From 68aea72a8d6a2a32a633cfc6e59f4f011517e0e9 Mon Sep 17 00:00:00 2001 From: gac-x09lb Date: Mon, 3 Oct 2022 19:11:30 +0200 Subject: [PATCH] Startup --- config/config.properties | 38 +++++++++++------------ config/preferences.json | 10 +++--- config/variables.properties | 6 ++-- devices/dummy_x.properties | 18 +++++------ devices/dummy_y.properties | 18 +++++------ devices/image.properties | 8 ++--- devices/m1.properties | 17 +++++++++++ script/local.py | 16 +++++----- script/test/Test2D.py | 61 +++++++++++++++++++++++++++++++------ 9 files changed, 126 insertions(+), 66 deletions(-) create mode 100644 devices/m1.properties diff --git a/config/config.properties b/config/config.properties index 6dbd449..369ba35 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,49 +1,49 @@ -#Fri Sep 30 15:05:43 CEST 2022 +#Mon Oct 03 14:25:38 CEST 2022 autoSaveScanData=true simulation=false +logDaysToLive=7 dataScanSaveOutput=false userAuthenticator= +logLevelConsole=Off +filePermissionsConfig=Public +scanStreamerPort=-1 dataScanSaveScript=false +dataScanSaveSetpoints=true notifiedTasks= parallelInitialization=false fdaSerialization=false dataTransferPath= saveConsoleSessionFiles=false +versionTrackingManual=false +dataTransferMode=Off hostName= +userManagement=false disableEmbeddedAttributes=false +instanceName=x09lb +dataServerPort=-1 serverPort=8080 +hideServerMessages=false versionTrackingEnabled=true dataPath={data}/{year}_{month}/{date}/{date}_{time}_{name} serverEnabled=false depthDimension=0 +dataScanReleaseRecords=true +dataScanPreserveTypes=false logLevel=Info +dataScanFlushRecords=false +filePermissionsLogs=Public +logPath={logs}/{date}_{time} dataLayout=default disableDataFileLogs=false sessionHandling=Off terminalEnabled=false notificationLevel=Off +filePermissionsScripts=Public terminalPort=3579 dataTransferUser= +filePermissionsData=Default versionTrackingLogin={context}/svcusr-hlapp_robot noBytecodeFiles=false versionTrackingRemote=git@git.psi.ch\:pshell_config/x09lb.git -logDaysToLive=7 -logLevelConsole=Off -filePermissionsConfig=Public -scanStreamerPort=-1 -dataScanSaveSetpoints=false -versionTrackingManual=false -dataTransferMode=Off -userManagement=false -instanceName=x09lb -dataServerPort=-1 -hideServerMessages=false -dataScanReleaseRecords=false -dataScanPreserveTypes=false -dataScanFlushRecords=false -filePermissionsLogs=Public -logPath={logs}/{date}_{time} -filePermissionsScripts=Public -filePermissionsData=Default dataProvider=h5 saveCommandStatistics=false diff --git a/config/preferences.json b/config/preferences.json index bf17205..0065dff 100644 --- a/config/preferences.json +++ b/config/preferences.json @@ -55,8 +55,8 @@ "scanPlotDisabled" : false, "scanTableDisabled" : false, "cachedDataPanel" : false, - "dataExtensions" : null, - "dataSubFiles" : null, + "dataExtensions" : "", + "dataSubFiles" : "", "hideFileName" : false, "showEmergencyStop" : false, "showHomingButtons" : false, @@ -71,13 +71,13 @@ "defaultRendererColormap" : "Grayscale", "linePlot" : "ch.psi.pshell.plot.LinePlotJFree", "matrixPlot" : "ch.psi.pshell.plot.MatrixPlotJFree", - "surfacePlot" : null, + "surfacePlot" : "null", "timePlot" : "ch.psi.pshell.plot.TimePlotJFree", "plotsDetached" : false, "plotLayout" : "Vertical", "quality" : "High", "defaultPlotColormap" : "Temperature", - "markerSize" : 0, + "markerSize" : 2, "plotBackground" : null, "gridColor" : null, "outlineColor" : null, @@ -119,5 +119,5 @@ "deviceClassName" : "ch.psi.pshell.device.ReadonlyRegister$ReadonlyRegisterMatrix", "panelClassName" : "ch.psi.pshell.swing.DeviceValueChart" } ], - "scriptPopupDialog" : "None" + "scriptPopupDialog" : "Exception" } \ No newline at end of file diff --git a/config/variables.properties b/config/variables.properties index 721422a..0ba1b6d 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Mon Oct 03 11:43:30 CEST 2022 +#Mon Oct 03 19:05:42 CEST 2022 LastRunDate=221003 -DaySequentialNumber=26 -FileSequentialNumber=26 +DaySequentialNumber=70 +FileSequentialNumber=70 diff --git a/devices/dummy_x.properties b/devices/dummy_x.properties index a227123..f59c3cf 100644 --- a/devices/dummy_x.properties +++ b/devices/dummy_x.properties @@ -1,17 +1,17 @@ -#Mon Oct 03 09:59:00 CEST 2022 -offset=0.0 -maxValue=10.0 -rotation=false +#Mon Oct 03 17:27:22 CEST 2022 precision=2 scale=1.0 description=null estbilizationDelay=0 -maxSpeed=10.0 resolution=NaN -startRetries=1 -minValue=-10.0 -unit=mm -defaultSpeed=1.0 +minValue=-10000.0 +defaultSpeed=100.0 sign_bit=0 monitorByPosition=false minSpeed=0.1 +offset=0.0 +maxValue=10000.0 +rotation=false +maxSpeed=1000.0 +startRetries=1 +unit=um diff --git a/devices/dummy_y.properties b/devices/dummy_y.properties index a227123..55f9e1b 100644 --- a/devices/dummy_y.properties +++ b/devices/dummy_y.properties @@ -1,17 +1,17 @@ -#Mon Oct 03 09:59:00 CEST 2022 -offset=0.0 -maxValue=10.0 -rotation=false +#Mon Oct 03 17:27:21 CEST 2022 precision=2 scale=1.0 description=null estbilizationDelay=0 -maxSpeed=10.0 resolution=NaN -startRetries=1 -minValue=-10.0 -unit=mm -defaultSpeed=1.0 +minValue=-10000.0 +defaultSpeed=100.0 sign_bit=0 monitorByPosition=false minSpeed=0.1 +offset=0.0 +maxValue=10000.0 +rotation=false +maxSpeed=1000.0 +startRetries=1 +unit=um diff --git a/devices/image.properties b/devices/image.properties index e14aa8f..8781a18 100644 --- a/devices/image.properties +++ b/devices/image.properties @@ -1,4 +1,4 @@ -#Fri Sep 30 14:48:24 CEST 2022 +#Mon Oct 03 12:11:04 CEST 2022 spatialCalOffsetY=NaN spatialCalOffsetX=NaN colormapLogarithmic=false @@ -6,12 +6,12 @@ scale=1.0 grayscale=false spatialCalScaleX=NaN spatialCalScaleY=NaN -colormapMax=NaN +colormapMax=354.157 rescaleOffset=0.0 roiWidth=-1 colormap=Temperature invert=false -colormapMin=NaN +colormapMin=330.703 rotation=0.0 rotationCrop=false rescaleFactor=1.0 @@ -19,7 +19,7 @@ spatialCalUnits=mm flipVertically=false roiHeight=-1 flipHorizontally=false -colormapAutomatic=true +colormapAutomatic=false roiY=0 roiX=0 transpose=false diff --git a/devices/m1.properties b/devices/m1.properties new file mode 100644 index 0000000..86acc21 --- /dev/null +++ b/devices/m1.properties @@ -0,0 +1,17 @@ +#Mon Oct 03 12:04:15 CEST 2022 +offset=0.0 +maxValue=10.0 +rotation=false +precision=2 +scale=1.0 +description=null +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 diff --git a/script/local.py b/script/local.py index 50518cb..e2c2574 100644 --- a/script/local.py +++ b/script/local.py @@ -3,14 +3,14 @@ ################################################################################################### def trig_ccd(): - return - if ccd.isSimulated(): - time.sleep(0.1) - else: - image_id = ccd.currentImageCount - ccd.start() - ccd.waitReady(-1) - ccd.waitNewImage(3000, image_id) + if ccd.dataMatrix in SENSORS: + if ccd.isSimulated(): + time.sleep(0.1) + else: + image_id = ccd.currentImageCount + ccd.start() + ccd.waitReady(-1) + ccd.waitNewImage(5000, image_id) def is_beam_ok(): diff --git a/script/test/Test2D.py b/script/test/Test2D.py index 4e22543..9040bce 100644 --- a/script/test/Test2D.py +++ b/script/test/Test2D.py @@ -1,16 +1,59 @@ +DRY_RUN = True -MOTORS = [dummy_x, dummy_y] -SENSORS = [current] -RANGE_X = [0.0,2.0] -RANGE_Y = [0.0,1.0] -STEPS = [5, 10] -LATENCY = 0.1 -RELATIVE = False +MOTORS = [sample_x, sample_y] +SENSORS = [current, ccd.dataMatrix] +RANGE_X = [-10.0,10.0] +RANGE_Y = [-10.0,10.0] +EXPOSURES = None # [0.1, 0.5, 1.0] +STEPS = [5, 5] #Integers = number of steps, Float = stepoSize +SETTLING_TIME = 0.1 +RELATIVE = True ZIGZAG = True +START = [RANGE_X[0], RANGE_Y[0]] +STOP = [RANGE_X[1], RANGE_Y[1]] + +COMPRESSION = False +ENABLED_PLOTS= [current] + +if DRY_RUN: + MOTORS = [dummy_x, dummy_y] + +if EXPOSURES: + class exposure_index (Writable, Readable): + def __init__(self): + self.pos=0.0 + + def read(self): + return self.pos + + def write(self, value): + ccd.setExposure(EXPOSURES[int(value)]) + self.pos = value + + class exposure (Readable): + def read(self): + return ccd.exposure + + POSITIONERS = MOTORS + [exposure_index()] + _SENSORS = SENSORS + [exposure()] + START = START + [0.0] + STOP = STOP + [float(len(POSITIONERS)-1)] + + + try: - ascan((MOTORS[0], MOTORS[1]), SENSORS, (RANGE_X[0], RANGE_Y[0]), (RANGE_X[1], RANGE_Y[1]), STEPS, LATENCY, RELATIVE, zigzag = ZIGZAG, \ - before_read=before_readout, after_read = after_readout, compression = True) + if EXPOSURES: + ascan(POSITIONERS, _SENSORS , START, STOP, STEPS + [1.0], \ + SETTLING_TIME, RELATIVE, zigzag = ZIGZAG, \ + before_read=before_readout, after_read = after_readout, \ + line_plots = ["current"], + compression = COMPRESSION, enabled_plots=ENABLED_PLOTS, keep=False, check_positions=False) + else: + ascan(MOTORS, SENSORS , START, STOP, STEPS, \ + SETTLING_TIME, RELATIVE, zigzag = ZIGZAG, \ + before_read=before_readout, after_read = after_readout, \ + compression = COMPRESSION, enabled_plots=ENABLED_PLOTS, keep=False, check_positions=False) finally: after_scan() \ No newline at end of file