This commit is contained in:
gac-S_Changer
2018-07-06 15:42:34 +02:00
parent 4c38bcba7c
commit ce67a031cf
6 changed files with 251 additions and 3 deletions

View File

@@ -1,14 +1,15 @@
MXSC-1.10.0.jar=enabled
WagoPanel.java=enabled
LaserUEPanel.java=enabled
BarcodeReaderPanel.java=enabled
PuckDetectionPanel.java=enabled
HexiposiPanel.java=enabled
MjpegSource2.java=enabled
MXSC-1.10.0.jar=enabled
LN2.java=enabled
Hexiposi.java=disabled
NewJPanel.java=disabled
Expert.java=disabled
RecoveryPanel.java=disabled
RobotPanel.java=enabled
SmartMagnetConfig.java=disabled
SmartMagnetPanel.java=enabled

View File

@@ -13,9 +13,9 @@ import javax.swing.JTextField;
/**
*
*/
public class Expert extends Panel {
public class Commands extends Panel {
public Expert() {
public Commands() {
initComponents();
((JSpinner.DefaultEditor)spinnerSegment.getEditor()).getTextField().setHorizontalAlignment(JTextField.RIGHT);
}

Binary file not shown.

90
plugins/Recovery.form Normal file
View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" 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">
<Group type="102" attributes="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="ledLidControlActive" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledLidInitialized" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace pref="96" max="32767" attributes="0"/>
<Component id="buttonInitHexiposi" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="116" 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="ledLidControlActive" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledLidInitialized" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="buttonInitHexiposi" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.swing.Led" name="ledLidControlActive">
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="Known position"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledLidInitialized">
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="Valid segment"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonInitHexiposi">
<Properties>
<Property name="text" type="java.lang.String" value="Recover"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonInitHexiposiActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

157
plugins/Recovery.java Normal file
View File

@@ -0,0 +1,157 @@
/*
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
*/
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.State;
import ch.psi.utils.swing.SwingUtils;
/**
*
*/
public class Recovery extends Panel {
public Recovery() {
initComponents();
}
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
}
@Override
public void onStateChange(State state, State former) {
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
//Callback to perform update - in event thread
@Override
protected void doUpdate() {
}
@Override
public boolean isActive() {
return true;
}
void execute(String statement){
execute(statement, false);
}
void execute(String statement, boolean background){
execute(statement, background, false);
}
void execute(String statement, boolean background, boolean showReturn){
try {
evalAsync(statement, background).handle((ret, ex) -> {
if (ex != null){
showException((Exception)ex);
} else if (showReturn){
SwingUtils.showMessage(getTopLevel(), "Return", String.valueOf(ret));
}
return ret;
});
} catch (Exception ex) {
showException(ex);
}
}
void execute(String script, Object args){
try {
runAsync(script, args).handle((ret, ex) -> {
if (ex != null){
showException((Exception)ex);
}
return ret;
});
} catch (Exception ex) {
showException(ex);
}
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
ledLidControlActive = new ch.psi.pshell.swing.Led();
jLabel6 = new javax.swing.JLabel();
ledLidInitialized = new ch.psi.pshell.swing.Led();
jLabel7 = new javax.swing.JLabel();
buttonInitHexiposi = new javax.swing.JButton();
jLabel6.setText("Known position");
jLabel7.setText("Valid segment");
buttonInitHexiposi.setText("Recover");
buttonInitHexiposi.setEnabled(false);
buttonInitHexiposi.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonInitHexiposiActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(ledLidControlActive, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6))
.addGroup(layout.createSequentialGroup()
.addComponent(ledLidInitialized, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7))))
.addGroup(layout.createSequentialGroup()
.addContainerGap(96, Short.MAX_VALUE)
.addComponent(buttonInitHexiposi)))
.addContainerGap(116, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledLidControlActive, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledLidInitialized, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7))
.addGap(18, 18, 18)
.addComponent(buttonInitHexiposi)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void buttonInitHexiposiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonInitHexiposiActionPerformed
try{
this.showDevicePanel("hexiposi");
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_buttonInitHexiposiActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonInitHexiposi;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private ch.psi.pshell.swing.Led ledLidControlActive;
private ch.psi.pshell.swing.Led ledLidInitialized;
// End of variables declaration//GEN-END:variables
}