Search in sources :

Example 11 with ParameterInfo

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);
}
Also used : AddParameterWizard(org.yamcs.studio.ui.alphanum.AddParameterWizard) Shell(org.eclipse.swt.widgets.Shell) ParameterInfo(org.yamcs.protobuf.Mdb.ParameterInfo) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 12 with ParameterInfo

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));
    });
}
Also used : PVConnectionInfo(org.yamcs.studio.css.core.pvmanager.PVConnectionInfo) ParameterInfo(org.yamcs.protobuf.Mdb.ParameterInfo)

Example 13 with ParameterInfo

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();
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) ParameterInfo(org.yamcs.protobuf.Mdb.ParameterInfo)

Example 14 with ParameterInfo

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();
    }
}
Also used : ParameterInfo(org.yamcs.protobuf.Mdb.ParameterInfo) CoreException(org.eclipse.core.runtime.CoreException) PartInitException(org.eclipse.ui.PartInitException) IOException(java.io.IOException) PrintWriter(java.io.PrintWriter)

Aggregations

ParameterInfo (org.yamcs.protobuf.Mdb.ParameterInfo)14 ArrayList (java.util.ArrayList)4 PVConnectionInfo (org.yamcs.studio.css.core.pvmanager.PVConnectionInfo)3 IOException (java.io.IOException)2 List (java.util.List)2 CoreException (org.eclipse.core.runtime.CoreException)2 ColumnLabelProvider (org.eclipse.jface.viewers.ColumnLabelProvider)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)2 NamedObjectId (org.yamcs.protobuf.Yamcs.NamedObjectId)2 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 BufferedReader (java.io.BufferedReader)1 InputStreamReader (java.io.InputStreamReader)1 PrintWriter (java.io.PrintWriter)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Collections (java.util.Collections)1 Date (java.util.Date)1 Iterator (java.util.Iterator)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Level (java.util.logging.Level)1