2016-09-06 16:49:11 +02:00
package org.hwo.pulscounter.ui ;
import java.awt.BorderLayout ;
import java.awt.EventQueue ;
import javax.swing.JFrame ;
import javax.swing.JPanel ;
import javax.swing.border.EmptyBorder ;
import javax.swing.event.ChangeEvent ;
import javax.swing.event.ChangeListener ;
2016-09-08 18:47:31 +02:00
import org.hwo.pulscounter.PulsCounterApplication ;
2016-09-15 16:52:11 +02:00
import org.hwo.pulscounter.device.IDeviceConnector ;
2016-09-06 16:49:11 +02:00
import org.hwo.servicelink.ServiceLink ;
import org.hwo.servicelink.ServiceLinkException ;
import org.hwo.servicelink.ServiceLinkRequestFailedException ;
import java.awt.GridLayout ;
import javax.swing.JTabbedPane ;
import java.awt.GridBagLayout ;
import java.awt.GridBagConstraints ;
import javax.swing.JLabel ;
import java.awt.Insets ;
import java.awt.Dimension ;
import javax.swing.JComboBox ;
import java.awt.event.ActionListener ;
import java.io.IOException ;
import java.math.BigInteger ;
2016-09-15 16:52:11 +02:00
import java.util.Arrays ;
2016-09-06 16:49:11 +02:00
import java.awt.event.ActionEvent ;
import javax.swing.JCheckBox ;
import javax.swing.JSpinner ;
import javax.swing.SpinnerNumberModel ;
import javax.swing.JButton ;
import org.hwo.bitfields.BitField ;
import org.hwo.bitfields.Field ;
import org.hwo.bitfields.ui.BitFieldEditor ;
import org.hwo.models.TableMapper.TableColumn ;
import org.hwo.models.TableMapper.TableMapper ;
import org.hwo.ui.JTimeSpanEditor ;
import java.awt.event.FocusAdapter ;
import java.awt.event.FocusEvent ;
import javax.swing.JScrollPane ;
import javax.swing.JTable ;
public class DeviceConfiguration extends JFrame {
2016-09-15 16:52:11 +02:00
private JPanel contentPane ;
int currentChannel ;
private BitFieldEditor bfeIntervall ;
private JTimeSpanEditor tseI3 ;
private JTimeSpanEditor tseI2 ;
private JTimeSpanEditor tseI1 ;
private JTimeSpanEditor tseI0 ;
2016-09-06 16:49:11 +02:00
2016-09-15 16:52:11 +02:00
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 } ;
2016-10-06 10:57:31 +02:00
gbl_panel_2 . rowHeights = new int [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
2016-09-15 16:52:11 +02:00
gbl_panel_2 . columnWeights = new double [ ] { 0.0 , 1.0 , Double . MIN_VALUE } ;
2016-10-06 10:57:31 +02:00
gbl_panel_2 . rowWeights = new double [ ] { 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , Double . MIN_VALUE } ;
2016-09-15 16:52:11 +02:00
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 ;
2016-10-06 10:57:31 +02:00
gbc_btnSnapshotSpeicherZurcksetzen . insets = new Insets ( 0 , 0 , 5 , 0 ) ;
2016-09-15 16:52:11 +02:00
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 ( ) ;
}
} ) ;
2016-10-06 10:57:31 +02:00
JButton btnSnapshotSpeicherAuf = new JButton ( "SnapShot Speicher auf letzten bekannten SnapShot setzen" ) ;
btnSnapshotSpeicherAuf . addActionListener ( new ActionListener ( ) {
public void actionPerformed ( ActionEvent e ) {
resetSnapShots ( true ) ;
}
} ) ;
GridBagConstraints gbc_btnSnapshotSpeicherAuf = new GridBagConstraints ( ) ;
gbc_btnSnapshotSpeicherAuf . fill = GridBagConstraints . HORIZONTAL ;
gbc_btnSnapshotSpeicherAuf . gridwidth = 2 ;
gbc_btnSnapshotSpeicherAuf . insets = new Insets ( 0 , 0 , 5 , 0 ) ;
gbc_btnSnapshotSpeicherAuf . gridx = 0 ;
gbc_btnSnapshotSpeicherAuf . gridy = 6 ;
panel_2 . add ( btnSnapshotSpeicherAuf , gbc_btnSnapshotSpeicherAuf ) ;
2016-09-15 16:52:11 +02:00
GridBagConstraints gbc_btnAlleZhlerLschen = new GridBagConstraints ( ) ;
gbc_btnAlleZhlerLschen . gridwidth = 2 ;
gbc_btnAlleZhlerLschen . fill = GridBagConstraints . HORIZONTAL ;
gbc_btnAlleZhlerLschen . gridx = 0 ;
2016-10-06 10:57:31 +02:00
gbc_btnAlleZhlerLschen . gridy = 7 ;
2016-09-15 16:52:11 +02:00
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 ( ) {
2016-10-06 10:57:31 +02:00
resetSnapShots ( false ) ;
}
private void resetSnapShots ( boolean toLastKnown ) {
deviceConnector . reset ( toLastKnown ? PulsCounterApplication . getApplication ( ) . getDatabase ( ) . highestSnapShot ( deviceConnector . getDeviceSerial ( ) ) : - 1 ) ;
2016-09-15 16:52:11 +02:00
}
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 ;
}
}
}