-void
-ReconstructorSupervisor::OnWorkerUnitTick (wxCommandEvent& event)
-{
- ++m_iViewsDone;
-
-#ifdef DEBUG
- if (theApp->getVerboseLogging())
- *theApp->getLog() << "Views done: " << static_cast<int>(m_iViewsDone) <<"\n";
-#endif
-
- if (m_pDialogProgress)
- m_bCancelling = ! m_pDialogProgress->Update (m_iViewsDone - 1);
- else {
- wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_UNIT_TICK);
- addTaskEvent.SetInt (m_iViewsDone - 1);
- addTaskEvent.SetClientData (this);
- wxPostEvent (theApp->getBackgroundManager(), addTaskEvent);
- }
-}
-
-void
-ReconstructorSupervisor::OnWorkerDone (wxCommandEvent& event)
-{
- m_iRunning--;
- wxASSERT (m_iRunning >= 0);
- m_critsectThreadContainer.Enter();
- m_vecpThread[event.GetInt()] = NULL;
- m_critsectThreadContainer.Leave();
-
-#ifdef DEBUG
- if (theApp->getVerboseLogging()) {
- wxString msg;
- msg.Printf("Reconstructor Supervisor: Thread finished. Remaining threads: %d\n", m_iRunning);
- wxCommandEvent eventLog (wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT );
- eventLog.SetString( msg );
- wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event
- }
-#endif
- if (m_iRunning <= 0) {
- onDone();
- return;
- }
-}
-
-void
-ReconstructorSupervisor::OnWorkerFail (wxCommandEvent& event)
-{
- if (isDone())
- return;
-
- m_iRunning--;
- m_critsectThreadContainer.Enter();
- m_vecpThread[event.GetInt()] = NULL;
- m_critsectThreadContainer.Leave();
- wxCommandEvent eventLog( wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT );
- eventLog.SetString( event.GetString() );
- wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event
-
- onDone();