use of org.csstudio.csdata.ProcessVariable in project yamcs-studio by yamcs.
the class OpenOPIProbeHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getActiveMenuSelection(event);
ProcessVariable[] pvs = AdapterUtil.convert(selection, ProcessVariable.class);
IPath probeOPIPath = ResourceUtil.getPathFromString("platform:/plugin/org.csstudio.opibuilder/opi/probe.opi");
LinkedHashMap<String, String> macros = new LinkedHashMap<>();
if (pvs.length > 0) {
macros.put(MACRO_NAME, pvs[0].getName());
}
int i = 0;
for (ProcessVariable pv : pvs) {
// $NON-NLS-1$
macros.put(MACRO_NAME + "_" + Integer.toString(i), pv.getName());
i++;
}
MacrosInput macrosInput = new MacrosInput(macros, true);
// Errors in here will show in dialog and error log
RunModeService.openDisplay(probeOPIPath, Optional.of(macrosInput), DisplayMode.NEW_TAB_DETACHED, Optional.empty());
return null;
}
use of org.csstudio.csdata.ProcessVariable in project yamcs-studio by yamcs.
the class ProcessVariableNameTransferDropPVTargetListener method getPVNamesFromTransfer.
@Override
protected String[] getPVNamesFromTransfer() {
if (getCurrentEvent().data == null)
return null;
ProcessVariable[] pvArray = (ProcessVariable[]) getCurrentEvent().data;
List<String> pvList = new ArrayList<String>();
for (ProcessVariable pv : pvArray) {
pvList.add(pv.getName());
}
return pvList.toArray(new String[pvList.size()]);
}
Aggregations