Skip to content
Snippets Groups Projects
Commit bd54c65f authored by Arthur Coolen's avatar Arthur Coolen
Browse files

BugID: 1030

If node.type starts with p get params that are not resolved for combolists
parent 9dcad461
No related branches found
No related tags found
No related merge requests found
...@@ -265,6 +265,12 @@ public class ParameterViewPanel extends javax.swing.JPanel implements IViewPanel ...@@ -265,6 +265,12 @@ public class ParameterViewPanel extends javax.swing.JPanel implements IViewPanel
setType(itsParam.type); setType(itsParam.type);
CardLayout cl=(CardLayout)CardPanel.getLayout(); CardLayout cl=(CardLayout)CardPanel.getLayout();
if (this.getType().substring(0,1).equals("p")) { if (this.getType().substring(0,1).equals("p")) {
try {
// Have to get new param because we need the unresolved limits field.
itsParam = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getParam(itsNode.treeID(),itsNode.paramDefID());
} catch (RemoteException ex) {
logger.debug("Error during getParam: "+ ex);
}
cl.show(CardPanel,"ComboCard"); cl.show(CardPanel,"ComboCard");
} else { } else {
cl.show(CardPanel,"TextCard"); cl.show(CardPanel,"TextCard");
......
...@@ -118,18 +118,15 @@ ...@@ -118,18 +118,15 @@
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="labelDirectionTypes" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="labelAngleTimes" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0"> <Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Component id="inputAngleTimes" alignment="0" min="-2" pref="160" max="-2" attributes="1"/>
<Component id="labelAngleTimes" min="-2" max="-2" attributes="0"/> <Component id="inputDirectionTypes" alignment="0" max="32767" attributes="1"/>
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<Component id="inputAngleTimes" min="-2" pref="159" max="-2" attributes="1"/>
</Group>
<Group type="102" alignment="0" attributes="1">
<Component id="labelDirectionTypes" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="inputDirectionTypes" max="32767" attributes="1"/>
</Group>
</Group> </Group>
<EmptySpace pref="34" max="32767" attributes="0"/> <EmptySpace pref="34" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
...@@ -152,8 +149,8 @@ ...@@ -152,8 +149,8 @@
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="labelAngleTimes" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="labelAngleTimes" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="inputAngle1" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="inputAngle1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="inputAngleTimes" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="labelAngle1" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="labelAngle1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="inputAngleTimes" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace min="15" pref="15" max="-2" attributes="0"/> <EmptySpace min="15" pref="15" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
package nl.astron.lofar.sas.otbcomponents.userpanels; package nl.astron.lofar.sas.otbcomponents.userpanels;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.Enumeration; import java.util.Enumeration;
...@@ -38,6 +37,7 @@ import nl.astron.lofar.sas.otb.MainFrame; ...@@ -38,6 +37,7 @@ import nl.astron.lofar.sas.otb.MainFrame;
import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode;
import nl.astron.lofar.sas.otb.jotdb2.jOTDBparam; import nl.astron.lofar.sas.otb.jotdb2.jOTDBparam;
import nl.astron.lofar.sas.otb.util.IViewPanel; import nl.astron.lofar.sas.otb.util.IViewPanel;
import nl.astron.lofar.sas.otb.util.OtdbRmi;
import nl.astron.lofar.sas.otb.util.UserAccount; import nl.astron.lofar.sas.otb.util.UserAccount;
import nl.astron.lofar.sas.otbcomponents.OLAPConfigPanel; import nl.astron.lofar.sas.otbcomponents.OLAPConfigPanel;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
...@@ -65,6 +65,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -65,6 +65,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
public ObservationPanel(MainFrame aMainFrame,jOTDBnode aNode) { public ObservationPanel(MainFrame aMainFrame,jOTDBnode aNode) {
initComponents(); initComponents();
itsMainFrame = aMainFrame; itsMainFrame = aMainFrame;
itsOtdbRmi=itsMainFrame.getSharedVars().getOTDBrmi();
itsNode=aNode; itsNode=aNode;
initialize(); initialize();
initPanel(); initPanel();
...@@ -79,6 +80,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -79,6 +80,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
public void setMainFrame(MainFrame aMainFrame) { public void setMainFrame(MainFrame aMainFrame) {
if (aMainFrame != null) { if (aMainFrame != null) {
itsMainFrame=aMainFrame; itsMainFrame=aMainFrame;
itsOtdbRmi=itsMainFrame.getSharedVars().getOTDBrmi();
} else { } else {
logger.debug("No Mainframe supplied"); logger.debug("No Mainframe supplied");
} }
...@@ -94,7 +96,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -94,7 +96,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
try { try {
//we need to get all the childs from this node. //we need to get all the childs from this node.
Vector childs = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(), 1); Vector childs = itsOtdbRmi.getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.nodeID(), 1);
// get all the params per child // get all the params per child
Enumeration e = childs.elements(); Enumeration e = childs.elements();
...@@ -106,11 +108,11 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -106,11 +108,11 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
// We need to keep all the nodes needed by this panel // We need to keep all the nodes needed by this panel
// if the node is a leaf we need to get the pointed to value via Param. // if the node is a leaf we need to get the pointed to value via Param.
if (aNode.leaf) { if (aNode.leaf) {
aParam = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getParam(aNode); aParam = itsOtdbRmi.getRemoteMaintenance().getParam(aNode);
setField(aParam,aNode); setField(aParam,aNode);
} else if (LofarUtils.keyName(aNode.name).equals("Beam")) { } else if (LofarUtils.keyName(aNode.name).equals("Beam")) {
//we need to get all the childs from this node also. //we need to get all the childs from this node also.
Vector beamChilds = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1); Vector beamChilds = itsOtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1);
// get all the params per child // get all the params per child
Enumeration e1 = beamChilds.elements(); Enumeration e1 = beamChilds.elements();
...@@ -120,13 +122,13 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -120,13 +122,13 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
aParam=null; aParam=null;
// We need to keep all the params needed by this panel // We need to keep all the params needed by this panel
if (aBeamNode.leaf) { if (aBeamNode.leaf) {
aParam = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getParam(aBeamNode); aParam = itsOtdbRmi.getRemoteMaintenance().getParam(aBeamNode);
} }
setField(aParam,aBeamNode); setField(aParam,aBeamNode);
} }
} else if (LofarUtils.keyName(aNode.name).equals("VirtualInstrument")) { } else if (LofarUtils.keyName(aNode.name).equals("VirtualInstrument")) {
//we need to get all the childs from this node also. //we need to get all the childs from this node also.
Vector VIChilds = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1); Vector VIChilds = itsOtdbRmi.getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1);
// get all the params per child // get all the params per child
Enumeration e2 = VIChilds.elements(); Enumeration e2 = VIChilds.elements();
...@@ -136,7 +138,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -136,7 +138,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
aParam=null; aParam=null;
// We need to keep all the params needed by this panel // We need to keep all the params needed by this panel
if (aVINode.leaf) { if (aVINode.leaf) {
aParam = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getParam(aVINode); aParam = itsOtdbRmi.getRemoteMaintenance().getParam(aVINode);
} }
setField(aParam,aVINode); setField(aParam,aVINode);
} }
...@@ -205,6 +207,14 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -205,6 +207,14 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
logger.debug("setField for: "+ aNode.name); logger.debug("setField for: "+ aNode.name);
boolean isRef = LofarUtils.isReference(aNode.limits); boolean isRef = LofarUtils.isReference(aNode.limits);
String aKeyName = LofarUtils.keyName(aNode.name); String aKeyName = LofarUtils.keyName(aNode.name);
try {
if (itsOtdbRmi.getRemoteTypes().getParamType(aParam.type).substring(0,1).equals("p")) {
// Have to get new param because we need the unresolved limits field.
aParam = itsOtdbRmi.getRemoteMaintenance().getParam(aNode.treeID(),aNode.paramDefID());
}
} catch (RemoteException ex) {
logger.debug("Error during getParam: "+ ex);
}
// Observation Specific parameters // Observation Specific parameters
if (aKeyName.equals("MSNameMask")) { if (aKeyName.equals("MSNameMask")) {
...@@ -407,7 +417,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -407,7 +417,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
return; return;
} }
try { try {
itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().saveNode(aNode); itsOtdbRmi.getRemoteMaintenance().saveNode(aNode);
} catch (RemoteException ex) { } catch (RemoteException ex) {
logger.debug("Error: saveNode failed : " + ex); logger.debug("Error: saveNode failed : " + ex);
} }
...@@ -504,7 +514,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -504,7 +514,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
return; return;
} }
try { try {
jOTDBparam aParam = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getParam(aNode); jOTDBparam aParam = itsOtdbRmi.getRemoteMaintenance().getParam(aNode);
// check if the node changed, and if the description was changed, if so ask if the new description // check if the node changed, and if the description was changed, if so ask if the new description
// should be saved. // should be saved.
if (itsOldDescriptionParam == null | itsOldDescriptionParam !=aParam) { if (itsOldDescriptionParam == null | itsOldDescriptionParam !=aParam) {
...@@ -512,8 +522,8 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -512,8 +522,8 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
if (!inputDescription.getText().equals(itsOldDescriptionParam.description) && !inputDescription.getText().equals("")) { if (!inputDescription.getText().equals(itsOldDescriptionParam.description) && !inputDescription.getText().equals("")) {
int answer=JOptionPane.showConfirmDialog(this,"The old description was altered, do you want to save the old one ?","alert",JOptionPane.YES_NO_OPTION); int answer=JOptionPane.showConfirmDialog(this,"The old description was altered, do you want to save the old one ?","alert",JOptionPane.YES_NO_OPTION);
if (answer == JOptionPane.YES_OPTION) { if (answer == JOptionPane.YES_OPTION) {
if (!itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().saveParam(itsOldDescriptionParam)) { if (!itsOtdbRmi.getRemoteMaintenance().saveParam(itsOldDescriptionParam)) {
logger.error("Saving param "+itsOldDescriptionParam.nodeID()+","+itsOldDescriptionParam.paramID()+"failed: "+ itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().errorMsg()); logger.error("Saving param "+itsOldDescriptionParam.nodeID()+","+itsOldDescriptionParam.paramID()+"failed: "+ itsOtdbRmi.getRemoteMaintenance().errorMsg());
} }
} }
} }
...@@ -636,15 +646,13 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -636,15 +646,13 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel3Layout.createSequentialGroup() .add(jPanel3Layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(labelDirectionTypes)
.add(labelAngleTimes))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel3Layout.createSequentialGroup() .add(org.jdesktop.layout.GroupLayout.LEADING, inputAngleTimes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 160, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(labelAngleTimes) .add(org.jdesktop.layout.GroupLayout.LEADING, inputDirectionTypes, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.add(19, 19, 19)
.add(inputAngleTimes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 159, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel3Layout.createSequentialGroup()
.add(labelDirectionTypes)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(inputDirectionTypes, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 34, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 34, Short.MAX_VALUE)
.add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(labelAngle1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(labelAngle1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
...@@ -662,8 +670,8 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -662,8 +670,8 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
.add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(labelAngleTimes) .add(labelAngleTimes)
.add(inputAngle1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(inputAngle1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(inputAngleTimes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(labelAngle1)
.add(labelAngle1)) .add(inputAngleTimes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(15, 15, 15) .add(15, 15, 15)
.add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(labelDirectionTypes) .add(labelDirectionTypes)
...@@ -1078,8 +1086,9 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -1078,8 +1086,9 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
changeDescription(itsAngle1); changeDescription(itsAngle1);
}//GEN-LAST:event_inputAngle1FocusGained }//GEN-LAST:event_inputAngle1FocusGained
private jOTDBnode itsNode = null; private jOTDBnode itsNode = null;
private MainFrame itsMainFrame; private MainFrame itsMainFrame;
private OtdbRmi itsOtdbRmi;
private Vector<jOTDBparam> itsParamList; private Vector<jOTDBparam> itsParamList;
private jOTDBparam itsOldDescriptionParam; private jOTDBparam itsOldDescriptionParam;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment