diff --git a/ChangeLog b/ChangeLog index 5384f5eff47856f6536600643a8030ac9ddca172..72526e1ac981672b8888ce092b072fea184265ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ -3.1.10 DD/MM/YYYY +3.2.1 DD/MM/YYYY ------ +* Overwritten equals method in Property class. + +3.2.0 11/02/2019 +------ +* Implementation of expressions and variables. 3.1.9 12/10/2018 ----- diff --git a/src/main/java/fr/ill/ics/core/property/Int32Property.java b/src/main/java/fr/ill/ics/core/property/Int32Property.java index 14b767f24808c27bd2ade6ab799977c7ef7be92a..eff8934c7eff4bb9adf20d0a13daf50da2cb7f6d 100644 --- a/src/main/java/fr/ill/ics/core/property/Int32Property.java +++ b/src/main/java/fr/ill/ics/core/property/Int32Property.java @@ -33,6 +33,9 @@ public class Int32Property extends IntegerProperty { return true; } catch (NumberFormatException e) { + if (getPropertyFormat().acceptsValue(value)) { // Case of hexadecimal integer value + return true; + } return false; } } diff --git a/src/main/java/fr/ill/ics/core/property/Property.java b/src/main/java/fr/ill/ics/core/property/Property.java index 424c3068c2f989888e695ca03c453211adf5cbbc..e9b8ac426627708750fceddedb0c96e08cf83e05 100644 --- a/src/main/java/fr/ill/ics/core/property/Property.java +++ b/src/main/java/fr/ill/ics/core/property/Property.java @@ -902,6 +902,18 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand } + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Property other = (Property)obj; + return id == other.getPropertyID(); + } + public abstract String getType(); diff --git a/src/main/java/fr/ill/ics/nscclient/command/CommandZoneAccessor.java b/src/main/java/fr/ill/ics/nscclient/command/CommandZoneAccessor.java index ae22e5a466c4bbe91b88674dbd27ef7671ea2f98..ba3e7b57d78e77f83a66a165477c02653fb52431 100644 --- a/src/main/java/fr/ill/ics/nscclient/command/CommandZoneAccessor.java +++ b/src/main/java/fr/ill/ics/nscclient/command/CommandZoneAccessor.java @@ -2688,6 +2688,45 @@ public class CommandZoneAccessor { return 1; } + + public String[] getVariableList(int commandBoxID) { + + // Create the message type. + CommandZoneRequests.Message type = CommandZoneRequests.Message.newBuilder() + .setType(CommandZoneRequests.Message.Type.GetVariableList) + .build(); + + // Create the request. + CommandZoneRequests.CommandBoxRequest request = CommandZoneRequests.CommandBoxRequest.newBuilder() + .setCommandBoxID(commandBoxID) + .build(); + + commandBoxRequester.sendTwoParts(type.toByteArray(), request.toByteArray()); + + try { + Common.StringArrayResponse response = Common.StringArrayResponse.parseFrom(commandBoxRequester.receive()); + + // Test the error. + if (response.hasError()) { + processError(response.getError(), commandBoxID); + } + else { + int size = response.getValueCount(); + String[] result = new String[size]; + + for (int i = 0; i < size; ++i) { + result[i] = response.getValue(i); + } + + return result; + } + } + catch (InvalidProtocolBufferException e) { + LOGGER.logp(Level.WARNING, this.getClass().getName(), "getVariableList", "error in parsing response for command box " + commandBoxID); + } + + return null; + } public int create() {