EgtMachKernel 2.7a3 :

- aggiunta a PostProc la chiamata a OnTableAxisData e a Estimator la chiamata a OnEstimTableAxisData per ogni asse di tavola su quella corrente
- modifiche varie a Machine per rendere possibile la modifica precedente
- piccolo aggiustamento a inizializzazione di dZConstOverlap.
This commit is contained in:
Dario Sassi
2025-01-28 19:45:11 +01:00
parent 0c27684785
commit b74f0d407d
11 changed files with 128 additions and 16 deletions
BIN
View File
Binary file not shown.
+9
View File
@@ -179,6 +179,15 @@ Estimator::CallOnTableData( void)
return m_pMachine->LuaCallFunction( ON_ESTIM_TABLE_DATA) ;
}
//----------------------------------------------------------------------------
bool
Estimator::CallOnTableAxisData( void)
{
if ( ! m_pMachine->LuaExistsFunction( ON_ESTIM_TABLE_AXIS_DATA))
return true ;
return m_pMachine->LuaCallFunction( ON_ESTIM_TABLE_AXIS_DATA) ;
}
//----------------------------------------------------------------------------
bool
Estimator::CallOnFixtureData( void)
+1
View File
@@ -33,6 +33,7 @@ class Estimator : public Processor
bool CallOnDispositionStart( void) override ;
bool CallOnDispositionEnd( void) override ;
bool CallOnTableData( void) override ;
bool CallOnTableAxisData( void) override ;
bool CallOnFixtureData( void) override ;
bool CallOnRawMoveData( void) override ;
bool CallOnToolSelect( void) override ;
+7
View File
@@ -181,6 +181,13 @@ Generator::CallOnTableData( void)
return m_pMachine->LuaCallFunction( ON_TABLE_DATA) ;
}
//----------------------------------------------------------------------------
bool
Generator::CallOnTableAxisData( void)
{
return m_pMachine->LuaCallFunction( ON_TABLE_AXIS_DATA) ;
}
//----------------------------------------------------------------------------
bool
Generator::CallOnFixtureData( void)
+1
View File
@@ -33,6 +33,7 @@ class Generator : public Processor
bool CallOnDispositionStart( void) override ;
bool CallOnDispositionEnd( void) override ;
bool CallOnTableData( void) override ;
bool CallOnTableAxisData( void) override ;
bool CallOnFixtureData( void) override ;
bool CallOnRawMoveData( void) override ;
bool CallOnToolSelect( void) override ;
+3
View File
@@ -50,6 +50,7 @@ class Machine
int GetAxisId( const std::string& sAxis) const
{ int nId = GetGroup( sAxis) ;
return ( IsAxisGroup( nId) ? nId : GDB_ID_NULL) ; }
bool GetAxisName( int nAxId, std::string& sAxis) const ;
int GetHeadId( const std::string& sHead) const
{ int nId = GetGroup( sHead) ;
return ( IsHeadGroup( nId) ? nId : GDB_ID_NULL) ; }
@@ -73,6 +74,7 @@ class Machine
{ return ( GetTcPos( nGroup) != nullptr) ; }
bool IsExitGroup( int nGroup) const
{ return ( GetExit( nGroup) != nullptr) ; }
bool GetAllAxesIds( INTVECTOR& vIds) const ;
bool GetAllTablesNames( STRVECTOR& vNames) const ;
bool GetAllAxesNames( STRVECTOR& vNames) const ;
bool GetAllHeadsNames( STRVECTOR& vNames) const ;
@@ -106,6 +108,7 @@ class Machine
bool GetAxisMin( const std::string& sAxis, double& dMin) const ;
bool GetAxisMax( const std::string& sAxis, double& dMax) const ;
bool GetAxisHomePos( const std::string& sAxis, double& dHomeVal) const ;
bool IsDispositionAxis( int nAxisId, int nTableId = GDB_ID_NULL) const ;
bool IsDispositionAxis( const std::string& sAxis, const std::string& sTable = "") const ;
bool ResetAxisPos( const std::string& sAxis) ;
bool ResetAllAxesPos( bool bStdAxes, bool bDispAxes) ;
+46 -10
View File
@@ -23,6 +23,22 @@
using namespace std ;
//----------------------------------------------------------------------------
bool
Machine::GetAllAxesIds( INTVECTOR& vIds) const
{
// reset lista identificativi
vIds.clear() ;
// ricerca degli assi
for ( const auto& snGro : m_mapGroups) {
if ( IsAxisGroup( snGro.second))
vIds.push_back( snGro.second) ;
}
// se richiesto, ordino alfabeticamente
sort( vIds.begin(), vIds.end()) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAllAxesNames( STRVECTOR& vNames) const
@@ -34,10 +50,22 @@ Machine::GetAllAxesNames( STRVECTOR& vNames) const
if ( IsAxisGroup( snGro.second))
vNames.push_back( snGro.first) ;
}
// ordino alfabeticamente
// se richiesto, ordino alfabeticamente
sort( vNames.begin(), vNames.end()) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAxisName( int nAxId, string& sName) const
{
// recupero il relativo gestore
const Axis* pAx = GetAxis( nAxId) ;
if ( pAx == nullptr)
return false ;
// recupero il token dell'asse
sName = pAx->GetName() ;
return true ;
}
//----------------------------------------------------------------------------
bool
@@ -234,6 +262,21 @@ Machine::GetAxisHomePos( const string& sAxis, double& dHomeVal) const
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::IsDispositionAxis( int nAxisId, int nTableId) const
{
// se direttamente dipendente dalla tavola
int nParentId = m_pGeomDB->GetParentId( nAxisId) ;
if ( ( nTableId != GDB_ID_NULL && nParentId == nTableId) || IsTableGroup( nParentId))
return true ;
// altrimenti deve dipendere da asse dipendente dalla tavola
if ( ! IsAxisGroup( nParentId))
return false ;
int nGrParId = m_pGeomDB->GetParentId( nParentId) ;
return ( ( nTableId != GDB_ID_NULL && nGrParId == nTableId) || IsTableGroup( nGrParId)) ;
}
//----------------------------------------------------------------------------
bool
Machine::IsDispositionAxis( const string& sAxis, const string& sTable) const
@@ -251,15 +294,8 @@ Machine::IsDispositionAxis( const string& sAxis, const string& sTable) const
if ( nTabId == GDB_ID_NULL)
return false ;
}
// se direttamente dipendente dalla tavola
int nParentId = m_pGeomDB->GetParentId( nAxId) ;
if ( ( nTabId != GDB_ID_NULL && nParentId == nTabId) || IsTableGroup( nParentId))
return true ;
// altrimenti deve dipendere da asse dipendente dalla tavola
if ( ! IsAxisGroup( nParentId))
return false ;
int nGrParId = m_pGeomDB->GetParentId( nParentId) ;
return ( ( nTabId != GDB_ID_NULL && nGrParId == nTabId) || IsTableGroup( nGrParId)) ;
// eseguo
return IsDispositionAxis( nAxId, nTabId) ;
}
//----------------------------------------------------------------------------
+6
View File
@@ -45,6 +45,10 @@ static const std::string GVAR_EMPTY = ".EMPTY" ; // (bool) flag disp
static const std::string GVAR_SBH = ".SBH" ; // (bool) flag disposizione con operazioni manuali
static const std::string GVAR_TABNAME = ".TABNAME" ; // (string) nome tavola
static const std::string GVAR_TABORI1 = ".TABORI1" ; // (Point3d) prima origine di tavola
static const std::string GVAR_TAIND = ".TAIND" ; // (int) indice asse tavola
static const std::string GVAR_TANAME = ".TANAME" ; // (string) nome asse tavola
static const std::string GVAR_TAPOS = ".TAPOS" ; // (double) posizione asse tavola
static const std::string GVAR_TAMOVED = ".TAMOVED" ; // (bool) flag asse tavola con movimento
static const std::string GVAR_FIXID = ".FIXID" ; // (int) identificativo bloccaggio (fixture)
static const std::string GVAR_FIXIND = ".FIXIND" ; // (int) indice bloccaggio
static const std::string GVAR_FIXNAME = ".FIXNAME" ; // (string) nome bloccaggio
@@ -198,6 +202,7 @@ static const std::string ON_TOOL_DATA = "OnToolData" ;
static const std::string ON_DISPOSITION_START = "OnDispositionStart" ;
static const std::string ON_DISPOSITION_END = "OnDispositionEnd" ;
static const std::string ON_TABLE_DATA = "OnTableData" ;
static const std::string ON_TABLE_AXIS_DATA = "OnTableAxisData" ;
static const std::string ON_FIXTURE_DATA = "OnFixtureData" ;
static const std::string ON_RAWMOVE_DATA = "OnRawMoveData" ;
static const std::string ON_TOOL_SELECT = "OnToolSelect" ;
@@ -220,6 +225,7 @@ static const std::string ON_ESTIM_TOOL_DATA = "OnEstimToolData" ;
static const std::string ON_ESTIM_DISPOSITION_START = "OnEstimDispositionStart" ;
static const std::string ON_ESTIM_DISPOSITION_END = "OnEstimDispositionEnd" ;
static const std::string ON_ESTIM_TABLE_DATA = "OnEstimTableData" ;
static const std::string ON_ESTIM_TABLE_AXIS_DATA = "OnEstimTableAxisData" ;
static const std::string ON_ESTIM_FIXTURE_DATA = "OnEstimFixtureData" ;
static const std::string ON_ESTIM_RAWMOVE_DATA = "OnEstimRawMoveData" ;
static const std::string ON_ESTIM_TOOL_SELECT = "OnEstimToolSelect" ;
+49 -3
View File
@@ -224,6 +224,38 @@ Processor::ProcessDisposition( int nOpId, int nOpInd)
if ( ! OnTableData( sTable, ptOri1))
return false ;
// Recupero assi tavola mossi nella disposizione
INTVECTOR vMovAxId ;
for ( int i = 0 ; ; ++ i) {
string sName ;
double dPos ;
if ( pDisp->GetMoveAxisData( i, sName, dPos)) {
int nAxId = m_pMachine->GetAxisId( sName) ;
if ( nAxId != GDB_ID_NULL)
vMovAxId.emplace_back( nAxId) ;
}
else
break ;
}
// Emetto posizioni assi di tavola
INTVECTOR vAxisId ;
m_pMachine->GetAllAxesIds( vAxisId) ;
int nTableId = m_pMachine->GetTableId( sTable) ;
int nInd = 0 ;
for ( int nAxId : vAxisId) {
string sName ;
double dPos ;
if ( m_pMachine->IsDispositionAxis( nAxId, nTableId) &&
m_pMachine->GetAxisName( nAxId, sName) &&
m_pMachine->GetAxisPos( sName, dPos)) {
++ nInd ;
bool bMoved = ( std::find( vMovAxId.begin(), vMovAxId.end(), nAxId) != vMovAxId.end()) ;
if ( ! OnTableAxisData( nInd, sName, dPos, bMoved))
return false ;
}
}
// Emetto dati bloccaggi
for ( int i = 0 ; ; ++ i) {
string sName ;
@@ -246,7 +278,7 @@ Processor::ProcessDisposition( int nOpId, int nOpInd)
Point3d ptPos ;
int nFlag ;
if ( pDisp->GetMoveRawData( i, nRawId, nType, ptPos, nFlag)) {
if ( ! OnRawMoveData( nRawId, i + 1, nType, ptPos, nFlag))
if ( ! OnRawMoveData( nRawId, i + 1, nType, ptPos, nFlag))
return false ;
}
else
@@ -807,6 +839,20 @@ Processor::OnTableData( const string& sName, const Point3d& ptOri1)
return bOk ;
}
//----------------------------------------------------------------------------
bool
Processor::OnTableAxisData( int nAxisInd, const string& sName, double dPos, bool bMoved)
{
// assegno dati movimento asse di tavola
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TAIND, nAxisInd) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TANAME, sName) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TAPOS, dPos) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TAMOVED, bMoved) ;
// chiamo la funzione di gestione dati movimento asse di tavola
bOk = bOk && CallOnTableAxisData() ;
return true ;
}
//----------------------------------------------------------------------------
bool
Processor::OnFixtureData( int nFixId, int nFixInd, const string& sName, const Point3d& ptPos,
@@ -826,11 +872,11 @@ Processor::OnFixtureData( int nFixId, int nFixInd, const string& sName, const Po
//----------------------------------------------------------------------------
bool
Processor::OnRawMoveData( int nRawId, int RawMoveInd, int nType, const Point3d& ptPos, int nFlag)
Processor::OnRawMoveData( int nRawId, int nRawMoveInd, int nType, const Point3d& ptPos, int nFlag)
{
// assegno dati bloccaggio
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWID, nRawId) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWIND, RawMoveInd) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWIND, nRawMoveInd) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWTYPE, nType) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWPOS, ptPos) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWFLAG, nFlag) ;
+3 -1
View File
@@ -47,9 +47,10 @@ class Processor
bool OnDispositionStart( int nOpId, int nOpInd, int nPhase, bool bEmpty, bool bSomeByHand) ;
bool OnDispositionEnd( void) ;
bool OnTableData( const std::string& sName, const Point3d& ptOri1) ;
bool OnTableAxisData( int nAxisInd, const std::string& sName, double dPos, bool bMoved) ;
bool OnFixtureData( int nFixId, int nFixInd, const std::string& sName,
const Point3d& ptPos, double dAngDeg, double dMov) ;
bool OnRawMoveData( int nRawId, int RawMoveInd, int nType, const Point3d& ptPos, int nFlag) ;
bool OnRawMoveData( int nRawId, int nRawMoveInd, int nType, const Point3d& ptPos, int nFlag) ;
bool OnMachiningStart( int nOpId, int nOpInd, double dSpeed, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax) ;
bool OnMachiningEnd( void) ;
@@ -80,6 +81,7 @@ class Processor
virtual bool CallOnDispositionStart( void) = 0 ;
virtual bool CallOnDispositionEnd( void) = 0 ;
virtual bool CallOnTableData( void) = 0 ;
virtual bool CallOnTableAxisData( void) = 0 ;
virtual bool CallOnFixtureData( void) = 0 ;
virtual bool CallOnRawMoveData( void) = 0 ;
virtual bool CallOnToolSelect( void) = 0 ;
+3 -2
View File
@@ -3825,9 +3825,10 @@ SurfFinishing::AddOptimal( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSr
if ( ! IsNull( pSfrZConst) && pSfrZConst->IsValid()) {
// recupero dai parametri eventuale Offset di sovrapposizione per ZConst
double dZConstOverlap = m_TParams.m_dDiam ;
double dZConstOverlap = m_TParams.m_dDiam / 2 ;
if ( GetValInNotes( m_Params.m_sUserNotes, "ZConstOverlap", dZConstOverlap))
dZConstOverlap = Clamp( dZConstOverlap, 0., m_TParams.m_dDiam) ;
dZConstOverlap = Clamp( dZConstOverlap, 0., m_TParams.m_dDiam / 2) ;
dZConstOverlap += m_TParams.m_dDiam / 2 ;
// effettuo un Offset del raggio utensile ( o definito da parametro) per la superficie a ZConst
pSfrZConst->Offset( dZConstOverlap, ICurve::OFF_FILLET) ;