use of org.csstudio.trends.databrowser3.model.ArchiveDataSource in project org.csstudio.display.builder by kasemir.
the class ArchivesTableHandler method createColumns.
/**
* Create table columns: Auto-sizable, with label provider and editor
* @param table_layout
* @param operations_manager
* @param archives_table
*/
public void createColumns(TableColumnLayout table_layout, final UndoableActionManager operations_manager, final TableViewer archives_table) {
table_viewer = archives_table;
TableViewerColumn col;
// Archive Name Column ----------
col = TableHelper.createColumn(table_layout, archives_table, Messages.ArchiveName, 100, 20);
col.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final ArchiveDataSource archive = (ArchiveDataSource) cell.getElement();
cell.setText(archive.getName());
}
});
// Archive Key Column ----------
col = TableHelper.createColumn(table_layout, archives_table, Messages.ArchiveKey, 20, 5);
col.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final ArchiveDataSource archive = (ArchiveDataSource) cell.getElement();
cell.setText(Integer.toString(archive.getKey()));
}
});
// Archive Server URL Column ----------
col = TableHelper.createColumn(table_layout, archives_table, Messages.URL, 50, 100);
col.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final ArchiveDataSource archive = (ArchiveDataSource) cell.getElement();
cell.setText(archive.getUrl());
}
});
}
use of org.csstudio.trends.databrowser3.model.ArchiveDataSource in project org.csstudio.display.builder by kasemir.
the class ArchiveFetchJobTest method testMultipleArchives.
/**
* Start ArchiveFetchJob for multiple data sources, one that fails, wait for its completion
*/
@Test(timeout = 60000)
public void testMultipleArchives() throws Exception {
final TestProperties settings = new TestProperties();
String url = settings.getString("archive_rdb_url");
if (url == null) {
System.out.println("Skipped");
return;
}
item = new PVItem("DTL_LLRF:IOC1:Load", 1.0);
// First URL is expected to fail
item.addArchiveDataSource(new ArchiveDataSource("Broken_URL", 1, "failed_test"));
// Second URL should return data
item.addArchiveDataSource(new ArchiveDataSource(url, 1, "test"));
runFetchJob();
}
use of org.csstudio.trends.databrowser3.model.ArchiveDataSource in project org.csstudio.display.builder by kasemir.
the class ArchiveFetchJobTest method testArchiveFetchJob.
/**
* Start ArchiveFetchJob, wait for its completion
*/
@Test(timeout = 60000)
public void testArchiveFetchJob() throws Exception {
final TestProperties settings = new TestProperties();
String url = settings.getString("archive_rdb_url");
if (url == null) {
System.out.println("Skipped");
return;
}
item = new PVItem("DTL_LLRF:IOC1:Load", 1.0);
item.addArchiveDataSource(new ArchiveDataSource(url, 1, "test"));
runFetchJob();
}
use of org.csstudio.trends.databrowser3.model.ArchiveDataSource in project org.csstudio.display.builder by kasemir.
the class ExportTest method createPVItem.
/**
* @return PV with some archive data source
*/
private PVItem createPVItem(final String name) throws Exception {
final PVItem item = new PVItem(name, 1.0);
item.addArchiveDataSource(new ArchiveDataSource(URL, KEY, "test"));
return item;
}
use of org.csstudio.trends.databrowser3.model.ArchiveDataSource in project org.csstudio.display.builder by kasemir.
the class AddArchiveDialogDemo method demoArchiveGUI.
public void demoArchiveGUI() throws Exception {
final Shell shell = new Shell();
final AddArchiveDialog dlg = new AddArchiveDialog(shell);
if (dlg.open() == Window.OK)
for (ArchiveDataSource arch : dlg.getArchives()) System.out.println(arch);
}
Aggregations