Sammelupdate 20160915 / HSQLDB, MultiDevice
parent
84e912b73e
commit
0582ec77e6
|
@ -119,84 +119,83 @@ public class ExportSetting {
|
|||
c.setTime(d);
|
||||
|
||||
return filename
|
||||
.replaceAll("\\%S", String.format("%d", ss.getDeviceSerial()))
|
||||
.replaceAll("\\%Y", String.format("%04d", new Integer(c.get(Calendar.YEAR))))
|
||||
.replaceAll("\\%M", String.format("%02d", new Integer(c.get(Calendar.MONTH)+1)))
|
||||
.replaceAll("\\%D", String.format("%02d", new Integer(c.get(Calendar.DAY_OF_MONTH))));
|
||||
}
|
||||
|
||||
public void export(){
|
||||
// SnapshotManager ssm = PulsCounterApplication.getApplication().getSnapshotManager();
|
||||
//
|
||||
// Hashtable<String, CSV> hash = new Hashtable<String, CSV>();
|
||||
//
|
||||
// for (int n=0;n<ssm.size();n++){
|
||||
// SnapShot ss = ssm.loadSnapShot(n);
|
||||
// String fn = calculateFileName(fileName, ss);
|
||||
//
|
||||
// if ((triggerType==TriggerType.ALL)||(ss.getTriggerType()==triggerType)){
|
||||
// if (triggerSource.equals(-1) || triggerSource.equals(ss.getSource())){
|
||||
//
|
||||
// if (!hash.containsKey(fn)){
|
||||
// hash.put(fn, new CSV());
|
||||
// if (extended){
|
||||
// hash.get(fn).getRecords().add(new CSVRecord(new Object[]{
|
||||
// "Zeitstempel", "Datum/Zeit", "Trigger", "Quelle",
|
||||
// "CH0","CH1","CH2","CH3","CH4","CH5","CH6","CH7",
|
||||
// "CH8","CH9","CH10","CH11","CH12","CH13","CH14","CH15",
|
||||
// "CH16","CH17","CH18","CH19","CH20","CH21","CH22","CH23",
|
||||
// "CH24","CH25","CH26","CH27","CH28","CH29","CH30","CH31",
|
||||
// "AN0","AN1","AN2","AN3","AN4","AN5","AN6","AN7"}));
|
||||
// } else {
|
||||
// hash.get(fn).getRecords().add(new CSVRecord(new Object[]{
|
||||
// "Datum/Zeit",
|
||||
// "CH0","CH1","CH2","CH3","CH4","CH5","CH6","CH7",
|
||||
// "CH8","CH9","CH10","CH11","CH12","CH13","CH14","CH15",
|
||||
// "CH16","CH17","CH18","CH19","CH20","CH21","CH22","CH23",
|
||||
// "CH24","CH25","CH26","CH27","CH28","CH29","CH30","CH31",
|
||||
// "AN0","AN1","AN2","AN3","AN4","AN5","AN6","AN7"}));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// hash.get(fn).getRecords().add(ss.getCSVRecord(extended));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (String fn: hash.keySet()){
|
||||
// if (recordDelta){
|
||||
// CSV csv = hash.get(fn);
|
||||
// if (!csv.getRecords().isEmpty()){
|
||||
// Iterator<CSVRecord> iter = csv.getRecords().iterator();
|
||||
//
|
||||
// iter.next();
|
||||
//
|
||||
// CSVRecord n = iter.next();
|
||||
// Integer[] vals = new Integer[32];
|
||||
//
|
||||
// for (int i=0;i<32;i++){
|
||||
// vals[i] = n.getIntegerValue(extended ? i + 4 : i + 1 );
|
||||
// }
|
||||
//
|
||||
// while (iter.hasNext()){
|
||||
// n = iter.next();
|
||||
//
|
||||
// for (int i=0;i<32;i++){
|
||||
// Integer v = n.getIntegerValue(extended ? i + 4 : i + 1 );
|
||||
// n.setValue(extended ? i + 4 : i + 1 , v - vals[i]);
|
||||
// vals[i] = v;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// csv.getRecords().remove(1);
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// hash.get(fn).saveToFile(new File(path,fn));
|
||||
// }
|
||||
Hashtable<String, CSV> hash = new Hashtable<String, CSV>();
|
||||
|
||||
for (SnapShot ss: PulsCounterApplication.getApplication().getDatabase().loadSnapshots(0))
|
||||
{
|
||||
String fn = calculateFileName(fileName, ss);
|
||||
|
||||
if ((triggerType==TriggerType.ALL)||(ss.getTriggerType()==triggerType)){
|
||||
if (triggerSource.equals(-1) || triggerSource.equals(ss.getSource())){
|
||||
|
||||
if (!hash.containsKey(fn)){
|
||||
hash.put(fn, new CSV());
|
||||
if (extended){
|
||||
hash.get(fn).getRecords().add(new CSVRecord(new Object[]{
|
||||
"Zeitstempel", "Datum/Zeit", "Trigger", "Quelle",
|
||||
"CH0","CH1","CH2","CH3","CH4","CH5","CH6","CH7",
|
||||
"CH8","CH9","CH10","CH11","CH12","CH13","CH14","CH15",
|
||||
"CH16","CH17","CH18","CH19","CH20","CH21","CH22","CH23",
|
||||
"CH24","CH25","CH26","CH27","CH28","CH29","CH30","CH31",
|
||||
"AN0","AN1","AN2","AN3","AN4","AN5","AN6","AN7"}));
|
||||
} else {
|
||||
hash.get(fn).getRecords().add(new CSVRecord(new Object[]{
|
||||
"Datum/Zeit",
|
||||
"CH0","CH1","CH2","CH3","CH4","CH5","CH6","CH7",
|
||||
"CH8","CH9","CH10","CH11","CH12","CH13","CH14","CH15",
|
||||
"CH16","CH17","CH18","CH19","CH20","CH21","CH22","CH23",
|
||||
"CH24","CH25","CH26","CH27","CH28","CH29","CH30","CH31",
|
||||
"AN0","AN1","AN2","AN3","AN4","AN5","AN6","AN7"}));
|
||||
}
|
||||
}
|
||||
|
||||
hash.get(fn).getRecords().add(ss.getCSVRecord(extended));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String fn: hash.keySet()){
|
||||
if (recordDelta){
|
||||
CSV csv = hash.get(fn);
|
||||
if (!csv.getRecords().isEmpty()){
|
||||
Iterator<CSVRecord> iter = csv.getRecords().iterator();
|
||||
|
||||
iter.next();
|
||||
|
||||
CSVRecord n = iter.next();
|
||||
Integer[] vals = new Integer[32];
|
||||
|
||||
for (int i=0;i<32;i++){
|
||||
vals[i] = n.getIntegerValue(extended ? i + 4 : i + 1 );
|
||||
}
|
||||
|
||||
while (iter.hasNext()){
|
||||
n = iter.next();
|
||||
|
||||
for (int i=0;i<32;i++){
|
||||
Integer v = n.getIntegerValue(extended ? i + 4 : i + 1 );
|
||||
n.setValue(extended ? i + 4 : i + 1 , v - vals[i]);
|
||||
vals[i] = v;
|
||||
}
|
||||
}
|
||||
|
||||
csv.getRecords().remove(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
hash.get(fn).saveToFile(new File(path,fn));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.hsqldb.persist.EventLogInterface;
|
|||
import org.hwo.StringHelper;
|
||||
import org.hwo.configuration.ConfigurableObjects;
|
||||
import org.hwo.io.NewSerialPort.NewSerialPort;
|
||||
import org.hwo.logging.Logging;
|
||||
import org.hwo.platform.Platform;
|
||||
import org.hwo.servicelink.ServiceLink;
|
||||
import org.hwo.servicelink.ServiceLinkListener;
|
||||
|
@ -101,6 +102,7 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
uiSynchronization = new Object();
|
||||
applicationListeners = new LinkedList<PulsCounterApplicationListener>();
|
||||
unseenMessages = new Vector<String>();
|
||||
exportSettings = new ArrayList<>();
|
||||
|
||||
interfaceClasses = new ArrayList<>();
|
||||
interfaces = new ArrayList<>();
|
||||
|
@ -183,6 +185,8 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
}
|
||||
|
||||
private static void logStartup(){
|
||||
Logging.setLogFileName("synololog.log");
|
||||
|
||||
log("Synololog Application Startup");
|
||||
|
||||
log("JAVA Environment: %s (%s)", System.getProperty("java.version"),
|
||||
|
@ -270,6 +274,20 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
log(INFO,"Database Schema Version: %s", database.getSchemaVersion());
|
||||
|
||||
|
||||
String sProfiles = database.getProperty("export.profiles");
|
||||
if (sProfiles != null){
|
||||
Integer nProfiles = new Integer(sProfiles);
|
||||
for (int n=0;n<nProfiles;n++){
|
||||
String profileConf = database.getProperty(String.format("export.profiles.%d",n));
|
||||
if (profileConf != null){
|
||||
ExportSetting es = new ExportSetting();
|
||||
ConfigurableObjects.setConfiguration(es, profileConf);
|
||||
exportSettings.add(es);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void shutdown(){
|
||||
|
@ -280,10 +298,7 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
for (Frame frame: JFrame.getFrames()){
|
||||
frame.setVisible(false);
|
||||
frame.dispose();
|
||||
}
|
||||
|
||||
database.close();
|
||||
|
||||
}
|
||||
|
||||
if (shouldSaveConfiguration){
|
||||
|
||||
|
@ -293,6 +308,15 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
applicationConfiguration.setProperty(String.format("interfaces.%d.settings", n), interfaces.get(n).getConnectionSettings());
|
||||
}
|
||||
|
||||
for (int n=0;n<exportSettings.size();n++){
|
||||
String conf = ConfigurableObjects.getConfiguration(exportSettings.get(n));
|
||||
if (conf != null){
|
||||
database.setProperty(String.format("export.profiles.%d", n), conf);
|
||||
}
|
||||
}
|
||||
database.setProperty("export.profiles", new Integer(exportSettings.size()).toString());
|
||||
|
||||
|
||||
|
||||
try {
|
||||
log(INFO,"Save application configuration");
|
||||
|
@ -310,17 +334,10 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
|
||||
|
||||
}
|
||||
|
||||
database.close();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
this.scheduler.shutdown();
|
||||
this.snapshotManager.doShutdown();
|
||||
TaskletManager.instance().shutdown();
|
||||
|
||||
this.getServiceLink().close();
|
||||
|
||||
this.savePrefs();
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -403,11 +420,12 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
|||
public void checkForSnapShots(){
|
||||
|
||||
for (IDeviceConnector idc: this.interfaces){
|
||||
Integer avail = idc.getAvailableSnapshots();
|
||||
Integer deviceSerial = idc.getDeviceSerial();
|
||||
Integer highestIndex = database.highestSnapShot(deviceSerial);
|
||||
|
||||
log(INFO,"Interface %s has %d available Snapshots", idc.toString(), avail);
|
||||
log(INFO,"Highest known snapshot index for device #%d is %d", deviceSerial, highestIndex);
|
||||
|
||||
SnapShot[] snapshots = idc.readSnapShots();
|
||||
SnapShot[] snapshots = idc.readSnapShots(highestIndex+1);
|
||||
if (snapshots != null){
|
||||
getDatabase().storeSnapshots(snapshots);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.hwo.pulscounter;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
@ -13,6 +15,7 @@ import org.hwo.servicelink.ServiceLinkException;
|
|||
public class SnapShot {
|
||||
Integer deviceSerial;
|
||||
|
||||
Integer index;
|
||||
Integer timestamp;
|
||||
Integer field0;
|
||||
|
||||
|
@ -47,6 +50,30 @@ public class SnapShot {
|
|||
fromBytes(bytes);
|
||||
}
|
||||
|
||||
public SnapShot(ResultSet rs) throws SQLException {
|
||||
this.values = new Integer[32];
|
||||
this.analog = new Integer[8];
|
||||
|
||||
this.deviceSerial = rs.getInt("device");
|
||||
this.index = rs.getInt("snap_id");
|
||||
this.timestamp = rs.getInt("timestamp");
|
||||
this.inputmask = rs.getInt("inputs");
|
||||
this.outputmask = rs.getInt("outputs");
|
||||
this.invertmask = rs.getInt("inverts");
|
||||
this.triggermask = 0;
|
||||
this.pullupmask = rs.getInt("pullups");
|
||||
this.field0 = rs.getInt("field0");
|
||||
|
||||
Object[] va = (Object[])rs.getArray("counters").getArray();
|
||||
for (int i=0;i<32;i++){
|
||||
this.values[i] = (Integer)va[i];
|
||||
}
|
||||
va = (Object[])rs.getArray("analogs").getArray();
|
||||
for (int i=0;i<8;i++){
|
||||
this.analog[i] = (Integer)va[i];
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getDeviceSerial() {
|
||||
return deviceSerial;
|
||||
}
|
||||
|
@ -54,6 +81,13 @@ public class SnapShot {
|
|||
this.deviceSerial = deviceSerial;
|
||||
}
|
||||
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public void setField0(Integer field0) {
|
||||
this.field0 = field0;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@ import java.sql.DriverManager;
|
|||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.hwo.pulscounter.SnapShot;
|
||||
|
||||
|
@ -79,14 +82,30 @@ public class PulsCounterDatabase {
|
|||
return null;
|
||||
}
|
||||
|
||||
private Object executeSimpleQueryObject(String query,Object... args){
|
||||
ResultSet result = executeSimpleSQL(query,args);
|
||||
if (result != null){
|
||||
try {
|
||||
if (result.next()){
|
||||
return result.getObject(1);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log(ERROR,"SQL Statement failed: %s",query);
|
||||
log(ERROR,"Exception: %s", e.toString());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String getProperty(String name){
|
||||
return executeVerySimpleQuery("SELECT value FROM properties WHERE name=?", name);
|
||||
return executeVerySimpleQuery("SELECT value FROM props WHERE name=?", name);
|
||||
}
|
||||
public void setProperty(String name,String value){
|
||||
executeSimpleSQL("MERGE INTO properties USING (VALUES(?,?)) as p(name,value) ON properties.name = p.name WHEN MATCHED THEN UPDATE SET properties.value = p.value WHEN NOT MATCHED THEN INSERT VALUES uuid(), p.name, p.value", name,value);
|
||||
executeSimpleSQL("MERGE INTO props USING (VALUES(?,?)) as p(name,value) ON props.name = p.name WHEN MATCHED THEN UPDATE SET props.value = p.value WHEN NOT MATCHED THEN INSERT VALUES uuid(), p.name, p.value", name,value);
|
||||
}
|
||||
public void removeProperty(String name){
|
||||
executeSimpleSQL("DELETE FROM properties WHERE properties.name = ?", name);
|
||||
executeSimpleSQL("DELETE FROM props WHERE props.name = ?", name);
|
||||
}
|
||||
|
||||
public String getSchemaVersion(){
|
||||
|
@ -100,21 +119,46 @@ public class PulsCounterDatabase {
|
|||
}
|
||||
|
||||
private void storeSnapshot(SnapShot snapShot){
|
||||
|
||||
executeVerySimpleQuery("INSERT INTO snapshots (id,device,timestamp,counters,analogs,inputs,outputs,pullups,inverts) VALUES(uuid(),?,?,?,?,?,?,?,?)",
|
||||
log(INFO,"db store snapshot [%d]",snapShot.getIndex());
|
||||
|
||||
executeVerySimpleQuery("INSERT INTO snapshots (id,device,snap_id,timestamp,counters,analogs,inputs,outputs,pullups,inverts,field0) VALUES(uuid(),?,?,?,?,?,?,?,?,?,?)",
|
||||
snapShot.getDeviceSerial(),
|
||||
snapShot.getIndex(),
|
||||
snapShot.getTimestamp(),
|
||||
snapShot.getValues(),
|
||||
snapShot.getAnalog(),
|
||||
snapShot.getInputmask(),
|
||||
snapShot.getOutputmask(),
|
||||
snapShot.getPullupmask(),
|
||||
snapShot.getInvertmask()
|
||||
);
|
||||
|
||||
// (id uuid,device integer,timestamp integer,counters integer array[32],analogs integer array[8],inputs integer,outputs integer,pullups integer,inverts integer);
|
||||
snapShot.getInvertmask(),
|
||||
snapShot.getField0()
|
||||
);
|
||||
}
|
||||
|
||||
public int highestSnapShot(int deviceSerial){
|
||||
Integer ind = (Integer)executeSimpleQueryObject("SELECT max(snap_id) FROM snapshots WHERE device=? GROUP BY device", deviceSerial);
|
||||
if (ind == null){
|
||||
return -1;
|
||||
} else {
|
||||
return ind;
|
||||
}
|
||||
}
|
||||
|
||||
public SnapShot[] loadSnapshots(int fromTimestamp){
|
||||
List<SnapShot> snapshots = new LinkedList<>();
|
||||
|
||||
ResultSet result = executeSimpleSQL("SELECT id,device,snap_id,timestamp,counters,analogs,inputs,outputs,pullups,inverts,field0 FROM snapshots WHERE timestamp >= ?", fromTimestamp);
|
||||
try {
|
||||
while (result.next()){
|
||||
|
||||
SnapShot ss = new SnapShot(result);
|
||||
snapshots.add(ss);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log(e);
|
||||
}
|
||||
|
||||
return snapshots.toArray(new SnapShot[0]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
|
||||
create table props (id uuid primary key,name varchar(255) unique,value varchar(255));
|
||||
create table devices (id uuid,serial varchar(12));
|
||||
create table snapshots (id uuid,device integer,timestamp integer,counters integer array[32],analogs integer array[8],inputs integer,outputs integer,pullups integer,inverts integer);
|
||||
|
||||
create table snapshots (id uuid,device integer,snap_id integer,timestamp integer,counters integer array[32],analogs integer array[8],inputs integer,outputs integer,pullups integer,inverts integer,field0 integer);
|
||||
|
||||
insert into props (id,name,value) values(uuid(),'db.schema.version','0');
|
||||
|
||||
|
|
|
@ -30,10 +30,37 @@ public interface IDeviceConnector {
|
|||
public void setPullups(int pullups);
|
||||
public int getInverts();
|
||||
public void setInverts(int inverts);
|
||||
public int getTriggers();
|
||||
public void setTriggers(int triggers);
|
||||
|
||||
public int getConfigOutputs();
|
||||
public void setConfigOutputs(int outputs);
|
||||
public int getConfigPullups();
|
||||
public void setConfigPullups(int pullups);
|
||||
public int getConfigInverts();
|
||||
public void setConfigInverts(int inverts);
|
||||
public int getConfigTriggers();
|
||||
public void setConfigTriggers(int triggers);
|
||||
|
||||
|
||||
public int getAvailableSnapshots();
|
||||
public int[] getDebounce();
|
||||
public void setDebounce(int[] filters);
|
||||
|
||||
public int[] getWindows();
|
||||
public void setWindows(int[] windows);
|
||||
|
||||
public int getInterval(int iNo);
|
||||
public boolean isIntervalDailyBased(int iNo);
|
||||
public void setInterval(int iNo,int intervall,boolean dailyBase);
|
||||
public int getDailyBaseMask();
|
||||
|
||||
|
||||
public int getHighestSnapShotIndex();
|
||||
public SnapShot[]
|
||||
readSnapShots();
|
||||
public SnapShot readSnapShot();
|
||||
readSnapShots(int startIndex);
|
||||
|
||||
public void reset(int flags);
|
||||
|
||||
public void syncConfigToLive();
|
||||
|
||||
}
|
||||
|
|
|
@ -2,4 +2,10 @@ package org.hwo.pulscounter.device;
|
|||
|
||||
public class NoDeviceConnectionException extends RuntimeException {
|
||||
|
||||
public NoDeviceConnectionException(){
|
||||
|
||||
}
|
||||
public NoDeviceConnectionException(Exception cause){
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.hwo.pulscounter.device;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,7 +22,6 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
private ServiceLink serviceLink;
|
||||
|
||||
private Integer deviceSerial;
|
||||
private Integer indSnapshotOldest;
|
||||
|
||||
public ServiceLinkDeviceConnector() {
|
||||
serviceLink = new ServiceLink(new NewSerialPort("COM1:"));
|
||||
|
@ -112,6 +112,8 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
values[n] = getCounter(n);
|
||||
}
|
||||
|
||||
checkRealTimeClock();
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
|
@ -218,15 +220,43 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
|
||||
@Override
|
||||
public int getInverts() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x0684 );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInverts(int inverts) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
try {
|
||||
serviceLink.writeInt(13, 0, 0x0684, inverts);
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getTriggers(){
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x0685 );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public void setTriggers(int triggers){
|
||||
try {
|
||||
serviceLink.writeInt(13, 0, 0x0685, triggers);
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
log(e);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public float[] getAnalogs() {
|
||||
|
@ -259,69 +289,53 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getAvailableSnapshots() {
|
||||
public int getHighestSnapShotIndex() {
|
||||
Integer s = readDeviceSerial();
|
||||
|
||||
if (s != null){
|
||||
Integer oldest,newest,sssize;
|
||||
|
||||
try {
|
||||
|
||||
if (s.equals(deviceSerial) && (indSnapshotOldest != null)){
|
||||
oldest = indSnapshotOldest;
|
||||
} else {
|
||||
oldest = serviceLink.readInt(13, 0, 0x0580);
|
||||
}
|
||||
|
||||
newest = serviceLink.readInt(13, 0, 0x0581);
|
||||
sssize = serviceLink.readInt(13, 0, 0x0582);
|
||||
|
||||
Integer avail = newest - oldest;
|
||||
if (avail < 0){
|
||||
avail += sssize;
|
||||
}
|
||||
return avail;
|
||||
|
||||
return serviceLink.readInt(13, 0, 0x0581);
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
log(e);
|
||||
log(ERROR,"ServiceLinkDeviceConnector: getHighestSnapShotIndex(): Exception: %s",e.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SnapShot[] readSnapShots() {
|
||||
public SnapShot[] readSnapShots(int startIndex) {
|
||||
Integer s = readDeviceSerial();
|
||||
List<SnapShot> snapshots = new LinkedList<>();
|
||||
|
||||
if (s != null){
|
||||
Integer oldest,newest,sssize;
|
||||
Integer newest,sssize;
|
||||
int ind;
|
||||
Integer id;
|
||||
|
||||
try {
|
||||
|
||||
if (s.equals(deviceSerial) && (indSnapshotOldest != null)){
|
||||
oldest = indSnapshotOldest;
|
||||
} else {
|
||||
oldest = serviceLink.readInt(13, 0, 0x0580);
|
||||
}
|
||||
|
||||
newest = serviceLink.readInt(13, 0, 0x0581);
|
||||
sssize = serviceLink.readInt(13, 0, 0x0582);
|
||||
|
||||
if (newest == null)
|
||||
if ((newest == null) || (sssize == null)){
|
||||
return null;
|
||||
}
|
||||
|
||||
while (!oldest.equals(newest)){
|
||||
|
||||
Integer id;
|
||||
|
||||
if (startIndex < (newest - sssize)){
|
||||
startIndex = newest - sssize;
|
||||
}
|
||||
if (startIndex < 0){
|
||||
startIndex = 0;
|
||||
}
|
||||
|
||||
log(INFO,"ServiceLinkDeviceConnector: reading snapshots [%d ... %d]",startIndex,newest);
|
||||
|
||||
for (ind = startIndex; ind <= newest; ind++){
|
||||
try {
|
||||
serviceLink.writeInt(13, 0, 0x0500, oldest);
|
||||
serviceLink.writeInt(13, 0, 0x0500, ind);
|
||||
id = serviceLink.readInt(13, 0, 0x0500);
|
||||
if (!id.equals(oldest)){
|
||||
log(WARN,"Snapshot could not be selected [%d]",oldest);
|
||||
if (!id.equals(ind)){
|
||||
log(WARN,"Snapshot could not be selected [%d != %d]",ind,id);
|
||||
} else {
|
||||
Integer timestamp,
|
||||
flags,
|
||||
|
@ -341,6 +355,7 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
pu = serviceLink.readInt(13, 0, 0x0505);
|
||||
inv = serviceLink.readInt(13, 0, 0x0506);
|
||||
trigger = serviceLink.readInt(13, 0, 0x0507);
|
||||
id = serviceLink.readInt(13, 0, 0x0530);
|
||||
|
||||
counters = new Integer[32];
|
||||
analogs = new Integer[8];
|
||||
|
@ -355,6 +370,7 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
|
||||
SnapShot ss = new SnapShot(s);
|
||||
ss.setTimestamp(timestamp);
|
||||
ss.setIndex(id);
|
||||
ss.setField0(flags);
|
||||
ss.setInputmask(in);
|
||||
ss.setOutputmask(out);
|
||||
|
@ -376,13 +392,7 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
log(e);
|
||||
}
|
||||
|
||||
oldest++;
|
||||
if (oldest >= sssize){
|
||||
oldest = 0;
|
||||
}
|
||||
}
|
||||
|
||||
indSnapshotOldest = oldest;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
log(e);
|
||||
}
|
||||
|
@ -392,9 +402,274 @@ public class ServiceLinkDeviceConnector implements IDeviceConnector {
|
|||
}
|
||||
|
||||
@Override
|
||||
public SnapShot readSnapShot() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
public int getInterval(int iNo) {
|
||||
checkOpen();
|
||||
|
||||
iNo %= 4;
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x1010 + iNo );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIntervalDailyBased(int iNo) {
|
||||
iNo %= 4;
|
||||
return ((getDailyBaseMask() & (1<<iNo))!=0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInterval(int iNo, int intervall, boolean dailyBase) {
|
||||
checkOpen();
|
||||
|
||||
iNo %= 4;
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x1003 );
|
||||
|
||||
if (dailyBase){
|
||||
v |= (1<<iNo);
|
||||
} else {
|
||||
v &= ~(1<<iNo);
|
||||
}
|
||||
|
||||
serviceLink.writeInt(13, 0, 0x1003, v);
|
||||
serviceLink.writeInt(13, 0, 0x1010 + iNo , intervall);
|
||||
|
||||
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException(e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDailyBaseMask() {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x1003 );
|
||||
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
private int getDebounce(int channel){
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x1020 + channel );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
private void setDebounce(int channel,int value){
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
|
||||
serviceLink.writeInt(13, 0, 0x1020 + channel, value );
|
||||
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDebounce() {
|
||||
int[] filters = new int[32];
|
||||
|
||||
for (int i=0;i<32;i++){
|
||||
filters[i] = getDebounce(i);
|
||||
}
|
||||
|
||||
return filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDebounce(int[] filters) {
|
||||
for (int i=0;i<32;i++){
|
||||
setDebounce(i,filters[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private int getWindow(int channel){
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x1280 + channel );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
private void setWindow(int channel,int value){
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
|
||||
serviceLink.writeInt(13, 0, 0x1280 + channel, value );
|
||||
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int[] getWindows() {
|
||||
int[] windows = new int[32];
|
||||
|
||||
for (int i=0;i<32;i++){
|
||||
windows[i] = getWindow(i);
|
||||
}
|
||||
|
||||
return windows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWindows(int[] windows) {
|
||||
for (int i=0;i<32;i++){
|
||||
setWindow(i,windows[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncConfigToLive() {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
|
||||
serviceLink.writeInt(13, 0, 0x1001, 1 );
|
||||
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset(int flags) {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
serviceLink.writeInt(13, 0, 0x0581, -1 );
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConfigOutputs() {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x1008 );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigOutputs(int outputs) {
|
||||
try {
|
||||
serviceLink.writeInt(13, 0, 0x1008, outputs);
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConfigPullups() {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x1009 );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigPullups(int pullups) {
|
||||
try {
|
||||
serviceLink.writeInt(13, 0, 0x1009, pullups);
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConfigInverts() {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x100A );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigInverts(int inverts) {
|
||||
try {
|
||||
serviceLink.writeInt(13, 0, 0x100A, inverts);
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getConfigTriggers(){
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
Integer v = serviceLink.readInt(13, 0, 0x100B );
|
||||
return v;
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
throw new NoDeviceConnectionException();
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public void setConfigTriggers(int triggers){
|
||||
try {
|
||||
serviceLink.writeInt(13, 0, 0x100B, triggers);
|
||||
} catch (IOException | ServiceLinkException e) {
|
||||
log(e);
|
||||
}
|
||||
};
|
||||
|
||||
public void checkRealTimeClock(){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
try {
|
||||
Integer deviceTime = serviceLink.readInt(13, 0, 0x001C);
|
||||
Long delta = deviceTime - (System.currentTimeMillis()/1000);
|
||||
|
||||
if ((delta < -1) || (delta > 1)){
|
||||
log(INFO,"realtime clock has a %d seconds shift",delta);
|
||||
serviceLink.writeInt((byte)13, (byte)0, 0x001C, (int)(calendar.getTimeInMillis() / 1000L));
|
||||
log(INFO,"realtime clock has been corrected.");
|
||||
|
||||
}
|
||||
} catch (ServiceLinkRequestFailedException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ServiceLinkException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -149,7 +149,58 @@ public class SimulatedCounter implements IDeviceConnector {
|
|||
public void setInverts(int inverts) {
|
||||
this.inverts = inverts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTriggers() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public void setTriggers(int triggers) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConfigOutputs() {
|
||||
return outputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigOutputs(int outputs) {
|
||||
this.outputs = outputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConfigPullups() {
|
||||
return pullups;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigPullups(int pullups) {
|
||||
this.pullups = pullups;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConfigInverts() {
|
||||
return inverts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigInverts(int inverts) {
|
||||
this.inverts = inverts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConfigTriggers() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public void setConfigTriggers(int triggers) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@Override
|
||||
public float[] getAnalogs() {
|
||||
return analogs;
|
||||
|
@ -160,22 +211,75 @@ public class SimulatedCounter implements IDeviceConnector {
|
|||
return analogs[channel];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getAvailableSnapshots() {
|
||||
public int getHighestSnapShotIndex() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SnapShot[] readSnapShots(int startIndex) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInterval(int iNo) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SnapShot[] readSnapShots() {
|
||||
public boolean isIntervalDailyBased(int iNo) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInterval(int iNo, int intervall, boolean dailyBase) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDebounce() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SnapShot readSnapShot() {
|
||||
public void setDebounce(int[] filters) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getWindows() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWindows(int[] windows) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDailyBaseMask() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncConfigToLive() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
public void reset(int flags) {
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import javax.swing.event.ChangeEvent;
|
|||
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;
|
||||
|
@ -25,6 +26,7 @@ import javax.swing.JComboBox;
|
|||
import java.awt.event.ActionListener;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Arrays;
|
||||
import java.awt.event.ActionEvent;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JSpinner;
|
||||
|
@ -43,468 +45,413 @@ import javax.swing.JScrollPane;
|
|||
import javax.swing.JTable;
|
||||
|
||||
public class DeviceConfiguration extends JFrame {
|
||||
};
|
||||
|
||||
private JPanel contentPane;
|
||||
|
||||
|
||||
int currentChannel;
|
||||
private BitFieldEditor bfeIntervall;
|
||||
private JTimeSpanEditor tseI3;
|
||||
private JTimeSpanEditor tseI2;
|
||||
private JTimeSpanEditor tseI1;
|
||||
private JTimeSpanEditor tseI0;
|
||||
|
||||
// private JPanel contentPane;
|
||||
//
|
||||
//
|
||||
// int currentChannel;
|
||||
// private BitFieldEditor bfeIntervall;
|
||||
// private JTimeSpanEditor tseI3;
|
||||
// private JTimeSpanEditor tseI2;
|
||||
// private JTimeSpanEditor tseI1;
|
||||
// private JTimeSpanEditor tseI0;
|
||||
//
|
||||
// private TableMapper tmSettings;
|
||||
//
|
||||
// int outputs,
|
||||
// pullups,
|
||||
// inverts,
|
||||
// trigger;
|
||||
//
|
||||
// int[] filter,
|
||||
// windows;
|
||||
// private JTable tSettings;
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * Create the frame.
|
||||
// */
|
||||
// public DeviceConfiguration() {
|
||||
// setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
// setBounds(100, 100, 860, 498);
|
||||
// contentPane = new JPanel();
|
||||
// contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
// setContentPane(contentPane);
|
||||
// GridBagLayout gbl_contentPane = new GridBagLayout();
|
||||
// gbl_contentPane.columnWidths = new int[] {30, 0, 0};
|
||||
// gbl_contentPane.rowHeights = new int[] {183, 0};
|
||||
// gbl_contentPane.columnWeights = new double[]{1.0, 0.0, 0.0};
|
||||
// gbl_contentPane.rowWeights = new double[]{1.0, 0.0};
|
||||
// contentPane.setLayout(gbl_contentPane);
|
||||
//
|
||||
// JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
||||
// GridBagConstraints gbc_tabbedPane = new GridBagConstraints();
|
||||
// gbc_tabbedPane.gridwidth = 3;
|
||||
// gbc_tabbedPane.fill = GridBagConstraints.BOTH;
|
||||
// gbc_tabbedPane.insets = new Insets(0, 0, 5, 0);
|
||||
// gbc_tabbedPane.gridx = 0;
|
||||
// gbc_tabbedPane.gridy = 0;
|
||||
// contentPane.add(tabbedPane, gbc_tabbedPane);
|
||||
//
|
||||
// JPanel panel_2 = new JPanel();
|
||||
// tabbedPane.addTab("Intervalle", null, panel_2, null);
|
||||
// GridBagLayout gbl_panel_2 = new GridBagLayout();
|
||||
// gbl_panel_2.columnWidths = new int[]{0, 0, 0};
|
||||
// gbl_panel_2.rowHeights = new int[]{0, 0, 0, 0, 0, 0};
|
||||
// gbl_panel_2.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
|
||||
// gbl_panel_2.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
|
||||
// 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.addChangeListener(new ChangeListener() {
|
||||
// public void stateChanged(ChangeEvent e) {
|
||||
// int v = bfeIntervall.getIntValue();
|
||||
// tseI0.setDaysEnabled(((v & 0x01)==0));
|
||||
// tseI1.setDaysEnabled(((v & 0x02)==0));
|
||||
// tseI2.setDaysEnabled(((v & 0x04)==0));
|
||||
// tseI3.setDaysEnabled(((v & 0x08)==0));
|
||||
//
|
||||
// ServiceLink sl = PulsCounterApplication.getApplication().getServiceLink();
|
||||
// try {
|
||||
//
|
||||
// sl.writeInt(13, 0, 0x1003, bfeIntervall.getIntValue());
|
||||
//
|
||||
// } catch (ServiceLinkRequestFailedException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (IOException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (ServiceLinkException e1) {
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// JLabel lblTageszeitabhngigkeit = new JLabel("Tageszeitabhängigkeit:");
|
||||
// GridBagConstraints gbc_lblTageszeitabhngigkeit = new GridBagConstraints();
|
||||
// gbc_lblTageszeitabhngigkeit.fill = GridBagConstraints.HORIZONTAL;
|
||||
// gbc_lblTageszeitabhngigkeit.insets = new Insets(0, 0, 5, 5);
|
||||
// gbc_lblTageszeitabhngigkeit.gridx = 0;
|
||||
// gbc_lblTageszeitabhngigkeit.gridy = 0;
|
||||
// panel_2.add(lblTageszeitabhngigkeit, gbc_lblTageszeitabhngigkeit);
|
||||
// GridBagConstraints gbc_bfeIntervall = new GridBagConstraints();
|
||||
// gbc_bfeIntervall.anchor = GridBagConstraints.NORTH;
|
||||
// gbc_bfeIntervall.insets = new Insets(0, 0, 5, 0);
|
||||
// gbc_bfeIntervall.fill = GridBagConstraints.HORIZONTAL;
|
||||
// gbc_bfeIntervall.gridx = 1;
|
||||
// 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>");
|
||||
// GridBagConstraints gbc_lblIntervall = new GridBagConstraints();
|
||||
// gbc_lblIntervall.fill = GridBagConstraints.HORIZONTAL;
|
||||
// gbc_lblIntervall.insets = new Insets(0, 0, 5, 5);
|
||||
// gbc_lblIntervall.gridx = 0;
|
||||
// gbc_lblIntervall.gridy = 1;
|
||||
// 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.addFocusListener(new FocusAdapter() {
|
||||
// @Override
|
||||
// public void focusLost(FocusEvent e) {
|
||||
// System.err.println("FOCUS LOST 0");
|
||||
// ServiceLink sl = PulsCounterApplication.getApplication().getServiceLink();
|
||||
// try {
|
||||
//
|
||||
// sl.writeInt(13, 0, 0x1010, (Integer)tseI0.getValue());
|
||||
//
|
||||
// } catch (ServiceLinkRequestFailedException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (IOException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (ServiceLinkException e1) {
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// GridBagConstraints gbc_tseI0 = new GridBagConstraints();
|
||||
// gbc_tseI0.anchor = GridBagConstraints.WEST;
|
||||
// gbc_tseI0.insets = new Insets(0, 0, 5, 0);
|
||||
// gbc_tseI0.gridx = 1;
|
||||
// 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>");
|
||||
// GridBagConstraints gbc_lblIntervall_1 = new GridBagConstraints();
|
||||
// gbc_lblIntervall_1.fill = GridBagConstraints.HORIZONTAL;
|
||||
// gbc_lblIntervall_1.insets = new Insets(0, 0, 5, 5);
|
||||
// gbc_lblIntervall_1.gridx = 0;
|
||||
// gbc_lblIntervall_1.gridy = 2;
|
||||
// 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.addFocusListener(new FocusAdapter() {
|
||||
// @Override
|
||||
// public void focusLost(FocusEvent e) {
|
||||
//
|
||||
// ServiceLink sl = PulsCounterApplication.getApplication().getServiceLink();
|
||||
// try {
|
||||
//
|
||||
// sl.writeInt(13, 0, 0x1011, (Integer)tseI1.getValue());
|
||||
//
|
||||
// } catch (ServiceLinkRequestFailedException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (IOException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (ServiceLinkException e1) {
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// GridBagConstraints gbc_tseI1 = new GridBagConstraints();
|
||||
// gbc_tseI1.anchor = GridBagConstraints.WEST;
|
||||
// gbc_tseI1.insets = new Insets(0, 0, 5, 0);
|
||||
// gbc_tseI1.gridx = 1;
|
||||
// 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>");
|
||||
// GridBagConstraints gbc_lblIntervall_2 = new GridBagConstraints();
|
||||
// gbc_lblIntervall_2.fill = GridBagConstraints.HORIZONTAL;
|
||||
// gbc_lblIntervall_2.insets = new Insets(0, 0, 5, 5);
|
||||
// gbc_lblIntervall_2.gridx = 0;
|
||||
// gbc_lblIntervall_2.gridy = 3;
|
||||
// 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.addFocusListener(new FocusAdapter() {
|
||||
// @Override
|
||||
// public void focusLost(FocusEvent e) {
|
||||
// ServiceLink sl = PulsCounterApplication.getApplication().getServiceLink();
|
||||
// try {
|
||||
//
|
||||
// sl.writeInt(13, 0, 0x1012, (Integer)tseI2.getValue());
|
||||
//
|
||||
// } catch (ServiceLinkRequestFailedException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (IOException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (ServiceLinkException e1) {
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// GridBagConstraints gbc_tseI2 = new GridBagConstraints();
|
||||
// gbc_tseI2.anchor = GridBagConstraints.WEST;
|
||||
// gbc_tseI2.insets = new Insets(0, 0, 5, 0);
|
||||
// gbc_tseI2.gridx = 1;
|
||||
// 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>");
|
||||
// GridBagConstraints gbc_lblIntervall_3 = new GridBagConstraints();
|
||||
// gbc_lblIntervall_3.fill = GridBagConstraints.HORIZONTAL;
|
||||
// gbc_lblIntervall_3.insets = new Insets(0, 0, 0, 5);
|
||||
// gbc_lblIntervall_3.gridx = 0;
|
||||
// gbc_lblIntervall_3.gridy = 4;
|
||||
// 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.addFocusListener(new FocusAdapter() {
|
||||
// @Override
|
||||
// public void focusLost(FocusEvent e) {
|
||||
// ServiceLink sl = PulsCounterApplication.getApplication().getServiceLink();
|
||||
// try {
|
||||
//
|
||||
// sl.writeInt(13, 0, 0x1013, (Integer)tseI3.getValue());
|
||||
//
|
||||
// } catch (ServiceLinkRequestFailedException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (IOException e1) {
|
||||
// e1.printStackTrace();
|
||||
// } catch (ServiceLinkException e1) {
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// GridBagConstraints gbc_tseI3 = new GridBagConstraints();
|
||||
// gbc_tseI3.anchor = GridBagConstraints.WEST;
|
||||
// gbc_tseI3.gridx = 1;
|
||||
// gbc_tseI3.gridy = 4;
|
||||
// panel_2.add(tseI3, gbc_tseI3);
|
||||
//
|
||||
// JPanel panel_1 = new JPanel();
|
||||
// tabbedPane.addTab("Kanäle", null, panel_1, null);
|
||||
// GridBagLayout gbl_panel_1 = new GridBagLayout();
|
||||
// gbl_panel_1.columnWidths = new int[] {100};
|
||||
// gbl_panel_1.rowHeights = new int[] {30};
|
||||
// gbl_panel_1.columnWeights = new double[]{1.0};
|
||||
// gbl_panel_1.rowWeights = new double[]{1.0};
|
||||
// panel_1.setLayout(gbl_panel_1);
|
||||
//
|
||||
// JScrollPane scrollPane = new JScrollPane();
|
||||
// GridBagConstraints gbc_scrollPane = new GridBagConstraints();
|
||||
// gbc_scrollPane.fill = GridBagConstraints.BOTH;
|
||||
// gbc_scrollPane.gridx = 0;
|
||||
// gbc_scrollPane.gridy = 0;
|
||||
// panel_1.add(scrollPane, gbc_scrollPane);
|
||||
//
|
||||
// tSettings = new JTable();
|
||||
// tSettings.setRowHeight(32);
|
||||
// tSettings.setFillsViewportHeight(true);
|
||||
// tSettings.setCellSelectionEnabled(true);
|
||||
// scrollPane.setViewportView(tSettings);
|
||||
//
|
||||
// JButton btnSchliessen = new JButton("abbrechen");
|
||||
// btnSchliessen.addActionListener(new ActionListener() {
|
||||
// public void actionPerformed(ActionEvent e) {
|
||||
// setVisible(false);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// JButton btnOk = new JButton("OK");
|
||||
// btnOk.addActionListener(new ActionListener() {
|
||||
// public void actionPerformed(ActionEvent e) {
|
||||
// writeDevice();
|
||||
// setVisible(false);
|
||||
// }
|
||||
// });
|
||||
// GridBagConstraints gbc_btnOk = new GridBagConstraints();
|
||||
// gbc_btnOk.fill = GridBagConstraints.BOTH;
|
||||
// gbc_btnOk.insets = new Insets(0, 0, 0, 5);
|
||||
// gbc_btnOk.gridx = 1;
|
||||
// gbc_btnOk.gridy = 1;
|
||||
// contentPane.add(btnOk, gbc_btnOk);
|
||||
// GridBagConstraints gbc_btnSchliessen = new GridBagConstraints();
|
||||
// gbc_btnSchliessen.fill = GridBagConstraints.BOTH;
|
||||
// gbc_btnSchliessen.gridx = 2;
|
||||
// gbc_btnSchliessen.gridy = 1;
|
||||
// contentPane.add(btnSchliessen, gbc_btnSchliessen);
|
||||
//
|
||||
// this.initialize();
|
||||
// }
|
||||
//
|
||||
// private Integer intOr0(Integer i){
|
||||
// if (i==null)
|
||||
// return 0;
|
||||
// return i;
|
||||
// }
|
||||
//
|
||||
// private void initialize(){
|
||||
// currentChannel = -1;
|
||||
// filter = new int[32];
|
||||
// windows = new int[32];
|
||||
// tmSettings = new TableMapper(ChannelConfiguration.class, tSettings);
|
||||
//
|
||||
// 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"));
|
||||
// bfeIntervall.setBitField(bf);
|
||||
// for (int i=0;i<32;i++){
|
||||
// tmSettings.addRow(new ChannelConfiguration(i));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// readDevice();
|
||||
// }
|
||||
//
|
||||
// private void readDevice(){
|
||||
// Integer v;
|
||||
//
|
||||
// ServiceLink sl = PulsCounterApplication.getApplication().getServiceLink();
|
||||
//
|
||||
// outputs = intOr0(sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1008));
|
||||
// pullups = intOr0(sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1009));
|
||||
// inverts = intOr0(sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x100A));
|
||||
// trigger = intOr0(sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x100B));
|
||||
//
|
||||
// bfeIntervall.setIntValue(sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1003));
|
||||
//
|
||||
// for (int i=0;i<32;i++){
|
||||
// filter[i] = intOr0( sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1020 + i));
|
||||
// windows[i] = intOr0( sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1280 + i));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// v = sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1010);
|
||||
// if (v!=null){
|
||||
// tseI0.setValue(v);
|
||||
// }
|
||||
// v = sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1011);
|
||||
// if (v!=null){
|
||||
// tseI1.setValue(v);
|
||||
// }
|
||||
// v = sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1012);
|
||||
// if (v!=null){
|
||||
// tseI2.setValue(v);
|
||||
// }
|
||||
// v = sl.getServiceRegisterCache().getCachedInteger(13, 0, 0x1013);
|
||||
// if (v!=null){
|
||||
// tseI3.setValue(v);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private void writeDevice(){
|
||||
// ServiceLink sl = PulsCounterApplication.getApplication().getServiceLink();
|
||||
// try {
|
||||
// sl.writeInt(13, 0, 0x1008, outputs);
|
||||
// sl.writeInt(13, 0, 0x1009, pullups);
|
||||
// sl.writeInt(13, 0, 0x100A, inverts);
|
||||
// sl.writeInt(13, 0, 0x100B, trigger);
|
||||
//
|
||||
// sl.writeInt(13, 0, 0x1003, bfeIntervall.getIntValue());
|
||||
//
|
||||
// for (int i=0;i<32;i++){
|
||||
// sl.writeInt(13, 0, 0x1020 + i, filter[i]);
|
||||
// sl.writeInt(13, 0, 0x1280 + i, windows[i]);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// sl.writeInt(13, 0, 0x1010, tseI0.getValue());
|
||||
// sl.writeInt(13, 0, 0x1011, tseI1.getValue());
|
||||
// sl.writeInt(13, 0, 0x1012, tseI2.getValue());
|
||||
// sl.writeInt(13, 0, 0x1013, tseI3.getValue());
|
||||
//
|
||||
// /* Konfiguration auf Live-System übertragen */
|
||||
// sl.writeInt(13, 0, 0x1001, 1);
|
||||
// } catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// class ChannelConfiguration{
|
||||
//
|
||||
// int channel;
|
||||
//
|
||||
// public ChannelConfiguration(int channel) {
|
||||
// this.channel = channel;
|
||||
// }
|
||||
//
|
||||
// @TableColumn(label="Channel",width=80,order=0)
|
||||
// public int getChannel(){
|
||||
// return channel;
|
||||
// }
|
||||
//
|
||||
// @TableColumn(label="Ausgang",width=80,order=10)
|
||||
// public Boolean getOutput(){
|
||||
// return (outputs & 1<<channel) == 0 ? false : true;
|
||||
// }
|
||||
// public void setOutput(Boolean value){
|
||||
// outputs &= ~(1<<channel);
|
||||
// if (value){
|
||||
// outputs |= (1<<channel);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @TableColumn(label="Passiver Schalter",width=80,order=20)
|
||||
// public Boolean getPullup(){
|
||||
// return (pullups & 1<<channel) == 0 ? false : true;
|
||||
// }
|
||||
// public void setPullup(Boolean value){
|
||||
// pullups &= ~(1<<channel);
|
||||
// if (value){
|
||||
// pullups |= (1<<channel);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @TableColumn(label="Invertiert",width=80,order=30)
|
||||
// public Boolean getInvert(){
|
||||
// return (inverts & 1<<channel) == 0 ? false : true;
|
||||
// }
|
||||
// public void setInvert(Boolean value){
|
||||
// inverts &= ~(1<<channel);
|
||||
// if (value){
|
||||
// inverts |= (1<<channel);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @TableColumn(label="Löst Snapshot aus",width=80,order=40)
|
||||
// public Boolean getTrigger(){
|
||||
// return (trigger & 1<<channel) == 0 ? false : true;
|
||||
// }
|
||||
// public void setTrigger(Boolean value){
|
||||
// trigger &= ~(1<<channel);
|
||||
// if (value){
|
||||
// trigger |= (1<<channel);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @TableColumn(label="Signalfenster",width=80,order=200)
|
||||
// public Integer getWindow(){
|
||||
// return windows[channel];
|
||||
// }
|
||||
// public void setWindow(Integer value){
|
||||
// windows[channel] = value;
|
||||
// }
|
||||
//
|
||||
// @TableColumn(label="Signalfilter",width=80,order=210)
|
||||
// public Integer getFilter(){
|
||||
// return filter[channel];
|
||||
// }
|
||||
// public void setFilter(Integer value){
|
||||
// filter[channel] = value;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
private TableMapper tmSettings;
|
||||
|
||||
int outputs,
|
||||
pullups,
|
||||
inverts,
|
||||
trigger;
|
||||
|
||||
int[] filter,
|
||||
windows;
|
||||
private JTable tSettings;
|
||||
|
||||
private IDeviceConnector deviceConnector;
|
||||
|
||||
/**
|
||||
* Create the frame.
|
||||
*/
|
||||
public DeviceConfiguration(IDeviceConnector deviceConnector) {
|
||||
this.deviceConnector = deviceConnector;
|
||||
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
setBounds(100, 100, 860, 498);
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
setContentPane(contentPane);
|
||||
GridBagLayout gbl_contentPane = new GridBagLayout();
|
||||
gbl_contentPane.columnWidths = new int[] {30, 0, 0};
|
||||
gbl_contentPane.rowHeights = new int[] {183, 0};
|
||||
gbl_contentPane.columnWeights = new double[]{1.0, 0.0, 0.0};
|
||||
gbl_contentPane.rowWeights = new double[]{1.0, 0.0};
|
||||
contentPane.setLayout(gbl_contentPane);
|
||||
|
||||
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
||||
GridBagConstraints gbc_tabbedPane = new GridBagConstraints();
|
||||
gbc_tabbedPane.gridwidth = 3;
|
||||
gbc_tabbedPane.fill = GridBagConstraints.BOTH;
|
||||
gbc_tabbedPane.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_tabbedPane.gridx = 0;
|
||||
gbc_tabbedPane.gridy = 0;
|
||||
contentPane.add(tabbedPane, gbc_tabbedPane);
|
||||
|
||||
JPanel panel_2 = new JPanel();
|
||||
tabbedPane.addTab("Intervalle", null, panel_2, null);
|
||||
GridBagLayout gbl_panel_2 = new GridBagLayout();
|
||||
gbl_panel_2.columnWidths = new int[]{0, 0, 0};
|
||||
gbl_panel_2.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0};
|
||||
gbl_panel_2.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
|
||||
gbl_panel_2.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
|
||||
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.addChangeListener(new ChangeListener() {
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
int v = bfeIntervall.getIntValue();
|
||||
tseI0.setDaysEnabled(((v & 0x01)==0));
|
||||
tseI1.setDaysEnabled(((v & 0x02)==0));
|
||||
tseI2.setDaysEnabled(((v & 0x04)==0));
|
||||
tseI3.setDaysEnabled(((v & 0x08)==0));
|
||||
}
|
||||
});
|
||||
|
||||
JLabel lblTageszeitabhngigkeit = new JLabel("Tageszeitabhängigkeit:");
|
||||
GridBagConstraints gbc_lblTageszeitabhngigkeit = new GridBagConstraints();
|
||||
gbc_lblTageszeitabhngigkeit.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblTageszeitabhngigkeit.insets = new Insets(0, 0, 5, 5);
|
||||
gbc_lblTageszeitabhngigkeit.gridx = 0;
|
||||
gbc_lblTageszeitabhngigkeit.gridy = 0;
|
||||
panel_2.add(lblTageszeitabhngigkeit, gbc_lblTageszeitabhngigkeit);
|
||||
GridBagConstraints gbc_bfeIntervall = new GridBagConstraints();
|
||||
gbc_bfeIntervall.anchor = GridBagConstraints.NORTH;
|
||||
gbc_bfeIntervall.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_bfeIntervall.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_bfeIntervall.gridx = 1;
|
||||
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>");
|
||||
GridBagConstraints gbc_lblIntervall = new GridBagConstraints();
|
||||
gbc_lblIntervall.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblIntervall.insets = new Insets(0, 0, 5, 5);
|
||||
gbc_lblIntervall.gridx = 0;
|
||||
gbc_lblIntervall.gridy = 1;
|
||||
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.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
}
|
||||
});
|
||||
GridBagConstraints gbc_tseI0 = new GridBagConstraints();
|
||||
gbc_tseI0.anchor = GridBagConstraints.WEST;
|
||||
gbc_tseI0.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_tseI0.gridx = 1;
|
||||
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>");
|
||||
GridBagConstraints gbc_lblIntervall_1 = new GridBagConstraints();
|
||||
gbc_lblIntervall_1.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblIntervall_1.insets = new Insets(0, 0, 5, 5);
|
||||
gbc_lblIntervall_1.gridx = 0;
|
||||
gbc_lblIntervall_1.gridy = 2;
|
||||
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.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
}
|
||||
});
|
||||
GridBagConstraints gbc_tseI1 = new GridBagConstraints();
|
||||
gbc_tseI1.anchor = GridBagConstraints.WEST;
|
||||
gbc_tseI1.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_tseI1.gridx = 1;
|
||||
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>");
|
||||
GridBagConstraints gbc_lblIntervall_2 = new GridBagConstraints();
|
||||
gbc_lblIntervall_2.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblIntervall_2.insets = new Insets(0, 0, 5, 5);
|
||||
gbc_lblIntervall_2.gridx = 0;
|
||||
gbc_lblIntervall_2.gridy = 3;
|
||||
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.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
}
|
||||
});
|
||||
GridBagConstraints gbc_tseI2 = new GridBagConstraints();
|
||||
gbc_tseI2.anchor = GridBagConstraints.WEST;
|
||||
gbc_tseI2.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_tseI2.gridx = 1;
|
||||
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>");
|
||||
GridBagConstraints gbc_lblIntervall_3 = new GridBagConstraints();
|
||||
gbc_lblIntervall_3.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_lblIntervall_3.insets = new Insets(0, 0, 5, 5);
|
||||
gbc_lblIntervall_3.gridx = 0;
|
||||
gbc_lblIntervall_3.gridy = 4;
|
||||
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.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
}
|
||||
});
|
||||
GridBagConstraints gbc_tseI3 = new GridBagConstraints();
|
||||
gbc_tseI3.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_tseI3.anchor = GridBagConstraints.WEST;
|
||||
gbc_tseI3.gridx = 1;
|
||||
gbc_tseI3.gridy = 4;
|
||||
panel_2.add(tseI3, gbc_tseI3);
|
||||
|
||||
JButton btnSnapshotSpeicherZurcksetzen = new JButton("SnapShot Speicher zurücksetzen");
|
||||
btnSnapshotSpeicherZurcksetzen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
resetSnapShots();
|
||||
}
|
||||
});
|
||||
GridBagConstraints gbc_btnSnapshotSpeicherZurcksetzen = new GridBagConstraints();
|
||||
gbc_btnSnapshotSpeicherZurcksetzen.gridwidth = 2;
|
||||
gbc_btnSnapshotSpeicherZurcksetzen.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_btnSnapshotSpeicherZurcksetzen.insets = new Insets(0, 0, 5, 5);
|
||||
gbc_btnSnapshotSpeicherZurcksetzen.gridx = 0;
|
||||
gbc_btnSnapshotSpeicherZurcksetzen.gridy = 5;
|
||||
panel_2.add(btnSnapshotSpeicherZurcksetzen, gbc_btnSnapshotSpeicherZurcksetzen);
|
||||
|
||||
JButton btnAlleZhlerLschen = new JButton("Alle Zähler zurücksetzen");
|
||||
btnAlleZhlerLschen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
resetCounters();
|
||||
}
|
||||
});
|
||||
GridBagConstraints gbc_btnAlleZhlerLschen = new GridBagConstraints();
|
||||
gbc_btnAlleZhlerLschen.gridwidth = 2;
|
||||
gbc_btnAlleZhlerLschen.fill = GridBagConstraints.HORIZONTAL;
|
||||
gbc_btnAlleZhlerLschen.insets = new Insets(0, 0, 0, 5);
|
||||
gbc_btnAlleZhlerLschen.gridx = 0;
|
||||
gbc_btnAlleZhlerLschen.gridy = 6;
|
||||
panel_2.add(btnAlleZhlerLschen, gbc_btnAlleZhlerLschen);
|
||||
|
||||
JPanel panel_1 = new JPanel();
|
||||
tabbedPane.addTab("Kanäle", null, panel_1, null);
|
||||
GridBagLayout gbl_panel_1 = new GridBagLayout();
|
||||
gbl_panel_1.columnWidths = new int[] {100};
|
||||
gbl_panel_1.rowHeights = new int[] {30};
|
||||
gbl_panel_1.columnWeights = new double[]{1.0};
|
||||
gbl_panel_1.rowWeights = new double[]{1.0};
|
||||
panel_1.setLayout(gbl_panel_1);
|
||||
|
||||
JScrollPane scrollPane = new JScrollPane();
|
||||
GridBagConstraints gbc_scrollPane = new GridBagConstraints();
|
||||
gbc_scrollPane.fill = GridBagConstraints.BOTH;
|
||||
gbc_scrollPane.gridx = 0;
|
||||
gbc_scrollPane.gridy = 0;
|
||||
panel_1.add(scrollPane, gbc_scrollPane);
|
||||
|
||||
tSettings = new JTable();
|
||||
tSettings.setRowHeight(32);
|
||||
tSettings.setFillsViewportHeight(true);
|
||||
tSettings.setCellSelectionEnabled(true);
|
||||
scrollPane.setViewportView(tSettings);
|
||||
|
||||
JButton btnSchliessen = new JButton("abbrechen");
|
||||
btnSchliessen.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
|
||||
JButton btnOk = new JButton("OK");
|
||||
btnOk.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
writeDevice();
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
GridBagConstraints gbc_btnOk = new GridBagConstraints();
|
||||
gbc_btnOk.fill = GridBagConstraints.BOTH;
|
||||
gbc_btnOk.insets = new Insets(0, 0, 0, 5);
|
||||
gbc_btnOk.gridx = 1;
|
||||
gbc_btnOk.gridy = 1;
|
||||
contentPane.add(btnOk, gbc_btnOk);
|
||||
GridBagConstraints gbc_btnSchliessen = new GridBagConstraints();
|
||||
gbc_btnSchliessen.fill = GridBagConstraints.BOTH;
|
||||
gbc_btnSchliessen.gridx = 2;
|
||||
gbc_btnSchliessen.gridy = 1;
|
||||
contentPane.add(btnSchliessen, gbc_btnSchliessen);
|
||||
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
private Integer intOr0(Integer i){
|
||||
if (i==null)
|
||||
return 0;
|
||||
return i;
|
||||
}
|
||||
|
||||
private void initialize(){
|
||||
currentChannel = -1;
|
||||
filter = new int[32];
|
||||
windows = new int[32];
|
||||
tmSettings = new TableMapper(ChannelConfiguration.class, tSettings);
|
||||
|
||||
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"));
|
||||
bfeIntervall.setBitField(bf);
|
||||
for (int i=0;i<32;i++){
|
||||
tmSettings.addRow(new ChannelConfiguration(i));
|
||||
}
|
||||
|
||||
|
||||
readDevice();
|
||||
}
|
||||
|
||||
private void resetSnapShots(){
|
||||
deviceConnector.reset(0);
|
||||
}
|
||||
|
||||
private void resetCounters(){
|
||||
int[] zero = new int[32];
|
||||
Arrays.fill(zero, 0);
|
||||
deviceConnector.setCounters(zero);
|
||||
}
|
||||
|
||||
private void readDevice(){
|
||||
Integer v;
|
||||
|
||||
outputs = intOr0(deviceConnector.getConfigOutputs());
|
||||
pullups = intOr0(deviceConnector.getConfigPullups());
|
||||
inverts = intOr0(deviceConnector.getConfigInverts());
|
||||
trigger = intOr0(deviceConnector.getConfigTriggers());
|
||||
|
||||
bfeIntervall.setIntValue(deviceConnector.getDailyBaseMask());
|
||||
|
||||
filter = deviceConnector.getDebounce();
|
||||
windows = deviceConnector.getWindows();
|
||||
|
||||
tseI0.setValue( deviceConnector.getInterval(0) );
|
||||
tseI1.setValue( deviceConnector.getInterval(1) );
|
||||
tseI2.setValue( deviceConnector.getInterval(2) );
|
||||
tseI3.setValue( deviceConnector.getInterval(3) );
|
||||
}
|
||||
|
||||
private void writeDevice(){
|
||||
|
||||
deviceConnector.setInterval(0, tseI0.getValue(), ((bfeIntervall.getIntValue() & (1<<0)) != 0) ? true : false);
|
||||
deviceConnector.setInterval(1, tseI1.getValue(), ((bfeIntervall.getIntValue() & (1<<1)) != 0) ? true : false);
|
||||
deviceConnector.setInterval(2, tseI2.getValue(), ((bfeIntervall.getIntValue() & (1<<2)) != 0) ? true : false);
|
||||
deviceConnector.setInterval(3, tseI3.getValue(), ((bfeIntervall.getIntValue() & (1<<3)) != 0) ? true : false);
|
||||
|
||||
deviceConnector.setConfigOutputs(outputs);
|
||||
deviceConnector.setConfigPullups(pullups);
|
||||
deviceConnector.setConfigInverts(inverts);
|
||||
deviceConnector.setConfigTriggers(trigger);
|
||||
|
||||
deviceConnector.setDebounce(filter);
|
||||
deviceConnector.setWindows(windows);
|
||||
|
||||
deviceConnector.syncConfigToLive();
|
||||
}
|
||||
|
||||
class ChannelConfiguration{
|
||||
|
||||
int channel;
|
||||
|
||||
public ChannelConfiguration(int channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
@TableColumn(label="Channel",width=80,order=0)
|
||||
public int getChannel(){
|
||||
return channel;
|
||||
}
|
||||
|
||||
@TableColumn(label="Ausgang",width=80,order=10)
|
||||
public Boolean getOutput(){
|
||||
return (outputs & 1<<channel) == 0 ? false : true;
|
||||
}
|
||||
public void setOutput(Boolean value){
|
||||
outputs &= ~(1<<channel);
|
||||
if (value){
|
||||
outputs |= (1<<channel);
|
||||
}
|
||||
}
|
||||
|
||||
@TableColumn(label="Passiver Schalter",width=80,order=20)
|
||||
public Boolean getPullup(){
|
||||
return (pullups & 1<<channel) == 0 ? false : true;
|
||||
}
|
||||
public void setPullup(Boolean value){
|
||||
pullups &= ~(1<<channel);
|
||||
if (value){
|
||||
pullups |= (1<<channel);
|
||||
}
|
||||
}
|
||||
|
||||
@TableColumn(label="Invertiert",width=80,order=30)
|
||||
public Boolean getInvert(){
|
||||
return (inverts & 1<<channel) == 0 ? false : true;
|
||||
}
|
||||
public void setInvert(Boolean value){
|
||||
inverts &= ~(1<<channel);
|
||||
if (value){
|
||||
inverts |= (1<<channel);
|
||||
}
|
||||
}
|
||||
|
||||
@TableColumn(label="Löst Snapshot aus",width=80,order=40)
|
||||
public Boolean getTrigger(){
|
||||
return (trigger & 1<<channel) == 0 ? false : true;
|
||||
}
|
||||
public void setTrigger(Boolean value){
|
||||
trigger &= ~(1<<channel);
|
||||
if (value){
|
||||
trigger |= (1<<channel);
|
||||
}
|
||||
}
|
||||
|
||||
@TableColumn(label="Signalfenster",width=80,order=200)
|
||||
public Integer getWindow(){
|
||||
return windows[channel];
|
||||
}
|
||||
public void setWindow(Integer value){
|
||||
windows[channel] = value;
|
||||
}
|
||||
|
||||
@TableColumn(label="Signalfilter",width=80,order=210)
|
||||
public Integer getFilter(){
|
||||
return filter[channel];
|
||||
}
|
||||
public void setFilter(Integer value){
|
||||
filter[channel] = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.hwo.tasklet.TaskletListener;
|
|||
import org.hwo.tasklet.TaskletManager;
|
||||
import org.hwo.ui.JObjectSelector;
|
||||
import org.hwo.ui.dialog.SerialPortChooser;
|
||||
import org.hwo.ui.states.WindowStateManager;
|
||||
import org.omg.CORBA.Environment;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
|
@ -94,7 +95,6 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
|
||||
private JFrame frmSynolog;
|
||||
private JSplitPane splitter;
|
||||
private JButton btnSetup;
|
||||
|
||||
private DefaultListModel<String> messageListModel;
|
||||
private JList lMessages;
|
||||
|
@ -188,7 +188,11 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
|
||||
|
||||
frmSynolog.addWindowListener(new WindowAdapter() {
|
||||
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
saveState();
|
||||
}
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
backgroundThread.exit();
|
||||
|
@ -206,9 +210,33 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
backgroundThread = new BackgroundThread();
|
||||
backgroundThread.start();
|
||||
|
||||
|
||||
restoreState();
|
||||
|
||||
frmSynolog.setVisible(true);
|
||||
}
|
||||
|
||||
private void restoreState(){
|
||||
String state = application().getApplicationConfiguration().getProperty("ui.NewMainWindow.state");
|
||||
if (state != null){
|
||||
WindowStateManager wsm = new WindowStateManager();
|
||||
wsm.applyState(this.frmSynolog, state);
|
||||
log(INFO,"UI state restored");
|
||||
} else {
|
||||
log(INFO,"UI state information not found");
|
||||
}
|
||||
}
|
||||
|
||||
private void saveState(){
|
||||
WindowStateManager wsm = new WindowStateManager();
|
||||
String state = wsm.saveState(frmSynolog);
|
||||
if (state != null){
|
||||
application().getApplicationConfiguration().setProperty("ui.NewMainWindow.state", state);
|
||||
log(INFO,"UI state was saved");
|
||||
} else {
|
||||
log(ERROR,"UI State was not saved");
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeChannelPanels(){
|
||||
channelDisplays = new ChannelDisplay[32];
|
||||
|
@ -275,32 +303,19 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
toolBar.setFloatable(false);
|
||||
frmSynolog.getContentPane().add(toolBar, BorderLayout.NORTH);
|
||||
|
||||
btnSetup = new JButton("S");
|
||||
btnSetup.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
AppSettingsFrame asf = new AppSettingsFrame();
|
||||
asf.setModalityType(ModalityType.APPLICATION_MODAL);
|
||||
|
||||
// if ((e.getModifiers() & ActionEvent.CTRL_MASK) != 0)
|
||||
// asf.debugging();
|
||||
|
||||
asf.setVisible(true);
|
||||
}
|
||||
});
|
||||
btnSetup.setToolTipText("<html>\n<b>Einstellungen</b><br/>\n<br/>\nEinstellungen der Synololog PC Software ändern.\n</html>");
|
||||
toolBar.add(btnSetup);
|
||||
|
||||
btnC = new JButton("C");
|
||||
btnC = new JButton("Synololog einstellen");
|
||||
btnC.setToolTipText("<html>\n<b>Konfiguration</b><br/>\n<br/>\nKonfiguration des Synololog bearbeiten.\n</html>");
|
||||
btnC.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
DeviceConfiguration cc = new DeviceConfiguration();
|
||||
cc.setVisible(true);
|
||||
if (selectedDeviceInterface != null){
|
||||
DeviceConfiguration cc = new DeviceConfiguration(selectedDeviceInterface);
|
||||
cc.setVisible(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
toolBar.add(btnC);
|
||||
|
||||
btnDatenExportieren = new JButton("Daten exportieren...");
|
||||
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.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
@ -913,6 +928,9 @@ public class NewMainWindow implements PulsCounterApplicationListener, TaskletLis
|
|||
}
|
||||
|
||||
} catch (InterruptedException e){
|
||||
} catch (Exception e){
|
||||
log(ERROR,"Unexpected Exception in backgroundThread: %s", e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue