Commit a3350ce9 authored by ics's avatar ics
Browse files

Merge branch V3.1_182 into master

parent 1a981228
......@@ -6,7 +6,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</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">
<attributes>
<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
-----
* 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 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadcommandsystem</artifactId>
<version>3.1.4-SNAPSHOT</version>
<version>3.1.9</version>
<name>NomadCommandSystem</name>
<description>Java bridge for the communication with the Nomad server</description>
<scm>
......@@ -54,13 +54,24 @@
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>2.6.1</version>
<artifactId>protobuf-lite</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>fr.ill.ics</groupId>
<artifactId>cameo-api-java-jzmq</artifactId>
<version>0.1.2-SNAPSHOT</version>
<artifactId>cameo-api</artifactId>
<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>
</dependencies>
<build>
......
......@@ -25,7 +25,7 @@ import java.util.Map.Entry;
import fr.ill.ics.nscclient.log.LogSubscriber;
import fr.ill.ics.nscclient.notification.DataNotificationClient;
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 {
......@@ -56,10 +56,10 @@ public class ChangeManager {
}
// Iterating the map of survey subscribers
Map<String, SurveySubcriberImpl> surveySubscriberMap = SurveySubcriberImpl.getInstances();
Iterator<Entry<String, SurveySubcriberImpl>> it2 = surveySubscriberMap.entrySet().iterator();
Map<String, SurveySubscriberImpl> surveySubscriberMap = SurveySubscriberImpl.getInstances();
Iterator<Entry<String, SurveySubscriberImpl>> it2 = surveySubscriberMap.entrySet().iterator();
while (it2.hasNext()) {
SurveySubcriberImpl surveySubscriber = it2.next().getValue();
SurveySubscriberImpl surveySubscriber = it2.next().getValue();
surveySubscriber.readAndDispatch();
}
}
......
......@@ -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();
}
......
......@@ -87,7 +87,7 @@ public class ResourceManager {
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);
......
......@@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.Map;
import fr.ill.ics.bridge.listeners.ServerSurveyXMLListener;
import fr.ill.ics.nscclient.survey.SurveySubcriberImpl;
import fr.ill.ics.nscclient.survey.SurveySubscriberImpl;
public class SurveyEventSender {
......@@ -47,11 +47,11 @@ public class SurveyEventSender {
* @param listener
*/
public void addSurveyXMLListener(ServerSurveyXMLListener listener) {
SurveySubcriberImpl.getInstance(serverId).addSurveyXMLListener(listener);
SurveySubscriberImpl.getInstance(serverId).addSurveyXMLListener(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 {
public String getServerValue() {
try {
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 {
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) {
System.err.println("Exception while getting value for property " + getName());
......@@ -48,9 +48,9 @@ public class Float64Property extends FloatProperty {
boolean ok = isOk(serverValue);
if (ok) {
if (isCommandBox) {
ok = CommandZoneAccessor.getInstance(serverId).setFloat64Value(containerId, id, new Double(serverValue).doubleValue());
ok = CommandZoneAccessor.getInstance(serverId).setFloat64Value(containerId, id, Double.valueOf(serverValue));
} else {
ok = DataAccessor.getInstance(serverId).setFloat64Value(containerId, id, new Double(serverValue).doubleValue());
ok = DataAccessor.getInstance(serverId).setFloat64Value(containerId, id, Double.valueOf(serverValue));
if (!ok) {
sendPropertyChangedEvent();
}
......
......@@ -30,9 +30,9 @@ public class Int32Property extends IntegerProperty {
public String getServerValue() {
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 {
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 {
boolean ok = isOk(serverValue);
if (ok) {
if (isCommandBox) {
ok = CommandZoneAccessor.getInstance(serverId).setInt32Value(containerId, id, new Integer(serverValue).intValue());
ok = CommandZoneAccessor.getInstance(serverId).setInt32Value(containerId, id, Integer.valueOf(serverValue));
} else {
ok = DataAccessor.getInstance(serverId).setInt32Value(containerId, id, new Integer(serverValue).intValue());
ok = DataAccessor.getInstance(serverId).setInt32Value(containerId, id, Integer.valueOf(serverValue));
if (!ok) {
sendPropertyChangedEvent();
}
......
......@@ -64,7 +64,7 @@ public abstract class IntegerProperty extends Property {
// String serverValue = this.propertyFormat.unformat(value);
// if (isOk(serverValue)) {
// try {
// abstractController.setValueByLong(name, new Integer(serverValue).intValue());
// abstractController.setValueByLong(name, Integer.valueOf(serverValue));
// showSettingPropertyMessage(value);
// } catch (CannotSetValueException e) {
// // if the value is refused then update all widgets with the true value.
......
......@@ -443,7 +443,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
synchronized (lockListeners) {
Iterator<ILockChangedListener> listenerIterator = lockListeners.iterator();
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
}
public UndoState getUndoState() {
return undoState;
}
public abstract String getType();
/**
......
......@@ -284,12 +284,8 @@ public class PropertyManager {
}
/**
*
* @param controller
*/
public void deleteDynamicPropertyFromController(Servant servant, String propertyName) {
HashMap<String, DynamicProperty> dynamicProperties = dynamicPropertyMap.get(servant.getId());
public void deleteDynamicPropertyFromController(Controller controller, String propertyName) {
HashMap<String, DynamicProperty> dynamicProperties = dynamicPropertyMap.get(controller.getDatabaseId());
if (dynamicProperties != null) {
dynamicProperties.remove(propertyName);
}
......
......@@ -31,7 +31,7 @@ public class GreaterThanPropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) {
try {
boolean isOk = (new Double(valueToBeTested).doubleValue() >= value);
boolean isOk = (Double.valueOf(valueToBeTested) >= value);
return isOk;
} catch (NumberFormatException e) {
return false;
......
......@@ -31,7 +31,7 @@ public class LowerThanPropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) {
try {
boolean isOk = (new Double(valueToBeTested).doubleValue() <= this.value);
boolean isOk = (Double.valueOf(valueToBeTested) <= this.value);
return isOk;
} catch (NumberFormatException e) {
return false;
......
......@@ -25,7 +25,7 @@ public class PositivePropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) {
try {
boolean isOk = (new Double(valueToBeTested).doubleValue() >= 0);
boolean isOk = (Double.valueOf(valueToBeTested) >= 0);
return isOk;
} catch (NumberFormatException e) {
return false;
......
......@@ -33,7 +33,7 @@ public class RangePropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) {
try {
double valueToTest = new Double(valueToBeTested).doubleValue();
double valueToTest = Double.valueOf(valueToBeTested);
return (valueToTest >= minIncluded && valueToTest <= maxIncluded);
} catch (NumberFormatException e) {
return false;
......
......@@ -110,9 +110,9 @@ public class RangePropertyDependentCondition implements IPropertyCondition {
}
if (minProperty != null && maxProperty != null) {
double minValue = new Double(minProperty.getValue()).doubleValue();
double maxValue = new Double(maxProperty.getValue()).doubleValue();
double valueToTest = new Double(valueToBeTested).doubleValue();
double minValue = Double.valueOf(minProperty.getValue());
double maxValue = Double.valueOf(maxProperty.getValue());
double valueToTest = Double.valueOf(valueToBeTested);
if (minPropertyExcluded && maxPropertyExcluded) {
return (valueToTest > minValue && valueToTest < maxValue);
......
......@@ -25,7 +25,7 @@ public class StrictlyPositivePropertyCondition implements IPropertyCondition {
public boolean isOk(String valueToBeTested) {
try {
boolean isOk = (new Double(valueToBeTested).doubleValue() > 0);
boolean isOk = (Double.valueOf(valueToBeTested) > 0);
return isOk;
} catch (NumberFormatException e) {
return false;
......
......@@ -103,7 +103,7 @@ public class DecimalFormat extends PropertyFormat {
nbOfDecimalPlaces = numberOfDecimalPlaces;
}
if (value.equals((new Double(Double.NaN)).toString()) ) {
if (value.equals((Double.valueOf(Double.NaN)).toString()) ) {
return value;
}
if (value.equals("")) {
......@@ -112,9 +112,9 @@ public class DecimalFormat extends PropertyFormat {
double valueAsDouble;
try {
valueAsDouble = new Double(Double.parseDouble(value)).doubleValue();
valueAsDouble = Double.valueOf(Double.parseDouble(value));
} 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;
}
......
......@@ -23,12 +23,12 @@ import java.math.BigInteger;
public class HexadecimalFormat extends PropertyFormat {
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) {
int valueInDecimal = new BigInteger(value, 16).intValue();
return new Integer(valueInDecimal).toString();
return Integer.valueOf(valueInDecimal).toString();
}
// ????? 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