From 405e5daf9f068f46bffd4681e663e8c7bf760cd9 Mon Sep 17 00:00:00 2001 From: gac-x07mb Date: Mon, 2 Mar 2026 13:49:55 +0100 Subject: [PATCH] Update to V2 --- config/config.properties | 125 +++++++++--------- config/preferences.json | 5 +- config/variables.properties | 8 +- config/xscan.properties | 10 ++ devices/ROT.properties | 2 +- devices/ScanX.properties | 2 +- devices/ScanY.properties | 2 +- devices/ScanY_RBV.properties | 2 +- devices/TRSCANH.properties | 2 +- devices/X4W7SB~B | 2 +- devices/dp1.properties | 3 +- devices/dummy.properties | 2 +- devices/energy_ma.properties | 2 +- devices/m1.properties | 23 ++-- devices/m2.properties | 23 ++-- devices/p1.properties | 13 +- devices/scan_y.properties | 2 +- plugins/EnergyScan.java | 13 +- plugins/PersonalizedTheme.java | 12 +- script/EnergyScan_ma.py | 2 +- script/Run_OTF_MA.py | 3 - script/Users/Camelia/Test_XAS.py | 4 - script/Users/CopyFromXtreme/local_xtreme.py | 12 +- .../Users/Thomas/EnergyScan_backup_220822.py | 2 +- script/Users/Thomas/Run_OTF_MA.py | 2 - script/Users/Thomas/test_pscan.v1.py | 3 - script/local.py | 5 +- 27 files changed, 144 insertions(+), 142 deletions(-) create mode 100644 config/xscan.properties diff --git a/config/config.properties b/config/config.properties index 0b0d188..a7fbce2 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,64 +1,65 @@ -#Tue Jun 06 14:23:25 CEST 2023 -xscanMoveTimeout=600 -autoSaveScanData=true -simulation=false +#Mon Mar 02 11:00:24 CET 2026 commandExecutionEvents=false -logDaysToLive=30 -xscanCrlogicChannel=null -dataScanSaveOutput=false -xscanCrlogicSimulated=false -userAuthenticator= -logLevelConsole=Off -filePermissionsConfig=Default -scanStreamerPort=-1 -dataScanSaveScript=false -dataScanSaveSetpoints=false -notifiedTasks=null -parallelInitialization=false -fdaSerialization=true -dataTransferPath=null -scanStreamingPort=-1 -saveConsoleSessionFiles=false -xscanAppendSuffix=true -devicePoolFile={config}/devices.properties -versionTrackingManual=true -dataTransferMode=Off -hostName=null -userManagement=false -disableEmbeddedAttributes=false -instanceName= -dataServerPort=-1 -serverPort=8080 -hideServerMessages=false -versionTrackingEnabled=true -dataPath={data}/{year}/{month}/{day}/{year}_{month}{day}_{time}_{name} -serverEnabled=true -depthDimension=0 -dataScanReleaseRecords=true -dataScanPreserveTypes=true -logLevel=Info -dataScanFlushRecords=true -logPath={logs}/{date}_{time} -filePermissionsLogs=Default -dataLayout=fda -disableDataFileLogs=false -sessionHandling=Off -deviceUpdateStrategyFile={config}/update.properties -terminalEnabled=false -notificationLevel=Off -filePermissionsScripts=Default -terminalPort=3579 -xscanCrlogicPrefix=null -tasksFile={config}/tasks.properties -dataTransferUser=null -filePermissionsData=Default -xscanCrlogicAbortable=true -xscanContinuousUpdate=false +commandQueueSize=-1 +commandStatistics=false +commandTimeToLive=600000 +consoleJournal=false createSessionFiles=false -versionTrackingLogin={context}/svcusr-hlapp_robot -noBytecodeFiles=false -versionTrackingRemote=git@git.psi.ch\:pshell_config/x07mb.git -dataProvider=fda -xscanCrlogicIoc=null -dataScanLazyTableCreation=false -saveCommandStatistics=false +dataDepthDimension=0 +dataEmbeddedAttributes=false +dataFormat=tiff +dataLayout=table +dataPath={data}/{year}/{month}/{day}/{year}_{month}{day}_{time}_{name} +dataServerPort=-1 +dataTransferMode=Off +dataTransferPath= +dataTransferUser= +dataTruncate=true +devicePoolFile={config}/devices.properties +deviceUpdateStrategyFile={config}/update.properties +disableEmbeddedAttributes=false +fdaSerialization=true +filePermissionsConfig=Default +filePermissionsData=Default +filePermissionsLogs=Default +filePermissionsScripts=Default +instanceName= +logDaysToLive=30 +logLevel=Info +logLevelConsole=Off +logPath={logs}/{date}_{time}.{mode} +notificationLevel=Off +notificationTasks=null +parallelInitialization=false +pythonHome= +pythonNoBytecodeFiles=false +scanAutoSave=true +scanDefaultTag="scan_{index}%d" +scanFlushRecords=true +scanLazyTableCreation=false +scanPreserveTypes=true +scanReleaseRecords=true +scanSaveLogs=true +scanSaveMeta=true +scanSaveOutput=false +scanSaveScript=false +scanSaveSetpoints=false +scanSaveTimestamps=false +scanStreamerPort=-1 +scanStreamingPort=-1 +serverCommandsHidden=false +serverEnabled=true +serverHostName=null +serverHttps=false +serverPort=8080 +sessionHandling=Off +simulation=false +tasksFile={config}/tasks.properties +terminalEnabled=false +terminalPort=3579 +userAuthenticator= +userManagement=false +versionTrackingEnabled=true +versionTrackingLogin= +versionTrackingManual=true +versionTrackingRemote=https\://gitea.psi.ch/pshell_config/x07mb.git diff --git a/config/preferences.json b/config/preferences.json index e3c3ba8..d147689 100644 --- a/config/preferences.json +++ b/config/preferences.json @@ -56,8 +56,7 @@ "scanPlotDisabled" : false, "scanTableDisabled" : false, "cachedDataPanel" : false, - "dataExtensions" : "xml log tif tiff txt", - "dataSubFiles" : "", + "dataVisibleFiles" : "xml log tif tiff txt", "hideFileName" : false, "showEmergencyStop" : false, "showHomingButtons" : false, @@ -115,4 +114,4 @@ "panelClassName" : "ch.psi.pshell.swing.DeviceValueChart" } ], "scriptPopupDialog" : "Exception" -} \ No newline at end of file +} diff --git a/config/variables.properties b/config/variables.properties index 5e9fd16..bf5cc5c 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Mon Jun 26 23:00:59 CEST 2023 -LastRunDate=230626 -FileSequentialNumber=4133 -DaySequentialNumber=211 +#Mon Mar 02 11:13:34 CET 2026 +DaySequentialNumber=10 +FileSequentialNumber=4143 +LastRunDate=260302 diff --git a/config/xscan.properties b/config/xscan.properties new file mode 100644 index 0000000..5643596 --- /dev/null +++ b/config/xscan.properties @@ -0,0 +1,10 @@ +#Mon Mar 02 11:11:14 CET 2026 +appendSuffix=true +channelCreationRetries=1 +continuousUpdate=false +dataEmbeddedAttributes=false +dataFormat=h5 +dataLayout=default +dataPath={data}/{year}_{month}/{date}/{date}_{time}_{name} +moveTimeout=600 +txtSerialization=false diff --git a/devices/ROT.properties b/devices/ROT.properties index 6261639..02fb315 100644 --- a/devices/ROT.properties +++ b/devices/ROT.properties @@ -7,7 +7,7 @@ scale=1.0 description=null estbilizationDelay=0 maxSpeed=NaN -resolution=0.002 +deadband=0.002 homingType=None startRetries=1 minValue=-41.0 diff --git a/devices/ScanX.properties b/devices/ScanX.properties index b8a5299..2e77056 100644 --- a/devices/ScanX.properties +++ b/devices/ScanX.properties @@ -7,7 +7,7 @@ scale=1.0 description=null estbilizationDelay=0 maxSpeed=NaN -resolution=0.001 +deadband=0.001 homingType=None startRetries=1 minValue=-32.0 diff --git a/devices/ScanY.properties b/devices/ScanY.properties index fc00051..e508b1c 100644 --- a/devices/ScanY.properties +++ b/devices/ScanY.properties @@ -7,7 +7,7 @@ scale=1.0 description=null estbilizationDelay=0 maxSpeed=NaN -resolution=0.2 +deadband=0.2 homingType=None startRetries=1 minValue=-23.3 diff --git a/devices/ScanY_RBV.properties b/devices/ScanY_RBV.properties index 0eb2bd7..e42dd6e 100644 --- a/devices/ScanY_RBV.properties +++ b/devices/ScanY_RBV.properties @@ -9,7 +9,7 @@ minSpeed=0.0050000000000000044 minValue=-17.0 offset=0.0 precision=8 -resolution=0.00125 +deadband=0.00125 rotation=false scale=1.0 startRetries=1 diff --git a/devices/TRSCANH.properties b/devices/TRSCANH.properties index 5dd484a..101afbd 100644 --- a/devices/TRSCANH.properties +++ b/devices/TRSCANH.properties @@ -7,7 +7,7 @@ scale=1.0 description=null estbilizationDelay=0 maxSpeed=NaN -resolution=0.01 +deadband=0.01 homingType=None startRetries=1 minValue=-17.0 diff --git a/devices/X4W7SB~B b/devices/X4W7SB~B index 4f8cebe..65aebcd 100644 --- a/devices/X4W7SB~B +++ b/devices/X4W7SB~B @@ -6,7 +6,7 @@ precision=-1 scale=1.0 estbilizationDelay=0 maxSpeed=NaN -resolution=NaN +deadband=NaN startRetries=1 minValue=NaN unit=null diff --git a/devices/dp1.properties b/devices/dp1.properties index 49a76db..d20f442 100644 --- a/devices/dp1.properties +++ b/devices/dp1.properties @@ -1,4 +1,5 @@ -#Mon Mar 21 10:29:45 CET 2016 +#Mon Mar 02 10:38:02 CET 2026 +description=null motor1=0.0|4.0|8.0|0.0 motor2=0.0|5.0|3.0|NaN motor3=null diff --git a/devices/dummy.properties b/devices/dummy.properties index 23d620b..364c504 100644 --- a/devices/dummy.properties +++ b/devices/dummy.properties @@ -6,7 +6,7 @@ precision=2 scale=1.0 estbilizationDelay=0 maxSpeed=10.0 -resolution=NaN +deadband=NaN startRetries=1 minValue=-10.0 unit=mm diff --git a/devices/energy_ma.properties b/devices/energy_ma.properties index b8bb77d..56d00a8 100644 --- a/devices/energy_ma.properties +++ b/devices/energy_ma.properties @@ -4,7 +4,7 @@ maxValue=2000.0 rotation=false precision=3 scale=1.0 -resolution=0.01 +deadband=0.01 minValue=300.0 unit=eV sign_bit=0 diff --git a/devices/m1.properties b/devices/m1.properties index e4a30d8..6132b4b 100644 --- a/devices/m1.properties +++ b/devices/m1.properties @@ -1,16 +1,17 @@ -#Wed Jul 22 10:07:25 CEST 2020 -offset=0.0 +#Mon Mar 02 10:38:02 CET 2026 +deadband=NaN +defaultSpeed=1.0 +description=null +estbilizationDelay=0 +maxSpeed=10.0 maxValue=10.0 +minSpeed=0.1 +minValue=-10.0 +monitorByPosition=false +offset=0.0 precision=2 rotation=false scale=1.0 -estbilizationDelay=0 -maxSpeed=10.0 -resolution=NaN -startRetries=1 -minValue=-10.0 -unit=mm -defaultSpeed=1.0 sign_bit=0 -monitorByPosition=false -minSpeed=0.1 +startRetries=1 +unit=mm diff --git a/devices/m2.properties b/devices/m2.properties index e4a30d8..6132b4b 100644 --- a/devices/m2.properties +++ b/devices/m2.properties @@ -1,16 +1,17 @@ -#Wed Jul 22 10:07:25 CEST 2020 -offset=0.0 +#Mon Mar 02 10:38:02 CET 2026 +deadband=NaN +defaultSpeed=1.0 +description=null +estbilizationDelay=0 +maxSpeed=10.0 maxValue=10.0 +minSpeed=0.1 +minValue=-10.0 +monitorByPosition=false +offset=0.0 precision=2 rotation=false scale=1.0 -estbilizationDelay=0 -maxSpeed=10.0 -resolution=NaN -startRetries=1 -minValue=-10.0 -unit=mm -defaultSpeed=1.0 sign_bit=0 -monitorByPosition=false -minSpeed=0.1 +startRetries=1 +unit=mm diff --git a/devices/p1.properties b/devices/p1.properties index e6cb79e..5b16325 100644 --- a/devices/p1.properties +++ b/devices/p1.properties @@ -1,10 +1,11 @@ -#Wed Jul 22 10:07:25 CEST 2020 -minValue=0.0 -unit=mm -offset=0.0 +#Mon Mar 02 10:38:02 CET 2026 +deadband=NaN +description=null maxValue=1000.0 +minValue=0.0 +offset=0.0 precision=-1 rotation=false -sign_bit=0 scale=1.0 -resolution=NaN +sign_bit=0 +unit=mm diff --git a/devices/scan_y.properties b/devices/scan_y.properties index 60dc096..bfae679 100644 --- a/devices/scan_y.properties +++ b/devices/scan_y.properties @@ -9,7 +9,7 @@ minSpeed=0.05 minValue=-23.3 offset=0.0 precision=6 -resolution=5.0E-4 +deadband=5.0E-4 rotation=false scale=1.0 startRetries=1 diff --git a/plugins/EnergyScan.java b/plugins/EnergyScan.java index db4bb67..72082b3 100644 --- a/plugins/EnergyScan.java +++ b/plugins/EnergyScan.java @@ -11,11 +11,12 @@ import java.util.HashMap; import java.util.logging.Level; import javax.swing.DefaultComboBoxModel; import javax.swing.JLabel; -import ch.psi.utils.State; -import ch.psi.utils.swing.DsvEditor; -import ch.psi.utils.swing.Editor.EditorDialog; +import ch.psi.pshell.framework.Setup; +import ch.psi.pshell.utils.State; +import ch.psi.pshell.swing.DsvEditor; +import ch.psi.pshell.swing.Editor.EditorDialog; import ch.psi.pshell.data.PlotDescriptor; -import ch.psi.pshell.ui.Panel; +import ch.psi.pshell.framework.Panel; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; @@ -59,7 +60,7 @@ public class EnergyScan extends Panel { } Path getConfigFile() { - return Paths.get(getContext().getSetup().getConfigPath(), "energy_scan.properties"); + return Paths.get(Setup.getConfigPath(), "energy_scan.properties"); } enum Mode { @@ -123,7 +124,7 @@ public class EnergyScan extends Panel { } else { mode = "lin_" + String.format("%1.0f", (Double) spinnerAlpha.getValue()); } - path = getContext().getSetup().expandPath(path); + path = Setup.expandPath(path); path = path.replaceAll("\\{el\\}", String.valueOf(comboSetup.getSelectedItem())); path = path.replaceAll("\\{mode\\}", mode); return path; diff --git a/plugins/PersonalizedTheme.java b/plugins/PersonalizedTheme.java index f987aeb..ffc04e7 100644 --- a/plugins/PersonalizedTheme.java +++ b/plugins/PersonalizedTheme.java @@ -1,9 +1,11 @@ -import ch.psi.pshell.ui.Plugin; -import ch.psi.pshell.ui.Preferences; -import ch.psi.pshell.swing.ScriptEditor; -import ch.psi.utils.swing.SwingUtils; +import ch.psi.pshell.framework.Plugin; +import ch.psi.pshell.workbench.Preferences; +import ch.psi.pshell.framework.ScriptEditor; +import ch.psi.pshell.workbench.View; +import ch.psi.pshell.swing.SwingUtils; import java.awt.Font; +import java.util.logging.Logger; import java.util.logging.Level; import javax.swing.UIManager; @@ -48,7 +50,7 @@ public class PersonalizedTheme implements Plugin { SwingUtils.invokeDelayed( ()->{ - getView().restorePreferences(); + ((View)getView()).restorePreferences(); }, 250); } catch (Exception ex) { diff --git a/script/EnergyScan_ma.py b/script/EnergyScan_ma.py index 6cd454e..660a7b7 100644 --- a/script/EnergyScan_ma.py +++ b/script/EnergyScan_ma.py @@ -59,7 +59,7 @@ if move_mono == True: caput('E1', E1) caput('E2', E2) caput('TIME', TIME) - caput('FOLDER', "OTF/" + get_context().setup.expandPath("OTF/{year}_{month}/{date}")) + caput('FOLDER', "OTF/" + Setup.expandPath("OTF/{year}_{month}/{date}")) caput('FILE', NAME) #endif time.sleep(max(DELAY, 0.1)) diff --git a/script/Run_OTF_MA.py b/script/Run_OTF_MA.py index fab766c..0ba6f2f 100644 --- a/script/Run_OTF_MA.py +++ b/script/Run_OTF_MA.py @@ -42,7 +42,6 @@ NoRead=0 def before_pass(): - get_context().dataManager.provider.embeddedAtributes = False # Called at begining pf scan print('before_pass') SC.PerformActions('Pre_Actions') @@ -264,8 +263,6 @@ print(' ') p=set_exec_pars(name=SD['filename']) -get_context().dataManager.provider.embeddedAtributes = False - time.sleep(.2) print(' -') print(' -') diff --git a/script/Users/Camelia/Test_XAS.py b/script/Users/Camelia/Test_XAS.py index 81e893a..f399d7c 100644 --- a/script/Users/Camelia/Test_XAS.py +++ b/script/Users/Camelia/Test_XAS.py @@ -27,7 +27,6 @@ imp.reload(PL) # always reload module NoRead=0 def before_pass(): - get_context().dataManager.provider.embeddedAtributes = False # Called at begining pf scan print('before_pass') SC.PerformActions('Pre_Actions') @@ -248,9 +247,6 @@ p=set_exec_pars(name=SD['filename']) # save scan definition - -get_context().dataManager.provider.embeddedAtributes = False - # .. now make individual scan for all positioners as defiens in GUI # as we like want to have separete datasets for each scan \ # diff --git a/script/Users/CopyFromXtreme/local_xtreme.py b/script/Users/CopyFromXtreme/local_xtreme.py index e4787c3..6d9e37d 100644 --- a/script/Users/CopyFromXtreme/local_xtreme.py +++ b/script/Users/CopyFromXtreme/local_xtreme.py @@ -35,7 +35,7 @@ maintenance_mode = False #Reading Energy Scan configuration file def getPars(element): - f = open(get_context().setup.getConfigPath() + '/energy_scan.properties') + f = open(Setup.getConfigPath() + '/energy_scan.properties') try: for line in f: tokens = line.split("=") @@ -170,7 +170,7 @@ def convert_file(input_file_name, output_file_name, pol = None): out.write(Ecrbk + s + CADC1 + s + CADC2 + s + CADC3 + s + CADC4 + s + CADC5 + s + MCurr + s + time + s + MAGX + s + MAGZ + s + str(pol) + s + EXPT + s + normtey + s + normdiode + line_sep) except: traceback.print_exc() - os.rename(input_file_name, get_context().setup.expandPath("{data}/OTF/" + ntpath.basename(input_file_name))) + os.rename(input_file_name, Setup.expandPath("{data}/OTF/" + ntpath.basename(input_file_name))) def plot_file(file_name, title = None): """ @@ -184,7 +184,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom Add entry to ELOG. """ if author is None: - author = "pshell" #get_context().user.name + author = "pshell" #Context.getUserName() typ = "pshell" entry = "" @@ -209,7 +209,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom raise Exception(err) print out -def get_plot_snapshots(title = None, file_type = "png", temp_path = get_context().setup.getContextPath()): +def get_plot_snapshots(title = None, file_type = "png", temp_path = Setup.getContextPath()): """ Returns list with file names of plots snapshots from a plotting context. """ @@ -601,7 +601,7 @@ def otf(start, end, time, delay=0.0, mode = None, offset = None, alpha = None, n """ if name is None: name = get_exec_pars().name - folder = get_context().setup.expandPath("{year}_{month}/{date}"); + folder = Setup.expandPath("{year}_{month}/{date}"); if len(name)> 38: name = name[:38] @@ -615,7 +615,7 @@ def otf2(start, end, time, delay=0.0, mode = None, offset = None, alpha = None, """ if name is None: name = get_exec_pars().name - folder = get_context().setup.expandPath("{year}_{month}/{date}"); + folder = Setup.expandPath("{year}_{month}/{date}"); if len(name)> 38: name = name[:38] diff --git a/script/Users/Thomas/EnergyScan_backup_220822.py b/script/Users/Thomas/EnergyScan_backup_220822.py index 6cd454e..660a7b7 100644 --- a/script/Users/Thomas/EnergyScan_backup_220822.py +++ b/script/Users/Thomas/EnergyScan_backup_220822.py @@ -59,7 +59,7 @@ if move_mono == True: caput('E1', E1) caput('E2', E2) caput('TIME', TIME) - caput('FOLDER', "OTF/" + get_context().setup.expandPath("OTF/{year}_{month}/{date}")) + caput('FOLDER', "OTF/" + Setup.expandPath("OTF/{year}_{month}/{date}")) caput('FILE', NAME) #endif time.sleep(max(DELAY, 0.1)) diff --git a/script/Users/Thomas/Run_OTF_MA.py b/script/Users/Thomas/Run_OTF_MA.py index eb2406d..201e8ed 100644 --- a/script/Users/Thomas/Run_OTF_MA.py +++ b/script/Users/Thomas/Run_OTF_MA.py @@ -39,7 +39,6 @@ NoRead=0 def before_pass(): - get_context().dataManager.provider.embeddedAtributes = False # Called at begining pf scan print('before_pass') SC.PerformActions('Pre_Actions') @@ -256,7 +255,6 @@ print(' ') p=set_exec_pars(name=SD['filename']) -get_context().dataManager.provider.embeddedAtributes = False time.sleep(.2) print(' -') diff --git a/script/Users/Thomas/test_pscan.v1.py b/script/Users/Thomas/test_pscan.v1.py index 11bf68e..84473da 100644 --- a/script/Users/Thomas/test_pscan.v1.py +++ b/script/Users/Thomas/test_pscan.v1.py @@ -27,7 +27,6 @@ imp.reload(PL) # always reload module NoRead=0 def before_pass(): - get_context().dataManager.provider.embeddedAtributes = False # Called at begining pf scan print('before_pass') SC.PerformActions('Pre_Actions') @@ -249,8 +248,6 @@ p=set_exec_pars(name=SD['filename']) # save scan definition -get_context().dataManager.provider.embeddedAtributes = False -asd # .. now make individual scan for all positioners as defiens in GUI # as we like want to have separete datasets for each scan \ #stop diff --git a/script/local.py b/script/local.py index 2f1d8b5..5ca5d68 100644 --- a/script/local.py +++ b/script/local.py @@ -110,6 +110,7 @@ ID_MODE.initialize() ID_DONE=ChannelString('ID_DONE','X07MA-ID:DONE') ID_DONE.initialize() + ID_ALPHA=ChannelString('ID_ALPHA','X07MA-ID:ALPHA') ID_ALPHA.initialize() @@ -129,10 +130,6 @@ ABORT_ON_ID_ERROR = False -#Layout -get_context().dataManager.provider.embeddedAtributes=False - - #Device initialization ma_energy.setBlockingWrite(True) id_pol_mode.setpoint.setBlockingWrite(True)