boolean enableScanSpeed = config.isEnableScanSpeed();
actionName = writeAttributeLog(CurrentScanDataModel.ENABLESCANSPEED, String.valueOf(enableScanSpeed));
setAttribute(CurrentScanDataModel.ENABLESCANSPEED, enableScanSpeed, false);
// Post scan behaviour.
IPostScanBehaviour postScanBehaviour = config.getScanAddOn().getPostScanBehaviour();
Behaviour behaviour = postScanBehaviour.getBehaviour();
if (behaviour == null) {
behaviour = Behaviour.NOOP;
}
int behaviourType = behaviour.getType();
actionName = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_TYPE, String.valueOf(behaviourType));
setAttribute(CurrentScanDataModel.AFTER_ACTION_TYPE, behaviourType, false);
if (behaviour.getArgumentCount() >= 1) {
int behaviourSensorIndex = postScanBehaviour.getSensor();
actionName = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_SENSOR,
String.valueOf(behaviourSensorIndex));
setAttribute(CurrentScanDataModel.AFTER_ACTION_SENSOR, behaviourSensorIndex, false);
} else if (behaviour.getArgumentCount() >= 2) {
int behaviourActuatorIndex = postScanBehaviour.getActuator();
actionName = writeAttributeLog(CurrentScanDataModel.AFTER_ACTION_ACTUATOR,
String.valueOf(behaviourActuatorIndex));
setAttribute(CurrentScanDataModel.AFTER_ACTION_ACTUATOR, behaviourActuatorIndex, false);
}