Merge commit 'e1c69e207dc2b46b5c1a1cb24d7aef223d69d15b'
This commit is contained in:
@@ -89,6 +89,8 @@ class Disposition : public Operation
|
||||
const std::string& GetHeadName( void) const override ;
|
||||
int GetExitNbr( void) const override ;
|
||||
const std::string& GetToolTcPos( void) const override ;
|
||||
bool GetDoubleToolData( std::string& sDblTool, std::string& sDblTcPos, std::string& sDblHead, int& nDblExit) const override
|
||||
{ return false ; }
|
||||
int GetSolCh( void) const override
|
||||
{ return 0 ; }
|
||||
bool NeedPrevHome( void) const override ;
|
||||
|
||||
+2
-2
@@ -754,8 +754,8 @@ Drilling::Update( bool bPostApply)
|
||||
// elimino le entità CLIMB, RISE e HOME della lavorazione in doppio
|
||||
RemoveClimbRiseHome( false) ;
|
||||
// recupero i dati della testa in doppio e la imposto
|
||||
string sDblTool ; string sDblHead ; int nDblExit ;
|
||||
bool bOk = GetDoubleToolData( sDblTool, sDblHead, nDblExit) &&
|
||||
string sDblTool ; string sDblTcPos ; string sDblHead ; int nDblExit ;
|
||||
bool bOk = GetDoubleToolData( sDblTool, sDblTcPos, sDblHead, nDblExit) &&
|
||||
m_pMchMgr->SetCalcTool( sDblTool, sDblHead, nDblExit) ;
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis, true) ;
|
||||
|
||||
@@ -1358,7 +1358,7 @@ MachMgr::GetMachiningStartAxes( bool bSkipClimb, DBLVECTOR& vAxVal) const
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// recupero i valori
|
||||
return pMch->GetInitialAxesValues( bSkipClimb, vAxVal) ;
|
||||
return pMch->GetInitialAxesValues( bSkipClimb, true, vAxVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -1374,5 +1374,5 @@ MachMgr::GetMachiningEndAxes( bool bSkipRise, DBLVECTOR& vAxVal) const
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// recupero i valori
|
||||
return pMch->GetFinalAxesValues( bSkipRise, vAxVal) ;
|
||||
return pMch->GetFinalAxesValues( bSkipRise, true, vAxVal) ;
|
||||
}
|
||||
|
||||
+42
-24
@@ -296,19 +296,22 @@ Machine::LuaEmtAddArcMove( lua_State* L)
|
||||
int
|
||||
Machine::LuaEmtAddClimb( lua_State* L)
|
||||
{
|
||||
// 5 o 6 parametri : nMachId, vAxVal, nMask, nFlag, nFlag2 [, sInfo]
|
||||
// 5 o 6 o 7 parametri : nMachId [, sMain], vAxVal, nMask, nFlag, nFlag2 [, sInfo]
|
||||
int nMachId ;
|
||||
LuaCheckParam( L, 1, nMachId)
|
||||
string sMain = MCH_CL ;
|
||||
int nOffs = ( LuaGetParam( L, 2, sMain) ? 1 : 0) ;
|
||||
bool bMain = ( ! EqualNoCase( sMain, MCH_DBL)) ;
|
||||
DBLVECTOR vAxVal ;
|
||||
LuaCheckParam( L, 2, vAxVal)
|
||||
LuaCheckParam( L, 2 + nOffs, vAxVal)
|
||||
int nMask ;
|
||||
LuaCheckParam( L, 3, nMask)
|
||||
LuaCheckParam( L, 3 + nOffs, nMask)
|
||||
int nFlag ;
|
||||
LuaCheckParam( L, 4, nFlag)
|
||||
LuaCheckParam( L, 4 + nOffs, nFlag)
|
||||
int nFlag2 ;
|
||||
LuaCheckParam( L, 5, nFlag2)
|
||||
LuaCheckParam( L, 5 + nOffs, nFlag2)
|
||||
string sInfo = "" ;
|
||||
LuaGetParam( L, 6, sInfo) ;
|
||||
LuaGetParam( L, 6 + nOffs, sInfo) ;
|
||||
LuaClearStack( L) ;
|
||||
// verifico ci sia una macchina attiva valida
|
||||
if ( m_pMchLua == nullptr ||
|
||||
@@ -317,7 +320,7 @@ Machine::LuaEmtAddClimb( lua_State* L)
|
||||
// recupero l'operazione
|
||||
Operation* pOper = GetOperation( m_pMchLua->m_pGeomDB->GetUserObj( nMachId)) ;
|
||||
// imposto la discesa (primo movimento del primo percorso della lavorazione)
|
||||
bool bOk = ( pOper != nullptr && pOper->AddSpecialClimb( vAxVal, ( nMask >= 0), GDB_ID_NULL, nFlag, nFlag2, nMask, sInfo, false)) ;
|
||||
bool bOk = ( pOper != nullptr && pOper->AddSpecialClimb( vAxVal, ( nMask >= 0), GDB_ID_NULL, bMain, nFlag, nFlag2, nMask, sInfo, false)) ;
|
||||
if ( ! bOk)
|
||||
return luaL_error( L, " Error in EmtAddClimb") ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
@@ -329,9 +332,12 @@ Machine::LuaEmtAddClimb( lua_State* L)
|
||||
int
|
||||
Machine::LuaEmtRemoveClimb( lua_State* L)
|
||||
{
|
||||
// 1 parametro : nMachId
|
||||
// 1 o 2 parametri : nMachId [, sMain]
|
||||
int nMachId ;
|
||||
LuaCheckParam( L, 1, nMachId)
|
||||
string sMain = MCH_CL ;
|
||||
LuaGetParam( L, 2, sMain) ;
|
||||
bool bMain = ( ! EqualNoCase( sMain, MCH_DBL)) ;
|
||||
LuaClearStack( L) ;
|
||||
// verifico ci sia una macchina attiva valida
|
||||
if ( m_pMchLua == nullptr ||
|
||||
@@ -340,7 +346,7 @@ Machine::LuaEmtRemoveClimb( lua_State* L)
|
||||
// recupero l'operazione
|
||||
Operation* pOper = GetOperation( m_pMchLua->m_pGeomDB->GetUserObj( nMachId)) ;
|
||||
// elimino le discese (primi movimenti "CLIMB" del primo percorso della lavorazione)
|
||||
bool bOk = ( pOper != nullptr && pOper->RemoveClimb()) ;
|
||||
bool bOk = ( pOper != nullptr && pOper->RemoveClimb( GDB_ID_NULL, bMain)) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
|
||||
return 1 ;
|
||||
@@ -350,19 +356,22 @@ Machine::LuaEmtRemoveClimb( lua_State* L)
|
||||
int
|
||||
Machine::LuaEmtAddRise( lua_State* L)
|
||||
{
|
||||
// 5 o 6 parametri : nMachId, vAxVal, nMask, nFlag, nFlag2 [, sInfo]
|
||||
// 5 o 6 o 7 parametri : nMachId [, sMain], vAxVal, nMask, nFlag, nFlag2 [, sInfo]
|
||||
int nMachId ;
|
||||
LuaCheckParam( L, 1, nMachId)
|
||||
string sMain = MCH_CL ;
|
||||
int nOffs = ( LuaGetParam( L, 2, sMain) ? 1 : 0) ;
|
||||
bool bMain = ( ! EqualNoCase( sMain, MCH_DBL)) ;
|
||||
DBLVECTOR vAxVal ;
|
||||
LuaCheckParam( L, 2, vAxVal)
|
||||
LuaCheckParam( L, 2 + nOffs, vAxVal)
|
||||
int nMask ;
|
||||
LuaCheckParam( L, 3, nMask)
|
||||
LuaCheckParam( L, 3 + nOffs, nMask)
|
||||
int nFlag ;
|
||||
LuaCheckParam( L, 4, nFlag)
|
||||
LuaCheckParam( L, 4 + nOffs, nFlag)
|
||||
int nFlag2 ;
|
||||
LuaCheckParam( L, 5, nFlag2)
|
||||
LuaCheckParam( L, 5 + nOffs, nFlag2)
|
||||
string sInfo = "" ;
|
||||
LuaGetParam( L, 6, sInfo) ;
|
||||
LuaGetParam( L, 6 + nOffs, sInfo) ;
|
||||
LuaClearStack( L) ;
|
||||
// verifico ci sia una macchina attiva valida
|
||||
if ( m_pMchLua == nullptr ||
|
||||
@@ -371,7 +380,7 @@ Machine::LuaEmtAddRise( lua_State* L)
|
||||
// recupero l'operazione
|
||||
Operation* pOper = GetOperation( m_pMchLua->m_pGeomDB->GetUserObj( nMachId)) ;
|
||||
// aggiungo la risalita (ultimo movimento dell'ultimo percorso della lavorazione)
|
||||
bool bOk = ( pOper != nullptr && pOper->AddSpecialRise( vAxVal, ( nMask >= 0), GDB_ID_NULL, nFlag, nFlag2, nMask, sInfo)) ;
|
||||
bool bOk = ( pOper != nullptr && pOper->AddSpecialRise( vAxVal, ( nMask >= 0), GDB_ID_NULL, bMain, nFlag, nFlag2, nMask, sInfo)) ;
|
||||
if ( ! bOk)
|
||||
return luaL_error( L, " Error in EmtAddRise") ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
@@ -383,9 +392,12 @@ Machine::LuaEmtAddRise( lua_State* L)
|
||||
int
|
||||
Machine::LuaEmtRemoveRise( lua_State* L)
|
||||
{
|
||||
// 1 parametro : nMachId
|
||||
// 1 o 2 parametri : nMachId [, bMain]
|
||||
int nMachId ;
|
||||
LuaCheckParam( L, 1, nMachId)
|
||||
string sMain = MCH_CL ;
|
||||
LuaGetParam( L, 2, sMain) ;
|
||||
bool bMain = ( ! EqualNoCase( sMain, MCH_DBL)) ;
|
||||
LuaClearStack( L) ;
|
||||
// verifico ci sia una macchina attiva valida
|
||||
if ( m_pMchLua == nullptr ||
|
||||
@@ -394,7 +406,7 @@ Machine::LuaEmtRemoveRise( lua_State* L)
|
||||
// recupero l'operazione
|
||||
Operation* pOper = GetOperation( m_pMchLua->m_pGeomDB->GetUserObj( nMachId)) ;
|
||||
// elimino le risalite (ultimi movimenti "RISE" dell'ultimo percorso della lavorazione)
|
||||
bool bOk = ( pOper != nullptr && pOper->RemoveRise()) ;
|
||||
bool bOk = ( pOper != nullptr && pOper->RemoveRise( GDB_ID_NULL, bMain)) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
|
||||
return 1 ;
|
||||
@@ -404,11 +416,14 @@ Machine::LuaEmtRemoveRise( lua_State* L)
|
||||
int
|
||||
Machine::LuaEmtGetInitialAxesPos( lua_State* L)
|
||||
{
|
||||
// 1 o 2 parametri : nMachId [, bSkipClimb]
|
||||
// 1 o 2 o 3 parametri : nMachId [, sMain] [, bSkipClimb]
|
||||
int nMachId ;
|
||||
LuaCheckParam( L, 1, nMachId)
|
||||
string sMain = MCH_CL ;
|
||||
int nOffs = ( LuaGetParam( L, 2, sMain) ? 1 : 0) ;
|
||||
bool bMain = ( ! EqualNoCase( sMain, MCH_DBL)) ;
|
||||
bool bSkipClimb = true ;
|
||||
LuaGetParam( L, 2, bSkipClimb) ;
|
||||
LuaGetParam( L, 2 + nOffs, bSkipClimb) ;
|
||||
LuaClearStack( L) ;
|
||||
// verifico ci sia una macchina attiva valida
|
||||
if ( m_pMchLua == nullptr ||
|
||||
@@ -418,7 +433,7 @@ Machine::LuaEmtGetInitialAxesPos( lua_State* L)
|
||||
Operation* pOper = GetOperation( m_pMchLua->m_pGeomDB->GetUserObj( nMachId)) ;
|
||||
// acquisico il valore iniziale degli assi macchina
|
||||
DBLVECTOR vAxesVal ;
|
||||
bool bOk = ( pOper != nullptr && pOper->GetInitialAxesValues( bSkipClimb, vAxesVal)) ;
|
||||
bool bOk = ( pOper != nullptr && pOper->GetInitialAxesValues( bSkipClimb, bMain, vAxesVal)) ;
|
||||
if ( bOk)
|
||||
LuaSetParam( L, vAxesVal) ;
|
||||
else
|
||||
@@ -431,11 +446,14 @@ Machine::LuaEmtGetInitialAxesPos( lua_State* L)
|
||||
int
|
||||
Machine::LuaEmtGetFinalAxesPos( lua_State* L)
|
||||
{
|
||||
// 1 o 2 parametri : nMachId [, bSkipRise]
|
||||
// 1 o 2 o 3 parametri : nMachId [, sMain] [, bSkipRise]
|
||||
int nMachId ;
|
||||
LuaCheckParam( L, 1, nMachId)
|
||||
bool bSkipRise = true ;
|
||||
LuaGetParam( L, 2, bSkipRise) ;
|
||||
string sMain = MCH_CL ;
|
||||
int nOffs = ( LuaGetParam( L, 2, sMain) ? 1 : 0) ;
|
||||
bool bMain = ( ! EqualNoCase( sMain, MCH_DBL)) ;
|
||||
LuaGetParam( L, 2 + nOffs, bSkipRise) ;
|
||||
LuaClearStack( L) ;
|
||||
// verifico ci sia una macchina attiva valida
|
||||
if ( m_pMchLua == nullptr ||
|
||||
@@ -445,7 +463,7 @@ Machine::LuaEmtGetFinalAxesPos( lua_State* L)
|
||||
Operation* pOper = GetOperation( m_pMchLua->m_pGeomDB->GetUserObj( nMachId)) ;
|
||||
// acquisico il valore finale degli assi macchina
|
||||
DBLVECTOR vAxesVal ;
|
||||
bool bOk = ( pOper != nullptr && pOper->GetFinalAxesValues( bSkipRise, vAxesVal)) ;
|
||||
bool bOk = ( pOper != nullptr && pOper->GetFinalAxesValues( bSkipRise, bMain, vAxesVal)) ;
|
||||
if ( bOk)
|
||||
LuaSetParam( L, vAxesVal) ;
|
||||
else
|
||||
|
||||
+8
-9
@@ -324,14 +324,14 @@ Machining::MyPrepareToolPreview( bool bDouble)
|
||||
return false ;
|
||||
|
||||
// se necessario, imposto l'utensile corrente
|
||||
string sTool, sHead ;
|
||||
string sTool, sTcPos, sHead ;
|
||||
int nExitDBLId ;
|
||||
if ( ! bDouble) {
|
||||
sTool = GetToolName() ;
|
||||
sHead = GetHeadName() ;
|
||||
}
|
||||
else {
|
||||
if ( ! GetDoubleToolData( sTool, sHead, nExitDBLId))
|
||||
if ( ! GetDoubleToolData( sTool, sTcPos, sHead, nExitDBLId))
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -670,8 +670,8 @@ Machining::PrepareToolPreview( void)
|
||||
}
|
||||
if ( bOk && nStdIdDBL != GDB_ID_NULL) {
|
||||
// imposto l'utensile per la lavorazione in doppio
|
||||
string sTool, sHead ; int nDblExit ;
|
||||
bOk = ( GetDoubleToolData( sTool, sHead, nDblExit)) ;
|
||||
string sTool, sTcPos, sHead ; int nDblExit ;
|
||||
bOk = ( GetDoubleToolData( sTool, sTcPos, sHead, nDblExit)) ;
|
||||
if ( bOk) {
|
||||
bool bOkToolSet = ( m_pMchMgr->SetCalcTool( sTool, sHead, nDblExit)) ;
|
||||
bOk = bOkToolSet && MyPrepareToolPreview( true) && MyChangeToolPreviewShow( m_nLookFlag, true) ;
|
||||
@@ -724,7 +724,7 @@ Machining::GetToolPreviewStepCount( void) const
|
||||
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
|
||||
if ( nClId == GDB_ID_NULL)
|
||||
return 0 ;
|
||||
// determino il numero di entità di tutti i sottogruppi, escludendo CLIMB e RISE
|
||||
// determino il numero di entità di tutti i sottogruppi, escludendo CLIMB, RISE ed HOME
|
||||
int nCount = 0 ;
|
||||
int nPxId = m_pGeomDB->GetFirstGroupInGroup( nClId) ;
|
||||
while ( nPxId != GDB_ID_NULL) {
|
||||
@@ -865,8 +865,8 @@ Machining::MyToolPreview( int nEntId, bool bDouble) const
|
||||
if ( ! bDouble)
|
||||
m_pMchMgr->GetAllCurrAxesNames( vAxNames) ;
|
||||
else {
|
||||
string sDBLTool, sDBLHead ; int nDBLExit ;
|
||||
bool bOk = ( GetDoubleToolData( sDBLTool, sDBLHead, nDBLExit) && m_pMchMgr->SetCalcTool( sDBLTool, sDBLHead, nDBLExit)) ;
|
||||
string sDBLTool, sDBLTcPos, sDBLHead ; int nDBLExit ;
|
||||
bool bOk = ( GetDoubleToolData( sDBLTool, sDBLTcPos, sDBLHead, nDBLExit) && m_pMchMgr->SetCalcTool( sDBLTool, sDBLHead, nDBLExit)) ;
|
||||
if ( bOk)
|
||||
m_pMchMgr->GetAllCurrAxesNames( vAxNames) ;
|
||||
m_pMchMgr->SetCalcTool( GetToolName(), GetHeadName(), GetExitNbr()) ;
|
||||
@@ -1052,7 +1052,7 @@ Machining::GetDoubleType( const string& sUserNotes)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machining::GetDoubleToolData( string& sDblTool, string& sDblHead, int& nDblExit) const
|
||||
Machining::GetDoubleToolData( string& sDblTool, string& sDblTcPos, string& sDblHead, int& nDblExit) const
|
||||
{
|
||||
if ( m_pGeomDB == nullptr || m_pMchMgr == nullptr)
|
||||
return false ;
|
||||
@@ -1063,7 +1063,6 @@ Machining::GetDoubleToolData( string& sDblTool, string& sDblHead, int& nDblExit)
|
||||
// recupero dati utensile in doppio
|
||||
if ( ! GetValInNotes( GetToolData().m_sUserNotes, "DOUBLE", sDblTool))
|
||||
return false ;
|
||||
string sDblTcPos ;
|
||||
if ( ! m_pMchMgr->GetCurrSetupMgr().GetToolData( sDblTool, sDblTcPos, sDblHead, nDblExit)) {
|
||||
const ToolData* pTdata = pTMgr->GetTool( sDblTool) ;
|
||||
if ( pTdata == nullptr)
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ class Machining : public Operation
|
||||
bool SpecialApply( std::string& sErr) ;
|
||||
bool PostApply( std::string& sErr) ;
|
||||
int GetDoubleType( const std::string& sUserNotes) ;
|
||||
bool GetDoubleToolData( std::string& sDblTool, std::string& sDblHead, int& nDblExit) const ;
|
||||
bool GetDoubleToolData( std::string& sDblTool, std::string& sDblTcPos, std::string& sDblHead, int& nDblExit) const override ;
|
||||
bool CalcMirrorByDouble( int nClId, const std::string& sUserNotes) ;
|
||||
bool ActivateDrillingUnit( int nHeadId, const INTVECTOR& vActExit) const ;
|
||||
|
||||
|
||||
+2
-2
@@ -910,8 +910,8 @@ Milling::Update( bool bPostApply)
|
||||
// elimino le entità CLIMB, RISE e HOME della lavorazione in doppio
|
||||
RemoveClimbRiseHome( false) ;
|
||||
// recupero i dati della testa in doppio e la imposto
|
||||
string sDblTool ; string sDblHead ; int nDblExit ;
|
||||
bool bOk = GetDoubleToolData( sDblTool, sDblHead, nDblExit) &&
|
||||
string sDblTool ; string sTcPos; string sDblHead ; int nDblExit ;
|
||||
bool bOk = GetDoubleToolData( sDblTool, sTcPos, sDblHead, nDblExit) &&
|
||||
m_pMchMgr->SetCalcTool( sDblTool, sDblHead, nDblExit) ;
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis, true) ;
|
||||
|
||||
+619
-183
File diff suppressed because it is too large
Load Diff
+25
-14
@@ -45,7 +45,7 @@ class Operation : public IUserObj
|
||||
{ m_nPhase = nPhase ; return true ; }
|
||||
virtual int GetPhase( void) const
|
||||
{ return m_nPhase ; }
|
||||
virtual bool RemoveHome( void) ;
|
||||
virtual bool RemoveHome( bool bMain = true) ;
|
||||
std::string GetName( void) const ;
|
||||
|
||||
public :
|
||||
@@ -54,8 +54,8 @@ class Operation : public IUserObj
|
||||
virtual bool UpdateStatus( int nModif) = 0 ;
|
||||
|
||||
public :
|
||||
bool GetInitialAxesValues( bool bSkipClimb, DBLVECTOR& vAxVal) const ;
|
||||
bool GetFinalAxesValues( bool bSkipRise, DBLVECTOR& vAxVal) const ;
|
||||
bool GetInitialAxesValues( bool bSkipClimb, bool bMain, DBLVECTOR& vAxVal) const ;
|
||||
bool GetFinalAxesValues( bool bSkipRise, bool bMain, DBLVECTOR& vAxVal) const ;
|
||||
|
||||
protected :
|
||||
virtual const std::string& GetToolName( void) const = 0 ;
|
||||
@@ -63,6 +63,7 @@ class Operation : public IUserObj
|
||||
virtual int GetExitNbr( void) const = 0 ;
|
||||
virtual int GetSolCh( void) const = 0 ;
|
||||
virtual const std::string& GetToolTcPos( void) const = 0 ;
|
||||
virtual bool GetDoubleToolData( std::string& sDblTool, std::string& sDblTcPos, std::string& sDblHead, int& nDblExit) const = 0 ;
|
||||
virtual bool NeedPrevHome( void) const = 0 ;
|
||||
virtual bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const
|
||||
{ return true ; }
|
||||
@@ -125,9 +126,9 @@ class Operation : public IUserObj
|
||||
bool AreAllPathsOk( void) const ;
|
||||
bool GetToolpathsStatus( int& nCnt, int& nEmpty) const ;
|
||||
int GetFirstFullToolpath( bool bMain = true) const ;
|
||||
int GetNextFullToolpath( int nClPathId) const ;
|
||||
int GetNextFullToolpath( int nClPathId, bool bMain = true) const ;
|
||||
int GetLastFullToolpath( bool bMain = true) const ;
|
||||
int GetPrevFullToolpath( int nClPathId) const ;
|
||||
int GetPrevFullToolpath( int nClPathId, bool bMain = true) const ;
|
||||
bool UpdateFollowingOperationsStatus( int nModif) ;
|
||||
bool GetElevation( int nPhase, const Point3d& ptP,
|
||||
const Vector3d& vtDir, double& dElev) const ;
|
||||
@@ -208,9 +209,9 @@ class Operation : public IUserObj
|
||||
bool GetClPathInitialToolDir( int nClPathId, bool bSkipClimb, Vector3d& vtTool) const ;
|
||||
bool GetFinalToolDir( bool bSkipRise, Vector3d& vtTool) const ;
|
||||
bool GetClPathFinalToolDir( int nClPathId, bool bSkipRise, Vector3d& vtTool) const ;
|
||||
const CamData* GetInitialCamData( bool bSkipClimb) const ;
|
||||
const CamData* GetInitialCamData( bool bSkipClimb, bool bMain = true) const ;
|
||||
const CamData* GetClPathInitialCamData( int nClPathId, bool bSkipClimb) const ;
|
||||
const CamData* GetFinalCamData( bool bSkipRise) const ;
|
||||
const CamData* GetFinalCamData( bool bSkipRise, bool bMain = true) const ;
|
||||
const CamData* GetClPathFinalCamData( int nClPathId, bool bSkipRise) const ;
|
||||
bool ApplyHintToPrevAxRot( const std::string& sHint, const Machine* pMch, DBLVECTOR& vAxRotPrec) ;
|
||||
bool CalculateClPathMcentAxesValues( int nClPathId, double dAngDeltaMinForHome, const DBLVECTOR& vAxRotHome,
|
||||
@@ -239,16 +240,25 @@ class Operation : public IUserObj
|
||||
bool AdjustStartEndMovementsStd( bool bVerifyPreviousLink) ;
|
||||
bool AdjustOneStartEndMovement( int nClPathId, int nPrevClPathId, Operation* pPrevOpe, const DBLVECTOR& vAxPrev, double dPrevOffsX, bool bMaxZ) ;
|
||||
bool AdjustStartEndMovementsNew( void) ;
|
||||
bool ManageSpecialLink( Operation* pPrevOpe, int nPrevClPathId, Operation* pNextOpe, int nNextClPathId) ;
|
||||
bool ToolChangeNeeded( const Operation& Ope1, const Operation& Ope2) const ;
|
||||
bool AddSpecialClimb( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL,
|
||||
bool MoveHeadFromHomeToMach( bool bMain, const std::string& sToolName, const std::string& sHeadName, int nExitNbr, int nStartZMax) ;
|
||||
bool MoveHeadFromMachToMach( Operation* pPrevOpe,
|
||||
bool bPrevMain, const std::string& sPrevToolName, const std::string& sPrevHeadName, int nPrevExitNbr,
|
||||
bool bCurrMain, const std::string& sCurrToolName, const std::string& sCurrHeadName, int nCurrExitNbr,
|
||||
bool bToolChange, int nStartZMax) ;
|
||||
bool MoveHeadFromMachToHome( Operation* pPrevOpe, bool bCurrMain, const std::string& sCurrToolName, const std::string& sCurrHeadName, int nCurrExitNbr,
|
||||
int nStartZMax) ;
|
||||
bool ManageDoubleOperNew( Operation* pPrevOpe) ;
|
||||
bool ManageSpecialLink( Operation* pPrevOpe, int nPrevClPathId, bool bPrevMain, Operation* pNextOpe, int nNextClPathId, bool bNextMain,
|
||||
int nStartZMax) ;
|
||||
bool ToolChangeNeeded( const Operation& Ope1, bool bMain1, const Operation& Ope2, bool bMain2) const ;
|
||||
bool AddSpecialClimb( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL, bool bMain = true,
|
||||
int nFlag = 0, int nFlag2 = 0, int nMask = -1, const std::string& sInfo = "", bool bFirst = true) ;
|
||||
bool RemoveClimb( int nClPathId = GDB_ID_NULL, bool bMain = true) ;
|
||||
bool AddRise( DBLVECTOR& vAxVal, double dDelta = NAN, int nClPathId = GDB_ID_NULL, int nToMinMaxZ = 0) ;
|
||||
bool AddSpecialRise( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL,
|
||||
bool AddRise( DBLVECTOR& vAxVal, double dDelta = NAN, int nClPathId = GDB_ID_NULL, bool bMain = true, int nToMinMaxZ = 0) ;
|
||||
bool AddSpecialRise( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL, bool bMain = true,
|
||||
int nFlag = 0, int nFlag2 = 0, int nMask = -1, const std::string& sInfo = "") ;
|
||||
bool RemoveRise( int nClPathId = GDB_ID_NULL, bool bMain = true) ;
|
||||
bool AddHome( void) ;
|
||||
bool AddHome( bool bMain = true) ;
|
||||
bool AddRobotClimb( int nEntId, double dDeltaZ = NAN) ;
|
||||
bool CalcRobotAxesAbovePos( const Point3d& ptP, const Vector3d& vtT, const Vector3d& vtA, double dDeltaZ,
|
||||
DBLVECTOR& vAx, double* pdNewDeltaZ = nullptr) const ;
|
||||
@@ -267,7 +277,8 @@ class Operation : public IUserObj
|
||||
bool SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, int& nFlag2, bool& bModif) ;
|
||||
bool SpecialMoveRapid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, DBLVECTOR& vAxNew, bool& bModif) ;
|
||||
bool SpecialLink( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, int nLinkType,
|
||||
const Operation* pPrevOpe, const Operation* pNextOpe) ;
|
||||
const Operation* pPrevOpe, bool bPrevMain, const Operation* pNextOpe, bool bNextMain,
|
||||
int nStartZMax) ;
|
||||
bool SpecialPrevMachiningOffset( const Operation* pPrevOpe, double& dOffsetX) ;
|
||||
|
||||
protected :
|
||||
|
||||
@@ -88,6 +88,7 @@ static const std::string GVAR_MAXMIN = ".MAXMIN" ; // (double/s) minimo di
|
||||
static const std::string GVAR_MAXMAX = ".MAXMAX" ; // (double/s) massimo di ingombro degli assi della lavorazione
|
||||
static const std::string GVAR_PATHID = ".PATHID" ; // (int) identificativo percorso di lavorazione
|
||||
static const std::string GVAR_PATHIND = ".PATHIND" ; // (int) indice percorso di lavorazione
|
||||
static const std::string GVAR_DBLPATHID = ".DBLPATHID" ; // (int) identificativo eventuale percorso di lavorazione in doppio
|
||||
static const std::string GVAR_START = ".START" ; // (Point3d) punto iniziale del percorso originale
|
||||
static const std::string GVAR_END = ".END" ; // (Point3d) punto finale del percorso originale
|
||||
static const std::string GVAR_EXTR = ".EXTR" ; // (Vector3d) versore estrusione
|
||||
|
||||
+2
-2
@@ -781,8 +781,8 @@ Pocketing::Update( bool bPostApply)
|
||||
// elimino le entità CLIMB, RISE e HOME della lavorazione in doppio
|
||||
RemoveClimbRiseHome( false) ;
|
||||
// recupero i dati della testa in doppio e la imposto
|
||||
string sDblTool ; string sDblHead ; int nDblExit ;
|
||||
bool bOk = GetDoubleToolData( sDblTool, sDblHead, nDblExit) &&
|
||||
string sDblTool ; string sDblTcPos ; string sDblHead ; int nDblExit ;
|
||||
bool bOk = GetDoubleToolData( sDblTool, sDblTcPos, sDblHead, nDblExit) &&
|
||||
m_pMchMgr->SetCalcTool( sDblTool, sDblHead, nDblExit) ;
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis, true) ;
|
||||
|
||||
+2
-2
@@ -858,8 +858,8 @@ PocketingNT::Update( bool bPostApply)
|
||||
// elimino le entità CLIMB, RISE e HOME della lavorazione in doppio
|
||||
RemoveClimbRiseHome( false) ;
|
||||
// recupero i dati della testa in doppio e la imposto
|
||||
string sDblTool ; string sDblHead ; int nDblExit ;
|
||||
bool bOk = GetDoubleToolData( sDblTool, sDblHead, nDblExit) &&
|
||||
string sDblTool ; string sDblTcPos ; string sDblHead ; int nDblExit ;
|
||||
bool bOk = GetDoubleToolData( sDblTool, sDblTcPos, sDblHead, nDblExit) &&
|
||||
m_pMchMgr->SetCalcTool( sDblTool, sDblHead, nDblExit) ;
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis, true) ;
|
||||
|
||||
+18
-4
@@ -960,6 +960,13 @@ SimulatorMP::FindAndManagePathStart( int& nStatus)
|
||||
// se trovato nuovo CLpath con entità, gestisco inizio percorso di lavoro
|
||||
if ( m_nEntId != GDB_ID_NULL) {
|
||||
++ m_nCLPathInd ;
|
||||
// verifico se Path in doppio
|
||||
int nDBLPathId = GDB_ID_NULL ;
|
||||
int nDBLId = m_pGeomDB->GetFirstNameInGroup( m_nOpId, MCH_DBL) ;
|
||||
if ( nDBLId != GDB_ID_NULL) {
|
||||
string sCLPathName ; m_pGeomDB->GetName( m_nCLPathId, sCLPathName) ;
|
||||
nDBLPathId = m_pGeomDB->GetFirstNameInGroup( nDBLId, sCLPathName) ;
|
||||
}
|
||||
// recupero punti di inizio e fine percorso
|
||||
Point3d ptStart ;
|
||||
m_pGeomDB->GetInfo( m_nCLPathId, KEY_START, ptStart) ;
|
||||
@@ -990,7 +997,7 @@ SimulatorMP::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, ptEnd, vtExtr,
|
||||
if ( ! OnPathStart( m_nCLPathId, m_nCLPathInd, nDBLPathId, m_nAuxSTot, ptStart, ptEnd, vtExtr,
|
||||
ptMin, ptMax, vAxMin, vAxMax, dElev, vActiveExit)) {
|
||||
nStatus = CalcStatusOnError( ERR_NONE) ;
|
||||
return false ;
|
||||
@@ -1961,6 +1968,8 @@ SimulatorMP::OnMachiningEnd( void)
|
||||
{
|
||||
// chiamo la funzione di fine lavorazione
|
||||
bool bOk = CallFunction( ON_SIMUL_MACHINING_END, true) ;
|
||||
// reset eventuale Path in double
|
||||
bOk = bOk && m_pMachine->LuaResetGlobVar( GLOB_VAR + GVAR_DBLPATHID) ;
|
||||
// forzo aggiornamento posizione assi (possono essere stati mossi nello script)
|
||||
UpdateAxesPos() ;
|
||||
return bOk ;
|
||||
@@ -1968,13 +1977,18 @@ SimulatorMP::OnMachiningEnd( void)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SimulatorMP::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
|
||||
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit)
|
||||
SimulatorMP::OnPathStart( int nClPathId, int nClPathInd, int nDBLPathId, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
|
||||
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit)
|
||||
{
|
||||
// assegno identificativo e indice percorso di lavorazione
|
||||
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PATHID, nClPathId) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PATHIND, nClPathInd) ;
|
||||
// assegno identificativo percorso di lavorazione in doppio
|
||||
if ( nDBLPathId == GDB_ID_NULL)
|
||||
bOk = bOk && m_pMachine->LuaResetGlobVar( GLOB_VAR + GVAR_DBLPATHID) ;
|
||||
else
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_DBLPATHID, nDBLPathId) ;
|
||||
// assegno numero di dati ausiliari iniziali
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_AUXTOT, nAS) ;
|
||||
// assegno punti iniziale e finale e versore estrusione
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ class SimulatorMP : public ISimulator
|
||||
bool OnMachiningEnd( void) ;
|
||||
bool OnPathStartAux( int nInd, const std::string& sAS, int& nErr) ;
|
||||
bool OnPathEndAux( int nInd, const std::string& sAE, int& nErr) ;
|
||||
bool OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
bool OnPathStart( int nClPathId, int nClPathInd, int nDBLPathId, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
|
||||
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit) ;
|
||||
bool OnPathEnd( int nAE) ;
|
||||
|
||||
+18
-4
@@ -908,6 +908,13 @@ SimulatorSP::FindAndManagePathStart( int& nStatus)
|
||||
// se trovato nuovo CLpath con entità, gestisco inizio percorso di lavoro
|
||||
if ( m_nEntId != GDB_ID_NULL) {
|
||||
++ m_nCLPathInd ;
|
||||
// verifico se Path in doppio
|
||||
int nDBLPathId = GDB_ID_NULL ;
|
||||
int nDBLId = m_pGeomDB->GetFirstNameInGroup( m_nOpId, MCH_DBL) ;
|
||||
if ( nDBLId != GDB_ID_NULL) {
|
||||
string sCLPathName ; m_pGeomDB->GetName( m_nCLPathId, sCLPathName) ;
|
||||
nDBLPathId = m_pGeomDB->GetFirstNameInGroup( nDBLId, sCLPathName) ;
|
||||
}
|
||||
// recupero punti di inizio e fine percorso
|
||||
Point3d ptStart ;
|
||||
m_pGeomDB->GetInfo( m_nCLPathId, KEY_START, ptStart) ;
|
||||
@@ -938,7 +945,7 @@ SimulatorSP::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, ptEnd, vtExtr,
|
||||
if ( ! OnPathStart( m_nCLPathId, m_nCLPathInd, nDBLPathId, m_nAuxSTot, ptStart, ptEnd, vtExtr,
|
||||
ptMin, ptMax, vAxMin, vAxMax, dElev, vActiveExit)) {
|
||||
nStatus = CalcStatusOnError( 0) ;
|
||||
return false ;
|
||||
@@ -2020,6 +2027,8 @@ SimulatorSP::OnMachiningEnd( void)
|
||||
return true ;
|
||||
// chiamo la funzione di fine lavorazione
|
||||
bool bOk = m_pMachine->LuaCallFunction( ON_SIMUL_MACHINING_END) ;
|
||||
// reset eventuale Path in double
|
||||
bOk = bOk && m_pMachine->LuaResetGlobVar( GLOB_VAR + GVAR_DBLPATHID) ;
|
||||
// forzo aggiornamento posizione assi (possono essere stati mossi nello script)
|
||||
UpdateAxesPos() ;
|
||||
return bOk ;
|
||||
@@ -2027,13 +2036,18 @@ SimulatorSP::OnMachiningEnd( void)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SimulatorSP::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
|
||||
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit)
|
||||
SimulatorSP::OnPathStart( int nClPathId, int nClPathInd, int nDBLPathId, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
|
||||
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit)
|
||||
{
|
||||
// assegno identificativo e indice percorso di lavorazione
|
||||
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PATHID, nClPathId) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PATHIND, nClPathInd) ;
|
||||
// assegno identificativo percorso di lavorazione in doppio
|
||||
if ( nDBLPathId == GDB_ID_NULL)
|
||||
bOk = bOk && m_pMachine->LuaResetGlobVar( GLOB_VAR + GVAR_DBLPATHID) ;
|
||||
else
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_DBLPATHID, nDBLPathId) ;
|
||||
// assegno numero di dati ausiliari iniziali
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_AUXTOT, nAS) ;
|
||||
// assegno punti iniziale e finale e versore estrusione
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ class SimulatorSP : public ISimulator
|
||||
bool OnMachiningEnd( void) ;
|
||||
bool OnPathStartAux( int nInd, const std::string& sAS, int& nErr) ;
|
||||
bool OnPathEndAux( int nInd, const std::string& sAE, int& nErr) ;
|
||||
bool OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
bool OnPathStart( int nClPathId, int nClPathInd, int nDBLPathId, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
|
||||
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit) ;
|
||||
bool OnPathEnd( int nAE) ;
|
||||
|
||||
Reference in New Issue
Block a user