Update to V2

This commit is contained in:
gac-x07mb
2026-03-02 13:49:55 +01:00
parent 67cee074cb
commit 405e5daf9f
27 changed files with 144 additions and 142 deletions

View File

@@ -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

View File

@@ -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"
}
}

View File

@@ -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

10
config/xscan.properties Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -6,7 +6,7 @@ precision=-1
scale=1.0
estbilizationDelay=0
maxSpeed=NaN
resolution=NaN
deadband=NaN
startRetries=1
minValue=NaN
unit=null

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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))

View File

@@ -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(' -')

View File

@@ -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 \
#

View File

@@ -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]

View File

@@ -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))

View File

@@ -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(' -')

View File

@@ -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

View File

@@ -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)