diff --git a/config/config.properties b/config/config.properties index 93db32f..2f5b3e6 100644 --- a/config/config.properties +++ b/config/config.properties @@ -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 diff --git a/config/variables.properties b/config/variables.properties index 2cea9f8..0148ef7 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -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 diff --git a/plugins/Test.form b/plugins/Test.form new file mode 100644 index 0000000..a40be78 --- /dev/null +++ b/plugins/Test.form @@ -0,0 +1,59 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/Test.java b/plugins/Test.java new file mode 100644 index 0000000..16a27db --- /dev/null +++ b/plugins/Test.java @@ -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") + // //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)) + ); + }// //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 +} diff --git a/script/test/TestScan.py b/script/test/TestScan.py index e0cfe61..0ca070f 100644 --- a/script/test/TestScan.py +++ b/script/test/TestScan.py @@ -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()