From d26d91d5085d25915dab74ae7dcb5e03740bc8ad Mon Sep 17 00:00:00 2001 From: gac-x11ma Date: Thu, 18 Sep 2025 13:55:56 +0200 Subject: [PATCH] --- config/config.properties | 60 +++++++----------------- config/settings.properties | 2 +- config/variables.properties | 8 ++-- config/xscan.properties | 10 ++++ devices/axis.properties | 26 +++++----- devices/scan_1_axis_0000.tiff.properties | 20 ++++++++ plugins/Beamline.java | 4 +- plugins/DataAcquisition.java | 8 ++-- plugins/Initialization.java | 2 +- plugins/Settings.java | 9 ++-- plugins/XPEEM_Settings.java | 8 ++-- script/test/tets_scan_tiff_stack.py | 15 ++++++ 12 files changed, 96 insertions(+), 76 deletions(-) create mode 100644 config/xscan.properties create mode 100644 devices/scan_1_axis_0000.tiff.properties create mode 100644 script/test/tets_scan_tiff_stack.py diff --git a/config/config.properties b/config/config.properties index 1d8dd0e..2b6c4ef 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,62 +1,46 @@ -#Mon Aug 25 10:57:19 CEST 2025 -autoSaveScanData=true -commandExecutionEvents=true -createSessionFiles=false +#Thu Sep 18 12:38:20 CEST 2025 +commandQueueSize=-1 +commandStatistics=false +commandTimeToLive=600000 +consoleJournal=false dataDepthDimension=0 +dataEmbeddedAttributes=false dataFormat=tiff dataLayout=table dataPath={data}/{year}_{month}/{date}/{date}_{seq}%04d_{name} -dataProvider=null -dataScanAutoSave=true -dataScanFlushRecords=true -dataScanLazyTableCreation=false -dataScanPreserveTypes=false -dataScanReleaseRecords=false -dataScanSaveLogs=true -dataScanSaveOutput=false -dataScanSaveScript=false -dataScanSaveSetpoints=false -dataScanSaveTimestamps=false -dataScanStreamerPort=-1 dataServerPort=-1 dataTransferMode=Off dataTransferPath=~/Data1 dataTransferUser= -depthDimension=0 -devicePoolFile={config}/devices.properties -deviceUpdateStrategyFile={config}/update.properties -disableDataFileLogs=false -disableEmbeddedAttributes=false -fdaSerialization=true filePermissionsConfig=Public filePermissionsData=Default filePermissionsLogs=Public filePermissionsScripts=Public hideServerMessages=false -hostName=null -imageSourcesFile={config}/imaging.properties instanceName=SIM logDaysToLive=7 logLevel=Fine -logLevelConsole=Off -logPath={logs}/{date}_{time} -noBytecodeFiles=false +logPath={logs}/{date}_{time}.{mode} notificationLevel=Completion notificationTasks=EigerAbsSpec|Eiger2Img -notifiedTasks= -parallelInitialization=true pythonHome= -pythonNoBytecodeFiles=false -saveCommandStatistics=false -saveConsoleSessionFiles=false +scanAutoSave=true +scanDefaultTag=null +scanFlushRecords=true +scanLazyTableCreation=false +scanPreserveTypes=false +scanReleaseRecords=false +scanSaveLogs=true +scanSaveOutput=false +scanSaveScript=false +scanSaveSetpoints=false +scanSaveTimestamps=false scanStreamerPort=-1 serverCommandsHidden=false serverEnabled=false serverHostName=null serverPort=8080 sessionHandling=On -simulation=false -tasksFile={config}/tasks.properties terminalEnabled=false terminalPort=3579 userAuthenticator= @@ -65,11 +49,3 @@ versionTrackingEnabled=true versionTrackingLogin=auto versionTrackingManual=true versionTrackingRemote=https\://gitea.psi.ch/pshell_config/x11ma.git -xscanAppendSuffix=true -xscanContinuousUpdate=false -xscanCrlogicAbortable=true -xscanCrlogicChannel=null -xscanCrlogicIoc=null -xscanCrlogicPrefix=null -xscanCrlogicSimulated=false -xscanMoveTimeout=600 diff --git a/config/settings.properties b/config/settings.properties index 8e723e7..267b156 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,4 +1,4 @@ -#Wed Sep 03 16:47:25 CEST 2025 +#Thu Sep 18 13:17:46 CEST 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 c508763..61a6807 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Thu Aug 28 14:45:05 CEST 2025 -DaySequentialNumber=0 -FileSequentialNumber=58 -LastRunDate=240407 +#Thu Sep 18 13:46:14 CEST 2025 +DaySequentialNumber=12 +FileSequentialNumber=71 +LastRunDate=250918 diff --git a/config/xscan.properties b/config/xscan.properties new file mode 100644 index 0000000..a549ce8 --- /dev/null +++ b/config/xscan.properties @@ -0,0 +1,10 @@ +#Thu Sep 18 12:49:27 CEST 2025 +appendSuffix=true +channelCreationRetries=1 +continuousUpdate=false +dataEmbeddedAttributes=false +dataFormat= +dataLayout= +dataPath= +moveTimeout=600 +txtSerialization=false diff --git a/devices/axis.properties b/devices/axis.properties index 098f00c..0c27c9f 100644 --- a/devices/axis.properties +++ b/devices/axis.properties @@ -1,20 +1,20 @@ -#Wed Nov 11 15:51:29 CET 2020 -spatialCalOffsetY=NaN +#Wed Sep 17 15:09:30 CEST 2025 +flipHorizontally=false +flipVertically=false +grayscale=false invert=false -spatialCalOffsetX=NaN +rescaleFactor=1.0 +rescaleOffset=0.0 +roiHeight=-1 +roiWidth=-1 +roiX=0 +roiY=0 rotation=0.0 rotationCrop=false scale=1.0 -rescaleFactor=1.0 -grayscale=false -spatialCalUnits=mm -flipVertically=false -roiHeight=-1 +spatialCalOffsetX=NaN +spatialCalOffsetY=NaN spatialCalScaleX=NaN spatialCalScaleY=NaN -flipHorizontally=false -roiY=0 -roiX=0 -rescaleOffset=0.0 +spatialCalUnits=mm transpose=false -roiWidth=-1 diff --git a/devices/scan_1_axis_0000.tiff.properties b/devices/scan_1_axis_0000.tiff.properties new file mode 100644 index 0000000..25ae954 --- /dev/null +++ b/devices/scan_1_axis_0000.tiff.properties @@ -0,0 +1,20 @@ +#Thu Sep 18 13:30:22 CEST 2025 +flipHorizontally=false +flipVertically=false +grayscale=false +invert=false +rescaleFactor=1.0 +rescaleOffset=0.0 +roiHeight=-1 +roiWidth=-1 +roiX=0 +roiY=0 +rotation=0.0 +rotationCrop=false +scale=1.0 +spatialCalOffsetX=NaN +spatialCalOffsetY=NaN +spatialCalScaleX=NaN +spatialCalScaleY=NaN +spatialCalUnits=mm +transpose=false diff --git a/plugins/Beamline.java b/plugins/Beamline.java index 08982e6..0bb2b9c 100644 --- a/plugins/Beamline.java +++ b/plugins/Beamline.java @@ -1,6 +1,6 @@ import ch.psi.pshell.framework.Context; import ch.psi.pshell.framework.Panel; -import ch.psi.pshell.sequencer.Interpreter; +import ch.psi.pshell.sequencer.Sequencer; import ch.psi.pshell.swing.DeviceValuePanel; import ch.psi.pshell.utils.Arr; import ch.psi.pshell.utils.State; @@ -198,7 +198,7 @@ public class Beamline extends Panel { args.put("CFF", spinnerCff.getValue()); } - void applyBeamline() throws Interpreter.InterpreterStateException { + void applyBeamline() throws Sequencer.StateException { HashMap args = new HashMap(); setBeamlineArgs(args); diff --git a/plugins/DataAcquisition.java b/plugins/DataAcquisition.java index e71aa02..fdc5bef 100644 --- a/plugins/DataAcquisition.java +++ b/plugins/DataAcquisition.java @@ -9,7 +9,7 @@ import ch.psi.pshell.imaging.RendererListener; import ch.psi.pshell.framework.Panel; import ch.psi.pshell.imaging.DeviceRenderer; import ch.psi.pshell.imaging.Renderer; -import ch.psi.pshell.sequencer.Interpreter; +import ch.psi.pshell.sequencer.Sequencer; import ch.psi.pshell.utils.Arr; import ch.psi.pshell.utils.IO; import ch.psi.pshell.utils.Serializer; @@ -370,7 +370,7 @@ public class DataAcquisition extends Panel { rendererRoi.abortSelection(); } - void run2Images() throws Interpreter.InterpreterStateException { + void run2Images() throws Sequencer.StateException { HashMap args = new HashMap(); args.put("METHOD", comboImgMethod.getSelectedItem()); @@ -417,7 +417,7 @@ public class DataAcquisition extends Panel { return ranges; } - void runAbsSpectrum() throws Interpreter.InterpreterStateException { + void runAbsSpectrum() throws Sequencer.StateException { HashMap args = new HashMap(); args.put("SAVE_SPECTRUM", checkSpecSaveSpectrum.isSelected()); args.put("SAVE_IMAGES", checkSpecSaveImages.isSelected()); @@ -454,7 +454,7 @@ public class DataAcquisition extends Panel { } } - void enableNorm(boolean enabled) throws Interpreter.InterpreterStateException { + void enableNorm(boolean enabled) throws Sequencer.StateException { if (!enabled) { removeNorm(); } else { diff --git a/plugins/Initialization.java b/plugins/Initialization.java index b47393a..816153a 100644 --- a/plugins/Initialization.java +++ b/plugins/Initialization.java @@ -66,7 +66,7 @@ public class Initialization extends Panel { if (ex != null) { showException((Exception) ex); } else { - Context.getInterpreter().scriptingLog(String.format("Shell command '%s' return value: %s", shellCommand, String.valueOf(ret))); + Context.getSequencer().scriptingLog(String.format("Shell command '%s' return value: %s", shellCommand, String.valueOf(ret))); } return ret; }); diff --git a/plugins/Settings.java b/plugins/Settings.java index c2d5389..228238b 100644 --- a/plugins/Settings.java +++ b/plugins/Settings.java @@ -3,14 +3,13 @@ import ch.psi.pshell.console.App; import ch.psi.pshell.framework.Context; import ch.psi.pshell.framework.Setup; import ch.psi.pshell.framework.Panel; -import ch.psi.pshell.notification.NotificationManager.NotificationLevel; +import ch.psi.pshell.notification.Notifier.NotificationLevel; import ch.psi.pshell.utils.State; import ch.psi.pshell.swing.SwingUtils; import ch.psi.pshell.swing.SwingUtils.OptionResult; import ch.psi.pshell.swing.SwingUtils.OptionType; import java.io.IOException; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.SwingUtilities; /** @@ -138,7 +137,7 @@ public class Settings extends Panel { try { updatingControls = true; comboNotification.setSelectedItem(App.getInstance().getConfig().notificationLevel); - textRecipients.setText(Context.getNotificationManager().getConfig().to); + textRecipients.setText(Context.getNotifier().getConfig().to); } finally { updatingControls = false; } @@ -834,8 +833,8 @@ public class Settings extends Panel { } } App.getInstance().getConfig().notificationLevel =level; - Context.getNotificationManager().setRecipients(to.split(";")); - Context.getNotificationManager().initialize(); //Remove this when fix setRecipients + Context.getNotifier().setRecipients(to.split(";")); + Context.getNotifier().initialize(); //Remove this when fix setRecipients } catch (Exception ex) { showException(ex); } diff --git a/plugins/XPEEM_Settings.java b/plugins/XPEEM_Settings.java index 4bf0d5b..1181c57 100644 --- a/plugins/XPEEM_Settings.java +++ b/plugins/XPEEM_Settings.java @@ -2,7 +2,7 @@ import ch.psi.pshell.framework.Context; import ch.psi.pshell.framework.Panel; import ch.psi.pshell.sequencer.CommandSource; -import ch.psi.pshell.sequencer.Interpreter; +import ch.psi.pshell.sequencer.Sequencer; import ch.psi.pshell.utils.State; import ch.psi.pshell.swing.SwingUtils; import java.awt.Component; @@ -267,7 +267,7 @@ public class XPEEM_Settings extends Panel { private void buttonRunSelectedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRunSelectedActionPerformed try { - Context.getInterpreter().startExecution(CommandSource.plugin, null, null,null, false); + Context.getSequencer().startExecution(CommandSource.plugin, null, null,null, false); new Thread(()->{ try{ if (checkSetting1.isSelected()==true){ @@ -287,8 +287,8 @@ public class XPEEM_Settings extends Panel { getLogger().log(Level.WARNING, null, ex); } finally{ try { - Context.getInterpreter().endExecution(); - } catch (Interpreter.InterpreterStateException ex) { + Context.getSequencer().endExecution(); + } catch (Sequencer.StateException ex) { getLogger().log(Level.SEVERE, null, ex); } } diff --git a/script/test/tets_scan_tiff_stack.py b/script/test/tets_scan_tiff_stack.py new file mode 100644 index 0000000..cc1abc2 --- /dev/null +++ b/script/test/tets_scan_tiff_stack.py @@ -0,0 +1,15 @@ + +class Detector(ReadonlyRegisterBase, ReadonlyRegisterMatrix): + def doRead(self): + return Convert.toUnsigned(axis.dataMatrix.read()) + + def getWidth(self): + return axis.data.width + + def getHeight(self): + return axis.data.height + +detector=Detector("detector") +detector.initialize() + +tscan((energy_rbk, detector), 5, 1.0, stack=True) \ No newline at end of file