diff --git a/plugins/ManipulatorScan.java b/plugins/ManipulatorScan.java index e39f3375..553e97e9 100644 --- a/plugins/ManipulatorScan.java +++ b/plugins/ManipulatorScan.java @@ -120,7 +120,7 @@ public class ManipulatorScan extends Panel { runAsync("ManipulatorScan", args); /* - getController().setExecutingContext("manip_scan"); + getContext().setExecutingContext("manip_scan"); String scan ="lscan(" + comboMotor.getSelectedItem().toString() + ", ( " ; for (Component c : panelSensors.getComponents()) { if ((c instanceof JCheckBox) && ((JCheckBox)c).isSelected()) diff --git a/plugins/PhotonEnergy.java b/plugins/PhotonEnergy.java index 60cbc594..31984839 100644 --- a/plugins/PhotonEnergy.java +++ b/plugins/PhotonEnergy.java @@ -40,13 +40,13 @@ public class PhotonEnergy extends Panel { @Override public void onStart() { super.onStart(); - getController().addScanListener(scanListener); + getContext().addScanListener(scanListener); } @Override public void onStop() { super.onStop(); - getController().removeScanListener(scanListener); + getContext().removeScanListener(scanListener); } @Override diff --git a/plugins/XPSSpectrum.java b/plugins/XPSSpectrum.java index 1fe3ddbc..6b192fd0 100644 --- a/plugins/XPSSpectrum.java +++ b/plugins/XPSSpectrum.java @@ -2,7 +2,7 @@ * Copyright (c) 2014 Paul Scherrer Institute. All rights reserved. */ -import ch.psi.pshell.core.Controller; +import ch.psi.pshell.core.Context; import ch.psi.pshell.device.Device; import ch.psi.pshell.device.DeviceAdapter; import ch.psi.pshell.device.DeviceListener; @@ -220,7 +220,7 @@ public class XPSSpectrum extends Panel { } } - void start() throws Controller.ControllerStateException{ + void start() throws Context.ContextStateException{ HashMap args = new HashMap<>(); args.put("ranges", scanRanges); args.put("pass_energy", Integer.valueOf(comboPass.getSelectedItem().toString())); @@ -600,7 +600,7 @@ public class XPSSpectrum extends Panel { private void btSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSaveActionPerformed try { - JFileChooser chooser = new JFileChooser(getController().getSetup().getContextPath()); + JFileChooser chooser = new JFileChooser(getContext().getSetup().getContextPath()); FileNameExtensionFilter filter = new FileNameExtensionFilter("XPS Spectrum scan definition file", "xps"); chooser.setFileFilter(filter); int rVal = chooser.showSaveDialog(this); @@ -623,7 +623,7 @@ public class XPSSpectrum extends Panel { private void btLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btLoadActionPerformed try { - JFileChooser chooser = new JFileChooser(getController().getSetup().getContextPath()); + JFileChooser chooser = new JFileChooser(getContext().getSetup().getContextPath()); FileNameExtensionFilter filter = new FileNameExtensionFilter("XPS Spectrum scan definition file", "xps"); chooser.setFileFilter(filter); int rVal = chooser.showOpenDialog(this); diff --git a/script/FeCrXPS.py b/script/FeCrXPS.py index 1fef747f..b39235ff 100644 --- a/script/FeCrXPS.py +++ b/script/FeCrXPS.py @@ -39,7 +39,7 @@ spectrum_series = plots[0].getSeries(0) def plot_cur_spectrum(): global spectrum_series try: - while controller.state.running: + while context.state.running: y = Scienta.spectrum.take(100) x = Scienta.spectrumX spectrum_series.setData(x, y) diff --git a/script/XPSSpectrum.py b/script/XPSSpectrum.py index f83b3f96..15c0b45a 100644 --- a/script/XPSSpectrum.py +++ b/script/XPSSpectrum.py @@ -28,7 +28,7 @@ spectrum_series = plots[0].getSeries(0) def plot_cur_spectrum(): global spectrum_series try: - while controller.state.running: + while context.state.running: y = Scienta.spectrum.take(100) x = Scienta.spectrumX spectrum_series.setData(x, y) diff --git a/script/local.py b/script/local.py index 799bc0b2..585ee287 100644 --- a/script/local.py +++ b/script/local.py @@ -328,7 +328,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom Add entry to ELOG. """ if author is None: - author = "pshell" #controller.getUser().name + author = "pshell" #context.getUser().name typ = "pshell" entry = "" @@ -353,7 +353,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom raise Exception(err) print out -def get_plot_snapshots(title = None, file_type = "jpg", temp_path = controller.setup.getContextPath()): +def get_plot_snapshots(title = None, file_type = "jpg", temp_path = context.setup.getContextPath()): """ Returns list with file names of plots snapshots from a plotting context. """ diff --git a/script/test/monitoring.py b/script/test/monitoring.py index 1bcf111f..a78d55bc 100644 --- a/script/test/monitoring.py +++ b/script/test/monitoring.py @@ -1,9 +1,9 @@ -if controller.state == State.Ready: +if context.state == State.Ready: print "Testing..." if not Scienta.state.isInitialized(): print "Try initialize Scienta..." try: - controller.evalLine("Scienta.initialize()") + context.evalLine("Scienta.initialize()") print "Scienta reinit ok" except: print "Scienta reinit failure" @@ -17,7 +17,7 @@ if controller.state == State.Ready: if i >= retries-1: print "Scienta timeout, try initialize..." try: - controller.evalLine("Scienta.initialize()") + context.evalLine("Scienta.initialize()") print "Scienta reinit ok" except: print "Scienta reinit failure"