diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index d86e1ef..e04e26e 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/MachineCalc.cpp b/MachineCalc.cpp index a93c16c..bedc890 100644 --- a/MachineCalc.cpp +++ b/MachineCalc.cpp @@ -37,6 +37,7 @@ static const string EVAR_TOTDIAM = ".TOTDIAM" ; // (num) diametro di in static const string EVAR_TOTLEN = ".TOTLEN" ; // (num) lunghezza di ingombro dell'utensile static const string EVAR_DIST = ".DIST" ; // (num) distanza dell'utensile (per seghe a catena) static const string EVAR_EXITPOS = ".EXITPOS" ; // (point) posizione attuale dell'uscita +static const string EVAR_TCPOS = ".TCPOS" ; // (string) posizione nell'attrezzaggio static const string EVAR_L1 = ".L1" ; // (num) valore del primo asse lineare static const string EVAR_L2 = ".L2" ; // (num) valore del secondo asse lineare static const string EVAR_L3 = ".L3" ; // (num) valore del terzo asse lineare @@ -229,6 +230,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit) double dTOvLen = 0 ; double dTOvDiam = 0 ; double dTDist = 0 ; + string sTcPos = "" ; // se definito if ( ! sTool.empty()) { // carico anche gli utensili su eventuali altre uscite della testa @@ -249,6 +251,8 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit) ! m_pMchMgr->TdbGetCurrToolParam( TPA_TOTDIAM, dTOvDiam)) return false ; m_pMchMgr->TdbGetCurrToolParam( TPA_DIST, dTDist) ; // opzionale + if ( ! m_pMchMgr->GetCurrSetupMgr().GetToolSetupPos( sTool, sTcPos)) + m_pMchMgr->TdbGetCurrToolParam( TPA_TCPOS, sTcPos) ; } // altrimenti casi speciali senza utensile else { @@ -261,6 +265,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit) dTOvLen = 0 ; dTOvDiam = 0 ; dTDist = 0 ; + sTcPos = "" ; m_pMchMgr->TdbSetCurrTool( "") ; } // assegno tutti i dati @@ -289,6 +294,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit) bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_TOTDIAM, dTOvDiam) ; bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_TOTLEN, dTOvLen) ; bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_DIST, dTDist) ; + bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_TCPOS, sTcPos) ; // chiamo funzione bOk = bOk && LuaCallFunction( ON_SET_HEAD) ; // reset variabili diff --git a/SetupMgr.h b/SetupMgr.h index bc164e8..84a3713 100644 --- a/SetupMgr.h +++ b/SetupMgr.h @@ -49,6 +49,8 @@ class SetupMgr bool FindTool( const std::string& sName) const ; bool GetPosData( int nPos, std::string& sTcPos, std::string& sHead, int& nExit, std::string& sName) const ; bool GetToolData( const std::string& sName, std::string& sTcPos, std::string& sHead, int& nExit, int* pnPos = nullptr) const ; + bool GetToolSetupPos( const std::string& sName, std::string& sTcPos) const + { std::string sH ; int nE ; return GetToolData( sName, sTcPos, sH, nE) ; } bool GetToolName( const std::string& sHead, int nExit, std::string& sName) const ; bool GetToolsInSetupPos( const std::string& sTcPos, STRVECTOR& vsTools) const ;