Commit 8d6dd60a authored by Ken Edmundson's avatar Ken Edmundson
Browse files

interface updates

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@5929 41f8697f-d340-4b68-9986-7bafba869bb8
parent ca2ed208
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include "CameraFocalPlaneMap.h"
#include "CameraDistortionMap.h"
#include "ControlPoint.h"
#include "Control.h"
#include "CorrelationMatrix.h"
#include "iTime.h"
#include "Latitude.h"
@@ -124,6 +125,30 @@ namespace Isis {
  }


  BundleAdjust::BundleAdjust(BundleSettings bundleSettings,
                             Control &cnet,
                             SerialNumberList &snlist,
                             bool bPrintSummary) {
    // initialize m_dConvergenceThreshold ???
    // ??? deleted keyword ??? m_dConvergenceThreshold = 0.0;    // This is needed for deltack???
    // ???                                   //JWB - this gets overwritten in Init... move to constructor ???????????????????????????????????????????????????????????????????????
    // ???
    // initialize constructor dependent settings...
    // m_bPrintSummary, m_bCleanUp, m_strCnetFileName, m_pCnet, m_pSnList, m_pHeldSnList,
    // m_bundleSettings
    Progress progress;
    m_bPrintSummary = bPrintSummary;
    m_bCleanUp = false;
    m_strCnetFileName = cnet.fileName();
    m_pCnet = new Isis::ControlNet(cnet.fileName(), &progress);
    m_pSnList = &snlist;
    m_pHeldSnList = NULL;
    m_bundleSettings = bundleSettings;

    init();
  }


  BundleAdjust::BundleAdjust(BundleSettings bundleSettings,
                             Isis::ControlNet &cnet, 
                             Isis::SerialNumberList &snlist,
+5 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ template< typename A, typename B > class QMap;

namespace Isis {
  class BundleResults;
  class Control;

  /**
   * @author 2006-05-30 Jeff Anderson, Debbie A. Cook, and Tracie Sucharski
@@ -199,6 +200,10 @@ namespace Isis {
                   QString &cnet, 
                   SerialNumberList &snlist, 
                   bool printSummary = true);
      BundleAdjust(BundleSettings bundleSettings,
                   Control &cnet,
                   SerialNumberList &snlist,
                   bool bPrintSummary);
      BundleAdjust(BundleSettings bundleSettings, 
                   ControlNet &cnet, 
                   SerialNumberList &snlist, 
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ namespace Isis {
  class BundleSettings;
  class BundleStatistics;
  class FileName;
  class ImageList;
  class Project;
  class PvlObject;
  class XmlStackedHandlerReader;
@@ -109,6 +110,7 @@ namespace Isis {
      FileName         *m_controlNetworkFileName;
      BundleSettings   *m_settings;
      BundleStatistics *m_statisticsResults;
      QList<ImageList *> *m_images;

      /**
       * A unique ID for this BundleResults object (useful for others to reference this object
+1 −0
Original line number Diff line number Diff line
@@ -24,5 +24,6 @@
    <file alias="ice">icons/ice.png</file>
    <file alias="statistics">icons/statistics.png</file>
    <file alias="settings">icons/settings.png</file>
    <file alias="run">icons/run.png</file>
  </qresource>
</RCC>
+37 −22
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
#include "Control.h"
#include "iTime.h"
#include "JigsawSetupDialog.h"
#include "ui_JigsawDialog.h"
#include "ui_jigsawdialog.h"
#include "Process.h"
#include "Project.h"

@@ -22,6 +22,11 @@ namespace Isis {
    m_selectedControl = NULL;
    m_bundleSettings = NULL;

    QList<BundleResults *> bundleResults = m_project->bundleResults();
    if (bundleResults.size() <= 0) {
      m_ui->useLastSettings->setEnabled(false);
    }

    setWindowFlags(Qt::WindowStaysOnTopHint);
  }

@@ -36,7 +41,7 @@ namespace Isis {

  void JigsawDialog::on_JigsawSetupButton_pressed() {

    JigsawSetupDialog setupdlg(m_project, this);
    JigsawSetupDialog setupdlg(m_project, true, false, this);

    // if (m_bundleSettings != NULL && setupdlg.useLastSettings()) {
    // }
@@ -63,6 +68,15 @@ namespace Isis {
    if (m_bundleSettings == NULL) {
    }

    QList<BundleResults *> bundleResults = m_project->bundleResults();
    if (m_ui->useLastSettings->isChecked() && bundleResults.size() > 0) {
       BundleSettings *lastBundleSettings = (bundleResults.last())->bundleSettings();

       if (lastBundleSettings) {
         m_bundleSettings = lastBundleSettings;
       }
    }

    SerialNumberList snlist;

    QList<ImageList *> imagelists = m_project->images();
@@ -76,19 +90,26 @@ namespace Isis {
      }
    }

//    ControlNet *cnet = m_selectedControl->controlNet();

//    BundleAdjust bundleAdjustment(*m_bundleSettings, *cnet, snlist, false);
    BundleAdjust bundleAdjustment(*m_bundleSettings, *m_selectedControlName, snlist, false);
    BundleAdjust bundleAdjustment(*m_bundleSettings, *m_selectedControl, snlist, false);
    // run bundle (thread with BundleThread::QThread) - pump output to modeless dialog
    // BundleResults results = bundleAdjustment.solveCholesky();
    bundleAdjustment.solveCholesky();

//     if ( !bundleAdjustment.isConverged() ) {
//        qDebug() << "Status = Bundle did not converge, camera pointing NOT updated";
//      }
//      else {
    if ( bundleAdjustment.isConverged() ) {
      // create BundleResults object
      // BundleResults results = bundleAdjustment.solveCholesky();
      // should be returned by BundleAdjustment?
      QString fname = m_selectedControl->fileName();
      BundleResults *dummyBundleResults = new BundleResults(*m_bundleSettings, fname);
      dummyBundleResults->setRunTime(Isis::iTime::CurrentLocalTime().toAscii().data());
      m_project->addBundleResults(dummyBundleResults);

      // create output control net
//      bundleAdjustment.controlNet()->Write("ONET.net");




//        for (int i = 0; i < bundleAdjustment.images(); i++) {
//          Process p;
//          CubeAttributeInput inAtt;
@@ -119,21 +140,15 @@ namespace Isis {
//          p.WriteHistory(*c);
//        }
//        qDebug() << "Status = Camera pointing updated";
//      }
    }
    else
      qDebug() << "Status = Bundle did not converge, camera pointing NOT updated";

#if 0
//#if 0
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // create dummy bundle results and add to project
    BundleSettings *settings = new BundleSettings();
    QString fname = m_selectedControl->fileName();
//    BundleResults *bundleResults = new BundleResults(*settings,*cnet, fname);
    BundleResults *bundleResults = new BundleResults(*settings, fname);
    bundleResults->setRunTime(Isis::iTime::CurrentLocalTime().toAscii().data());
    m_project->addBundleResults(bundleResults);


    m_ui->useLastSettings->setEnabled(true);
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#endif
//#endif
  }
}
Loading