Isis 3 Programmer Reference
Isis::JigsawRunWidget Class Reference

This dialog allows the user to select the bundle adjust parameters, run the bundle, and view the results. More...

#include <JigsawRunWidget.h>

Inheritance diagram for Isis::JigsawRunWidget:
Inheritance graph
Collaboration diagram for Isis::JigsawRunWidget:
Collaboration graph

Classes

class  CopyImageToResultsFunctor
 Functor used to copy images to a specified destination directory. More...
 

Public Slots

void outputBundleStatus (QString status)
 Update the label or text edit area with the most recent status update by appending to list and refreshing. More...
 
void errorString (QString error)
 Update the label or text edit area with the error message by appending to list and refreshing. More...
 
void reportException (QString exception)
 Update the label or text edit area with the error message by appending to list and refreshing. More...
 
void updateIteration (int iteration)
 Update the label or text edit area with the error message by appending to list and refreshing. More...
 
void updatePoint (int point)
 
Update the label or text edit area with the error message by appending to list and refreshing. More...
 
void updateStatus (QString status)
 
Update the label or text edit area with the error message by appending to list and refreshing. More...
 
void bundleFinished (BundleSolutionInfo *bundleSolutionInfo)
 This method will be called when the bundle is complete. More...
 
void notifyThreadFinished ()
 Notifies the widget that the bundle thread has finished. More...
 

Public Member Functions

 JigsawRunWidget (Project *project, QWidget *parent=0)
 Constructor. More...
 
 JigsawRunWidget (Project *project, BundleSettingsQsp bundleSettings, Control *selectedControl, QString outputControlFileName, QWidget *parent=0)
 Constructor that takes bundle settings and a selected control. More...
 
 ~JigsawRunWidget ()
 Destructor. More...
 
void closeEvent (QCloseEvent *event)
 This method is called whenever the widget recieves a close request. More...
 

Protected Member Functions

void init ()
 Constructor delegate. More...
 

Protected Attributes

BundleAdjustm_bundleAdjust
 
Projectm_project
 
Controlm_selectedControl
 
QString m_selectedControlName
 
QString m_outputControlName
 
BundleSettingsQsp m_bundleSettings
 

Private Slots

void on_JigsawSetupButton_clicked ()
 
void on_JigsawRunButton_clicked ()
 
void on_JigsawAcceptButton_clicked ()
 Accepts the bundle results and saves them to the project. More...
 
void clearDialog ()
 Resets the dialog's status widgets to their default state. More...
 
void updateScrollBar ()
 Updates the scroll bar to position to its maximum setting (the bottom). More...
 

Private Attributes

bool m_bRunning
 Indicates whether or not the bundle adjust is running. More...
 
QThreadm_bundleThread
 separate thread for running bundle adjust calculations in. More...
 
BundleSolutionInfom_bundleSolutionInfo
 Captures the most recent results of a bundle. More...
 
Ui::JigsawRunWidget * m_ui
 Reference to self's UI generated with QtDesigner. More...
 

Detailed Description

This dialog allows the user to select the bundle adjust parameters, run the bundle, and view the results.

Author
2014-??-?? Ken Edmundson
History:

2014-09-18 Kimberly Oyama - Added code to thread the bundle run. It is currently commented out but it works.

2015-02-20 Jeannie Backer - Replaced BundleResults references with BundleSolutionInfo and BundleStatistics references with BundleResults due to class name changes.

2015-09-03 Jeannie Backer - Modified to create JigsawSetupDialog object using the value for the useLastSettings checkbox. When the Run button is clicked, the run time will now be used to create a uniquely named directory to contain the output files for the bundle solution.

2017-04-17 Ian Humphrey - Added second constructor that can be used when the JigsawWorkOrder initially creates a setup dialog so it can pass information to this dialog. Added init() delegate method for constructors to use to reduce code duplication. Modified notifyThreadFinished to update the Run button. References #4748.

2017-04-18 Ian Humphrey - Added members for an Accept, Reject, and Close button to determine when to save a successful bundle adjust's results to the project (or when to discard the results). Added placeholder private slots for accepting and rejecting the results. Removed default OK and Cancel buttons from UI file. Fixes #4781.

2017-04-18 Tracie Sucharski - Write the updated control net to the runtime folder under results folder. Fixes #4783.

2017-04-25 Ian Humphrey - Updated the setup clicked slot to load the current settings into the setup dialog if we are not using the last (most recent) settings in the project. Fixes #4817.

2017-04-26 Ian Humphrey - Added updateScrollBar() and clearDialog() to reduce code duplication. Modified the run clicked slot to clear the dialog display anytime that a bundle adjust is re-ran. Fixes #4808.

2017-04-27 Ian Humphrey - Modified to track the last used control net to properly update the jigsaw setup dialog's cnet combo box. References #4817.

2017-05-04 Ian Humphrey & Makayla Shepherd - Updated acceptBundleResults() to concurrently save the bundled images (ecub's) to the project. Fixes #4804, #4837.

2017-05-04 Ian Humphrey & Makayla Shepherd - Removed connection handling deleting the bundle adjust later. This prevents a segfault from occuring when the bundle adjust was accessed in the acceptBundleResults() slot, Since its memory may have been deleted by then. Now manually managing the memory for m_bundleAdjust. Fixes #4849.

2017-05-15 Tracie Sucharski - Commented out code in acceptBundleResults which was not being used and causing compile warnings. Add creation of BundleSolutionInfo folder to the acceptBundleResults method.

2017-05-16 Tracie Sucharski - Disable Close button if jigsaw has been run, force selection of accept or reject. Once a choice has been made, re-enable the Close button.

2017-06-14 Ken Edmundson - Write text summary file.

2017-07-27 Cole Neubauer - Added a project->setClean call if the bundle results are accepted. Fixes #4960

2017-11-01 Ian Humphrey - Create ecubs in the bundle results directory which contain updated SPICE. Fixes #4804, #4849.

2018-03-22 Ken Edmundson - Added member variable QString m_outputControlName. Added argument QString outputControlFileName to constructor. Modified acceptBundleResults method to take output control network filename from the JigsawSetupDialog.

2018-05-22 Ken Edmundson - Modified init() method to not set m_BundleSolutionInfo to NULL because JigsawDialog no longer owns it. Modified destructor to not delete m_BundleSolutionInfo or set it to NULL. Note this is NOT ideal, m_BundleSolutionInfo should be a QSharedPointer, not a raw pointer.

2018-05-31 Christopher Combs - Name changed from JigsawDialog to JigsawRunWidget. Now inherits from QFrame instead of QDialog. Added support for new workflow in which JigsawSetupDialog is only ever called from a button on this widget. Fixes #5428.

2018-06-14 Christopher Combs - Made changes according to new design mockup. Added status bar, control net info, and rms adj point sigmas sections. Removed buttons for close and reject. Now inherits from QDockWidget instead of QFrame, and handles close event if a bundle is running.

2018-06-15 Christopher Combs - Implemented "Write detached labels" checkbox. made changes to on_JigsawAcceptButton_clicked to reflect this.

2018-07-26 Tracie Sucharski - Reformated the widget to get rid of fixed sizes and use layouts to handle sizing instead. Also put entire widget in a scrolled area.

Definition at line 109 of file JigsawRunWidget.h.

Constructor & Destructor Documentation

◆ JigsawRunWidget() [1/2]

Isis::JigsawRunWidget::JigsawRunWidget ( Project project,
QWidget parent = 0 
)
explicit

Constructor.

Creates a widget for running a jigsaw (bundle adjustment) and changing the solve settings.

Parameters
Project*project Pointer to the project this widget belongs to.
QWidget*parent Pointer to parent widget.

Definition at line 38 of file JigsawRunWidget.cpp.

References init(), and m_bundleThread.

◆ JigsawRunWidget() [2/2]

Isis::JigsawRunWidget::JigsawRunWidget ( Project project,
BundleSettingsQsp  bundleSettings,
Control selectedControl,
QString  outputControlFileName,
QWidget parent = 0 
)
explicit

Constructor that takes bundle settings and a selected control.

Creates a widget after the jigsaw solve settings have been set up and a control has been selected.

Parameters
Project*project Pointer to the project this widget belongs to.
BundleSettingsQspbundleSettings Settings to give to this widget to use for a jigsaw.
Control*selectedControl Pointer to the selected control to adjust.
QWidget*parent Pointer to the parent widget.

Definition at line 57 of file JigsawRunWidget.cpp.

References Isis::Control::fileName(), init(), and m_bundleThread.

◆ ~JigsawRunWidget()

Isis::JigsawRunWidget::~JigsawRunWidget ( )

Destructor.

Definition at line 110 of file JigsawRunWidget.cpp.

References m_bundleThread, and m_ui.

Member Function Documentation

◆ bundleFinished

void Isis::JigsawRunWidget::bundleFinished ( BundleSolutionInfo bundleSolutionInfo)
slot

This method will be called when the bundle is complete.

This method will only be used when the bundle is threaded. It can be used when the bundle is not threaded but we don't need it because we have solveCholeskyBR().

Parameters
bundleSolutionInfoThe results of the bundle run.

Definition at line 643 of file JigsawRunWidget.cpp.

References Isis::iTime::CurrentLocalTime(), m_bundleSolutionInfo, m_ui, and Isis::BundleSolutionInfo::setRunTime().

◆ clearDialog

void Isis::JigsawRunWidget::clearDialog ( )
privateslot

Resets the dialog's status widgets to their default state.

This will clear the status text, reset the lcd displays to 0, and update the scroll on the scroll bar. This does NOT affect the state of the buttons.

Definition at line 477 of file JigsawRunWidget.cpp.

References m_ui, and updateScrollBar().

◆ closeEvent()

void Isis::JigsawRunWidget::closeEvent ( QCloseEvent *  event)

This method is called whenever the widget recieves a close request.

If a bundle is running, the user will be asked if they want to abort the bundle. In this case, the bundle thread must be scheduled to delete when it has finished aborting. Otherwise, the event will accept.

Parameters
eventThe close event being handled.

Definition at line 660 of file JigsawRunWidget.cpp.

References Isis::BundleAdjust::abortBundle(), m_bRunning, and m_bundleThread.

◆ errorString

void Isis::JigsawRunWidget::errorString ( QString  error)
slot

Update the label or text edit area with the error message by appending to list and refreshing.

Parameters
errorError status of bundle.

Definition at line 526 of file JigsawRunWidget.cpp.

References m_ui, and updateScrollBar().

◆ init()

void Isis::JigsawRunWidget::init ( )
protected

Constructor delegate.

Delegate method that helps the constructors. This is used to reduce repeated code.

Definition at line 78 of file JigsawRunWidget.cpp.

References Isis::Project::bundleSolutionInfo(), m_bRunning, and m_ui.

Referenced by JigsawRunWidget().

◆ notifyThreadFinished

void Isis::JigsawRunWidget::notifyThreadFinished ( )
slot

Notifies the widget that the bundle thread has finished.

This slot is used to notify the widget that the bundle has finished. The bundle thread finishes when the bundle adjust finishes (either successfully or unsuccessfully, or if the user aborts the run).

Definition at line 591 of file JigsawRunWidget.cpp.

References Isis::BundleSolutionInfo::bundleResults(), Isis::BundleAdjust::isAborted(), m_bRunning, m_bundleSolutionInfo, m_ui, Isis::BundleResults::sigmaCoord1StatisticsRms(), Isis::BundleResults::sigmaCoord2StatisticsRms(), Isis::BundleResults::sigmaCoord3StatisticsRms(), and updateScrollBar().

◆ on_JigsawAcceptButton_clicked

◆ outputBundleStatus

void Isis::JigsawRunWidget::outputBundleStatus ( QString  status)
slot

Update the label or text edit area with the most recent status update by appending to list and refreshing.

Parameters
statusCurrent status of bundle.

Definition at line 510 of file JigsawRunWidget.cpp.

References m_ui, and updateScrollBar().

◆ reportException

void Isis::JigsawRunWidget::reportException ( QString  exception)
slot

Update the label or text edit area with the error message by appending to list and refreshing.

Parameters
errorError status of bundle.

Definition at line 541 of file JigsawRunWidget.cpp.

References m_ui, and updateScrollBar().

◆ updateIteration

void Isis::JigsawRunWidget::updateIteration ( int  iteration)
slot

Update the label or text edit area with the error message by appending to list and refreshing.

Parameters
errorError status of bundle.

Definition at line 556 of file JigsawRunWidget.cpp.

References m_ui.

◆ updatePoint

void Isis::JigsawRunWidget::updatePoint ( int  point)
slot


Update the label or text edit area with the error message by appending to list and refreshing.

Parameters
errorError status of bundle.

Definition at line 567 of file JigsawRunWidget.cpp.

References m_ui.

◆ updateScrollBar

void Isis::JigsawRunWidget::updateScrollBar ( )
privateslot

Updates the scroll bar to position to its maximum setting (the bottom).

Definition at line 498 of file JigsawRunWidget.cpp.

References m_ui.

Referenced by clearDialog(), errorString(), notifyThreadFinished(), outputBundleStatus(), and reportException().

◆ updateStatus

void Isis::JigsawRunWidget::updateStatus ( QString  status)
slot


Update the label or text edit area with the error message by appending to list and refreshing.

Parameters
errorError status of bundle.

Definition at line 578 of file JigsawRunWidget.cpp.

References m_ui.

Member Data Documentation

◆ m_bRunning

bool Isis::JigsawRunWidget::m_bRunning
private

Indicates whether or not the bundle adjust is running.

Definition at line 144 of file JigsawRunWidget.h.

Referenced by closeEvent(), init(), and notifyThreadFinished().

◆ m_bundleSolutionInfo

BundleSolutionInfo* Isis::JigsawRunWidget::m_bundleSolutionInfo
private

Captures the most recent results of a bundle.

JigsawRunWidget owns this pointer.

Definition at line 175 of file JigsawRunWidget.h.

Referenced by bundleFinished(), notifyThreadFinished(), and on_JigsawAcceptButton_clicked().

◆ m_bundleThread

QThread* Isis::JigsawRunWidget::m_bundleThread
private

separate thread for running bundle adjust calculations in.

Definition at line 145 of file JigsawRunWidget.h.

Referenced by closeEvent(), JigsawRunWidget(), and ~JigsawRunWidget().

◆ m_ui

Ui::JigsawRunWidget* Isis::JigsawRunWidget::m_ui
private

The documentation for this class was generated from the following files: