Closedown

This commit is contained in:
x03daop
2016-12-22 15:52:41 +01:00
parent b05ae21305
commit 1c18b78ebb
7 changed files with 14 additions and 14 deletions

View File

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

View File

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

View File

@@ -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<String, Object> 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);

View File

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

View File

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

View File

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

View File

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