"""Handler for table: Place value fo first column of selected row into a PV """ from org.csstudio.display.builder.runtime.script import PVUtil, ScriptUtil, ValueUtil logger = ScriptUtil.getLogger() # Selection has columns "Row", "Column", "ID", ... id = PVUtil.getTableCell(pvs[0], 0, 2) logger.severe("scripts/handle_selected_id_bob.py id = " + str(id)) if id is not None: # Confirm changing proposal if "IPTS" in pvs[1].getName(): prev = PVUtil.getInt(pvs[1]) if prev != int(id) and \ ScriptUtil.showConfirmationDialog(widget, "Do you want to select #" + str(id) + "?\nThis will affect where experiment data is written."): logger.severe("Confirmed " + pvs[1].getName() + " = " + str(id)) pvs[1].write(int(id)) else: logger.severe("Writing " + pvs[1].getName() + " = " + str(id)) pvs[1].write(int(id)) # Clear selection PV nothing = ValueUtil.createStringTableFromColumns([], []) pvs[0].write(nothing)