|
Hugin trunk 0.1
|
#include <Batch.h>

Public Types | |
| enum | EndTask { DO_NOTHING = 0 , CLOSE_PTBATCHERGUI = 1 , SHUTDOWN = 2 , SUSPEND = 3 , HIBERNATE = 4 } |
Public Member Functions | |
| Batch (wxFrame *parent) | |
| Main constructor. | |
| ~Batch () | |
| destructor | |
| void | AddAppToBatch (wxString app) |
| Adds an application entry in the batch list. | |
| void | AddProjectToBatch (wxString projectFile, wxString outputFile=wxEmptyString, wxString userDefinedSequence=wxEmptyString, Project::Target target=Project::STITCHING) |
| Adds a project entry in the batch list. | |
| bool | AllDone () |
| Returns true if there are no more projects pending execution. | |
| void | AppendBatchFile (wxString file) |
| Appends projects from file to batch list. | |
| void | CancelBatch () |
| Stops batch run, failing projects in progress. | |
| void | CancelProject (int index) |
| Cancels project at index in batch, failing it. | |
| void | ChangePrefix (int index, wxString newPrefix) |
| Changes output prefix for project at index. | |
| void | ChangeUserDefined (int index, wxString newUserDefined) |
| Changes user defined sequence for project at index. | |
| int | ClearBatch () |
| Clears batch list and returns 0 if succesful. | |
| bool | CompareProjectsInLists (int stitchListIndex, int batchListIndex) |
| Compares two project at indexes in both lists and returns true if they have identical project ids. | |
| int | GetFirstAvailable () |
| Returns index of first waiting project in batch. | |
| int | GetIndex (int id) |
| Returns index of project with selected id. | |
| Project * | GetProject (int index) |
| Returns project at index. | |
| int | GetProjectCount () |
| Returns number of projects in batch list. | |
| int | GetProjectCountByPath (wxString path) |
| Returns number of projects in batch list with the input file path. | |
| int | GetRunningCount () |
| Returns number of projects currently in progress. | |
| Project::Status | GetStatus (int index) |
| Returns current status of project at index. | |
| bool | IsRunning () |
| return true, if batch is running | |
| bool | IsPaused () |
| Returns true if batch execution is currently paused. | |
| int | LoadBatchFile (wxString file) |
| Clears current batch list and loads projects from batch file. | |
| int | LoadTemp () |
| Loads temporary batch file. | |
| bool | NoErrors () |
| Returns true if there are no failed projects in batch. | |
| void | OnProcessTerminate (wxProcessEvent &event) |
| Called internally when all running processes have completed and need to be removed from running list. | |
| bool | OnStitch (wxString scriptFile, wxString outname, wxString userDefinedOutput, int id) |
| Called to start stitch of project with input scriptFile. | |
| bool | OnDetect (wxString scriptFile, wxString userDefinedAssistant, int id) |
| called to start detecting | |
| void | PauseBatch () |
| Pauses and continues batch execution. | |
| void | RemoveProject (int id) |
| Removes project with id from batch list. | |
| void | RemoveProjectAtIndex (int selIndex) |
| Removes project at index from batch list. | |
| void | RunBatch () |
| Starts batch execution. | |
| void | RunNextInBatch () |
| Starts execution of next waiting project in batch. | |
| void | SaveBatchFile (wxString file) |
| Saves batch list to file. | |
| wxString | GetBatchFilename () |
| returns the filename of the default queue file | |
| void | SaveTemp () |
| Saves batch list to temporary file. | |
| void | SetStatus (int index, Project::Status status) |
| Used internally to set status of selected project. | |
| void | SwapProject (int index) |
| Swaps position in batch of project at index with project at index+1. | |
| void | ShowOutput (bool isVisible=true) |
| Set visibility of all running projects. | |
| size_t | GetFailedProjectsCount () |
| returns number of failed projects | |
| wxString | GetFailedProjectName (unsigned int i) |
| returns project file name of failed project with index i | |
| wxString | GetFailedProjectLog (unsigned int i) |
| returns log file name of failed project with index i | |
Public Attributes | |
| bool | deleteFiles |
| EndTask | atEnd |
| bool | overwrite |
| bool | verbose |
| bool | autostitch |
| bool | autoremove |
| bool | saveLog |
Private Attributes | |
| wxConfigBase * | m_config |
| ProjectArray | m_projList |
| FrameArray | m_stitchFrames |
| bool | m_cancelled |
| bool | m_paused |
| bool | m_running |
| bool | m_clearedInProgress |
| std::vector< FailedProject > | m_failedProjects |
| wxPowerResourceBlocker * | m_resBlocker |
|
explicit |
Main constructor.
Definition at line 48 of file Batch.cpp.
References atEnd, autoremove, autostitch, deleteFiles, DO_NOTHING, m_cancelled, m_clearedInProgress, m_paused, m_resBlocker, m_running, OnProcessTerminate(), overwrite, saveLog, threshold(), and verbose.
| Batch::~Batch | ( | ) |
Adds an application entry in the batch list.
Definition at line 74 of file Batch.cpp.
References m_projList, and threshold().
Referenced by AppendBatchFile(), and BatchFrame::OnButtonAddCommand().
| void Batch::AddProjectToBatch | ( | wxString | projectFile, |
| wxString | outputFile = wxEmptyString, |
||
| wxString | userDefinedSequence = wxEmptyString, |
||
| Project::Target | target = Project::STITCHING |
||
| ) |
Adds a project entry in the batch list.
Definition at line 80 of file Batch.cpp.
References Project::DETECTING, m_projList, and threshold().
Referenced by BatchFrame::AddArrayToList(), BatchFrame::AddDirToList(), BatchFrame::AddToList(), AppendBatchFile(), and OnProcessTerminate().
| bool Batch::AllDone | ( | ) |
Returns true if there are no more projects pending execution.
Definition at line 100 of file Batch.cpp.
References m_projList, Project::PAUSED, Project::RUNNING, threshold(), and Project::WAITING.
Referenced by OnProcessTerminate(), and RunNextInBatch().
Appends projects from file to batch list.
Definition at line 114 of file Batch.cpp.
References AddAppToBatch(), AddProjectToBatch(), Project::DETECTING, Project::FAILED, Project::idGenerator, m_projList, Project::PAUSED, Project::RUNNING, threshold(), and Project::WAITING.
Referenced by LoadBatchFile(), and LoadTemp().
| void Batch::CancelBatch | ( | ) |
Stops batch run, failing projects in progress.
Definition at line 184 of file Batch.cpp.
References CancelProject(), GetRunningCount(), m_cancelled, m_resBlocker, m_running, and threshold().
Referenced by ClearBatch(), and BatchFrame::OnButtonCancel().
Cancels project at index in batch, failing it.
Definition at line 198 of file Batch.cpp.
References GetRunningCount(), m_paused, m_running, m_stitchFrames, and threshold().
Referenced by CancelBatch(), and BatchFrame::OnButtonSkip().
Changes output prefix for project at index.
Definition at line 211 of file Batch.cpp.
References m_projList, and threshold().
Referenced by BatchFrame::ChangePrefix().
Changes user defined sequence for project at index.
Definition at line 216 of file Batch.cpp.
References m_projList, and threshold().
Referenced by BatchFrame::ChangeUserDefined(), and BatchFrame::OnButtonChangeUserDefinedSequence().
| int Batch::ClearBatch | ( | ) |
Clears batch list and returns 0 if succesful.
Definition at line 221 of file Batch.cpp.
References CancelBatch(), hugin_utils::HuginMessageBox(), Project::idGenerator, m_clearedInProgress, m_projList, m_stitchFrames, and threshold().
Referenced by LoadBatchFile(), BatchFrame::OnButtonClear(), and BatchFrame::OnClose().
Compares two project at indexes in both lists and returns true if they have identical project ids.
Definition at line 248 of file Batch.cpp.
References m_projList, m_stitchFrames, and threshold().
Referenced by BatchFrame::OnButtonSkip().
| wxString Batch::GetBatchFilename | ( | ) |
returns the filename of the default queue file
Definition at line 888 of file Batch.cpp.
References hugin_utils::GetUserAppDataDir(), and threshold().
Referenced by LoadTemp(), and SaveTemp().
returns log file name of failed project with index i
Definition at line 943 of file Batch.cpp.
References m_failedProjects, and threshold().
Referenced by FailedProjectsDialog::OnSelectProject().
returns project file name of failed project with index i
Definition at line 931 of file Batch.cpp.
References m_failedProjects, and threshold().
|
inline |
returns number of failed projects
Definition at line 145 of file Batch.h.
References m_failedProjects.
Referenced by BatchFrame::OnBatchFailed().
| int Batch::GetFirstAvailable | ( | ) |
Returns index of first waiting project in batch.
Definition at line 253 of file Batch.cpp.
References m_projList, threshold(), and Project::WAITING.
Referenced by RunNextInBatch().
Returns index of project with selected id.
Definition at line 278 of file Batch.cpp.
References m_projList, and threshold().
Referenced by OnProcessTerminate(), and RemoveProject().
Returns project at index.
Definition at line 290 of file Batch.cpp.
References m_projList.
Referenced by BatchFrame::AddArrayToList(), BatchFrame::AddDirToList(), BatchFrame::AddToList(), ProjectListBox::ChangePrefix(), ProjectListBox::ChangeUserDefined(), ProjectListBox::Fill(), BatchFrame::OnButtonAddCommand(), BatchFrame::OnButtonChangePrefix(), BatchFrame::OnButtonChangeUserDefinedSequence(), BatchFrame::OnButtonOpenWithHugin(), BatchFrame::OnButtonRemoveFromList(), BatchFrame::OnButtonReset(), ProjectListBox::OnContextMenu(), BatchFrame::OnRefillListBox(), and BatchFrame::OnUpdateListBox().
| int Batch::GetProjectCount | ( | ) |
Returns number of projects in batch list.
Definition at line 295 of file Batch.cpp.
References m_projList.
Referenced by BatchFrame::AddArrayToList(), BatchFrame::AddDirToList(), BatchFrame::AddToList(), BatchFrame::ChangePrefix(), BatchFrame::ChangeUserDefined(), ProjectListBox::Fill(), BatchFrame::OnButtonAddCommand(), BatchFrame::OnClose(), and BatchFrame::OnUpdateListBox().
Returns number of projects in batch list with the input file path.
Definition at line 300 of file Batch.cpp.
References m_projList, and threshold().
| int Batch::GetRunningCount | ( | ) |
Returns number of projects currently in progress.
Definition at line 313 of file Batch.cpp.
References m_stitchFrames.
Referenced by CancelBatch(), CancelProject(), BatchFrame::OnButtonPause(), BatchFrame::OnButtonResetAll(), BatchFrame::OnButtonSkip(), OnProcessTerminate(), BatchFrame::OnProcessTerminate(), and PauseBatch().
| Project::Status Batch::GetStatus | ( | int | index | ) |
Returns current status of project at index.
Definition at line 318 of file Batch.cpp.
References hugin_utils::HuginMessageBox(), m_projList, Project::MISSING, Project::status, and threshold().
Referenced by BatchFrame::OnButtonRemoveComplete(), BatchFrame::OnButtonRemoveFromList(), BatchFrame::OnButtonReset(), BatchFrame::OnButtonSkip(), and BatchFrame::OnUpdateListBox().
| bool Batch::IsPaused | ( | ) |
Returns true if batch execution is currently paused.
Definition at line 336 of file Batch.cpp.
References m_paused.
Referenced by BatchFrame::IsPaused(), BatchFrame::OnButtonPause(), BatchFrame::OnButtonRunBatch(), BatchFrame::UpdateTaskBarProgressBar(), and BatchFrame::UpdateTrayIcon().
| bool Batch::IsRunning | ( | ) |
return true, if batch is running
Definition at line 331 of file Batch.cpp.
References m_running.
Referenced by BatchFrame::IsRunning(), and BatchFrame::UpdateTrayIcon().
Clears current batch list and loads projects from batch file.
Definition at line 341 of file Batch.cpp.
References AppendBatchFile(), ClearBatch(), hugin_utils::HuginMessageBox(), and threshold().
Referenced by BatchFrame::OnButtonOpenBatch().
| int Batch::LoadTemp | ( | ) |
Loads temporary batch file.
Definition at line 361 of file Batch.cpp.
References AppendBatchFile(), GetBatchFilename(), and threshold().
Referenced by BatchFrame::BatchFrame().
| bool Batch::NoErrors | ( | ) |
Returns true if there are no failed projects in batch.
Definition at line 372 of file Batch.cpp.
References Project::FAILED, m_projList, and threshold().
Referenced by BatchFrame::OnButtonRemoveComplete(), and OnProcessTerminate().
called to start detecting
Definition at line 667 of file Batch.cpp.
References m_stitchFrames, threshold(), and verbose.
Referenced by RunNextInBatch().
| void Batch::OnProcessTerminate | ( | wxProcessEvent & | event | ) |
Called internally when all running processes have completed and need to be removed from running list.
Definition at line 384 of file Batch.cpp.
References AddProjectToBatch(), AllDone(), atEnd, autoremove, autostitch, CLOSE_PTBATCHERGUI, Project::DETECTING, DO_NOTHING, Project::FAILED, Project::FINISHED, GetIndex(), GetRunningCount(), HIBERNATE, m_cancelled, m_clearedInProgress, m_failedProjects, m_paused, m_projList, m_resBlocker, m_running, m_stitchFrames, NoErrors(), FailedProject::project, RemoveProjectAtIndex(), RunNextInBatch(), saveLog, SaveTemp(), SHUTDOWN, Project::STITCHING, SUSPEND, and threshold().
Referenced by Batch().
Called to start stitch of project with input scriptFile.
Definition at line 584 of file Batch.cpp.
References m_stitchFrames, overwrite, threshold(), and verbose.
Referenced by RunNextInBatch().
| void Batch::PauseBatch | ( | ) |
Pauses and continues batch execution.
Definition at line 695 of file Batch.cpp.
References GetRunningCount(), m_paused, m_projList, m_stitchFrames, Project::PAUSED, Project::RUNNING, and threshold().
Referenced by BatchFrame::OnButtonPause().
Removes project with id from batch list.
Definition at line 729 of file Batch.cpp.
References GetIndex(), hugin_utils::HuginMessageBox(), RemoveProjectAtIndex(), and threshold().
Removes project at index from batch list.
Definition at line 741 of file Batch.cpp.
References deleteFiles, Project::FINISHED, hugin_utils::HuginMessageBox(), Project::idGenerator, m_projList, and threshold().
Referenced by BatchFrame::OnButtonRemoveComplete(), BatchFrame::OnButtonRemoveFromList(), OnProcessTerminate(), and RemoveProject().
| void Batch::RunBatch | ( | ) |
Starts batch execution.
Definition at line 764 of file Batch.cpp.
References m_failedProjects, m_resBlocker, m_running, RunNextInBatch(), and threshold().
Referenced by BatchFrame::RunBatch().
| void Batch::RunNextInBatch | ( | ) |
Starts execution of next waiting project in batch.
Definition at line 780 of file Batch.cpp.
References AllDone(), Project::FAILED, Project::FINISHED, GetFirstAvailable(), m_projList, m_running, Project::MISSING, OnDetect(), OnStitch(), Project::RUNNING, Project::STITCHING, and threshold().
Referenced by OnProcessTerminate(), and RunBatch().
Saves batch list to file.
Definition at line 851 of file Batch.cpp.
References Project::DETECTING, Project::idGenerator, m_projList, Project::STITCHING, and threshold().
Referenced by BatchFrame::OnButtonSaveBatch(), and SaveTemp().
| void Batch::SaveTemp | ( | ) |
Saves batch list to temporary file.
Definition at line 900 of file Batch.cpp.
References GetBatchFilename(), and SaveBatchFile().
Referenced by BatchFrame::AddArrayToList(), BatchFrame::AddDirToList(), BatchFrame::AddToList(), BatchFrame::BatchFrame(), BatchFrame::OnButtonAddCommand(), BatchFrame::OnButtonAddToAssistantQueue(), BatchFrame::OnButtonAddToStitchingQueue(), BatchFrame::OnButtonChangePrefix(), BatchFrame::OnButtonClear(), BatchFrame::OnButtonMoveDown(), BatchFrame::OnButtonMoveUp(), BatchFrame::OnButtonOpenBatch(), BatchFrame::OnButtonRemoveComplete(), BatchFrame::OnButtonRemoveFromList(), BatchFrame::OnButtonReset(), BatchFrame::OnButtonResetAll(), BatchFrame::OnClose(), OnProcessTerminate(), and BatchFrame::OnUpdateListBox().
| void Batch::SetStatus | ( | int | index, |
| Project::Status | status | ||
| ) |
Used internally to set status of selected project.
Definition at line 905 of file Batch.cpp.
References hugin_utils::HuginMessageBox(), m_projList, and threshold().
Referenced by BatchFrame::OnButtonReset(), BatchFrame::OnButtonResetAll(), BatchFrame::OnButtonSkip(), and BatchFrame::OnUpdateListBox().
Set visibility of all running projects.
| isVisible | If true display the project output, otherwise hide it. |
Definition at line 923 of file Batch.cpp.
References m_stitchFrames, and threshold().
Referenced by BatchFrame::OnCheckVerbose(), BatchFrame::OnMinimize(), and BatchFrame::UpdateBatchVerboseStatus().
Swaps position in batch of project at index with project at index+1.
Definition at line 917 of file Batch.cpp.
References m_projList.
Referenced by BatchFrame::SwapProject().
| EndTask Batch::atEnd |
Definition at line 58 of file Batch.h.
Referenced by Batch(), BatchFrame::OnChoiceEnd(), OnProcessTerminate(), BatchFrame::PropagateDefaults(), and BatchFrame::SetCheckboxes().
| bool Batch::autoremove |
Definition at line 62 of file Batch.h.
Referenced by Batch(), BatchFrame::OnCheckAutoRemove(), OnProcessTerminate(), BatchFrame::PropagateDefaults(), and BatchFrame::SetCheckboxes().
| bool Batch::autostitch |
Definition at line 61 of file Batch.h.
Referenced by Batch(), BatchFrame::OnCheckAutoStitch(), OnProcessTerminate(), BatchFrame::PropagateDefaults(), and BatchFrame::SetCheckboxes().
| bool Batch::deleteFiles |
Definition at line 57 of file Batch.h.
Referenced by Batch(), and RemoveProjectAtIndex().
|
private |
Definition at line 163 of file Batch.h.
Referenced by Batch(), CancelBatch(), and OnProcessTerminate().
|
private |
Definition at line 166 of file Batch.h.
Referenced by Batch(), ClearBatch(), and OnProcessTerminate().
|
private |
|
private |
Definition at line 169 of file Batch.h.
Referenced by GetFailedProjectLog(), GetFailedProjectName(), GetFailedProjectsCount(), OnProcessTerminate(), and RunBatch().
|
private |
Definition at line 164 of file Batch.h.
Referenced by Batch(), CancelProject(), IsPaused(), OnProcessTerminate(), and PauseBatch().
|
private |
Definition at line 158 of file Batch.h.
Referenced by AddAppToBatch(), AddProjectToBatch(), AllDone(), AppendBatchFile(), ChangePrefix(), ChangeUserDefined(), ClearBatch(), CompareProjectsInLists(), GetFirstAvailable(), GetIndex(), GetProject(), GetProjectCount(), GetProjectCountByPath(), GetStatus(), NoErrors(), OnProcessTerminate(), PauseBatch(), RemoveProjectAtIndex(), RunNextInBatch(), SaveBatchFile(), SetStatus(), and SwapProject().
|
private |
Definition at line 170 of file Batch.h.
Referenced by Batch(), CancelBatch(), OnProcessTerminate(), RunBatch(), and ~Batch().
|
private |
Definition at line 165 of file Batch.h.
Referenced by Batch(), CancelBatch(), CancelProject(), IsRunning(), OnProcessTerminate(), RunBatch(), and RunNextInBatch().
|
private |
Definition at line 160 of file Batch.h.
Referenced by CancelProject(), ClearBatch(), CompareProjectsInLists(), GetRunningCount(), OnDetect(), OnProcessTerminate(), OnStitch(), PauseBatch(), and ShowOutput().
| bool Batch::overwrite |
Definition at line 59 of file Batch.h.
Referenced by Batch(), BatchFrame::OnCheckOverwrite(), OnStitch(), BatchFrame::PropagateDefaults(), and BatchFrame::SetCheckboxes().
| bool Batch::saveLog |
Definition at line 63 of file Batch.h.
Referenced by Batch(), BatchFrame::OnCheckSaveLog(), OnProcessTerminate(), and BatchFrame::SetCheckboxes().
| bool Batch::verbose |
Definition at line 60 of file Batch.h.
Referenced by Batch(), BatchFrame::OnCheckVerbose(), OnDetect(), BatchFrame::OnMinimize(), OnStitch(), BatchFrame::PropagateDefaults(), BatchFrame::SetCheckboxes(), BatchFrame::SetInternalVerbose(), and BatchFrame::UpdateBatchVerboseStatus().