Search in sources :

Example 6 with FormulaItem

use of org.csstudio.trends.databrowser3.model.FormulaItem in project org.csstudio.display.builder by kasemir.

the class ControllerDemo method createModel.

private void createModel() throws Exception {
    model = new Model();
    model.setMacros(new TestMacros());
    ModelItem item;
    item = new PVItem("$(simu)", 1);
    item.setDisplayName("$(name)");
    item.setAxis(model.addAxis());
    model.addItem(item);
    item = new FormulaItem("math", "sine*0.5+2", new FormulaInput[] { new FormulaInput(item, "sine") });
    item = new PVItem("sim://ramp", 0);
    item.setDisplayName("Ramp (monitored)");
    item.setAxis(model.addAxis());
    model.addItem(item);
    final ArchiveDataSource archive = new ArchiveDataSource("jdbc:oracle:thin:sns_reports/sns@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(ADDRESS=(PROTOCOL=TCP)(HOST=172.31.75.138)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=172.31.75.141)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ics_prod_lba)))", 1, "rdb");
    item = new PVItem("CCL_LLRF:IOC1:Load", 0);
    ((PVItem) item).addArchiveDataSource(archive);
    item.setDisplayName("CCL 1 CPU Load (monitored)");
    item.setAxis(model.addAxis());
    model.addItem(item);
    item = new PVItem("DTL_LLRF:IOC1:Load", 1.0);
    ((PVItem) item).addArchiveDataSource(archive);
    item.setDisplayName("DTL 1 CPU Load (1 sec)");
    item.setAxis(model.addAxis());
    model.addItem(item);
    item = new FormulaItem("calc", "dtl-10", new FormulaInput[] { new FormulaInput(item, "dtl") });
    item.setDisplayName("Lessened Load");
    item.setAxis(model.getAxis(2));
    model.addItem(item);
}
Also used : FormulaItem(org.csstudio.trends.databrowser3.model.FormulaItem) Model(org.csstudio.trends.databrowser3.model.Model) ModelItem(org.csstudio.trends.databrowser3.model.ModelItem) FormulaInput(org.csstudio.trends.databrowser3.model.FormulaInput) ArchiveDataSource(org.csstudio.trends.databrowser3.model.ArchiveDataSource) PVItem(org.csstudio.trends.databrowser3.model.PVItem)

Aggregations

FormulaItem (org.csstudio.trends.databrowser3.model.FormulaItem)6 FormulaInput (org.csstudio.trends.databrowser3.model.FormulaInput)3 PVItem (org.csstudio.trends.databrowser3.model.PVItem)3 Model (org.csstudio.trends.databrowser3.model.Model)2 ArchiveDataSource (org.csstudio.trends.databrowser3.model.ArchiveDataSource)1 AxisConfig (org.csstudio.trends.databrowser3.model.AxisConfig)1 ModelItem (org.csstudio.trends.databrowser3.model.ModelItem)1 AddAxisCommand (org.csstudio.trends.databrowser3.propsheet.AddAxisCommand)1 EditFormulaDialog (org.csstudio.trends.databrowser3.propsheet.EditFormulaDialog)1 MinSizeTableColumnLayout (org.csstudio.ui.util.MinSizeTableColumnLayout)1 TableColumnLayout (org.eclipse.jface.layout.TableColumnLayout)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 MouseEvent (org.eclipse.swt.events.MouseEvent)1 MouseListener (org.eclipse.swt.events.MouseListener)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1