From 07cc0270cca6bdfed07d22db5f10fc624ee14b77 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 1 May 2017 13:05:14 +0000 Subject: [PATCH] EgtMachKernel 1.8d9 : - aggiunta EMT.ELEV ( elevazione massima) ai dati di OnStartPath di Generatore e Simulatore. --- Chiseling.cpp | 2 ++ Drilling.cpp | 2 ++ EgtMachKernel.rc | Bin 11774 -> 11774 bytes GenMachining.cpp | 2 ++ Generator.cpp | 9 +++++++-- Generator.h | 2 +- Milling.cpp | 2 ++ OutputConst.h | 1 + Pocketing.cpp | 2 ++ Sawing.cpp | 28 ++++++++++++++++++++++++++++ Simulator.cpp | 9 +++++++-- Simulator.h | 2 +- 12 files changed, 55 insertions(+), 6 deletions(-) diff --git a/Chiseling.cpp b/Chiseling.cpp index 07f8f72..f2c309d 100644 --- a/Chiseling.cpp +++ b/Chiseling.cpp @@ -1154,6 +1154,8 @@ Chiseling::ProcessPath( int nPathId, int nPvId, int nClId) m_pGeomDB->SetInfo( nPxId, KEY_EXTR, vtTool) ; // assegno il punto di inizio al gruppo del percorso m_pGeomDB->SetInfo( nPxId, KEY_START, vSqHole[i].ptIni) ; + // assegno l'elevazione massima + m_pGeomDB->SetInfo( nPxId, KEY_ELEV, dElev) ; // assegno al gruppo l'ingombro del percorso di scalpellatura BBox3d b3Grp ; m_pGeomDB->GetGlobalBBox( nPxId, b3Grp) ; diff --git a/Drilling.cpp b/Drilling.cpp index 0c7274b..c1db080 100644 --- a/Drilling.cpp +++ b/Drilling.cpp @@ -870,6 +870,8 @@ Drilling::GenerateHoleCl( int nInd, const SelData& nCircId, const string& sPName m_pGeomDB->SetInfo( nPathId, KEY_EXTR, hole.vtDir) ; // assegno il punto di inizio al gruppo del percorso m_pGeomDB->SetInfo( nPathId, KEY_START, hole.ptIni) ; + // assegno l'elevazione massima + m_pGeomDB->SetInfo( nPathId, KEY_ELEV, hole.dLen) ; // foro normale if ( m_Params.m_dStep < EPS_SMALL || m_Params.m_dStep > hole.dLen - EPS_SMALL) { diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 4241b80457f248b7b4c8d6af6ff5792a13410952..ce6a7097b722a73e851801d195b55b13dcddef3d 100644 GIT binary patch delta 97 zcmewt{V#gMFE&QY&A-`fnHeo7Ka|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUieBftOv delta 97 zcmewt{V#gMFE&Pt&A-`fnHeo6Ka|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUdVBe(zn diff --git a/GenMachining.cpp b/GenMachining.cpp index 7b863e1..0c55502 100644 --- a/GenMachining.cpp +++ b/GenMachining.cpp @@ -1119,6 +1119,8 @@ GenMachining::ProcessPath( int nPathId, int nPvId, int nClId) m_pGeomDB->SetInfo( nPxId, KEY_EXTR, vtTool) ; // assegno il punto di inizio al gruppo del percorso m_pGeomDB->SetInfo( nPxId, KEY_START, ptStart) ; + // assegno l'elevazione massima + m_pGeomDB->SetInfo( nPxId, KEY_ELEV, dElev) ; // Imposto dati comuni SetPathId( nPxId) ; diff --git a/Generator.cpp b/Generator.cpp index ee39bcb..beb971a 100644 --- a/Generator.cpp +++ b/Generator.cpp @@ -346,11 +346,14 @@ Generator::ProcessClPath( int nClPathId, int nClPathInd, int nOpId, int nOpInd) Point3d ptMin, ptMax ; m_pGeomDB->GetInfo( nClPathId, KEY_PMIN, ptMin) ; m_pGeomDB->GetInfo( nClPathId, KEY_PMAX, ptMax) ; + // Recupero massima elevazione + double dElev = 0 ; + m_pGeomDB->GetInfo( nClPathId, KEY_ELEV, dElev) ; // Recupero il numero di eventi ausiliari iniziali int nAS = 0 ; m_pGeomDB->GetInfo( nClPathId, KEY_AS_TOT, nAS) ; // Emetto inizio percorso di lavoro - if ( ! OnPathStart( nClPathId, nClPathInd, nAS, ptStart, vtExtr, ptMin, ptMax)) + if ( ! OnPathStart( nClPathId, nClPathInd, nAS, ptStart, vtExtr, ptMin, ptMax, dElev)) return false ; // Emissione eventuali dati ausiliari di inizio @@ -821,7 +824,7 @@ Generator::OnMachiningEnd( void) //---------------------------------------------------------------------------- bool Generator::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, - const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax) + const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax, double dElev) { // assegno identificativo e indice percorso di lavorazione bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PATHID, nClPathId) ; @@ -834,6 +837,8 @@ Generator::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& p // assegno punti estremi dell'ingombro del percorso di lavorazione bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PMIN, ptMin) ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PMAX, ptMax) ; + // assegno la massima elevazione + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_ELEV, dElev) ; // chiamo la funzione di inizio percorso di lavorazione bOk = bOk && m_pMachine->LuaCallFunction( ON_PATH_START) ; return bOk ; diff --git a/Generator.h b/Generator.h index e6c2e36..6232896 100644 --- a/Generator.h +++ b/Generator.h @@ -52,7 +52,7 @@ class Generator bool OnMachiningStart( int nOpId, int nOpInd, double dSpeed) ; bool OnMachiningEnd( void) ; bool OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, - const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax) ; + const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax, double dElev) ; bool OnPathEnd( int nAE) ; bool OnPathStartAux( int nInd, const std::string& sAS) ; bool OnPathEndAux( int nInd, const std::string& sAE) ; diff --git a/Milling.cpp b/Milling.cpp index 6cede52..0f53b17 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -1343,6 +1343,8 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId) m_pGeomDB->SetInfo( nPxId, KEY_EXTR, vtTool) ; // assegno il punto di inizio al gruppo del percorso m_pGeomDB->SetInfo( nPxId, KEY_START, ptStart) ; + // assegno l'elevazione massima + m_pGeomDB->SetInfo( nPxId, KEY_ELEV, dElev) ; // Imposto dati comuni SetPathId( nPxId) ; diff --git a/OutputConst.h b/OutputConst.h index a4900af..58fd163 100644 --- a/OutputConst.h +++ b/OutputConst.h @@ -73,6 +73,7 @@ static const std::string GVAR_START = ".START" ; // (Point3d) punto iniz static const std::string GVAR_EXTR = ".EXTR" ; // (Vector3d)versore estrusione static const std::string GVAR_PMIN = ".PMIN" ; // (Point3d) punto minimo di ingombro del percorso di lavorazione static const std::string GVAR_PMAX = ".PMAX" ; // (Point3d) punto massimo di ingombro del percorso di lavorazione +static const std::string GVAR_ELEV = ".ELEV" ; // (double) massima elevazione static const std::string GVAR_AUXTOT = ".AUXTOT" ; // (int) numero totale dati ausiliari inizio/fine percorso di lavorazione static const std::string GVAR_AUXIND = ".AUXIND" ; // (int) indice dato ausiliario inizio/fine percorso di lavorazione static const std::string GVAR_AUX = ".AUX" ; // (string) dato ausiliario inizio/fine percorso di lavorazione diff --git a/Pocketing.cpp b/Pocketing.cpp index 84946f7..10ef80d 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -1166,6 +1166,8 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId) m_pGeomDB->SetInfo( nPxId, KEY_EXTR, vtTool) ; // assegno il punto di inizio al gruppo del percorso m_pGeomDB->SetInfo( nPxId, KEY_START, ptStart) ; + // assegno l'elevazione massima + m_pGeomDB->SetInfo( nPxId, KEY_ELEV, dElev) ; // Imposto dati comuni SetPathId( nPxId) ; diff --git a/Sawing.cpp b/Sawing.cpp index 4457e96..af092fd 100644 --- a/Sawing.cpp +++ b/Sawing.cpp @@ -1421,6 +1421,8 @@ Sawing::GenerateLineCl( const ICurveLine* pLine, const Vector3d& vtTool, const V m_pGeomDB->SetInfo( nPxId, KEY_EXTR, Vector3d( 0, 0, 1)) ; // assegno il punto di inizio al gruppo del percorso m_pGeomDB->SetInfo( nPxId, KEY_START, pLine->GetStart()) ; + // assegno l'elevazione massima + m_pGeomDB->SetInfo( nPxId, KEY_ELEV, dElev) ; // Imposto dati comuni SetPathId( nPxId) ; SetToolDir( vtTool) ; @@ -1955,6 +1957,13 @@ Sawing::GenerateExtArcCl( const ICurveArc* pArc, const Vector3d& vtStaTool, cons return false ; m_pGeomDB->SetName( nPxId, sName) ; m_pGeomDB->SetMaterial( nPxId, BLUE) ; + // assegno il vettore estrazione al gruppo del percorso + m_pGeomDB->SetInfo( nPxId, KEY_EXTR, Vector3d( 0, 0, 1)) ; + // assegno il punto di inizio al gruppo del percorso + Point3d ptStart ; pArc->GetStartPoint( ptStart) ; + m_pGeomDB->SetInfo( nPxId, KEY_START, ptStart) ; + // assegno l'elevazione massima + m_pGeomDB->SetInfo( nPxId, KEY_ELEV, dElev) ; // Imposto dati comuni SetPathId( nPxId) ; SetCorrAuxDir( vtCorr) ; @@ -2167,6 +2176,12 @@ Sawing::GenerateExtArcCl( const ICurveArc* pArc, const Vector3d& vtStaTool, cons return false ; } + // assegno al gruppo l'ingombro del percorso di lavoro + BBox3d b3Grp ; + m_pGeomDB->GetGlobalBBox( nPxId, b3Grp) ; + m_pGeomDB->SetInfo( nPxId, KEY_PMIN, b3Grp.GetMin()) ; + m_pGeomDB->SetInfo( nPxId, KEY_PMAX, b3Grp.GetMax()) ; + return true ; } @@ -2603,6 +2618,13 @@ Sawing::GenerateIntArcCl( const ICurveArc* pArc, return false ; m_pGeomDB->SetName( nPxId, sName) ; m_pGeomDB->SetMaterial( nPxId, BLUE) ; + // assegno il vettore estrazione al gruppo del percorso + m_pGeomDB->SetInfo( nPxId, KEY_EXTR, Vector3d( 0, 0, 1)) ; + // assegno il punto di inizio al gruppo del percorso + Point3d ptStart ; pArc->GetStartPoint( ptStart) ; + m_pGeomDB->SetInfo( nPxId, KEY_START, ptStart) ; + // assegno l'elevazione massima + m_pGeomDB->SetInfo( nPxId, KEY_ELEV, dElev) ; // Imposto dati comuni SetPathId( nPxId) ; // recupero distanza di sicurezza @@ -2830,6 +2852,12 @@ Sawing::GenerateIntArcCl( const ICurveArc* pArc, return false ; } + // assegno al gruppo l'ingombro del percorso di lavoro + BBox3d b3Grp ; + m_pGeomDB->GetGlobalBBox( nPxId, b3Grp) ; + m_pGeomDB->SetInfo( nPxId, KEY_PMIN, b3Grp.GetMin()) ; + m_pGeomDB->SetInfo( nPxId, KEY_PMAX, b3Grp.GetMax()) ; + return true ; } diff --git a/Simulator.cpp b/Simulator.cpp index e1e9655..cd0a4e2 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -598,6 +598,9 @@ Simulator::FindAndManagePathStart( int& nStatus) Point3d ptMin, ptMax ; m_pGeomDB->GetInfo( m_nCLPathId, KEY_PMIN, ptMin) ; m_pGeomDB->GetInfo( m_nCLPathId, KEY_PMAX, ptMax) ; + // recupero massima elevazione + double dElev = 0 ; + m_pGeomDB->GetInfo( m_nCLPathId, KEY_ELEV, dElev) ; // recupero il numero di eventi ausiliari di inizio if ( ! m_pGeomDB->GetInfo( m_nCLPathId, KEY_AS_TOT, m_nAuxSTot)) m_nAuxSTot = 0 ; @@ -606,7 +609,7 @@ Simulator::FindAndManagePathStart( int& nStatus) m_nAuxEInd = 0 ; m_nAuxETot = 0 ; // richiamo gestione evento inizio percorso di lavoro - if ( ! OnPathStart( m_nCLPathId, m_nCLPathInd, m_nAuxSTot, ptStart, vtExtr, ptMin, ptMax)) { + if ( ! OnPathStart( m_nCLPathId, m_nCLPathInd, m_nAuxSTot, ptStart, vtExtr, ptMin, ptMax, dElev)) { nStatus = MCH_SIM_ERR ; return false ; } @@ -1001,7 +1004,7 @@ Simulator::OnMachiningEnd( void) //---------------------------------------------------------------------------- bool Simulator::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, - const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax) + const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax, double dElev) { // assegno identificativo e indice percorso di lavorazione bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PATHID, nClPathId) ; @@ -1014,6 +1017,8 @@ Simulator::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& p // assegno punti estremi dell'ingombro del percorso di lavorazione bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PMIN, ptMin) ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PMAX, ptMax) ; + // assegno la massima elevazione + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_ELEV, dElev) ; // verifico esistenza funzione if ( ! m_pMachine->LuaExistsFunction( ON_SIMUL_PATH_START)) return bOk ; diff --git a/Simulator.h b/Simulator.h index 9936427..cf570f7 100644 --- a/Simulator.h +++ b/Simulator.h @@ -63,7 +63,7 @@ class Simulator bool OnPathStartAux( int nInd, const std::string& sAS) ; bool OnPathEndAux( int nInd, const std::string& sAE) ; bool OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, - const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax) ; + const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax, double dElev) ; bool OnPathEnd( int nAE) ; bool OnMoveStart( const CamData* pCamData) ; bool OnMoveEnd( void) ;