From 6378dddcdf7303bb858999ae2f5cc87d037af39e Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 3 Apr 2023 08:50:46 +0200 Subject: [PATCH] =?UTF-8?q?EgtMachKernel=202.5d1=20:=20-=20eliminata=20la?= =?UTF-8?q?=20necessit=C3=A0=20di=20testa=20dummy=20per=20disposizioni=20c?= =?UTF-8?q?on=20comandi=20StartAux=20o=20EndAux=20e=20senza=20movimenti=20?= =?UTF-8?q?diretti.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Disposition.cpp | 4 ++-- Disposition.h | 16 +++++++++------- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Processor.cpp | 4 ++-- Simulator.cpp | 12 +++++++----- 5 files changed, 20 insertions(+), 16 deletions(-) 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 27a04f564cd6df60213ba8032cd22d5569ad6d7b..a1ef62e9fb02b345a354170440ac62fbfc7aecec 100644 GIT binary patch delta 121 zcmewt{V#gMH#Sxi1|0^&&A-{KnVC}<3@1O7)ZLuM)x!c8zsNNCgkT;*P6$a3MUMyL R=2g-z%(yjz6ex#q0RU@pCXfIC delta 121 zcmewt{V#gMH#Syd1|0^Y&A-{KnVFLrj3z&n)ZLuM)x!c8zsNNCgkT;*P6$a3MUMyL R=2g-z%(yjz6ex#q0RU@RCXfIC 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