Skip to content
Snippets Groups Projects
Commit 9c9f3161 authored by Gwenaelle ABEILLE's avatar Gwenaelle ABEILLE
Browse files

add support for uchar & ulong64 (still missing char, long64, int. Not supported by ATK)

parent 7e95d2f4
Branches
Tags
No related merge requests found
......@@ -167,8 +167,7 @@ public class HdbCollectorFactory {
*/
public HdbCollector get(final AttributeLightMode attributeLightMode) {
final SuperMode superMode = new SuperMode(attributeLightMode.getData_format(),
attributeLightMode.getData_type(), attributeLightMode.getWritable(),
attributeLightMode.getMode());
attributeLightMode.getData_type(), attributeLightMode.getWritable(), attributeLightMode.getMode());
return tableCollector.get(superMode);
}
......@@ -179,13 +178,12 @@ public class HdbCollectorFactory {
* @param attributeLightMode
* Attribute associated to the looked collector.
*/
public void createCollectorAndAddSource(final AttributeLightMode attributeLightMode,
final ILogger logger, final DbProxy dbProxy) throws ArchivingException {
public void createCollectorAndAddSource(final AttributeLightMode attributeLightMode, final ILogger logger,
final DbProxy dbProxy) throws ArchivingException {
logger.trace(ILogger.LEVEL_DEBUG, "createCollectorAndAddSource for " + attributeLightMode);
final SuperMode superMode = new SuperMode(attributeLightMode.getData_format(),
attributeLightMode.getData_type(), attributeLightMode.getWritable(),
attributeLightMode.getMode());
attributeLightMode.getData_type(), attributeLightMode.getWritable(), attributeLightMode.getMode());
HdbCollector collector = tableCollector.get(superMode);
if (collector == null) {
logger.trace(ILogger.LEVEL_DEBUG, "new collector ");
......@@ -230,8 +228,7 @@ public class HdbCollectorFactory {
* @return the instance of HdbCollector associated / associable to an
* attribute.
*/
public HdbCollector create(final AttributeLightMode attributeLightMode)
throws ArchivingException {
public HdbCollector create(final AttributeLightMode attributeLightMode) throws ArchivingException {
// System.out.println("HdbCollectorFactory.create\r\n\t" +
// attributeLightMode.toString());
final String name = attributeLightMode.getAttribute_complete_name();
......@@ -254,6 +251,8 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_DOUBLE:
case TangoConst.Tango_DEV_FLOAT:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_ULONG64:
collector = new NumberScalar_RO(modeHandler);
break;
case TangoConst.Tango_DEV_BOOLEAN:
......@@ -266,7 +265,8 @@ public class HdbCollectorFactory {
collector = new StringScalar_RO(modeHandler);
break;
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_LONG64:
case TangoConst.Tango_DEV_INT:
default:
generateException(GlobalConst.DATA_TYPE_EXCEPTION, data_type, name);
}
......@@ -279,6 +279,8 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_DOUBLE:
case TangoConst.Tango_DEV_FLOAT:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_ULONG64:
collector = new NumberScalar_RW(modeHandler);
break;
case TangoConst.Tango_DEV_BOOLEAN:
......@@ -287,9 +289,10 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_STRING:
collector = new StringScalar_RW(modeHandler);
break;
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_STATE:
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_LONG64:
case TangoConst.Tango_DEV_INT:
default:
generateException(GlobalConst.DATA_TYPE_EXCEPTION, data_type, name);
}
......@@ -302,6 +305,8 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_DOUBLE:
case TangoConst.Tango_DEV_FLOAT:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_ULONG64:
collector = new NumberScalar_WO(modeHandler);
break;
case TangoConst.Tango_DEV_BOOLEAN:
......@@ -310,6 +315,9 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_STRING:
collector = new StringScalar_WO(modeHandler);
break;
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_LONG64:
case TangoConst.Tango_DEV_INT:
default:
generateException(GlobalConst.DATA_TYPE_EXCEPTION, data_type, name);
}
......@@ -322,6 +330,8 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_LONG:
case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_DOUBLE:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_ULONG64:
collector = new NumberScalar_RW(modeHandler);
break;
case TangoConst.Tango_DEV_BOOLEAN:
......@@ -330,6 +340,9 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_STRING:
collector = new StringScalar_RW(modeHandler);
break;
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_LONG64:
case TangoConst.Tango_DEV_INT:
default:
generateException(GlobalConst.DATA_TYPE_EXCEPTION, data_type, name);
}
......@@ -351,8 +364,8 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_DOUBLE:
case TangoConst.Tango_DEV_FLOAT:
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_ULONG64:
collector = new NumberSpectrum_RO(modeHandler);
break;
case TangoConst.Tango_DEV_BOOLEAN:
......@@ -361,6 +374,9 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_STRING:
collector = new StringSpectrum_RO(modeHandler);
break;
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_LONG64:
case TangoConst.Tango_DEV_INT:
default:
generateException(GlobalConst.DATA_TYPE_EXCEPTION, data_type, name);
}
......@@ -373,8 +389,8 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_DOUBLE:
case TangoConst.Tango_DEV_FLOAT:
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_ULONG64:
collector = new NumberSpectrum_RO(modeHandler);
break;
case TangoConst.Tango_DEV_BOOLEAN:
......@@ -383,6 +399,9 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_STRING:
collector = new StringSpectrum_RO(modeHandler);
break;
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_LONG64:
case TangoConst.Tango_DEV_INT:
default:
generateException(GlobalConst.DATA_TYPE_EXCEPTION, data_type, name);
}
......@@ -397,8 +416,9 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_DOUBLE:
case TangoConst.Tango_DEV_FLOAT:
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_UCHAR:
case TangoConst.Tango_DEV_ULONG64:
case TangoConst.Tango_DEV_STATE:
collector = new NumberSpectrum_RW(modeHandler);
break;
......@@ -408,6 +428,9 @@ public class HdbCollectorFactory {
case TangoConst.Tango_DEV_STRING:
collector = new StringSpectrum_RW(modeHandler);
break;
case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_LONG64:
case TangoConst.Tango_DEV_INT:
default:
generateException(GlobalConst.DATA_TYPE_EXCEPTION, data_type, name);
}
......@@ -427,8 +450,7 @@ public class HdbCollectorFactory {
public void destroy(final AttributeLightMode attributeLightMode) {
final SuperMode superMode = new SuperMode(attributeLightMode.getData_format(),
attributeLightMode.getData_type(), attributeLightMode.getWritable(),
attributeLightMode.getMode());
attributeLightMode.getData_type(), attributeLightMode.getWritable(), attributeLightMode.getMode());
tableCollector.remove(superMode);
}
......@@ -450,12 +472,11 @@ public class HdbCollectorFactory {
}
// GIACOMO VERSION
public void removeAllForAttribute(final AttributeLightMode attributeLightMode)
throws ArchivingException {
public void removeAllForAttribute(final AttributeLightMode attributeLightMode) throws ArchivingException {
SuperMode superMode;
final HashSet<SuperMode> toRemove = new HashSet<SuperMode>();
superMode = new SuperMode(attributeLightMode.getData_format(), attributeLightMode
.getData_type(), attributeLightMode.getWritable(), attributeLightMode.getMode());
superMode = new SuperMode(attributeLightMode.getData_format(), attributeLightMode.getData_type(),
attributeLightMode.getWritable(), attributeLightMode.getMode());
final HdbCollector collector = tableCollector.get(superMode);
if (collector != null) {
......@@ -513,8 +534,8 @@ public class HdbCollectorFactory {
return ret;
}
private static void generateException(final String cause, final int cause_value,
final String name) throws ArchivingException {
private static void generateException(final String cause, final int cause_value, final String name)
throws ArchivingException {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + cause;
final String reason = "Failed while executing HdbCollectorFactory.create() method...";
final String desc = cause + " (" + cause_value + ") not supported !! [" + name + "]";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment