From d75a5fdde8aa820952489fe5a77d2cb910214759 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 21 Apr 2017 14:37:32 +0000 Subject: [PATCH] EgtMachKernel : - correzione molto importante a Start simulazione. --- Simulator.cpp | 11 +++++++---- Simulator.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) 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) ;