Commit d8475862 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

Update the control net when a new active control is set in ipce. References #4567.

parent 6259e1ae
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -579,19 +579,40 @@ namespace Isis {
  /**
   * New control network being edited
   *
   * @param cnet (ControlNet *) The control network to edit
   * @param filename (Qstring) Need filename to write to widget label.  ControlNet doesn't
   *                       contain a filename.
   * @param cnet (Control *) The control network to edit
   *  
   * @internal
  */
  void ControlPointEditWidget::setControl(Control *control) {
    //  TODO  more error checking
    m_controlNet = control->controlNet();
    m_cnetFileName = control->fileName();

    m_cnetFileNameLabel->setText("Control Network: " + m_cnetFileName);
    setWindowTitle("Control Point Editor- Control Network File: " + m_cnetFileName);

    emit newControlNetwork(m_controlNet);
  }


  /**
   * New active control was set from ipce 
   *  
   * TODO:  This will need to be redesigned with the ::setControl method to better handle editing 
   * points from different cnets. 
   */
  void ControlPointEditWidget::setControlFromActive() {

    if (m_directory->project()->activeControl()) {
      m_controlNet = m_directory->project()->activeControl()->controlNet();
      m_cnetFileName = m_directory->project()->activeControl()->fileName();

      m_cnetFileNameLabel->setText("Control Network: " + m_cnetFileName);
      setWindowTitle("Control Point Editor- Control Network File: " + m_cnetFileName);

      emit newControlNetwork(m_controlNet);    
    }
  }


  /**
+7 −3
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ namespace Isis {
   *                           Fixes #4984.
   *   @history 2017-08-15 Tracie Sucharski - When ControlPoint is deleted, set the visibility of
   *                            this widget to false, then to true in loadPoint().  Fixes #5073.
   *   @history 2018-03-23 Tracie Sucharski - Update the cnet filename with current cnet.
   *   @history 2018-03-26 Tracie Sucharski - Update editor if a new active control net is set in
   *                            ipce. References #4567.
   */
  class ControlPointEditWidget : public QWidget {
    Q_OBJECT
@@ -104,6 +107,7 @@ namespace Isis {
    public slots:
      void setSerialNumberList(SerialNumberList *snList);
      void setControl(Control *control);
      void setControlFromActive();
      void setEditPoint(ControlPoint *controlPoint, QString serialNumber = "");
      void deletePoint(ControlPoint *controlPoint);