diff --git a/Disposition.cpp b/Disposition.cpp index e126a10..0984588 100644 --- a/Disposition.cpp +++ b/Disposition.cpp @@ -1353,7 +1353,7 @@ Disposition::SpecialApply( bool bRecalc) bOk = bOk && pMch->LuaResetGlobVar( EMC_VAR) ; // segnalo errori ed esco if ( ! bOk || nErr > 0) { - m_nShifts = - 1 ; + m_nShifts = -2 ; string sOut = sMsg ; if ( IsEmptyOrSpaces( sOut)) sOut = " Error in " + ON_SPECIAL_APPLY + " (" + ToString( nErr) + ")" ; @@ -1393,7 +1393,7 @@ Disposition::SpecialUpdate( void) // se disposizione vuota, esco if ( m_nShifts <= 0) { - if ( m_nShifts < 0) + if ( m_nShifts == -2) m_pMchMgr->SetWarning( 2052, "Warning in Disposition : No shifts") ; return true ; } diff --git a/Disposition.h b/Disposition.h index 8f0b7e3..7ce4cd9 100644 --- a/Disposition.h +++ b/Disposition.h @@ -56,14 +56,14 @@ class Disposition : public Operation { return true ; } bool Save( int nBaseId, STRVECTOR& vString) const override ; bool Load( const STRVECTOR& vString, int nBaseGdbId) override ; - + public : // Operation - int GetType( void) const override - { return OPER_DISP ; } - bool IsEmpty( void) const override - { return ( m_nShifts == 0) ; } + int GetType( void) const override + { return OPER_DISP ; } + bool IsEmpty( void) const override + { return ( m_nShifts == 0) ; } bool UpdateStatus( int nModif) override - { m_nStatus |= nModif ; return true ; } + { m_nStatus |= nModif ; return true ; } protected : // Operation const std::string& GetToolName( void) const override ; @@ -71,7 +71,7 @@ class Disposition : public Operation int GetExitNbr( void) const override ; const std::string& GetToolTcPos( void) const override ; int GetSolCh( void) const override - { return 0 ; } + { return 0 ; } bool NeedPrevHome( void) const override ; public : @@ -111,6 +111,8 @@ class Disposition : public Operation bool GetToolData( std::string& sName, std::string& sHead, int& nExit, std::string& sTcPos) const ; bool GetSomeByHand( void) const { return m_bSomeByHand ; } + bool IsWithTool( void) + { return ( m_nShifts != -1) ;} private : bool InsertMoveInfoInList( int nRawId, int nType, const Point3d& ptP, int nFlag) ; diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 27a04f5..a1ef62e 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/Processor.cpp b/Processor.cpp index b04a865..914daec 100644 --- a/Processor.cpp +++ b/Processor.cpp @@ -184,8 +184,8 @@ Processor::ProcessDisposition( int nOpId, int nOpInd) bool bEmpty = pDisp->IsEmpty() ; bool bSomeByHand = pDisp->GetSomeByHand() ; - // Se disposizione con movimenti macchina - if ( ! pDisp->IsEmpty()) { + // Se disposizione con movimenti autonomi e utensile associato + if ( ! pDisp->IsEmpty() && pDisp->IsWithTool()) { // Recupero l'utensile della disposizione corrente string sTool ; string sHead ; int nExit ; string sTcPos ; if ( ! pDisp->GetToolData( sTool, sHead, nExit, sTcPos)) diff --git a/Simulator.cpp b/Simulator.cpp index c71e09b..08d3a7c 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -687,11 +687,13 @@ Simulator::FindAndManageOperationStart( bool bStart, bool bFirst, int& nStatus) } // cambio fase m_pMchMgr->SetCurrPhase( nPhase, ( nPhase == 1)) ; - // aggiorno utensile e assi conseguenti - int nErr ; - if ( ! UpdateTool( bFirst, nErr)) { - nStatus = CalcStatusOnError( nErr) ; - return false ; + // se previsto, aggiorno utensile e assi conseguenti + if ( pDisp->IsWithTool()) { + int nErr ; + if ( ! UpdateTool( bFirst, nErr)) { + nStatus = CalcStatusOnError( nErr) ; + return false ; + } } ++ m_nOpInd ; // richiamo gestione evento inizio disposizione