commit 511f888e982506d12b99cffdcf9a2886135a1470 Author: gobbo_a Date: Mon Jul 14 17:48:44 2025 +0200 Startup diff --git a/config/.DS_Store b/config/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/config/.DS_Store differ diff --git a/config/config.properties b/config/config.properties new file mode 100644 index 0000000..8a67ff9 --- /dev/null +++ b/config/config.properties @@ -0,0 +1,78 @@ +#Mon Jul 14 17:42:43 CEST 2025 +autoSaveScanData=true +dataDepthDimension=0 +dataFormat=h5 +dataLayout=default +dataPath={data}/{year}_{month}/{date}/{date}_{time}_{name} +dataScanAutoSave=true +dataScanFlushRecords=false +dataScanLazyTableCreation=false +dataScanPreserveTypes=false +dataScanReleaseRecords=false +dataScanSaveLogs=true +dataScanSaveOutput=false +dataScanSaveScript=false +dataScanSaveSetpoints=false +dataScanSaveTimestamps=false +dataScanStreamerPort=-1 +dataServerPort=-1 +dataTransferMode=Off +dataTransferPath= +dataTransferUser= +depthDimension=0 +disableDataFileLogs=false +disableEmbeddedAttributes=false +fdaSerialization=true +filePermissionsConfig=Default +filePermissionsData=Default +filePermissionsLogs=Default +filePermissionsScripts=Default +hideServerMessages=false +hostName= +instanceName= +logDaysToLive=-1 +logLevel=Info +logLevelConsole=Off +logPath={logs}/{date}_{time} +noBytecodeFiles=false +notificationLevel=Off +notificationTasks= +notifiedTasks= +parallelInitialization=false +pythonHome= +pythonNoBytecodeFiles=false +saveCommandStatistics=false +saveConsoleSessionFiles=false +scanFlushRecords=false +scanLazyTableCreation=false +scanPreserveTypes=false +scanReleaseRecords=false +scanSaveLogs=true +scanSaveOutput=false +scanSaveScript=false +scanSaveSetpoints=false +scanSaveTimestamps=false +scanStreamerPort=-1 +serverCommandsHidden=true +serverEnabled=true +serverHostName=null +serverLight=true +serverPort=8080 +sessionHandling=Off +simulation=false +terminalEnabled=false +terminalPort=3579 +userAuthenticator= +userManagement=false +versionTrackingEnabled=true +versionTrackingLogin= +versionTrackingManual=false +versionTrackingRemote= +xscanAppendSuffix=true +xscanContinuousUpdate=false +xscanCrlogicAbortable=true +xscanCrlogicChannel= +xscanCrlogicIoc= +xscanCrlogicPrefix= +xscanCrlogicSimulated=false +xscanMoveTimeout=600 diff --git a/config/devices.properties b/config/devices.properties new file mode 100644 index 0000000..e831de1 --- /dev/null +++ b/config/devices.properties @@ -0,0 +1 @@ +sin=ch.psi.pshell.epics.ChannelDouble|TESTIOC:TESTSINUS:SinCalc|Read||true diff --git a/config/jcae.properties b/config/jcae.properties new file mode 100644 index 0000000..97245f2 --- /dev/null +++ b/config/jcae.properties @@ -0,0 +1,12 @@ +#Wed Mar 19 11:12:57 CET 2025 +ch.psi.jcae.ContextFactory.addressList=localhost\:54321 sls-cagw.psi.ch\:5062 +ch.psi.jcae.ContextFactory.serverPort= +ch.psi.jcae.ContextFactory.maxArrayBytes=20000000 +ch.psi.jcae.ContextFactory.maxSendArrayBytes=20000000 +ch.psi.jcae.ChannelFactory.retries=1 +ch.psi.jcae.ChannelFactory.timeout=3000 +ch.psi.jcae.impl.DefaultChannelService.retries=1 +ch.psi.jcae.impl.DefaultChannelService.timeout=1000 +ch.psi.jcae.ContextFactory.autoAddressList=true +ch.psi.jcae.ContextFactory.useShellVariables=false +ch.psi.jcae.ContextFactory.addLocalBroadcastInterfaces=true diff --git a/config/mail.properties b/config/mail.properties new file mode 100644 index 0000000..dfc1565 --- /dev/null +++ b/config/mail.properties @@ -0,0 +1,9 @@ +#Wed Mar 19 12:00:25 CET 2025 +auth=None +from= +host= +port=0 +pwd= +smsSuffix=@sms.switch.ch +to= +usr= diff --git a/config/plugins.properties b/config/plugins.properties new file mode 100644 index 0000000..c5a342a --- /dev/null +++ b/config/plugins.properties @@ -0,0 +1,3 @@ +YYY.java=disabled +XXX.java=disabled +Test.java=disabled diff --git a/config/preferences.json b/config/preferences.json new file mode 100644 index 0000000..5ef937e --- /dev/null +++ b/config/preferences.json @@ -0,0 +1,132 @@ +{ + "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" : { + "name" : "Menlo", + "style" : 0, + "size" : 14 + }, + "tabSize" : 4, + "contentWidth" : 0, + "editorBackground" : null, + "editorForeground" : null, + "simpleEditor" : false, + "hideEditorLineNumbers" : false, + "hideEditorContextMenu" : false, + "consoleLocation" : "Left", + "dataPanelLocation" : "Status", + "openDataFilesInDocTab" : false, + "noVariableEvaluationPropagation" : false, + "processingScripts" : [ ], + "asyncViewersUpdate" : false, + "asyncHistoryPlotsUpdate" : false, + "scanPlotDisabled" : false, + "scanTableDisabled" : false, + "cachedDataPanel" : false, + "dataExtensions" : "h5 xml txt", + "dataSubFiles" : "", + "showEmergencyStop" : false, + "showHomingButtons" : false, + "showJogButtons" : false, + "hideScanPanel" : false, + "hideOutputPanel" : false, + "showXScanFileBrowser" : true, + "showQueueBrowser" : true, + "backgroundRendering" : false, + "showImageStatusBar" : true, + "persistRendererWindows" : true, + "defaultRendererColormap" : "Grayscale", + "linePlot" : "ch.psi.pshell.plot.LinePlotJFree", + "matrixPlot" : "ch.psi.pshell.plot.MatrixPlotJFree", + "surfacePlot" : "null", + "timePlot" : "ch.psi.pshell.plot.TimePlotJFree", + "plotsDetached" : true, + "plotsHidden" : 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.MasterPositioner", + "panelClassName" : "ch.psi.pshell.swing.MasterPositionerPanel" + }, { + "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.bs.Stream", + "panelClassName" : "ch.psi.pshell.swing.StreamPanel" + }, { + "deviceClassName" : "ch.psi.pshell.bs.StreamChannel", + "panelClassName" : "ch.psi.pshell.swing.StreamChannelPanel" + }, { + "deviceClassName" : "ch.psi.pshell.camserver.CamServerStream", + "panelClassName" : "ch.psi.pshell.swing.CamServerStreamPanel" + }, { + "deviceClassName" : "ch.psi.pshell.camserver.CamServerService", + "panelClassName" : "ch.psi.pshell.swing.CamServerServicePanel" + }, { + "deviceClassName" : "ch.psi.pshell.device.ReadonlyRegister", + "panelClassName" : "ch.psi.pshell.swing.DeviceValueChart" + } ] +} \ No newline at end of file diff --git a/config/variables.properties b/config/variables.properties new file mode 100644 index 0000000..be5bd24 --- /dev/null +++ b/config/variables.properties @@ -0,0 +1,4 @@ +#Mon Jul 14 17:19:57 CEST 2025 +DaySequentialNumber=156 +FileSequentialNumber=456 +LastRunDate=250714 diff --git a/config/xscan.properties b/config/xscan.properties new file mode 100644 index 0000000..7a61cc6 --- /dev/null +++ b/config/xscan.properties @@ -0,0 +1,14 @@ +#Thu Jun 12 14:01:18 CEST 2025 +appendSuffix=true +channelCreationRetries=1 +continuousUpdate=false +crlogicAbortable=true +crlogicChannel= +crlogicIoc= +crlogicPrefix= +crlogicSimulated=false +dataFormat=null +dataLayout=null +dataPath=null +fdaSerialization=false +moveTimeout=600 diff --git a/devices/CameraServer.properties b/devices/CameraServer.properties new file mode 100644 index 0000000..f2ea899 --- /dev/null +++ b/devices/CameraServer.properties @@ -0,0 +1,25 @@ +#Mon May 05 13:14:59 CEST 2025 +colormap=Grayscale +colormapAutomatic=false +colormapLogarithmic=false +colormapMax=NaN +colormapMin=NaN +flipHorizontally=false +flipVertically=false +grayscale=false +invert=false +rescaleFactor=1.0 +rescaleOffset=0.0 +roiHeight=-1 +roiWidth=-1 +roiX=0 +roiY=0 +rotation=0.0 +rotationCrop=false +scale=1.0 +spatialCalOffsetX=NaN +spatialCalOffsetY=NaN +spatialCalScaleX=NaN +spatialCalScaleY=NaN +spatialCalUnits=mm +transpose=false diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties new file mode 100644 index 0000000..31c2ad4 --- /dev/null +++ b/devices/CurrentCamera.properties @@ -0,0 +1,25 @@ +#Thu May 08 14:06:17 CEST 2025 +colormap=Grayscale +colormapAutomatic=false +colormapLogarithmic=false +colormapMax=NaN +colormapMin=NaN +flipHorizontally=false +flipVertically=false +grayscale=false +invert=false +rescaleFactor=1.0 +rescaleOffset=0.0 +roiHeight=-1 +roiWidth=-1 +roiX=0 +roiY=0 +rotation=0.0 +rotationCrop=false +scale=1.0 +spatialCalOffsetX=-637.0000131373355 +spatialCalOffsetY=-483.0000310340799 +spatialCalScaleX=-35.21126791588346 +spatialCalScaleY=-48.38709170854271 +spatialCalUnits=mm +transpose=false diff --git a/devices/dp1.properties b/devices/dp1.properties new file mode 100644 index 0000000..73b3582 --- /dev/null +++ b/devices/dp1.properties @@ -0,0 +1,12 @@ +#Tue Mar 18 14:13:39 CET 2025 +description=null +motor1=0.0|4.0|8.0|0.0 +motor2=0.0|5.0|3.0|NaN +motor3=null +motor4=null +motor5=null +motor6=null +motor7=null +motor8=null +positions=Park|Ready|Out|Clear +precision=-1 diff --git a/devices/m1.properties b/devices/m1.properties new file mode 100644 index 0000000..7832097 --- /dev/null +++ b/devices/m1.properties @@ -0,0 +1,17 @@ +#Tue Mar 18 14:13:39 CET 2025 +defaultSpeed=1.0 +description=null +estbilizationDelay=0 +maxSpeed=10.0 +maxValue=10.0 +minSpeed=0.1 +minValue=-10.0 +monitorByPosition=false +offset=0.0 +precision=2 +resolution=NaN +rotation=false +scale=1.0 +sign_bit=0 +startRetries=1 +unit=mm diff --git a/devices/m2.properties b/devices/m2.properties new file mode 100644 index 0000000..7832097 --- /dev/null +++ b/devices/m2.properties @@ -0,0 +1,17 @@ +#Tue Mar 18 14:13:39 CET 2025 +defaultSpeed=1.0 +description=null +estbilizationDelay=0 +maxSpeed=10.0 +maxValue=10.0 +minSpeed=0.1 +minValue=-10.0 +monitorByPosition=false +offset=0.0 +precision=2 +resolution=NaN +rotation=false +scale=1.0 +sign_bit=0 +startRetries=1 +unit=mm diff --git a/devices/p1.properties b/devices/p1.properties new file mode 100644 index 0000000..d4f7619 --- /dev/null +++ b/devices/p1.properties @@ -0,0 +1,11 @@ +#Tue Mar 18 14:13:39 CET 2025 +description=null +maxValue=1000.0 +minValue=0.0 +offset=0.0 +precision=-1 +resolution=NaN +rotation=false +scale=1.0 +sign_bit=0 +unit=mm diff --git a/devices/src1.properties b/devices/src1.properties new file mode 100644 index 0000000..9cd010f --- /dev/null +++ b/devices/src1.properties @@ -0,0 +1,25 @@ +#Tue Mar 18 14:18:08 CET 2025 +colormap=Temperature +colormapAutomatic=true +colormapLogarithmic=false +colormapMax=NaN +colormapMin=NaN +flipHorizontally=false +flipVertically=false +grayscale=false +invert=false +rescaleFactor=1.0 +rescaleOffset=0.0 +roiHeight=-1 +roiWidth=-1 +roiX=0 +roiY=0 +rotation=0.0 +rotationCrop=false +scale=1.0 +spatialCalOffsetX=NaN +spatialCalOffsetY=NaN +spatialCalScaleX=NaN +spatialCalScaleY=NaN +spatialCalUnits=mm +transpose=false diff --git a/devices/src2.properties b/devices/src2.properties new file mode 100644 index 0000000..ac936d8 --- /dev/null +++ b/devices/src2.properties @@ -0,0 +1,25 @@ +#Tue Mar 18 14:18:08 CET 2025 +colormap=Grayscale +colormapAutomatic=true +colormapLogarithmic=false +colormapMax=NaN +colormapMin=NaN +flipHorizontally=false +flipVertically=false +grayscale=false +invert=false +rescaleFactor=1.0 +rescaleOffset=0.0 +roiHeight=-1 +roiWidth=-1 +roiX=0 +roiY=0 +rotation=0.0 +rotationCrop=false +scale=1.0 +spatialCalOffsetX=NaN +spatialCalOffsetY=NaN +spatialCalScaleX=NaN +spatialCalScaleY=NaN +spatialCalUnits=mm +transpose=false diff --git a/plugins/.DS_Store b/plugins/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/plugins/.DS_Store differ diff --git a/plugins/CCC.form b/plugins/CCC.form new file mode 100644 index 0000000..ff9cfab --- /dev/null +++ b/plugins/CCC.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/CCC.java b/plugins/CCC.java new file mode 100644 index 0000000..9ed3525 --- /dev/null +++ b/plugins/CCC.java @@ -0,0 +1,65 @@ +import ch.psi.pshell.framework.Panel; +import ch.psi.pshell.utils.State; + +/** + * + */ +public class CCC extends Panel { + + public CCC() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + @Override + protected void onTimer() { + } + + @Override + protected void onLoaded() { + + } + + @Override + protected void onUnloaded() { + + } + + //Invoked by 'update()' to update components in the event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 449, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 137, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/plugins/Test.form b/plugins/Test.form new file mode 100644 index 0000000..ff9cfab --- /dev/null +++ b/plugins/Test.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/Test.java b/plugins/Test.java new file mode 100644 index 0000000..8f3c7fe --- /dev/null +++ b/plugins/Test.java @@ -0,0 +1,65 @@ +import ch.psi.pshell.framework.Panel; +import ch.psi.pshell.utils.State; + +/** + * + */ +public class Test extends Panel { + + public Test() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + @Override + protected void onTimer() { + } + + @Override + protected void onLoaded() { + + } + + @Override + protected void onUnloaded() { + + } + + //Invoked by 'update()' to update components in the event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 449, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 137, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/plugins/XXX.form b/plugins/XXX.form new file mode 100644 index 0000000..73fb65f --- /dev/null +++ b/plugins/XXX.form @@ -0,0 +1,58 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/XXX.java b/plugins/XXX.java new file mode 100644 index 0000000..8256aea --- /dev/null +++ b/plugins/XXX.java @@ -0,0 +1,88 @@ + +import ch.psi.pshell.framework.Panel; +import ch.psi.pshell.utils.State; + +/** + * + */ +public class XXX extends Panel { + + public XXX() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + @Override + protected void onTimer() { + } + + @Override + protected void onLoaded() { + + } + + @Override + protected void onUnloaded() { + + } + + //Invoked by 'update()' to update components in the event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + deviceValuePanel1 = new ch.psi.pshell.swing.DeviceValuePanel(); + renderer1 = new ch.psi.pshell.imaging.Renderer(); + + deviceValuePanel1.setDeviceName("sin"); + + renderer1.setDeviceName("src1"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(renderer1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(81, 81, 81) + .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, Short.MAX_VALUE) + .addComponent(renderer1, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(34, 34, 34)) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel1; + private ch.psi.pshell.imaging.Renderer renderer1; + // End of variables declaration//GEN-END:variables +} diff --git a/plugins/YYY.form b/plugins/YYY.form new file mode 100644 index 0000000..ff9cfab --- /dev/null +++ b/plugins/YYY.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/YYY.java b/plugins/YYY.java new file mode 100644 index 0000000..5f6b145 --- /dev/null +++ b/plugins/YYY.java @@ -0,0 +1,65 @@ +import ch.psi.pshell.framework.Panel; +import ch.psi.pshell.utils.State; + +/** + * + */ +public class YYY extends Panel { + + public YYY() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + @Override + protected void onTimer() { + } + + @Override + protected void onLoaded() { + + } + + @Override + protected void onUnloaded() { + + } + + //Invoked by 'update()' to update components in the event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 449, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 137, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/plugins/ZZZ.form b/plugins/ZZZ.form new file mode 100644 index 0000000..ff9cfab --- /dev/null +++ b/plugins/ZZZ.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/ZZZ.java b/plugins/ZZZ.java new file mode 100644 index 0000000..2590eeb --- /dev/null +++ b/plugins/ZZZ.java @@ -0,0 +1,65 @@ +import ch.psi.pshell.framework.Panel; +import ch.psi.pshell.utils.State; + +/** + * + */ +public class ZZZ extends Panel { + + public ZZZ() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + @Override + protected void onTimer() { + } + + @Override + protected void onLoaded() { + + } + + @Override + protected void onUnloaded() { + + } + + //Invoked by 'update()' to update components in the event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 449, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 137, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/script/.DS_Store b/script/.DS_Store new file mode 100644 index 0000000..c197415 Binary files /dev/null and b/script/.DS_Store differ diff --git a/script/listener.py b/script/listener.py new file mode 100644 index 0000000..57ee33f --- /dev/null +++ b/script/listener.py @@ -0,0 +1,47 @@ +""" +Create a device listener to interrupt the scan +""" +import java.lang.InterruptedException + + +class ListenerAO (ch.psi.pshell.device.DeviceListener): + def onStateChanged(self, device, state, former): + pass + def onValueChanged(self, device, value, former): + pass + def onValueChanging(self, device, value, former): + pass + +#Create a listener to the sensor, verifying the readback values. +class ListenerAI (DeviceListener): + def onValueChanged(self, device, value, former): + if value > 1.02: + print "Value over limit-> aborting" + abort() +listenerAI = ListenerAI() +ai1.addListener(listenerAI) + + + +#Create a listener to the positioner checking the setpoint before each command is sent. +class ListenerAO (DeviceListener): + def onStateChanged(self, device, state, former): + pass + def onValueChanged(self, device, value, former): + print "Moved to: " + str(value) + def onValueChanging(self, device, value, former): + if value > 20: + #Vetoing the change will abort the scan + raise Exception("Forbidden move to " + str(value)) + print "Moving to: " + str(value) + " ... " , +listenerAO = ListenerAO() +ao1.addListener(listenerAO) + + +try: + lscan(ao1, (ai1), 0, 40, 200, 0.01) +except java.lang.InterruptedException: + print "Aborted" +finally: + ai1.removeListener(listenerAI) + ao1.removeListener(listenerAO) diff --git a/script/local.groovy b/script/local.groovy new file mode 100644 index 0000000..eef7106 --- /dev/null +++ b/script/local.groovy @@ -0,0 +1,3 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Deployment specific global definitions - executed after startup.groovy +/////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/script/local.js b/script/local.js new file mode 100644 index 0000000..e2eeaad --- /dev/null +++ b/script/local.js @@ -0,0 +1,4 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Deployment specific global definitions - executed after startup.js +/////////////////////////////////////////////////////////////////////////////////////////////////// + diff --git a/script/local.py b/script/local.py new file mode 100644 index 0000000..fafc516 --- /dev/null +++ b/script/local.py @@ -0,0 +1,190 @@ +################################################################################################### +# Deployment specific global definitions - executed after startup.py +################################################################################################### + +import random + +#################################################################################################### +# Simulated Devices +#################################################################################################### + +class AnalogOutput(RegisterBase): + def doRead(self): + return self.val if hasattr(self, 'val') else 0.0 + + def doWrite(self, val): + self.val = val + +class AnalogInput(ReadonlyRegisterBase): + def doRead(self): + time.sleep(0.001) + self.val = to_array(self.calc(), 'd') + return self.val + +class Waveform(ReadonlyRegisterBase, ReadonlyRegisterArray): + def doRead(self): + time.sleep(0.001) + self.val = to_array(self.calc(), 'd') + return self.val + +class Image(ReadonlyRegisterBase, ReadonlyRegisterMatrix): + def doRead(self): + time.sleep(0.001) + self.val = to_array(self.calc(), 'd') + return self.val + + def getWidth(self): + return len(self.take(-1)[0]) + + def getHeight(self): + return len(self.take(-1)) + + + +class Random(AnalogInput): + def calc(self): + return random.random() + + +class SinusoidSample(AnalogInput): + def calc(self): + self.x = self.x + 0.1 if hasattr(self, 'x') else 0.0 + noise = (random.random() - 0.5) / 10.0 + return math.sin(self.x) + noise + +class SinusoidTime(AnalogInput): + def calc(self): + noise = (random.random() - 0.5) / 10.0 + return math.sin(time.time()) + noise + + +class SinusoidWaveform(Waveform): + def calc(self): + ret = [] + x = random.random() + for i in range (20): + ret.append(math.sin(x)) + x = x + 0.1 + return ret + +class SinusoidImage(Image): + def calc(self): + (width, height) = (200, 100) + ret = [] + x = random.random(); + base = [] + for i in range (width): + base.append( math.sin(x)) + x = x + 0.05 + for i in range (height): + noise = (random.random() - 0.5)/5.0 + ret.append([x+noise for x in base]) + return ret + + +#Defintion +add_device(DummyMotor("m1"), True) +add_device(DummyMotor("m2"), True) +add_device(DummyRegister("reg1",3), True) +add_device(AnalogOutput("ao1"), True) +add_device(AnalogOutput("ao2"), True) +add_device(SinusoidSample("ai1"), True) +add_device(SinusoidTime("ai2"), True) +add_device(Random("ai3"), True) +add_device(SinusoidWaveform("wf1"), True) +add_device(SinusoidImage("im1"), True) +add_device(DummyPositioner("p1"),True) +add_device(MotorGroupBase("mg1", m1, m2), True) +add_device(MotorGroupDiscretePositioner("dp1", mg1), True) + + + +#Initial Configuration +if p1.config.unit is None: + p1.config.minValue = 0.0 #Not persisted + p1.config.maxValue = 1000.0 + p1.config.unit = "mm" + p1.config.save() + p1.initialize() + +if dp1.config.positions is None: + dp1.config.positions = ["Park","Ready","Out","Clear"] + dp1.config.motor1 = ["0.0","4.0","8.0" ,"0.0"] + dp1.config.motor2 = ["0.0","5.0","3.0" ,"NaN"] + dp1.config.save() + dp1.initialize() + + + +#Update +m1.setMonitored(True) +m2.setMonitored(True) + + + + +#################################################################################################### +# Simple Readable / Writable objects can be created and used in scans +#################################################################################################### +class WritableScalar(Writable): + def write(self, value): + pass + +class ReadableScalar(Readable): + def read(self): + return random.random() + + +class ReadableWaveform(ReadableArray): + def getSize(self): + return 20 + + def read(self): + ret = [] + for i in range (self.getSize()): + ret.append(random.random()) + return ret + +class ReadableImage(ReadableMatrix): + def read(self): + ret = [] + for i in range (self.getHeight()): + ret.append([random.random()] * self.getWidth()) + return to_array(ret, 'd') + + def getWidth(self): + return 80 + + def getHeight(self): + return 40 + + + +ws1 = WritableScalar() +rs1 = ReadableScalar() +rw1 = ReadableWaveform() +ri1 = ReadableImage() + + +#################################################################################################### +# Imaging +#################################################################################################### + +configured = os.path.exists(Device.getConfigFileName("src1")) + +add_device(RegisterMatrixSource("src1", im1), True) +add_device(RegisterMatrixSource("src2", ri1), True) + +src1.polling = 100 +src2.polling = 100 + +#Some configuration for so the imaging will work out of the box +if not configured: + src1.config.colormapAutomatic = True + src1.config.colormap = Colormap.Temperature + src1.config.save() + src2.config.colormapAutomatic = True + src2.config.save() + + + diff --git a/script/methood.py b/script/methood.py new file mode 100644 index 0000000..618d76e --- /dev/null +++ b/script/methood.py @@ -0,0 +1,2 @@ +def test(): + pass \ No newline at end of file diff --git a/script/test.py b/script/test.py new file mode 100644 index 0000000..02a649b --- /dev/null +++ b/script/test.py @@ -0,0 +1,14 @@ +################################################################################################### +# Demonstrate the use of Line Scan: one or multiple positioners move together linearly. +################################################################################################### + + +#Execute the scan: 100 steps, a1 from 0 to 40 +r1 = lscan(ao1, (ai1,ai2,wf1), 0, 40, 100, 0.01) + +#Steps of size 1.0, a1 from 0 to 40 +r2 = lscan(ao1, (ai1,ai2,wf1), 0, 40, 1.0, 0.01) + +#2 positioners moving together in 10 steps. Also sampling an image: +r3 = lscan((ao1,ao2), (ai1,ai2,wf1,im1), (0, 0), (40, 100), 4, 0.01) + diff --git a/script/test.xml b/script/test.xml new file mode 100644 index 0000000..facf9bb --- /dev/null +++ b/script/test.xml @@ -0,0 +1,29 @@ + + + + alexandre.gobbo@psi.ch + + + My first test + + + + + 0.0 + 31.0 + 1.0 + + + + + + + + + + + + + diff --git a/script/test2.py b/script/test2.py new file mode 100644 index 0000000..b17b2f4 --- /dev/null +++ b/script/test2.py @@ -0,0 +1,11 @@ +################################################################################################### +# Demonstrate the use of Line Scan: one or multiple positioners move together linearly. +################################################################################################### + + +#Execute the scan: 100 steps, a1 from 0 to 40 +r1 = lscan(ao1, (ai1,ai2), 0, 40, 100, 0.01) + + +r2 = lscan(ao1, (ai1,ai2), 0, 40, 100, 0.01) + diff --git a/script/test2.xml b/script/test2.xml new file mode 100644 index 0000000..d330c96 --- /dev/null +++ b/script/test2.xml @@ -0,0 +1,27 @@ + + + + alexandre.gobbo@psi.ch + + + My first test + + + + + 0.0 + 31.0 + 1.0 + + + + + + + + + + + diff --git a/script/test8.xml b/script/test8.xml new file mode 100755 index 0000000..facf9bb --- /dev/null +++ b/script/test8.xml @@ -0,0 +1,29 @@ + + + + alexandre.gobbo@psi.ch + + + My first test + + + + + 0.0 + 31.0 + 1.0 + + + + + + + + + + + + +