WIP170310
parent
4624fa0903
commit
beb88f1b8d
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
<properties>
|
||||
<comment>missing translations</comment>
|
||||
<entry key="tooltip.synololog.einstellen">tooltip.synololog.einstellen</entry>
|
||||
<entry key="tooltip.export.list">tooltip.export.list</entry>
|
||||
<entry key="Zähler #31">Zähler #31</entry>
|
||||
<entry key="Zähler #30">Zähler #30</entry>
|
||||
<entry key="Export Einstellungen...">Export Einstellungen...</entry>
|
||||
<entry key="Export löschen">Export löschen</entry>
|
||||
<entry key="Anschlusseinstellungen">Anschlusseinstellungen</entry>
|
||||
<entry key="tooltip.daten.exportieren"><html>\n<b>Daten exportieren</b><br/>\n<br/>\nExport definitionen bearbeiten und ausführen.<br/>\nHiermit können die Aufzeichnungsdaten in Textdateien exportiert werden.<br/>\n</html></entry>
|
||||
<entry key="Gerät">Gerät</entry>
|
||||
<entry key="tooltip.export.run">tooltip.export.run</entry>
|
||||
<entry key="Einstellungen">Einstellungen</entry>
|
||||
<entry key="Zeitstempel">Zeitstempel</entry>
|
||||
<entry key="Zähler #29">Zähler #29</entry>
|
||||
<entry key="Zähler #28">Zähler #28</entry>
|
||||
<entry key="Zähler #27">Zähler #27</entry>
|
||||
<entry key="Zähler #26">Zähler #26</entry>
|
||||
<entry key="Zähler #25">Zähler #25</entry>
|
||||
<entry key="Zähler #24">Zähler #24</entry>
|
||||
<entry key="Automatiklauf">Automatiklauf</entry>
|
||||
<entry key="Zähler #23">Zähler #23</entry>
|
||||
<entry key="Zähler #22">Zähler #22</entry>
|
||||
<entry key="Zähler #21">Zähler #21</entry>
|
||||
<entry key="tooltip.export.configuration">tooltip.export.configuration</entry>
|
||||
<entry key="Zähler #20">Zähler #20</entry>
|
||||
<entry key="Skripte">Skripte...</entry>
|
||||
<entry key="HW-Index">HW-Index</entry>
|
||||
<entry key="Verzeichnis">Verzeichnis</entry>
|
||||
<entry key="Dateiname">Dateiname</entry>
|
||||
<entry key="Synololog einstellen">Synololog einstellen</entry>
|
||||
<entry key="Cancel">abbrechen</entry>
|
||||
<entry key="Zähler #9">Zähler #9</entry>
|
||||
<entry key="Zähler #8">Zähler #8</entry>
|
||||
<entry key="Zähler #7">Zähler #7</entry>
|
||||
<entry key="Zähler #6">Zähler #6</entry>
|
||||
<entry key="Zähler #5">Zähler #5</entry>
|
||||
<entry key="Verbindung">Verbindung</entry>
|
||||
<entry key="Zähler #4">Zähler #4</entry>
|
||||
<entry key="Zähler #19">Zähler #19</entry>
|
||||
<entry key="Zähler #3">Zähler #3</entry>
|
||||
<entry key="Export hinzufügen">Export hinzufügen</entry>
|
||||
<entry key="Zähler #18">Zähler #18</entry>
|
||||
<entry key="Zähler #2">Zähler #2</entry>
|
||||
<entry key="Auslöser">Auslöser</entry>
|
||||
<entry key="Zähler #17">Zähler #17</entry>
|
||||
<entry key="Meldungen">Meldungen</entry>
|
||||
<entry key="Zähler #1">Zähler #1</entry>
|
||||
<entry key="Zähler #16">Zähler #16</entry>
|
||||
<entry key="Zähler #0">Zähler #0</entry>
|
||||
<entry key="Zähler #15">Zähler #15</entry>
|
||||
<entry key="Zähler #14">Zähler #14</entry>
|
||||
<entry key="Zähler #13">Zähler #13</entry>
|
||||
<entry key="Zähler #12">Zähler #12</entry>
|
||||
<entry key="Export ausführen">Export ausführen</entry>
|
||||
<entry key="Zähler #11">Zähler #11</entry>
|
||||
<entry key="Zähler #10">Zähler #10</entry>
|
||||
<entry key="Daten exportieren">Daten exportieren</entry>
|
||||
<entry key="schliessen">schliessen</entry>
|
||||
<entry key="Differenzieren">Differenzieren</entry>
|
||||
<entry key="Aufgezeichnete Werte verwalten">Aufgezeichnete Werte verwalten</entry>
|
||||
<entry key="tooltip.export.add">tooltip.export.add</entry>
|
||||
<entry key="Autostart">Autostart</entry>
|
||||
<entry key="tooltip.export.remove">tooltip.export.remove</entry>
|
||||
<entry key="Benennung">Benennung</entry>
|
||||
<entry key="Aufzeichnungen verwalten">Aufzeichnungen bearbeiten</entry>
|
||||
</properties>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
<properties>
|
||||
<comment>missing translations</comment>
|
||||
<entry key="Skripte">Scripts...</entry>
|
||||
<entry key="Cancel">cancel</entry>
|
||||
</properties>
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
<properties>
|
||||
<comment>missing translations</comment>
|
||||
<entry key="von Zähler holen....">von Zähler holen....</entry>
|
||||
<entry key="SnapShot Speicher zurücksetzen">SnapShot Speicher zurücksetzen</entry>
|
||||
<entry key="tooltip.synololog.einstellen">tooltip.synololog.einstellen</entry>
|
||||
<entry key="Operation">Operation</entry>
|
||||
<entry key="Z">Z</entry>
|
||||
<entry key="Von Gerät %s geholt am %s">Von Gerät %s geholt am %s</entry>
|
||||
<entry key="Inkrement">Inkrement</entry>
|
||||
<entry key="ARITHEMTIK = B + 1">ARITHEMTIK = B + 1</entry>
|
||||
<entry key="Bezeichnung:">Bezeichnung:</entry>
|
||||
<entry key="Bedingung">Bedingung</entry>
|
||||
<entry key="Anschlusseinstellungen">Anschlusseinstellungen</entry>
|
||||
<entry key="Ausgang">Ausgang</entry>
|
||||
<entry key="tooltip.daten.exportieren">tooltip.daten.exportieren</entry>
|
||||
<entry key="Bezeichnung">Bezeichnung</entry>
|
||||
<entry key="Intervall 1:">Intervall 1:</entry>
|
||||
<entry key="Signalfenster">Signalfenster</entry>
|
||||
<entry key="Es konnte kein Skript vom gerät empfangen werden.">Es konnte kein Skript vom gerät empfangen werden.</entry>
|
||||
<entry key="name">name</entry>
|
||||
<entry key="Skript bearbeiten">Skript bearbeiten</entry>
|
||||
<entry key="B">B</entry>
|
||||
<entry key="A != 0">A != 0</entry>
|
||||
<entry key="A">A</entry>
|
||||
<entry key="Signalfilter">Signalfilter</entry>
|
||||
<entry key="neu...">neu...</entry>
|
||||
<entry key="Der Selbsttest für Zähler #%d war erfolgreich.">Der Selbsttest für Zähler #%d war erfolgreich.</entry>
|
||||
<entry key="Wählen Sie die Schnittstelle über die das Skript empfangen werden soll.">Wählen Sie die Schnittstelle über die das Skript empfangen werden soll.</entry>
|
||||
<entry key="Intervall 1 basiert auf Tageszeit">Intervall 1 basiert auf Tageszeit</entry>
|
||||
<entry key="Beschreibung:">Beschreibung:</entry>
|
||||
<entry key="Intervall 0 basiert auf Tageszeit">Intervall 0 basiert auf Tageszeit</entry>
|
||||
<entry key="Intervall 3 basiert auf Tageszeit">Intervall 3 basiert auf Tageszeit</entry>
|
||||
<entry key="Intervall 2 basiert auf Tageszeit">Intervall 2 basiert auf Tageszeit</entry>
|
||||
<entry key="warning.title.selftest">warning.title.selftest</entry>
|
||||
<entry key="ARITHEMTIK = B">ARITHEMTIK = B</entry>
|
||||
<entry key="ARITHEMTIK = A">ARITHEMTIK = A</entry>
|
||||
<entry key="OK">OK</entry>
|
||||
<entry key="Alle Zähler zurücksetzen">Alle Zähler zurücksetzen</entry>
|
||||
<entry key="Skripte">Skripte</entry>
|
||||
<entry key="Wählen Sie die Schnittstelle über die das Skript übertragen werden soll.">Wählen Sie die Schnittstelle über die das Skript übertragen werden soll.</entry>
|
||||
<entry key="tooltip.intervall">tooltip.intervall</entry>
|
||||
<entry key="Wollen Sie wirklich alle Zählerstände auf 0 zurücksetzen?">Wollen Sie wirklich alle Zählerstände auf 0 zurücksetzen?</entry>
|
||||
<entry key="Tageszeitabhängigkeit:">Tageszeitabhängigkeit:</entry>
|
||||
<entry key="Synololog einstellen">Synololog einstellen</entry>
|
||||
<entry key="Intervall 0:">Intervall 0:</entry>
|
||||
<entry key="Invertiert">Invertiert</entry>
|
||||
<entry key="Intervall 3:">Intervall 3:</entry>
|
||||
<entry key="ARITHEMTIK = 0">ARITHEMTIK = 0</entry>
|
||||
<entry key="Löst Snapshot aus">Löst Snapshot aus</entry>
|
||||
<entry key="bearbeiten...">bearbeiten...</entry>
|
||||
<entry key="auf Zähler übertragen....">auf Zähler übertragen....</entry>
|
||||
<entry key="Nur nach Rücksprache mit Support:">Nur nach Rücksprache mit Support:</entry>
|
||||
<entry key="Verbindung">Verbindung</entry>
|
||||
<entry key="Passiver Schalter">Passiver Schalter</entry>
|
||||
<entry key="Meldungen">Meldungen</entry>
|
||||
<entry key="tooltip.tagesbasierte.intervalle">tooltip.tagesbasierte.intervalle</entry>
|
||||
<entry key="Kanal">Kanal</entry>
|
||||
<entry key="warning.selftest">warning.selftest</entry>
|
||||
<entry key="Daten exportieren">Daten exportieren</entry>
|
||||
<entry key="Der Selbsttest für Zähler #%d ist fehlgeschlagen.">Der Selbsttest für Zähler #%d ist fehlgeschlagen.</entry>
|
||||
<entry key="A == 0">A == 0</entry>
|
||||
<entry key="SnapShot Speicher auf letzten bekannten SnapShot setzen">SnapShot Speicher auf letzten bekannten SnapShot setzen</entry>
|
||||
<entry key="entfernen">entfernen</entry>
|
||||
<entry key="Intervall 2:">Intervall 2:</entry>
|
||||
<entry key="Formeln">Formeln</entry>
|
||||
<entry key="Schnittstelle wählen...">Schnittstelle wählen...</entry>
|
||||
<entry key="Alle Zählerstände zurücksetzen">Alle Zählerstände zurücksetzen</entry>
|
||||
<entry key="Aufzeichnungen verwalten">Aufzeichnungen verwalten</entry>
|
||||
<entry key="Immer">Immer</entry>
|
||||
</properties>
|
|
@ -3,12 +3,15 @@ package org.hwo.pulscounter;
|
|||
import static org.hwo.logging.Logging.log;
|
||||
|
||||
import org.hwo.logging.LogLevel;
|
||||
import org.hwo.logging.Logging;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
PulsCounterApplication application = new PulsCounterApplication(args);
|
||||
|
||||
Logging.getInstance().setLimitLogLevel(50);
|
||||
|
||||
log(LogLevel.INFO,"Application initialized, starting up user interface");
|
||||
|
||||
application.start();
|
||||
|
|
|
@ -0,0 +1,237 @@
|
|||
package org.hwo.pulscounter;
|
||||
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.pulscounter.device.IDeviceConnector;
|
||||
import static org.hwo.logging.Logging.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.hwo.logging.LogLevel.*;
|
||||
|
||||
public class DeviceTester extends Thread{
|
||||
|
||||
private IDeviceConnector device;
|
||||
|
||||
public DeviceTester(IDeviceConnector device){
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
prepare();
|
||||
|
||||
if (fullTest()){
|
||||
PulsCounterApplication.getApplication().message(String.format(
|
||||
Messages.getString("Der Selbsttest für Zähler #%d war erfolgreich."),
|
||||
device.getDeviceSerial()
|
||||
));
|
||||
} else {
|
||||
PulsCounterApplication.getApplication().message(String.format(
|
||||
Messages.getString("Der Selbsttest für Zähler #%d ist fehlgeschlagen."),
|
||||
device.getDeviceSerial()
|
||||
));
|
||||
}
|
||||
|
||||
unprepare();
|
||||
}
|
||||
|
||||
private void sleep(int ms){
|
||||
try {
|
||||
Thread.sleep(ms);
|
||||
} catch (InterruptedException e){
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean fullTest(){
|
||||
|
||||
if (!setIncrements(1))
|
||||
return false;
|
||||
|
||||
if (!setPullups(false))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
if (!setOutputs(false))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
if (!setInverts(false))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
if (!setCounters(999999))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
if (!setCounters(0))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
|
||||
for (int i=0;i<10;i++){
|
||||
if (!setInverts(true))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
if (!setInverts(false))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
}
|
||||
|
||||
if (!checkCounters(10))
|
||||
return false;
|
||||
|
||||
for (int i=0;i<10;i++){
|
||||
if (!setPullups(true))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
if (!setPullups(false))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
}
|
||||
|
||||
if (!checkCounters(20))
|
||||
return false;
|
||||
|
||||
if (!setPullups(true))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
for (int i=0;i<10;i++){
|
||||
if (!setOutputs(true))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
if (!setOutputs(false))
|
||||
return false;
|
||||
|
||||
sleep( 50 );
|
||||
|
||||
}
|
||||
|
||||
if (!checkCounters(30))
|
||||
return false;
|
||||
|
||||
if (!setPullups(false))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void prepare(){
|
||||
device.escape(IDeviceConnector.ESC_PREPARE_DEVICETEST, 0);
|
||||
try {
|
||||
Thread.sleep(250);
|
||||
} catch (InterruptedException e){
|
||||
log(e);
|
||||
}
|
||||
|
||||
}
|
||||
public void unprepare(){
|
||||
device.escape(IDeviceConnector.ESC_UNPREPARE_DEVICETEST, 0);
|
||||
}
|
||||
|
||||
public boolean setPullups(boolean on){
|
||||
int set,act;
|
||||
|
||||
set = on ? 0xFFFFFFFF : 0;
|
||||
device.setPullups(set);
|
||||
act = device.getPullups();
|
||||
|
||||
log(INFO,"setPullups(%s): Result: %s",on,(act==set));
|
||||
return (set == act);
|
||||
}
|
||||
|
||||
public boolean setOutputs(boolean on){
|
||||
int set,act;
|
||||
|
||||
set = on ? 0xFFFFFFFF : 0;
|
||||
device.setOutputs(set);
|
||||
act = device.getOutputs();
|
||||
|
||||
log(INFO,"setOutputs(%s): Result: %s",on,(act==set));
|
||||
return (set == act);
|
||||
}
|
||||
|
||||
public boolean setInverts(boolean on){
|
||||
int set,act;
|
||||
|
||||
set = on ? 0xFFFFFFFF : 0;
|
||||
device.setInverts(set);
|
||||
act = device.getInverts();
|
||||
|
||||
log(INFO,"setInverts(%s): Result: %s",on,(act==set));
|
||||
return (set == act);
|
||||
}
|
||||
|
||||
public boolean setCounters(int set){
|
||||
boolean success = true;
|
||||
int[] _set = new int[32];
|
||||
int[] _act = new int[32];
|
||||
|
||||
Arrays.fill(_set, set);
|
||||
device.setCounters(_set);
|
||||
_act = device.getCounters();
|
||||
|
||||
for (int i=0;i<32;i++){
|
||||
if (_set[i] != _act[i]){
|
||||
success = false;
|
||||
log(INFO,"Setting Channel Counter %d failed",i);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
public boolean setIncrements(int set){
|
||||
boolean success = true;
|
||||
int[] _set = new int[32];
|
||||
int[] _act = new int[32];
|
||||
|
||||
Arrays.fill(_set, set);
|
||||
device.setIncrements(_set);
|
||||
_act = device.getIncrements();
|
||||
|
||||
for (int i=0;i<32;i++){
|
||||
if (_set[i] != _act[i]){
|
||||
success = false;
|
||||
log(INFO,"Setting Channel Counter Increment %d failed",i);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
public boolean checkCounters(int check){
|
||||
boolean success = true;
|
||||
int[] _check = new int[32];
|
||||
int[] _act = new int[32];
|
||||
|
||||
Arrays.fill(_check, check);
|
||||
_act = device.getCounters();
|
||||
|
||||
for (int i=0;i<32;i++){
|
||||
if (_check[i] != _act[i]){
|
||||
success = false;
|
||||
log(INFO,"Check Channel Counter %d failed (0x%08x != 0x%08x)",i,check,_act[i]);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -152,8 +152,8 @@ public class ExportSetting {
|
|||
|
||||
int[] simpleSelection = new int[]{
|
||||
1,
|
||||
4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,
|
||||
34,35,36,37,38,39,40,41
|
||||
4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,
|
||||
36,37,38,39,40,41,42,43
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ import org.hwo.io.SerialPort;
|
|||
import org.hwo.io.SerialPortExeption;
|
||||
import org.hwo.io.NewSerialPort.NewSerialPort;
|
||||
import org.hwo.servicelink.ServiceLink;
|
||||
import org.hwo.servicelink.ServiceLinkException;
|
||||
import org.hwo.servicelink.ServiceLinkRequestFailedException;
|
||||
import org.hwo.servicelink.exceptions.ServiceLinkException;
|
||||
import org.hwo.servicelink.exceptions.ServiceLinkRequestFailedException;
|
||||
|
||||
public class NewPulsCounterDevice implements IPulsCounter {
|
||||
private ServiceLink serviceLink;
|
||||
|
|
|
@ -28,6 +28,7 @@ import javax.swing.JFrame;
|
|||
import org.hsqldb.persist.EventLogInterface;
|
||||
import org.hwo.StringHelper;
|
||||
import org.hwo.configuration.ConfigurableObjects;
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.io.NewSerialPort.NewSerialPort;
|
||||
import org.hwo.logging.Logging;
|
||||
import org.hwo.platform.Platform;
|
||||
|
@ -60,6 +61,8 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
private boolean uiIsFinished;
|
||||
private boolean shouldSaveConfiguration;
|
||||
|
||||
private boolean dontLoadTranslations;
|
||||
|
||||
private List<PulsCounterApplicationListener>
|
||||
applicationListeners;
|
||||
|
||||
|
@ -113,6 +116,10 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
|
||||
batchCommands = new ArrayList<>();
|
||||
|
||||
/* Prepare Translation Framework */
|
||||
Messages i18n = Messages.getInstance();
|
||||
i18n.setMissingKeysFileName("missing-translation.txt");
|
||||
|
||||
/* Prepare for Startup */
|
||||
loadApplicationConfiguration();
|
||||
|
||||
|
@ -140,13 +147,20 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
break;
|
||||
case "--batch-execute":
|
||||
batchCommands.add( options.next() );
|
||||
break;
|
||||
case "--no-translation":
|
||||
dontLoadTranslations = true;
|
||||
break;
|
||||
default:
|
||||
log(WARN,"Unknown command line parameter: %s", option);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!dontLoadTranslations){
|
||||
Messages.loadMessages(PulsCounterApplication.class);
|
||||
} else {
|
||||
log(INFO,"Translation text fragments are NOT loaded, due to command line switch (--no-translation)");
|
||||
}
|
||||
|
||||
/* Old stuff... */
|
||||
// this.initialize();
|
||||
|
@ -319,6 +333,11 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
|
||||
log(INFO,"Application shutdown...");
|
||||
|
||||
for (IDeviceConnector c: interfaces){
|
||||
c.shutdown();
|
||||
}
|
||||
|
||||
|
||||
/* Dispose all left frames */
|
||||
for (Frame frame: JFrame.getFrames()){
|
||||
frame.setVisible(false);
|
||||
|
@ -362,6 +381,7 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
|
||||
database.close();
|
||||
|
||||
Messages.getInstance().saveMissingStrings();
|
||||
|
||||
}
|
||||
|
||||
|
@ -508,6 +528,7 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
|
||||
|
||||
public void message(String message){
|
||||
log(INFO, message);
|
||||
|
||||
if (applicationListeners.size() == 0){
|
||||
unseenMessages.addElement(message);
|
||||
|
@ -521,7 +542,7 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
|
||||
for (PulsCounterApplicationListener listener: applicationListeners){
|
||||
listener.messageArrived(message);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.UUID;
|
|||
import org.hwo.csv.CSVRecord;
|
||||
import org.hwo.models.TableMapper.TableColumn;
|
||||
import org.hwo.servicelink.ServiceLink;
|
||||
import org.hwo.servicelink.ServiceLinkException;
|
||||
import org.hwo.servicelink.exceptions.ServiceLinkException;
|
||||
import org.hwo.ui.diagram.annotation.Plot;
|
||||
|
||||
public class SnapShot {
|
||||
|
|
|
@ -112,8 +112,7 @@ public class PulsCounterDatabase {
|
|||
|
||||
} catch (SQLException e) {
|
||||
log(ERROR,"SQL Statement failed: %s",query);
|
||||
log(ERROR,"Exception: %s", e.toString());
|
||||
e.printStackTrace();
|
||||
log(e);
|
||||
if (e.getCause() != null){
|
||||
log(ERROR,"Caused-By: %s",e.getCause().toString());
|
||||
e.getCause().printStackTrace();
|
||||
|
@ -133,7 +132,7 @@ public class PulsCounterDatabase {
|
|||
}
|
||||
} catch (SQLException e) {
|
||||
log(ERROR,"SQL Statement failed: %s",query);
|
||||
log(ERROR,"Exception: %s", e.toString());
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -148,7 +147,7 @@ public class PulsCounterDatabase {
|
|||
}
|
||||
} catch (SQLException e) {
|
||||
log(ERROR,"SQL Statement failed: %s",query);
|
||||
log(ERROR,"Exception: %s", e.toString());
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -5,10 +5,13 @@ import java.awt.Component;
|
|||
import org.hwo.pulscounter.SnapShot;
|
||||
|
||||
public interface IDeviceConnector {
|
||||
public static int ESC_PREPARE_DEVICETEST = 0x00000001;
|
||||
public static int ESC_UNPREPARE_DEVICETEST = 0x00000002;
|
||||
|
||||
public static int ESC_DEBUG_MASK = 0xFFFF0000;
|
||||
public static int ESC_DEBUG_SCHEDULER_BUG = 0x00010000;
|
||||
|
||||
|
||||
public Integer getDeviceSerial();
|
||||
|
||||
public boolean showConnctionSetup(Component parent);
|
||||
|
@ -72,4 +75,6 @@ public interface IDeviceConnector {
|
|||
|
||||
public void syncConfigToLive();
|
||||
|
||||
public void shutdown();
|
||||
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ import org.hwo.pulscounter.SnapShot;
|
|||
import org.hwo.pulscounter.simplescript.SimpleScript.SimpleScriptElement;
|
||||
import org.hwo.pulscounter.ui.DeviceConfiguration;
|
||||
import org.hwo.servicelink.ServiceLink;
|
||||
import org.hwo.servicelink.ServiceLinkException;
|
||||
import org.hwo.servicelink.ServiceLinkRequestFailedException;
|
||||
import org.hwo.servicelink.exceptions.*;
|
||||
import org.hwo.ui.dialog.SerialPortChooser;
|
||||
import static org.hwo.logging.Logging.*;
|
||||
import static org.hwo.logging.LogLevel.*;
|
||||
|
@ -168,7 +167,7 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
|
||||
log(DEBUG,"%d ScriptElements on Device.",l);
|
||||
|
||||
if (l<0)
|
||||
if (l<=0)
|
||||
return new int[0];
|
||||
|
||||
int[] script = new int[l];
|
||||
|
@ -785,6 +784,15 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
}
|
||||
|
||||
return 0;
|
||||
case ESC_PREPARE_DEVICETEST:
|
||||
log(DEBUG,"Prepare Device for testing.");
|
||||
serviceLink.setForceSynchronousRequests(true);
|
||||
return 0;
|
||||
case ESC_UNPREPARE_DEVICETEST:
|
||||
log(DEBUG,"Un-Prepare Device after testing.");
|
||||
serviceLink.setForceSynchronousRequests(false);
|
||||
return 0;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -831,5 +839,10 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
} catch (IOException | ServiceLinkException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
serviceLink.close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -300,4 +300,7 @@ public class SimulatedCounter implements IDeviceConnector {
|
|||
public void setIncrements(int[] triggers) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.models.TableMapper.TableColumn;
|
||||
|
||||
public class SimpleScript {
|
||||
|
@ -181,12 +182,12 @@ public class SimpleScript {
|
|||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
return Messages.getString(desc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return desc;
|
||||
return Messages.getString(desc);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -230,12 +231,12 @@ public class SimpleScript {
|
|||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
return Messages.getString(desc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return desc;
|
||||
return Messages.getString(desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,7 +265,7 @@ public class SimpleScript {
|
|||
this.code = code;
|
||||
}
|
||||
|
||||
@TableColumn(label="A",order=0)
|
||||
@TableColumn(label="A",order=0,width=120)
|
||||
public String getHumanA(){
|
||||
return SimpleScriptAddress.toString(getA());
|
||||
}
|
||||
|
@ -273,7 +274,7 @@ public class SimpleScript {
|
|||
return code & 0xff;
|
||||
}
|
||||
|
||||
@TableColumn(label="B",order=10)
|
||||
@TableColumn(label="B",order=10,width=120)
|
||||
public String getHumanB(){
|
||||
return SimpleScriptAddress.toString(getB());
|
||||
}
|
||||
|
@ -282,7 +283,7 @@ public class SimpleScript {
|
|||
return (code >> 8) & 0xff;
|
||||
}
|
||||
|
||||
@TableColumn(label="Z",order=90)
|
||||
@TableColumn(label="Z",order=90,width=120)
|
||||
public String getHumanZ(){
|
||||
return SimpleScriptAddress.toString(getZ());
|
||||
}
|
||||
|
@ -319,7 +320,7 @@ public class SimpleScript {
|
|||
code |= (operation & 0x1F) << 27;
|
||||
}
|
||||
|
||||
@TableColumn(label="Operation",order=50)
|
||||
@TableColumn(label="Operation",order=50,width=140)
|
||||
public ScriptOperation getScriptOperation(){
|
||||
return ScriptOperation.get(getOperation());
|
||||
}
|
||||
|
@ -331,7 +332,7 @@ public class SimpleScript {
|
|||
}
|
||||
}
|
||||
|
||||
@TableColumn(label="Bedingung",order=40)
|
||||
@TableColumn(label="Bedingung",order=40,width=120)
|
||||
public ScriptCondition getScriptCondition(){
|
||||
return ScriptCondition.get(getCondition());
|
||||
}
|
||||
|
|
|
@ -29,8 +29,7 @@ import org.hwo.io.NewSerialPort.NewSerialPort;
|
|||
import org.hwo.pulscounter.PulsCounterApplication;
|
||||
import org.hwo.pulscounter.SnapShot;
|
||||
import org.hwo.servicelink.ServiceLink;
|
||||
import org.hwo.servicelink.ServiceLinkException;
|
||||
import org.hwo.servicelink.ServiceLinkRequestFailedException;
|
||||
import org.hwo.servicelink.exceptions.*;
|
||||
import org.hwo.ui.dialog.SerialPortChooser;
|
||||
|
||||
import java.awt.event.ActionListener;
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.hwo.pulscounter.ui;
|
|||
import org.hwo.pulscounter.ExportSetting;
|
||||
import org.hwo.pulscounter.PulsCounterApplication;
|
||||
import org.hwo.pulscounter.PulsCounterApplicationListener;
|
||||
import org.hwo.servicelink.ServiceLinkException;
|
||||
import org.hwo.servicelink.exceptions.*;
|
||||
import static org.hwo.logging.Logging.*;
|
||||
import static org.hwo.logging.LogLevel.*;
|
||||
|
||||
|
|
|
@ -12,8 +12,7 @@ import javax.swing.event.ChangeListener;
|
|||
import org.hwo.pulscounter.PulsCounterApplication;
|
||||
import org.hwo.pulscounter.device.IDeviceConnector;
|
||||
import org.hwo.servicelink.ServiceLink;
|
||||
import org.hwo.servicelink.ServiceLinkException;
|
||||
import org.hwo.servicelink.ServiceLinkRequestFailedException;
|
||||
import org.hwo.servicelink.exceptions.*;
|
||||
|
||||
import java.awt.GridLayout;
|
||||
import javax.swing.JTabbedPane;
|
||||
|
@ -41,6 +40,7 @@ import javax.swing.JButton;
|
|||
import org.hwo.bitfields.BitField;
|
||||
import org.hwo.bitfields.Field;
|
||||
import org.hwo.bitfields.ui.BitFieldEditor;
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.models.TableMapper.TableColumn;
|
||||
import org.hwo.models.TableMapper.TableMapper;
|
||||
import org.hwo.ui.JTimeSpanEditor;
|
||||
|
@ -119,7 +119,7 @@ public class DeviceConfiguration extends JDialog {
|
|||
panel_2.setLayout(gbl_panel_2);
|
||||
|
||||
bfeIntervall = new BitFieldEditor();
|
||||
bfeIntervall.setToolTipText("<html>\n<b>Tagesbasierte Intervalle</b><br/>\n<br/>\nTagesbasierte Intervalle werden immer auf 0:00:00 Uhr des aktuellen Tages bezogen ausgeführt.<br/>\nDies ermöglicht nicht nur eine Regelmäßige Aufzeichnung, sondern erzwingt auch eine Aufzeichnung<br/>\nin einem festgelegten immer gleichen Raster.<br/>\n<br/>\nNicht tageszeitbasierte Intervalle werden mit Bezug auf den 1.1.1970 0:00:00 Uhr ausgeführt.<br/>\nDiese ermöglichen eine stete regelmäßige Aufzeichnung bei der die tageszeit ignoriert wird.\n</html>");
|
||||
bfeIntervall.setToolTipText(Messages.getString("tooltip.tagesbasierte.intervalle")); //"<html>\n<b>Tagesbasierte Intervalle</b><br/>\n<br/>\nTagesbasierte Intervalle werden immer auf 0:00:00 Uhr des aktuellen Tages bezogen ausgeführt.<br/>\nDies ermöglicht nicht nur eine Regelmäßige Aufzeichnung, sondern erzwingt auch eine Aufzeichnung<br/>\nin einem festgelegten immer gleichen Raster.<br/>\n<br/>\nNicht tageszeitbasierte Intervalle werden mit Bezug auf den 1.1.1970 0:00:00 Uhr ausgeführt.<br/>\nDiese ermöglichen eine stete regelmäßige Aufzeichnung bei der die tageszeit ignoriert wird.\n</html>");
|
||||
bfeIntervall.addChangeListener(new ChangeListener() {
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
int v = bfeIntervall.getIntValue();
|
||||
|
@ -130,7 +130,7 @@ public class DeviceConfiguration extends JDialog {
|
|||
}
|
||||
});
|
||||
|
||||
JLabel lblTageszeitabhngigkeit = new JLabel("Tageszeitabhängigkeit:");
|
||||
JLabel lblTageszeitabhngigkeit = new JLabel(Messages.getString("Tageszeitabhängigkeit:"));
|
||||
GridBagConstraints gbc_lblTageszeitabhngigkeit = new GridBagConstraints();
|
||||
gbc_lblTageszeitabhngigkeit.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblTageszeitabhngigkeit.insets = new Insets(0, 0, 5, 5);
|
||||
|
@ -145,8 +145,8 @@ public class DeviceConfiguration extends JDialog {
|
|||
gbc_bfeIntervall.gridy = 0;
|
||||
panel_2.add(bfeIntervall, gbc_bfeIntervall);
|
||||
|
||||
JLabel lblIntervall = new JLabel("Intervall 0:");
|
||||
lblIntervall.setToolTipText("<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
JLabel lblIntervall = new JLabel(Messages.getString("Intervall 0:"));
|
||||
lblIntervall.setToolTipText(Messages.getString("tooltip.intervall")); // "<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
GridBagConstraints gbc_lblIntervall = new GridBagConstraints();
|
||||
gbc_lblIntervall.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblIntervall.insets = new Insets(0, 0, 5, 5);
|
||||
|
@ -155,7 +155,7 @@ public class DeviceConfiguration extends JDialog {
|
|||
panel_2.add(lblIntervall, gbc_lblIntervall);
|
||||
|
||||
tseI0 = new JTimeSpanEditor();
|
||||
tseI0.setToolTipText("<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
tseI0.setToolTipText(Messages.getString("tooltip.intervall"));
|
||||
tseI0.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
|
@ -168,8 +168,8 @@ public class DeviceConfiguration extends JDialog {
|
|||
gbc_tseI0.gridy = 1;
|
||||
panel_2.add(tseI0, gbc_tseI0);
|
||||
|
||||
JLabel lblIntervall_1 = new JLabel("Intervall 1:");
|
||||
lblIntervall_1.setToolTipText("<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
JLabel lblIntervall_1 = new JLabel(Messages.getString("Intervall 1:"));
|
||||
lblIntervall_1.setToolTipText(Messages.getString("tooltip.intervall"));
|
||||
GridBagConstraints gbc_lblIntervall_1 = new GridBagConstraints();
|
||||
gbc_lblIntervall_1.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblIntervall_1.insets = new Insets(0, 0, 5, 5);
|
||||
|
@ -178,7 +178,7 @@ public class DeviceConfiguration extends JDialog {
|
|||
panel_2.add(lblIntervall_1, gbc_lblIntervall_1);
|
||||
|
||||
tseI1 = new JTimeSpanEditor();
|
||||
tseI1.setToolTipText("<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
tseI1.setToolTipText(Messages.getString("tooltip.intervall"));
|
||||
tseI1.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
|
@ -191,8 +191,8 @@ public class DeviceConfiguration extends JDialog {
|
|||
gbc_tseI1.gridy = 2;
|
||||
panel_2.add(tseI1, gbc_tseI1);
|
||||
|
||||
JLabel lblIntervall_2 = new JLabel("Intervall 2:");
|
||||
lblIntervall_2.setToolTipText("<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
JLabel lblIntervall_2 = new JLabel(Messages.getString("Intervall 2:"));
|
||||
lblIntervall_2.setToolTipText(Messages.getString("tooltip.intervall"));
|
||||
GridBagConstraints gbc_lblIntervall_2 = new GridBagConstraints();
|
||||
gbc_lblIntervall_2.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblIntervall_2.insets = new Insets(0, 0, 5, 5);
|
||||
|
@ -201,7 +201,7 @@ public class DeviceConfiguration extends JDialog {
|
|||
panel_2.add(lblIntervall_2, gbc_lblIntervall_2);
|
||||
|
||||
tseI2 = new JTimeSpanEditor();
|
||||
tseI2.setToolTipText("<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
tseI2.setToolTipText(Messages.getString("tooltip.intervall"));
|
||||
tseI2.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
|
@ -214,8 +214,8 @@ public class DeviceConfiguration extends JDialog {
|
|||
gbc_tseI2.gridy = 3;
|
||||
panel_2.add(tseI2, gbc_tseI2);
|
||||
|
||||
JLabel lblIntervall_3 = new JLabel("Intervall 3:");
|
||||
lblIntervall_3.setToolTipText("<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
JLabel lblIntervall_3 = new JLabel(Messages.getString("Intervall 3:"));
|
||||
lblIntervall_3.setToolTipText(Messages.getString("tooltip.intervall"));
|
||||
GridBagConstraints gbc_lblIntervall_3 = new GridBagConstraints();
|
||||
gbc_lblIntervall_3.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblIntervall_3.insets = new Insets(0, 0, 5, 5);
|
||||
|
@ -224,7 +224,7 @@ public class DeviceConfiguration extends JDialog {
|
|||
panel_2.add(lblIntervall_3, gbc_lblIntervall_3);
|
||||
|
||||
tseI3 = new JTimeSpanEditor();
|
||||
tseI3.setToolTipText("<html>\n<b>Intervall</b><br/>\n<br/>\nStellen Sie die gewünschten Intervalllängen ein.<br/>\n<br/>\nEinheiten: <b>Tage, Stunden, Minuten, Sekunden</b>\n</html>");
|
||||
tseI3.setToolTipText(Messages.getString("tooltip.intervall"));
|
||||
tseI3.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
|
@ -268,7 +268,7 @@ public class DeviceConfiguration extends JDialog {
|
|||
gbl_pManagement.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
|
||||
pManagement.setLayout(gbl_pManagement);
|
||||
|
||||
btnAlleZhlerLschen = new JButton("Alle Zähler zurücksetzen");
|
||||
btnAlleZhlerLschen = new JButton(Messages.getString("Alle Zähler zurücksetzen"));
|
||||
btnAlleZhlerLschen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
resetCounters();
|
||||
|
@ -281,7 +281,7 @@ public class DeviceConfiguration extends JDialog {
|
|||
gbc_btnAlleZhlerLschen_1_1.insets = new Insets(0, 0, 5, 0);
|
||||
pManagement.add(btnAlleZhlerLschen, gbc_btnAlleZhlerLschen_1_1);
|
||||
|
||||
JLabel lblNurNachRcksprache = new JLabel("Nur nach Rücksprache mit Support:");
|
||||
JLabel lblNurNachRcksprache = new JLabel(Messages.getString("Nur nach Rücksprache mit Support:"));
|
||||
GridBagConstraints gbc_lblNurNachRcksprache = new GridBagConstraints();
|
||||
gbc_lblNurNachRcksprache.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblNurNachRcksprache.insets = new Insets(0, 0, 5, 0);
|
||||
|
@ -289,14 +289,14 @@ public class DeviceConfiguration extends JDialog {
|
|||
gbc_lblNurNachRcksprache.gridy = 1;
|
||||
pManagement.add(lblNurNachRcksprache, gbc_lblNurNachRcksprache);
|
||||
|
||||
btnSnapshotSpeicherZurcksetzen = new JButton("SnapShot Speicher zurücksetzen");
|
||||
btnSnapshotSpeicherZurcksetzen = new JButton(Messages.getString("SnapShot Speicher zurücksetzen"));
|
||||
btnSnapshotSpeicherZurcksetzen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
resetSnapShots();
|
||||
}
|
||||
});
|
||||
|
||||
btnSnapshotSpeicherAuf = new JButton("SnapShot Speicher auf letzten bekannten SnapShot setzen");
|
||||
btnSnapshotSpeicherAuf = new JButton(Messages.getString("SnapShot Speicher auf letzten bekannten SnapShot setzen"));
|
||||
btnSnapshotSpeicherAuf.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
resetSnapShots(true);
|
||||
|
@ -315,14 +315,14 @@ public class DeviceConfiguration extends JDialog {
|
|||
pManagement.add(btnSnapshotSpeicherZurcksetzen, gbc_btnSnapshotSpeicherZurcksetzen_1_1);
|
||||
|
||||
|
||||
JButton btnSchliessen = new JButton("abbrechen");
|
||||
JButton btnSchliessen = new JButton(Messages.getString("Cancel"));
|
||||
btnSchliessen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
|
||||
JButton btnOk = new JButton("OK");
|
||||
JButton btnOk = new JButton(Messages.getString("OK"));
|
||||
btnOk.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
writeDevice();
|
||||
|
@ -360,10 +360,10 @@ public class DeviceConfiguration extends JDialog {
|
|||
|
||||
BitField bf = new BitField();
|
||||
bf.clear();
|
||||
bf.addField(new Field(bf, 0, 1, "Intervall 0 basiert auf Tageszeit"));
|
||||
bf.addField(new Field(bf, 1, 1, "Intervall 1 basiert auf Tageszeit"));
|
||||
bf.addField(new Field(bf, 2, 1, "Intervall 2 basiert auf Tageszeit"));
|
||||
bf.addField(new Field(bf, 3, 1, "Intervall 3 basiert auf Tageszeit"));
|
||||
bf.addField(new Field(bf, 0, 1, Messages.getString("Intervall 0 basiert auf Tageszeit")));
|
||||
bf.addField(new Field(bf, 1, 1, Messages.getString("Intervall 1 basiert auf Tageszeit")));
|
||||
bf.addField(new Field(bf, 2, 1, Messages.getString("Intervall 2 basiert auf Tageszeit")));
|
||||
bf.addField(new Field(bf, 3, 1, Messages.getString("Intervall 3 basiert auf Tageszeit")));
|
||||
bfeIntervall.setBitField(bf);
|
||||
for (int i=0;i<32;i++){
|
||||
tmSettings.addRow(new ChannelConfiguration(i));
|
||||
|
@ -378,14 +378,20 @@ public class DeviceConfiguration extends JDialog {
|
|||
}
|
||||
|
||||
private void resetSnapShots(boolean toLastKnown){
|
||||
if (JOptionPane.showConfirmDialog(null, "<html>Diese Funktion sollte nur auf Aufforderung durch den Support ausgeführt werden.<br/>Soll der Snapshot Index auf dem Gerät wirklich zurückgesetzt werden?</html>", "Snapshot Index zurücksetzen", JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
|
||||
if (JOptionPane.showConfirmDialog(null,
|
||||
Messages.getString("<html>Diese Funktion sollte nur auf Aufforderung durch den Support ausgeführt werden.<br/>Soll der Snapshot Index auf dem Gerät wirklich zurückgesetzt werden?</html>"),
|
||||
Messages.getString("Snapshot Index zurücksetzen"),
|
||||
JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
|
||||
deviceConnector.reset(toLastKnown ? PulsCounterApplication.getApplication().getDatabase().highestSnapShot(deviceConnector.getDeviceSerial()) : -1);
|
||||
}
|
||||
}
|
||||
|
||||
private void resetCounters(){
|
||||
|
||||
if (JOptionPane.showConfirmDialog(null, "Wollen Sie wirklich alle Zählerstände auf 0 zurücksetzen?", "Alle Zählerstände zurücksetzen", JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
|
||||
if (JOptionPane.showConfirmDialog(null,
|
||||
Messages.getString("Wollen Sie wirklich alle Zählerstände auf 0 zurücksetzen?"),
|
||||
Messages.getString("Alle Zählerstände zurücksetzen"),
|
||||
JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
|
||||
int[] zero = new int[32];
|
||||
Arrays.fill(zero, 0);
|
||||
deviceConnector.setCounters(zero);
|
||||
|
|
|
@ -10,11 +10,12 @@ import javax.swing.border.EmptyBorder;
|
|||
import org.hwo.datetime.DateTime;
|
||||
import org.hwo.logging.Logging;
|
||||
import org.hwo.logging.LoggingListener;
|
||||
import org.hwo.pulscounter.DeviceTester;
|
||||
import org.hwo.pulscounter.PulsCounterApplication;
|
||||
import org.hwo.pulscounter.PulsCounterApplicationListener;
|
||||
import org.hwo.pulscounter.device.ServiceLinkDeviceConnector;
|
||||
import org.hwo.servicelink.ServiceLink;
|
||||
import org.hwo.servicelink.ServiceLinkException;
|
||||
import org.hwo.servicelink.exceptions.*;
|
||||
|
||||
import java.awt.GridBagLayout;
|
||||
import javax.swing.JLabel;
|
||||
|
@ -206,7 +207,7 @@ public class DeviceTestFrame extends JFrame implements LoggingListener{
|
|||
messageListModel = new DefaultListModel<String>();
|
||||
lMessages.setModel(messageListModel);
|
||||
|
||||
Logging.getInstance().addLoggingListener(this);
|
||||
// Logging.getInstance().addLoggingListener(this);
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
|
@ -246,6 +247,7 @@ public class DeviceTestFrame extends JFrame implements LoggingListener{
|
|||
*/
|
||||
|
||||
private void startTest(){
|
||||
/*
|
||||
if (this.deviceChecker != null){
|
||||
while (this.deviceChecker.isAlive()){
|
||||
try {
|
||||
|
@ -258,6 +260,20 @@ public class DeviceTestFrame extends JFrame implements LoggingListener{
|
|||
}
|
||||
this.deviceChecker = new DeviceChecker();
|
||||
this.deviceChecker.start();
|
||||
*/
|
||||
|
||||
DeviceTester dt = new DeviceTester( (application().getInterfaces().get(0)) );
|
||||
dt.start();
|
||||
|
||||
while (dt.isAlive()){
|
||||
try {
|
||||
dt.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -265,6 +281,9 @@ public class DeviceTestFrame extends JFrame implements LoggingListener{
|
|||
if (EventQueue.isDispatchThread()){
|
||||
int pos = messageListModel.size();
|
||||
messageListModel.addElement(message);
|
||||
if (messageListModel.getSize() > 32)
|
||||
messageListModel.remove(0);
|
||||
|
||||
lMessages.ensureIndexIsVisible(messageListModel.size()-1);
|
||||
} else {
|
||||
final String msg = message;
|
||||
|
|
|
@ -9,6 +9,7 @@ import javax.swing.border.EmptyBorder;
|
|||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.interactiveobjects.ObjectEditorUI;
|
||||
import org.hwo.interactiveobjects.ObjectEditorUIHelper;
|
||||
import org.hwo.models.TableMapper.TableMapper;
|
||||
|
@ -53,7 +54,7 @@ public class ExportFilesFrame extends JDialog {
|
|||
public ExportFilesFrame() {
|
||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||
|
||||
setTitle("Export Einstellungen...");
|
||||
setTitle(Messages.getString("Export Einstellungen..."));
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
setBounds(100, 100, 825, 433);
|
||||
contentPane = new JPanel();
|
||||
|
@ -76,8 +77,8 @@ public class ExportFilesFrame extends JDialog {
|
|||
gbc_toolBar.gridy = 0;
|
||||
contentPane.add(toolBar, gbc_toolBar);
|
||||
|
||||
bAdd = new JButton("Export hinzufügen");
|
||||
bAdd.setToolTipText("<html>\n<b>Neue Exportkonfiguration hinzufügen</b><br/>\n</html>");
|
||||
bAdd = new JButton(Messages.getString("Export hinzufügen"));
|
||||
bAdd.setToolTipText(Messages.getString("tooltip.export.add")); //"<html>\n<b>Neue Exportkonfiguration hinzufügen</b><br/>\n</html>");
|
||||
bAdd.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ExportSetting es = new ExportSetting();
|
||||
|
@ -86,8 +87,8 @@ public class ExportFilesFrame extends JDialog {
|
|||
});
|
||||
toolBar.add(bAdd);
|
||||
|
||||
bEdit = new JButton("Einstellungen");
|
||||
bEdit.setToolTipText("<html>\n<b>Ausgewählte Exportkonfiguration bearbeiten</b>\n</html>");
|
||||
bEdit = new JButton(Messages.getString("Einstellungen"));
|
||||
bEdit.setToolTipText(Messages.getString("tooltip.export.configuration")); // "<html>\n<b>Ausgewählte Exportkonfiguration bearbeiten</b>\n</html>");
|
||||
bEdit.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ExportSetting es = (ExportSetting)tmExportSettings.getSelectedRow();
|
||||
|
@ -101,8 +102,8 @@ public class ExportFilesFrame extends JDialog {
|
|||
bEdit.setEnabled(false);
|
||||
toolBar.add(bEdit);
|
||||
|
||||
bRemove = new JButton("Export löschen");
|
||||
bRemove.setToolTipText("<html>\n<b>Ausgewählte Exportkonfiguration entfernen</b>\n</html>");
|
||||
bRemove = new JButton(Messages.getString(Messages.getString("Export löschen")));
|
||||
bRemove.setToolTipText(Messages.getString("tooltip.export.remove")); // "<html>\n<b>Ausgewählte Exportkonfiguration entfernen</b>\n</html>");
|
||||
bRemove.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (selectedExportSetting != null){
|
||||
|
@ -117,8 +118,8 @@ public class ExportFilesFrame extends JDialog {
|
|||
separator = new JSeparator();
|
||||
toolBar.add(separator);
|
||||
|
||||
btnExec = new JButton("Export ausführen");
|
||||
btnExec.setToolTipText("<html>\n<b>Ausgewählte Exportkonfiguration jetzt ausführen</b><br/>\n</html>");
|
||||
btnExec = new JButton(Messages.getString("Export ausführen"));
|
||||
btnExec.setToolTipText(Messages.getString("tooltip.export.run")); //"<html>\n<b>Ausgewählte Exportkonfiguration jetzt ausführen</b><br/>\n</html>");
|
||||
btnExec.setEnabled(false);
|
||||
btnExec.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -127,7 +128,7 @@ public class ExportFilesFrame extends JDialog {
|
|||
});
|
||||
toolBar.add(btnExec);
|
||||
|
||||
btnBatch = new JButton("Automatik");
|
||||
btnBatch = new JButton(Messages.getString("Automatiklauf"));
|
||||
btnBatch.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
doBatchExport();
|
||||
|
@ -136,7 +137,7 @@ public class ExportFilesFrame extends JDialog {
|
|||
toolBar.add(btnBatch);
|
||||
|
||||
JScrollPane scrollPane = new JScrollPane();
|
||||
scrollPane.setToolTipText("<html>\n<b>Exportkonfigurationen</b><br/>\nZeigt eine Übersicht über die aktuell vorhandenen Exportkonfigurationen\n</html>");
|
||||
scrollPane.setToolTipText(Messages.getString("tooltip.export.list")); // "<html>\n<b>Exportkonfigurationen</b><br/>\nZeigt eine Übersicht über die aktuell vorhandenen Exportkonfigurationen\n</html>");
|
||||
GridBagConstraints gbc_scrollPane = new GridBagConstraints();
|
||||
gbc_scrollPane.gridwidth = 3;
|
||||
gbc_scrollPane.insets = new Insets(0, 0, 5, 0);
|
||||
|
@ -159,7 +160,7 @@ public class ExportFilesFrame extends JDialog {
|
|||
tmExportSettings.setRows(PulsCounterApplication.getApplication().getExportSettings());
|
||||
scrollPane.setViewportView(tExportSettings);
|
||||
|
||||
JButton btnSchliessen = new JButton("schliessen");
|
||||
JButton btnSchliessen = new JButton(Messages.getString("schliessen"));
|
||||
btnSchliessen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
setVisible(false);
|
||||
|
|
|
@ -14,17 +14,18 @@ import javax.swing.border.TitledBorder;
|
|||
|
||||
import org.hwo.Smoother;
|
||||
import org.hwo.datetime.DateTime;
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.io.NewSerialPort.NewSerialPort;
|
||||
import org.hwo.logging.Logging;
|
||||
import org.hwo.models.FlexibleObjectListModel;
|
||||
import org.hwo.platform.Platform;
|
||||
import org.hwo.pulscounter.DeviceTester;
|
||||
import org.hwo.pulscounter.PulsCounterApplication;
|
||||
import org.hwo.pulscounter.PulsCounterApplicationListener;
|
||||
import org.hwo.pulscounter.device.IDeviceConnector;
|
||||
import org.hwo.pulscounter.device.NoDeviceConnectionException;
|
||||
import org.hwo.pulscounter.device.ServiceLinkDeviceConnector;
|
||||
import org.hwo.servicelink.ServiceLinkException;
|
||||
import org.hwo.servicelink.ServiceLinkRequestFailedException;
|
||||
import org.hwo.servicelink.exceptions.*;
|
||||
import org.hwo.tasklet.Tasklet;
|
||||
import org.hwo.tasklet.TaskletListener;
|
||||
import org.hwo.tasklet.TaskletManager;
|
||||
|
@ -59,6 +60,8 @@ import java.awt.Dialog.ModalityType;
|
|||
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import java.awt.Font;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.ToolTipManager;
|
||||
|
@ -126,6 +129,7 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
private JTextArea tfConnectionSettings;
|
||||
private JButton btnSkripte;
|
||||
private JButton btnAufzeichnungenVerwalten;
|
||||
private JButton btnSelbsttest;
|
||||
|
||||
|
||||
public static void startGUI(){
|
||||
|
@ -288,8 +292,8 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
toolBar.setFloatable(false);
|
||||
frmSynolog.getContentPane().add(toolBar, BorderLayout.NORTH);
|
||||
|
||||
btnC = new JButton("Synololog einstellen");
|
||||
btnC.setToolTipText("<html>\n<b>Konfiguration</b><br/>\n<br/>\nKonfiguration des Synololog bearbeiten.\n</html>");
|
||||
btnC = new JButton(Messages.getString("Synololog einstellen"));
|
||||
btnC.setToolTipText(Messages.getString("tooltip.synololog.einstellen"));
|
||||
btnC.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (selectedDeviceInterface != null){
|
||||
|
@ -301,8 +305,8 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
});
|
||||
toolBar.add(btnC);
|
||||
|
||||
btnDatenExportieren = new JButton("Daten exportieren");
|
||||
btnDatenExportieren.setToolTipText("<html>\n<b>Daten exportieren</b><br/>\n<br/>\nExport definitionen bearbeiten und ausführen.<br/>\nHiermit können die Aufzeichnungsdaten in Textdateien exportiert werden.<br/>\n</html>");
|
||||
btnDatenExportieren = new JButton(Messages.getString("Daten exportieren"));
|
||||
btnDatenExportieren.setToolTipText(Messages.getString("tooltip.daten.exportieren"));
|
||||
btnDatenExportieren.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ExportFilesFrame eff = new ExportFilesFrame();
|
||||
|
@ -312,7 +316,7 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
});
|
||||
toolBar.add(btnDatenExportieren);
|
||||
|
||||
btnSkripte = new JButton("Skripte");
|
||||
btnSkripte = new JButton(Messages.getString("Skripte"));
|
||||
btnSkripte.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
SimpleScriptSetup sss = new SimpleScriptSetup();
|
||||
|
@ -322,7 +326,7 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
});
|
||||
toolBar.add(btnSkripte);
|
||||
|
||||
btnAufzeichnungenVerwalten = new JButton("Aufzeichnungen verwalten");
|
||||
btnAufzeichnungenVerwalten = new JButton(Messages.getString("Aufzeichnungen verwalten"));
|
||||
btnAufzeichnungenVerwalten.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
SnapshotManager.show(frmSynolog);
|
||||
|
@ -330,6 +334,14 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
});
|
||||
toolBar.add(btnAufzeichnungenVerwalten);
|
||||
|
||||
btnSelbsttest = new JButton("Selbsttest");
|
||||
btnSelbsttest.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
deviceTest();
|
||||
}
|
||||
});
|
||||
toolBar.add(btnSelbsttest);
|
||||
|
||||
splitter = new JSplitPane();
|
||||
splitter.setBorder(null);
|
||||
splitter.setOneTouchExpandable(true);
|
||||
|
@ -348,7 +360,7 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
|
||||
JPanel panel_1 = new JPanel();
|
||||
panel_1.setBackground(Color.WHITE);
|
||||
panel_1.setBorder(new TitledBorder(null, "Verbindung", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
||||
panel_1.setBorder(new TitledBorder(null, Messages.getString("Verbindung"), TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
||||
GridBagConstraints gbc_panel_1 = new GridBagConstraints();
|
||||
gbc_panel_1.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_panel_1.fill = GridBagConstraints.BOTH;
|
||||
|
@ -418,7 +430,7 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
scrollPane_2.setViewportView(lInterfaces);
|
||||
|
||||
panel_4 = new JPanel();
|
||||
panel_4.setBorder(new TitledBorder(null, "Anschlusseinstellungen", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
||||
panel_4.setBorder(new TitledBorder(null, Messages.getString("Anschlusseinstellungen"), TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
||||
GridBagConstraints gbc_panel_4 = new GridBagConstraints();
|
||||
gbc_panel_4.gridwidth = 2;
|
||||
gbc_panel_4.fill = GridBagConstraints.BOTH;
|
||||
|
@ -443,7 +455,7 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
|
||||
JPanel panel_2 = new JPanel();
|
||||
panel_2.setBackground(Color.WHITE);
|
||||
panel_2.setBorder(new TitledBorder(null, "Meldungen", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
||||
panel_2.setBorder(new TitledBorder(null, Messages.getString("Meldungen"), TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
||||
GridBagConstraints gbc_panel_2 = new GridBagConstraints();
|
||||
gbc_panel_2.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_panel_2.fill = GridBagConstraints.BOTH;
|
||||
|
@ -495,6 +507,9 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
gbl_pChannels.columnWeights = new double[]{Double.MIN_VALUE};
|
||||
gbl_pChannels.rowWeights = new double[]{Double.MIN_VALUE};
|
||||
pChannels.setLayout(gbl_pChannels);
|
||||
|
||||
messageListModel = new DefaultListModel<String>();
|
||||
lMessages.setModel(messageListModel);
|
||||
|
||||
}
|
||||
|
||||
|
@ -508,12 +523,9 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
/* ToDO: GUI Update */
|
||||
if (selectedDeviceInterface == null){
|
||||
bIntfDel.setEnabled(false);
|
||||
|
||||
tfConnectionSettings.setText("");
|
||||
} else {
|
||||
bIntfDel.setEnabled(true);
|
||||
|
||||
// tfConnectionSettings.setText(String.format("<html>%s</html>", selectedDeviceInterface.getConnectionSettingsText().replaceAll("\n", "<br/>")));
|
||||
tfConnectionSettings.setText(selectedDeviceInterface.getConnectionSettingsText());
|
||||
|
||||
}
|
||||
|
@ -587,7 +599,6 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
|
||||
|
||||
} catch (NoDeviceConnectionException e){
|
||||
log("No Device");
|
||||
} catch (Exception e){
|
||||
log(e);
|
||||
}
|
||||
|
@ -599,71 +610,7 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void connectionStateChanged(Boolean connected) {
|
||||
if (connected){
|
||||
Integer version = application().getServiceLink().getServiceRegisterCache().getCachedInteger(13, 0, 0x001A);
|
||||
Integer uptime = application().getServiceLink().getServiceRegisterCache().getCachedInteger(13, 0, 0x0022);
|
||||
Integer eesize = application().getServiceLink().getServiceRegisterCache().getCachedInteger(13, 0, 0x9000);
|
||||
|
||||
if (version != null){
|
||||
tfConnection.setText(String.format("Version %d.%d.%d", version >> 16, (version >> 8) & 0xff, version & 0xff));
|
||||
tfConnection.setBackground(Color.GREEN);
|
||||
tfConnection.setForeground(Color.BLACK);
|
||||
|
||||
|
||||
|
||||
application().message(String.format("Synololog verbunden (Version %d.%d.%d) (Uptime: %d:%d:%d)", version >> 16, (version >> 8) & 0xff, version & 0xff, uptime / 3600, (uptime / 60)%60, uptime % 60));
|
||||
application().message(String.format("EEPROM Size: 0x%08x Bytes", eesize));
|
||||
|
||||
trimDeviceTimeSlice = application().getServiceLink().getServiceRegisterCache().getCachedInteger(13, 0, 0x1302);
|
||||
|
||||
// Trim helper initialisieren
|
||||
trimTicksOnConnect = null;
|
||||
|
||||
application().getSnapshotManager().notify(Notification.FULLSYNC);
|
||||
|
||||
} else {
|
||||
tfConnection.setText("Version unbekannt");
|
||||
tfConnection.setBackground(Color.YELLOW);
|
||||
tfConnection.setForeground(Color.BLACK);
|
||||
|
||||
application().getServiceLink().close();
|
||||
}
|
||||
} else {
|
||||
tfConnection.setText("Nicht verbunden");
|
||||
tfConnection.setBackground(Color.RED);
|
||||
tfConnection.setForeground(Color.WHITE);
|
||||
|
||||
trimTicksOnConnect = null;
|
||||
|
||||
if (timerReconnect != null){
|
||||
timerReconnect.schedule(new TimerTask() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!application().getServiceLink().isOpen()){
|
||||
try {
|
||||
application().getServiceLink().open();
|
||||
} catch (ServiceLinkException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
if (this.connected)
|
||||
application().message("Verbindung getrennt");
|
||||
}
|
||||
this.connected = connected;
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
public synchronized void messageArrived(String message) {
|
||||
|
@ -864,6 +811,7 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
|
||||
private int timeout;
|
||||
private boolean exit;
|
||||
private boolean paused;
|
||||
|
||||
private int checkTimeout;
|
||||
|
||||
|
@ -903,15 +851,16 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
try {
|
||||
wait(timeout);
|
||||
|
||||
updateDeviceView();
|
||||
|
||||
if (checkTimeout > 0){
|
||||
checkTimeout--;
|
||||
} else {
|
||||
checkTimeout = 10;
|
||||
application().checkForSnapShots();
|
||||
if (!isPaused()){
|
||||
updateDeviceView();
|
||||
|
||||
if (checkTimeout > 0){
|
||||
checkTimeout--;
|
||||
} else {
|
||||
checkTimeout = 10;
|
||||
application().checkForSnapShots();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (InterruptedException e){
|
||||
} catch (Exception e){
|
||||
log(ERROR,"Unexpected Exception in backgroundThread: %s", e.toString());
|
||||
|
@ -922,7 +871,25 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
log(INFO,"newMainWindow: backgroundThread: exited");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public synchronized boolean isPaused() {
|
||||
return paused;
|
||||
}
|
||||
public synchronized void setPaused(boolean paused) {
|
||||
this.paused = paused;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void deviceTest(){
|
||||
if (selectedDeviceInterface != null){
|
||||
if (JOptionPane.showConfirmDialog(frmSynolog, Messages.getString("warning.title.selftest"),Messages.getString("warning.selftest"), JOptionPane.YES_NO_OPTION)== JOptionPane.YES_OPTION){
|
||||
DeviceTester deviceTester = new DeviceTester(selectedDeviceInterface);
|
||||
backgroundThread.setPaused(true);
|
||||
deviceTester.start();
|
||||
backgroundThread.setPaused(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import javax.swing.JPanel;
|
|||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.models.TableMapper.TableColumn;
|
||||
import org.hwo.models.TableMapper.TableMapper;
|
||||
import org.hwo.models.TableMapper.TableMapperListener;
|
||||
|
@ -72,6 +73,7 @@ public class SimpleScriptEditor extends JDialog {
|
|||
* Create the dialog.
|
||||
*/
|
||||
public SimpleScriptEditor() {
|
||||
setTitle(Messages.getString("Skript bearbeiten"));
|
||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||
setBounds(100, 100, 921, 474);
|
||||
|
@ -106,7 +108,7 @@ public class SimpleScriptEditor extends JDialog {
|
|||
if (e.isPopupTrigger()){
|
||||
JPopupMenu popupMenu = new JPopupMenu();
|
||||
|
||||
JMenuItem miAdd = new JMenuItem("1x neu");
|
||||
JMenuItem miAdd = new JMenuItem(Messages.getString("1x neu"));
|
||||
miAdd.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -116,7 +118,7 @@ public class SimpleScriptEditor extends JDialog {
|
|||
});
|
||||
popupMenu.add(miAdd);
|
||||
|
||||
JMenuItem miAdd5 = new JMenuItem("5x neu");
|
||||
JMenuItem miAdd5 = new JMenuItem(Messages.getString("5x neu"));
|
||||
miAdd5.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -135,7 +137,7 @@ public class SimpleScriptEditor extends JDialog {
|
|||
|
||||
SimpleScriptElement sse = (SimpleScriptElement)mtScriptElements.getTableMapper().getSelectedRow();
|
||||
if (sse != null){
|
||||
JMenuItem miRemove = new JMenuItem("Entfernen");
|
||||
JMenuItem miRemove = new JMenuItem(Messages.getString("Entfernen"));
|
||||
miRemove.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
|
@ -156,7 +158,7 @@ public class SimpleScriptEditor extends JDialog {
|
|||
};
|
||||
|
||||
{
|
||||
JLabel lblBezeichnung = new JLabel("Bezeichnung:");
|
||||
JLabel lblBezeichnung = new JLabel(Messages.getString("Bezeichnung:"));
|
||||
GridBagConstraints gbc_lblBezeichnung = new GridBagConstraints();
|
||||
gbc_lblBezeichnung.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblBezeichnung.anchor = GridBagConstraints.NORTH;
|
||||
|
@ -177,7 +179,7 @@ public class SimpleScriptEditor extends JDialog {
|
|||
tfName.setColumns(10);
|
||||
}
|
||||
{
|
||||
JLabel lblBescrheibung = new JLabel("Beschreibung:");
|
||||
JLabel lblBescrheibung = new JLabel(Messages.getString("Beschreibung:"));
|
||||
GridBagConstraints gbc_lblBescrheibung = new GridBagConstraints();
|
||||
gbc_lblBescrheibung.anchor = GridBagConstraints.NORTH;
|
||||
gbc_lblBescrheibung.fill = GridBagConstraints.HORIZONTAL;
|
||||
|
@ -206,6 +208,9 @@ public class SimpleScriptEditor extends JDialog {
|
|||
contentPanel.add(spElementTable, gbc_spElementTable);
|
||||
{
|
||||
mtScriptElements = new JMappedTable(SimpleScriptElement.class);
|
||||
mtScriptElements.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
mtScriptElements.setEditorEnabled(true);
|
||||
mtScriptElements.setFillsViewportHeight(true);
|
||||
mtScriptElements.addMouseListener(popupAdapter);
|
||||
spElementTable.setViewportView(mtScriptElements);
|
||||
}
|
||||
|
@ -215,7 +220,7 @@ public class SimpleScriptEditor extends JDialog {
|
|||
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
||||
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
||||
{
|
||||
JButton okButton = new JButton("OK");
|
||||
JButton okButton = new JButton(Messages.getString("OK"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
accept();
|
||||
|
@ -226,7 +231,7 @@ public class SimpleScriptEditor extends JDialog {
|
|||
getRootPane().setDefaultButton(okButton);
|
||||
}
|
||||
{
|
||||
JButton cancelButton = new JButton("Cancel");
|
||||
JButton cancelButton = new JButton(Messages.getString("Cancel"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
cancel();
|
||||
|
@ -256,6 +261,11 @@ public class SimpleScriptEditor extends JDialog {
|
|||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public void tableRowChanged(TableMapper sender, Object row) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
mtScriptElements.getTableMapper().setEditorEnabled(true);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import javax.swing.JDialog;
|
|||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.pulscounter.simplescript.SimpleScript;
|
||||
import org.hwo.pulscounter.simplescript.SimpleScript.ScriptCondition;
|
||||
import org.hwo.pulscounter.simplescript.SimpleScript.ScriptOperation;
|
||||
|
@ -57,7 +58,7 @@ public class SimpleScriptElementEditor extends JDialog {
|
|||
public SimpleScriptElementEditor() {
|
||||
setResizable(false);
|
||||
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||
setTitle("Skriptelement bearbeiten");
|
||||
setTitle(Messages.getString("Skriptelement bearbeiten"));
|
||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||
setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
|
||||
setBounds(100, 100, 519, 350);
|
||||
|
@ -72,7 +73,7 @@ public class SimpleScriptElementEditor extends JDialog {
|
|||
contentPanel.setLayout(gbl_contentPanel);
|
||||
{
|
||||
JPanel panel = new JPanel();
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "Eingangswert A", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), Messages.getString("Eingangswert A"), TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
GridBagConstraints gbc_panel = new GridBagConstraints();
|
||||
gbc_panel.insets = new Insets(0, 0, 5, 5);
|
||||
gbc_panel.fill = GridBagConstraints.BOTH;
|
||||
|
@ -96,7 +97,7 @@ public class SimpleScriptElementEditor extends JDialog {
|
|||
}
|
||||
{
|
||||
JPanel panel = new JPanel();
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "Eingangswert B", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), Messages.getString("Eingangswert B"), TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
GridBagConstraints gbc_panel = new GridBagConstraints();
|
||||
gbc_panel.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_panel.fill = GridBagConstraints.BOTH;
|
||||
|
@ -120,7 +121,7 @@ public class SimpleScriptElementEditor extends JDialog {
|
|||
}
|
||||
{
|
||||
JPanel panel = new JPanel();
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "Bedingung", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)),Messages.getString("Bedingung"), TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
GridBagConstraints gbc_panel = new GridBagConstraints();
|
||||
gbc_panel.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_panel.gridwidth = 2;
|
||||
|
@ -147,7 +148,7 @@ public class SimpleScriptElementEditor extends JDialog {
|
|||
}
|
||||
{
|
||||
JPanel panel = new JPanel();
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "Operation", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)),Messages.getString("Operation"), TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
GridBagConstraints gbc_panel = new GridBagConstraints();
|
||||
gbc_panel.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_panel.gridwidth = 2;
|
||||
|
@ -174,7 +175,7 @@ public class SimpleScriptElementEditor extends JDialog {
|
|||
}
|
||||
{
|
||||
JPanel panel = new JPanel();
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "Ausgangswert Z", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), Messages.getString("Ausgangswert Z"), TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
|
||||
GridBagConstraints gbc_panel = new GridBagConstraints();
|
||||
gbc_panel.insets = new Insets(0, 0, 0, 5);
|
||||
gbc_panel.fill = GridBagConstraints.BOTH;
|
||||
|
@ -201,7 +202,7 @@ public class SimpleScriptElementEditor extends JDialog {
|
|||
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
||||
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
||||
{
|
||||
JButton okButton = new JButton("OK");
|
||||
JButton okButton = new JButton(Messages.getString("OK"));
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
accept();
|
||||
|
@ -212,7 +213,7 @@ public class SimpleScriptElementEditor extends JDialog {
|
|||
getRootPane().setDefaultButton(okButton);
|
||||
}
|
||||
{
|
||||
JButton cancelButton = new JButton("Cancel");
|
||||
JButton cancelButton = new JButton(Messages.getString("Cancel"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
cancel();
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.JDialog;
|
|||
|
||||
import java.awt.FlowLayout;
|
||||
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.models.TableMapper.TableMapper;
|
||||
import org.hwo.models.TableMapper.TableMapperListener;
|
||||
import org.hwo.pulscounter.PulsCounterApplication;
|
||||
|
@ -68,6 +69,7 @@ import java.awt.event.ActionListener;
|
|||
import java.awt.event.ActionEvent;
|
||||
import java.awt.Dialog.ModalExclusionType;
|
||||
import java.awt.Dialog.ModalityType;
|
||||
import javax.swing.JTable;
|
||||
|
||||
public class SimpleScriptSetup extends JDialog {
|
||||
|
||||
|
@ -82,7 +84,7 @@ public class SimpleScriptSetup extends JDialog {
|
|||
private JButton btnReceive;
|
||||
|
||||
public SimpleScriptSetup() {
|
||||
setTitle("Formeln");
|
||||
setTitle(Messages.getString("Formeln"));
|
||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
setBounds(100, 100, 831, 406);
|
||||
|
@ -107,7 +109,7 @@ public class SimpleScriptSetup extends JDialog {
|
|||
gbc_panel.gridy = 0;
|
||||
contentPane.add(panel, gbc_panel);
|
||||
|
||||
btnNeu = new JButton("neu...");
|
||||
btnNeu = new JButton(Messages.getString("neu..."));
|
||||
btnNeu.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
scriptTable.getTableMapper().addRow(new SimpleScript());
|
||||
|
@ -115,7 +117,7 @@ public class SimpleScriptSetup extends JDialog {
|
|||
});
|
||||
panel.add(btnNeu);
|
||||
|
||||
btnBearbeiten = new JButton("bearbeiten...");
|
||||
btnBearbeiten = new JButton(Messages.getString("bearbeiten..."));
|
||||
btnBearbeiten.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
scriptTable.getTableMapper().openEditor();
|
||||
|
@ -124,7 +126,7 @@ public class SimpleScriptSetup extends JDialog {
|
|||
btnBearbeiten.setEnabled(false);
|
||||
panel.add(btnBearbeiten);
|
||||
|
||||
btnEntfernen = new JButton("entfernen");
|
||||
btnEntfernen = new JButton(Messages.getString("entfernen"));
|
||||
btnEntfernen.setEnabled(false);
|
||||
btnEntfernen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -135,7 +137,7 @@ public class SimpleScriptSetup extends JDialog {
|
|||
});
|
||||
panel.add(btnEntfernen);
|
||||
|
||||
btnTransmit = new JButton("auf Zähler übertragen....");
|
||||
btnTransmit = new JButton(Messages.getString("auf Zähler übertragen...."));
|
||||
btnTransmit.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
transmit();
|
||||
|
@ -144,7 +146,7 @@ public class SimpleScriptSetup extends JDialog {
|
|||
btnTransmit.setEnabled(false);
|
||||
panel.add(btnTransmit);
|
||||
|
||||
btnReceive = new JButton("von Zähler holen....");
|
||||
btnReceive = new JButton(Messages.getString("von Zähler holen...."));
|
||||
btnReceive.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
receive();
|
||||
|
@ -161,6 +163,8 @@ public class SimpleScriptSetup extends JDialog {
|
|||
contentPane.add(scrollPane, gbc_scrollPane);
|
||||
|
||||
scriptTable = new JMappedTable(SimpleScript.class);
|
||||
scriptTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
scriptTable.setFillsViewportHeight(true);
|
||||
scrollPane.setViewportView(scriptTable);
|
||||
|
||||
JPanel panel_1 = new JPanel();
|
||||
|
@ -172,7 +176,7 @@ public class SimpleScriptSetup extends JDialog {
|
|||
gbc_panel_1.gridy = 2;
|
||||
contentPane.add(panel_1, gbc_panel_1);
|
||||
|
||||
JButton btnSchliessen = new JButton("schliessen");
|
||||
JButton btnSchliessen = new JButton(Messages.getString("schliessen"));
|
||||
btnSchliessen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
setVisible(false);
|
||||
|
@ -225,6 +229,12 @@ public class SimpleScriptSetup extends JDialog {
|
|||
public void ValueChanged(int row, int column) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tableRowChanged(TableMapper sender, Object row) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -234,8 +244,8 @@ public class SimpleScriptSetup extends JDialog {
|
|||
IDeviceConnector connector = JObjectSelector.execute(
|
||||
connectors,
|
||||
this,
|
||||
"Schnittstelle wählen...",
|
||||
"Wählen Sie die Schnittstelle über die das Skript übertragen werden soll."
|
||||
Messages.getString("Schnittstelle wählen..."),
|
||||
Messages.getString("Wählen Sie die Schnittstelle über die das Skript übertragen werden soll.")
|
||||
);
|
||||
|
||||
if (connector != null){
|
||||
|
@ -250,8 +260,8 @@ public class SimpleScriptSetup extends JDialog {
|
|||
IDeviceConnector connector = JObjectSelector.execute(
|
||||
connectors,
|
||||
this,
|
||||
"Schnittstelle wählen...",
|
||||
"Wählen Sie die Schnittstelle über die das Skript empfangen werden soll."
|
||||
Messages.getString("Schnittstelle wählen..."),
|
||||
Messages.getString("Wählen Sie die Schnittstelle über die das Skript empfangen werden soll.")
|
||||
);
|
||||
|
||||
if (connector != null){
|
||||
|
@ -260,11 +270,11 @@ public class SimpleScriptSetup extends JDialog {
|
|||
int[] scriptElements = connector.getSimpleScript();
|
||||
|
||||
if (scriptElements == null){
|
||||
JOptionPane.showMessageDialog(this, "Es konnte kein Skript vom gerät empfangen werden.");
|
||||
JOptionPane.showMessageDialog(this, Messages.getString("Es konnte kein Skript vom gerät empfangen werden."));
|
||||
} else {
|
||||
SimpleScript simpleScript = new SimpleScript();
|
||||
simpleScript.setSimpleScriptElements(scriptElements);
|
||||
simpleScript.setName(String.format("Von Gerät %s geholt am %s", connector.getDeviceSerial(), DateFormat.getDateTimeInstance().format(new Date())));
|
||||
simpleScript.setName(String.format(Messages.getString("Von Gerät %s geholt am %s"), connector.getDeviceSerial(), DateFormat.getDateTimeInstance().format(new Date())));
|
||||
|
||||
scriptTable.getTableMapper().addRow(simpleScript);
|
||||
PulsCounterApplication.getApplication().getDatabase().storeSimpleScript(simpleScript);
|
||||
|
|
|
@ -19,6 +19,7 @@ import javax.swing.JSplitPane;
|
|||
import java.awt.GridBagConstraints;
|
||||
|
||||
import org.hwo.ObjectTable;
|
||||
import org.hwo.i18n.Messages;
|
||||
import org.hwo.pulscounter.PulsCounterApplication;
|
||||
import org.hwo.pulscounter.SnapShot;
|
||||
import org.hwo.ui.JMappedTable;
|
||||
|
@ -80,7 +81,7 @@ public class SnapshotManager extends JDialog {
|
|||
* Create the dialog.
|
||||
*/
|
||||
public SnapshotManager() {
|
||||
setTitle("Aufgezeichnete Werte verwalten");
|
||||
setTitle(Messages.getString("Aufgezeichnete Werte verwalten"));
|
||||
setModal(true);
|
||||
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||
|
@ -187,7 +188,7 @@ public class SnapshotManager extends JDialog {
|
|||
gbl_panel_2.rowWeights = new double[]{0.0, Double.MIN_VALUE};
|
||||
panel_2.setLayout(gbl_panel_2);
|
||||
{
|
||||
cbDifferenzen = new JCheckBox("Differenzieren");
|
||||
cbDifferenzen = new JCheckBox(Messages.getString("Differenzieren"));
|
||||
cbDifferenzen.addActionListener(new ActionListener(){
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
for (int i=0;i<32;i++){
|
||||
|
@ -218,13 +219,13 @@ public class SnapshotManager extends JDialog {
|
|||
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
||||
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
||||
{
|
||||
JButton cancelButton = new JButton("schliessen");
|
||||
JButton cancelButton = new JButton(Messages.getString("schliessen"));
|
||||
cancelButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
cancelButton.setActionCommand("Cancel");
|
||||
cancelButton.setActionCommand(Messages.getString("Cancel"));
|
||||
buttonPane.add(cancelButton);
|
||||
}
|
||||
}
|
||||
|
@ -284,7 +285,7 @@ public class SnapshotManager extends JDialog {
|
|||
public void popupTriggered(int x, int y) {
|
||||
JPopupMenu popup = new JPopupMenu();
|
||||
|
||||
JMenuItem mi = new JMenuItem("Nur diesen Graph zeigen");
|
||||
JMenuItem mi = new JMenuItem(Messages.getString("Nur diesen Graph zeigen"));
|
||||
mi.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
|
@ -300,7 +301,7 @@ public class SnapshotManager extends JDialog {
|
|||
});
|
||||
popup.add(mi);
|
||||
|
||||
mi = new JMenuItem("Alle ausser diesem Graph zeigen");
|
||||
mi = new JMenuItem(Messages.getString("Alle ausser diesem Graph zeigen"));
|
||||
mi.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
|
@ -332,12 +333,12 @@ public class SnapshotManager extends JDialog {
|
|||
|
||||
if ((selRows != null)&&(selRows.length>0)){
|
||||
JPopupMenu popupMenu = new JPopupMenu();
|
||||
JMenuItem mi = new JMenuItem("Entfernen...");
|
||||
JMenuItem mi = new JMenuItem(Messages.getString("Entfernen..."));
|
||||
mi.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
if (JOptionPane.showConfirmDialog(SnapshotManager.this, "Sollen die markierten Snapshots wirklich gelöscht werden?","Aufzeichnungen entfernen",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
|
||||
if (JOptionPane.showConfirmDialog(SnapshotManager.this, Messages.getString("Sollen die markierten Snapshots wirklich gelöscht werden?"),Messages.getString("Aufzeichnungen entfernen"),JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
|
||||
for (SnapShot ss: selRows){
|
||||
mtSnapshots.getTableMapper().removeRow(ss);
|
||||
PulsCounterApplication.getApplication().getDatabase().deleteSnapshot(ss);
|
||||
|
@ -353,7 +354,7 @@ public class SnapshotManager extends JDialog {
|
|||
});
|
||||
popupMenu.add(mi);
|
||||
|
||||
mi = new JMenuItem("(Ent-)Parken");
|
||||
mi = new JMenuItem(Messages.getString("(Ent-)Parken"));
|
||||
mi.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
|
Loading…
Reference in New Issue