Skip to content
Snippets Groups Projects
Commit f3b3cd79 authored by gwen-soleil's avatar gwen-soleil
Browse files

recommit e55b3538 that was removed by commit...

recommit e55b3538 that was removed by commit 0c5e16e1
parent cbb8db56
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,7 @@ public class DeviceAttributeWrapper { ...@@ -122,7 +122,7 @@ public class DeviceAttributeWrapper {
return this.attribute.getQuality(); return this.attribute.getQuality();
} }
public DevState extractState() throws DevFailed { public DevState[] extractDevStateArray() throws DevFailed {
return attribute.extractState(); return attribute.extractDevStateArray();
} }
} }
/* Synchrotron Soleil
*
* File : AnyAttribute.java
*
* Project : TangoParser
*
* Description :
*
* Author : CLAISSE
*
* Original : 17 janv. 07
*
* Revision: Author:
* Date: State:
*
* Log: AnyAttribute.java,v
*
*/
/*
* Created on 17 janv. 07
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.onattributes.plugin.persistance; package fr.soleil.actiongroup.collectiveaction.onattributes.plugin.persistance;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -14,8 +38,7 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.TangoCons ...@@ -14,8 +38,7 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.TangoCons
* @author CLAISSE * @author CLAISSE
*/ */
public class AnyAttribute { public class AnyAttribute {
final static Logger logger = LoggerFactory.getLogger(AnyAttribute.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AnyAttribute.class);
private static final String SPECTRUM_SEPARATOR = ","; private static final String SPECTRUM_SEPARATOR = ",";
...@@ -88,7 +111,7 @@ public class AnyAttribute { ...@@ -88,7 +111,7 @@ public class AnyAttribute {
/** /**
* The attribute's State value * The attribute's State value
*/ */
private DevState rawValueState; private DevState[] rawValueState;
private final int numberOfComponents; private final int numberOfComponents;
...@@ -176,8 +199,8 @@ public class AnyAttribute { ...@@ -176,8 +199,8 @@ public class AnyAttribute {
break; break;
case TangoConst.Tango_DEV_STATE: case TangoConst.Tango_DEV_STATE:
rawValueState = attribute.extractState(); rawValueState = attribute.extractDevStateArray();
_numberOfComponents = 1; _numberOfComponents = rawValueState == null ? 0 : rawValueState.length;
break; break;
case TangoConst.Tango_DEV_STRING: case TangoConst.Tango_DEV_STRING:
...@@ -185,7 +208,7 @@ public class AnyAttribute { ...@@ -185,7 +208,7 @@ public class AnyAttribute {
_numberOfComponents = rawValueString == null ? 0 : rawValueString.length; _numberOfComponents = rawValueString == null ? 0 : rawValueString.length;
break; break;
default: default:
LOGGER.error("NO EXTRACTION " + attribute.getName()); logger.error("NO EXTRACTION " + attribute.getName());
} }
return _numberOfComponents; return _numberOfComponents;
} }
...@@ -207,7 +230,7 @@ public class AnyAttribute { ...@@ -207,7 +230,7 @@ public class AnyAttribute {
// stored // stored
// as // as
// 0/1 // 0/1
convertedStringValuesTable[i] = Boolean.toString(rawValueBoolean[i]); // for convertedStringValuesTable[i] = rawValueBoolean[i] + ""; // for
// spectrums // spectrums
// which // which
// are // are
...@@ -218,37 +241,37 @@ public class AnyAttribute { ...@@ -218,37 +241,37 @@ public class AnyAttribute {
case TangoConst.Tango_DEV_DOUBLE: case TangoConst.Tango_DEV_DOUBLE:
convertedNumericValuesTable[i] = rawValueDouble[i]; convertedNumericValuesTable[i] = rawValueDouble[i];
convertedStringValuesTable[i] = Double.toString(rawValueDouble[i]); convertedStringValuesTable[i] = rawValueDouble[i] + "";
break; break;
case TangoConst.Tango_DEV_FLOAT: case TangoConst.Tango_DEV_FLOAT:
convertedNumericValuesTable[i] = rawValueFloat[i]; convertedNumericValuesTable[i] = rawValueFloat[i];
convertedStringValuesTable[i] = Float.toString(rawValueFloat[i]); convertedStringValuesTable[i] = rawValueFloat[i] + "";
break; break;
case TangoConst.Tango_DEV_LONG: case TangoConst.Tango_DEV_LONG:
case TangoConst.Tango_DEV_INT: case TangoConst.Tango_DEV_INT:
case TangoConst.Tango_DEV_USHORT: case TangoConst.Tango_DEV_USHORT:
convertedNumericValuesTable[i] = rawValueInt[i]; convertedNumericValuesTable[i] = rawValueInt[i];
convertedStringValuesTable[i] = Integer.toString(rawValueInt[i]); convertedStringValuesTable[i] = rawValueInt[i] + "";
break; break;
case TangoConst.Tango_DEV_ULONG: case TangoConst.Tango_DEV_ULONG:
case TangoConst.Tango_DEV_ULONG64: case TangoConst.Tango_DEV_ULONG64:
case TangoConst.Tango_DEV_LONG64: case TangoConst.Tango_DEV_LONG64:
convertedNumericValuesTable[i] = rawValueLong[i]; convertedNumericValuesTable[i] = rawValueLong[i];
convertedStringValuesTable[i] = Long.toString(rawValueLong[i]); convertedStringValuesTable[i] = rawValueLong[i] + "";
break; break;
case TangoConst.Tango_DEV_SHORT: case TangoConst.Tango_DEV_SHORT:
case TangoConst.Tango_DEV_CHAR: case TangoConst.Tango_DEV_CHAR:
case TangoConst.Tango_DEV_UCHAR: case TangoConst.Tango_DEV_UCHAR:
convertedNumericValuesTable[i] = rawValueShort[i]; convertedNumericValuesTable[i] = rawValueShort[i];
convertedStringValuesTable[i] = Short.toString(rawValueShort[i]); convertedStringValuesTable[i] = rawValueShort[i] + "";
break; break;
case TangoConst.Tango_DEV_STATE: case TangoConst.Tango_DEV_STATE:
convertedNumericValuesTable[i] = rawValueState.value(); convertedNumericValuesTable[i] = rawValueState[i].value();
convertedStringValuesTable[i] = TangoConst.Tango_DevStateName[rawValueState.value()]; convertedStringValuesTable[i] = rawValueState[i].value()+"";
break; break;
case TangoConst.Tango_DEV_STRING: case TangoConst.Tango_DEV_STRING:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment