Commit 3b5924a4 authored by yannick legoc's avatar yannick legoc

Removed checkValue in AutoApplyState.setValue

parent 15f1d16f
3.2.3 07/06/2019
------
* Removed checkValue in AutoApplyState.setValue. Otherwise setting an hexadecimal value is not possible because the value is verified as an expression by the server.
3.2.2 04/06/2019
------
* Added GetWholeDynamicProperties request to get the alias of dynamic properties.
......
......@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadcommandsystem</artifactId>
<version>3.2.2</version>
<version>3.2.3</version>
<name>NomadCommandSystem</name>
<description>Java bridge for the communication with the Nomad server</description>
<scm>
......
......@@ -317,8 +317,6 @@ public class ControllerManager implements ServerConfigurationChangeListener {
// and SettingsSelectionPlugin classes.
if (enable == ClientConfigurationState.PROPERTY) {
ServantManagerAccessor.getInstance(serverId).updateDynamicProperties(servantID);
System.out.println("ServantManagerAccessor updateDynamicProperties " + servantID);
}
}
......
......@@ -49,15 +49,11 @@ public class AutoApplyState extends UndoState {
* Sets server value
*/
public boolean setValue(String value) {
// Validity of the value for the property does not depend on UndoState => call to super class method
boolean ok = checkValue(value);
// First step is ok if the result is accepted.
if (ok) {
// Set the server value.
ok = property.setServerValue(value).isValid();
}
return ok;
// Do not check the value by the server as it is done in the UndoableState.
// Otherwise setting an hexadecimal value is not possible because the value is verified as an expression by the server.
// Only set the server value.
return property.setServerValue(value).isValid();
}
/**
......
......@@ -72,18 +72,18 @@ public abstract class UndoState {
if (result.getStatus() == ExpressionStatus.INVALID_EXPRESSION) {
if (result.getError() == ExpressionError.PARSER_ERROR || result.getError() == ExpressionError.UNDEFINED_VARIABLE_ERROR) {
// Should not occurs here because the error has been detected earlier, in SelectionTree.addToCommandList method
System.out.println(result.getMessage() + " (" + getClass() + ".setValue('" + value.trim() + "'))");
// Should not occur here because the error has been detected earlier, in SelectionTree.addToCommandList method
System.out.println("Unexpected expression error while checking the value : " + result.getMessage() + " for " + value.trim());
ok = false;
} else {
// DISABLED_CONTROLLER_ERROR, ENUMERATED_VALUE_ERROR, UNDEFINED_VARIABLE_ERROR
// Those errors are warnings: the expression is not valid as this time but may be valid later
System.out.println(result.getMessage() + " (" + getClass() + ".setValue('" + value.trim() + "'))");
System.out.println("Expression error while checking the value : " + result.getMessage() + " for " + value.trim());
ok = true;
}
}
else if (result.getStatus() == ExpressionStatus.INVALID_CONSTANT) {
System.out.println(result.getMessage() + " (" + getClass() + ".setValue('" + value.trim() + "'))");
System.out.println("Constant error while checking the value : " + result.getMessage() + " for " + value.trim());
ok = false;
}
return ok;
......
......@@ -229,8 +229,6 @@ public class DataChangeSubscriber {
clientState = ClientConditionState.ON_ACTIVATION_DELAY;
}
System.out.println("condition state changed " + message.getConditionID() + " " + message.getOn() + " " + clientState);
DataNotificationClient.getInstance().conditionStateChanged(message.getConditionID(), message.getOn(), clientState);
}
......@@ -252,13 +250,13 @@ public class DataChangeSubscriber {
}
private void notifyUserVariableValueChanged(UserVariableValueChanged message) {
System.out.println("UserVariableValueChanged " + message.getVariableName() + " : " + message.getValue());
//System.out.println("UserVariableValueChanged " + message.getVariableName() + " : " + message.getValue());
DataNotificationClient.getInstance().variableValueChanged(message.getVariableName(), message.getValue());
}
private void notifyUserVariableStateChanged(UserVariableStateChanged message) {
System.out.println("UserVariableStateChanged " + message.getVariableName() + " : " + message.getState());
//System.out.println("UserVariableStateChanged " + message.getVariableName() + " : " + message.getState());
DataNotificationClient.getInstance().variableStateChanged(message.getVariableName(), message.getState());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment