"afterRunActionSensor");
afterRunActionSensor.insert(sensorPosition);
scanServerProxy.write_attribute(afterRunActionSensor);
}
else {
throw new SalsaDeviceException("Error : sensor " + sensor.getName()
+ " is unknow on the scan server " + scanServerName + ".");
}
}
}
if (actuator != null) {
// We need the actuator position.
String actuatorName = actuator.getName();
if (actuatorName != null && !actuatorName.trim().equals("")) {
String[] actuatorsNamesArray = scanServerProxy.read_attribute("actuators")
.extractStringArray();
int actuatorPosition;
for (actuatorPosition = 0; actuatorPosition < actuatorsNamesArray.length; ++actuatorPosition) {
if (actuatorName.equals(actuatorsNamesArray[actuatorPosition])) {
break;
}
}
if (actuatorPosition < actuatorsNamesArray.length) {
DeviceAttribute afterRunActionActuator = new DeviceAttribute(
"afterRunActionActuator");
afterRunActionActuator.insert(actuatorPosition);
scanServerProxy.write_attribute(afterRunActionActuator);
}
else {
throw new SalsaDeviceException("Error : actuator " + actuator.getName()
+ " is unknow on the scan server " + scanServerName + ".");
}
}
}
scanServerProxy.command_inout("ExecuteAction");
}
catch (DevFailed e) {
scanServerManager.invalidateScanServerProxy(scanServerName);
e.printStackTrace();
throw new SalsaDeviceException("Error : cannot perform scan function : "
+ e.getMessage(), e);
}
}