...
 
Commits (25)
4.0.8 22/04/2020
-----
* Merge ploty2 branch
4.0.7 21/04/2020
-----
* Update version of nomadcommandsystem in pom.
......
# Initial size for the main window
mainWindowPeerHeight=850
mainWindowPeerWidth=1400
plotWindowTitle=Nomad plots
defaultPlotWindowHeight=600
defaultPlotWindowWidth=800
defaultPlotImageHeight=48
defaultPlotImageWidth=64
# Titles for the main window according to current version of the server
icsMainWindowTitle=Nomad
nomadMainWindowTitle=Nomad
# Title for the login shell
loginShellTitle=Log in
# server default login
defaultServerLogin=
defaultServerPassword=
# Path for the xml files that contain the properties for each controller
serverPropertiesFilesPath=serverproperties/
commandLineConfigFilesPath=commandline/
menuFile=menu.xml
completionFile=completion.xml
logsDirectory=logs
serverLogDirectory=log
surveyDirectory=histo
# Roles
scientific=scientific
administrative=administrative
# Directory for saved scans
usersScansDir=nomadScans
# Directory for deleted scans or XBU
deletedScansDirectory=.trash
# Directory for XBU files
usersXBUDir=nomadXBUs
# Directory for pal files
palFilesDir=nomadPal
# Directory for saved settings
saveSettingsDir=nomadSettings
# Temporary scan name for copying to the server tab from another one
temporaryScanCopyName=nomadScanCopy.xml
# Directory for saved spies
usersSpiesDir=nomadSpies
usersSpiesFileName=spies.xml
usersFavoriteSpiesFileName=.spies.xml
# Directory for saved favourites
usersFavouritesDir=nomadSpies
usersFavouritesFileName=favourites.xml
# Server command types
atomicCommandType=atomic
scanCommandType=scan
settingsCommandType=settings
forLoopCommandType=forloop
genericCommandType=generic
controlCommandType=control
# allow/disallow text mode in server scan
textModeAllowedInServerScan=false
#Directory for Nomad plot preferences saving
nomadPlotPreferencesDirectory=nomadPlotPreferences
#Directory for multiplot viewer images
offscreenImagesDir=offscreenImages
#Multiplot archive directory for log images
logImagesDirectory=logImagesDirectory
#Image generation frequency (msec)
imageGenerationFrequency=1000
#Rendering mode
renderingMode=0
#Maximum data size used for VBO smooth rendering mode (xSize * ySize)
maximumDataSize=9000000
#Server test mode
serverTestMode=false
fcuFilesDirectory=Fcu
instrumentsAllowingPALFiles=gamma34,gamma24,gamma26,in12,thales,in20,in3,gamma23,in22nomad
# Initial size for the main window
mainWindowPeerHeight=850
mainWindowPeerWidth=1400
plotWindowTitle=Nomad plots
defaultPlotWindowHeight=600
defaultPlotWindowWidth=800
defaultPlotImageHeight=48
defaultPlotImageWidth=64
# Titles for the main window according to current version of the server
icsMainWindowTitle=Nomad
nomadMainWindowTitle=Nomad
# Title for the login shell
loginShellTitle=Log in
# server default login
defaultServerLogin=
defaultServerPassword=
# Path for the xml files that contain the properties for each controller
serverPropertiesFilesPath=serverproperties/
commandLineConfigFilesPath=commandline/
menuFile=menu.xml
completionFile=completion.xml
logsDirectory=logs
serverLogDirectory=log
surveyDirectory=histo
# Roles
scientific=scientific
administrative=administrative
# Directory for saved scans
usersScansDir=nomadScans
# Directory for deleted scans or XBU
deletedScansDirectory=.trash
# Directory for XBU files
usersXBUDir=nomadXBUs
# Directory for pal files
palFilesDir=nomadPal
# Directory for saved settings
saveSettingsDir=nomadSettings
# Temporary scan name for copying to the server tab from another one
temporaryScanCopyName=nomadScanCopy.xml
# Directory for saved spies
usersSpiesDir=nomadSpies
usersSpiesFileName=spies.xml
usersFavoriteSpiesFileName=.spies.xml
# Directory for saved favourites
usersFavouritesDir=nomadSpies
usersFavouritesFileName=favourites.xml
# Server command types
atomicCommandType=atomic
scanCommandType=scan
settingsCommandType=settings
forLoopCommandType=forloop
genericCommandType=generic
controlCommandType=control
# allow/disallow text mode in server scan
textModeAllowedInServerScan=false
#Directory for Nomad plot preferences saving
nomadPlotPreferencesDirectory=nomadPlotPreferences
#Directory for multiplot viewer images
offscreenImagesDir=offscreenImages
#Multiplot archive directory for log images
logImagesDirectory=logImagesDirectory
#Image generation frequency (msec)
imageGenerationFrequency=1000
#Rendering mode
renderingMode=0
#Maximum data size used for VBO smooth rendering mode (xSize * ySize)
maximumDataSize=9000000
#Server test mode
serverTestMode=false
fcuFilesDirectory=Fcu
instrumentsAllowingPALFiles=gamma34,gamma24,gamma26,in12,thales,in20,in3,gamma23,in22nomad
############################################################
# Logging Configuration File for Nomad
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################
############################################################
# Global properties
############################################################
# "handlers" specifies a comma separated list of log Handler
# classes. These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
handlers= java.util.logging.FileHandler
#, java.util.logging.ConsoleHandler
#handlers=java.util.logging.FileHandler
#handlers= java.util.logging.ConsoleHandler
# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers. For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level=INFO
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
# Limit the message that are written on the specified file(s) to the specified level and above.
java.util.logging.FileHandler.pattern = logs/log_nomad%u_%g.log
java.util.logging.FileHandler.limit = 1000000
java.util.logging.FileHandler.count = 20
#java.util.logging.FileHandler.formatter = fr.ill.ics.common.LogXMLFormatter
java.util.logging.FileHandler.formatter = fr.ill.ics.common.LogFormatter
# Limit the message that are printed on the console to the specified level and above.
java.util.logging.ConsoleHandler.level = FINEST
#java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = fr.ill.ics.common.LogFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#com.xyz.foo.level = SEVERE
############################################################
# Logging Configuration File for Nomad
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################
############################################################
# Global properties
############################################################
# "handlers" specifies a comma separated list of log Handler
# classes. These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
handlers= java.util.logging.FileHandler
#, java.util.logging.ConsoleHandler
#handlers=java.util.logging.FileHandler
#handlers= java.util.logging.ConsoleHandler
# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers. For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level=INFO
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
# Limit the message that are written on the specified file(s) to the specified level and above.
java.util.logging.FileHandler.pattern = logs/log_nomad%u_%g.log
java.util.logging.FileHandler.limit = 1000000
java.util.logging.FileHandler.count = 20
#java.util.logging.FileHandler.formatter = fr.ill.ics.common.LogXMLFormatter
java.util.logging.FileHandler.formatter = fr.ill.ics.common.LogFormatter
# Limit the message that are printed on the console to the specified level and above.
java.util.logging.ConsoleHandler.level = FINEST
#java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = fr.ill.ics.common.LogFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#com.xyz.foo.level = SEVERE
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadgui</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<name>NomadGUI</name>
<description>Graphical user interface for Nomad</description>
<scm>
......@@ -132,10 +132,15 @@
<artifactId>jogl-all-main</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadcommandsystem</artifactId>
<version>4.0.6</version>
<version>4.0.7</version>
</dependency>
<!-- **************************************************************** JFACE ****************************************************************
......
......@@ -47,6 +47,7 @@ import fr.ill.ics.client.control.command.navigation.button.TabButton;
import fr.ill.ics.client.control.experiment.ExperimentData;
import fr.ill.ics.client.control.login.Authentication;
import fr.ill.ics.client.control.login.UserConnection;
import fr.ill.ics.client.control.plot.PlotyManager;
import fr.ill.ics.client.control.plugin.selection.CommandsSelectionPlugin;
import fr.ill.ics.client.control.plugin.selection.HardwareSelectionPlugin;
import fr.ill.ics.client.control.plugin.selection.SelectionPlugin;
......@@ -195,6 +196,10 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
} finally {
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyManager.getInstance().closePlots();
}
ServerConnection.getInstance(CommandZoneWrapper.SERVER_ID).reset();
System.out.println("Resetting Cameo application");
......
......@@ -151,6 +151,19 @@ public class ControllerConfigParser extends GenericParser {
if (attributeIsPresent(attributes, ControllerViewParser.ATTRIBUTE_TITLE_PROPERTY)) {
titlePropertyName = getAttribute(attributes, ControllerViewParser.ATTRIBUTE_TITLE_PROPERTY);
}
} else if (qName.equals(ControllerViewParser.TAG_DYNAMIC_PLOT) || qName.equals(ControllerViewParser.TAG_DYNAMIC_PLOT_LAUNCHER)) {
plotRoleName = getAttribute(attributes, ControllerViewParser.ATTRIBUTE_ROLE);
if (attributeIsPresent(attributes, ControllerViewParser.ATTRIBUTE_X_AXIS_TITLE_PROPERTY)) {
xAxisTitlePropertyName = getAttribute(attributes, ControllerViewParser.ATTRIBUTE_X_AXIS_TITLE_PROPERTY);
}
if (attributeIsPresent(attributes, ControllerViewParser.ATTRIBUTE_Y_AXIS_TITLE_PROPERTY)) {
yAxisTitlePropertyName = getAttribute(attributes, ControllerViewParser.ATTRIBUTE_Y_AXIS_TITLE_PROPERTY);
}
if (attributeIsPresent(attributes, ControllerViewParser.ATTRIBUTE_TITLE_PROPERTY)) {
titlePropertyName = getAttribute(attributes, ControllerViewParser.ATTRIBUTE_TITLE_PROPERTY);
}
}
......@@ -262,6 +275,21 @@ public class ControllerConfigParser extends GenericParser {
titlePropertyName = null;
}
plotRoleName = null;
} else if (qName.equals(ControllerViewParser.TAG_DYNAMIC_PLOT) || qName.equals(ControllerViewParser.TAG_DYNAMIC_PLOT_LAUNCHER)) {
if (xAxisTitlePropertyName != null) {
addDynamicProperty(plotRoleName, xAxisTitlePropertyName);
xAxisTitlePropertyName = null;
}
if (yAxisTitlePropertyName != null) {
addDynamicProperty(plotRoleName, yAxisTitlePropertyName);
yAxisTitlePropertyName = null;
}
if (titlePropertyName != null) {
addDynamicProperty(plotRoleName, titlePropertyName);
titlePropertyName = null;
}
plotRoleName = null;
}
}
......
......@@ -85,6 +85,9 @@ public class ControllerViewParser extends GenericParser {
public final static String TAG_PLOT_LAUNCHER = "plot_launcher";
public final static String TAG_FILE_TEXT = "file_text";
public final static String TAG_DYNAMIC_PLOT = "dynamic_plot";
public final static String TAG_DYNAMIC_PLOT_LAUNCHER = "dynamic_plot_launcher";
// Switcher
public final static String TAG_IMAGE_BUTTON = "image_button";
public final static String TAG_PROPERTY_SWITCHER = "property_switcher";
......@@ -419,6 +422,27 @@ public class ControllerViewParser extends GenericParser {
widgetDescriptor.setYAxisTitleProperty(getAttribute(attributes, ATTRIBUTE_Y_AXIS_TITLE_PROPERTY));
setWidgetAttributes(attributes);
} else if (qName.equals(TAG_DYNAMIC_PLOT)) {
widgetDescriptor = new WidgetDescriptor(TAG_DYNAMIC_PLOT);
widgetDescriptor.setHeight(getAttribute(attributes, ATTRIBUTE_HEIGHT));
widgetDescriptor.setWidth(getAttribute(attributes, ATTRIBUTE_WIDTH));
widgetDescriptor.setXAxisTitle(getAttribute(attributes, ATTRIBUTE_X_AXIS_TITLE));
widgetDescriptor.setYAxisTitle(getAttribute(attributes, ATTRIBUTE_Y_AXIS_TITLE));
widgetDescriptor.setTitleProperty(getAttribute(attributes, ATTRIBUTE_TITLE_PROPERTY));
widgetDescriptor.setXAxisTitleProperty(getAttribute(attributes, ATTRIBUTE_X_AXIS_TITLE_PROPERTY));
widgetDescriptor.setYAxisTitleProperty(getAttribute(attributes, ATTRIBUTE_Y_AXIS_TITLE_PROPERTY));
setWidgetAttributes(attributes);
} else if (qName.equals(TAG_DYNAMIC_PLOT_LAUNCHER)) {
widgetDescriptor = new WidgetDescriptor(TAG_DYNAMIC_PLOT_LAUNCHER);
widgetDescriptor.setHeight(getAttribute(attributes, ATTRIBUTE_HEIGHT));
widgetDescriptor.setXAxisTitle(getAttribute(attributes, ATTRIBUTE_X_AXIS_TITLE));
widgetDescriptor.setYAxisTitle(getAttribute(attributes, ATTRIBUTE_Y_AXIS_TITLE));
widgetDescriptor.setTitleProperty(getAttribute(attributes, ATTRIBUTE_TITLE_PROPERTY));
widgetDescriptor.setXAxisTitleProperty(getAttribute(attributes, ATTRIBUTE_X_AXIS_TITLE_PROPERTY));
widgetDescriptor.setYAxisTitleProperty(getAttribute(attributes, ATTRIBUTE_Y_AXIS_TITLE_PROPERTY));
setWidgetAttributes(attributes);
} else if (qName.equals(TAG_IMAGE_BUTTON)) {
widgetDescriptor = new WidgetDescriptor(TAG_IMAGE_BUTTON);
setWidgetAttributes(attributes); // to set role and property
......@@ -529,7 +553,14 @@ public class ControllerViewParser extends GenericParser {
} else if (qName.equals(TAG_TITLE) || qName.equals(TAG_SUMMARY_CONTENT)) {
compositeDescriptor = mainCompositeDescriptor; // back to the future
} else if ((qName.equals(TAG_LABEL)) || (qName.equals(TAG_CHANGING_COLOR_LABEL)) || (qName.equals(TAG_SIMPLE_LABEL)) || (qName.equals(TAG_SIMPLE_IMAGE)) || (qName.equals(TAG_TEXT)) || (qName.equals(TAG_RADIO)) || (qName.equals(TAG_CHECK)) || (qName.equals(TAG_COMBO)) || (qName.equals(TAG_PROPERTY_COMBO)) || (qName.equals(TAG_BUTTON))|| (qName.equals(TAG_FILE_TEXT)) || (qName.equals(TAG_PROGRESS)) || (qName.equals(TAG_IMAGE_BUTTON)) || (qName.equals(TAG_STATUS)) || (qName.equals(TAG_TIME)) || (qName.equals(TAG_DAY)) || (qName.equals(TAG_CONTROLLER_NAME)) || (qName.equals(TAG_PLOT)) || (qName.equals(TAG_PLOT_LAUNCHER)) || qName.equals(TAG_PROPERTY_SWITCHER) || qName.equals(TAG_GRAPHICAL_SWITCHER)) {
} else if ((qName.equals(TAG_LABEL)) || (qName.equals(TAG_CHANGING_COLOR_LABEL))
|| (qName.equals(TAG_SIMPLE_LABEL)) || (qName.equals(TAG_SIMPLE_IMAGE)) || (qName.equals(TAG_TEXT))
|| (qName.equals(TAG_RADIO)) || (qName.equals(TAG_CHECK)) || (qName.equals(TAG_COMBO))
|| (qName.equals(TAG_PROPERTY_COMBO)) || (qName.equals(TAG_BUTTON)) || (qName.equals(TAG_FILE_TEXT))
|| (qName.equals(TAG_PROGRESS)) || (qName.equals(TAG_IMAGE_BUTTON)) || (qName.equals(TAG_STATUS))
|| (qName.equals(TAG_TIME)) || (qName.equals(TAG_DAY)) || (qName.equals(TAG_CONTROLLER_NAME))
|| (qName.equals(TAG_PLOT)) || (qName.equals(TAG_PLOT_LAUNCHER)) || qName.equals(TAG_PROPERTY_SWITCHER)
|| qName.equals(TAG_GRAPHICAL_SWITCHER) || (qName.equals(TAG_DYNAMIC_PLOT)) || (qName.equals(TAG_DYNAMIC_PLOT_LAUNCHER))) {
compositeDescriptor.addContent(widgetDescriptor);
widgetDescriptor = null;
}
......@@ -648,6 +679,14 @@ public class ControllerViewParser extends GenericParser {
}
prefixOrTitleAttribute = ATTRIBUTE_TITLE;
prefixOrTitleValue = widgetDescriptor.getTitle();
} else if (widgetDescriptor.getType().equals(TAG_DYNAMIC_PLOT)) {
widgetTag = TAG_DYNAMIC_PLOT;
propertyOrCommandAttribute = ATTRIBUTE_DATA;
if (widgetDescriptor.getData() != null && !widgetDescriptor.getData().isEmpty()) {
propertyOrCommandValue = widgetDescriptor.getData().get(0);
}
prefixOrTitleAttribute = ATTRIBUTE_TITLE;
prefixOrTitleValue = widgetDescriptor.getTitle();
} else {
// use label as a default with a property attribute
widgetTag = TAG_LABEL;
......
......@@ -413,7 +413,22 @@ public class WidgetDescriptor extends AbstractDescriptor {
clonedDescriptor.setExtensions(new HashSet<String>(extensions));
}
if (this.type.equals(ControllerViewParser.TAG_PLOT_LAUNCHER)) {
if (this.type.equals(ControllerViewParser.TAG_PLOT_LAUNCHER) || this.type.equals(ControllerViewParser.TAG_PLOT)) {
// Change property associated with plot datas
if (clonedDescriptor.getData() != null) {
Iterator<String> it = clonedDescriptor.getData().iterator();
List<String> dynamicData = new ArrayList<String>();
while (it.hasNext()) {
String data = it.next();
dynamicData.add(data + index);
}
clonedDescriptor.setData(dynamicData);
clonedDescriptor.setTitleProperty(titleProperty + index);
clonedDescriptor.setXAxisTitleProperty(xAxisTitleProperty + index);
clonedDescriptor.setYAxisTitleProperty(yAxisTitleProperty + index);
}
}
else if (this.type.equals(ControllerViewParser.TAG_DYNAMIC_PLOT_LAUNCHER) || this.type.equals(ControllerViewParser.TAG_DYNAMIC_PLOT)) {
// Change property associated with plot datas
if (clonedDescriptor.getData() != null) {
Iterator<String> it = clonedDescriptor.getData().iterator();
......
This diff is collapsed.
......@@ -826,12 +826,12 @@ public abstract class ControllerPlugin extends Plugin {
Controller controller = (Controller)controllers.get(plotDataDescriptor.getSizePropertyRole());
try {
Property nbDynamicsProperty = getProperty(controller, plotDataDescriptor.getSizeProperty(), plotDataDescriptor.getSizePropertyRole());
Property nbDynamicsProperty = PropertyManager.getInstance().getProperty(controller, plotDataDescriptor.getSizeProperty(), PluginType.COMMAND);
int nbDynamics = Integer.valueOf(nbDynamicsProperty.getValue());
String initialPlotDataKey = plotDataDescriptor.getKey();
if (nbDynamics > 0) {
dynamicPlotDatas = new HashMap<String, PropertyPlotData>();
dynamicPlotDatas = new LinkedHashMap<String, PropertyPlotData>();
}
for (int i = 0; i < nbDynamics; i++) {
......@@ -883,6 +883,51 @@ public abstract class ControllerPlugin extends Plugin {
} catch (Exception e) {
// System.out.println("Problem with " + property.getName());
}
// optimization part
if (!plotDataDescriptor.getOptimizationRoleName().equals("")) {
propertyAndRole = plotDataDescriptor.getOptimizationRoleName() + ConfigManager.ROLE_AND_NAME_SEPARATOR + plotDataDescriptor.getOptimizationFoundPropertyName() + "." + i;
if (plotProperties.containsKey(propertyAndRole)) {
plotData.setOptimizationFoundProperty(plotProperties.get(propertyAndRole));
} else {
Property property = getDynamicProperty(propertyAndRole);
plotProperties.put(propertyAndRole, property);
plotData.setOptimizationFoundProperty(property);
}
propertyAndRole = plotDataDescriptor.getOptimizationRoleName() + ConfigManager.ROLE_AND_NAME_SEPARATOR + plotDataDescriptor.getOptimizationValuePropertyName() + "." + i;
if (plotProperties.containsKey(propertyAndRole)) {
plotData.setOptimizationValueProperty(plotProperties.get(propertyAndRole));
} else {
Property property = getDynamicProperty(propertyAndRole);
plotProperties.put(propertyAndRole, property);
plotData.setOptimizationValueProperty(property);
}
plotData.setOptimizationRGB(plotDataDescriptor.getOptimizationRed(), plotDataDescriptor.getOptimizationGreen(), plotDataDescriptor.getOptimizationBlue());
}
// optimization fit part
if (!plotDataDescriptor.getOptimizationFitRoleName().equals("")) {
propertyAndRole = plotDataDescriptor.getOptimizationFitRoleName() + ConfigManager.ROLE_AND_NAME_SEPARATOR + plotDataDescriptor.getOptimizationFitFoundPropertyName() + "." + i;
if (plotProperties.containsKey(propertyAndRole)) {
plotData.setOptimizationFitFoundProperty(plotProperties.get(propertyAndRole));
} else {
Property property = getDynamicProperty(propertyAndRole);
plotProperties.put(propertyAndRole, property);
plotData.setOptimizationFitFoundProperty(property);
}
propertyAndRole = plotDataDescriptor.getOptimizationFitRoleName() + ConfigManager.ROLE_AND_NAME_SEPARATOR + plotDataDescriptor.getOptimizationFitValuePropertyName() + "." + i;
if (plotProperties.containsKey(propertyAndRole)) {
plotData.setOptimizationFitValueProperty(plotProperties.get(propertyAndRole));
} else {
Property property = getDynamicProperty(propertyAndRole);
plotProperties.put(propertyAndRole, property);
plotData.setOptimizationFitValueProperty(property);
}
plotData.setOptimizationFitRGB(plotDataDescriptor.getOptimizationFitRed(), plotDataDescriptor.getOptimizationFitGreen(), plotDataDescriptor.getOptimizationFitBlue());
}
}
} catch (PropertyNotFoundException e) {
MainWindow.getInstance().onPropertyNotFoundException(e);
......@@ -1363,6 +1408,10 @@ public abstract class ControllerPlugin extends Plugin {
return null;
}
public Map<String, PropertyPlotData> getDynamicPlotDatas() {
return dynamicPlotDatas;
}
public PropertyPlotData getDynamicPlotData(String key) {
return dynamicPlotDatas.get(key);
}
......
......@@ -24,6 +24,7 @@ import fr.ill.ics.cameo.Application;
import fr.ill.ics.client.control.MainWindow;
import fr.ill.ics.client.control.command.CommandWindow;
import fr.ill.ics.client.control.login.ServerConnection;
import fr.ill.ics.client.control.plot.PlotyManager;
import fr.ill.ics.client.control.login.UserConnection;
import fr.ill.ics.client.control.plugin.PluginManager;
import fr.ill.ics.client.control.remote.RemoteControlManager;
......@@ -41,7 +42,7 @@ import fr.ill.ics.util.ConfigManager;
public class Startup {
private StartupSplashDialog startupSplashDialog;
private static int numberOfSteps = 14;
private static int numberOfSteps = 13;
private int currentStep = -3;
private ServerConnection login;
private boolean displayDebugMessages = false;
......@@ -114,6 +115,23 @@ public class Startup {
break;
case 1:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
boolean plotyOk = PlotyManager.getInstance().init();
// if connection unsuccessful, do not go to next step
if (!plotyOk) {
advanceToNextStep = false;
informationKey = "Failled ploty2 connection";
} else {
// set information key for next stage
informationKey = "";
}
}
break;
case 2:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
......@@ -124,7 +142,7 @@ public class Startup {
informationKey = "clientInitialisingPropertiesMessage";
break;
case 2:
case 3:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
......@@ -143,7 +161,7 @@ public class Startup {
informationKey = "clientInitialisingPluginManagerMessage";
break;
case 3:
case 4:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
......@@ -154,14 +172,14 @@ public class Startup {
informationKey = "clientReadingPropertiesMessage";
break;
case 4:
case 5:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
MainWindowPeer.getInstance().initCommandImageFactory();
break;
case 5:
case 6:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
......@@ -169,14 +187,17 @@ public class Startup {
MainWindow.getInstance().initSelectionPluginsAndToolBar();
break;
case 6:
case 7:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
// construct the main window
MainWindowPeer.getInstance().constructDisplay();
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyManager.getInstance().restorePlots();
}
break;
case 7:
case 8:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
......@@ -185,7 +206,7 @@ public class Startup {
informationKey = "initialiseCommandSelectionAreaMessage";
break;
case 8:
case 9:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
......@@ -194,7 +215,7 @@ public class Startup {
informationKey = "initialiseServerScanMessage";
break;
case 9:
case 10:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
......@@ -205,11 +226,11 @@ public class Startup {
CommandWindow.getInstance().getCurrentCommandZone().refreshZone(false);
informationKey = "synchroniseTokenState";
break;
case 10:
case 11:
TokenManager.getInstance().initialiseToken();
informationKey = "initialiseSpiesMessage";
break;
case 11:
case 12:
if (displayDebugMessages) {
System.out.println("Step " + currentStep + " " + MainWindow.getElapsedTime());
}
......
......@@ -59,6 +59,7 @@ import fr.ill.ics.client.view.widget.SimpleText;
import fr.ill.ics.client.view.widget.plot.PlotWidget;
import fr.ill.ics.client.view.widget.plot.PropertyPlotWidget;
import fr.ill.ics.client.view.widget.plot.launcher.PlotLauncher;
import fr.ill.ics.client.view.widget.plot.launcher.PlotLauncherExternImageButton;
import fr.ill.ics.client.view.widget.plot.launcher.PlotLauncherImageButton;
import fr.ill.ics.core.command.CommandAction;
import fr.ill.ics.core.property.Property;
......@@ -123,7 +124,9 @@ public abstract class PWidgetFactory {
public abstract PlotLauncher createPlotLauncherButton(PContainer parent, int height, List<PlotData> plotDatas, String titleKey, String xAxisTitleKey, String yAxisTitleKey, Property titleProperty, Property xAxisTitleProperty, Property yAxisTitleProperty, Property numorProperty);
public abstract CButton createCButton(ControllerPlugin controllerPlugin, PContainer parent, CommandAction commandAction, WidgetDescriptor widgetDescriptor);
public abstract PlotLauncherExternImageButton createPlotLauncherExternImageButton(PContainer parent, List<PlotData> plotDatas, String title, int width, int height, String xAxisTitleKey, String yAxisTitleKey, Property titleProperty, Property xAxisTitleProperty, Property yAxisTitleProperty, Property numorProperty);
public abstract CButton createCButton(ControllerPlugin controllerPlugin, PContainer parent, CommandAction commandAction, WidgetDescriptor widgetDescriptor);
public abstract NomadWindow createNomadWindow(String windowTitle);
......
......@@ -86,8 +86,10 @@ import fr.ill.ics.client.view.widget.SimpleText;
import fr.ill.ics.client.view.widget.plot.PlotWidget;
import fr.ill.ics.client.view.widget.plot.PropertyPlotWidget;
import fr.ill.ics.client.view.widget.plot.launcher.PlotLauncherButton;
import fr.ill.ics.client.view.widget.plot.launcher.PlotLauncherExternImageButton;
import fr.ill.ics.client.view.widget.plot.launcher.PlotLauncherImageButton;
import fr.ill.ics.client.view.widget.plot.launcher.swt.SWTPlotLauncherButton;
import fr.ill.ics.client.view.widget.plot.launcher.swt.SWTPlotLauncherExternImageButton;
import fr.ill.ics.client.view.widget.plot.launcher.swt.SWTPlotLauncherImageButton;
import fr.ill.ics.client.view.widget.swt.SWTCButton;
import fr.ill.ics.client.view.widget.swt.SWTCProgressBar;
......@@ -720,6 +722,13 @@ public class SWTPWidgetFactory extends PWidgetFactory {
return new SWTPlotLauncherImageButton(parent, height, plotDatas, title, xAxisTitleKey, yAxisTitleKey, titleProperty, xAxisTitleProperty, yAxisTitleProperty, numorProperty);
}
public PlotLauncherExternImageButton createPlotLauncherExternImageButton(PContainer parent, List<PlotData> plotDatas, String title, int width, int height, String xAxisTitleKey, String yAxisTitleKey, Property titleProperty, Property xAxisTitleProperty, Property yAxisTitleProperty, Property numorProperty) {
if (height == 0) {
height = ConfigManager.getInstance().getInt("defaultPlotImageHeight");
}
return new SWTPlotLauncherExternImageButton(parent, height, plotDatas, title, xAxisTitleKey, yAxisTitleKey, titleProperty, xAxisTitleProperty, yAxisTitleProperty, numorProperty);
}
public PlotLauncherButton createPlotLauncherButton(PContainer parent, int height, List plotDatas, String titleKey, String xAxisTitleKey, String yAxisTitleKey, Property titleProperty, Property xAxisTitleProperty, Property yAxisTitleProperty, Property numorProperty) {
Composite composite = ((SWTPContainer) parent).getComposite();
return new SWTPlotLauncherButton(convertToPContainer(composite), height, plotDatas, titleKey, xAxisTitleKey, yAxisTitleKey, titleProperty, xAxisTitleProperty, yAxisTitleProperty, numorProperty);
......
......@@ -135,6 +135,13 @@ public final class DynamicComposite extends PWidget {
if (dynamicProperty != null) {
controllerPluginPeer.getControllerPlugin().addDynamicProperty(compositeDescriptor.getRole(), realPropertyName, dynamicProperty);
/* H.ORTIZ 02 JUL 2019 ??? TO BE DONE OR NOT ?
if (controller instanceof AtomicCommandWrapper) {
// Do not forget scan properties
((ControllerCommandPlugin)controllerPluginPeer.getControllerPlugin()).addScanDynamicProperty(compositeDescriptor.getRole() + ConfigManager.ROLE_AND_NAME_SEPARATOR + realPropertyName);
}
****/
if (controllerPluginPeer.getControllerPlugin() instanceof ControllerCommandPlugin) {
// H.ORTIZ 30/08/2019 (if not done, set points are not correctly copied when the CB is copied / pasted)
......
......@@ -102,7 +102,7 @@ public abstract class PlotManager implements INomadWindowListener {
thePlotWindow.openNomadWindow();
}
protected String computePlotTabKey(List<PlotData> plotDatas) {
public String computePlotTabKey(List<PlotData> plotDatas) {
String key = "";
Iterator<PlotData> it = plotDatas.iterator();
while (it.hasNext()) {
......
......@@ -24,6 +24,7 @@ import java.util.List;
import fr.ill.ics.client.control.plot.IPlotDataListener;
import fr.ill.ics.client.control.plot.PlotData;
import fr.ill.ics.client.control.plot.PlotyManager;
import fr.ill.ics.client.control.plot.PropertyPlotData;
import fr.ill.ics.client.view.MainWindowPeer;
import fr.ill.ics.client.view.factory.WidgetFactory;
......@@ -73,14 +74,20 @@ public abstract class PlotLauncher extends NomadWidget implements IPlotDataHolde
}
protected void onClick() {
int previousMode = WidgetFactory.CURRENT_MODE;
WidgetFactory.CURRENT_MODE = WidgetFactory.PLOT_WINDOW_MODE;
MainWindowPeer.getInstance().setCursorToWait();
plotKey = PlotManager.getInstance().activatePlot(plotDatas, title, xAxisTitle, yAxisTitle, titleProperty,
xAxisTitleProperty, yAxisTitleProperty, numorProperty);
PlotManager.getInstance().openPlotWindow();
MainWindowPeer.getInstance().setCursorToDefault();
WidgetFactory.CURRENT_MODE = previousMode;
if (ConfigManager.getInstance().getPlotyVersion() == 1) {
int previousMode = WidgetFactory.CURRENT_MODE;
WidgetFactory.CURRENT_MODE = WidgetFactory.PLOT_WINDOW_MODE;
MainWindowPeer.getInstance().setCursorToWait();
plotKey = PlotManager.getInstance().activatePlot(plotDatas, title, xAxisTitle, yAxisTitle, titleProperty,
xAxisTitleProperty, yAxisTitleProperty, numorProperty);
PlotManager.getInstance().openPlotWindow();
MainWindowPeer.getInstance().setCursorToDefault();
WidgetFactory.CURRENT_MODE = previousMode;
}
else if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyManager.getInstance().plot(PlotManager.getInstance().computePlotTabKey(plotDatas), plotDatas, title, title, xAxisTitle, yAxisTitle, titleProperty,
xAxisTitleProperty, yAxisTitleProperty);
}
}
public void updatePlotData(List<PlotData> plotDatas) {
......
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package fr.ill.ics.client.view.widget.plot.launcher;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.io.monitor.FileAlterationMonitor;
import fr.ill.ics.client.control.plot.PlotData;
import fr.ill.ics.client.control.plot.PlotDataEvent;
import fr.ill.ics.client.control.plot.PropertyPlotData;
import fr.ill.ics.client.view.widget.PContainer;
import fr.ill.ics.core.property.Property;
import fr.ill.ics.nscclient.ploty.PlotyInstance;
import fr.ill.ics.nscclient.ploty.SpyPlotChangeListener;
import fr.ill.ics.util.ConfigManager;
public abstract class PlotLauncherExternImageButton extends PlotLauncher implements SpyPlotChangeListener {
protected boolean initDone = false;
protected int height;
protected int width;
protected String imageKey;
protected FileAlterationMonitor monitor;
protected PlotLauncherExternImageButton(PContainer parent, int height, List<PlotData> plotDatas, String titleKey,
String xAxisTitleKey, String yAxisTitleKey, Property titleProperty, Property xAxisTitleProperty,
Property yAxisTitleProperty, Property numorProperty) {
super(parent, height, plotDatas, titleKey, xAxisTitleKey, yAxisTitleKey, titleProperty, xAxisTitleProperty,
yAxisTitleProperty, numorProperty);
this.height = height;
this.width = height;
String key = "";
String controllerName = "";
String legendName = "";
Iterator<PlotData> it = plotDatas.iterator();
while (it.hasNext()) {
key = "";
PropertyPlotData pdata = ((PropertyPlotData) it.next());
if (pdata != null) {
if (pdata.getDataPlotController() != null) {
controllerName = pdata.getDataPlotController().getName();
}
if (titleProperty != null) {
legendName = titleProperty.getValue();
if (legendName.contains("-")) {
legendName = legendName.substring(0, legendName.indexOf("-") - 1);
}
}
}
key = key + "," + pdata.getKey();
break;
}
if (key.length() > 0) {
key = key.substring(1);
}
if (controllerName.isEmpty() == false) {
key = controllerName + "#" + key;
}
if ((legendName.isEmpty() == false) && (!controllerName.contains("ScanSpy"))) {
key = key + "#" + legendName;
}
imageKey = key + ".png";
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyInstance.getInstance().addSpyPlotChangeListener(this);
}
// File parentDirectory = FileUtils.getFile(System.getenv("HOME") + "/offscreenImages/spy");
// FileAlterationObserver observer = new FileAlterationObserver(parentDirectory);
//
// observer.addListener(new FileAlterationListenerAdaptor() {
//
// @Override
// public void onFileChange(File file) {
// if (file.getAbsolutePath().contentEquals(imageKey)) {
// //System.out.println("file changed: " + file.getName());
// updateImage();
// }
// }
//
// @Override
// public void onFileCreate(File file) {
// if (file.getAbsolutePath().contentEquals(imageKey)) {
// //System.out.println("File created: " + file.getName());
// updateImage();
// }
// }
//
// });
//
// // create a monitor to check changes after every 500 ms
// monitor = new FileAlterationMonitor(500, observer);
//
// try {
// monitor.start();
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
protected void closePlotWindow() {
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyInstance.getInstance().removeSpyPlotChangeListener(this);
}
// try {
// monitor.stop();
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
public void plotDataChanged(PlotDataEvent event) {
updateImage();
}
public void updatePlotData(List<PlotData> plotDatas) {
}
public void swapPlotData(PropertyPlotData plotData) {
}
protected abstract void createCanvas();
public abstract void updateImage();
public void reloadImage() {
updateImage();
}
public String getImageKey() {
return imageKey;
}
}
\ No newline at end of file
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package fr.ill.ics.client.view.widget.plot.launcher.swt;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Canvas;
import fr.ill.ics.client.control.plot.PlotData;
import fr.ill.ics.client.view.factory.swt.SWTImageFactory;
import fr.ill.ics.client.view.factory.swt.SWTWidgetFactory;
import fr.ill.ics.client.view.magnifier.swt.SWTMagnifier;
import fr.ill.ics.client.view.util.listener.swt.SWTMouseTracker;
import fr.ill.ics.client.view.util.swt.SWTImageUtils;
import fr.ill.ics.client.view.widget.PContainer;
import fr.ill.ics.client.view.widget.plot.launcher.PlotLauncherExternImageButton;
import fr.ill.ics.client.view.widget.swt.SWTPContainer;
import fr.ill.ics.core.property.Property;
public class SWTPlotLauncherExternImageButton extends PlotLauncherExternImageButton implements DisposeListener {
private Image image;
private Canvas canvas;
private boolean updateImageInProgress = false;
public SWTPlotLauncherExternImageButton(PContainer parent, int height, List<PlotData> plotDatas, String titleKey,
String xAxisTitleKey, String yAxisTitleKey, Property titleProperty, Property xAxisTitleProperty,
Property yAxisTitleProperty, Property numorProperty) {
super(parent, height, plotDatas, titleKey, xAxisTitleKey, yAxisTitleKey, titleProperty, xAxisTitleProperty,
yAxisTitleProperty, numorProperty);
createCanvas();
}
protected void createCanvas() {
canvas = SWTWidgetFactory.getInstance().createCanvas(((SWTPContainer) parent).getComposite(), SWT.NONE, true);
canvas.addMouseListener(new MouseAdapter() {
public void mouseDown(MouseEvent event) {
if (event.button == 1) {
onClick();
}
}
});
canvas.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent event) {
SWTImageUtils.drawScaledImage(event.gc, image, width, height, 0, 0);
}
});
canvas.addMouseTrackListener(new SWTMouseTracker());
update();
}
public void updateImage() {
if (!updateImageInProgress) {
updateImageInProgress = true;
if (canvas.isDisposed() == false) {
canvas.getDisplay().asyncExec(new Runnable() {
public void run() {
if (!canvas.isDisposed()) {
update();
}
updateImageInProgress = false;
}
});
}
}
}
public void widgetDisposed(DisposeEvent event) {
super.dispose();
canvas.dispose();
closePlotWindow();
}
public void onMagnify() {
if (canvas.isDisposed()) {
SWTMagnifier.getInstance().removeWidgetMagnifyListener(this);
} else {
updateImage();
}
}
private void update() {
try {
image = SWTImageFactory.createImageFromOutsideResources(System.getenv("HOME") + "/offscreenImages/spy/" + imageKey);
} catch (Exception e) {
}
canvas.setLayoutData(SWTWidgetFactory.getInstance().getImageGridData(width, height, true));
canvas.redraw();
}
}
\ No newline at end of file
......@@ -36,6 +36,7 @@ import fr.ill.ics.client.control.MainWindow;
import fr.ill.ics.client.control.parser.descriptor.PlotDataDescriptor;
import fr.ill.ics.client.control.plot.PlotData;
import fr.ill.ics.client.control.plot.PlotDataManager;
import fr.ill.ics.client.control.plot.PlotyManager;
import fr.ill.ics.client.control.plot.PropertyPlotData;
import fr.ill.ics.client.view.MainWindowPeer;
import fr.ill.ics.client.view.widget.plot.PlotManager;
......@@ -65,9 +66,9 @@ public abstract class MultiplotWindow implements IPropertyChangeListener {
public final static int THUMBNAIL_HEIGHT = 155;
public final static String PLOT_SCREENSHOTS_DIR = ConfigManager.NOMAD_CLIENT_FILES + ConfigManager.FILE_SEPARATOR + ConfigManager.getInstance().getString("offscreenImages");
public final static String PLOT_MULTIPLOT_DIR = PLOT_SCREENSHOTS_DIR + ConfigManager.FILE_SEPARATOR + "multiplot" + ConfigManager.FILE_SEPARATOR;
public final static String PLOT_PENDING_SCREENSHOTS_DIR = PLOT_MULTIPLOT_DIR + "pending" + ConfigManager.FILE_SEPARATOR;
public final static String PLOT_LOG_DIR = PLOT_SCREENSHOTS_DIR + ConfigManager.FILE_SEPARATOR + "log" + ConfigManager.FILE_SEPARATOR;
public final static String PLOT_WEB_DIR = PLOT_SCREENSHOTS_DIR + ConfigManager.FILE_SEPARATOR + "web" + ConfigManager.FILE_SEPARATOR;
// public final static String PLOT_PENDING_SCREENSHOTS_DIR = PLOT_MULTIPLOT_DIR + "pending" + ConfigManager.FILE_SEPARATOR;
// public final static String PLOT_LOG_DIR = PLOT_SCREENSHOTS_DIR + ConfigManager.FILE_SEPARATOR + "log" + ConfigManager.FILE_SEPARATOR;
// public final static String PLOT_WEB_DIR = PLOT_SCREENSHOTS_DIR + ConfigManager.FILE_SEPARATOR + "web" + ConfigManager.FILE_SEPARATOR;
private final static String DATAPLOT_CONTROLLER_TYPE = "data_plot";
private final static String DETECTOR_PLOTDATA_DESCRIPTOR = "detector_plot_data";
......@@ -154,13 +155,14 @@ public abstract class MultiplotWindow implements IPropertyChangeListener {
StringTokenizer tokenizer = new StringTokenizer(plotDataKeyAndControllerName, MultiplotWindow.SHARP);
String rawPlotDataKey = tokenizer.nextToken();
String controllerName = tokenizer.nextToken();
String imageTitle = tokenizer.nextToken();
int imageindex = Integer.valueOf(imageTitle).intValue() + NUMBER_PER_PAGE * actualImagesPage;
PlotDataDescriptor plotDataDescriptor = null;
PropertyPlotData plotData = null;
// Retrieve both indexes from the "raw" data key
String plotIndex = rawPlotDataKey.substring(rawPlotDataKey.indexOf(".") + 1, rawPlotDataKey.lastIndexOf("."));
String secondIndex = rawPlotDataKey.substring(rawPlotDataKey.lastIndexOf(".") + 1);
String plotIndex = rawPlotDataKey.substring(rawPlotDataKey.indexOf(".") + 1, rawPlotDataKey.length());
// Get controller (should be always plotData), controller type and its plotDataDescriptor.
// Instead of using the controllerName given in the image name, retrieve it using the controller type. This is because sometimes the name of the controller given which belongs to the image name does not correspond to the name of the real plot controller.
......@@ -221,7 +223,7 @@ public abstract class MultiplotWindow implements IPropertyChangeListener {
// Configure the plot: set the type of view (RAW, SLICE, CHANNEL, SUM)
Property multiplotType = PropertyManager.getInstance().getDynamicProperty(controller, ControllerAndPropertyConstants.MULTIPLOT_TYPE + "." + plotIndex);
setMultiplot(controller, multiplotType.getValue(), plotIndex, secondIndex);
setMultiplot(controller, multiplotType.getValue(), plotIndex, imageindex);
String simplePlotDataKey = plotDataDescriptor.getKey();
String title = PlotManager.getInstance().getPlotDataProperties(simplePlotDataKey).getTitle();
......@@ -236,8 +238,14 @@ public abstract class MultiplotWindow implements IPropertyChangeListener {
String yAxisTitlePropertyName = PlotManager.getInstance().getPlotDataProperties(simplePlotDataKey).getyAxisTitleProperty();
Property yAxisTitleProperty = PropertyManager.getInstance().getProperty(controller, yAxisTitlePropertyName + "." + plotIndex, PluginType.GENERAL);
PlotManager.getInstance().activatePlot(plots, title, xAxisTitle, yAxisTitle, titleProperty, xAxisTitleProperty, yAxisTitleProperty, null);
PlotManager.getInstance().openPlotWindow();
if (ConfigManager.getInstance().getPlotyVersion() == 1) {
PlotManager.getInstance().activatePlot(plots, title, xAxisTitle, yAxisTitle, titleProperty, xAxisTitleProperty, yAxisTitleProperty, null);
PlotManager.getInstance().openPlotWindow();
}
else if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyManager.getInstance().plot(PlotManager.getInstance().computePlotTabKey(plots), plots, title, title, xAxisTitle, yAxisTitle, titleProperty,
xAxisTitleProperty, yAxisTitleProperty);
}
}
} catch (PropertyNotFoundException e) {
......@@ -309,7 +317,7 @@ public abstract class MultiplotWindow implements IPropertyChangeListener {
// In order to get the right plotData when opening the Nomad plot window we
// will have to update a specific property which depends on "multiplot_type"
// property value
public void setMultiplot(Controller dataPlotController, String multiplotType, String firstIndex, String secondIndex) {
public void setMultiplot(Controller dataPlotController, String multiplotType, String firstIndex, int imageindex) {
Property property = null;
try {
......@@ -327,7 +335,7 @@ public abstract class MultiplotWindow implements IPropertyChangeListener {
}
if (property != null) {
property.setValue(secondIndex);
property.setValue(String.valueOf(imageindex));
// Set also the property dataState
String propertyName = ControllerAndPropertyConstants.dataStatePropertyName + "." + firstIndex;
......
......@@ -24,12 +24,14 @@ public abstract class PlotImageItem {
protected String imageTitle;
protected String controllerName;
protected String plotDataKey;
protected int index;
public PlotImageItem(String fileName) {
public PlotImageItem(String fileName, int index) {
StringTokenizer tokenizer = new StringTokenizer(fileName, MultiplotWindow.SHARP);
controllerName = tokenizer.nextToken();
plotDataKey = tokenizer.nextToken();
imageTitle = tokenizer.nextToken();
this.index = index;
}
}
......@@ -167,7 +167,7 @@ public class SWTMultiplotWindow extends MultiplotWindow implements ICanvasClickL
plotImageComposite.setLayoutData(SWTWidgetFactory.getInstance().getNoGrabGridData());
itemComposite[getActualImageNumber(i)] = plotImageComposite;
SWTPlotImageItem item = new SWTPlotImageItem(this, plotImageComposite, imageName);
SWTPlotImageItem item = new SWTPlotImageItem(this, plotImageComposite, imageName, getActualImageNumber(i));
plotItemByImageNames.put(imageName + MultiplotWindow.FILES_EXTENSION, item);
imageNamesAndTimes.put(imageName + MultiplotWindow.FILES_EXTENSION, 0L);
canvasArray[i - NUMBER_PER_PAGE * pageNumber] = item;
......@@ -250,7 +250,7 @@ public class SWTMultiplotWindow extends MultiplotWindow implements ICanvasClickL
Composite testComposite = itemComposite[getActualImageNumber(i)];
testComposite.setVisible(true);
item = new SWTPlotImageItem(this, testComposite, images[i]);
item = new SWTPlotImageItem(this, testComposite, images[i], getActualImageNumber(i));
SWTPlotImageCanvas canvas = item.getCanvas();
canvas.redraw();
imageName = images[i].substring(images[i].lastIndexOf(MultiplotWindow.SHARP) + 1);
......
......@@ -48,14 +48,16 @@ public class SWTPlotImageCanvas extends Canvas implements MouseListener {
private ICanvasClickListener clickListener;
private String plotDataName;
private String controllerName;
private int index;
private Image image;
public SWTPlotImageCanvas(ICanvasClickListener listener, Composite parent, String imageName, String controllerName, String plotDataKey) {
public SWTPlotImageCanvas(ICanvasClickListener listener, Composite parent, String imageName, String controllerName, int index, String plotDataKey) {
super(parent, SWT.BORDER);
clickListener = listener;
plotDataName = plotDataKey;
this.controllerName = controllerName;
this.index = index;
try {
setImage(imageName);
......@@ -121,7 +123,7 @@ public class SWTPlotImageCanvas extends Canvas implements MouseListener {
getDisplay().asyncExec(new Runnable() {
public void run() {
setCursor(SWTWidgetFactory.getInstance().getWaitCursor());
clickListener.onCanvasClick(plotDataName + MultiplotWindow.SHARP + controllerName);
clickListener.onCanvasClick(plotDataName + MultiplotWindow.SHARP + controllerName + MultiplotWindow.SHARP + index);
if (!isDisposed()) {
resetCanvasImage();
}
......
......@@ -38,15 +38,15 @@ public class SWTPlotImageItem extends PlotImageItem {
private Label canvasLabel;
private Composite parent;
public SWTPlotImageItem(ICanvasClickListener listener, Composite parent, String fileName) {
super(fileName);
public SWTPlotImageItem(ICanvasClickListener listener, Composite parent, String fileName, int index) {
super(fileName, index);
this.parent = parent;
this.canvasLabel = SWTWidgetFactory.getInstance().createLabel(parent, "", FontFactory.standardFontDataHeight, FontFactory.BOLD_STYLE);
canvasLabel.setText(imageTitle);
GridData gridData = SWTWidgetFactory.getInstance().getHorizontalGridData();
gridData.horizontalAlignment = GridData.CENTER;
canvasLabel.setLayoutData(gridData);
this.canvas = new SWTPlotImageCanvas(listener, parent, fileName, controllerName, plotDataKey);
this.canvas = new SWTPlotImageCanvas(listener, parent, fileName, controllerName, index, plotDataKey);
}
......
......@@ -41,6 +41,8 @@ public class ControllerAndPropertyConstants {
public final static String DATA_STATE = "data_state";
public final static String detectorXPositionPropertyName = "detector_x_position";
public final static String detectorYPositionPropertyName = "detector_y_position";
public final static String xPhysicalSizePropertyName = "detector_x_physical_size";
public final static String yPhysicalSizePropertyName = "detector_y_physical_size";
public final static String channelPositionPropertyName = "channel_position";
public final static String slicePositionPropertyName = "slice_position";
public final static String AutoContrastPropertyName = "auto_contrast";
......@@ -60,10 +62,21 @@ public class ControllerAndPropertyConstants {
public final static String roiY0PropertyName = "roi_y0";
public final static String roiX1PropertyName = "roi_x1";
public final static String roiY1PropertyName = "roi_y1";
public final static String roiSumPropertyName = "roi_sum";
public final static String roiAddCommandName = "add";
public final static String roiRazCommandName = "raz";
public final static String countActivatedPropertyName = "count_activated";
public final static String dataStatePropertyName = "data_state";
public final static String detectorMaxXPositionPropertyName = "detector_max_x_position";
public final static String detectorMaxYPositionPropertyName = "detector_max_y_position";
public final static String channelMaxPositionPropertyName = "channel_max_position";
public final static String sliceMaxPositionPropertyName = "slice_max_position";
public final static String useGridPropertyName = "use_grid";
public final static String useLogPropertyName = "use_log";
public final static String colorMapPropertyName = "color_map";
public final static String minColorLimitPropertyName = "min_color_limit";
public final static String maxColorLimitPropertyName = "max_color_limit";
public final static String NBELEMENTS = "nbElements";
// Status values / Property Values
......