def showSimulation(simu): """ Display Scan Simulation""" SimulationDisplay.show(simu)
#from org.eclipse.jface.dialogs import MessageDialog #MessageDialog.openWarning( # None, "Type", "Type is " + neutrons.__class__.__name__) # Create scan cmds =[ Loop('xpos', min(x0, x1), max(x0, x1), max(0.1, abs(dx)), Loop('ypos', min(y0, y1), max(y0, y1), toggle * max(0.1, abs(dy)), [ Wait('neutrons', neutrons, comparison='increase by'), Log('xpos', 'ypos', 'readback') ] ) ) ] if simu: simulation = scan_client.simulate(cmds) SimulationDisplay.show(SimulationResult(simulation['seconds'], simulation['simulation'])) else: # Submit scan id = scan_client.submit(cmds, "XY Scan") workbench = PlatformUI.getWorkbench() window = workbench.getActiveWorkbenchWindow() page = window.getActivePage() plot = page.showView("org.csstudio.scan.ui.plot.view") plot.selectScan("XY Scan", id) plot.selectDevices("xpos", "ypos") except: showException("XY Scan")
#from org.eclipse.jface.dialogs import MessageDialog #MessageDialog.openWarning( # None, "Type", "Type is " + neutrons.__class__.__name__) # Create scan cmds = [ Loop( 'xpos', min(x0, x1), max(x0, x1), max(0.1, abs(dx)), Loop('ypos', min(y0, y1), max(y0, y1), toggle * max(0.1, abs(dy)), [ Wait('neutrons', neutrons, comparison='increase by'), Log('xpos', 'ypos', 'readback') ])) ] if simu: simulation = scan_client.simulate(cmds) SimulationDisplay.show( SimulationResult(simulation['seconds'], simulation['simulation'])) else: # Submit scan id = scan_client.submit(cmds, "XY Scan") workbench = PlatformUI.getWorkbench() window = workbench.getActiveWorkbenchWindow() page = window.getActivePage() plot = page.showView("org.csstudio.scan.ui.plot.view") plot.selectScan("XY Scan", id) plot.selectDevices("xpos", "ypos") except: showException("XY Scan")