use of org.yamcs.protobuf.Mdb.ParameterInfo in project yamcs-studio by yamcs.
the class AddNewParameterAction method run.
@Override
public void run() {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
AddParameterWizard wizard = new AddParameterWizard();
WizardDialog dialog = new WizardDialog(shell, wizard);
if (dialog.open() == Window.OK)
for (ParameterInfo info : wizard.getParameter()) viewer.addParameter(info);
}
use of org.yamcs.protobuf.Mdb.ParameterInfo in project yamcs-studio by yamcs.
the class PVCatalogue method mdbUpdated.
@Override
public void mdbUpdated() {
pvReadersById.forEach((id, pvReader) -> {
ParameterInfo parameter = ParameterCatalogue.getInstance().getParameterInfo(id);
if (log.isLoggable(Level.FINER)) {
log.finer(String.format("Signaling %s --> %s", id, parameter));
}
pvReader.processConnectionInfo(new PVConnectionInfo(true, parameter));
});
}
use of org.yamcs.protobuf.Mdb.ParameterInfo in project yamcs-studio by yamcs.
the class AlphaNumericEditor method createPartControl.
@Override
public void createPartControl(Composite parent) {
FillLayout fl = new FillLayout();
fl.marginHeight = 0;
fl.marginWidth = 0;
parent.setLayout(fl);
SashForm sash = new SashForm(parent, SWT.VERTICAL);
Composite tableWrapper = new Composite(sash, SWT.NONE);
tableWrapper.setLayoutData(new GridData(GridData.FILL_BOTH));
parameterTable = new ParameterTableViewer(tableWrapper);
ParameterContentProvider provider = (ParameterContentProvider) parameterTable.getContentProvider();
provider.load(loadData());
for (ParameterInfo info : loadData()) parameterTable.addParameter(info);
parameterTable.refresh();
}
use of org.yamcs.protobuf.Mdb.ParameterInfo in project yamcs-studio by yamcs.
the class AlphaNumericEditor method saveToStream.
/**
* Save current model, mark editor as clean.
*
* @param stream
* Output stream
*/
private void saveToStream(List<ParameterInfo> parameters, OutputStream stream) {
final PrintWriter out = new PrintWriter(stream);
try {
for (ParameterInfo info : parameters) out.println(info.getQualifiedName());
ParameterContentProvider provider = (ParameterContentProvider) parameterTable.getContentProvider();
provider.load(new ArrayList<>(provider.getParameter()));
firePropertyChange(IEditorPart.PROP_DIRTY);
} catch (Exception ex) {
ExceptionDetailsErrorDialog.openError(getSite().getShell(), "Error while writing parameter list", ex);
} finally {
out.close();
}
}
Aggregations