diff --git a/config/devices.properties b/config/devices.properties index df1253a..df25b3f 100755 --- a/config/devices.properties +++ b/config/devices.properties @@ -14,6 +14,7 @@ stream=ch.psi.pshell.bs.Stream|dispatcher||| #sa=ch.psi.pshell.bs.Scalar|stream SINXB01-RWVG100-DCP10:FOR-AMPLT 10||| cpu_timer=ch.psi.pshell.bs.Scalar|stream SINDI01-RLLE-STA:SLAVE1-CPUTIMER 10 4||| #dl_timer=ch.psi.pshell.bs.Scalar|stream SINDI01-RLLE-STA:SLAVE1-DLTIMER 10||| +amp=ch.psi.pshell.bs.Waveform|stream SINDI01-RCIR-PUP10:SIG-AMPLT 10 4||| #BC1_energy=ch.psi.pshell.epics.ChannelDouble|VA-SINBC02-DBPM140:ENERGY|Read||true #SARUN02_MCRX080=ch.psi.pshell.epics.Positioner|VA-SARUN02-MCRX080:I-SET VA-SARUN02-MCRX080:I-READ|||true #SARUN02_MCRY080=ch.psi.pshell.epics.Positioner|VA-SARUN02-MCRY080:I-SET VA-SARUN02-MCRY080:I-READ|||true diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index 25c7939..0fedd6f 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,13 +1,13 @@ -#Tue Oct 18 21:42:31 CEST 2016 -colormap=Temperature +#Mon Oct 24 14:03:06 CEST 2016 +colormap=Rainbow colormapAutomatic=true colormapMax=0.0 colormapMin=0.0 -flipHorizontally=false -flipVertically=false +flipHorizontally=true +flipVertically=true grayscale=false -imageHeight=770 -imageWidth=1042 +imageHeight=2160 +imageWidth=1936 invert=false rescaleFactor=1.0 rescaleOffset=0.0 @@ -18,9 +18,9 @@ roiY=0 rotation=0.0 rotationCrop=true scale=1.0 -spatialCalOffsetX=-645.9478748685497 -spatialCalOffsetY=-572.3419423291002 -spatialCalScaleX=8.51063829787234 -spatialCalScaleY=-8.235817348324838 +spatialCalOffsetX=-969.0 +spatialCalOffsetY=-1086.0 +spatialCalScaleX=7.802340702210663 +spatialCalScaleY=-7.804878048780488 spatialCalUnits=mm transpose=false diff --git a/plugins/Correlation.java b/plugins/Correlation.java index 80d0063..b0695f9 100644 --- a/plugins/Correlation.java +++ b/plugins/Correlation.java @@ -261,7 +261,12 @@ public class Correlation extends Panel { args.put("bs", checkBS.isSelected()); args.put("p", plot); - runAsync("Correlation/Correlation", args); + runAsync("Correlation/Correlation", args).handle((ok, ex) -> { + if (ex != null) { + ex.printStackTrace(); + } + return ok; + }); } catch (Exception ex) { showException(ex); diff --git a/plugins/ScreenPanel.java b/plugins/ScreenPanel.java index 15e58fa..3b76251 100644 --- a/plugins/ScreenPanel.java +++ b/plugins/ScreenPanel.java @@ -1792,7 +1792,15 @@ public class ScreenPanel extends Panel { //byte[] arr = (byte[]) (((DataBufferByte)(Utils.grayscale(renderer.getImage()).getRaster().getDataBuffer())).getData()); //Object image = Convert.toBidimensional(arr, renderer.getImage().getWidth(), renderer.getImage().getHeight()); //getController().getDataManager().setDataset("/image", image); - elog("ScreenPanel Snapshot", "Data file: " + getController().getExecutionContext().getPath(), new String[]{snapshotFile}); + StringBuilder message = new StringBuilder(); + message.append("Camera: ").append(cameraName).append(" ("). + append((camera instanceof Camtool) ? "camtool" : "direct").append(")").append("\n"); + message.append("Data file: ").append(getController().getExecutionContext().getPath()).append("\n"); + if ((fitOv != null) && (fitOv.length>3)){ + Overlays.Text text = (Overlays.Text) fitOv[3]; + message.append(text.getText()).append("\n"); + } + elog("ScreenPanel Snapshot", message.toString(), new String[]{snapshotFile}); } catch (Exception ex) { ex.printStackTrace(); diff --git a/script/Correlation/Correlation.py b/script/Correlation/Correlation.py index 0837ae0..487a940 100644 --- a/script/Correlation/Correlation.py +++ b/script/Correlation/Correlation.py @@ -8,8 +8,8 @@ import org.apache.commons.math3.stat.correlation.PearsonsCorrelation as Pearsons if get_context().source == CommandSource.ui: #dx = "SINEG01-RLLE-REF10:SIG-PHASE-AVG" #dy = "SINEG01-RLLE-REF20:SIG-PHASE-AVG" - dx = "SINEG01-RGUN-PUP10:SIG-AMPLT-AVG" - dy = "SINEG01-RGUN-PUP20:SIG-AMPLT-AVG" + dx = "SINEG01-RGUN-PUP10:SIG-AMPLT-AVG 4" + dy = "SINEG01-RGUN-PUP20:SIG-AMPLT-AVG 4" #dx = "SINDI01-RKLY-DCP10:REF-AMPLT" #dy = "SINDI01-RKLY-DCP10:REF-PHASE" @@ -26,6 +26,8 @@ if get_context().source == CommandSource.ui: window = 40 p = plot(None)[0] bs = True +print dx +print dy for s in p.getAllSeries(): p.removeSeries(s) @@ -38,7 +40,7 @@ def _get_device(d): global _stream egu = None if isinstance(d, basestring): - name = d + name = d.strip() d = None try: d = get_device(name) @@ -56,11 +58,16 @@ def _get_device(d): except: pass if d is None: + offset = 0 + if " " in name: + tokens = name.split(" ") + name = tokens[0] + offset = int(tokens[1]) if bs == True: if _stream == None: _stream = Stream("corr_stream", dispatcher) instances.append(_stream) - d = _stream.addScalar(name, name, int(interval*100), 0) + d = _stream.addScalar(name, name, int(interval*100), offset) else: d = Channel(name) instances.append(d) diff --git a/script/test/bs.py b/script/test/bs.py index dc771de..0a136ad 100644 --- a/script/test/bs.py +++ b/script/test/bs.py @@ -1,18 +1,23 @@ st1 = Stream("st1", dispatcher) -st1.addScalar("pup10", "SINEG01-RGUN-PUP10:SIG-AMPLT-AVG", 10, 0) -st1.addScalar("pup20", "SINEG01-RGUN-PUP20:SIG-AMPLT-AVG", 10, 0) -st1.addScalar("pup30", "SINEG01-RGUN-PUP30:SIG-AMPLT-AVG", 10, 0) +#st1.addScalar("pup10", "SINEG01-RGUN-PUP10:SIG-AMPLT-AVG", 10, 0) +#st1.addScalar("pup20", "SINEG01-RGUN-PUP20:SIG-AMPLT-AVG", 10, 0) +#st1.addScalar("pup30", "SINEG01-RGUN-PUP30:SIG-AMPLT-AVG", 10, 0) #st1.addScalar("ampli", "SINDI01-RKLY-DCP10:REF-AMPLT", 10, 0) #st1.addScalar("phase", "SINDI01-RKLY-DCP10:REF-PHASE", 10, 0) #st1.addScalar("cput", "SINDI01-RLLE-STA:SLAVE1-CPUTIMER", 10, 0) #st1.addScalar("dlt", "SINDI01-RLLE-STA:SLAVE1-DLTIMER", 10, 0) #st1.addScalar("dlt", "SINDI01-RKLY-DCP10:REF-AMPLT-AVG", 10, 0) +st1.addScalar("scpu", "SINDI01-RLLE-STA:SLAVE1-CPUTIMER", 10, 4) +st1.addScalar("mcpu", "SINDI01-RLLE-STA:MASTER-CPUTIMER", 10, 4) + +st1.addWaveform("amp", "SINDI01-RCIR-PUP10:SIG-AMPLT", 10, 4) + st1.initialize() st1.start() -try: - tscan (st1.getReadables(), 10, 1, title="tscan") +try: bscan (st1, 10, title="bscan") + tscan (st1.getReadables(), 10, 1, title="tscan") finally: st1.close()