diff --git a/config/AbsortionSpectrum/Cr_L23edge.abs b/config/AbsortionSpectrum/Cr_L23edge.abs new file mode 100644 index 0000000..57b9ccb Binary files /dev/null and b/config/AbsortionSpectrum/Cr_L23edge.abs differ diff --git a/config/AbsortionSpectrum/Fe_L3_L2_sandy.abs b/config/AbsortionSpectrum/Fe_L3_L2_sandy.abs new file mode 100644 index 0000000..55b0fd2 Binary files /dev/null and b/config/AbsortionSpectrum/Fe_L3_L2_sandy.abs differ diff --git a/config/AbsortionSpectrum/Mn_L3_L2_Sandy.abs b/config/AbsortionSpectrum/Mn_L3_L2_Sandy.abs new file mode 100644 index 0000000..652ceb5 Binary files /dev/null and b/config/AbsortionSpectrum/Mn_L3_L2_Sandy.abs differ diff --git a/config/AbsortionSpectrum/Rh_Sara.abs b/config/AbsortionSpectrum/Rh_Sara.abs new file mode 100644 index 0000000..bccdd39 Binary files /dev/null and b/config/AbsortionSpectrum/Rh_Sara.abs differ diff --git a/config/AbsortionSpectrum/Ru_M23-edge.abs b/config/AbsortionSpectrum/Ru_M23-edge.abs new file mode 100644 index 0000000..f9e6132 Binary files /dev/null and b/config/AbsortionSpectrum/Ru_M23-edge.abs differ diff --git a/config/AbsortionSpectrum/membrane_ref_TiMnLaBa.abs b/config/AbsortionSpectrum/membrane_ref_TiMnLaBa.abs new file mode 100644 index 0000000..a85d233 Binary files /dev/null and b/config/AbsortionSpectrum/membrane_ref_TiMnLaBa.abs differ diff --git a/config/ROIs/AZI30.roi b/config/ROIs/AZI30.roi new file mode 100644 index 0000000..0f0c065 Binary files /dev/null and b/config/ROIs/AZI30.roi differ diff --git a/config/ROIs/AZI60.roi b/config/ROIs/AZI60.roi new file mode 100644 index 0000000..d2e6ca6 Binary files /dev/null and b/config/ROIs/AZI60.roi differ diff --git a/config/ROIs/test.roi b/config/ROIs/test.roi index b8d5f60..bf92d5b 100755 Binary files a/config/ROIs/test.roi and b/config/ROIs/test.roi differ diff --git a/config/ROIs/test3.roi b/config/ROIs/test3.roi new file mode 100644 index 0000000..01c8136 Binary files /dev/null and b/config/ROIs/test3.roi differ diff --git a/config/config.properties b/config/config.properties index a554305..ff6705f 100755 --- a/config/config.properties +++ b/config/config.properties @@ -1,57 +1,65 @@ -#Thu Jan 26 14:35:03 CET 2023 -imageSourcesFile={config}/imaging.properties +#Tue May 16 14:12:40 CEST 2023 autoSaveScanData=true simulation=false -commandExecutionEvents=true -logDaysToLive=7 +xscanCrlogicChannel=null dataScanSaveOutput=false userAuthenticator= -logLevelConsole=Off -filePermissionsConfig=Public -scanStreamerPort=-1 dataScanSaveScript=false -dataScanSaveSetpoints=false notifiedTasks=EigerAbsSpec|Eiger2Img parallelInitialization=true fdaSerialization=true dataTransferPath=~/Data1 scanStreamingPort=-1 saveConsoleSessionFiles=false +xscanAppendSuffix=true devicePoolFile={config}/devices.properties -versionTrackingManual=true -dataTransferMode=Off hostName=null -userManagement=true disableEmbeddedAttributes=false -instanceName=SIM -dataServerPort=-1 serverPort=8080 -hideServerMessages=false versionTrackingEnabled=true dataPath={data}/{year}_{month}/{date}/{date}_{seq}%04d_{name} serverEnabled=false depthDimension=0 -dataScanReleaseRecords=false -dataScanPreserveTypes=false -logLevel=Info -dataScanFlushRecords=true -logPath={logs}/{date}_{time} -filePermissionsLogs=Public +logLevel=Fine dataLayout=table disableDataFileLogs=false sessionHandling=On deviceUpdateStrategyFile={config}/update.properties terminalEnabled=false notificationLevel=Completion -filePermissionsScripts=Public terminalPort=3579 -tasksFile={config}/tasks.properties dataTransferUser= -filePermissionsData=Default -createSessionFiles=false +xscanContinuousUpdate=false versionTrackingLogin={context}/svcusr-hlapp_robot noBytecodeFiles=false versionTrackingRemote=git@git.psi.ch\:pshell_config/x11ma.git -dataProvider=txt dataScanLazyTableCreation=false +xscanMoveTimeout=600 +imageSourcesFile={config}/imaging.properties +commandExecutionEvents=true +logDaysToLive=7 +xscanCrlogicSimulated=false +logLevelConsole=Off +filePermissionsConfig=Public +scanStreamerPort=-1 +dataScanSaveSetpoints=false +versionTrackingManual=true +dataTransferMode=Off +userManagement=true +instanceName=SIM +dataServerPort=-1 +hideServerMessages=false +dataScanReleaseRecords=false +dataScanPreserveTypes=false +dataScanFlushRecords=true +logPath={logs}/{date}_{time} +filePermissionsLogs=Public +filePermissionsScripts=Public +xscanCrlogicPrefix=null +tasksFile={config}/tasks.properties +filePermissionsData=Default +xscanCrlogicAbortable=true +createSessionFiles=false +dataProvider=txt +xscanCrlogicIoc=null saveCommandStatistics=false diff --git a/config/devices.properties b/config/devices.properties index 41073ac..06725e6 100644 --- a/config/devices.properties +++ b/config/devices.properties @@ -1,3 +1,11 @@ +et7026=ch.psi.pshell.modbus.ModbusTCP|129.129.121.95:502||| +ai1-raw=ch.psi.pshell.modbus.AnalogInput|et7026 1||5000| +ai1=ch.psi.pshell.modbus.ReadonlyProcessVariable|et7026 1||5000| +ais=ch.psi.pshell.modbus.AnalogInputArray|et7026 0 6||5000|false +et7244=ch.psi.pshell.modbus.ModbusTCP|129.129.121.96:502||| +di1=ch.psi.pshell.modbus.DigitalInput|et7244 0||5000| +di2=ch.psi.pshell.modbus.DigitalInput|et7244 1||5000| +do1=ch.psi.pshell.modbus.DigitalOutput|et7244 0||| Grating_ch=ch.psi.pshell.epics.ChannelString|X11MA-PGM-GRCH:GRATING|||true DiffOrd=ch.psi.pshell.epics.ChannelString|X11MA-PGM:difforder0|||true voltage=ch.psi.pshell.epics.ChannelDouble|X11MA-KEI13:SETVOLTAGE|||true @@ -10,6 +18,7 @@ fe_slit_H_size_offs=ch.psi.pshell.epics.ChannelDouble|X11MA-FE-DSHOR.A|||true fe_slit_H_size=ch.psi.pshell.epics.Motor|X11MA-FE-SH:size|||true exit_slit_offset=ch.psi.pshell.epics.ChannelDouble|X11MA-OP2-SL:EOff|||true exit_slit=ch.psi.pshell.epics.Motor|X11MA-OP2-SL:TRY|||true +rmu_ry=ch.psi.pshell.epics.Positioner|X11MA-OP-RMU:Ry X11MA-OP-RMU:oRy|||true machine_cur=ch.psi.pshell.epics.ChannelDouble|ARIDI-PCT:CURRENT|Read||true field=ch.psi.pshell.epics.ChannelDouble|X11MA-XMCD:Ireadout|Read||true pol_mode=ch.psi.pshell.epics.DiscretePositioner|X11MA-ID2:MODE|||true @@ -74,10 +83,12 @@ otf_start=ch.psi.pshell.epics.ChannelInteger|X11MA-OTF:GO|||true eiger_bit_depth_rbv=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:BitDepth_RBV|Read||true eiger_mode_rbv=ch.psi.pshell.epics.ChannelString|X11MA-ES1-SD1:cam1:ImageMode_RBV|Read||true eiger_exposure_rbv=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1-SD1:cam1:AcquireTime_RBV 2|Read||true +eiger_threshold_rbv=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1-SD1:cam1:ThresholdEnergy_RBV|Read||true eiger_status=ch.psi.pshell.epics.ChannelString|X11MA-ES1-SD1:cam1:Acquire|||true eiger_bit_depth=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:BitDepth|||true eiger_mode=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:ImageMode|||true eiger_exposure=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1-SD1:cam1:AcquireTime 2|||true +eiger_threshold=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1-SD1:cam1:ThresholdEnergy|||true Ecrbk=ch.psi.pshell.epics.ChannelDouble|X11MA-PGM:CERBK|Read||true CADC1=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC1|Read||true CADC2=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC2|Read||true diff --git a/config/plugins.properties b/config/plugins.properties index 9182de7..1af9151 100644 --- a/config/plugins.properties +++ b/config/plugins.properties @@ -1,3 +1,5 @@ +BeamlineInit.java=disabled +Cooling.java=enabled XPEEM_Settings.java=enabled Align_ComputeShifts.java=disabled Imaging.java=disabled diff --git a/config/preferences.json b/config/preferences.json index 741a063..db0f23f 100644 --- a/config/preferences.json +++ b/config/preferences.json @@ -39,7 +39,7 @@ "style" : 0, "size" : 14 }, - "tabSize" : 4, + "tabSize" : 10, "contentWidth" : 0, "editorBackground" : null, "editorForeground" : null, @@ -47,7 +47,7 @@ "hideEditorLineNumbers" : false, "hideEditorContextMenu" : false, "consoleLocation" : "Status", - "dataPanelLocation" : null, + "dataPanelLocation" : "Status", "openDataFilesInDocTab" : false, "noVariableEvaluationPropagation" : false, "processingScripts" : [ ], @@ -75,6 +75,7 @@ "surfacePlot" : "ch.psi.pshell.plot.SurfacePlotJzy3d", "timePlot" : "ch.psi.pshell.plot.TimePlotJFree", "plotsDetached" : false, + "plotsHidden" : false, "plotLayout" : "Vertical", "quality" : "High", "defaultPlotColormap" : "Viridis", diff --git a/config/scicat.properties b/config/scicat.properties index 39cd0cc..aae12ae 100755 --- a/config/scicat.properties +++ b/config/scicat.properties @@ -1,11 +1,11 @@ -#Mon Oct 17 12:47:34 CEST 2022 +#Mon Jul 10 17:15:25 CEST 2023 environment=prod testParameters=-testenv -user slssim\:4DMGBarXmr -sourceFolder=/sls/X11MA/Data1/e19687 +sourceFolder=/sls/X11MA/Data1/e19681 prodParameters=\ -user slssim\:4DMGBarXmr devParameters=-devenv -user slssim\:slssim -ownerGroup= +ownerGroup=p21144 type=raw parameters=-ingest -allowexistingsource -noninteractive -autoarchive creationLocation=/PSI/SLS/SIM -principalInvestigator= +principalInvestigator=Joanna E. Olszowka diff --git a/config/session_metadata.properties b/config/session_metadata.properties index 81bdf9e..55671d2 100755 --- a/config/session_metadata.properties +++ b/config/session_metadata.properties @@ -1,5 +1,5 @@ -#Wed Dec 14 17:01:44 CET 2022 +#Sat Jun 24 09:37:51 CEST 2023 keywords=List;[] -ownerEmail=String;armin.kleibert@psi.ch +ownerEmail=String;gavin.macauley@psi.ch contactEmail=String;armin.kleibert@psi.ch -owner=String;Armin Kleibert +owner=String;Macauley Gavin Martin diff --git a/config/sessions.properties b/config/sessions.properties index 0e65b0c..9d60cbf 100644 --- a/config/sessions.properties +++ b/config/sessions.properties @@ -1,2 +1,2 @@ -#Thu Dec 15 01:10:54 CET 2022 -SessionCounter=80 +#Wed Jun 14 21:20:33 CEST 2023 +SessionCounter=89 diff --git a/config/settings.properties b/config/settings.properties index 4768eb5..b11dc18 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,29 +1,24 @@ -#Thu Jan 26 15:36:34 CET 2023 -HARMONIC_ID_1=1 +#Tue Jul 18 10:46:52 CEST 2023 RSYNC_USER= CFF=2.25 OUTLIERS_THRESHOLD=1000000000 -NORM_FILE=/sls/X11MA/data/e18927/Data1/2022_10/20221017/20221017_Take_Image/i221017_042/i221017_042\#001.tif AUTO_SWITCH_VALVE=false +NORM_FILE=/sls/X11MA/data/e20816/Data1/2023_06/20230615/654 DRY_RUN=true POL_ID_2=Lin_Hor -OFFSET_ID_1=0.0 -ID=PGM_ID2 OFFSET_ID_2=-2.0 +ID=PGM_ID2 proposal=proposal -ENERGY=800.0 +ENERGY=800 proposer=proposer GRATING=G3_600 image_shift_angle=1.0963912950426833 -POL_ID_1=Lin_Hor RSYNC_HOST= sample=sample RSYNC_PATH= -pgroup=pgroup AUTO_SWITCH_BEAMLINE=false -AUTO_SWITCH_SHUTTER=false -ALPHA_ID_2=0.0 -ALPHA_ID_1=0.0 +pgroup=pgroup +AUTO_SWITCH_SHUTTER=true RSYNC_DEL=true DIFF_ORD=1 image_shift_scale=3.296579966879864 diff --git a/config/variables.properties b/config/variables.properties index 0e8fa39..f94d359 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Thu Jan 26 15:42:52 CET 2023 -LastRunDate=230126 -FileSequentialNumber=18359 -DaySequentialNumber=1 +#Mon Jul 17 23:25:27 CEST 2023 +LastRunDate=230717 +FileSequentialNumber=22119 +DaySequentialNumber=2 diff --git a/devices/CameraServer.properties b/devices/CameraServer.properties new file mode 100644 index 0000000..fd23e3a --- /dev/null +++ b/devices/CameraServer.properties @@ -0,0 +1,25 @@ +#Mon Mar 06 12:54:54 CET 2023 +spatialCalOffsetY=NaN +spatialCalOffsetX=NaN +colormapLogarithmic=false +scale=1.0 +grayscale=false +spatialCalScaleX=NaN +spatialCalScaleY=NaN +colormapMax=NaN +rescaleOffset=0.0 +roiWidth=-1 +colormap=Grayscale +invert=false +colormapMin=NaN +rotation=0.0 +rotationCrop=false +rescaleFactor=1.0 +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +flipHorizontally=false +colormapAutomatic=false +roiY=0 +roiX=0 +transpose=false diff --git a/devices/ai1.properties b/devices/ai1.properties new file mode 100644 index 0000000..b792352 --- /dev/null +++ b/devices/ai1.properties @@ -0,0 +1,7 @@ +#Wed Jun 14 16:07:53 CEST 2023 +offset=4.0 +precision=3 +scale=2.44140625E-4 +description=Current +unit=mA +sign_bit=0 diff --git a/devices/ai1pv.properties b/devices/ai1pv.properties new file mode 100644 index 0000000..b792352 --- /dev/null +++ b/devices/ai1pv.properties @@ -0,0 +1,7 @@ +#Wed Jun 14 16:07:53 CEST 2023 +offset=4.0 +precision=3 +scale=2.44140625E-4 +description=Current +unit=mA +sign_bit=0 diff --git a/devices/ci230606_001#001.tif.properties b/devices/ci230606_001#001.tif.properties new file mode 100644 index 0000000..75da3e3 --- /dev/null +++ b/devices/ci230606_001#001.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 09:56:30 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/ci230606_001#002.tif.properties b/devices/ci230606_001#002.tif.properties new file mode 100644 index 0000000..317f77a --- /dev/null +++ b/devices/ci230606_001#002.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 09:56:31 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/ci230606_001#003.tif.properties b/devices/ci230606_001#003.tif.properties new file mode 100644 index 0000000..b3c1e02 --- /dev/null +++ b/devices/ci230606_001#003.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 09:56:34 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/ci230606_003#001.tif.properties b/devices/ci230606_003#001.tif.properties new file mode 100644 index 0000000..0e422d1 --- /dev/null +++ b/devices/ci230606_003#001.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 10:13:51 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/dp1.properties b/devices/dp1.properties old mode 100755 new mode 100644 index 9d9b9fe..c116104 --- a/devices/dp1.properties +++ b/devices/dp1.properties @@ -1,12 +1,13 @@ -#Tue Oct 27 16:28:34 CET 2015 -accessType=ReadWrite -motor1=0.0|4.0|8.0|0.0 -motor2=0.0|5.0|3.0|NaN +#Tue Jun 13 15:25:00 CEST 2023 +precision=-1 +description=null +positions=Park|Ready|Out|Clear motor3=null motor4=null -motor5=null -motor6=null +motor1=0.0|4.0|8.0|0.0 +motor2=0.0|5.0|3.0|NaN +accessType=ReadWrite motor7=null motor8=null -positions=Park|Ready|Out|Clear -precision=-1 +motor5=null +motor6=null diff --git a/devices/et7026.properties b/devices/et7026.properties new file mode 100644 index 0000000..5026e7d --- /dev/null +++ b/devices/et7026.properties @@ -0,0 +1,8 @@ +#Tue Jun 06 10:59:59 CEST 2023 +offsetWriteAnalogOutput=0 +offsetWriteDigitalOutput=0 +offsetReadAnalogOutput=0 +offsetReadDigitalInput=0 +offsetReadAnalogInput=0 +offsetReadDigitalOutput=0 +timeout=1000 diff --git a/devices/et7244.properties b/devices/et7244.properties new file mode 100644 index 0000000..5026e7d --- /dev/null +++ b/devices/et7244.properties @@ -0,0 +1,8 @@ +#Tue Jun 06 10:59:59 CEST 2023 +offsetWriteAnalogOutput=0 +offsetWriteDigitalOutput=0 +offsetReadAnalogOutput=0 +offsetReadDigitalInput=0 +offsetReadAnalogInput=0 +offsetReadDigitalOutput=0 +timeout=1000 diff --git a/devices/i230511_098#014.tif.properties b/devices/i230511_098#014.tif.properties new file mode 100644 index 0000000..8958460 --- /dev/null +++ b/devices/i230511_098#014.tif.properties @@ -0,0 +1,20 @@ +#Thu May 11 19:11:31 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/i230511_098#015.tif.properties b/devices/i230511_098#015.tif.properties new file mode 100644 index 0000000..da34914 --- /dev/null +++ b/devices/i230511_098#015.tif.properties @@ -0,0 +1,20 @@ +#Thu May 11 19:11:35 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/i230511_098#016.tif.properties b/devices/i230511_098#016.tif.properties new file mode 100644 index 0000000..709a97e --- /dev/null +++ b/devices/i230511_098#016.tif.properties @@ -0,0 +1,20 @@ +#Thu May 11 19:11:20 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/i230511_098#017.tif.properties b/devices/i230511_098#017.tif.properties new file mode 100644 index 0000000..ce1e0d9 --- /dev/null +++ b/devices/i230511_098#017.tif.properties @@ -0,0 +1,20 @@ +#Thu May 11 19:11:11 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/i230606_001#001.tif.properties b/devices/i230606_001#001.tif.properties new file mode 100644 index 0000000..7f6618e --- /dev/null +++ b/devices/i230606_001#001.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 09:56:36 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/i230606_001#002.tif.properties b/devices/i230606_001#002.tif.properties new file mode 100644 index 0000000..f2d597e --- /dev/null +++ b/devices/i230606_001#002.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 09:56:37 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/i230606_001#003.tif.properties b/devices/i230606_001#003.tif.properties new file mode 100644 index 0000000..a21291f --- /dev/null +++ b/devices/i230606_001#003.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 09:56:38 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/i230606_002#001.tif.properties b/devices/i230606_002#001.tif.properties new file mode 100644 index 0000000..c5cbe17 --- /dev/null +++ b/devices/i230606_002#001.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 10:06:28 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/i230606_002#002.tif.properties b/devices/i230606_002#002.tif.properties new file mode 100644 index 0000000..d3533b6 --- /dev/null +++ b/devices/i230606_002#002.tif.properties @@ -0,0 +1,20 @@ +#Tue Jun 06 10:06:30 CEST 2023 +spatialCalOffsetY=NaN +invert=false +spatialCalOffsetX=NaN +rotation=0.0 +rotationCrop=false +scale=1.0 +rescaleFactor=1.0 +grayscale=false +spatialCalUnits=mm +flipVertically=false +roiHeight=-1 +spatialCalScaleX=NaN +spatialCalScaleY=NaN +flipHorizontally=false +roiY=0 +roiX=0 +rescaleOffset=0.0 +transpose=false +roiWidth=-1 diff --git a/devices/image.properties b/devices/image.properties index 9ae51e1..c4674bf 100644 --- a/devices/image.properties +++ b/devices/image.properties @@ -1,4 +1,4 @@ -#Fri Dec 23 22:39:00 CET 2022 +#Sun Jun 11 15:10:26 CEST 2023 spatialCalOffsetY=NaN spatialCalOffsetX=NaN colormapLogarithmic=false @@ -6,7 +6,7 @@ scale=1.0 grayscale=false spatialCalScaleX=NaN spatialCalScaleY=NaN -colormapMax=20.0 +colormapMax=800.0 rescaleOffset=0.0 roiWidth=-1 colormap=Grayscale @@ -19,7 +19,7 @@ spatialCalUnits=null flipVertically=false roiHeight=-1 flipHorizontally=false -colormapAutomatic=false +colormapAutomatic=true roiY=0 roiX=0 transpose=false diff --git a/devices/m1.properties b/devices/m1.properties old mode 100755 new mode 100644 index bd86c60..8134b99 --- a/devices/m1.properties +++ b/devices/m1.properties @@ -1,9 +1,10 @@ -#Tue Oct 29 14:00:16 CET 2019 +#Tue Jun 13 15:25:00 CEST 2023 offset=0.0 maxValue=10.0 precision=2 rotation=false scale=1.0 +description=null estbilizationDelay=0 maxSpeed=10.0 resolution=NaN diff --git a/devices/m2.properties b/devices/m2.properties old mode 100755 new mode 100644 index bd86c60..8134b99 --- a/devices/m2.properties +++ b/devices/m2.properties @@ -1,9 +1,10 @@ -#Tue Oct 29 14:00:16 CET 2019 +#Tue Jun 13 15:25:00 CEST 2023 offset=0.0 maxValue=10.0 precision=2 rotation=false scale=1.0 +description=null estbilizationDelay=0 maxSpeed=10.0 resolution=NaN diff --git a/devices/p1.properties b/devices/p1.properties old mode 100755 new mode 100644 index 9da4f16..6652021 --- a/devices/p1.properties +++ b/devices/p1.properties @@ -1,4 +1,4 @@ -#Tue Oct 29 14:00:16 CET 2019 +#Tue Jun 13 15:25:00 CEST 2023 minValue=0.0 unit=mm offset=0.0 @@ -7,4 +7,5 @@ precision=-1 rotation=false sign_bit=0 scale=1.0 +description=null resolution=NaN diff --git a/devices/rmu_ry.properties b/devices/rmu_ry.properties new file mode 100644 index 0000000..d9c0c3c --- /dev/null +++ b/devices/rmu_ry.properties @@ -0,0 +1,19 @@ +#Wed Jun 14 21:28:18 CEST 2023 +offset=0.0 +maxValue=10.0 +rotation=false +precision=3 +scale=1.0 +description=user input Ry +estbilizationDelay=0 +maxSpeed=NaN +resolution=0.003 +homingType=None +startRetries=1 +minValue=-10.0 +unit= +defaultSpeed=NaN +hasEnable=false +sign_bit=0 +monitorByPosition=false +minSpeed=NaN diff --git a/devices/test.properties b/devices/test.properties new file mode 100644 index 0000000..cf709c8 --- /dev/null +++ b/devices/test.properties @@ -0,0 +1,8 @@ +#Tue Jun 13 15:11:20 CEST 2023 +offsetWriteAnalogOutput=0 +offsetWriteDigitalOutput=0 +offsetReadAnalogOutput=0 +offsetReadDigitalInput=0 +offsetReadAnalogInput=0 +offsetReadDigitalOutput=0 +timeout=1000 diff --git a/plugins/Align_ComputeShifts.java b/plugins/Align_ComputeShifts.java index 6013eca..19e91f4 100644 --- a/plugins/Align_ComputeShifts.java +++ b/plugins/Align_ComputeShifts.java @@ -4,10 +4,10 @@ import ij.gui.*; import java.awt.*; import ij.plugin.PlugIn; import ij.WindowManager; -//import edu.emory.mathcs.jtransforms.fft.*; -//import edu.emory.mathcs.utils.*; -import org.jtransforms.fft.*; -import org.jtransforms.utils.*; +import edu.emory.mathcs.jtransforms.fft.*; +import edu.emory.mathcs.utils.*; +//import org.jtransforms.fft.*; +//import org.jtransforms.utils.*; import flanagan.complex.*; import flanagan.math.*; import ij.plugin.frame.RoiManager; diff --git a/plugins/Beamline.java b/plugins/Beamline.java index 1dca81c..7fe8a33 100755 --- a/plugins/Beamline.java +++ b/plugins/Beamline.java @@ -3,6 +3,7 @@ import ch.psi.pshell.swing.DeviceValuePanel; import ch.psi.pshell.ui.Panel; import ch.psi.utils.Arr; import ch.psi.utils.State; +import ch.psi.utils.Str; import ch.psi.utils.swing.SwingUtils; import java.awt.Component; import java.awt.Font; @@ -111,36 +112,45 @@ public class Beamline extends Panel { protected void doUpdate() { } + void updateSpinnerDouble(JSpinner spinner, String setting){ + try{ + Double value = Double.valueOf(getSetting(setting)); + spinner.setValue(value); + } catch (Exception ex){ + } + } + + void updateSpinnerString(JSpinner spinner, String setting){ + try{ + spinner.setValue(getSetting(setting)); + } catch (Exception ex){ + } + } + + void updateComboString(JComboBox combo, String setting){ + try{ + combo.setSelectedItem(getSetting(setting)); + } catch (Exception ex){ + } + } + void updateBeamlineSetup() throws IOException{ - String id = getSetting("ID"); - Double en = Double.valueOf(getSetting("ENERGY")); - String pol1 = getSetting("POL_ID_1"); - Double alp1 = Double.valueOf(getSetting("ALPHA_ID_1")); - String har1 = getSetting("HARMONIC_ID_1"); - Double off1 = Double.valueOf(getSetting("OFFSET_ID_1")); - String pol2 = getSetting("POL_ID_2"); - Double alp2 = Double.valueOf(getSetting("ALPHA_ID_2")); - String har2 = getSetting("HARMONIC_ID_2"); - Double off2 = Double.valueOf(getSetting("OFFSET_ID_2")); - String grat = getSetting("GRATING"); - Double order= Double.valueOf(getSetting("DIFF_ORD")); - Double cff = Double.valueOf(getSetting("CFF")); - comboID.setSelectedItem(id); - spinnerImgEng.setValue(en); - comboPol1.setSelectedItem(pol1); - spinnerAlp1.setValue(alp1); - spinnerHar1.setValue(har1); - spinnerOff1.setValue(off1); - comboPol2.setSelectedItem(pol2); - spinnerAlp2.setValue(alp2); - spinnerHar2.setValue(har2); - spinnerOff2.setValue(off2); - comboGrating.setSelectedItem(grat); - comboDiffOrder.setSelectedItem(order); - spinnerCff.setValue(cff); - checkAutoValve.setSelected(String.valueOf(getSetting("AUTO_SWITCH_VALVE")).equalsIgnoreCase("true")); - checkAutoShutter.setSelected(String.valueOf(getSetting("AUTO_SWITCH_SHUTTER")).equalsIgnoreCase("true")); + updateComboString(comboID, getSetting("ID")); + updateSpinnerDouble(spinnerImgEng, "ENERGY"); + updateComboString(comboPol1, getSetting("POL_ID_1")); + updateSpinnerDouble(spinnerAlp1, "ALPHA_ID_1"); + updateSpinnerString(spinnerHar1, "HARMONIC_ID_1"); + updateSpinnerDouble(spinnerOff1, "OFFSET_ID_1"); + updateComboString(comboPol2, getSetting("POL_ID_2")); + updateSpinnerDouble(spinnerAlp2, "ALPHA_ID_2"); + updateSpinnerString(spinnerHar2, "HARMONIC_ID_2"); + updateSpinnerDouble(spinnerOff2, "OFFSET_ID_2"); + updateComboString(comboGrating, getSetting("GRATING")); + updateComboString(comboDiffOrder, getSetting("DIFF_ORD")); + updateSpinnerDouble(spinnerCff, "CFF"); + checkAutoValve.setSelected(Str.toString(getSetting("AUTO_SWITCH_VALVE")).equalsIgnoreCase("true")); + checkAutoShutter.setSelected(Str.toString(getSetting("AUTO_SWITCH_SHUTTER")).equalsIgnoreCase("true")); } void updateControls() { diff --git a/plugins/BeamlineInit.form b/plugins/BeamlineInit.form new file mode 100644 index 0000000..128a2ce --- /dev/null +++ b/plugins/BeamlineInit.form @@ -0,0 +1,91 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/BeamlineInit.java b/plugins/BeamlineInit.java new file mode 100644 index 0000000..0178116 --- /dev/null +++ b/plugins/BeamlineInit.java @@ -0,0 +1,199 @@ + +import ch.psi.pshell.ui.Panel; +import ch.psi.utils.State; +import javax.swing.JButton; + +/** + * + */ +public class BeamlineInit extends Panel { + + public BeamlineInit() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + @Override + protected void onTimer() { + } + + @Override + protected void onLoaded() { + + } + + @Override + protected void onUnloaded() { + + } + + //Invoked by 'update()' to update components in the event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + buttonAUinit = new javax.swing.JButton(); + buttonFEinit = new javax.swing.JButton(); + buttonExitSlitsInit = new javax.swing.JButton(); + buttonCMUinit = new javax.swing.JButton(); + statusAU = new javax.swing.JLabel(); + + buttonAUinit.setText("Init AU"); + buttonAUinit.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonAUinitActionPerformed(evt); + } + }); + + buttonFEinit.setText("init FE"); + buttonFEinit.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonFEinitActionPerformed(evt); + } + }); + + buttonExitSlitsInit.setText("init Exit Slits"); + buttonExitSlitsInit.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonExitSlitsInitActionPerformed(evt); + } + }); + + buttonCMUinit.setText("init CMU"); + buttonCMUinit.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonCMUinitActionPerformed(evt); + } + }); + + statusAU.setText("status AU"); + + 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(83, 83, 83) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(buttonAUinit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonFEinit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonExitSlitsInit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonCMUinit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(18, 18, 18) + .addComponent(statusAU) + .addContainerGap(184, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(24, 24, 24) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(buttonAUinit) + .addComponent(statusAU)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(buttonFEinit) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(buttonExitSlitsInit) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(buttonCMUinit) + .addContainerGap(271, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + private void buttonAUinitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAUinitActionPerformed + statusAU.setText("Running"); + try { + runAsync("beamline_init/init/InitAU").handle((ret, ex) -> { + if (ex != null) { + statusAU.setText(ex.getMessage()); + showException((Exception) ex); + } else { + statusAU.setText((ret==null)? "" : ret.toString()); + } + return ret; + }); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonAUinitActionPerformed + + private void buttonFEinitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonFEinitActionPerformed + try { + boolean background = false; + + runAsync("beamline_init/init/InitFE", background).handle((ret, ex) -> { + ((JButton) evt.getSource()).setEnabled(true); + if (ex != null) { + showException((Exception) ex); + } + return ret; + }); + + ((JButton) evt.getSource()).setEnabled(false); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonFEinitActionPerformed + + private void buttonExitSlitsInitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExitSlitsInitActionPerformed + try { + boolean background = false; + + runAsync("beamline_init/init/InitExitSlit", background).handle((ret, ex) -> { + ((JButton) evt.getSource()).setEnabled(true); + if (ex != null) { + showException((Exception) ex); + } + return ret; + }); + + ((JButton) evt.getSource()).setEnabled(false); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonExitSlitsInitActionPerformed + + private void buttonCMUinitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCMUinitActionPerformed + try { + boolean background = false; + + runAsync("beamline_init/init/InitCMU", background).handle((ret, ex) -> { + ((JButton) evt.getSource()).setEnabled(true); + if (ex != null) { + showException((Exception) ex); + } + return ret; + }); + + ((JButton) evt.getSource()).setEnabled(false); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonCMUinitActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton buttonAUinit; + private javax.swing.JButton buttonCMUinit; + private javax.swing.JButton buttonExitSlitsInit; + private javax.swing.JButton buttonFEinit; + private javax.swing.JLabel statusAU; + // End of variables declaration//GEN-END:variables +} diff --git a/plugins/Cooling.form b/plugins/Cooling.form new file mode 100644 index 0000000..df4a590 --- /dev/null +++ b/plugins/Cooling.form @@ -0,0 +1,556 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/Cooling.java b/plugins/Cooling.java new file mode 100644 index 0000000..01f537a --- /dev/null +++ b/plugins/Cooling.java @@ -0,0 +1,555 @@ + +import ch.psi.pshell.epics.GenericChannel; +import ch.psi.pshell.swing.DevicePanel; +import ch.psi.pshell.swing.RegisterPanel; +import ch.psi.pshell.ui.Panel; +import ch.psi.pshell.ui.StripChart; +import ch.psi.utils.State; +import java.io.File; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + */ +public class Cooling extends Panel { + + public Cooling() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + DevicePanel[] panels = new DevicePanel[]{panelNeedleValveSet,panelNeedleValveGet,panelHeFlowSet,panelHeFlowGet, + panelSBResist,panelSBTemp,panelSBVolt,panelSBCurr,panelSBResistance,panelGude1,panelGude2,panelGude3,panelGude4}; + for (DevicePanel p : panels){ + + GenericChannel channel = new GenericChannel(p.getName(), p.getName()); + if (p instanceof RegisterPanel){ + channel.setPrecision(((RegisterPanel)p).getDecimals()); + } + channel.setMonitored(true); + try { + channel.initialize(); + p.setDevice(channel); + } catch (Exception ex) { + Logger.getLogger(Cooling.class.getName()).log(Level.SEVERE, null, ex); + } + + } + + panelPlot.removeAll(); + panelPlot.add(StripChart.getPlotPanel(new File("/sls/X11MA/data/X11MA/strip/PEEM-Pt100.scd"))); + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + @Override + protected void onTimer() { + } + + @Override + protected void onLoaded() { + + } + + @Override + protected void onUnloaded() { + + } + + //Invoked by 'update()' to update components in the event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + panelNeedleValveGet = new ch.psi.pshell.swing.DeviceValuePanel(); + panelNeedleValveSet = new ch.psi.pshell.swing.RegisterPanel(); + label1 = new java.awt.Label(); + label2 = new java.awt.Label(); + panelHeFlowSet = new ch.psi.pshell.swing.RegisterPanel(); + panelHeFlowGet = new ch.psi.pshell.swing.DeviceValuePanel(); + jLabel1 = new javax.swing.JLabel(); + panelFilamentSet = new ch.psi.pshell.swing.RegisterPanel(); + jPanel1 = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + panelSBResist = new ch.psi.pshell.swing.DeviceValuePanel(); + panelSBTemp = new ch.psi.pshell.swing.DeviceValuePanel(); + jLabel3 = new javax.swing.JLabel(); + panelSBVolt = new ch.psi.pshell.swing.DeviceValuePanel(); + panelSBCurr = new ch.psi.pshell.swing.DeviceValuePanel(); + jLabel4 = new javax.swing.JLabel(); + panelSBResistance = new ch.psi.pshell.swing.DeviceValuePanel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel14 = new javax.swing.JLabel(); + jLabel15 = new javax.swing.JLabel(); + jLabel16 = new javax.swing.JLabel(); + panelPlot = new javax.swing.JPanel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + jLabel11 = new javax.swing.JLabel(); + jPanel2 = new javax.swing.JPanel(); + panelGude1 = new ch.psi.pshell.swing.DeviceValuePanel(); + panelGude2 = new ch.psi.pshell.swing.DeviceValuePanel(); + panelGude3 = new ch.psi.pshell.swing.DeviceValuePanel(); + panelGude4 = new ch.psi.pshell.swing.DeviceValuePanel(); + jLabel17 = new javax.swing.JLabel(); + jLabel18 = new javax.swing.JLabel(); + jLabel19 = new javax.swing.JLabel(); + jLabel20 = new javax.swing.JLabel(); + checkGude1 = new javax.swing.JCheckBox(); + checkGude2 = new javax.swing.JCheckBox(); + checkGude3 = new javax.swing.JCheckBox(); + checkGude4 = new javax.swing.JCheckBox(); + + panelNeedleValveGet.setName("X11MA-ES1-AO4:V"); // NOI18N + + panelNeedleValveSet.setDecimals(3); + panelNeedleValveSet.setName("X11MA-ES1-AO4:V"); // NOI18N + + label1.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N + label1.setText("Needle Valve"); + + label2.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N + label2.setText("He Flow Meter"); + + panelHeFlowSet.setDecimals(3); + panelHeFlowSet.setName("X11MA-PC-BRONKHORST:PEEM-SET-SETPOINT"); // NOI18N + + panelHeFlowGet.setName("X11MA-PC-BRONKHORST:PEEM-GET-MEASURE"); // NOI18N + + jLabel1.setFont(new java.awt.Font("DejaVu Sans", 1, 12)); // NOI18N + jLabel1.setText("LEEM Filament"); + + panelFilamentSet.setDecimals(3); + panelFilamentSet.setDeviceName("fil"); + panelFilamentSet.setName(""); // NOI18N + + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Switchbox")); + jPanel1.setName(""); // NOI18N + + jLabel2.setText("Pt100"); + + panelSBResist.setName("X11MA-PC-SW:Pt100-R"); // NOI18N + + panelSBTemp.setName("X11MA-PC-SW:Pt100-K"); // NOI18N + + jLabel3.setText("E-Field"); + + panelSBVolt.setName("X11MA-PC-SW:E-Field-V"); // NOI18N + + panelSBCurr.setName("X11MA-PC-SW:E-Field-I"); // NOI18N + + jLabel4.setText("Resistance"); + jLabel4.setToolTipText("Resistance"); + + panelSBResistance.setName("X11MA-PC-SW:Resistance"); // NOI18N + + jLabel12.setText("Ohm"); + + jLabel13.setText("K"); + + jLabel14.setText("V"); + + jLabel15.setText("K"); + + jLabel16.setText("Ohm"); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(jLabel4) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(panelSBVolt, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE) + .addComponent(panelSBResist, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel12) + .addComponent(jLabel14)) + .addGap(18, 18, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(panelSBTemp, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel13)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(panelSBCurr, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel15))))) + .addContainerGap(15, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(panelSBResistance, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel16) + .addGap(0, 0, Short.MAX_VALUE)))) + ); + + jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {panelSBResistance, panelSBVolt}); + + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(14, 14, 14) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(panelSBResist, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(panelSBTemp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(2, 2, 2))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel3) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(panelSBVolt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(16, 16, 16) + .addComponent(jLabel14)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(15, 15, 15) + .addComponent(jLabel15)))) + .addComponent(panelSBCurr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(panelSBResistance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + panelPlot.setBorder(javax.swing.BorderFactory.createTitledBorder("PEEM Pt100")); + panelPlot.setLayout(new java.awt.BorderLayout()); + + jLabel5.setText("V"); + + jLabel6.setText("V"); + + jLabel7.setText("%"); + + jLabel8.setText("%"); + + jLabel11.setText("mA"); + + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Power Sockets")); + + panelGude1.setName("PEEM-GUDE:CH1READ"); // NOI18N + + panelGude2.setName("PEEM-GUDE:CH2READ"); // NOI18N + + panelGude3.setName("PEEM-GUDE:CH3READ"); // NOI18N + + panelGude4.setName("PEEM-GUDE:CH4READ"); // NOI18N + + jLabel17.setText("Helium Pump"); + + jLabel18.setText("Detector"); + + jLabel19.setText("He level meter"); + + jLabel20.setText("Heater"); + + checkGude1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkGude1ActionPerformed(evt); + } + }); + + checkGude2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkGude2ActionPerformed(evt); + } + }); + + checkGude3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkGude3ActionPerformed(evt); + } + }); + + checkGude4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkGude4ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addGap(11, 11, 11) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel19) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(checkGude3)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel20) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(checkGude4)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel17) + .addComponent(jLabel18)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(checkGude2) + .addComponent(checkGude1)))) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(panelGude3, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(panelGude1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(panelGude2, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(panelGude4, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(15, Short.MAX_VALUE)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap(12, Short.MAX_VALUE) + .addComponent(panelGude1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(14, 14, 14) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(checkGude1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(panelGude2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(checkGude2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(panelGude3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(checkGude3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(12, 12, 12) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(panelGude4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(checkGude4, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()))) + ); + + 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(37, 37, 37) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(panelNeedleValveSet, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(panelNeedleValveGet, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel6)) + .addComponent(label2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addComponent(panelHeFlowSet, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(panelHeFlowGet, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(panelFilamentSet, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(76, 76, 76))) + .addGap(4, 4, 4) + .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(33, 33, 33) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(25, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(panelPlot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(1, 1, 1) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(panelNeedleValveGet, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(panelNeedleValveSet, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(19, 19, 19)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel6) + .addGap(30, 30, 30))) + .addComponent(label2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(1, 1, 1) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(panelHeFlowSet, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(panelHeFlowGet, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(panelFilamentSet, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(47, 47, 47)) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(32, 32, 32) + .addComponent(panelPlot, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE) + .addContainerGap()) + ); + + jPanel1.getAccessibleContext().setAccessibleName(""); + }// //GEN-END:initComponents + + private void checkGude1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkGude1ActionPerformed + try { + if (checkGude1.isSelected()){ + evalAsync("gude1('On')"); + } else { + evalAsync("gude1('Off')"); + } + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_checkGude1ActionPerformed + + private void checkGude2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkGude2ActionPerformed + try { + if (checkGude2.isSelected()){ + evalAsync("gude2('On')"); + } else { + evalAsync("gude2('Off')"); + } + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_checkGude2ActionPerformed + + private void checkGude3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkGude3ActionPerformed + try { + if (checkGude3.isSelected()){ + evalAsync("gude3('On')"); + } else { + evalAsync("gude3('Off')"); + } + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_checkGude3ActionPerformed + + private void checkGude4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkGude4ActionPerformed + try { + if (checkGude4.isSelected()){ + evalAsync("gude4('On')"); + } else { + evalAsync("gude4('Off')"); + } + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_checkGude4ActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox checkGude1; + private javax.swing.JCheckBox checkGude2; + private javax.swing.JCheckBox checkGude3; + private javax.swing.JCheckBox checkGude4; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel17; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel20; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private java.awt.Label label1; + private java.awt.Label label2; + private ch.psi.pshell.swing.RegisterPanel panelFilamentSet; + private ch.psi.pshell.swing.DeviceValuePanel panelGude1; + private ch.psi.pshell.swing.DeviceValuePanel panelGude2; + private ch.psi.pshell.swing.DeviceValuePanel panelGude3; + private ch.psi.pshell.swing.DeviceValuePanel panelGude4; + private ch.psi.pshell.swing.DeviceValuePanel panelHeFlowGet; + private ch.psi.pshell.swing.RegisterPanel panelHeFlowSet; + private ch.psi.pshell.swing.DeviceValuePanel panelNeedleValveGet; + private ch.psi.pshell.swing.RegisterPanel panelNeedleValveSet; + private javax.swing.JPanel panelPlot; + private ch.psi.pshell.swing.DeviceValuePanel panelSBCurr; + private ch.psi.pshell.swing.DeviceValuePanel panelSBResist; + private ch.psi.pshell.swing.DeviceValuePanel panelSBResistance; + private ch.psi.pshell.swing.DeviceValuePanel panelSBTemp; + private ch.psi.pshell.swing.DeviceValuePanel panelSBVolt; + // End of variables declaration//GEN-END:variables +} diff --git a/plugins/DataAcquisition.form b/plugins/DataAcquisition.form index 8638854..6517f17 100755 --- a/plugins/DataAcquisition.form +++ b/plugins/DataAcquisition.form @@ -712,6 +712,9 @@ + + + @@ -1066,6 +1069,9 @@ + + + diff --git a/plugins/DataAcquisition.java b/plugins/DataAcquisition.java old mode 100755 new mode 100644 index 13eb145..29edbc4 --- a/plugins/DataAcquisition.java +++ b/plugins/DataAcquisition.java @@ -10,7 +10,7 @@ import ch.psi.pshell.ui.Panel; import ch.psi.utils.Arr; import ch.psi.utils.IO; import ch.psi.utils.Serializer; -import ch.psi.utils.State; +import ch.psi.utils.State; import ch.psi.utils.Str; import ch.psi.utils.swing.SwingUtils; import java.awt.Color; @@ -204,7 +204,11 @@ public class DataAcquisition extends Panel { Rect imagingRoiOverlay; Rectangle getImagingRoi(){ - return (Rectangle) getGlobalVar("IMAGING_ROI"); + try{ + return (Rectangle) getGlobalVar("IMAGING_ROI"); + } catch (Exception ex){ + return null; + } } //Callback to perform update - in event thread @@ -959,6 +963,11 @@ public class DataAcquisition extends Panel { checkImgAutosave.setSelected(true); checkImgAutosave.setText("Autosave"); + checkImgAutosave.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkImgAutosaveActionPerformed(evt); + } + }); jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel20.setText("Measurements:"); @@ -1177,6 +1186,11 @@ public class DataAcquisition extends Panel { checkSpecWithI0.setSelected(true); checkSpecWithI0.setText("With I0"); + checkSpecWithI0.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkSpecWithI0ActionPerformed(evt); + } + }); checkSpecSaveSpectrum.setSelected(true); checkSpecSaveSpectrum.setText("Save spectrum"); @@ -1815,6 +1829,14 @@ public class DataAcquisition extends Panel { } }//GEN-LAST:event_buttonImgOTFAbortActionPerformed + private void checkImgAutosaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkImgAutosaveActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_checkImgAutosaveActionPerformed + + private void checkSpecWithI0ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkSpecWithI0ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_checkSpecWithI0ActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton buttonAdd; private javax.swing.JButton buttonClear; diff --git a/plugins/Eiger.form b/plugins/Eiger.form index 59bd2bc..4f6d041 100755 --- a/plugins/Eiger.form +++ b/plugins/Eiger.form @@ -45,18 +45,32 @@ - - - + + - + + + + + + + + + + + + + + + + + + - - @@ -85,7 +99,7 @@ - + @@ -121,9 +135,14 @@ - - - + + + + + + + + @@ -354,5 +373,27 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/Eiger.java b/plugins/Eiger.java index 4fa270c..227c89c 100755 --- a/plugins/Eiger.java +++ b/plugins/Eiger.java @@ -16,6 +16,7 @@ public class Eiger extends Panel { ChannelInteger bitDepth; ChannelInteger mode; ChannelDouble exposure; + ChannelDouble threshold; public Eiger() { initComponents(); @@ -33,6 +34,7 @@ public class Eiger extends Panel { bitDepth = ((ChannelInteger)getDevice("eiger_bit_depth")); mode = ((ChannelInteger) getDevice("eiger_mode")); exposure = ((ChannelDouble) getDevice("eiger_exposure")); + threshold = ((ChannelDouble) getDevice("eiger_threshold")); startTimer(1000,10); } catch (Exception ex) { showException(ex); @@ -70,10 +72,15 @@ public class Eiger extends Panel { try{ spinnerExposure.setValue(exposure.take()); } catch (Exception ex){ - } + } + try{ + spinnerThreshold.setValue(threshold.take()); + } catch (Exception ex){ + } comboDepth.setEnabled(bitDepth.isInitialized()); comboMode.setEnabled(mode.isInitialized()); - spinnerExposure.setEnabled(exposure.isInitialized()); + spinnerExposure.setEnabled(exposure.isInitialized()); + spinnerThreshold.setEnabled(threshold.isInitialized()); } finally{ updatingControls=false; @@ -131,6 +138,9 @@ public class Eiger extends Panel { jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); textFOV = new javax.swing.JTextField(); + jLabel8 = new javax.swing.JLabel(); + spinnerThreshold = new javax.swing.JSpinner(); + deviceValuePanel5 = new ch.psi.pshell.swing.DeviceValuePanel(); renderer.setDeviceName("image"); renderer.setMode(ch.psi.pshell.imaging.RendererMode.Stretch); @@ -249,6 +259,23 @@ public class Eiger extends Panel { textFOV.setDisabledTextColor(new java.awt.Color(0, 0, 0)); textFOV.setEnabled(false); + jLabel8.setText("Threshold [eV]:"); + + spinnerThreshold.setModel(new javax.swing.SpinnerNumberModel(0.0d, null, null, 1.0d)); + spinnerThreshold.setEnabled(false); + spinnerThreshold.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerThresholdStateChanged(evt); + } + }); + spinnerThreshold.addPropertyChangeListener(new java.beans.PropertyChangeListener() { + public void propertyChange(java.beans.PropertyChangeEvent evt) { + spinnerThresholdPropertyChange(evt); + } + }); + + deviceValuePanel5.setDeviceName("eiger_threshold_rbv"); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -278,16 +305,26 @@ public class Eiger extends Panel { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(textFOV, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(spinnerExposure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(deviceValuePanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) + .addGroup(layout.createSequentialGroup() + .addComponent(textFOV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel8) + .addGap(10, 10, 10))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(deviceValuePanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deviceValuePanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(spinnerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(deviceValuePanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() @@ -307,7 +344,7 @@ public class Eiger extends Panel { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(buttonCloseVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonOpenVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addGap(39, 39, 39)))) + .addGap(166, 166, 166)))) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboDepth, comboMode, deviceValuePanel1, deviceValuePanel2, deviceValuePanel3, spinnerExposure, textFOV}); @@ -338,9 +375,13 @@ public class Eiger extends Panel { .addComponent(deviceValuePanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel7) - .addComponent(textFOV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(deviceValuePanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(textFOV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel8) + .addComponent(spinnerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(36, 36, 36) @@ -527,6 +568,27 @@ public class Eiger extends Panel { }//GEN-LAST:event_spinnerMinStateChanged + private void spinnerThresholdStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerThresholdStateChanged + try{ + if (!updatingControls){ + ch.psi.pshell.device.Camera eiger = (ch.psi.pshell.device.Camera) getDevice("eiger"); + if (eiger.isStarted()){ + buttonDoneActionPerformed(null); + eiger.waitState(State.Ready, 10000); //Timeout of 10s + } + //((ch.psi.pshell.device.Camera) getDevice("eiger")).stop(); + //TimeUnit.SECONDS.sleep(1); + threshold.write((Double)spinnerThreshold.getValue()); + } + } catch (Exception ex){ + showException(ex); + } + }//GEN-LAST:event_spinnerThresholdStateChanged + + private void spinnerThresholdPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_spinnerThresholdPropertyChange + // TODO add your handling code here: + }//GEN-LAST:event_spinnerThresholdPropertyChange + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton buttonAquire; private javax.swing.JButton buttonCloseVG10; @@ -541,6 +603,7 @@ public class Eiger extends Panel { private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel2; private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel3; private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel4; + private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel5; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; @@ -548,10 +611,12 @@ public class Eiger extends Panel { private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; private ch.psi.pshell.imaging.Renderer renderer; private javax.swing.JSpinner spinnerExposure; private javax.swing.JSpinner spinnerMax; private javax.swing.JSpinner spinnerMin; + private javax.swing.JSpinner spinnerThreshold; private javax.swing.JTextField textFOV; // End of variables declaration//GEN-END:variables } diff --git a/plugins/Initialization.form b/plugins/Initialization.form index 3dfafc2..68c98b1 100644 --- a/plugins/Initialization.form +++ b/plugins/Initialization.form @@ -11,7 +11,6 @@ - diff --git a/plugins/XPEEM_Settings.form b/plugins/XPEEM_Settings.form index ae559b5..1987d8d 100644 --- a/plugins/XPEEM_Settings.form +++ b/plugins/XPEEM_Settings.form @@ -17,7 +17,14 @@ - + + + + + + + + @@ -52,7 +59,7 @@ - + @@ -61,7 +68,8 @@ - + + @@ -71,13 +79,22 @@ - + + + + - + + + + - + + + + @@ -160,17 +177,17 @@ - + - + - + @@ -181,5 +198,13 @@ + + + + + + + + diff --git a/plugins/XPEEM_Settings.java b/plugins/XPEEM_Settings.java index 8e9238b..df03110 100644 --- a/plugins/XPEEM_Settings.java +++ b/plugins/XPEEM_Settings.java @@ -70,6 +70,10 @@ public class XPEEM_Settings extends Panel { label6 = new java.awt.Label(); label7 = new java.awt.Label(); buttonRunSelected = new javax.swing.JButton(); + checkSetting1 = new javax.swing.JCheckBox(); + checkSetting2 = new javax.swing.JCheckBox(); + checkSetting3 = new javax.swing.JCheckBox(); + checkSetting4 = new javax.swing.JCheckBox(); ButtonDefaultXrays.setText("X-rays (Standard)"); ButtonDefaultXrays.addActionListener(new java.awt.event.ActionListener() { @@ -108,11 +112,11 @@ public class XPEEM_Settings extends Panel { label4.setText("Obj. = 1475.0 mA, Stig. A,B = 0.0, Obj. Align. x,y = 0.0, Start voltage = 0.0,"); - label5.setText(" FOV = 100 um, CA = open, Slit = open."); + label5.setText(" FOV = 100 um"); - label6.setText(" FOV = 100 um, CA = open, Slit = open."); + label6.setText(" FOV = 100 um"); - label7.setText("x,y = 0.0, tilt = 0.0"); + label7.setText("x,y = 0.0, tilt = 0.0, CA = open, Slit = open, Close VG10."); buttonRunSelected.setText("Run Selected"); buttonRunSelected.addActionListener(new java.awt.event.ActionListener() { @@ -126,7 +130,13 @@ public class XPEEM_Settings extends Panel { layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGap(79, 79, 79) + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(checkSetting2) + .addComponent(checkSetting3) + .addComponent(checkSetting4) + .addComponent(checkSetting1)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(ButtonDefaultOptics10kV) @@ -152,7 +162,7 @@ public class XPEEM_Settings extends Panel { .addComponent(ButtonNeutralizePosition, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(label7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(68, Short.MAX_VALUE)) + .addContainerGap(117, Short.MAX_VALUE)) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {ButtonDefaultOptics10kV, ButtonDefaultOptics15kV, ButtonDefaultXrays, ButtonNeutralizePosition}); @@ -162,6 +172,7 @@ public class XPEEM_Settings extends Panel { .addGroup(layout.createSequentialGroup() .addGap(46, 46, 46) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(checkSetting1) .addComponent(ButtonDefaultOptics15kV) .addGroup(layout.createSequentialGroup() .addComponent(label4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -170,13 +181,19 @@ public class XPEEM_Settings extends Panel { .addGap(39, 39, 39) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(ButtonDefaultOptics10kV) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(ButtonDefaultOptics10kV) + .addComponent(checkSetting2)) .addGap(36, 36, 36) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() - .addComponent(ButtonDefaultXrays) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(ButtonDefaultXrays) + .addComponent(checkSetting3)) .addGap(42, 42, 42) - .addComponent(ButtonNeutralizePosition)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(ButtonNeutralizePosition) + .addComponent(checkSetting4))) .addGroup(layout.createSequentialGroup() .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -252,32 +269,32 @@ public class XPEEM_Settings extends Panel { getContext().startExecution(CommandSource.plugin, null, null,null, false); new Thread(()->{ try{ - if (true){ + if (checkSetting1.isSelected()==true){ this.eval("peem_optics_default_15kV()", true); } - if (true){ + if (checkSetting2.isSelected()==true){ this.eval("peem_optics_default_10kV()", true); - } - if (true){ + } + if (checkSetting3.isSelected()==true){ this.eval("xrays_default()", true); - } - if (true){ + } + if (checkSetting4.isSelected()==true){ this.eval("neutralize_position()", true); - } - + } + } catch (Exception ex){ - getLogger().log(Level.WARNING, null, ex); - } finally{ + getLogger().log(Level.WARNING, null, ex); + } finally{ try { getContext().endExecution(); } catch (Context.ContextStateException ex) { getLogger().log(Level.SEVERE, null, ex); } } - }).start(); + }).start(); } catch (Exception ex) { showException(ex); - } + } }//GEN-LAST:event_buttonRunSelectedActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables @@ -286,6 +303,10 @@ public class XPEEM_Settings extends Panel { private javax.swing.JButton ButtonDefaultXrays; private javax.swing.JButton ButtonNeutralizePosition; private javax.swing.JButton buttonRunSelected; + private javax.swing.JCheckBox checkSetting1; + private javax.swing.JCheckBox checkSetting2; + private javax.swing.JCheckBox checkSetting3; + private javax.swing.JCheckBox checkSetting4; private java.awt.Label label1; private java.awt.Label label2; private java.awt.Label label3; diff --git a/script/Users/PEEM/Armin/02_Eslit_offset_AK.py b/script/Users/PEEM/Armin/02_Eslit_offset_AK.py new file mode 100644 index 0000000..48ff311 --- /dev/null +++ b/script/Users/PEEM/Armin/02_Eslit_offset_AK.py @@ -0,0 +1,39 @@ +import sys + +from mathutils import fit_polynomial +from mathutils import PolynomialFunction + + +#seting parameters +sensor = 'KEI11' +if sensor == 'KEI10': + detector= keithley_1a + detector_range='X11MA-KEI10:RANGE' +elif sensor == 'KEI11': + detector= keithley_2a + detector_range='X11MA-KEI11:RANGE' +else: + print "Select a proper detector: KEI10 or KEI11." + sys.exit() + +caput(detector_range, 4) # 6 --> 200 nA +exit_slit.move(30.0) +speed = exit_slit.getSpeed() +min_speed=exit_slit.getMinSpeed() +exit_slit.setSpeed(min_speed) + +#scan Energy Slit +time.sleep(1) +#run('Users/PEEM/Armin/Functions/SlitCalib.py',{"Slit":exit_slit, "Slit_offset":exit_slit_offset, "detector":detector, "start":30, "end":-20.0, "step_size":1.0, "final_pos":20.0}) +#cscan([girder_x], ['ca://machine_cur'], [0.16], [0.18], [0.01], latency=1.0, time=10.0, relative=False, passes=1, zigzag=False, keep=False, name='Unknown') +result=lscan([exit_slit], [detector], [30.0], [-20.0], [1.0], latency=1.0) + + + + + +time.sleep(1) + +#resetting parameters +caput(detector_range, 0) # 0--> AUTO +exit_slit.setSpeed(speed) diff --git a/script/Users/PEEM/Armin/Functions/SlitCalib.py b/script/Users/PEEM/Armin/Functions/SlitCalib.py new file mode 100644 index 0000000..087bb43 --- /dev/null +++ b/script/Users/PEEM/Armin/Functions/SlitCalib.py @@ -0,0 +1,67 @@ +################################################################################################### +# Function fitting and peak search with mathutils.py +################################################################################################### + +from mathutils import fit_polynomial +from mathutils import PolynomialFunction + +# Input parameters (example) +#Slit = exit_slit +#Slit_offset = exit_slit_offset +#detector = keithley_1a +#start = 30.0 +#end = -20.0 +#step_size = 1.0 +#final_pos = 20.0 +#run('beamline_init/with_x-rays/functions/SlitCalib.py',{"Slit":exit_slit, "Slit_offset":exit_slit_offset, "detector":detector, "start":30, "end":-20.0, "step_size":1.0, "final_pos":20.0}) + +# Execute the scan +result=lscan(Slit, detector, start, end, float(step_size)) + +readable_ = result[detector] +positions_ = result[Slit] +print positions_ +readable=[] +positions=[] + +# execute the fit +fit_threshold=readable_[0]*0.05 + +#filter the positions with analog values above the threshold +for i in range(8,len(positions_),1): + if(readable_[i] +# microscope.send_receive("mmp 7 -9044.7", 60000) +# microscope.send_receive("mmp 2 -5998.6", 60000) +# microscope.send_receive("mmp 1 0.0", 60000) +# slitttt.read() +# slitttt.write(pos[0]) + +# read ROI intensity, see FocusScan.py +# scan_contrast +# if roi is None: +# sensor = image_contrast +# else: +# sensor = roi_contrast +# roi_contrast.set_roi(roi) +# +# see test_autofocus +#r=lscan (objective, image.contrast, RANGE[0], RANGE[1], STEP_SIZE, latency=(SETTLING_TIME + eiger.getExposure())) +#(norm, mn, std )= fit (r["image_contrast"], r["objective"]) +#if (mnRANGE[1]): +# raise Exception("Invalid fit") +#objective.write(mn) + diff --git a/script/Users/PEEM/Armin/RMU_scan.py b/script/Users/PEEM/Armin/RMU_scan.py new file mode 100644 index 0000000..703fbf3 --- /dev/null +++ b/script/Users/PEEM/Armin/RMU_scan.py @@ -0,0 +1,20 @@ +#for i in [-1.9, -2.0, -2.1]: +## girder_x.move(i, -1) +## rmu_ry.move(-4.477, -1) +# print "Do something" +# time.sleep(1.0) +# +#for x in range(0, 15): +# y = -3.5 + float(x)*0.5 +# z = -5.2211 + y*0.4865 +# #print("Girder x %f" % (y)) +# print("RMU Ry %f" % (z)) +# #str(1.23) +for x in range(30, 70): + y = -3.5 + float(x)*0.05 + z = -5.222 + y*0.4638 + print("Girder x %f" % (y)) + #girder_x.move(y, -1) + print("RMU Ry %f" % (z)) + #rmu_ry.move(z, -1) + time.sleep(3.0) \ No newline at end of file diff --git a/script/Users/PEEM/Armin/TestUserScript_Armin.py b/script/Users/PEEM/Armin/TestUserScript_Armin.py old mode 100755 new mode 100644 index 50742dc..5567a45 --- a/script/Users/PEEM/Armin/TestUserScript_Armin.py +++ b/script/Users/PEEM/Armin/TestUserScript_Armin.py @@ -14,17 +14,18 @@ two_pol(switching="Tune_Detune", sequence="A", measurements=MEASUREMENTS, exposu time.sleep(2.0) #TwoEnergies with lin hor polarization ID2 only (normal) -set_beamline_setup(id ="ID2", en=710, pol2="Lin_Hor") +#set_beamline_setup(id ="ID2", en=710, pol2="Lin_Hor") -> causes problems? two_energies(705, 710, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) time.sleep(2.0) #abs_spec(ranges=[[500.0, 1000.0, 100.0],], switch_pol=False, scans=1, exposure=EXPOSURE, average=AVERAGE) #Use manulally defined ranges and rois defined in GUI abs_spec(ranges="Fe_L3_fine", roi="test", switch_pol=False, scans=1, exposure=EXPOSURE, average=AVERAGE) +#eiger.stop() +#eiger_threshold.write(7500) +#eiger.start() - - - +#tscan(['ca://X11MA-PC-ET7000:SW-K'], points=10, interval=1.0, title='temperature', keep=False, name='tewsst', layout='table', provider='txt', auto_range=True, domain_axis='Time') #Direct functions to change energy, pol, offset: #change_energy(700) @@ -36,4 +37,10 @@ abs_spec(ranges="Fe_L3_fine", roi="test", switch_pol=False, scans=1, exposure=EX #switch_pol() #Restoring beamline state defined in last set_beamline_setut: -#restore_beamline_setup() \ No newline at end of file +#restore_beamline_setup() +# +#for i in [-1.9, -2.0, -2.1]: +# girder_x.move(i, -1) +# rmu_ry.move(-4.477, -1) +# print "Do something" +# caput("X11MA-HG:X_SET", 1.9) \ No newline at end of file diff --git a/script/Users/PEEM/Armin/Threshold_Scan.py b/script/Users/PEEM/Armin/Threshold_Scan.py new file mode 100644 index 0000000..8788757 --- /dev/null +++ b/script/Users/PEEM/Armin/Threshold_Scan.py @@ -0,0 +1,26 @@ +##Constants +AVERAGE = 1 +EXPOSURE = 1.0 +MEASUREMENTS = 5 +DRIFT_CORRECTION = True + +eiger.stop() +eiger_threshold.write(4000.0) +time.sleep(2.0) +#eiger.start() + +##TakeImage at 710 eV at the given polarization +#change_energy(712) +take_image(scans=1, switch_pol=False, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +time.sleep(2.0) +# + +eiger.stop() +eiger_threshold.write(4100.0) +time.sleep(2.0) +#eiger.start() + +##TakeImage at 710 eV at the given polarization +#change_energy(712) +take_image(scans=1, switch_pol=False, measurements=MEASUREMENTS, exposure=EXPOSURE, average=AVERAGE) +time.sleep(2.0) \ No newline at end of file diff --git a/script/Users/PEEM/Armin/test.py b/script/Users/PEEM/Armin/test.py new file mode 100644 index 0000000..5d88966 --- /dev/null +++ b/script/Users/PEEM/Armin/test.py @@ -0,0 +1,2 @@ +#cscan([girder_x], ['ca://machine_cur'], [0.16], [0.18], [0.01], latency=1.0, time=10.0, relative=False, passes=1, zigzag=False, keep=False, name='Unknown') +cscan(girder_x, machine_cur, 0.16, 0.18, 0.01) \ No newline at end of file diff --git a/script/beamline_init/init/InitAU.py b/script/beamline_init/init/InitAU.py new file mode 100644 index 0000000..f71f9c3 --- /dev/null +++ b/script/beamline_init/init/InitAU.py @@ -0,0 +1,102 @@ +import subprocess +import time +import traceback + +running = False +counts = {} + +def countHLS(motor): + global counts + try: + time.sleep(1.0) + counts[motor]=0 + def on_change(value): + global counts + print "LimitSW changed on" , motor, "to", value + if int(value) == 1: + counts[motor]=counts[motor]+1 + + with Channel(motor+".HLS", callback=on_change, monitored=True, name="test") as ch: + if int(ch.read()) == 1: + counts[motor]=1 + while(running==True): + time.sleep(0.1) + print "High Limit Switch motor "+motor +" reached "+ str(counts[motor]) + " times\n" + return counts[motor] + except: + print "Exception counting "+str(motor) + traceback.print_exc() + raise + + +def countLLS(motor): + global counts + try: + time.sleep(1.0) + counts[motor]=0 + def on_change(value): + global counts + print "LimitSW changed on" , motor, "to", value + if int(value) == 1: + counts[motor]=counts[motor]+1 + + with Channel(motor+".LLS", callback=on_change, monitored=True, name="test") as ch: + if int(ch.read()) == 1: + counts[motor]=1 + while(running==True): + time.sleep(0.1) + print "Low Limit Switch motor "+motor +" reached "+ str(counts[motor]) + " times\n" + return counts[motor] + except: + print "Exception counting "+str(motor) + traceback.print_exc() + raise + +def init(): + try: + global running + running = True + + subprocess.call("X_X11MA_init-AU.sh", shell=True) + # Positions at limit switches are not checked + time.sleep(1.0) + caput('X11MA-OP2-AVsize',20) + caput('X11MA-OP2-AHsize',20) + + running = False + return 0 + except: + print "Exception in init" + traceback.print_exc() + raise + + +#Fork and join +try: + futures = fork(init,(countHLS,("X11MA-OP2-AU:TRY1",)), \ + (countLLS,("X11MA-OP2-AU:TRY4",)), \ + (countHLS,("X11MA-OP2-AU:TRZ1",)), \ + (countLLS,("X11MA-OP2-AU:TRZ4",)), \ + (countHLS,("X11MA-OP2-BP1:TRY",)), \ + (countHLS,("X11MA-OP2-BP1:TRZ",)) ) + ret = join(futures) + +#check limit switch status after init + limitsw=True + for i in range(1,6): + if(ret[i]!=1): + limitsw=False + print "Limit switch status for all motors: %s" %("OK" if limitsw == True else "Not OK") + +#final status report + if(limitsw==True): + print "init-AU: ==> done. OK!" + set_return("OK") + else: + print "init-AU: ==> not done. NOT OK!" + set_return("Not OK") + +except: + set_return("Error") + + diff --git a/script/beamline_init/init/InitCMU.py b/script/beamline_init/init/InitCMU.py index e51bcd9..9c9ec04 100644 --- a/script/beamline_init/init/InitCMU.py +++ b/script/beamline_init/init/InitCMU.py @@ -21,7 +21,7 @@ def countHS(motor): counts[motor]=1 while(running==True): time.sleep(0.1) - print "Home Switch motor "+motor +" reached "+ str(counts[motor]) + " times" + print "Home Switch motor "+motor +" reached "+ str(counts[motor]) + " times\n" return counts[motor] except: print "Exception counting "+str(motor) diff --git a/script/beamline_init/init/InitExitSlit.py b/script/beamline_init/init/InitExitSlit.py new file mode 100644 index 0000000..1cefcac --- /dev/null +++ b/script/beamline_init/init/InitExitSlit.py @@ -0,0 +1,9 @@ +run("xrays_default") + +time.sleep(3) + +caput("X11MA-OP-SL:GO.PROC",1) +time.sleep(30) +exit_slit.write(20.0) + +print "Init Exit Slit OK." \ No newline at end of file diff --git a/script/beamline_init/with_x-rays/02_Eslit_offset.py b/script/beamline_init/with_x-rays/02_Eslit_offset.py index 7ab92d6..c929569 100644 --- a/script/beamline_init/with_x-rays/02_Eslit_offset.py +++ b/script/beamline_init/with_x-rays/02_Eslit_offset.py @@ -1,27 +1,28 @@ import sys #seting parameters -sensor = KEI11 -if sensor == KEI10: +sensor = 'KEI11' +if sensor == 'KEI10': detector= keithley_1a detector_range='X11MA-KEI10:RANGE' -elif sensor == KEI11: +elif sensor == 'KEI11': detector= keithley_2a detector_range='X11MA-KEI11:RANGE' else: print "Select a proper detector: KEI10 or KEI11." sys.exit() -caput(detector_range, 5) # 6 --> 200 nA +caput(detector_range, 4) # 6 --> 200 nA exit_slit.move(30.0) speed = exit_slit.getSpeed() min_speed=exit_slit.getMinSpeed() exit_slit.setSpeed(min_speed) #scan Energy Slit +time.sleep(1) run('beamline_init/with_x-rays/functions/SlitCalib.py',{"Slit":exit_slit, "Slit_offset":exit_slit_offset, "detector":detector, "start":30, "end":-20.0, "step_size":1.0, "final_pos":20.0}) time.sleep(1) #resetting parameters caput(detector_range, 0) # 0--> AUTO -exit_slit.setSpeed(speed) \ No newline at end of file +exit_slit.setSpeed(speed) diff --git a/script/beamline_init/with_x-rays/functions/SlitCalib.py b/script/beamline_init/with_x-rays/functions/SlitCalib.py index 3d5950f..48f5eb6 100644 --- a/script/beamline_init/with_x-rays/functions/SlitCalib.py +++ b/script/beamline_init/with_x-rays/functions/SlitCalib.py @@ -28,7 +28,7 @@ fit_threshold=readable_[0]*0.05 #filter the positions with analog values above the threshold for i in range(8,len(positions_),1): - if(readable_[i]>fit_threshold): + if(readable_[i] Error shifting image: " + str(sys.exc_info()[1]) return + metadata["roi"] = str(roi) save_as_tiff(shifted_frame, filename, check, show, parallel=False, metadata=metadata) def shift_and_save_as_tiff(data, filename, reference=None, roi=None, shift=None, check=False, show = False, parallel=True, metadata={}): @@ -426,10 +427,12 @@ class ProcImage(Filter): self.outliers_mask =None def processData(self, data): + if data is None: + return None outliers_threshold = get_outliers_threshold() if (self.outliers_threshold is None) else self.outliers_threshold outliers_mask = get_outliers_mask() if (self.outliers_mask is None) else self.outliers_mask roi = self.roi - data=data.copy() + data=data.copy() if roi is not None: data = data.getRoi(Rectangle(roi[0], roi[1], roi[2], roi[3])) #ret = load_image(img) diff --git a/script/imaging/fov_arrows.py b/script/imaging/fov_arrows.py index 075be86..4ba2af7 100644 --- a/script/imaging/fov_arrows.py +++ b/script/imaging/fov_arrows.py @@ -53,7 +53,7 @@ def update_arrows(): arrow_a.update(FOV_ARROWS_ORIGIN, Point(xa,ya)) xa,ya=int(x+FOV_XRAY_LABEL_POS*math.cos(a)), int(y-FOV_XRAY_LABEL_POS*math.sin(a)) label_a.update(Point(xa,ya)) - angle=angle+azimuth + angle=angle-azimuth a=math.radians(angle) xa,ya=int(x+FOV_ARROWS_SIZE*math.cos(a)), int(y-FOV_ARROWS_SIZE*math.sin(a)) arrow_x.update(FOV_ARROWS_ORIGIN, Point(xa,ya)) diff --git a/script/imaging/shifts.py b/script/imaging/shifts.py index 492a63e..c854281 100644 --- a/script/imaging/shifts.py +++ b/script/imaging/shifts.py @@ -3,7 +3,9 @@ import java.lang.reflect import flanagan.complex.ComplexMatrix as ComplexMatrix import flanagan.math.Matrix as Matrix import flanagan.complex.Complex as Complex -import org.jtransforms.fft.DoubleFFT_2D as DoubleFFT_2D +#import org.jtransforms.fft.DoubleFFT_2D as DoubleFFT_2D +import edu.emory.mathcs.jtransforms.fft.DoubleFFT_2D + import math from startup import ScriptUtils import ij.plugin.filter.PlugInFilterRunner as PlugInFilterRunner @@ -613,6 +615,7 @@ def calculate_shifts(imp_r, imp_i, roi, upscale_factor=100, reference_slide=1, j IJ.showProgress(i + 1, len(ffts))\ return shifts # [ref, drifted, dr, dc, error, diffphase] +#Transforms an array in memory, a BufferedImage, or a file name into a ImagePlus object. def to_ip(obj): if is_string(obj): try: diff --git a/script/local.py b/script/local.py index 093369e..40ca6c8 100644 --- a/script/local.py +++ b/script/local.py @@ -147,6 +147,15 @@ def is_id_error(): def check_id_error(): if is_id_error(): raise Exception ("ID error: check ID status") + +def gude1(pwr): + caput("PEEM-GUDE:CH1SET",pwr) +def gude2(pwr): + caput("PEEM-GUDE:CH2SET",pwr) +def gude3(pwr): + caput("PEEM-GUDE:CH3SET",pwr) +def gude4(pwr): + caput("PEEM-GUDE:CH4SET",pwr) ################################################################################################### #Default scan callbacks @@ -468,13 +477,13 @@ def assert_beamline_ok(): checkbeamline=0 message=[ "PLC error","Encoder error", "Feedforward error","Operator control", "Moving timeout", "Interlock"] ID = get_setting("ID") - if ID == "PGM_ID1": + if ID in ("PGM_ID1", "ID1"): id1_status=get_id_status(1) id2_status=0 - elif ID == "PGM_ID2": + elif ID in ("PGM_ID2", "ID2"): id1_status=0 id2_status=get_id_status(2) - if ID == "PGM_ID1_ID2": + else: # if ID in ("PGM_ID1_ID2", "ID1_ID2") : id1_status=get_id_status(1) id2_status=get_id_status(2) if id1_status >= 1: @@ -759,12 +768,15 @@ def apply_beamline_setup(id,en=None,pol1=None,alp1=None,har1=None,off1=None,pol2 # Monochromator part if grat is not None: if grat=='G1_300': + print "Grat G1" Grating.write("0") Grating_ch.write("0") elif grat=='G2_1200': + print "Grat G2" Grating.write("1") Grating_ch.write("1") elif grat =='G3_600': + print "Grat G3" Grating.write("2") Grating_ch.write("2") if order is not None: @@ -840,9 +852,6 @@ def peem_optics_default_15kV(): start_voltage.write(0) # fov.write(100) microscope.send_receive("sep 100um") - microscope.send_receive("mmp 7 -9044.7", 60000) - microscope.send_receive("mmp 2 -5998.6", 60000) - microscope.send_receive("mmp 1 0.0", 60000) def peem_optics_default_10kV(): objective.write(1220) @@ -852,9 +861,6 @@ def peem_optics_default_10kV(): obj_align_y.write(0) start_voltage.write(0) microscope.send_receive("sep 100um") - microscope.send_receive("mmp 7 -9044.7", 60000) - microscope.send_receive("mmp 2 -5998.6", 60000) - microscope.send_receive("mmp 1 0.0", 60000) @@ -878,7 +884,11 @@ def neutralize_position(retries = 3): log("neutralize_position error - retrying: " + sys.exc_info()[1]) time.sleep(1) microscope.home_tilt('H') - microscope.home_tilt('V') + microscope.home_tilt('V') + microscope.send_receive("mmp 7 -9044.7", 60000) + microscope.send_receive("mmp 2 -5998.6", 60000) + microscope.send_receive("mmp 1 0.0", 60000) + close_vg10() ################################################################################################### #Maths ################################################################################################### @@ -983,3 +993,13 @@ def auto_intensity(roi=None, exposure=None): return scan_intensity(roi) finally: restore_eiger() + +################################################################################################### +# System utilities +################################################################################################### + +def memory(): + import java.lang.Runtime as Runtime + r=Runtime.getRuntime() + print "Used: ", r.totalMemory() + print "Max : ", r.maxMemory() \ No newline at end of file diff --git a/script/templates/Eiger2Img.py b/script/templates/Eiger2Img.py index 3eff0ab..2c2b33e 100644 --- a/script/templates/Eiger2Img.py +++ b/script/templates/Eiger2Img.py @@ -34,14 +34,8 @@ start = time.time() threads = [] image_drift=None calculated_shifts={} -#path = "{data}/{year}_{month}/{date}" + "/" + "{seq}%03d_" + METHOD -#set_exec_pars(path= path, format="txt", layout="table", open=True) -#data_path = get_context().setup.expandPath(path) data_path = "{data}/{year}_{month}/{date}/{date}_{name}" set_exec_pars(name=METHOD, path = data_path, format="txt", layout="table", open=True) -#data_path = get_exec_pars().path - -#get_context().incrementFileSequentialNumber() def get_image_file_name(cycle=-1, frame_index=0, short_name=False, shifted=False): @@ -49,10 +43,8 @@ def get_image_file_name(cycle=-1, frame_index=0, short_name=False, shifted=False if (METHOD == "Two_Pol") and (SEQUENCE == "A") and (frame_index<2) and ((cycle%2)==0): #Swapped frame_index = 0 if frame_index else 1 root = "" if short_name else (data_path + "/") - #prefix = get_context().setup.expandPath("i{seq}%03d" + "_" + ("%d" % frame_index)) abs_index=run_index + frame_index max_index= max(max_index, frame_index) - #prefix = get_context().setup.expandPath("i{date}%02d_{seq}%03d") prefix = get_context().setup.expandPath("i{date}%02d_" + ("%03d" % (abs_index,))) if cycle < 0: @@ -87,8 +79,9 @@ if METHOD == "Two_Pol" or (SWITCH_POL and (METHOD == "Take_Image")): def imageinfo(info): pass -ref_images = {} +ref_image = None def save_image_file(frame, cycle=-1, frame_index=0, processed_shift=False): + global ref_image if frame is None: raise Exception("Cannot save frame - None: cycle: " + str(cycle) + " index: " + str(frame_index)) if SHOW_IMAGES: @@ -119,27 +112,18 @@ def save_image_file(frame, cycle=-1, frame_index=0, processed_shift=False): filename = get_image_file_name(cycle, frame_index, shifted=True) #print " *** ", cycle, frame_index if cycle>0: - if cycle==1: - ref_images[frame_index] = frame + if ref_image is None: + if (cycle!=1) or (frame_index!=0): + raise Exception ("Invalid reference image: cycle=" + str(cycle) + " index="+ str (frame_index)) + ref_image = frame threads.append(save_as_tiff(frame, filename, metadata=metadata)) else: - """ - if image_drift is not None: - print "-> Shifting ", filename - #shifted_frame = apply_shift(frame, image_drift) - #threads.append(save_as_tiff(shifted_frame, filename, metadata=metadata)) - threads.append(shift_and_save_as_tiff(frame, shift=image_drift, metadata=metadata)) - """ if frame_index==2: - #shift = calculated_shifts[get_image_file_name(cycle, 0, shifted=True)] - #threads.append(shift_and_save_as_tiff(frame, filename, shift=shift, metadata=metadata)) + #Done later pass else: - threads.append(shift_and_save_as_tiff(frame, filename, ref_images[0], calc_roi, metadata=metadata)) - - - # log("SV:"+Format(startvoltage,"0.000")+" OB:"+Format(objective,"0.00")+" ST:"+Format(LEEMtemp,"0.0")) - + threads.append(shift_and_save_as_tiff(frame, filename, ref_image, calc_roi, metadata=metadata)) + init_eiger(exposure=EXPOSURE) run_index = get_context().getDaySequentialNumber() @@ -169,29 +153,8 @@ try: if METHOD == "Two_Energies": change_energy(ENERGY[i]) print "--- Grabing " + str(AVERAGE)+ " frames - cycle: " + str(cycle) + " step: " + str(i) - #s=time.time() av = average_eiger_frames(AVERAGE, roi=None, wait_next=True) - #print "--- Time: " + str(time.time() - s) - #time.sleep(1) #added by Armin frames.append(av) - """ - if (i==0) and DRIFT_CORRECTION and (calc_roi is not None): - if ref_image is None: - ref_image = frames[0] - print "-> Saved shift ref image" - else: - try: - cur_image = frames[0] - xoff, yoff, error, diffphase, image_drift = calculate_shift(ref_image,cur_image, calc_roi) - if (abs(xoff) <= MAX_SHIFT) and (abs(yoff) <= MAX_SHIFT): - print "-> Calculated shift: ", xoff, yoff, error, diffphase - else: - print "-> Error: shift too big:", xoff, yoff - image_drift = None - except: - print "-> Error calculating shift: " + str(sys.exc_info()[1]) - image_drift = None - """ imageinfo("I") save_image_file(frames[i], cycle, i) if METHOD == "Take_Image": @@ -200,7 +163,6 @@ try: if METHOD == "Two_Pol": if (i==0) or (SEQUENCE == "B"): switch_pol() - #time.sleep(1) if (METHOD == "Two_Pol") or (METHOD == "Two_Energies"): if (METHOD == "Two_Energies") or (SEQUENCE == "B") or ((cycle%2)==1): @@ -241,16 +203,6 @@ try: print "--- Averaging..." for i in range(len(frames)): - """ - measures = [] - for cycle in range(1, MEASUREMENTS + 1): - filename = get_image_file_name(cycle, i) - ip = open_image(filename) - #measures.append(Data(get_ip_array(ip))) - measures.append(ip) - #av = average_frames(measures) #Result is transposed??? - av=average_ips (measures, roi=None, as_float=True) - """ integration = None for cycle in range(1, MEASUREMENTS + 1): filename = get_image_file_name(cycle, i) @@ -284,25 +236,7 @@ try: if SWITCH_POL and (METHOD == "Take_Image"): switch_pol() - - #SWITCH_POL = False - #set_exec_pars(then_success="run('templates/Eiger2Img')") - - """ - get_context().incrementDaySequentialNumber() - set_exec_pars(open=False) - set_exec_pars(open=True) - - for cycle in range(1, MEASUREMENTS + 1): - frames = [] - if MEASUREMENTS > 1: - log("nround = " + str(cycle) + " / " + str(MEASUREMENTS)) - print "--- Grabing " + str(AVERAGE)+ " frames - cycle: " + str(cycle) + " step: " + str(i) - av = average_eiger_frames(AVERAGE, roi=None, wait_next=True) - imageinfo("I") - save_image_file(av, cycle, i) - - """ + #TODO: This is a workaround to handle 2-Images, should be removed run_index = run_index + 1 if scan>0: diff --git a/script/test/Diagnostics.py b/script/test/Diagnostics.py old mode 100755 new mode 100644 index 86a3a46..3deea16 --- a/script/test/Diagnostics.py +++ b/script/test/Diagnostics.py @@ -60,6 +60,7 @@ diag_devices = { "id2 alpha": id2_alpha, \ "id2 harmonic": id2_harmonic, \ "ring current": machine_cur, \ + "ai1 current": ai1, \ }