return actuatorTrajectoriesList;
}
public IScanResult retrieveCommonScanResult() throws SalsaDeviceException {
// System.out.println(this.getClass().getName() + ".retrieveCommonScanResult");
IScanResult scanResult = null;
DeviceProxy scanServerProxy = TangoDeviceHelper.getDeviceProxy(scanServerName);
if (scanServerProxy != null) {
if (isScanResultReady()) {
try {
// Type
actionName = "read_attribute(\"" + CurrentScanDataModel.SCAN_TYPE + "\")";
DeviceAttribute scanTypeAttribute = scanServerProxy
.read_attribute(CurrentScanDataModel.SCAN_TYPE);
int scanType = scanTypeAttribute.extractLong();
// 0 -> time scan
// 1 -> scan 1d
// 2 -> scan 2d
switch (scanType) {
case 0:
scanResult = new ScanResultImpl();
scanResult.setResultType(IScanResult.ResultType.RESULT_TIMESCAN);
break;
case 1:
scanResult = new ScanResult1DImpl();
scanResult.setResultType(IScanResult.ResultType.RESULT_1D);
break;
case 2:
scanResult = new ScanResult2DImpl();
scanResult.setResultType(IScanResult.ResultType.RESULT_2D);
break;
}
if (scanResult != null) {
scanResult.setScanServer(scanServerName);
// Name.
actionName = "read_attribute(\"" + CurrentScanDataModel.RUN_NAME + "\")";
scanResult.setRunName(CurrentScanDataModel.readRunName(scanServerName));
CurrentScanDataModel.updateAttributeInfo(scanServerName);
// Sensors
actionName = "read_attribute(\"" + CurrentScanDataModel.SENSORS_DATA_LIST
+ "\")";
String[] sensorsValueKeysArray = CurrentScanDataModel
.getSensors(scanServerName);
ISensor sensor = null;
String sensorName = null;
String entityName = null;
if (sensorsValueKeysArray != null) {
for (String sensorValueKey : sensorsValueKeysArray) {
entityName = TangoDeviceHelper.getEntityName(sensorValueKey);
sensorName = TangoAttributeHelper.getLabel(scanServerName,
entityName);
sensor = new SensorImpl();
sensor.setName(sensorName);
sensor.setEnabled(true);
scanResult.getSensorsList().add(sensor);
sensor.setScanServerAttributeName(sensorValueKey);
}
}
// Actuators dimension X
actionName = "read_attribute(\"" + CurrentScanDataModel.ACTUATORS_DATA_LIST
+ " " + CurrentScanDataModel.YACTUATORS_DATA_LIST + "\")";
String[] actuatorsValueKeysArray = CurrentScanDataModel
.getActuators(scanServerName);
IActuator actuator = null;
String actuatorName = null;
List<IActuator> actuatorList = null;
if (actuatorsValueKeysArray != null) {
for (String actuatorValueKey : actuatorsValueKeysArray) {
entityName = TangoDeviceHelper.getEntityName(actuatorValueKey);
actuatorName = TangoAttributeHelper.getLabel(scanServerName,
entityName);
actuator = new ActuatorImpl();
actuator.setName(actuatorName);
actuator.setEnabled(true);
// X Actuator
if (entityName.startsWith("actuator_1")) {
actuatorList = scanResult.getActuatorsXList();
}
else if (entityName.startsWith("actuator_2")
&& scanResult instanceof IScanResult2D) {
actuatorList = ((IScanResult2D) scanResult).getActuatorsYList();
}