Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • release_1_5_4
  • release_1_5_5
  • release_1_5_6
  • release_1_5_7
  • release_1_5_8
  • release_1_6_0
  • release_1_6_1
  • release_1_6_2
  • release_1_6_3
  • snapArchivingApi-1.6.4
  • snapArchivingApi-1.6.5
  • snapArchivingApi-1.6.6
  • snapArchivingApi-1.7.0
  • snapArchivingApi-1.7.1
  • snapArchivingApi-1.7.2
  • snapArchivingApi-1.7.3
  • snapArchivingApi-1.7.4
  • snapArchivingApi-1.7.5
  • snapArchivingApi-1.7.6
  • snapArchivingApi-1.7.7
  • snapArchivingApi-1.7.8
  • snapArchivingApi-1.8.0
  • snapArchivingApi-1.8.1
  • snapArchivingApi-1.8.2
  • snapArchivingApi-1.8.3
  • snapArchivingApi-1.8.4
  • trunk
28 results

Target

Select target project
  • software-control-system/tango-controls-archiving/snaparchivingapi
1 result
Select Git revision
  • master
  • release_1_5_4
  • release_1_5_5
  • release_1_5_6
  • release_1_5_7
  • release_1_5_8
  • release_1_6_0
  • release_1_6_1
  • release_1_6_2
  • release_1_6_3
  • snapArchivingApi-1.6.4
  • snapArchivingApi-1.6.5
  • snapArchivingApi-1.6.6
  • snapArchivingApi-1.7.0
  • snapArchivingApi-1.7.1
  • snapArchivingApi-1.7.2
  • snapArchivingApi-1.7.3
  • snapArchivingApi-1.7.4
  • snapArchivingApi-1.7.5
  • snapArchivingApi-1.7.6
  • snapArchivingApi-1.7.7
  • snapArchivingApi-1.7.8
  • snapArchivingApi-1.8.0
  • snapArchivingApi-1.8.1
  • snapArchivingApi-1.8.2
  • snapArchivingApi-1.8.3
  • snapArchivingApi-1.8.4
  • trunk
28 results
Show changes

Commits on Source 2

Showing with 120 additions and 136 deletions
...@@ -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 : PersistencePluginAction.java
*
* Project : TangoParser
*
* Description :
*
* Author : CLAISSE
*
* Original : 25 janv. 07
*
* Revision: Author:
* Date: State:
*
* Log: PersistencePluginAction.java,v
*
*/
/*
* Created on 25 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; package fr.soleil.actiongroup.collectiveaction.onattributes.plugin;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAttributeWrapper; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAttributeWrapper;
...@@ -37,19 +13,13 @@ import fr.soleil.actiongroup.collectiveaction.onattributes.plugin.persistance.Pe ...@@ -37,19 +13,13 @@ import fr.soleil.actiongroup.collectiveaction.onattributes.plugin.persistance.Pe
* <LI> storing the attribute * <LI> storing the attribute
* </UL> * </UL>
* The persistence management is delegated to the chosen IPersistenceManager implementation * The persistence management is delegated to the chosen IPersistenceManager implementation
*
* @author CLAISSE * @author CLAISSE
*/ */
public class PersistencePlugin implements Plugin public class PersistencePlugin implements Plugin {
{
public PersistencePlugin ()
{
} public void execute(PluginContext context, String deviceName, DeviceAttributeWrapper attribute) throws Exception {
public void execute ( PluginContext context, String deviceName, DeviceAttributeWrapper attribute ) throws Exception
{
AnyAttribute anyAttribute = new AnyAttribute(deviceName, attribute); AnyAttribute anyAttribute = new AnyAttribute(deviceName, attribute);
PersistenceContext persistenceContext = context.getPersistenceContext(); PersistenceContext persistenceContext = context.getPersistenceContext();
PersistenceManager manager = persistenceContext.getManager(); PersistenceManager manager = persistenceContext.getManager();
manager.store(anyAttribute, persistenceContext); manager.store(anyAttribute, persistenceContext);
......
...@@ -111,7 +111,7 @@ public class AnyAttribute { ...@@ -111,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;
...@@ -199,8 +199,8 @@ public class AnyAttribute { ...@@ -199,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:
...@@ -270,8 +270,8 @@ public class AnyAttribute { ...@@ -270,8 +270,8 @@ public class AnyAttribute {
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:
......
package fr.soleil.archiving.snap.api.persistence; package fr.soleil.archiving.snap.api.persistence;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.esrf.Tango.AttrDataFormat; import fr.esrf.Tango.AttrDataFormat;
import fr.esrf.Tango.AttrWriteType; import fr.esrf.Tango.AttrWriteType;
import fr.esrf.TangoDs.TangoConst; import fr.esrf.TangoDs.TangoConst;
...@@ -21,6 +16,10 @@ import fr.soleil.archiving.snap.api.persistence.spring.dto.ScStr1Val; ...@@ -21,6 +16,10 @@ import fr.soleil.archiving.snap.api.persistence.spring.dto.ScStr1Val;
import fr.soleil.archiving.snap.api.persistence.spring.dto.ScStr2Val; import fr.soleil.archiving.snap.api.persistence.spring.dto.ScStr2Val;
import fr.soleil.archiving.snap.api.persistence.spring.dto.Sp1Val; import fr.soleil.archiving.snap.api.persistence.spring.dto.Sp1Val;
import fr.soleil.archiving.snap.api.persistence.spring.dto.Sp2Val; import fr.soleil.archiving.snap.api.persistence.spring.dto.Sp2Val;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
public class SpringSnapshotPersistenceManagerImpl implements SnapshotPersistenceManager { public class SpringSnapshotPersistenceManagerImpl implements SnapshotPersistenceManager {
private final Logger logger = LoggerFactory.getLogger(SpringSnapshotPersistenceManagerImpl.class); private final Logger logger = LoggerFactory.getLogger(SpringSnapshotPersistenceManagerImpl.class);
...@@ -33,8 +32,7 @@ public class SpringSnapshotPersistenceManagerImpl implements SnapshotPersistence ...@@ -33,8 +32,7 @@ public class SpringSnapshotPersistenceManagerImpl implements SnapshotPersistence
@Override @Override
public void store(final AnyAttribute attribute, final PersistenceContext persistenceContext) throws Exception { public void store(final AnyAttribute attribute, final PersistenceContext persistenceContext) throws Exception {
final SnapshotPersistenceContext context = (SnapshotPersistenceContext) persistenceContext; final SnapshotPersistenceContext context = (SnapshotPersistenceContext) persistenceContext;
logger.debug(attribute.getCompleteName() + " - values: " logger.debug("storing {} with value: {}", attribute.getCompleteName(), Arrays.toString(attribute.getConvertedStringValuesTable()));
+ Arrays.toString(attribute.getConvertedStringValuesTable()));
switch (attribute.getFormat()) { switch (attribute.getFormat()) {
case AttrDataFormat._SCALAR: case AttrDataFormat._SCALAR:
if (attribute.getWritable() == AttrWriteType._READ) { if (attribute.getWritable() == AttrWriteType._READ) {
......
...@@ -37,14 +37,18 @@ public class ScNum1Val extends Val { ...@@ -37,14 +37,18 @@ public class ScNum1Val extends Val {
public ScNum1Val(AnyAttribute attribute, SnapshotPersistenceContext context) { public ScNum1Val(AnyAttribute attribute, SnapshotPersistenceContext context) {
super(attribute, context); super(attribute, context);
double[] val = attribute.getConvertedNumericValuesTable(); double[] val = attribute.getConvertedNumericValuesTable();
this.value = val[0]; if (val == null) {
value = Double.NaN;
} else {
value = val[0];
}
} }
/** /**
* @return the value * @return the value
*/ */
public double getValue() { public double getValue() {
return this.value; return value;
} }
/** /**
......
...@@ -43,8 +43,13 @@ public class ScNum2Val extends Val { ...@@ -43,8 +43,13 @@ public class ScNum2Val extends Val {
super(attribute, context); super(attribute, context);
double[] val = attribute.getConvertedNumericValuesTable(); double[] val = attribute.getConvertedNumericValuesTable();
this.readValue = val[0]; if (val == null) {
this.writeValue = val[1]; readValue = Double.NaN;
writeValue= Double.NaN;
} else {
readValue = val[0];
writeValue = val[1];
}
} }
/** /**
......
...@@ -36,21 +36,23 @@ public class ScStr1Val extends Val { ...@@ -36,21 +36,23 @@ public class ScStr1Val extends Val {
public ScStr1Val(AnyAttribute attribute, SnapshotPersistenceContext context) { public ScStr1Val(AnyAttribute attribute, SnapshotPersistenceContext context) {
super(attribute, context); super(attribute, context);
String[] val = attribute.getConvertedStringValuesTable(); String[] val = attribute.getConvertedStringValuesTable();
this.value = val[0]; if (val == null) {
value = null;
} else {
value = val[0];
}
} }
/** /**
* @return the value * @return the value
*/ */
public String getValue() { public String getValue() {
return this.value; return value;
} }
/** /**
* @param value * @param value the value to set
* the value to set
*/ */
public void setValue(String value) { public void setValue(String value) {
this.value = value; this.value = value;
......
...@@ -39,9 +39,14 @@ public class ScStr2Val extends Val { ...@@ -39,9 +39,14 @@ public class ScStr2Val extends Val {
super(attribute, context); super(attribute, context);
String[] val = attribute.getConvertedStringValuesTable(); String[] val = attribute.getConvertedStringValuesTable();
if (val == null) {
readValue = null;
writeValue= null;
} else {
this.readValue = val[0]; this.readValue = val[0];
this.writeValue = val[1]; this.writeValue = val[1];
} }
}
/** /**
* @return the readValue * @return the readValue
......