From 9f74db9be66b4d672a29d10c5739bd7cedb14ce4 Mon Sep 17 00:00:00 2001 From: gac-x11ma Date: Thu, 30 Oct 2025 14:02:37 +0100 Subject: [PATCH] Startup --- config/config.properties | 4 +- config/settings.properties | 2 +- config/variables.properties | 8 +- devices/image.properties | 4 +- plugins/TestScript.form | 81 +++++++++++++++++++ plugins/TestScript.java | 155 ++++++++++++++++++++++++++++++++++++ script/test/TestScript.py | 3 + script/test/test_alex.py | 5 +- 8 files changed, 251 insertions(+), 11 deletions(-) create mode 100644 plugins/TestScript.form create mode 100644 plugins/TestScript.java create mode 100644 script/test/TestScript.py diff --git a/config/config.properties b/config/config.properties index ebc0061..871a1d1 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,4 +1,4 @@ -#Fri Oct 24 14:56:55 CEST 2025 +#Thu Oct 30 14:02:21 CET 2025 commandQueueSize=-1 commandStatistics=false commandTimeToLive=600000 @@ -48,5 +48,5 @@ userAuthenticator= userManagement=true versionTrackingEnabled=true versionTrackingLogin= -versionTrackingManual=true +versionTrackingManual=false versionTrackingRemote=https\://gitea.psi.ch/pshell_config/x11ma.git diff --git a/config/settings.properties b/config/settings.properties index 79faffe..adac1ff 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,4 +1,4 @@ -#Thu Oct 23 10:35:10 CEST 2025 +#Thu Oct 30 13:51:14 CET 2025 ALPHA_ID_2=0.0 AUTO_SWITCH_BEAMLINE=false AUTO_SWITCH_SHUTTER=true diff --git a/config/variables.properties b/config/variables.properties index ec13f34..ae7b176 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Wed Oct 22 17:04:16 CEST 2025 -DaySequentialNumber=2 -FileSequentialNumber=125 -LastRunDate=251022 +#Thu Oct 30 14:02:28 CET 2025 +DaySequentialNumber=11 +FileSequentialNumber=140 +LastRunDate=251030 diff --git a/devices/image.properties b/devices/image.properties index 2b7aec7..3d348d6 100644 --- a/devices/image.properties +++ b/devices/image.properties @@ -1,8 +1,8 @@ -#Thu Oct 23 14:04:00 CEST 2025 +#Mon Oct 27 13:27:27 CET 2025 colormap=Grayscale colormapAutomatic=false colormapLogarithmic=false -colormapMax=1.0 +colormapMax=9.0 colormapMin=0.0 flipHorizontally=false flipVertically=false diff --git a/plugins/TestScript.form b/plugins/TestScript.form new file mode 100644 index 0000000..901521a --- /dev/null +++ b/plugins/TestScript.form @@ -0,0 +1,81 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/TestScript.java b/plugins/TestScript.java new file mode 100644 index 0000000..17cae46 --- /dev/null +++ b/plugins/TestScript.java @@ -0,0 +1,155 @@ + +import ch.psi.pshell.framework.ScriptProcessor; +import ch.psi.pshell.framework.Task; +import ch.psi.pshell.utils.State; +import java.util.HashMap; +import java.util.Map; + +/** + * + */ +public class TestScript extends ScriptProcessor { + + //TODO: set script name + public static final String SCRIPT_NAME = "test/TestScript"; + + public TestScript() { + initComponents(); + } + + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + spinnerSamples.setEnabled(state.isReady()); + spinnerInterval.setEnabled(state.isReady()); + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + @Override + public void onTaskFinished(Task task) { + } + + @Override + protected void onTimer() { + } + + @Override + protected void onLoaded() { + + } + + @Override + protected void onUnloaded() { + + } + + + @Override + protected void onStartingExecution(Map args) throws Exception{ + } + + @Override + protected void onFinishedExecution(Map args, Object ret, Throwable t) throws Exception{ + } + + + //Invoked by 'update()' to update components in the event thread + @Override + protected void doUpdate() { + } + + + @Override + public String getScript(){ + return SCRIPT_NAME; + } + + @Override + public Map getArgs(){ + //TODO: add script arguments + Map ret = new HashMap<>(); + ret.put("samples", ((Number)spinnerSamples.getValue()).intValue()); + ret.put("interval", ((Number)spinnerInterval.getValue()).doubleValue()); + return ret; + } + + @Override + public boolean canPause() { + return true; + } + + @Override + public void clear() { + spinnerSamples.setValue(10); + spinnerInterval.setValue(0.1); + } + + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + spinnerInterval = new javax.swing.JSpinner(); + spinnerSamples = new javax.swing.JSpinner(); + + jLabel1.setText("Samples:"); + + jLabel2.setText("Interval:"); + + spinnerInterval.setModel(new javax.swing.SpinnerNumberModel(0.1d, 0.001d, 1000.0d, 1.0d)); + + spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(10, 1, 1000, 1)); + + 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(60, 60, 60) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(spinnerInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(74, Short.MAX_VALUE)) + ); + + layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerInterval, spinnerSamples}); + + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(26, 26, 26) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(spinnerInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(94, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JSpinner spinnerInterval; + private javax.swing.JSpinner spinnerSamples; + // End of variables declaration//GEN-END:variables +} diff --git a/script/test/TestScript.py b/script/test/TestScript.py new file mode 100644 index 0000000..4eb04da --- /dev/null +++ b/script/test/TestScript.py @@ -0,0 +1,3 @@ + +r = tscan(keithley_1a, samples, interval) +set_return(r) \ No newline at end of file diff --git a/script/test/test_alex.py b/script/test/test_alex.py index 2ea3993..24131e9 100644 --- a/script/test/test_alex.py +++ b/script/test/test_alex.py @@ -4,6 +4,7 @@ sensors = [Keithley_2_raw] #ascan([FE_CX, FE_CY], sensors, [X_min, Y_min], [X_max, Y_max], [X_step, Y_step], latency=0.5, zigzag=True) #ascan([FE_CX, FE_CY], sensors, [-1.0, 0.3], [0.0, 1.3], [0.1, 0.1], latency=0.5, zigzag=True) -ascan([m1, m2], sensors, [-0.5, 0.45], [0.0, 1.05], [0.05, 0.05], latency=0.5, zigzag=False) +#ascan([m1, m2], sensors, [-0.5, 0.45], [0.0, 1.05], [0.05, 0.05], latency=0.5, zigzag=False) -#lscan(energy, sensors, 1100, 1900, 5.0, latency=0.5) \ No newline at end of file +#lscan(energy, sensors, 1100, 1900, 5.0, latency=0.5) +tscan(sensors, 10, 0.1) \ No newline at end of file