This commit is contained in:
gac-x11ma
2023-07-18 11:00:54 +02:00
parent 8488d81c80
commit 1d75bc4535
77 changed files with 2464 additions and 253 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
config/ROIs/AZI30.roi Normal file

Binary file not shown.

BIN
config/ROIs/AZI60.roi Normal file

Binary file not shown.

Binary file not shown.

BIN
config/ROIs/test3.roi Normal file

Binary file not shown.

View File

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

View File

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

View File

@@ -1,3 +1,5 @@
BeamlineInit.java=disabled
Cooling.java=enabled
XPEEM_Settings.java=enabled
Align_ComputeShifts.java=disabled
Imaging.java=disabled

View File

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

View File

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

View File

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

View File

@@ -1,2 +1,2 @@
#Thu Dec 15 01:10:54 CET 2022
SessionCounter=80
#Wed Jun 14 21:20:33 CEST 2023
SessionCounter=89

View File

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

View File

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

View File

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

7
devices/ai1.properties Normal file
View File

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

7
devices/ai1pv.properties Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

17
devices/dp1.properties Executable file → Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

3
devices/m1.properties Executable file → Normal file
View File

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

3
devices/m2.properties Executable file → Normal file
View File

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

3
devices/p1.properties Executable file → Normal file
View File

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

19
devices/rmu_ry.properties Normal file
View File

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

8
devices/test.properties Normal file
View File

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

View File

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

View File

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

91
plugins/BeamlineInit.form Normal file
View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="83" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="buttonAUinit" max="32767" attributes="0"/>
<Component id="buttonFEinit" alignment="0" max="32767" attributes="0"/>
<Component id="buttonExitSlitsInit" alignment="0" max="32767" attributes="0"/>
<Component id="buttonCMUinit" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="statusAU" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="184" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonAUinit" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="statusAU" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonFEinit" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonExitSlitsInit" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonCMUinit" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="271" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="buttonAUinit">
<Properties>
<Property name="text" type="java.lang.String" value="Init AU"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonAUinitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonFEinit">
<Properties>
<Property name="text" type="java.lang.String" value="init FE"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonFEinitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonExitSlitsInit">
<Properties>
<Property name="text" type="java.lang.String" value="init Exit Slits"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonExitSlitsInitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonCMUinit">
<Properties>
<Property name="text" type="java.lang.String" value="init CMU"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCMUinitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="statusAU">
<Properties>
<Property name="text" type="java.lang.String" value="status AU"/>
</Properties>
</Component>
</SubComponents>
</Form>

199
plugins/BeamlineInit.java Normal file
View File

@@ -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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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))
);
}// </editor-fold>//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
}

556
plugins/Cooling.form Normal file
View File

@@ -0,0 +1,556 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="label1" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="panelNeedleValveSet" min="-2" pref="85" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="panelNeedleValveGet" min="-2" pref="81" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="label2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="panelHeFlowSet" min="-2" pref="81" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" pref="18" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="panelHeFlowGet" min="-2" pref="81" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="panelFilamentSet" min="-2" pref="81" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel11" min="-2" pref="29" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="76" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="25" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="panelPlot" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="label1" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="panelNeedleValveGet" min="-2" max="-2" attributes="0"/>
<Component id="panelNeedleValveSet" alignment="1" min="-2" pref="35" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="1" min="-2" pref="35" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="label2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel7" min="-2" pref="33" max="-2" attributes="0"/>
<Component id="panelHeFlowSet" min="-2" pref="33" max="-2" attributes="0"/>
<Component id="panelHeFlowGet" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" alignment="0" min="-2" pref="35" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelFilamentSet" min="-2" pref="33" max="-2" attributes="0"/>
<Component id="jLabel11" min="-2" pref="33" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
</Group>
<Component id="jPanel2" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
<Component id="panelPlot" pref="105" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelNeedleValveGet">
<Properties>
<Property name="name" type="java.lang.String" value="X11MA-ES1-AO4:V" noResource="true"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.RegisterPanel" name="panelNeedleValveSet">
<Properties>
<Property name="decimals" type="int" value="3"/>
<Property name="name" type="java.lang.String" value="X11MA-ES1-AO4:V" noResource="true"/>
</Properties>
</Component>
<Component class="java.awt.Label" name="label1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="12" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="Needle Valve"/>
</Properties>
</Component>
<Component class="java.awt.Label" name="label2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="12" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="He Flow Meter"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.RegisterPanel" name="panelHeFlowSet">
<Properties>
<Property name="decimals" type="int" value="3"/>
<Property name="name" type="java.lang.String" value="X11MA-PC-BRONKHORST:PEEM-SET-SETPOINT" noResource="true"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelHeFlowGet">
<Properties>
<Property name="name" type="java.lang.String" value="X11MA-PC-BRONKHORST:PEEM-GET-MEASURE" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="DejaVu Sans" size="12" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="LEEM Filament"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.RegisterPanel" name="panelFilamentSet">
<Properties>
<Property name="decimals" type="int" value="3"/>
<Property name="deviceName" type="java.lang.String" value="fil"/>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Switchbox"/>
</Border>
</Property>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value=""/>
</AccessibilityProperties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="panelSBVolt" linkSize="1" pref="81" max="32767" attributes="0"/>
<Component id="panelSBResist" pref="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="panelSBTemp" min="-2" pref="74" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel13" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="panelSBCurr" min="-2" pref="74" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace pref="15" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="panelSBResistance" linkSize="1" min="-2" pref="55" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel16" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelSBResist" min="-2" max="-2" attributes="0"/>
<Component id="jLabel12" min="-2" pref="33" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel13" min="-2" pref="33" max="-2" attributes="0"/>
<Component id="panelSBTemp" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="panelSBVolt" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Component id="panelSBCurr" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="panelSBResistance" min="-2" max="-2" attributes="0"/>
<Component id="jLabel16" min="-2" pref="33" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Pt100"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelSBResist">
<Properties>
<Property name="name" type="java.lang.String" value="X11MA-PC-SW:Pt100-R" noResource="true"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelSBTemp">
<Properties>
<Property name="name" type="java.lang.String" value="X11MA-PC-SW:Pt100-K" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="E-Field"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelSBVolt">
<Properties>
<Property name="name" type="java.lang.String" value="X11MA-PC-SW:E-Field-V" noResource="true"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelSBCurr">
<Properties>
<Property name="name" type="java.lang.String" value="X11MA-PC-SW:E-Field-I" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Resistance"/>
<Property name="toolTipText" type="java.lang.String" value="Resistance"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelSBResistance">
<Properties>
<Property name="name" type="java.lang.String" value="X11MA-PC-SW:Resistance" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel12">
<Properties>
<Property name="text" type="java.lang.String" value="Ohm"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="text" type="java.lang.String" value="K"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="text" type="java.lang.String" value="V"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel15">
<Properties>
<Property name="text" type="java.lang.String" value="K"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel16">
<Properties>
<Property name="text" type="java.lang.String" value="Ohm"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="panelPlot">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="PEEM Pt100"/>
</Border>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="V"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="V"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="%"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="%"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="text" type="java.lang.String" value="mA"/>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Power Sockets"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel19" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="checkGude3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel20" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="checkGude4" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel17" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel18" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="checkGude2" min="-2" max="-2" attributes="0"/>
<Component id="checkGude1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="1" attributes="0">
<Component id="panelGude3" alignment="1" min="-2" pref="88" max="-2" attributes="0"/>
<Component id="panelGude1" min="-2" pref="88" max="-2" attributes="0"/>
<Component id="panelGude2" min="-2" pref="88" max="-2" attributes="0"/>
</Group>
<Component id="panelGude4" min="-2" pref="88" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="15" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace pref="12" max="32767" attributes="0"/>
<Component id="panelGude1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="checkGude1" max="32767" attributes="0"/>
<Component id="jLabel17" pref="25" max="32767" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelGude2" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel18" alignment="3" min="-2" pref="25" max="-2" attributes="0"/>
<Component id="checkGude2" alignment="3" min="-2" pref="25" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelGude3" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="checkGude3" alignment="1" min="-2" pref="29" max="-2" attributes="0"/>
<Component id="jLabel19" min="-2" pref="29" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="panelGude4" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel20" max="32767" attributes="0"/>
<Component id="checkGude4" min="-2" pref="29" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelGude1">
<Properties>
<Property name="name" type="java.lang.String" value="PEEM-GUDE:CH1READ" noResource="true"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelGude2">
<Properties>
<Property name="name" type="java.lang.String" value="PEEM-GUDE:CH2READ" noResource="true"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelGude3">
<Properties>
<Property name="name" type="java.lang.String" value="PEEM-GUDE:CH3READ" noResource="true"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelGude4">
<Properties>
<Property name="name" type="java.lang.String" value="PEEM-GUDE:CH4READ" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel17">
<Properties>
<Property name="text" type="java.lang.String" value="Helium Pump"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel18">
<Properties>
<Property name="text" type="java.lang.String" value="Detector"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel19">
<Properties>
<Property name="text" type="java.lang.String" value="He level meter"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel20">
<Properties>
<Property name="text" type="java.lang.String" value="Heater"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkGude1">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkGude1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkGude2">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkGude2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkGude3">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkGude3ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkGude4">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkGude4ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

555
plugins/Cooling.java Normal file
View File

@@ -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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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("");
}// </editor-fold>//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
}

View File

@@ -712,6 +712,9 @@
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Autosave"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkImgAutosaveActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel20">
<Properties>
@@ -1066,6 +1069,9 @@
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="With I0"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkSpecWithI0ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkSpecSaveSpectrum">
<Properties>

26
plugins/DataAcquisition.java Executable file → Normal file
View File

@@ -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;
@@ -204,7 +204,11 @@ public class DataAcquisition extends Panel {
}
Rect imagingRoiOverlay;
return (Rectangle) getGlobalVar("IMAGING_ROI");
Rectangle getImagingRoi(){
try{
return (Rectangle) getGlobalVar("IMAGING_ROI");
} catch (Exception ex){
return null;
}
}
@@ -959,6 +963,11 @@ public class DataAcquisition extends Panel {
panelImgControls.setBorder(javax.swing.BorderFactory.createTitledBorder("Parameters"));
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);
@@ -1177,6 +1186,11 @@ public class DataAcquisition extends Panel {
spinnerSpecExp.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.0d, 3600.0d, 1.0d));
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);
@@ -1815,6 +1829,14 @@ public class DataAcquisition extends Panel {
getLogger().log(Level.SEVERE, null, ex);
}
}//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;

View File

@@ -45,18 +45,32 @@
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="textFOV" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="spinnerExposure" linkSize="1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="deviceValuePanel3" linkSize="1" min="-2" pref="106" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="deviceValuePanel4" min="-2" pref="127" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="textFOV" linkSize="1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="deviceValuePanel4" min="-2" pref="127" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonShowDetectorPanel" min="-2" pref="127" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="spinnerThreshold" min="-2" pref="121" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="deviceValuePanel5" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonShowDetectorPanel" min="-2" pref="127" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
@@ -85,7 +99,7 @@
</Group>
</Group>
</Group>
<EmptySpace min="39" pref="39" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="166" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
@@ -121,9 +135,14 @@
<Component id="buttonShowDetectorPanel" alignment="2" min="-2" pref="35" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textFOV" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="deviceValuePanel5" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textFOV" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerThreshold" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
@@ -354,5 +373,27 @@
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="Threshold [eV]:"/>
</Properties>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerThreshold">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spinnerThresholdStateChanged"/>
<EventHandler event="propertyChange" listener="java.beans.PropertyChangeListener" parameters="java.beans.PropertyChangeEvent" handler="spinnerThresholdPropertyChange"/>
</Events>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel5">
<Properties>
<Property name="deviceName" type="java.lang.String" value="eiger_threshold_rbv"/>
</Properties>
</Component>
</SubComponents>
</Form>

View File

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

View File

@@ -11,7 +11,6 @@
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,91"/>
</AuxValues>
<Layout>

View File

@@ -17,7 +17,14 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="79" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="checkSetting2" min="-2" max="-2" attributes="0"/>
<Component id="checkSetting3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkSetting4" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkSetting1" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="ButtonDefaultOptics10kV" linkSize="1" min="-2" max="-2" attributes="0"/>
@@ -52,7 +59,7 @@
<Component id="label7" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="68" max="32767" attributes="0"/>
<EmptySpace pref="117" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -61,7 +68,8 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="46" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="ButtonDefaultOptics15kV" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkSetting1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="ButtonDefaultOptics15kV" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="label4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
@@ -71,13 +79,22 @@
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="ButtonDefaultOptics10kV" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ButtonDefaultOptics10kV" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkSetting2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="ButtonDefaultXrays" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ButtonDefaultXrays" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkSetting3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="42" max="-2" attributes="0"/>
<Component id="ButtonNeutralizePosition" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ButtonNeutralizePosition" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkSetting4" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" attributes="0">
<Component id="label1" min="-2" max="-2" attributes="0"/>
@@ -160,17 +177,17 @@
</Component>
<Component class="java.awt.Label" name="label5">
<Properties>
<Property name="text" type="java.lang.String" value=" FOV = 100 um, CA = open, Slit = open."/>
<Property name="text" type="java.lang.String" value=" FOV = 100 um"/>
</Properties>
</Component>
<Component class="java.awt.Label" name="label6">
<Properties>
<Property name="text" type="java.lang.String" value=" FOV = 100 um, CA = open, Slit = open."/>
<Property name="text" type="java.lang.String" value=" FOV = 100 um"/>
</Properties>
</Component>
<Component class="java.awt.Label" name="label7">
<Properties>
<Property name="text" type="java.lang.String" value="x,y = 0.0, tilt = 0.0"/>
<Property name="text" type="java.lang.String" value="x,y = 0.0, tilt = 0.0, CA = open, Slit = open, Close VG10."/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonRunSelected">
@@ -181,5 +198,13 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonRunSelectedActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkSetting1">
</Component>
<Component class="javax.swing.JCheckBox" name="checkSetting2">
</Component>
<Component class="javax.swing.JCheckBox" name="checkSetting3">
</Component>
<Component class="javax.swing.JCheckBox" name="checkSetting4">
</Component>
</SubComponents>
</Form>

View File

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

View File

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

View File

@@ -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]<fit_threshold):
readable.append(readable_[i])
positions.append(positions_[i])
pars_polynomial = (a0, a1) = fit_polynomial(readable, positions,1)
fitted_polynomial_function = PolynomialFunction(pars_polynomial)
print pars_polynomial
resolution = step_size/100
fit_polinomial = []
# from the fit function calculate the values at the positions
for x in frange(end,start,resolution, True):
fit_polinomial.append(fitted_polynomial_function.value(x))
x = frange(end, start+resolution, resolution)
# crate plots
plots = plot([readable_, fit_polinomial] , ["data", "polinomial"], xdata = [positions_,x], title="Data")
p = plot(None,name="Data 1")[0]
p.addSeries(LinePlotSeries("Data2"))
p.getSeries(0).setData(positions_, readable_)
p.getSeries(1).setData(x, fit_polinomial)
#calculate the position where the line crosses zero
k=-pars_polynomial[0]/pars_polynomial[1]
print k
#change the offset
#offset=Slit_offset.read()
#Slit_offset.write(offset+k)
Slit.write(final_pos)

View File

@@ -0,0 +1,23 @@
# Commands to move slit and CA>
# 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 (mn<RANGE[0] or mn>RANGE[1]):
# raise Exception("Invalid fit")
#objective.write(mn)

View File

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

17
script/Users/PEEM/Armin/TestUserScript_Armin.py Executable file → Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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)
exit_slit.setSpeed(speed)

View File

@@ -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]<fit_threshold):
readable.append(readable_[i])
positions.append(positions_[i])

View File

@@ -367,7 +367,7 @@ class ListenerAzimuth (DeviceListener):
set_azimuth_rot(value)
except:
if self.debug:
self.getLogger().warning(str(sys.exc_info()[1]))
log(str(sys.exc_info()[1]))
listenerAzimuth = ListenerAzimuth()
listenerAzimuth.debug=True
azimuth_rot.addListener(listenerAzimuth)

View File

@@ -103,6 +103,7 @@ diag_devices = {
"PEEM high voltage": microscope.high_voltage, \
"Tilt vertical": tilt_vertical, \
"Tilt horizontal": tilt_horizontal, \
"ai1 current": ai1, \
}

View File

@@ -224,6 +224,7 @@ def _shift_and_save_as_tiff(data, filename, reference=None, roi=None, image_drif
except:
print "-> 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)

View File

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

View File

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

View File

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

View File

@@ -34,14 +34,8 @@ start = time.time()
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)
calculated_shifts={}
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
set_exec_pars(name=METHOD, path = data_path, format="txt", layout="table", open=True)
@@ -49,10 +43,8 @@ def get_image_file_name(cycle=-1, frame_index=0, short_name=False, shifted=False
global max_index
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 + "/")
root = "" if short_name else (data_path + "/")
abs_index=run_index + frame_index
max_index= max(max_index, frame_index)
max_index= max(max_index, frame_index)
prefix = get_context().setup.expandPath("i{date}%02d_" + ("%03d" % (abs_index,)))
@@ -87,8 +79,9 @@ if METHOD == "Two_Pol" or (SWITCH_POL and (METHOD == "Take_Image")):
def imageinfo(info):
pass
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))
@@ -119,27 +112,18 @@ def save_image_file(frame, cycle=-1, frame_index=0, processed_shift=False):
if DRIFT_CORRECTION and (not processed_shift):
filename = get_image_file_name(cycle, frame_index, shifted=True)
#print " *** ", cycle, frame_index
if cycle>0:
if cycle==1:
if cycle>0:
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))
else:
if frame_index==2:
#shift = calculated_shifts[get_image_file_name(cycle, 0, shifted=True)]
if frame_index==2:
#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"))
else:
threads.append(shift_and_save_as_tiff(frame, filename, ref_image, calc_roi, metadata=metadata))
init_eiger(exposure=EXPOSURE)
@@ -169,29 +153,8 @@ try:
assert_status_ok()
if METHOD == "Two_Energies":
change_energy(ENERGY[i])
print "--- Grabing " + str(AVERAGE)+ " frames - cycle: " + str(cycle) + " step: " + str(i)
print "--- Grabing " + str(AVERAGE)+ " frames - cycle: " + str(cycle) + " step: " + str(i)
av = average_eiger_frames(AVERAGE, roi=None, wait_next=True)
#print "--- Time: " + str(time.time() - s)
av = average_eiger_frames(AVERAGE, roi=None, wait_next=True)
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
frames.append(av)
imageinfo("I")
save_image_file(frames[i], cycle, i)
@@ -200,7 +163,6 @@ try:
if METHOD == "Two_Pol":
if (i==0) or (SEQUENCE == "B"):
switch_pol()
switch_pol()
if (METHOD == "Two_Pol") or (METHOD == "Two_Energies"):
@@ -241,16 +203,6 @@ try:
save_image_file(ip1,cycle, 2, processed_shift=True)
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)
for i in range(len(frames)):
integration = None
for cycle in range(1, MEASUREMENTS + 1):
@@ -284,25 +236,7 @@ try:
save_image_file(av, -1, i, processed_shift=True)
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)
switch_pol()
#TODO: This is a workaround to handle 2-Images, should be removed
run_index = run_index + 1

1
script/test/Diagnostics.py Executable file → Normal file
View File

@@ -60,6 +60,7 @@ diag_devices = {
"id2 alpha": id2_alpha, \
"id2 harmonic": id2_harmonic, \
"ring current": machine_cur, \
"ai1 current": ai1, \
}