Skip to content
Snippets Groups Projects
Commit dd336235 authored by Thilbault Piketty's avatar Thilbault Piketty
Browse files

allow sensor send SCAN-766

parent fb1ed23c
Branches jupyterlab
Tags
No related merge requests found
...@@ -41,7 +41,7 @@ public class CurrentScan1DResultBean extends JSplitPane implements IChartViewerL ...@@ -41,7 +41,7 @@ public class CurrentScan1DResultBean extends JSplitPane implements IChartViewerL
TangoKey xTangoKey = null; TangoKey xTangoKey = null;
// GUI ELEMENTS // GUI ELEMENTS
private final CurrentScan1DActuatorInput actuatorInput = new CurrentScan1DActuatorInput(); private final CurrentScan1DActuatorInput actuatorInput;
private final Chart chartViewer = new Chart(); private final Chart chartViewer = new Chart();
private final ChartViewerBox chartBox = new ChartViewerBox(); private final ChartViewerBox chartBox = new ChartViewerBox();
...@@ -61,8 +61,9 @@ public class CurrentScan1DResultBean extends JSplitPane implements IChartViewerL ...@@ -61,8 +61,9 @@ public class CurrentScan1DResultBean extends JSplitPane implements IChartViewerL
// private List<String> dataViewIdList = new ArrayList<String>(); // private List<String> dataViewIdList = new ArrayList<String>();
public CurrentScan1DResultBean(boolean showImageAsSpectrumStack) { public CurrentScan1DResultBean(boolean showImageAsSpectrumStack, boolean isSendSensor) {
this.showImageAsSpectrumStack = showImageAsSpectrumStack; this.showImageAsSpectrumStack = showImageAsSpectrumStack;
actuatorInput = new CurrentScan1DActuatorInput(isSendSensor);
initGUI(); initGUI();
} }
...@@ -568,7 +569,7 @@ public class CurrentScan1DResultBean extends JSplitPane implements IChartViewerL ...@@ -568,7 +569,7 @@ public class CurrentScan1DResultBean extends JSplitPane implements IChartViewerL
scanServer = args[0]; scanServer = args[0];
} }
CurrentScan1DResultBean bean = new CurrentScan1DResultBean(true); CurrentScan1DResultBean bean = new CurrentScan1DResultBean(true, false);
bean.setScanServerDeviceName(scanServer); bean.setScanServerDeviceName(scanServer);
// bean.setY1SensorsDataList(new String[] { "data_01", "data_02" }); // bean.setY1SensorsDataList(new String[] { "data_01", "data_02" });
// bean.setActuatorName("actuator_1_1"); // bean.setActuatorName("actuator_1_1");
......
...@@ -74,8 +74,9 @@ public class CurrentScanResultBean extends AbstractTangoBox ...@@ -74,8 +74,9 @@ public class CurrentScanResultBean extends AbstractTangoBox
private CurrentScanConfigurationBean currentScanConfigurationBean = null; private CurrentScanConfigurationBean currentScanConfigurationBean = null;
public CurrentScanResultBean(boolean showImageAsSpectrumStack, String exportTrajectortDeviceName) { public CurrentScanResultBean(boolean showImageAsSpectrumStack, String exportTrajectortDeviceName,
scan1DBean = new CurrentScan1DResultBean(showImageAsSpectrumStack); boolean isSendSensor) {
scan1DBean = new CurrentScan1DResultBean(showImageAsSpectrumStack, isSendSensor);
scan2DBean = new CurrentScan2DResultBean(exportTrajectortDeviceName); scan2DBean = new CurrentScan2DResultBean(exportTrajectortDeviceName);
initGUI(); initGUI();
} }
...@@ -452,7 +453,7 @@ public class CurrentScanResultBean extends AbstractTangoBox ...@@ -452,7 +453,7 @@ public class CurrentScanResultBean extends AbstractTangoBox
*/ */
public static void main(final String[] args) { public static void main(final String[] args) {
CurrentScanResultBean bean = new CurrentScanResultBean(false, null); CurrentScanResultBean bean = new CurrentScanResultBean(false, null, false);
// bean.setZSensorsDataList(new String[] { "data_01" }); // bean.setZSensorsDataList(new String[] { "data_01" });
// bean.setScanServerDeviceName("test/scan/julien"); // bean.setScanServerDeviceName("test/scan/julien");
......
...@@ -40,11 +40,17 @@ public class CurrentScan1DActuatorInput extends JScrollPane implements IScanServ ...@@ -40,11 +40,17 @@ public class CurrentScan1DActuatorInput extends JScrollPane implements IScanServ
private boolean confirmation = true; private boolean confirmation = true;
private String oldDate = null; private String oldDate = null;
private boolean isSendSensor = false;
public CurrentScan1DActuatorInput() { public CurrentScan1DActuatorInput() {
initGUI(); initGUI();
} }
public CurrentScan1DActuatorInput(boolean isSendSensor) {
this();
this.isSendSensor = isSendSensor;
}
public void initGUI() { public void initGUI() {
containPanel.setLayout(new BorderLayout()); containPanel.setLayout(new BorderLayout());
mainPanel.setLayout(new GridBagLayout()); mainPanel.setLayout(new GridBagLayout());
...@@ -84,10 +90,8 @@ public class CurrentScan1DActuatorInput extends JScrollPane implements IScanServ ...@@ -84,10 +90,8 @@ public class CurrentScan1DActuatorInput extends JScrollPane implements IScanServ
if ((messageConfirmation != null) && !messageConfirmation.isEmpty()) { if ((messageConfirmation != null) && !messageConfirmation.isEmpty()) {
result = JOptionPane.showConfirmDialog(this, messageConfirmation, "Confirmation", result = JOptionPane.showConfirmDialog(this, messageConfirmation, "Confirmation",
JOptionPane.YES_NO_CANCEL_OPTION); JOptionPane.YES_NO_CANCEL_OPTION);
} } else {
else { JOptionPane.showMessageDialog(this, "No data to send", "Information", JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(this, "No data to send", "Information",
JOptionPane.INFORMATION_MESSAGE);
result = JOptionPane.CANCEL_OPTION; result = JOptionPane.CANCEL_OPTION;
} }
} }
...@@ -158,33 +162,72 @@ public class CurrentScan1DActuatorInput extends JScrollPane implements IScanServ ...@@ -158,33 +162,72 @@ public class CurrentScan1DActuatorInput extends JScrollPane implements IScanServ
String[] tmpActuatorsDataList = null; String[] tmpActuatorsDataList = null;
String[] tmpActuatorsList = null; String[] tmpActuatorsList = null;
String[] tmpXActuatorsDataList = CurrentScanDataModel.readAttributeList( String[] tmpXActuatorsDataList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
scanServerDeviceName, CurrentScanDataModel.ACTUATORS_DATA_LIST); CurrentScanDataModel.ACTUATORS_DATA_LIST);
String[] tmpXActuatorsList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
CurrentScanDataModel.ACTUATORS_LIST);
String[] tmpXActuatorsList = CurrentScanDataModel.readAttributeList( String[] tmpYActuatorsDataList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
scanServerDeviceName, CurrentScanDataModel.ACTUATORS_LIST); CurrentScanDataModel.YACTUATORS_DATA_LIST);
String[] tmpYActuatorsList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
CurrentScanDataModel.YACTUATORS_LIST);
String[] tmpYActuatorsDataList = CurrentScanDataModel.readAttributeList( String[] tmpXSensorsDataList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
scanServerDeviceName, CurrentScanDataModel.YACTUATORS_DATA_LIST); CurrentScanDataModel.SENSORS_DATA_LIST);
String[] tmpYActuatorsList = CurrentScanDataModel.readAttributeList( String[] tmpXSensorsList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
scanServerDeviceName, CurrentScanDataModel.YACTUATORS_LIST); CurrentScanDataModel.SENSORS_LIST);
String[] tmpXDataList;
if (isSendSensor) {
tmpXDataList = new String[tmpXActuatorsDataList.length + tmpXSensorsDataList.length];
} else {
tmpXDataList = new String[tmpXActuatorsDataList.length];
}
int index = 0;
for (String data : tmpXActuatorsDataList) {
tmpXDataList[index] = data;
index++;
}
if (isSendSensor) {
for (String data : tmpXSensorsDataList) {
tmpXDataList[index] = data;
index++;
}
}
String[] tmpXList;
if (isSendSensor) {
tmpXList = new String[tmpXActuatorsList.length + tmpXSensorsList.length];
} else {
tmpXList = new String[tmpXActuatorsList.length];
}
index = 0;
for (String data : tmpXActuatorsList) {
tmpXList[index] = data;
index++;
}
if (isSendSensor) {
for (String data : tmpXSensorsList) {
tmpXList[index] = data;
index++;
}
}
if ((tmpYActuatorsDataList != null) && (tmpYActuatorsDataList.length > 0)) { if ((tmpYActuatorsDataList != null) && (tmpYActuatorsDataList.length > 0)) {
tmpActuatorsDataList = tmpYActuatorsDataList; tmpActuatorsDataList = tmpYActuatorsDataList;
tmpActuatorsList = tmpYActuatorsList; tmpActuatorsList = tmpYActuatorsList;
} } else {
else { tmpActuatorsDataList = tmpXDataList;
tmpActuatorsDataList = tmpXActuatorsDataList; tmpActuatorsList = tmpXList;
tmpActuatorsList = tmpXActuatorsList;
} }
// System.out.println("tmpXActuatorsDataList=" + // System.out.println("tmpXActuatorsDataList=" +
// Arrays.toString(tmpXActuatorsDataList)); // Arrays.toString(tmpXActuatorsDataList));
// System.out.println("tmpActuatorsList=" + Arrays.toString(tmpActuatorsList)); // System.out.println("tmpActuatorsList=" + Arrays.toString(tmpActuatorsList));
if ((tmpActuatorsDataList == null) || (tmpActuatorsDataList.length == 0) if ((tmpActuatorsDataList == null) || (tmpActuatorsDataList.length == 0) || (tmpActuatorsList == null)
|| (tmpActuatorsList == null) || (tmpActuatorsList.length == 0) || (tmpActuatorsList.length == 0) || (tmpActuatorsDataList.length != tmpActuatorsList.length)) {
|| (tmpActuatorsDataList.length != tmpActuatorsList.length)) {
return; return;
} }
...@@ -241,7 +284,7 @@ public class CurrentScan1DActuatorInput extends JScrollPane implements IScanServ ...@@ -241,7 +284,7 @@ public class CurrentScan1DActuatorInput extends JScrollPane implements IScanServ
public static void main(final String[] args) { public static void main(final String[] args) {
CurrentScan1DActuatorInput bean = new CurrentScan1DActuatorInput(); CurrentScan1DActuatorInput bean = new CurrentScan1DActuatorInput();
bean.setScanServerDeviceName("test/scan/julien"); bean.setScanServerDeviceName("ica/salsa/scan.1");
JFrame frame = new JFrame(); JFrame frame = new JFrame();
frame.setContentPane(bean); frame.setContentPane(bean);
......
...@@ -25,8 +25,7 @@ import javax.swing.WindowConstants; ...@@ -25,8 +25,7 @@ import javax.swing.WindowConstants;
import fr.soleil.model.scanserver.CurrentScanDataModel; import fr.soleil.model.scanserver.CurrentScanDataModel;
import fr.soleil.model.scanserver.IScanServerListener; import fr.soleil.model.scanserver.IScanServerListener;
public class CurrentScan2DActuatorInput extends JScrollPane implements ActionListener, public class CurrentScan2DActuatorInput extends JScrollPane implements ActionListener, IScanServerListener {
IScanServerListener {
private static final long serialVersionUID = -4575569575384238007L; private static final long serialVersionUID = -4575569575384238007L;
...@@ -48,11 +47,17 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis ...@@ -48,11 +47,17 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis
private boolean confirmation = true; private boolean confirmation = true;
private String oldDate = null; private String oldDate = null;
private boolean isSendSensor = false;
public CurrentScan2DActuatorInput() { public CurrentScan2DActuatorInput() {
initGUI(); initGUI();
} }
public CurrentScan2DActuatorInput(boolean isSendSensor) {
this();
this.isSendSensor = isSendSensor;
}
public void initGUI() { public void initGUI() {
containPanel.setLayout(new BorderLayout()); containPanel.setLayout(new BorderLayout());
mainPanel.setLayout(new GridBagLayout()); mainPanel.setLayout(new GridBagLayout());
...@@ -89,10 +94,8 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis ...@@ -89,10 +94,8 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis
if ((messageConfirmation != null) && !messageConfirmation.isEmpty()) { if ((messageConfirmation != null) && !messageConfirmation.isEmpty()) {
result = JOptionPane.showConfirmDialog(this, messageConfirmation, "Confirmation", result = JOptionPane.showConfirmDialog(this, messageConfirmation, "Confirmation",
JOptionPane.YES_NO_CANCEL_OPTION); JOptionPane.YES_NO_CANCEL_OPTION);
} } else {
else { JOptionPane.showMessageDialog(this, "No data to send", "Information", JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(this, "No data to send", "Information",
JOptionPane.INFORMATION_MESSAGE);
result = JOptionPane.CANCEL_OPTION; result = JOptionPane.CANCEL_OPTION;
} }
} }
...@@ -196,31 +199,81 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis ...@@ -196,31 +199,81 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis
clearGUI(); clearGUI();
oldDate = CurrentScanDataModel.getStartDate(scanServerDeviceName); oldDate = CurrentScanDataModel.getStartDate(scanServerDeviceName);
String[] tmpXActuatorsDataList = CurrentScanDataModel.readAttributeList( String[] tmpXActuatorsDataList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
scanServerDeviceName, CurrentScanDataModel.ACTUATORS_DATA_LIST); CurrentScanDataModel.ACTUATORS_DATA_LIST);
String[] tmpXActuatorsList = CurrentScanDataModel.readAttributeList(
scanServerDeviceName, CurrentScanDataModel.ACTUATORS_LIST);
String[] tmpYActuatorsDataList = CurrentScanDataModel.readAttributeList( String[] tmpXActuatorsList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
scanServerDeviceName, CurrentScanDataModel.YACTUATORS_DATA_LIST); CurrentScanDataModel.ACTUATORS_LIST);
String[] tmpYActuatorsList = CurrentScanDataModel.readAttributeList(
scanServerDeviceName, CurrentScanDataModel.YACTUATORS_LIST);
// System.out.println(Arrays.toString(tmpXActuatorsDataList)); String[] tmpYActuatorsDataList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
// System.out.println(Arrays.toString(tmpXActuatorsList)); CurrentScanDataModel.YACTUATORS_DATA_LIST);
// String[] tmpYActuatorsList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
// System.out.println(Arrays.toString(tmpXActuatorsDataList)); CurrentScanDataModel.YACTUATORS_LIST);
// System.out.println(Arrays.toString(tmpYActuatorsList));
String[] tmpXSensorsDataList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
CurrentScanDataModel.SENSORS_DATA_LIST);
String[] tmpXSensorsList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
CurrentScanDataModel.SENSORS_LIST);
String[] tmpXDataList;
if (isSendSensor) {
tmpXDataList = new String[tmpXActuatorsDataList.length + tmpXSensorsDataList.length];
} else {
tmpXDataList = new String[tmpXActuatorsDataList.length];
}
int index = 0;
for (String data : tmpXActuatorsDataList) {
tmpXDataList[index] = data;
index++;
}
if (isSendSensor) {
for (String data : tmpXSensorsDataList) {
tmpXDataList[index] = data;
index++;
}
}
if ((tmpXActuatorsDataList == null) || (tmpXActuatorsDataList.length == 0) String[] tmpXList;
|| (tmpXActuatorsList == null) || (tmpXActuatorsList.length == 0) if (isSendSensor) {
|| (tmpXActuatorsDataList.length != tmpXActuatorsList.length)) { tmpXList = new String[tmpXActuatorsList.length + tmpXSensorsList.length];
} else {
tmpXList = new String[tmpXActuatorsList.length];
}
index = 0;
for (String data : tmpXActuatorsList) {
tmpXList[index] = data;
index++;
}
if (isSendSensor) {
for (String data : tmpXSensorsList) {
tmpXList[index] = data;
index++;
}
}
// String[] tmpXActuatorsDataList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
// CurrentScanDataModel.ACTUATORS_DATA_LIST);
// String[] tmpXActuatorsList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
// CurrentScanDataModel.ACTUATORS_LIST);
//
// String[] tmpYActuatorsDataList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
// CurrentScanDataModel.YACTUATORS_DATA_LIST);
// String[] tmpYActuatorsList = CurrentScanDataModel.readAttributeList(scanServerDeviceName,
// CurrentScanDataModel.YACTUATORS_LIST);
//
// // System.out.println(Arrays.toString(tmpXActuatorsDataList));
// // System.out.println(Arrays.toString(tmpXActuatorsList));
// //
// // System.out.println(Arrays.toString(tmpXActuatorsDataList));
// // System.out.println(Arrays.toString(tmpYActuatorsList));
//
if ((tmpXActuatorsDataList == null) || (tmpXActuatorsDataList.length == 0) || (tmpXActuatorsList == null)
|| (tmpXActuatorsList.length == 0) || (tmpXActuatorsDataList.length != tmpXActuatorsList.length)) {
return; return;
} }
if ((tmpYActuatorsDataList == null) || (tmpYActuatorsDataList.length == 0) if ((tmpYActuatorsDataList == null) || (tmpYActuatorsDataList.length == 0) || (tmpYActuatorsList == null)
|| (tmpYActuatorsList == null) || (tmpYActuatorsList.length == 0) || (tmpYActuatorsList.length == 0) || (tmpYActuatorsDataList.length != tmpYActuatorsList.length)) {
|| (tmpYActuatorsDataList.length != tmpYActuatorsList.length)) {
return; return;
} }
...@@ -236,9 +289,9 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis ...@@ -236,9 +289,9 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis
String yactuatorAttributeName = null; String yactuatorAttributeName = null;
String lineKey = null; String lineKey = null;
for (int i = 0; i < tmpXActuatorsDataList.length; i++) { for (int i = 0; i < tmpXDataList.length; i++) {
lineKey = String.valueOf(i); lineKey = String.valueOf(i);
xactuatorAttributeName = tmpXActuatorsDataList[i]; xactuatorAttributeName = tmpXDataList[i];
yactuatorAttributeName = tmpYActuatorsDataList[i]; yactuatorAttributeName = tmpYActuatorsDataList[i];
// Input X // Input X
constraints = new GridBagConstraints(); constraints = new GridBagConstraints();
...@@ -277,8 +330,7 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis ...@@ -277,8 +330,7 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis
mainPanel.add(dualButton, constraints); mainPanel.add(dualButton, constraints);
buttonList.add(dualButton); buttonList.add(dualButton);
dualMap.put(lineKey, dualMap.put(lineKey, new String[] { xactuatorAttributeName, yactuatorAttributeName });
new String[] { xactuatorAttributeName, yactuatorAttributeName });
} }
} }
...@@ -302,10 +354,9 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis ...@@ -302,10 +354,9 @@ public class CurrentScan2DActuatorInput extends JScrollPane implements ActionLis
if (confirmation) { if (confirmation) {
String messageConfirmation = buildConfirmationMessage(vectorInput); String messageConfirmation = buildConfirmationMessage(vectorInput);
if ((messageConfirmation != null) && !messageConfirmation.isEmpty()) { if ((messageConfirmation != null) && !messageConfirmation.isEmpty()) {
result = JOptionPane.showConfirmDialog(this, messageConfirmation, result = JOptionPane.showConfirmDialog(this, messageConfirmation, "Confirmation",
"Confirmation", JOptionPane.YES_NO_CANCEL_OPTION); JOptionPane.YES_NO_CANCEL_OPTION);
} } else {
else {
JOptionPane.showMessageDialog(this, "No data to send", "Information", JOptionPane.showMessageDialog(this, "No data to send", "Information",
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
result = JOptionPane.CANCEL_OPTION; result = JOptionPane.CANCEL_OPTION;
......
...@@ -19,8 +19,7 @@ import fr.soleil.comete.tango.data.service.helper.TangoDeviceHelper; ...@@ -19,8 +19,7 @@ import fr.soleil.comete.tango.data.service.helper.TangoDeviceHelper;
import fr.soleil.model.scanserver.CurrentScanDataModel; import fr.soleil.model.scanserver.CurrentScanDataModel;
import fr.soleil.model.scanserver.IScanServerListener; import fr.soleil.model.scanserver.IScanServerListener;
public class SimpleActuatorAttributeInputBean extends AbstractTangoBox implements public class SimpleActuatorAttributeInputBean extends AbstractTangoBox implements IScanServerListener {
IScanServerListener {
private static final long serialVersionUID = -4234975024341275029L; private static final long serialVersionUID = -4234975024341275029L;
...@@ -98,8 +97,7 @@ IScanServerListener { ...@@ -98,8 +97,7 @@ IScanServerListener {
public void setActuatorIndex(int index) { public void setActuatorIndex(int index) {
this.actuatorIndex = index; this.actuatorIndex = index;
double value = CurrentScanDataModel.getValueAtIndex(scanServerDeviceName, double value = CurrentScanDataModel.getValueAtIndex(scanServerDeviceName, actuatorAttributeName, index);
actuatorAttributeName, index);
// System.out.println(actuatorAttributeName + "[" + index + "]=" + value); // System.out.println(actuatorAttributeName + "[" + index + "]=" + value);
if (!Double.isNaN(value)) { if (!Double.isNaN(value)) {
attributeField.setText(String.valueOf(value)); attributeField.setText(String.valueOf(value));
...@@ -109,8 +107,7 @@ IScanServerListener { ...@@ -109,8 +107,7 @@ IScanServerListener {
public void setActuatorIndex(int x, int y) { public void setActuatorIndex(int x, int y) {
setActuatorXIndex(x); setActuatorXIndex(x);
setActuatorYIndex(y); setActuatorYIndex(y);
double value = CurrentScanDataModel.getValueAtIndex(scanServerDeviceName, double value = CurrentScanDataModel.getValueAtIndex(scanServerDeviceName, actuatorAttributeName, x, y);
actuatorAttributeName, x, y);
// System.out.println(actuatorName + "[" + x + "," + y + "]=" + value); // System.out.println(actuatorName + "[" + x + "," + y + "]=" + value);
if (!Double.isNaN(value)) { if (!Double.isNaN(value)) {
attributeField.setText(String.valueOf(value)); attributeField.setText(String.valueOf(value));
...@@ -141,6 +138,7 @@ IScanServerListener { ...@@ -141,6 +138,7 @@ IScanServerListener {
// It can be an alias // It can be an alias
if ((name != null) && !name.isEmpty()) { if ((name != null) && !name.isEmpty()) {
try { try {
name = name.replace("(sensor)", "");
String fullattributeName = TangoUtil.getfullAttributeNameForAttribute(name); String fullattributeName = TangoUtil.getfullAttributeNameForAttribute(name);
// System.out.println("fullattributeName=" + attributeName); // System.out.println("fullattributeName=" + attributeName);
if ((fullattributeName != null) && !fullattributeName.isEmpty()) { if ((fullattributeName != null) && !fullattributeName.isEmpty()) {
...@@ -177,16 +175,14 @@ IScanServerListener { ...@@ -177,16 +175,14 @@ IScanServerListener {
} }
protected boolean isValidConfiguration() { protected boolean isValidConfiguration() {
if ((getModel() == null) || getModel().isEmpty() || (attributeName == null) if ((getModel() == null) || getModel().isEmpty() || (attributeName == null) || attributeName.isEmpty()) {
|| attributeName.isEmpty()) {
return false; return false;
} }
return true; return true;
} }
protected boolean isActuatorValidConfiguration() { protected boolean isActuatorValidConfiguration() {
if ((model == null) || model.isEmpty() || (actuatorAttributeName == null) if ((model == null) || model.isEmpty() || (actuatorAttributeName == null) || actuatorAttributeName.isEmpty()) {
|| actuatorAttributeName.isEmpty()) {
return false; return false;
} }
return true; return true;
...@@ -277,8 +273,7 @@ IScanServerListener { ...@@ -277,8 +273,7 @@ IScanServerListener {
*/ */
public static void main(final String[] args) { public static void main(final String[] args) {
SimpleActuatorAttributeInputBean bean = new SimpleActuatorAttributeInputBean( SimpleActuatorAttributeInputBean bean = new SimpleActuatorAttributeInputBean(FlowLayout.CENTER);
FlowLayout.CENTER);
// bean.setModel("tango/tangotest/titan"); // bean.setModel("tango/tangotest/titan");
// bean.setAttributeName("ampli"); // bean.setAttributeName("ampli");
bean.setActuatorAttributeName("actuator_1_1"); bean.setActuatorAttributeName("actuator_1_1");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment