Commit a3350ce9 authored by ics's avatar ics
Browse files

Merge branch V3.1_182 into master

parent 1a981228
...@@ -6,7 +6,11 @@ ...@@ -6,7 +6,11 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path="src/test/resources"/> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
......
3.1.10 DD/MM/YYYY
------
3.1.9 12/10/2018
-----
* Change HashMap to TreeMap so that controller and property combo in generic command boxes are sorted.
3.1.8 DD/MM/YYYY
-----
* Remove deprecated code (since Java 10).
3.1.7 30/08/2018
-----
* Modifications for dynamic properties management.
3.1.6 06/04/2018
-----
* Added more control on the subscriber termination in survey.
3.1.5 06/04/2018
-----
* Do not call logoutAll in login. The call is made in the main application (NomadGUI, etc.).
3.1.4 13/03/2018
-----
* Avoid a NullPointerException when ConfigurationException.controllerName is null.
* Fix bug: Bad initialisation of a for loop command box while launching Nomad while the command zone already contains a for loop command box.
3.1.3 09/01/2018 3.1.3 09/01/2018
----- -----
* Fix bug: when getting servant for a property, Nomad searches among controllers without checking before that the servant is really a controller and not a driver... * Fix bug: when getting servant for a property, Nomad searches among controllers without checking before that the servant is really a controller and not a driver...
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>fr.ill.ics</groupId> <groupId>fr.ill.ics</groupId>
<artifactId>nomadcommandsystem</artifactId> <artifactId>nomadcommandsystem</artifactId>
<version>3.1.4-SNAPSHOT</version> <version>3.1.9</version>
<name>NomadCommandSystem</name> <name>NomadCommandSystem</name>
<description>Java bridge for the communication with the Nomad server</description> <description>Java bridge for the communication with the Nomad server</description>
<scm> <scm>
...@@ -54,13 +54,24 @@ ...@@ -54,13 +54,24 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.protobuf</groupId> <groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId> <artifactId>protobuf-lite</artifactId>
<version>2.6.1</version> <version>3.0.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>fr.ill.ics</groupId> <groupId>fr.ill.ics</groupId>
<artifactId>cameo-api-java-jzmq</artifactId> <artifactId>cameo-api</artifactId>
<version>0.1.2-SNAPSHOT</version> <version>0.1.4</version>
<exclusions>
<exclusion>
<groupId>fr.ill.ics</groupId>
<artifactId>cameo-com-jeromq</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>fr.ill.ics</groupId>
<artifactId>cameo-com-jzmq</artifactId>
<version>0.0.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -25,7 +25,7 @@ import java.util.Map.Entry; ...@@ -25,7 +25,7 @@ import java.util.Map.Entry;
import fr.ill.ics.nscclient.log.LogSubscriber; import fr.ill.ics.nscclient.log.LogSubscriber;
import fr.ill.ics.nscclient.notification.DataNotificationClient; import fr.ill.ics.nscclient.notification.DataNotificationClient;
import fr.ill.ics.nscclient.notification.commandzone.CommandZoneEventClient; import fr.ill.ics.nscclient.notification.commandzone.CommandZoneEventClient;
import fr.ill.ics.nscclient.survey.SurveySubcriberImpl; import fr.ill.ics.nscclient.survey.SurveySubscriberImpl;
public class ChangeManager { public class ChangeManager {
...@@ -56,10 +56,10 @@ public class ChangeManager { ...@@ -56,10 +56,10 @@ public class ChangeManager {
} }
// Iterating the map of survey subscribers // Iterating the map of survey subscribers
Map<String, SurveySubcriberImpl> surveySubscriberMap = SurveySubcriberImpl.getInstances(); Map<String, SurveySubscriberImpl> surveySubscriberMap = SurveySubscriberImpl.getInstances();
Iterator<Entry<String, SurveySubcriberImpl>> it2 = surveySubscriberMap.entrySet().iterator(); Iterator<Entry<String, SurveySubscriberImpl>> it2 = surveySubscriberMap.entrySet().iterator();
while (it2.hasNext()) { while (it2.hasNext()) {
SurveySubcriberImpl surveySubscriber = it2.next().getValue(); SurveySubscriberImpl surveySubscriber = it2.next().getValue();
surveySubscriber.readAndDispatch(); surveySubscriber.readAndDispatch();
} }
} }
......
...@@ -138,7 +138,7 @@ public class ControllerManager implements ServerConfigurationChangeListener { ...@@ -138,7 +138,7 @@ public class ControllerManager implements ServerConfigurationChangeListener {
} }
public HashMap<String, LinkedHashMap<String, String>> getPropertiesForGeneric() { public TreeMap<String, LinkedHashMap<String, String>> getPropertiesForGeneric() {
return ServantManagerAccessor.getInstance(serverId).getPropertiesForGeneric(); return ServantManagerAccessor.getInstance(serverId).getPropertiesForGeneric();
} }
......
...@@ -87,7 +87,7 @@ public class ResourceManager { ...@@ -87,7 +87,7 @@ public class ResourceManager {
public void setFileContent(String controllerType, String fileName, String content) { public void setFileContent(String controllerType, String fileName, String content) {
System.out.println("H.ORTIZ: call to writeResourceFile commented .................................................." + fileName); //System.out.println("H.ORTIZ: call to writeResourceFile commented .................................................." + fileName);
//ServantManagerAccessor.getInstance(serverId).writeResourceFile(controllerType, fileName, content); //ServantManagerAccessor.getInstance(serverId).writeResourceFile(controllerType, fileName, content);
......
...@@ -22,7 +22,7 @@ import java.util.HashMap; ...@@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import fr.ill.ics.bridge.listeners.ServerSurveyXMLListener; import fr.ill.ics.bridge.listeners.ServerSurveyXMLListener;
import fr.ill.ics.nscclient.survey.SurveySubcriberImpl; import fr.ill.ics.nscclient.survey.SurveySubscriberImpl;
public class SurveyEventSender { public class SurveyEventSender {
...@@ -47,11 +47,11 @@ public class SurveyEventSender { ...@@ -47,11 +47,11 @@ public class SurveyEventSender {
* @param listener * @param listener
*/ */
public void addSurveyXMLListener(ServerSurveyXMLListener listener) { public void addSurveyXMLListener(ServerSurveyXMLListener listener) {
SurveySubcriberImpl.getInstance(serverId).addSurveyXMLListener(listener); SurveySubscriberImpl.getInstance(serverId).addSurveyXMLListener(listener);
} }
public void removeSurveyXMLListener(ServerSurveyXMLListener listener) { public void removeSurveyXMLListener(ServerSurveyXMLListener listener) {
SurveySubcriberImpl.getInstance(serverId).removeSurveyXMLListener(listener); SurveySubscriberImpl.getInstance(serverId).removeSurveyXMLListener(listener);
} }
} }
\ No newline at end of file
...@@ -31,9 +31,9 @@ public class Float64Property extends FloatProperty { ...@@ -31,9 +31,9 @@ public class Float64Property extends FloatProperty {
public String getServerValue() { public String getServerValue() {
try { try {
if (isCommandBox) { if (isCommandBox) {
return this.propertyFormat.formatForDisplay(new Double(CommandZoneAccessor.getInstance(serverId).getFloat64Value(containerId, id)).toString()); return this.propertyFormat.formatForDisplay(Double.valueOf(CommandZoneAccessor.getInstance(serverId).getFloat64Value(containerId, id)).toString());
} else { } else {
return this.propertyFormat.formatForDisplay(new Double(DataAccessor.getInstance(serverId).getFloat64Value(containerId, id)).toString()); return this.propertyFormat.formatForDisplay(Double.valueOf(DataAccessor.getInstance(serverId).getFloat64Value(containerId, id)).toString());
} }
} catch (Exception e) { } catch (Exception e) {
System.err.println("Exception while getting value for property " + getName()); System.err.println("Exception while getting value for property " + getName());
...@@ -48,9 +48,9 @@ public class Float64Property extends FloatProperty { ...@@ -48,9 +48,9 @@ public class Float64Property extends FloatProperty {
boolean ok = isOk(serverValue); boolean ok = isOk(serverValue);
if (ok) { if (ok) {
if (isCommandBox) { if (isCommandBox) {
ok = CommandZoneAccessor.getInstance(serverId).setFloat64Value(containerId, id, new Double(serverValue).doubleValue()); ok = CommandZoneAccessor.getInstance(serverId).setFloat64Value(containerId, id, Double.valueOf(serverValue));
} else { } else {
ok = DataAccessor.getInstance(serverId).setFloat64Value(containerId, id, new Double(serverValue).doubleValue()); ok = DataAccessor.getInstance(serverId).setFloat64Value(containerId, id, Double.valueOf(serverValue));
if (!ok) { if (!ok) {
sendPropertyChangedEvent(); sendPropertyChangedEvent();
} }
......
...@@ -30,9 +30,9 @@ public class Int32Property extends IntegerProperty { ...@@ -30,9 +30,9 @@ public class Int32Property extends IntegerProperty {
public String getServerValue() { public String getServerValue() {
if (isCommandBox) { if (isCommandBox) {
return this.propertyFormat.formatForDisplay(new Integer(CommandZoneAccessor.getInstance(serverId).getInt32Value(containerId, id)).toString()); return this.propertyFormat.formatForDisplay(Integer.valueOf(CommandZoneAccessor.getInstance(serverId).getInt32Value(containerId, id)).toString());
} else { } else {
return this.propertyFormat.formatForDisplay(new Integer(DataAccessor.getInstance(serverId).getInt32Value(containerId, id)).toString()); return this.propertyFormat.formatForDisplay(Integer.valueOf(DataAccessor.getInstance(serverId).getInt32Value(containerId, id)).toString());
} }
} }
...@@ -43,9 +43,9 @@ public class Int32Property extends IntegerProperty { ...@@ -43,9 +43,9 @@ public class Int32Property extends IntegerProperty {
boolean ok = isOk(serverValue); boolean ok = isOk(serverValue);
if (ok) { if (ok) {
if (isCommandBox) { if (isCommandBox) {
ok = CommandZoneAccessor.getInstance(serverId).setInt32Value(containerId, id, new Integer(serverValue).intValue()); ok = CommandZoneAccessor.getInstance(serverId).setInt32Value(containerId, id, Integer.valueOf(serverValue));
} else { } else {
ok = DataAccessor.getInstance(serverId).setInt32Value(containerId, id, new Integer(serverValue).intValue()); ok = DataAccessor.getInstance(serverId).setInt32Value(containerId, id, Integer.valueOf(serverValue));
if (!ok) { if (!ok) {
sendPropertyChangedEvent(); sendPropertyChangedEvent();
} }
......
...@@ -64,7 +64,7 @@ public abstract class IntegerProperty extends Property { ...@@ -64,7 +64,7 @@ public abstract class IntegerProperty extends Property {
// String serverValue = this.propertyFormat.unformat(value); // String serverValue = this.propertyFormat.unformat(value);
// if (isOk(serverValue)) { // if (isOk(serverValue)) {
// try { // try {
// abstractController.setValueByLong(name, new Integer(serverValue).intValue()); // abstractController.setValueByLong(name, Integer.valueOf(serverValue));
// showSettingPropertyMessage(value); // showSettingPropertyMessage(value);
// } catch (CannotSetValueException e) { // } catch (CannotSetValueException e) {
// // if the value is refused then update all widgets with the true value. // // if the value is refused then update all widgets with the true value.
......
...@@ -443,7 +443,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand ...@@ -443,7 +443,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
synchronized (lockListeners) { synchronized (lockListeners) {
Iterator<ILockChangedListener> listenerIterator = lockListeners.iterator(); Iterator<ILockChangedListener> listenerIterator = lockListeners.iterator();
while (listenerIterator.hasNext()) { while (listenerIterator.hasNext()) {
((ILockChangedListener) (listenerIterator.next())).lockChanged(new LockEvent(this, isLocked)); listenerIterator.next().lockChanged(new LockEvent(this, isLocked));
} }
} }
} }
...@@ -720,6 +720,12 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand ...@@ -720,6 +720,12 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
} }
public UndoState getUndoState() {
return undoState;
}
public abstract String getType(); public abstract String getType();
/** /**
......
...@@ -284,12 +284,8 @@ public class PropertyManager { ...@@ -284,12 +284,8 @@ public class PropertyManager {
} }
/** public void deleteDynamicPropertyFromController(Controller controller, String propertyName) {
* HashMap<String, DynamicProperty> dynamicProperties = dynamicPropertyMap.get(controller.getDatabaseId());
* @param controller
*/
public void deleteDynamicPropertyFromController(Servant servant, String propertyName) {
HashMap<String, DynamicProperty> dynamicProperties = dynamicPropertyMap.get(servant.getId());
if (dynamicProperties != null) { if (dynamicProperties != null) {
dynamicProperties.remove(propertyName); dynamicProperties.remove(propertyName);
} }
......
...@@ -31,7 +31,7 @@ public class GreaterThanPropertyCondition implements IPropertyCondition { ...@@ -31,7 +31,7 @@ public class GreaterThanPropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) { public boolean isOk(String valueToBeTested) {
try { try {
boolean isOk = (new Double(valueToBeTested).doubleValue() >= value); boolean isOk = (Double.valueOf(valueToBeTested) >= value);
return isOk; return isOk;
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return false; return false;
......
...@@ -31,7 +31,7 @@ public class LowerThanPropertyCondition implements IPropertyCondition { ...@@ -31,7 +31,7 @@ public class LowerThanPropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) { public boolean isOk(String valueToBeTested) {
try { try {
boolean isOk = (new Double(valueToBeTested).doubleValue() <= this.value); boolean isOk = (Double.valueOf(valueToBeTested) <= this.value);
return isOk; return isOk;
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return false; return false;
......
...@@ -25,7 +25,7 @@ public class PositivePropertyCondition implements IPropertyCondition { ...@@ -25,7 +25,7 @@ public class PositivePropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) { public boolean isOk(String valueToBeTested) {
try { try {
boolean isOk = (new Double(valueToBeTested).doubleValue() >= 0); boolean isOk = (Double.valueOf(valueToBeTested) >= 0);
return isOk; return isOk;
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return false; return false;
......
...@@ -33,7 +33,7 @@ public class RangePropertyCondition implements IPropertyCondition { ...@@ -33,7 +33,7 @@ public class RangePropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) { public boolean isOk(String valueToBeTested) {
try { try {
double valueToTest = new Double(valueToBeTested).doubleValue(); double valueToTest = Double.valueOf(valueToBeTested);
return (valueToTest >= minIncluded && valueToTest <= maxIncluded); return (valueToTest >= minIncluded && valueToTest <= maxIncluded);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return false; return false;
......
...@@ -110,9 +110,9 @@ public class RangePropertyDependentCondition implements IPropertyCondition { ...@@ -110,9 +110,9 @@ public class RangePropertyDependentCondition implements IPropertyCondition {
} }
if (minProperty != null && maxProperty != null) { if (minProperty != null && maxProperty != null) {
double minValue = new Double(minProperty.getValue()).doubleValue(); double minValue = Double.valueOf(minProperty.getValue());
double maxValue = new Double(maxProperty.getValue()).doubleValue(); double maxValue = Double.valueOf(maxProperty.getValue());
double valueToTest = new Double(valueToBeTested).doubleValue(); double valueToTest = Double.valueOf(valueToBeTested);
if (minPropertyExcluded && maxPropertyExcluded) { if (minPropertyExcluded && maxPropertyExcluded) {
return (valueToTest > minValue && valueToTest < maxValue); return (valueToTest > minValue && valueToTest < maxValue);
......
...@@ -25,7 +25,7 @@ public class StrictlyPositivePropertyCondition implements IPropertyCondition { ...@@ -25,7 +25,7 @@ public class StrictlyPositivePropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) { public boolean isOk(String valueToBeTested) {
try { try {
boolean isOk = (new Double(valueToBeTested).doubleValue() > 0); boolean isOk = (Double.valueOf(valueToBeTested) > 0);
return isOk; return isOk;
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return false; return false;
......
...@@ -103,7 +103,7 @@ public class DecimalFormat extends PropertyFormat { ...@@ -103,7 +103,7 @@ public class DecimalFormat extends PropertyFormat {
nbOfDecimalPlaces = numberOfDecimalPlaces; nbOfDecimalPlaces = numberOfDecimalPlaces;
} }
if (value.equals((new Double(Double.NaN)).toString()) ) { if (value.equals((Double.valueOf(Double.NaN)).toString()) ) {
return value; return value;
} }
if (value.equals("")) { if (value.equals("")) {
...@@ -112,9 +112,9 @@ public class DecimalFormat extends PropertyFormat { ...@@ -112,9 +112,9 @@ public class DecimalFormat extends PropertyFormat {
double valueAsDouble; double valueAsDouble;
try { try {
valueAsDouble = new Double(Double.parseDouble(value)).doubleValue(); valueAsDouble = Double.valueOf(Double.parseDouble(value));
} catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
LOGGER.logp(Level.SEVERE, this.getClass().getName(), "format", "Trying to format: " + value + " as an double"); LOGGER.logp(Level.SEVERE, this.getClass().getName(), "format", "Trying to format: " + value + " as a double");
return value; return value;
} }
......
...@@ -23,12 +23,12 @@ import java.math.BigInteger; ...@@ -23,12 +23,12 @@ import java.math.BigInteger;
public class HexadecimalFormat extends PropertyFormat { public class HexadecimalFormat extends PropertyFormat {
public String formatForDisplay(String value) { public String formatForDisplay(String value) {
return Integer.toHexString(new Integer(value).intValue()).toUpperCase(); return Integer.toHexString(Integer.valueOf(value)).toUpperCase();
} }
public String unformat(String value) { public String unformat(String value) {
int valueInDecimal = new BigInteger(value, 16).intValue(); int valueInDecimal = new BigInteger(value, 16).intValue();
return new Integer(valueInDecimal).toString(); return Integer.valueOf(valueInDecimal).toString();
} }
// ????? ROBIN // ????? ROBIN
......
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