Skip to content
Snippets Groups Projects
Commit 2571cc6d authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

code readapted to changes in CometeTrend

parent 1da2817c
Branches
Tags
No related merge requests found
......@@ -125,7 +125,6 @@ public class TangoDataSourceBrowser extends AbstractDataSourceProducerBrowser {
canRead = TangoDeviceHelper.isDeviceRunning(completeDeviceName);
}
}
// System.err.println("canRead sourcePath=" + sourcePath + canRead);
return canRead;
}
......@@ -196,7 +195,6 @@ public class TangoDataSourceBrowser extends AbstractDataSourceProducerBrowser {
if (currentKey instanceof TangoKey) {
String alias = getAlias(currentKey);
String deviceName = TangoKeyTool.getDeviceName(currentKey);
// System.out.println("deviceName=" + deviceName);
if (TangoKeyTool.isAnAttribute(currentKey)) {
infoMap = super.getInformations(key);
infoMap.put(LABEL_ATTRIBUTE + "Label", getLabel(currentKey));
......@@ -248,9 +246,6 @@ public class TangoDataSourceBrowser extends AbstractDataSourceProducerBrowser {
}
}
}
// Benchmarker.stop("getInformations");
// System.out.println(Benchmarker.print());
// Benchmarker.reset();
return infoMap;
}
......@@ -491,7 +486,6 @@ public class TangoDataSourceBrowser extends AbstractDataSourceProducerBrowser {
if (currentKey != null) {
// First check alias
description = getAlias(currentKey);
// System.out.println("getalias =" + description);
if ((description == null) || description.trim().isEmpty()) {
description = getTangoDescription(currentKey);
if ((description == null) || description.trim().isEmpty()
......@@ -561,9 +555,6 @@ public class TangoDataSourceBrowser extends AbstractDataSourceProducerBrowser {
if ((dataType != DataType.IMAGE) && (getFormat(attributeKey) != DataFormat.TEXT)) {
child = new ItemTreeNode();
// attributeKey = new TangoKey();
// TangoKeyTool.registerAttribute(attributeKey, deviceName, attributeName);
// TangoKeyTool.registerRefreshed(attributeKey, false);
historyKey = new HistoryKey(attributeKey);
child.setName(attributeName);
child.setData(historyKey);
......@@ -779,7 +770,6 @@ public class TangoDataSourceBrowser extends AbstractDataSourceProducerBrowser {
if (database != null) {
deviceAlias = database.get_alias_from_device(fullNameForDevice);
}
// System.out.println("deviceAlias=" + deviceAlias);
} catch (DevFailed e) {
LOGGER.debug(String.format("Cannot get alias for device %s because %s", deviceName,
TangoExceptionHelper.getErrorMessage(e)), e);
......
......@@ -41,26 +41,25 @@ public class TangoFile {
TrendFile trendFile = new TrendFile(fileName);
chartProperties = trendFile.getChartProperties();
Collection<Entry<IKey, PlotProperties>> knownPlotProperties = trendFile.getKnownPlotProperties();
Collection<Entry<String, PlotProperties>> knownPlotProperties = trendFile.getKnownPlotProperties();
if ((knownPlotProperties != null) && !knownPlotProperties.isEmpty()) {
PlotProperties plotProperties = null;
// AxisPrefix axisPrefix = null;
for (Entry<IKey, PlotProperties> entry : knownPlotProperties) {
IKey key = entry.getKey();
for (Entry<String, PlotProperties> entry : knownPlotProperties) {
String key = entry.getKey();
plotProperties = entry.getValue();
if (plotProperties.getAxisChoice() != TrendFile.AXIS_NONE) {
if (key instanceof HistoryKey) {
trendKeyList.add((HistoryKey) key);
plotPropertiesMap.put(key, plotProperties);
IKey simpleKey = ((HistoryKey) key).getHistory();
String attributeName = TangoKeyTool.getAttributeName(simpleKey);
String deviceName = TangoKeyTool.getDeviceName(simpleKey);
IKey hkey = trendFile.convertToKey(key);
if ((hkey instanceof HistoryKey) && (plotProperties.getAxisChoice() != TrendFile.AXIS_NONE)) {
trendKeyList.add((HistoryKey) hkey);
plotPropertiesMap.put(hkey, plotProperties);
int index = key.lastIndexOf('/');
if (index > 0) {
String attributeName = key.substring(index + 1);
String deviceName = key.substring(0, index);
TangoKey tangoKey = new TangoKey();
TangoKeyTool.registerAttribute(tangoKey, deviceName, attributeName);
simpleKeyList.add(tangoKey);
plotPropertiesMap.put(tangoKey, plotProperties);
}
}
}
......@@ -74,7 +73,6 @@ public class TangoFile {
HistoryKey historyKey = null;
while (((s = br.readLine()) != null) && !s.trim().isEmpty()) {
// System.out.println("Line=" + s);
if (!s.startsWith("#")) {
completeAttributeName = s.trim();
deviceName = TangoDeviceHelper.getDeviceName(completeAttributeName);
......@@ -120,8 +118,7 @@ public class TangoFile {
}
public PlotProperties getPlotProperties(IKey key) {
return plotPropertiesMap.get(key);
return key == null ? null : plotPropertiesMap.get(key);
}
public ChartProperties getChartProperties(IKey key) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment