Commit 41f9245c authored by legoc's avatar legoc

Merged master

parents aee0810d a1735e52
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
-----
......
......@@ -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;
}
}
......
......@@ -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();
......
......@@ -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() {
......
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