diff --git a/Simulator.cpp b/Simulator.cpp index af9de39..f9ceaa3 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -101,7 +101,7 @@ Simulator::Start( bool bFirst) // Arrivo alla preparazione per la prima lavorazione int nStatus ; - return FindAndManageOperationStart( bFirst, nStatus) ; + return FindAndManageOperationStart( true, bFirst, nStatus) ; } //---------------------------------------------------------------------------- @@ -141,7 +141,7 @@ Simulator::Move( int& nStatus) if ( ! ManageOperationEnd( nStatus)) return false ; // ricerca e gestione nuova operazione - if ( ! FindAndManageOperationStart( false, nStatus)) + if ( ! FindAndManageOperationStart( false, false, nStatus)) return false ; // se non ce ne sono altre, sono alla fine if ( m_nOpId == GDB_ID_NULL) { @@ -433,10 +433,13 @@ Simulator::ResetAuxAxes( void) //---------------------------------------------------------------------------- bool -Simulator::FindAndManageOperationStart( bool bFirst, int& nStatus) +Simulator::FindAndManageOperationStart( bool bStart, bool bFirst, int& nStatus) { + // verifico parametri + if ( ! bStart) + bFirst = false ; // recupero la nuova operazione - if ( bFirst) { + if ( bStart) { m_nOpId = m_pMchMgr->GetFirstActiveOperation() ; m_nOpInd = 0 ; } diff --git a/Simulator.h b/Simulator.h index 6dad563..9936427 100644 --- a/Simulator.h +++ b/Simulator.h @@ -44,7 +44,7 @@ class Simulator bool ResetAuxAxes( void) ; private : - bool FindAndManageOperationStart( bool bFirst, int& nStatus) ; + bool FindAndManageOperationStart( bool bStart, bool bFirst, int& nStatus) ; bool ManageOperationEnd( int& nStatus) ; bool FindAndManagePathStart( int& nStatus) ; bool ManagePathEnd( int& nStatus) ;