This commit is contained in:
Binary file not shown.
142
plugins/NewJPanel.form
Normal file
142
plugins/NewJPanel.form
Normal file
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="142" max="-2" attributes="0"/>
|
||||
<Component id="jPanel11" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="143" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="84" max="-2" attributes="0"/>
|
||||
<Component id="jPanel11" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="84" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="jPanel11">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="System Status"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="ledAirPressure" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="ledN2Pressure" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel16" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="ledLocalSafety" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel19" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="ledPsysSafety" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabell20" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="ledAirPressure" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="ledN2Pressure" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="ledLocalSafety" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="ledPsysSafety" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabell20" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledAirPressure">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel15">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Air Pressure"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel16">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="N2 Pressure"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledN2Pressure">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel19">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Local Safety"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledLocalSafety">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabell20">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Psys Safety"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledPsysSafety">
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
221
plugins/NewJPanel.java
Normal file
221
plugins/NewJPanel.java
Normal file
@@ -0,0 +1,221 @@
|
||||
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceAdapter;
|
||||
import ch.psi.utils.State;
|
||||
import java.awt.Color;
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author gac-S_Changer
|
||||
*/
|
||||
public class NewJPanel extends javax.swing.JPanel {
|
||||
|
||||
/**
|
||||
* Creates new form NewJPanel
|
||||
*/
|
||||
public NewJPanel() {
|
||||
initComponents();
|
||||
|
||||
|
||||
((Device) getDevice("hexiposi")).addListener(new DeviceAdapter() {
|
||||
@Override
|
||||
public void onStateChanged(Device device, State state, State former) {
|
||||
updateHexiposiState(state);
|
||||
}
|
||||
});
|
||||
updateHexiposiState(((Device) getDevice("hexiposi")).getState());
|
||||
|
||||
((Device) getDevice("air_pressure_ok")).addListener(new DeviceAdapter() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
updateAirPressure(value);
|
||||
}
|
||||
});
|
||||
updateAirPressure(((Device) getDevice("air_pressure_ok")).take());
|
||||
|
||||
((Device) getDevice("n2_pressure_ok")).addListener(new DeviceAdapter() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
updateN2Pressure(value);
|
||||
}
|
||||
});
|
||||
updateN2Pressure(((Device) getDevice("n2_pressure_ok")).take());
|
||||
|
||||
((Device) getDevice("feedback_local_safety")).addListener(new DeviceAdapter() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
updateLocalSafety(value);
|
||||
}
|
||||
});
|
||||
updateLocalSafety(((Device) getDevice("feedback_local_safety")).take());
|
||||
|
||||
((Device) getDevice("feedback_psys_safety")).addListener(new DeviceAdapter() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
updatePsysSafety(value);
|
||||
}
|
||||
});
|
||||
updatePsysSafety(((Device) getDevice("feedback_psys_safety")).take());
|
||||
}
|
||||
|
||||
void updateHexiposiState(State state){
|
||||
ledLidControlActive.setColor(state.isInitialized() ? Color.GREEN : Color.BLACK );
|
||||
ledLidInitialized.setColor((state.isNormal()&& state !=State.Disabled) ? Color.GREEN : Color.BLACK);
|
||||
}
|
||||
|
||||
void updateAirPressure(Object value){
|
||||
if ((value == null) || !(value instanceof Boolean)){
|
||||
ledAirPressure.setColor(Color.BLACK);
|
||||
} else if ((Boolean)value){
|
||||
ledAirPressure.setColor(Color.GREEN);
|
||||
} else {
|
||||
ledAirPressure.setColor(Color.RED);
|
||||
}
|
||||
}
|
||||
|
||||
void updateN2Pressure(Object value){
|
||||
if ((value == null) || !(value instanceof Boolean)){
|
||||
ledN2Pressure.setColor(Color.BLACK);
|
||||
} else if ((Boolean)value){
|
||||
ledN2Pressure.setColor(Color.GREEN);
|
||||
} else {
|
||||
ledN2Pressure.setColor(Color.RED);
|
||||
}
|
||||
}
|
||||
|
||||
void updateLocalSafety(Object value){
|
||||
if ((value == null) || !(value instanceof Boolean)){
|
||||
ledLocalSafety.setColor(Color.BLACK);
|
||||
} else if ((Boolean)value){
|
||||
ledLocalSafety.setColor(Color.GREEN);
|
||||
} else {
|
||||
ledLocalSafety.setColor(Color.RED);
|
||||
}
|
||||
}
|
||||
|
||||
void updatePsysSafety(Object value){
|
||||
if ((value == null) || !(value instanceof Boolean)){
|
||||
ledPsysSafety.setColor(Color.BLACK);
|
||||
} else if ((Boolean)value){
|
||||
ledPsysSafety.setColor(Color.GREEN);
|
||||
} else {
|
||||
ledPsysSafety.setColor(Color.RED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jPanel11 = new javax.swing.JPanel();
|
||||
ledAirPressure = new ch.psi.pshell.swing.Led();
|
||||
jLabel15 = new javax.swing.JLabel();
|
||||
jLabel16 = new javax.swing.JLabel();
|
||||
ledN2Pressure = new ch.psi.pshell.swing.Led();
|
||||
jLabel19 = new javax.swing.JLabel();
|
||||
ledLocalSafety = new ch.psi.pshell.swing.Led();
|
||||
jLabell20 = new javax.swing.JLabel();
|
||||
ledPsysSafety = new ch.psi.pshell.swing.Led();
|
||||
|
||||
jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder("System Status"));
|
||||
|
||||
jLabel15.setText("Air Pressure");
|
||||
|
||||
jLabel16.setText("N2 Pressure");
|
||||
|
||||
jLabel19.setText("Local Safety");
|
||||
|
||||
jLabell20.setText("Psys Safety");
|
||||
|
||||
javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
|
||||
jPanel11.setLayout(jPanel11Layout);
|
||||
jPanel11Layout.setHorizontalGroup(
|
||||
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel11Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel11Layout.createSequentialGroup()
|
||||
.addComponent(ledAirPressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel15))
|
||||
.addGroup(jPanel11Layout.createSequentialGroup()
|
||||
.addComponent(ledN2Pressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel16))
|
||||
.addGroup(jPanel11Layout.createSequentialGroup()
|
||||
.addComponent(ledLocalSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel19))
|
||||
.addGroup(jPanel11Layout.createSequentialGroup()
|
||||
.addComponent(ledPsysSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabell20)))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel11Layout.setVerticalGroup(
|
||||
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel11Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(ledAirPressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel15))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(ledN2Pressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel16))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(ledLocalSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel19))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(ledPsysSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabell20)))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 400, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(142, 142, 142)
|
||||
.addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(143, 143, 143)))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 300, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(84, 84, 84)
|
||||
.addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(84, 84, 84)))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel jLabel15;
|
||||
private javax.swing.JLabel jLabel16;
|
||||
private javax.swing.JLabel jLabel19;
|
||||
private javax.swing.JLabel jLabell20;
|
||||
private javax.swing.JPanel jPanel11;
|
||||
private ch.psi.pshell.swing.Led ledAirPressure;
|
||||
private ch.psi.pshell.swing.Led ledLocalSafety;
|
||||
private ch.psi.pshell.swing.Led ledN2Pressure;
|
||||
private ch.psi.pshell.swing.Led ledPsysSafety;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
Reference in New Issue
Block a user