This commit is contained in:
gac-x09la
2021-09-27 09:37:01 +02:00
parent 95884aa11d
commit 5b53202f49
5 changed files with 198 additions and 21 deletions

View File

@@ -1,43 +1,48 @@
#Thu Aug 26 11:06:44 CEST 2021
autoSaveScanData=true
simulation=false
logDaysToLive=7
dataScanSaveOutput=false
userAuthenticator=
logLevelConsole=Off
scanStreamerPort=-1
dataScanSaveScript=false
dataScanSaveSetpoints=false
notifiedTasks=
parallelInitialization=true
dataTransferPath=
saveConsoleSessionFiles=false
versionTrackingManual=true
dataTransferMode=Off
#Thu Sep 02 10:52:56 CEST 2021
hostName=
userManagement=false
disableEmbeddedAttributes=false
instanceName=SIS
autoSaveScanData=true
simulation=false
dataServerPort=-1
hideServerMessages=false
serverPort=8080
versionTrackingEnabled=true
dataPath={data}/{year}_{month}/{date}/{date}_{time}_{name}
serverEnabled=false
logDaysToLive=7
dataScanReleaseRecords=false
depthDimension=0
dataScanPreserveTypes=true
dataScanSaveOutput=false
logLevel=Info
dataScanFlushRecords=false
logPath={logs}/{date}_{time}
filePermissionsLogs=Default
dataLayout=default
disableDataFileLogs=false
sessionHandling=Off
terminalEnabled=false
notificationLevel=Off
filePermissionsScripts=Default
userAuthenticator=
logLevelConsole=Off
terminalPort=3579
filePermissionsConfig=Default
scanStreamerPort=-1
dataScanSaveScript=false
dataTransferUser=
dataScanSaveSetpoints=false
notifiedTasks=
filePermissionsData=Default
parallelInitialization=true
dataTransferPath=
saveConsoleSessionFiles=false
versionTrackingLogin={context}/svcusr-hlapp_robot
noBytecodeFiles=false
versionTrackingManual=true
versionTrackingRemote=git@git.psi.ch\:pshell_config/x09la.git
dataProvider=h5
dataTransferMode=Off
saveCommandStatistics=false

View File

@@ -1,4 +1,4 @@
#Mon Aug 30 18:03:14 CEST 2021
LastRunDate=210830
DaySequentialNumber=8
FileSequentialNumber=10
#Thu Sep 02 10:51:44 CEST 2021
LastRunDate=210902
DaySequentialNumber=5
FileSequentialNumber=15

59
plugins/Test.form Normal file
View File

@@ -0,0 +1,59 @@
<?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" alignment="0" attributes="0">
<EmptySpace min="-2" pref="66" max="-2" attributes="0"/>
<Component id="buttonStart" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="201" 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 min="-2" pref="42" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonStart" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonAbort" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="70" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JToggleButton" name="buttonStart">
<Properties>
<Property name="text" type="java.lang.String" value="Start"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStartActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonAbort">
<Properties>
<Property name="text" type="java.lang.String" value="Abort"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonAbortActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

106
plugins/Test.java Normal file
View File

@@ -0,0 +1,106 @@
import ch.psi.pshell.core.Context;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.State;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.script.ScriptException;
/**
*
*/
public class Test extends Panel {
public Test() {
initComponents();
}
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
}
@Override
public void onStateChange(State state, State former) {
buttonStart.setEnabled(state==State.Ready);
buttonAbort.setEnabled(state.isRunning());
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
//Callback to perform update - in event thread
@Override
protected void doUpdate() {
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonStart = new javax.swing.JToggleButton();
buttonAbort = new javax.swing.JToggleButton();
buttonStart.setText("Start");
buttonStart.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonStartActionPerformed(evt);
}
});
buttonAbort.setText("Abort");
buttonAbort.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonAbortActionPerformed(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()
.addGap(66, 66, 66)
.addComponent(buttonStart)
.addGap(39, 39, 39)
.addComponent(buttonAbort)
.addContainerGap(201, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(42, 42, 42)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonStart)
.addComponent(buttonAbort))
.addContainerGap(70, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void buttonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartActionPerformed
try {
this.runAsync("test/TestScan").handle((ret, ex)->{
return ret;
});
} catch (Exception ex) {
this.showException(ex);
}
}//GEN-LAST:event_buttonStartActionPerformed
private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed
try {
this.abort();
} catch (Exception ex) {
this.showException(ex);
}
}//GEN-LAST:event_buttonAbortActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JToggleButton buttonAbort;
private javax.swing.JToggleButton buttonStart;
// End of variables declaration//GEN-END:variables
}

View File

@@ -1,4 +1,11 @@
START = 0
END = 10
STEPS = 4
################
en = DummyPositioner("DummyEnergy")
add_device(en, True)
@@ -8,6 +15,6 @@ set_device_alias(scienta.stats[0], "sum")
sensors=[current, scienta.stats[0], scienta.getDataMatrix()]
try:
lscan(en, sensors, 0, 10, 4, latency = 0.0, before_read=trigger_scienta, after_read=handle_diagnostics, save=True)
lscan(en, sensors, START, END, STEPS, latency = 0.0, before_read=trigger_scienta, after_read=handle_diagnostics, save=True)
finally:
scienta.zeroSupplies()