This commit is contained in:
gac-bernina
2024-02-19 16:44:57 +01:00
parent a0fb826e6f
commit 3edd5ecda9
50 changed files with 1166 additions and 89 deletions

View File

@@ -1,45 +1,60 @@
#Wed Apr 28 09:43:14 CEST 2021
#Mon May 15 09:51:30 CEST 2023
xscanMoveTimeout=600
autoSaveScanData=true
simulation=false
commandExecutionEvents=false
logDaysToLive=50
xscanCrlogicChannel=null
dataScanSaveOutput=false
xscanCrlogicSimulated=false
userAuthenticator=
logLevelConsole=Off
filePermissionsConfig=Public
scanStreamerPort=-1
dataScanSaveScript=false
dataScanSaveSetpoints=false
notifiedTasks=null
parallelInitialization=false
fdaSerialization=false
dataTransferPath=null
saveConsoleSessionFiles=false
xscanAppendSuffix=true
versionTrackingManual=true
dataTransferMode=null
dataTransferMode=Off
hostName=null
userManagement=false
instanceName=BE
disableEmbeddedAttributes=false
instanceName=BE
dataServerPort=-1
hideServerMessages=false
serverPort=8080
hideServerMessages=false
versionTrackingEnabled=true
dataPath={data}/{year}_{month}/{date}/{date}_{time}_{name}
serverEnabled=false
dataScanReleaseRecords=false
depthDimension=0
dataScanReleaseRecords=false
dataScanPreserveTypes=false
logLevel=Info
dataScanFlushRecords=false
logPath={logs}/{date}_{time}
filePermissionsLogs=Public
dataLayout=default
disableDataFileLogs=false
sessionHandling=null
sessionHandling=Off
terminalEnabled=false
notificationLevel=Off
filePermissionsScripts=Public
terminalPort=3579
xscanCrlogicPrefix=null
dataTransferUser=null
filePermissionsData=Default
xscanCrlogicAbortable=true
xscanContinuousUpdate=false
createSessionFiles=false
versionTrackingLogin={context}/svcusr-hlapp_robot
noBytecodeFiles=false
versionTrackingRemote=git@git.psi.ch\:pshell_config/saresb.git
dataProvider=h5
xscanCrlogicIoc=null
dataScanLazyTableCreation=false
saveCommandStatistics=false

31
config/devices.properties Executable file → Normal file
View File

@@ -6,15 +6,22 @@ cam_s=ch.psi.pshell.imaging.MjpegSource|http://bernina-cam-s/axis-cgi/mjpg/video
cam_w=ch.psi.pshell.imaging.MjpegSource|http://bernina-cam-w/axis-cgi/mjpg/video.cgi reopen||-200|
cam_mobile=ch.psi.pshell.imaging.MjpegSource|http://bernina-cam-mobile/axis-cgi/mjpg/video.cgi reopen||-200|
energy_machine=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:ENERGY|||true
psss_energy=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:ENERGY|||true
psss_spectrum_x=ch.psi.pshell.epics.ChannelDoubleArray|SARFE10-PSSS059:SPECTRUM_X -1 -3|||true
psss_spectrum_y=ch.psi.pshell.epics.ChannelDoubleArray|SARFE10-PSSS059:SPECTRUM_Y -1 -3|||true
psss_center=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:SPECTRUM_CENTER|||true
psss_fwhm=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:SPECTRUM_FWHM|||true
psss_roi_min=ch.psi.pshell.epics.ChannelInteger|SARFE10-PSSS059:SPC_ROI_YMIN|||true
psss_roi_max=ch.psi.pshell.epics.ChannelInteger|SARFE10-PSSS059:SPC_ROI_YMAX|||true
histo_center=ch.psi.pshell.device.HistogramGenerator|psss_center|||true
histo_fwhm=ch.psi.pshell.device.HistogramGenerator|psss_fwhm|||true
psss_spectrum_y_average=ch.psi.pshell.device.ArrayAverager|psss_spectrum_y|||true
psss_center_average=ch.psi.pshell.device.Averager|psss_center|||true
psss_fwhm_average=ch.psi.pshell.device.Averager|psss_fwhm|||true
camera_screen=ch.psi.pshell.epics.DiscretePositioner|SAROP21-PPRM094:PROBE_SP|||true
beamline_name=ch.psi.pshell.epics.ChannelString|SAROP-ARAMIS:BEAMLINE|||
aperture_slope_width=ch.psi.pshell.epics.Motor|SAROP21-OAPU092:MOTOR_W|||true
aperture_slope_height=ch.psi.pshell.epics.Motor|SAROP21-OAPU092:MOTOR_H|||true
$aperture_offset_width=ch.psi.pshell.epics.Motor|SARFE10-OAPU044:MOTOR_W|||true
$aperture_offset_height=ch.psi.pshell.epics.Motor|SARFE10-OAPU044:MOTOR_H|||true
attenuator=ch.psi.pshell.epics.Positioner|SARFE10-OATT053:UsrRec.TD SARFE10-OATT053:UsrRec.TR1|||true
#psss_energy=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:ENERGY|||true
#psss_spectrum_x=ch.psi.pshell.epics.ChannelDoubleArray|SARFE10-PSSS059:SPECTRUM_X -1 -3|||true
#psss_spectrum_y=ch.psi.pshell.epics.ChannelDoubleArray|SARFE10-PSSS059:SPECTRUM_Y -1 -3|||true
#psss_center=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:SPECTRUM_CENTER|||true
#psss_fwhm=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:SPECTRUM_FWHM|||true
#psss_roi_min=ch.psi.pshell.epics.ChannelInteger|SARFE10-PSSS059:SPC_ROI_YMIN|||true
#psss_roi_max=ch.psi.pshell.epics.ChannelInteger|SARFE10-PSSS059:SPC_ROI_YMAX|||true
#histo_center=ch.psi.pshell.device.HistogramGenerator|psss_center|||true
#histo_fwhm=ch.psi.pshell.device.HistogramGenerator|psss_fwhm|||true
#psss_spectrum_y_average=ch.psi.pshell.device.ArrayAverager|psss_spectrum_y|||true
#psss_center_average=ch.psi.pshell.device.Averager|psss_center|||true
#psss_fwhm_average=ch.psi.pshell.device.Averager|psss_fwhm|||true

16
config/devices_psss.properties Executable file
View File

@@ -0,0 +1,16 @@
psss_fwhm_avg=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:REL-E-SPREAD|||true
dispatcher=ch.psi.pshell.bs.Dispatcher|https://dispatcher-api.psi.ch/sf|||
cam_server=ch.psi.pshell.bs.PipelineServer|sf-daqsync-01:8889|||
energy_machine=ch.psi.pshell.epics.ChannelDouble|SARFE10-PBPG050:ENERGY|||true
psss_energy=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:ENERGY|||true
psss_spectrum_x=ch.psi.pshell.epics.ChannelDoubleArray|SARFE10-PSSS059:SPECTRUM_X -1 -3|||true
psss_spectrum_y=ch.psi.pshell.epics.ChannelDoubleArray|SARFE10-PSSS059:SPECTRUM_Y -1 -3|||true
psss_center=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:SPECTRUM_CENTER|||true
psss_fwhm=ch.psi.pshell.epics.ChannelDouble|SARFE10-PSSS059:SPECTRUM_FWHM|||true
psss_roi_min=ch.psi.pshell.epics.ChannelInteger|SARFE10-PSSS059:SPC_ROI_YMIN|||true
psss_roi_max=ch.psi.pshell.epics.ChannelInteger|SARFE10-PSSS059:SPC_ROI_YMAX|||true
histo_center=ch.psi.pshell.device.HistogramGenerator|psss_center|||true
histo_fwhm=ch.psi.pshell.device.HistogramGenerator|psss_fwhm|||true
psss_spectrum_y_average=ch.psi.pshell.device.ArrayAverager|psss_spectrum_y|||true
psss_center_average=ch.psi.pshell.device.Averager|psss_center|||true
psss_fwhm_average=ch.psi.pshell.device.Averager|psss_fwhm|||true

View File

@@ -1,4 +1,4 @@
#Mon Feb 22 20:35:07 CET 2021
#Wed Aug 25 11:03:01 CEST 2021
ch.psi.jcae.ContextFactory.addressList=
ch.psi.jcae.ContextFactory.serverPort=
ch.psi.jcae.ContextFactory.maxArrayBytes=50000000

3
config/plugins.properties Executable file → Normal file
View File

@@ -1,10 +1,11 @@
Pointing.java=enabled
Correlation.java=disabled
ScreenPanel2.java=disabled
ScreenPanel3.java=disabled
ScreenPanel4.java=disabled
ScreenPanel5.java=disabled
ScreenPanel6.java=disabled
PSSS.java=enabled
PSSS.java=disabled
MonitoringCameras.java=disabled
Chris.java=disabled
SfCamera.java=enabled

116
config/preferences.json Normal file
View File

@@ -0,0 +1,116 @@
{
"fontShellPanel" : {
"name" : "Monospaced",
"style" : 0,
"size" : 13
},
"fontShellCommand" : {
"name" : "SansSerif",
"style" : 0,
"size" : 13
},
"fontOutput" : {
"name" : "Monospaced",
"style" : 0,
"size" : 13
},
"fontEditor" : {
"name" : "Monospaced",
"style" : 0,
"size" : 13
},
"fontPlotLabel" : {
"name" : "SansSerif",
"style" : 0,
"size" : 11
},
"fontPlotTick" : {
"name" : "SansSerif",
"style" : 0,
"size" : 10
},
"fontPlotTitle" : {
"name" : "SansSerif",
"style" : 1,
"size" : 13
},
"fontTerminal" : null,
"tabSize" : 4,
"contentWidth" : 0,
"editorBackground" : null,
"editorForeground" : null,
"simpleEditor" : false,
"hideEditorLineNumbers" : false,
"hideEditorContextMenu" : false,
"consoleLocation" : "Left",
"dataPanelLocation" : null,
"openDataFilesInDocTab" : false,
"noVariableEvaluationPropagation" : false,
"processingScripts" : [ ],
"asyncViewersUpdate" : false,
"scanPlotDisabled" : false,
"scanTableDisabled" : false,
"cachedDataPanel" : false,
"dataExtensions" : null,
"dataSubFiles" : null,
"hideFileName" : false,
"showEmergencyStop" : false,
"showHomingButtons" : false,
"showJogButtons" : false,
"hideScanPanel" : false,
"hideOutputPanel" : false,
"showXScanFileBrowser" : false,
"showQueueBrowser" : false,
"backgroundRendering" : false,
"showImageStatusBar" : true,
"persistRendererWindows" : true,
"defaultRendererColormap" : "Grayscale",
"linePlot" : "ch.psi.pshell.plot.LinePlotJFree",
"matrixPlot" : "ch.psi.pshell.plot.MatrixPlotJFree",
"surfacePlot" : "ch.psi.pshell.plot.SurfacePlotJzy3d",
"timePlot" : "ch.psi.pshell.plot.TimePlotJFree",
"plotsDetached" : false,
"plotLayout" : "Vertical",
"quality" : "High",
"defaultPlotColormap" : "Temperature",
"markerSize" : 2,
"plotBackground" : null,
"gridColor" : null,
"outlineColor" : null,
"disableOffscreenBuffer" : false,
"defaultPanels" : [ {
"deviceClassName" : "ch.psi.pshell.epics.Scaler",
"panelClassName" : "ch.psi.pshell.swing.ScalerPanel"
}, {
"deviceClassName" : "ch.psi.pshell.epics.Scienta",
"panelClassName" : "ch.psi.pshell.swing.ScientaPanel"
}, {
"deviceClassName" : "ch.psi.pshell.device.Motor",
"panelClassName" : "ch.psi.pshell.swing.MotorPanel"
}, {
"deviceClassName" : "ch.psi.pshell.device.ProcessVariable",
"panelClassName" : "ch.psi.pshell.swing.ProcessVariablePanel"
}, {
"deviceClassName" : "ch.psi.pshell.device.MotorGroup",
"panelClassName" : "ch.psi.pshell.swing.MotorGroupPanel"
}, {
"deviceClassName" : "ch.psi.pshell.device.DiscretePositioner",
"panelClassName" : "ch.psi.pshell.swing.DiscretePositionerPanel"
}, {
"deviceClassName" : "ch.psi.pshell.device.Camera",
"panelClassName" : "ch.psi.pshell.swing.CameraPanel"
}, {
"deviceClassName" : "ch.psi.pshell.device.Slit",
"panelClassName" : "ch.psi.pshell.swing.SlitPanel"
}, {
"deviceClassName" : "ch.psi.pshell.device.HistogramGenerator",
"panelClassName" : "ch.psi.pshell.swing.HistogramGeneratorPanel"
}, {
"deviceClassName" : "ch.psi.pshell.device.ReadonlyRegister$ReadonlyRegisterArray",
"panelClassName" : "ch.psi.pshell.swing.DeviceValueChart"
}, {
"deviceClassName" : "ch.psi.pshell.device.ReadonlyRegister$ReadonlyRegisterMatrix",
"panelClassName" : "ch.psi.pshell.swing.DeviceValueChart"
} ],
"scriptPopupDialog" : "Exception"
}

View File

@@ -1,23 +1,25 @@
#Thu Feb 25 14:38:29 CET 2021
#Tue Aug 16 17:03:47 CEST 2022
sessionsPath={outp}/sessions
scriptPath={home}/script
pluginsPath={home}/plugins
configFileDevices={config}/devices.properties
consoleSessionsPath={sessions}/console
libraryPath={script}; {script}/Lib
configFilePlugins={config}/plugins.properties
contextPath={outp}/context
xscanPath={script}
queuePath={script}
extensionsPath={home}/extensions
configPath={home}/config
configFileSessions={config}/sessions.properties
userSessionsPath={sessions}/user
dataPath={outp}/data
devicesPath={home}/devices
configFileVariables={config}/variables.properties
configFileSettings={config}/settings.properties
logPath={outp}/log
wwwPath={home}/www
imagesPath={outp}/images
configFile={config}/config.properties
scriptType=py
configFileTasks={config}/tasks.properties
pluginsPath={home}/plugins
consoleSessionsPath={sessions}/console
libraryPath={script}; {script}/Lib
configFilePlugins={config}/plugins.properties
contextPath={outp}/context
devicesPath={home}/devices
configFileSettings={config}/settings.properties
imagesPath={outp}/images
scriptType=py

8
config/variables.properties Executable file → Normal file
View File

@@ -1,4 +1,4 @@
#Thu Apr 29 13:47:57 CEST 2021
LastRunDate=210429
FileSequentialNumber=86
DaySequentialNumber=5
#Tue Dec 12 12:48:24 CET 2023
LastRunDate=231212
DaySequentialNumber=3
FileSequentialNumber=6

View File

@@ -0,0 +1,25 @@
#Mon Dec 19 15:35:22 CET 2022
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

28
devices/CurrentCamera.properties Executable file → Normal file
View File

@@ -1,32 +1,26 @@
#Tue May 04 13:01:49 CEST 2021
\u0000\u0000\u0000\u0000=
=0
spatialCalOffsetY=0.0
spatialCalOffsetX=0.0
#Mon Feb 19 14:45:17 CET 2024
spatialCalOffsetY=-213.43204623518318
spatialCalOffsetX=-415.6307007415859
colormapLogarithmic=false
scale=1.0
grayscale=false
spatialCalScaleX=-1.0
spatialCalScaleY=-1.0
colormapMax=15848.0
Y=0
spatialCalScaleX=-15.057748904706497
spatialCalScaleY=-11.764705882352942
colormapMax=65535.0
rescaleOffset=0.0
roiWidth=-1
colormap=Temperature
imageWidth=1280
colormap=Flame
invert=false
colormapMin=69.0
colormapMin=63.0
rotation=0.0
rotationCrop=false
false=
rescaleFactor=1.0
imageHeight=1024
spatialCalUnits=mm
spatialCalUnits=null
flipVertically=false
roiHeight=-1
flipHorizontally=false
colormapAutomatic=false
colormapAutomatic=true
roiY=0
roiX=0
transpose=false
regionStartX=1
regionStartY=1

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

@@ -1,4 +1,4 @@
#Wed Feb 26 11:49:58 CET 2020
#Wed Oct 04 17:47:35 CEST 2023
minValue=NaN
unit=null
offset=0.0
@@ -7,4 +7,5 @@ rotation=false
precision=-1
sign_bit=0
scale=1.0
description=null
resolution=NaN

View File

@@ -0,0 +1,19 @@
#Wed Nov 15 15:55:09 CET 2023
precision=3
scale=1.0
description=width Y
estbilizationDelay=0
resolution=0.01
minValue=0.0
defaultSpeed=0.3
sign_bit=0
monitorByPosition=false
minSpeed=0.1
offset=0.0
maxValue=5.0
rotation=false
maxSpeed=0.3
homingType=None
startRetries=1
unit=mm
hasEnable=false

View File

@@ -0,0 +1,19 @@
#Wed Nov 15 15:54:55 CET 2023
precision=3
scale=1.0
description=width X
estbilizationDelay=0
resolution=0.01
minValue=0.0
defaultSpeed=0.3
sign_bit=0
monitorByPosition=false
minSpeed=0.1
offset=0.0
maxValue=5.0
rotation=false
maxSpeed=0.3
homingType=None
startRetries=1
unit=mm
hasEnable=false

View File

@@ -0,0 +1,19 @@
#Wed Nov 15 15:55:18 CET 2023
precision=3
description=width Y
scale=1.0
estbilizationDelay=0
resolution=0.01
minValue=0.0
defaultSpeed=0.3
sign_bit=0
monitorByPosition=false
minSpeed=0.1
offset=0.0
maxValue=5.0
rotation=false
maxSpeed=0.3
homingType=None
startRetries=1
unit=mm
hasEnable=false

View File

@@ -0,0 +1,19 @@
#Wed Nov 15 15:55:34 CET 2023
precision=3
description=width X
scale=1.0
estbilizationDelay=0
resolution=0.01
minValue=0.0
defaultSpeed=0.3
sign_bit=0
monitorByPosition=false
minSpeed=0.1
offset=0.0
maxValue=5.0
rotation=false
maxSpeed=0.3
homingType=None
startRetries=1
unit=mm
hasEnable=false

View File

@@ -0,0 +1,11 @@
#Mon Feb 19 15:18:22 CET 2024
offset=0.0
maxValue=1.0
rotation=false
precision=3
scale=1.0
description=null
resolution=0.01
minValue=0.0
unit=%
sign_bit=0

14
devices/cam_server.properties Executable file → Normal file
View File

@@ -1,15 +1,15 @@
#Sun May 02 17:05:06 CEST 2021
spatialCalOffsetY=-50.02315886984715
spatialCalOffsetX=-50.01953888237593
#Mon Feb 19 10:07:14 CET 2024
spatialCalOffsetY=-213.43204623518318
spatialCalOffsetX=-415.6307007415859
colormapLogarithmic=false
scale=1.0
grayscale=false
spatialCalScaleX=-1.0
spatialCalScaleY=-1.0
spatialCalScaleX=-15.057748904706497
spatialCalScaleY=-11.764705882352942
colormapMax=255.0
rescaleOffset=0.0
roiWidth=-1
colormap=Temperature
colormap=Flame
invert=false
colormapMin=0.0
rotationCrop=false
@@ -19,7 +19,7 @@ spatialCalUnits=mm
flipVertically=false
roiHeight=-1
flipHorizontally=false
colormapAutomatic=false
colormapAutomatic=true
roiY=0
roiX=0
transpose=false

4
devices/dispatcher.properties Executable file → Normal file
View File

@@ -1,11 +1,13 @@
#Wed Jun 03 18:45:57 CEST 2020
#Sun Dec 03 11:20:04 CET 2023
sendStrategy=complete_all
dropIncomplete=false
keepListeningOnStop=false
disableCompression=false
parallelHandlerProcessing=true
sendBuildChannelConfig=at_startup
analizeHeader=false
sendAwaitFirstMessage=false
headerReservingAllocator=false
socketType=DEFAULT
validationInconsistency=keep_as_is
byteBufferAllocator=false

View File

@@ -1,6 +1,7 @@
#Fri Apr 30 14:09:41 CEST 2021
#Tue Aug 16 17:03:53 CEST 2022
bins=1000
min=11240.0
max=11160.0
min=11050.0
max=10900.0
precision=-1
description=null
numberOfSamples=10000

View File

@@ -1,6 +1,7 @@
#Fri Apr 30 07:45:13 CEST 2021
#Tue Aug 16 17:03:53 CEST 2022
bins=1000
min=0.0
max=40.0
precision=-1
description=null
numberOfSamples=10000

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

@@ -1,4 +1,5 @@
#Mon May 03 09:21:35 CEST 2021
#Tue Aug 16 17:03:53 CEST 2022
measures=10
precision=-1
description=null
interval=-1

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

@@ -1,4 +1,5 @@
#Mon May 03 09:21:52 CEST 2021
#Tue Aug 16 17:03:53 CEST 2022
measures=10
precision=-1
description=null
interval=-1

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

@@ -1,5 +1,6 @@
#Mon May 03 09:15:04 CEST 2021
#Tue Aug 16 17:03:53 CEST 2022
measures=10
precision=-1
description=null
interval=-1
integrate=false

191
plugins/Pointing.form Normal file
View File

@@ -0,0 +1,191 @@
<?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">
<Component id="viewer" min="-2" pref="469" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="processVariablePanel1" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="75" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="textSaturated" linkSize="2" min="-2" pref="95" max="-2" attributes="0"/>
<EmptySpace min="0" pref="181" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="130" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonRefOffAp" linkSize="1" max="32767" attributes="0"/>
<Component id="buttonEnd" linkSize="1" max="32767" attributes="0"/>
</Group>
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
<Component id="ckOffsetCheck" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="textOffY" linkSize="2" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="textOffX" linkSize="2" min="-2" pref="136" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="165" max="-2" attributes="0"/>
<Component id="buttonStart" linkSize="1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="viewer" min="-2" pref="716" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="86" max="-2" attributes="0"/>
<Component id="buttonStart" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="73" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textSaturated" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="processVariablePanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="97" max="-2" attributes="0"/>
<Component id="buttonRefOffAp" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="74" max="-2" attributes="0"/>
<Component id="ckOffsetCheck" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textOffX" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textOffY" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="buttonEnd" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="106" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.ui.CamServerViewer" name="viewer">
</Component>
<Component class="ch.psi.pshell.swing.ProcessVariablePanel" name="processVariablePanel1">
<Properties>
<Property name="deviceName" type="java.lang.String" value="attenuator"/>
<Property name="showLimitButtons" type="boolean" value="false"/>
<Property name="showSlider" type="boolean" value="false"/>
<Property name="showStop" type="boolean" value="false"/>
<Property name="stepIncrement" type="double" value="0.01"/>
<Property name="stepSize" type="double" value="0.01"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Saturated Pixels:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="textSaturated">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="horizontalAlignment" type="int" value="0"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonStart">
<Properties>
<Property name="text" type="java.lang.String" value="Start"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStartActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonRefOffAp">
<Properties>
<Property name="text" type="java.lang.String" value="Reference Offset Aperture"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonRefOffApActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonEnd">
<Properties>
<Property name="text" type="java.lang.String" value="End"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonEndActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Off X:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="textOffX">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="horizontalAlignment" type="int" value="0"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Off Y:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="textOffY">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="horizontalAlignment" type="int" value="0"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="ckOffsetCheck">
<Properties>
<Property name="text" type="java.lang.String" value="Enable Offset Check"/>
</Properties>
</Component>
</SubComponents>
</Form>

281
plugins/Pointing.java Normal file
View File

@@ -0,0 +1,281 @@
import ch.psi.pshell.ui.CamServerViewer;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.State;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
*/
public class Pointing extends Panel {
public Pointing() {
initComponents();
try {
viewer.initialize(CamServerViewer.SourceSelecionMode.Single);
viewer.setCameraServerUrl("sf-daqsync-01:8888");
viewer.setPipelineServerUrl("sf-daqsync-01:8889");
viewer.setStartupStream(TOOL_TIP_TEXT_KEY);
viewer.setToolbarVisible(false);
viewer.setZoom(2.0);
} catch (Exception ex) {
showException(ex);
}
}
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
try {
viewer.setStream("SAROP21-PPRM094_sp");
} catch (Exception ex) {
showException(ex);
}
this.startTimer(1000, 1000);
}
@Override
public void onStateChange(State state, State former) {
buttonStart.setEnabled(state.isReady());
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
@Override
protected void onTimer() {
try{
Object img = viewer.getStreamDevice().take().getValue("image");
this.setGlobalVar("plugin_img", img);
Object ret = eval("get_saturated_pixels(plugin_img)", true);
textSaturated.setText((ret==null) ? "" : ret.toString());
} catch (Exception ex){
textSaturated.setText("");
this.getLogger().severe(ex.getMessage());
}
if (ckOffsetCheck.isSelected()){
try{
Object ret = this.run("pointing/check_offset", null, true);
List offset = (List) ret;
Double offX = (Double) offset.get(0);
Double offY = (Double) offset.get(1);
textOffX.setText(String.format("%1.3f",offX));
textOffY.setText(String.format("%1.3f",offY));
} catch (Exception ex){
textOffX.setText("");
textOffY.setText("");
//showException(ex);
}
}
}
@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() {
viewer = new ch.psi.pshell.ui.CamServerViewer();
processVariablePanel1 = new ch.psi.pshell.swing.ProcessVariablePanel();
jLabel1 = new javax.swing.JLabel();
textSaturated = new javax.swing.JTextField();
buttonStart = new javax.swing.JButton();
buttonRefOffAp = new javax.swing.JButton();
buttonEnd = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
textOffX = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
textOffY = new javax.swing.JTextField();
ckOffsetCheck = new javax.swing.JCheckBox();
processVariablePanel1.setDeviceName("attenuator");
processVariablePanel1.setShowLimitButtons(false);
processVariablePanel1.setShowSlider(false);
processVariablePanel1.setShowStop(false);
processVariablePanel1.setStepIncrement(0.01);
processVariablePanel1.setStepSize(0.01);
jLabel1.setText("Saturated Pixels:");
textSaturated.setEditable(false);
textSaturated.setHorizontalAlignment(javax.swing.JTextField.CENTER);
buttonStart.setText("Start");
buttonStart.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonStartActionPerformed(evt);
}
});
buttonRefOffAp.setText("Reference Offset Aperture");
buttonRefOffAp.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonRefOffApActionPerformed(evt);
}
});
buttonEnd.setText("End");
buttonEnd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonEndActionPerformed(evt);
}
});
jLabel2.setText("Off X:");
textOffX.setEditable(false);
textOffX.setHorizontalAlignment(javax.swing.JTextField.CENTER);
jLabel3.setText("Off Y:");
textOffY.setEditable(false);
textOffY.setHorizontalAlignment(javax.swing.JTextField.CENTER);
ckOffsetCheck.setText("Enable Offset Check");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(viewer, javax.swing.GroupLayout.PREFERRED_SIZE, 469, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(processVariablePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(75, 75, 75)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textSaturated, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 181, Short.MAX_VALUE))))
.addGroup(layout.createSequentialGroup()
.addGap(130, 130, 130)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonRefOffAp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonEnd, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(ckOffsetCheck)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textOffY))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textOffX, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGap(165, 165, 165)
.addComponent(buttonStart)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonEnd, buttonRefOffAp, buttonStart});
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {textOffX, textOffY, textSaturated});
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(viewer, javax.swing.GroupLayout.PREFERRED_SIZE, 716, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(86, 86, 86)
.addComponent(buttonStart)
.addGap(73, 73, 73)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(textSaturated, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(processVariablePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(97, 97, 97)
.addComponent(buttonRefOffAp)
.addGap(74, 74, 74)
.addComponent(ckOffsetCheck)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(textOffX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(textOffY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(buttonEnd)))
.addContainerGap(106, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void buttonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartActionPerformed
try{
runAsync("pointing/start").handle((ret,ex)->{
return ret;
});
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_buttonStartActionPerformed
private void buttonRefOffApActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRefOffApActionPerformed
try{
runAsync("pointing/reference_offset").handle((ret,ex)->{
return ret;
});
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_buttonRefOffApActionPerformed
private void buttonEndActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEndActionPerformed
try{
runAsync("pointing/end").handle((ret,ex)->{
return ret;
});
} catch (Exception ex){
showException(ex);
}
}//GEN-LAST:event_buttonEndActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonEnd;
private javax.swing.JButton buttonRefOffAp;
private javax.swing.JButton buttonStart;
private javax.swing.JCheckBox ckOffsetCheck;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private ch.psi.pshell.swing.ProcessVariablePanel processVariablePanel1;
private javax.swing.JTextField textOffX;
private javax.swing.JTextField textOffY;
private javax.swing.JTextField textSaturated;
private ch.psi.pshell.ui.CamServerViewer viewer;
// End of variables declaration//GEN-END:variables
}

View File

@@ -2,7 +2,7 @@ import math
import sys, traceback
from mathutils import fit_polynomial, PolynomialFunction
from plotutils import plot_line, plot_function
from ch.psi.pshell.swing.Shell import STDOUT_COLOR
from ch.psi.pshell.swing.Shell import getColorStdout
import org.apache.commons.math3.stat.correlation.PearsonsCorrelation as PearsonsCorrelation
import ch.psi.pshell.bs.PipelineServer as PipelineServer
@@ -13,15 +13,17 @@ TYPE_CAMERA= 2
if get_exec_pars().source == CommandSource.ui:
dx = "SINDI01-RLLE-STA:SLAVE1-CPUTIMER"
dx="SARFE10-PBPS053:INTENSITY"
#dx = "SLG-LCAM-C042 x_rms"
dxtype = TYPE_STREAM
dxtype = TYPE_CHANNEL
#dxtype = TYPE_CHANNEL
#dxtype = TYPE_CAMERA
#dy = "SINDI01-RLLE-STA:SLAVE1-DLTIMER"
dy = "SLG-LCAM-C042 y_rms"
dy = "SINDI01-RLLE-STA:SLAVE1-DLTIMER"
#dy = "SLG-LCAM-C042 y_rms"
dy="SARFE10-PBPS053:INTENSITY"
dytype = TYPE_STREAM
dytype = TYPE_CHANNEL
dytype = TYPE_CAMERA
#dytype = TYPE_CHANNEL
#dytype = TYPE_CAMERA
interval = 0.10
window = 40
p = plot(None)[0]
@@ -115,7 +117,7 @@ try:
_stream.initialize()
_stream.start(True)
if _camname != None:
shared = _camname.endswith("_sp1")
shared = _camname.endswith("_sp")
print "Camera: " , _camname, " shared: ", shared
cam_server.start(_camname, shared )
cam_server.stream.waitCacheChange(10000);
@@ -140,7 +142,8 @@ try:
#Sample and plot data
if bs == True:
_stream.waitValueNot(_stream.take(), 10000)
bsdata = list(_stream.take().values)
bsdata = list(_stream.take().values())
#print bsdata
if dxtype==TYPE_CHANNEL:
x=dx.read()
@@ -174,7 +177,7 @@ try:
if marker is not None:
p.removeMarker(marker)
marker = p.addMarker(x2+res, p.AxisId.X, s, p.getBackground())
marker.setLabelPaint(STDOUT_COLOR)
marker.setLabelPaint(getColorStdout())
if linear_fit:
#Calculate, print and plot linear fit
pars_lin = (a0,a1) = fit_polynomial(ay, ax, 1)

View File

@@ -3,7 +3,7 @@ import ch.psi.pshell.device.HistogramGenerator as HistogramGenerator
CAMERA_NAME = "SARES20-PROF141-M1"
CHANNEL = "intensity"
cam_server.start(CAMERA_NAME + "_sp", CAMERA_NAME + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)
dev = cam_server.stream.getChild(CHANNEL)
add_device(dev, True) #To see it in Device panel

View File

@@ -3,7 +3,7 @@ import ch.psi.pshell.device.HistogramGenerator as HistogramGenerator
CAMERA_NAME = "SAROP21-PPRM138"
cam_server.start(CAMERA_NAME + "_sp", CAMERA_NAME + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)

View File

@@ -20,7 +20,7 @@ bins = 100
panels = OrderedDict()
cam_server.start(CAMERA_NAME + "_sp", CAMERA_NAME + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)
for channel in CHANNELS:

View File

@@ -22,7 +22,7 @@ panels = OrderedDict()
CAMERA_NAME='SAROP21-PPRM138'
cam_server.start(CAMERA_NAME + "_sp", CAMERA_NAME + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)
for channel in CHANNELS:

View File

@@ -3,7 +3,7 @@ import ch.psi.pshell.device.HistogramGenerator as HistogramGenerator
CAMERA_NAME = "SAROP21-PPRM102"
#CAMERA_NAME = "SAROP21-PPRM138"
cam_server.start(CAMERA_NAME + "_sp", CAMERA_NAME + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)

View File

@@ -3,7 +3,7 @@ import ch.psi.pshell.device.HistogramGenerator as HistogramGenerator
CAMERA_NAME = "SARES20-PROF142-M1"
cam_server.start(CAMERA_NAME + "_sp", CAMERA_NAME + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)

4
script/local.py Executable file → Normal file
View File

@@ -8,7 +8,9 @@ from mathutils import PolynomialFunction, Gaussian, HarmonicOscillator, Gaussian
from plotutils import plot_function, plot_data
import java.awt.Color as Color
run("psss/psss")
#run("psss/psss")
run ("pointing/local")
###################################################################################################
# DRY RUN

View File

@@ -0,0 +1,5 @@
st.waitCacheChange(5000)
val=st.take()
fit_pos = val["x_fit_mean"], val["y_fit_mean"]
offset = fit_pos[0] - marker_pos[0], fit_pos[1] - marker_pos[1]
set_return(offset)

18
script/pointing/config.py Normal file
View File

@@ -0,0 +1,18 @@
BEAMLINE_NAME = "Bernina"
CAMERA_NAME = "SAROP21-PPRM094"
APERTURE_SLOPE_W_MIN = 0.2
APERTURE_SLOPE_H_MIN = 0.2
APERTURE_OFFSET_W_MIN = 0.2
APERTURE_OFFSET_H_MIN = 0.2
APERTURE_SLOPE_W_DEFAULT = 5.0
APERTURE_SLOPE_H_DEFAULT = 5.0
APERTURE_OFFSET_W_DEFAULT = 5.0
APERTURE_OFFSET_H_DEFAULT = 5.0
ATENUATOR_CAL = 0.01
ATENUATOR_DEFAULT = 0.05

3
script/pointing/end.py Normal file
View File

@@ -0,0 +1,3 @@
attenuator.write(ATENUATOR_DEFAULT)
st.close()

14
script/pointing/local.py Normal file
View File

@@ -0,0 +1,14 @@
run("pointing/config")
def check():
if beamline_name.read() != BEAMLINE_NAME:
raise "Invalid beamline mode"
camera_screen.setSettlingCondition(ChannelSettlingCondition("SAROP21-PPRM094:IN_POS", 1, None, 'i'))
def get_saturated_pixels(img):
img = flatten(img)
return sum([1 if v>=4095 else 0 for v in img])

63
script/pointing/main.py Normal file
View File

@@ -0,0 +1,63 @@
#check()
run("pointing/start")
#Close aperture offset
aperture_offset_width.move(APERTURE_OFFSET_W_MIN)
aperture_offset_height.move(APERTURE_OFFSET_H_MIN)
#Move marker to the fit position
val=st.take()
fit_pos = val["x_fit_mean"], val["y_fit_mean"]
x_axis, y_axis = val["x_axis"], val["y_axis"]
fit_pos_px_x = int(fit_pos[0] / cam_server.config.spatialCalScaleX - cam_server.config.spatialCalOffsetX)
fit_pos_px_y = int(fit_pos[1] / cam_server.config.spatialCalScaleY - cam_server.config.spatialCalOffsetY)
fit_pos_px = [fit_pos_px_x, fit_pos_px_y]
print fit_pos_px
#marker_pos_px = cam_server.getInstanceConfigValue("Marker")
#marker_pos_x = (marker_pos_px[0] + cam_server.config.spatialCalOffsetX) * cam_server.config.spatialCalScaleX
#marker_pos_y = (marker_pos_px[1] + cam_server.config.spatialCalOffsetY) * cam_server.config.spatialCalScaleY
#marker_pos = [marker_pos_x, marker_pos_y]
#print marker_pos_px
cam_server.setInstanceConfigValue("Marker", fit_pos_px)
marker_pos_px = fit_pos_px
#Open aperture offset
aperture_offset_width.move(APERTURE_OFFSET_W_DEFAULT)
aperture_offset_height.move(APERTURE_OFFSET_H_DEFAULT)
time.sleep(0.5)
st.waitCacheChange(5000)
val=st.take()
fit_pos = val["x_fit_mean"], val["y_fit_mean"]
marker_pos_x = (marker_pos_px[0] + cam_server.config.spatialCalOffsetX) * cam_server.config.spatialCalScaleX
marker_pos_y = (marker_pos_px[1] + cam_server.config.spatialCalOffsetY) * cam_server.config.spatialCalScaleY
marker_pos = [marker_pos_x, marker_pos_y]
offset = fit_pos[0] - marker_pos[0], fit_pos[1] - marker_pos[1]
print offset
#1/0
#camera_screen.move("Free")
#aperture_slope_width.move(APERTURE_SLOPE_W_MIN)
#aperture_slope_height.move(APERTURE_SLOPE_H_MIN)
run("pointing/end")

View File

@@ -0,0 +1,40 @@
try:
#Close aperture offset
aperture_offset_width.moveAsync(APERTURE_OFFSET_W_MIN)
aperture_offset_height.move(APERTURE_OFFSET_H_MIN)
aperture_offset_width.waitReady(-1)
#Move marker to the fit position
val=st.take()
fit_pos = val["x_fit_mean"], val["y_fit_mean"]
x_axis, y_axis = val["x_axis"], val["y_axis"]
fit_pos_px_x = int(fit_pos[0] / cam_server.config.spatialCalScaleX - cam_server.config.spatialCalOffsetX)
fit_pos_px_y = int(fit_pos[1] / cam_server.config.spatialCalScaleY - cam_server.config.spatialCalOffsetY)
fit_pos_px = [fit_pos_px_x, fit_pos_px_y]
print fit_pos_px
#marker_pos_px = cam_server.getInstanceConfigValue("Marker")
#marker_pos_x = (marker_pos_px[0] + cam_server.config.spatialCalOffsetX) * cam_server.config.spatialCalScaleX
#marker_pos_y = (marker_pos_px[1] + cam_server.config.spatialCalOffsetY) * cam_server.config.spatialCalScaleY
#marker_pos = [marker_pos_x, marker_pos_y]
#print marker_pos_px
cam_server.setInstanceConfigValue("Marker", fit_pos_px)
marker_pos_px = fit_pos_px
marker_pos_x = (marker_pos_px[0] + cam_server.config.spatialCalOffsetX) * cam_server.config.spatialCalScaleX
marker_pos_y = (marker_pos_px[1] + cam_server.config.spatialCalOffsetY) * cam_server.config.spatialCalScaleY
marker_pos = [marker_pos_x, marker_pos_y]
finally:
#Open aperture offset
aperture_offset_width.moveAsync(APERTURE_OFFSET_W_DEFAULT)
aperture_offset_height.move(APERTURE_OFFSET_H_DEFAULT)
aperture_offset_width.waitReady(-1)
time.sleep(0.5)

17
script/pointing/start.py Normal file
View File

@@ -0,0 +1,17 @@
aperture_offset_width = aperture_slope_width #TODO: REMOVE
aperture_offset_height = aperture_slope_height
camera_screen.move("Wafer 100um")
time.sleep(0.2)
camera_screen.getSettlingCondition().waitSettled() #ecj
cam_server.start(CAMERA_NAME + '_sp', True)
cam_server.averaging=10
st = cam_server.stream
print('Started camera')
#Fix this with a specific pipeline
time.sleep(0.5)
st.waitCacheChange(5000)
#show_panel(cam_server)
add_device(st, True)
attenuator.write(ATENUATOR_CAL)

2
script/psss/psss.py Executable file → Normal file
View File

@@ -159,7 +159,7 @@ def enable_psss_image(enabled, renderer):
cam_server.config.colormap=Colormap.Temperature
cam_server.start(PSSS_CAMERA_NAME + "_sp", PSSS_CAMERA_NAME + "_sp1")
cam_server.start(PSSS_CAMERA_NAME + "_sp", True)
#ovmin, ovmax= Overlays.Crosshairs(renderer.getPenMarker(), Dimension(-1,1)), \
# Overlays.Crosshairs(renderer.getPenMarker(), Dimension(-1,1))
ovmin, ovmax= Overlays.Line(renderer.getPenMarker()), Overlays.Line(renderer.getPenMarker())

View File

@@ -0,0 +1,28 @@
CAMERA = "SARES20-CAMS142-M3"
CAMERA = "SARFE10-PSSS059"
CAMERA = "SATBD02-DSCR050"
CAMERA = "SATES31-CAMS187-RIXS1"
CAMERA = "SAROP21-PPRM138"
CAMERA = "SARES20-PROF142-M1"
#CAMERA = "SARES20-CAMS142-M5"
CAMERA = "SLAAR02-LPMO01-C321"
CAMERA = "SLAAR02-LPMO02-C322"
CAMERA = "SLAAR21-LCAM-CS841"
CAMERA = "SLAAR21-LCAM-CS842"
CAMERA = "SARES20-CAMS142-C2"
CAMERA_URL = caget(CAMERA + ":BSREADCONFIG").replace("tcp://daq", "tcp://")
#CAMERA_URL= "tcp://sf-sioc-cs-83:9020"
#CAMERA_URL= "tcp://sf-sioc-cs-64:9000"
CAMERA_URL = "tcp://sf-daqsync-02:31852"
print CAMERA_URL
st1 = Stream("st1", CAMERA_URL, SocketType.PULL)
st1.initialize()
st1.start()
st1.waitCacheChange(3000)
try:
#r=bscan (st1, records=5, timeout=10.0, save=False, enabled_plots=[st1,])
#v= st1.getValues()
show_panel(st1)
finally:
st1.close()

2
script/test/demo_histogram.py Executable file → Normal file
View File

@@ -3,7 +3,7 @@ import ch.psi.pshell.device.HistogramGenerator as HistogramGenerator
CAMERA_NAME = "SARES20-PROF141-M1"
CHANNEL = "intensity"
cam_server.start(CAMERA_NAME + "_sp", CAMERA_NAME + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)
dev = cam_server.stream.getChild(CHANNEL)
add_device(dev, True) #To see it in Device panel

2
script/test/demo_histogram2.py Executable file → Normal file
View File

@@ -8,7 +8,7 @@ range_min, range_max = float('nan'),float('nan')
bins = 100
for camera_name in CAMERA_NAMES:
cam_server.start(camera_name + "_sp", camera_name + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(camera_name + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)
for channel in CHANNELS:

2
script/test/demo_histogram3.py Executable file → Normal file
View File

@@ -25,7 +25,7 @@ bins = 100
panels = OrderedDict()
for camera_name in CAMERA_NAMES:
cam_server.start(camera_name + "_sp", camera_name + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(camera_name + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)
for channel in CHANNELS:

2
script/test/demo_histogram4.py Executable file → Normal file
View File

@@ -24,7 +24,7 @@ bins = 100
panels = OrderedDict()
cam_server.start(CAMERA_NAME + "_sp", CAMERA_NAME + "_sp1") #Start or connect to ScreenPanel pipeline
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)
for channel in CHANNELS:

View File

@@ -0,0 +1,5 @@
s1 = Stream("s1", dispatcher)
s1.addScalar("SARFE10-PSSS059:SPECTRUM_Y_SUM", "SARFE10-PSSS059:SPECTRUM_Y_SUM", 1, 0)
s1.addScalar("SARFE10-PBPS053:INTENSITY" , "SARFE10-PBPS053:INTENSITY", 1, 0)
s1.initialize()
bscan(s1, 10, 3.0)

0
script/test/test_cpython.py Normal file → Executable file
View File

2
script/test/test_screenpanel_pipeline.py Executable file → Normal file
View File

@@ -1,6 +1,6 @@
import ch.psi.pshell.device.HistogramGenerator as HistogramGenerator
cam_server.start("SARES20-PROF141-M1_sp", "SARES20-PROF141-M1_sp1")
cam_server.start("SARES20-PROF141-M1_sp", True)
channels = ["intensity",
"x_center_of_mass",

View File

@@ -0,0 +1,136 @@
"""
Run as:
pshell_be -l -test -c -f="users/roman/correlation_bs.py" -args="CHS:['SAROP21-PBPS103:INTENSITY', 'SAROP21-PBPS133:INTENSITY']"
or with additional parameters:
pshell_be -l -test -c -f="users/roman/correlation_bs.py" -args="CHS:['SAROP21-PBPS103:INTENSITY', 'SAROP21-PBPS133:INTENSITY'],VERBOSE:False,TIME_INTERVAL:2.0"
"""
if not "VERBOSE" in globals():
VERBOSE = False
if not "TIME_INTERVAL" in globals():
TIME_INTERVAL = 1.0
EMPTY_VALUE = 1112223330
channel_list = CHS
def start_stream(channel_list):
try:
st=None
print "Starting stream"
if len(channel_list)==0:
raise Exception ("No channel defined")
st = Stream("pulse_id", dispatcher)
for c in channel_list:
st.addScalar(c, c, 1, 0)
st.initialize()
st.start()
st.waitCacheChange(10000) #Wait stream be running before starting scan
if st.take() is None:
raise Exception("Error initializing data stream")
ack_channel_list(channel_list)
print "Stream started"
except:
stop_stream(st)
st=None
print sys.exc_info()[1]
return st
def stop_stream(st):
try:
if st:
st.close()
st=None
print "Stream closed"
except:
print sys.exc_info()[1]
finally:
ack_channel_list([])
#def on_start_change(val):
# fork(start_stream if (val==1) else stop_stream)
#start = Channel(PREFIX + "START_STOP", type = 'i', monitored = True, callback=on_start_change)
t0=None
pid=None
def handle_message(msg, channel_list, buf):
global t0, pid
if t0 is None:
t0 = time.time()
now=time.time()
num_channels = len(channel_list)
size_buffer= 300 #int((len(buf)-100)/(len(channel_list)+1))
buf[0] = msg.pulseId
buf[1] = num_channels
buf[4] = EMPTY_VALUE
#if (pid is not None) and ((pid+1) != msg.pulseId):
# print "Missing pid: ", (pid+1)
pid = msg.pulseId
#Count
if buf[2] < size_buffer:
buf[2] = buf[2]+1
#Index
buf[3] = buf[3]+1
if buf[3] == size_buffer:
buf[3]=0
index = int(buf[3])*(num_channels+1) + 10
buf[index] = msg.pulseId
index = index+1
for v in msg.values():
buf[index] = EMPTY_VALUE if ((v is None) or (math.isnan(v)))else v
index = index+1
if now >= (t0 + TIME_INTERVAL):
if VERBOSE:
print to_list(buf[0:5])
t0 = time.time()
return True
return False
def run():
channel_list = []
st=None
start = Channel(PREFIX + "START_STOP", type = 'i')
outp = Channel(PREFIX + "PACK_DATA", type = '[d')
buf = to_array([0]*outp.get_size(),'d')
buf[2] = 0
buf[3]= -1
try:
while True:
started = (start.get()==1)
if started and not st:
print "Started"
channel_list=get_channel_list()
print "Channel list: ", channel_list
st = start_stream(channel_list)
if st is not None:
class StreamListener (DeviceListener):
def onValueChanged(self, device, value, former):
if handle_message(value, channel_list, buf):
outp.putq(buf)
listener = StreamListener()
st.addListener(listener)
elif st and not started:
print "Stopped"
channel_list=[]
stop_stream(st)
st = None
"""
if st:
st.waitCacheChange(0)
if handle_message(st.take(), channel_list, buf):
outp.putq(buf)
time.sleep(0.001)
else:
time.sleep(0.1)
"""
time.sleep(0.1)
finally:
stop_stream(st)
if outp: outp.close()
if start: start.close()
if __name__ == "__main__":
run()