Search in sources :

Example 21 with ArchiveDataSource

use of org.csstudio.trends.databrowser3.model.ArchiveDataSource 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

ArchiveDataSource (org.csstudio.trends.databrowser3.model.ArchiveDataSource)17 PVItem (org.csstudio.trends.databrowser3.model.PVItem)8 ArrayList (java.util.ArrayList)6 ChannelInfo (org.csstudio.trends.databrowser3.model.ChannelInfo)4 TestProperties (org.csstudio.apputil.test.TestProperties)3 Test (org.junit.Test)3 ArchiveReader (org.csstudio.archive.reader.ArchiveReader)2 AxisConfig (org.csstudio.trends.databrowser3.model.AxisConfig)2 FormulaItem (org.csstudio.trends.databrowser3.model.FormulaItem)2 ModelItem (org.csstudio.trends.databrowser3.model.ModelItem)2 AddAxisCommand (org.csstudio.trends.databrowser3.propsheet.AddAxisCommand)2 CellLabelProvider (org.eclipse.jface.viewers.CellLabelProvider)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)2 ViewerCell (org.eclipse.jface.viewers.ViewerCell)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Button (org.eclipse.swt.widgets.Button)2 PartInitException (org.eclipse.ui.PartInitException)2 PrintWriter (java.io.PrintWriter)1