EgtMachKernel 2.3b5 :
- aggiunto Flag2 a CamData per secondo flag dei movimenti - nei movimenti Genera e Simula ora definito EMT.FLAG2 - in Simula possibilità di visualizzare quote assi principali anche se disabilitati come movimento EMT.ShowAxes.
This commit is contained in:
+24
-1
@@ -51,7 +51,9 @@ static int CAM_PARAM_V6 = 21 ;
|
||||
static string CAM_INDEX = "Idx" ;
|
||||
static int CAM_PARAM_V7 = 22 ;
|
||||
static string CAM_ORIGFEED = "OrFeed" ;
|
||||
static int CAM_TOTPARAM =CAM_PARAM_V7 ;
|
||||
static int CAM_PARAM_V8 = 23 ;
|
||||
static string CAM_FLAG2 = "Flg2" ;
|
||||
static int CAM_TOTPARAM =CAM_PARAM_V8 ;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -88,6 +90,7 @@ CamData::Clone( void) const
|
||||
pCam->m_dFeed = m_dFeed ;
|
||||
pCam->m_dOrigFeed = m_dOrigFeed ;
|
||||
pCam->m_nFlag = m_nFlag ;
|
||||
pCam->m_nFlag2 = m_nFlag2 ;
|
||||
pCam->m_nIndex = m_nIndex ;
|
||||
pCam->m_nAxesStatus = m_nAxesStatus ;
|
||||
pCam->m_nAxesMask = m_nAxesMask ;
|
||||
@@ -125,6 +128,7 @@ CamData::Dump( string& sOut, bool bMM, const char* szNewLine) const
|
||||
if ( m_dOrigFeed >= 0)
|
||||
sOut += CAM_ORIGFEED + "=" + ToString( m_dOrigFeed) + szNewLine ;
|
||||
sOut += CAM_FLAG + "=" + ToString( m_nFlag) + szNewLine ;
|
||||
sOut += CAM_FLAG2 + "=" + ToString( m_nFlag2) + szNewLine ;
|
||||
sOut += CAM_INDEX + "=" + ToString( m_nIndex) + szNewLine ;
|
||||
sOut += CAM_AXSTS + "=" + ToString( m_nAxesStatus) + szNewLine ;
|
||||
sOut += CAM_AXMSK + "=" + ToString( m_nAxesMask) + szNewLine ;
|
||||
@@ -197,6 +201,8 @@ CamData::Save( int nBaseId, STRVECTOR& vString) const
|
||||
vString[++k] = CAM_INDEX + "=" + ToString( m_nIndex) ;
|
||||
// parametri aggiunti V7
|
||||
vString[++k] = CAM_ORIGFEED + "=" + ToString( m_dOrigFeed) ;
|
||||
// parametri aggiunti V8
|
||||
vString[++k] = CAM_FLAG2 + "=" + ToString( m_nFlag2) ;
|
||||
}
|
||||
catch( ...) {
|
||||
return false ;
|
||||
@@ -281,6 +287,14 @@ CamData::Load( const STRVECTOR& vString, int nBaseGdbId)
|
||||
else {
|
||||
m_dOrigFeed = -1 ;
|
||||
}
|
||||
// parametri aggiunti V8
|
||||
if ( int( vString.size()) >= CAM_PARAM_V8) {
|
||||
if ( ! GetVal( vString[++k], CAM_FLAG2, m_nFlag2))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
m_nFlag2 = 0 ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -537,6 +551,7 @@ CamData::CamData( void)
|
||||
m_dFeed = 0 ;
|
||||
m_dOrigFeed = -1 ;
|
||||
m_nFlag = 0 ;
|
||||
m_nFlag2 = 0 ;
|
||||
m_nIndex = 0 ;
|
||||
m_nAxesStatus = AS_NONE ;
|
||||
m_nAxesMask = 0x00 ;
|
||||
@@ -650,6 +665,14 @@ CamData::SetFlag( int nFlag)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CamData::SetFlag2( int nFlag2)
|
||||
{
|
||||
m_nFlag2 = nFlag2 ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CamData::SetIndex( int nIndex)
|
||||
|
||||
@@ -57,6 +57,7 @@ class CamData : public IUserObj
|
||||
bool SetFeed( double dFeed) ;
|
||||
bool SetOrigFeed( double dOrigFeed) ;
|
||||
bool SetFlag( int nFlag) ;
|
||||
bool SetFlag2( int nFlag2) ;
|
||||
bool SetIndex( int nIndex) ;
|
||||
bool SetAxes( int nStatus, const DBLVECTOR& vAxVal) ;
|
||||
bool ChangeAxesMask( int nMask) ;
|
||||
@@ -95,6 +96,8 @@ class CamData : public IUserObj
|
||||
{ return m_dOrigFeed ; }
|
||||
int GetFlag( void) const
|
||||
{ return m_nFlag ; }
|
||||
int GetFlag2( void) const
|
||||
{ return m_nFlag2 ; }
|
||||
int GetIndex( void) const
|
||||
{ return m_nIndex ; }
|
||||
int GetAxesStatus( void) const
|
||||
@@ -147,6 +150,7 @@ class CamData : public IUserObj
|
||||
double m_dFeed ; // velocità di avanzamento in lavorazione
|
||||
double m_dOrigFeed ; // velocità originale di avanzamento (sul tip utensile)
|
||||
int m_nFlag ; // flag per usi vari
|
||||
int m_nFlag2 ; // secondo flag per usi vari
|
||||
int m_nIndex ; // indice per usi vari
|
||||
int m_nAxesStatus ; // stato dei valori degli assi
|
||||
int m_nAxesMask ; // mask di emissione degli assi (bit a bit)
|
||||
|
||||
Binary file not shown.
@@ -75,9 +75,9 @@ class MachMgr : public IMachMgr
|
||||
std::string GetLastErrorString( void) const override
|
||||
{ return m_sLastError ; }
|
||||
int GetWarningId( int nInd) const override
|
||||
{ if ( nInd >= int( m_Warnings.size())) return 0 ; return m_Warnings[ nInd].first ; }
|
||||
{ if ( nInd < 0 || nInd >= int( m_Warnings.size())) return 0 ; return m_Warnings[ nInd].first ; }
|
||||
std::string GetWarningString( int nInd) const override
|
||||
{ if ( nInd >= int( m_Warnings.size())) return "" ; return m_Warnings[ nInd].second ; }
|
||||
{ if ( nInd < 0 || nInd >= int( m_Warnings.size())) return "" ; return m_Warnings[ nInd].second ; }
|
||||
// Machines
|
||||
bool SetCurrMachine( const std::string& sMachineName) override ;
|
||||
bool GetCurrMachineName( std::string& sMachineName) const override ;
|
||||
|
||||
+43
-8
@@ -130,7 +130,7 @@ Operation::Init( MachMgr* pMchMgr)
|
||||
Operation::Operation( void)
|
||||
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr), m_pMchMgr( nullptr), m_nPhase( 1),
|
||||
m_nPathId( GDB_ID_NULL), m_bCurr( false), m_ptCurr(),
|
||||
m_vtTool(), m_vtCorr(), m_vtAux(), m_dFeed( 0), m_nFlag( 0), m_nIndex( 0)
|
||||
m_vtTool(), m_vtCorr(), m_vtAux(), m_dFeed( 0), m_nFlag( 0), m_nFlag2( 0), m_nIndex( 0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1236,8 +1236,8 @@ Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
|
||||
// Assegno gli angoli iniziali
|
||||
DBLVECTOR vAxRotPrec( nRotAxes, 0.) ;
|
||||
DBLVECTOR vAxVal ;
|
||||
// se utensile non cambiato, uso gli angoli finali della lavorazione precedente
|
||||
if ( ! sPrevTool.empty() && ! ToolChangeNeeded( *pPrevOp, *this) &&
|
||||
// se non richiesti angoli Home e utensile non cambiato, uso gli angoli finali della lavorazione precedente
|
||||
if ( GetUserNotesZmax() != 2 && ! sPrevTool.empty() && ! ToolChangeNeeded( *pPrevOp, *this) &&
|
||||
pPrevOp->GetFinalAxesValues( true, vAxVal)) {
|
||||
for ( int i = 0 ; i < nRotAxes ; ++ i)
|
||||
vAxRotPrec[i] = vAxVal[nLinAxes + i] ;
|
||||
@@ -1949,22 +1949,26 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
|
||||
DBLVECTOR vAxNew = vAxCurr ;
|
||||
vAxNew[2] = dHomeZ ;
|
||||
int nFlagNew = 2 ;
|
||||
int nFlag2New = 1 ;
|
||||
// eventuali aggiustamenti speciali dipendenti dalla macchina
|
||||
DBLVECTOR vAxTmp = vAxNew ;
|
||||
Vector3d vtTool = pCamData->GetToolDir() ;
|
||||
int nFlagTmp = nFlagNew ;
|
||||
int nFlag2Tmp = nFlag2New ;
|
||||
bool bModif ;
|
||||
if ( ! SpecialMoveZup( vAxTmp, vtTool, nFlagTmp, bModif))
|
||||
if ( ! SpecialMoveZup( vAxTmp, vtTool, nFlagTmp, nFlag2Tmp, bModif))
|
||||
return false ;
|
||||
if ( bModif) {
|
||||
vAxNew = vAxTmp ;
|
||||
pCamData->SetToolDir( vtTool) ;
|
||||
nFlagNew = nFlagTmp ;
|
||||
nFlag2New = nFlag2Tmp ;
|
||||
}
|
||||
// applico le modifiche (non forzo emissione della Z che è già massima)
|
||||
pCamData->SetAxes( CamData::AS_OK, vAxNew) ;
|
||||
pCamData->ChangeAxesMask( CamData::MSK_L1 | CamData::MSK_L2 | CamData::MSK_R1 | CamData::MSK_R2 | CamData::MSK_R3) ;
|
||||
pCamData->SetFlag( nFlagNew) ;
|
||||
pCamData->SetFlag2( nFlag2New) ;
|
||||
}
|
||||
// verifico se la testa interferisce con i pezzi o i bloccaggi sulla tavola
|
||||
else {
|
||||
@@ -2015,22 +2019,26 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
|
||||
DBLVECTOR vAxNew = vAxCurr ;
|
||||
vAxNew[2] = vAxNew1[2] ;
|
||||
int nFlagNew = 2 ;
|
||||
int nFlag2New = 1 ;
|
||||
// eventuali aggiustamenti speciali dipendenti dalla macchina
|
||||
Vector3d vtTool = pCamData->GetToolDir() ;
|
||||
DBLVECTOR vAxTmp = vAxNew ;
|
||||
int nFlagTmp = nFlagNew ;
|
||||
int nFlag2Tmp = nFlag2New ;
|
||||
bool bModif ;
|
||||
if ( ! SpecialMoveZup( vAxTmp, vtTool, nFlagTmp, bModif))
|
||||
if ( ! SpecialMoveZup( vAxTmp, vtTool, nFlagTmp, nFlag2Tmp, bModif))
|
||||
return false ;
|
||||
if ( bModif) {
|
||||
pCamData->SetToolDir( vtTool) ;
|
||||
vAxNew = vAxTmp ;
|
||||
nFlagNew = nFlagTmp ;
|
||||
nFlag2New = nFlag2Tmp ;
|
||||
}
|
||||
// applico le modifiche (non forzo emissione della Z che è già alta)
|
||||
pCamData->SetAxes( CamData::AS_OK, vAxNew) ;
|
||||
pCamData->ChangeAxesMask( CamData::MSK_L1 | CamData::MSK_L2 | CamData::MSK_R1 | CamData::MSK_R2 | CamData::MSK_R3) ;
|
||||
pCamData->SetFlag( nFlagNew) ;
|
||||
pCamData->SetFlag2( nFlag2New) ;
|
||||
}
|
||||
// altrimenti
|
||||
else {
|
||||
@@ -2058,22 +2066,26 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
|
||||
DBLVECTOR vAxNew = vAxCurr ;
|
||||
vAxNew[2] = vAxPrev[2] ;
|
||||
int nFlagNew = 2 ;
|
||||
int nFlag2New = 0 ;
|
||||
// eventuali aggiustamenti speciali dipendenti dalla macchina
|
||||
Vector3d vtTool = pCamData->GetToolDir() ;
|
||||
DBLVECTOR vAxTmp = vAxNew ;
|
||||
int nFlagTmp = nFlagNew ;
|
||||
int nFlag2Tmp = nFlag2New ;
|
||||
bool bModif ;
|
||||
if ( ! SpecialMoveZup( vAxTmp, vtTool, nFlagTmp, bModif))
|
||||
if ( ! SpecialMoveZup( vAxTmp, vtTool, nFlagTmp, nFlag2Tmp, bModif))
|
||||
return false ;
|
||||
if ( bModif) {
|
||||
pCamData->SetToolDir( vtTool) ;
|
||||
vAxNew = vAxTmp ;
|
||||
nFlagNew = nFlagTmp ;
|
||||
nFlag2New = nFlag2Tmp ;
|
||||
}
|
||||
// applico le modifiche (non forzo emissione della Z che è già alta)
|
||||
pCamData->SetAxes( CamData::AS_OK, vAxNew) ;
|
||||
pCamData->ChangeAxesMask( CamData::MSK_L1 | CamData::MSK_L2 | CamData::MSK_R1 | CamData::MSK_R2 | CamData::MSK_R3) ;
|
||||
pCamData->SetFlag( nFlagNew) ;
|
||||
pCamData->SetFlag2( nFlag2New) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2169,6 +2181,7 @@ Operation::AddRise( DBLVECTOR& vAxVal, double dDelta, int nClPathId, bool bZHome
|
||||
return false ;
|
||||
// flag per tipo di movimento in rapido
|
||||
int nFlag = 0 ;
|
||||
int nFlag2 = 0 ;
|
||||
// se delta positivo lo uso come incremento di Z
|
||||
if ( dDelta > 0 || bZHomeDown) {
|
||||
vAxVal[2] += dDelta ;
|
||||
@@ -2181,18 +2194,21 @@ Operation::AddRise( DBLVECTOR& vAxVal, double dDelta, int nClPathId, bool bZHome
|
||||
m_pMchMgr->GetAllCurrAxesHomePos( vAxHome) ;
|
||||
vAxVal[2] = vAxHome[2] ;
|
||||
nFlag = 3 ; // movimento a Zmax
|
||||
nFlag2 = 1 ;
|
||||
}
|
||||
// eventuale aggiustamenti speciali dipendenti dalla macchina
|
||||
Vector3d vtTool = pCam->GetToolDir() ;
|
||||
DBLVECTOR vAxTmp = vAxVal ;
|
||||
int nFlagTmp = nFlag ;
|
||||
int nFlag2Tmp = nFlag2 ;
|
||||
bool bModif ;
|
||||
if ( ! SpecialMoveZup( vAxTmp, vtTool, nFlagTmp, bModif))
|
||||
if ( ! SpecialMoveZup( vAxTmp, vtTool, nFlagTmp, nFlag2Tmp, bModif))
|
||||
return false ;
|
||||
if ( bModif) {
|
||||
pCam->SetToolDir( vtTool) ;
|
||||
vAxVal = vAxTmp ;
|
||||
nFlag = nFlagTmp ;
|
||||
nFlag2 = nFlag2Tmp ;
|
||||
}
|
||||
// verifico extra-corsa dell'asse Z
|
||||
double dL1 = vAxVal[0] ;
|
||||
@@ -2208,6 +2224,7 @@ Operation::AddRise( DBLVECTOR& vAxVal, double dDelta, int nClPathId, bool bZHome
|
||||
pCam->SetMoveType( 0) ;
|
||||
pCam->SetFeed( 0) ;
|
||||
pCam->SetFlag( nFlag) ;
|
||||
pCam->SetFlag2( nFlag2) ;
|
||||
// associo questo oggetto a quello geometrico
|
||||
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
|
||||
|
||||
@@ -2484,6 +2501,9 @@ Operation::ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const
|
||||
int nRotAxes = m_pMchMgr->GetCurrRotAxes() ;
|
||||
if ( nLinAxes + nRotAxes != vAxStart.size() || nLinAxes + nRotAxes != vAxEnd.size())
|
||||
return true ;
|
||||
// Verifico se richiesta risalita da note utente della lavorazione
|
||||
if ( GetUserNotesZmax() > 0)
|
||||
return true ;
|
||||
// Se testa con Info ZMAXONROT != 0 e movimento assi rotanti -> risalita a Zmax
|
||||
int nHeadId = pMch->GetCurrHead() ;
|
||||
DBLVECTOR vdVal ;
|
||||
@@ -2500,6 +2520,19 @@ Operation::ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
Operation::GetUserNotesZmax( void) const
|
||||
{
|
||||
string sUserNotes ;
|
||||
if ( m_pMchMgr != nullptr && m_pMchMgr->GetMachiningParam( MPA_USERNOTES, sUserNotes)) {
|
||||
int nVal ;
|
||||
if ( FromString( ExtractInfo( sUserNotes, "StartZmax="), nVal))
|
||||
return nVal ;
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetZHomeDown( void) const
|
||||
@@ -2678,7 +2711,7 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, bool& bModif)
|
||||
Operation::SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, int& nFlag2, bool& bModif)
|
||||
{
|
||||
// recupero la macchina corrente
|
||||
Machine* pMch = ( m_pMchMgr != nullptr ? m_pMchMgr->GetCurrMachine() : nullptr) ;
|
||||
@@ -2697,6 +2730,7 @@ Operation::SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, bool& b
|
||||
// imposto valori parametri
|
||||
bOk = bOk && pMch->LuaCreateGlobTable( EMC_VAR) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_FLAG, nFlag) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_FLAG2, nFlag2) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_TOOL, GetToolName()) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_HEAD, GetHeadName()) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_EXIT, GetExitNbr()) ;
|
||||
@@ -2713,6 +2747,7 @@ Operation::SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, bool& b
|
||||
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_ERROR, nErr) ;
|
||||
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_MODIF, bModif) ;
|
||||
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + GVAR_FLAG, nFlag) ;
|
||||
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + GVAR_FLAG2, nFlag2) ;
|
||||
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + GVAR_TDIR, vtTool) ;
|
||||
for ( int i = 1 ; i <= nNumAxes ; ++ i)
|
||||
bOk = bOk && pMch->LuaGetGlobVar( GetGlobVarAxisValue( i, EMC_VAR), vAx[i-1]) ;
|
||||
|
||||
+4
-1
@@ -112,9 +112,10 @@ class Operation : public IUserObj
|
||||
bool CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, double& dDeltaZ) const ;
|
||||
bool GetExtraZ( double dSafeZ, double& dExtraZ, double& dMaxAngV) const ;
|
||||
bool ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
|
||||
int GetUserNotesZmax( void) const ;
|
||||
bool GetZHomeDown( void) const ;
|
||||
bool TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
|
||||
bool SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, bool& bModif) ;
|
||||
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 GetAggrBottomData( const std::string& sHead, AggrBottom& agbData) const ;
|
||||
@@ -133,6 +134,7 @@ class Operation : public IUserObj
|
||||
bool SetCorrAuxDir( const Vector3d& vtDir) ;
|
||||
bool SetFeed( double dFeed) ;
|
||||
bool SetFlag( int nFlag) ;
|
||||
bool SetFlag2( int nFlag2) ;
|
||||
bool SetIndex( int nIndex) ;
|
||||
bool GetCurrPos( Point3d& ptCurr) const
|
||||
{ if ( ! m_bCurr) return false ; ptCurr = m_ptCurr ; return true ; }
|
||||
@@ -163,6 +165,7 @@ class Operation : public IUserObj
|
||||
Vector3d m_vtAux ; // direzione ausiliaria corrente
|
||||
double m_dFeed ; // feed corrente
|
||||
int m_nFlag ; // flag corrente
|
||||
int m_nFlag2 ; // secondo flag corrente
|
||||
int m_nIndex ; // indice corrente
|
||||
} ;
|
||||
|
||||
|
||||
@@ -82,6 +82,14 @@ Operation::SetFlag( int nFlag)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::SetFlag2( int nFlag2)
|
||||
{
|
||||
m_nFlag2 = nFlag2 ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::SetIndex( int nIndex)
|
||||
@@ -121,6 +129,7 @@ Operation::AddRapidStart( const Point3d& ptP)
|
||||
pCam->SetEndPoint( ptP) ;
|
||||
pCam->SetFeed( 0) ;
|
||||
pCam->SetFlag( m_nFlag) ;
|
||||
pCam->SetFlag2( m_nFlag2) ;
|
||||
pCam->SetIndex( m_nIndex) ;
|
||||
// associo questo oggetto a quello geometrico
|
||||
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
|
||||
@@ -172,6 +181,7 @@ Operation::AddRapidMove( const Point3d& ptP)
|
||||
pCam->SetEndPoint( ptP) ;
|
||||
pCam->SetFeed( 0) ;
|
||||
pCam->SetFlag( m_nFlag) ;
|
||||
pCam->SetFlag2( m_nFlag2) ;
|
||||
pCam->SetIndex( m_nIndex) ;
|
||||
// associo questo oggetto a quello geometrico
|
||||
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
|
||||
@@ -229,6 +239,7 @@ Operation::AddLinearMove( const Point3d& ptP)
|
||||
pCam->SetEndPoint( ptP) ;
|
||||
pCam->SetFeed( m_dFeed) ;
|
||||
pCam->SetFlag( m_nFlag) ;
|
||||
pCam->SetFlag2( m_nFlag2) ;
|
||||
pCam->SetIndex( m_nIndex) ;
|
||||
// associo questo oggetto a quello geometrico
|
||||
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
|
||||
@@ -302,6 +313,7 @@ Operation::AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen,
|
||||
pCam->SetNormDir( vtMyN) ;
|
||||
pCam->SetFeed( m_dFeed) ;
|
||||
pCam->SetFlag( m_nFlag) ;
|
||||
pCam->SetFlag2( m_nFlag2) ;
|
||||
pCam->SetIndex( m_nIndex) ;
|
||||
// associo questo oggetto a quello geometrico
|
||||
m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
|
||||
@@ -412,6 +424,7 @@ Operation::ResetMoveData( void)
|
||||
m_vtAux = V_NULL ;
|
||||
m_dFeed = 0 ;
|
||||
m_nFlag = 0 ;
|
||||
m_nFlag2 = 0 ;
|
||||
m_nIndex = 0 ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -139,11 +139,13 @@ static const std::string GVAR_R3N = ".R3n" ; // (string) nome del t
|
||||
static const std::string GVAR_R4N = ".R4n" ; // (string) nome del quarto asse rotante
|
||||
static const std::string GVAR_MASK = ".MASK" ; // (int) mask associato ai movimenti in rapido
|
||||
static const std::string GVAR_FLAG = ".FLAG" ; // (int) flag associato ad ogni movimento
|
||||
static const std::string GVAR_FLAG2 = ".FLAG2" ; // (int) secondo flag associato ad ogni movimento
|
||||
static const std::string GVAR_INDEX = ".IDX" ; // (int) indice associato ad ogni movimento
|
||||
static const std::string GVAR_TDIR = ".TDIR" ; // (Vector3d)versore utensile nel riferimento pezzo
|
||||
static const std::string GVAR_CDIR = ".CDIR" ; // (Vector3d)versore correzione nel riferimento pezzo
|
||||
static const std::string GVAR_ADIR = ".ADIR" ; // (Vector3d)versore ausiliario nel riferimento pezzo
|
||||
static const std::string GVAR_ENABAXES = ".EnabAxes" ; // (bool) flag abilitazione assi attivi per simulazione
|
||||
static const std::string GVAR_SHOWAXES = ".ShowAxes" ; // (bool) flag visualizzazione assi attivi per simulazione
|
||||
static const std::string GVAR_AUXAXES = ".AuxAxes" ; // (int) numero assi ausiliari per simulazione
|
||||
static const std::string GVAR_AN = ".AN" ; // (num) valore del N-esimo asse ausiliario per simulazione
|
||||
static const std::string GVAR_ANN = ".ANn" ; // (string) nome del N-esimo asse ausiliario per simulazione
|
||||
|
||||
+12
-6
@@ -449,13 +449,13 @@ Processor::ProcessClEnt( int nEntId, int nEntInd, int nClPathId, int nClPathInd,
|
||||
case 0 : // rapido
|
||||
if ( ! OnRapid( nMove, AxesEnd, pCamData->GetAxesMask(),
|
||||
pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(),
|
||||
pCamData->GetFlag(), pCamData->GetIndex()))
|
||||
pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex()))
|
||||
return false ;
|
||||
break ;
|
||||
case 1 : // linea
|
||||
if ( ! OnLinear( nMove, AxesEnd,
|
||||
pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(),
|
||||
pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetIndex()))
|
||||
pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex()))
|
||||
return false ;
|
||||
break ;
|
||||
case 2 : // arco CW
|
||||
@@ -464,7 +464,7 @@ Processor::ProcessClEnt( int nEntId, int nEntInd, int nClPathId, int nClPathInd,
|
||||
ptMid.Rotate( pCamData->GetAxesCen(), pCamData->GetAxesNormDir(), - pCamData->GetAxesAngCen() / 2) ;
|
||||
if ( ! OnArc( nMove, AxesEnd, pCamData->GetAxesCen(), ptMid, pCamData->GetAxesRad(), pCamData->GetAxesAngCen(),
|
||||
pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(),
|
||||
pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetIndex()))
|
||||
pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex()))
|
||||
return false ;
|
||||
break ;
|
||||
}
|
||||
@@ -959,7 +959,7 @@ Processor::OnPathEndAux( int nInd, const string& sAE)
|
||||
bool
|
||||
Processor::OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
|
||||
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
|
||||
int nFlag, int nIndex)
|
||||
int nFlag, int nFlag2, int nIndex)
|
||||
{
|
||||
// cancello variabili estranee
|
||||
ResetArcData() ;
|
||||
@@ -983,6 +983,8 @@ Processor::OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_ADIR, vtAux) ;
|
||||
// assegno il valore del flag
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG, nFlag) ;
|
||||
// assegno il valore del secondo flag
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG2, nFlag2) ;
|
||||
// assegno il valore dell'indice
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_INDEX, nIndex) ;
|
||||
// chiamo la funzione di movimento in rapido
|
||||
@@ -994,7 +996,7 @@ Processor::OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
|
||||
bool
|
||||
Processor::OnLinear( int nMove, const DBLVECTOR& AxesEnd,
|
||||
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
|
||||
double dFeed, int nFlag, int nIndex)
|
||||
double dFeed, int nFlag, int nFlag2, int nIndex)
|
||||
{
|
||||
// cancello variabili estranee
|
||||
ResetArcData() ;
|
||||
@@ -1018,6 +1020,8 @@ Processor::OnLinear( int nMove, const DBLVECTOR& AxesEnd,
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_F, dFeed) ;
|
||||
// assegno il valore del flag
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG, nFlag) ;
|
||||
// assegno il valore del secondo flag
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG2, nFlag2) ;
|
||||
// assegno il valore dell'indice
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_INDEX, nIndex) ;
|
||||
// chiamo la funzione di movimento in rapido
|
||||
@@ -1029,7 +1033,7 @@ Processor::OnLinear( int nMove, const DBLVECTOR& AxesEnd,
|
||||
bool
|
||||
Processor::OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen,
|
||||
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
|
||||
double dFeed, int nFlag, int nIndex)
|
||||
double dFeed, int nFlag, int nFlag2, int nIndex)
|
||||
{
|
||||
// assegno il tipo di movimento
|
||||
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ;
|
||||
@@ -1063,6 +1067,8 @@ Processor::OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, con
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_F, dFeed) ;
|
||||
// assegno il valore del flag
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG, nFlag) ;
|
||||
// assegno il valore del secondo flag
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG2, nFlag2) ;
|
||||
// assegno il valore dell'indice
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_INDEX, nIndex) ;
|
||||
// chiamo la funzione di movimento in rapido
|
||||
|
||||
+3
-3
@@ -61,12 +61,12 @@ class Processor
|
||||
bool OnPathEndAux( int nInd, const std::string& sAE) ;
|
||||
bool OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
|
||||
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
|
||||
int nFlag, int nIndex) ;
|
||||
int nFlag, int nFlag2, int nIndex) ;
|
||||
bool OnLinear( int nMove, const DBLVECTOR& AxesEnd, const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
|
||||
double dFeed, int nFlag, int nIndex) ;
|
||||
double dFeed, int nFlag, int nFlag2, int nIndex) ;
|
||||
bool OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen,
|
||||
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
|
||||
double dFeed, int nFlag, int nIndex) ;
|
||||
double dFeed, int nFlag, int nFlag2, int nIndex) ;
|
||||
bool ResetArcData( void) ;
|
||||
|
||||
protected :
|
||||
|
||||
+7
-1
@@ -70,6 +70,7 @@ Simulator::Simulator( void)
|
||||
m_dVmAdOffs = 0 ;
|
||||
m_dSafeDist = SAFEDIST_STD ;
|
||||
m_bEnabAxes = true ;
|
||||
m_bShowAxes = true ;
|
||||
m_AxesName.reserve( 8) ;
|
||||
m_AxesToken.reserve( 8) ;
|
||||
m_AxesLinear.reserve( 8) ;
|
||||
@@ -206,6 +207,7 @@ Simulator::ResetInterpolation( void)
|
||||
m_dVmAdOffs = 0 ;
|
||||
m_dSafeDist = SAFEDIST_STD ;
|
||||
m_bEnabAxes = true ;
|
||||
m_bShowAxes = true ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -287,7 +289,7 @@ Simulator::GetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear,
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// numero assi di calcolo e ausiliari
|
||||
int nAxisCount = ( m_bEnabAxes ? int( m_AxesName.size()) : 0) ;
|
||||
int nAxisCount = ( m_bShowAxes ? int( m_AxesName.size()) : 0) ;
|
||||
int nAuxAxisCount = int( m_AuxAxesName.size()) ;
|
||||
// recupero i dati dell'asse
|
||||
if ( nI < 0 || nI >= nAxisCount + nAuxAxisCount)
|
||||
@@ -578,6 +580,7 @@ Simulator::ResetAuxAxes( void)
|
||||
m_AuxAxesEnd.clear() ;
|
||||
// abilito assi principali
|
||||
m_bEnabAxes = true ;
|
||||
m_bShowAxes = true ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -1598,6 +1601,7 @@ Simulator::OnMoveStart( const CamData* pCamData, int& nErr)
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEIND, m_nEntInd) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, pCamData->GetMoveType()) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG, pCamData->GetFlag()) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG2, pCamData->GetFlag2()) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_INDEX, pCamData->GetIndex()) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_ERR, nErr) ;
|
||||
// valore degli assi all'inizio e alla fine del movimento
|
||||
@@ -1649,6 +1653,8 @@ Simulator::OnMoveStart( const CamData* pCamData, int& nErr)
|
||||
// recupero i dati di ritorno
|
||||
if ( ! m_pMachine->LuaGetGlobVar( GLOB_VAR + GVAR_ENABAXES, m_bEnabAxes))
|
||||
m_bEnabAxes = true ;
|
||||
if ( ! m_pMachine->LuaGetGlobVar( GLOB_VAR + GVAR_SHOWAXES, m_bShowAxes))
|
||||
m_bShowAxes = m_bEnabAxes ;
|
||||
int nNumAuxAxes = 0 ;
|
||||
if ( ! m_pMachine->LuaGetGlobVar( GLOB_VAR + GVAR_AUXAXES, nNumAuxAxes) || nNumAuxAxes == 0)
|
||||
return true ;
|
||||
|
||||
@@ -132,6 +132,7 @@ class Simulator
|
||||
COBVECTOR m_CollObj ; // vettore oggetti da testare per collisione con grezzo
|
||||
double m_dSafeDist ; // distanza di sicurezza per verifica collisioni
|
||||
bool m_bEnabAxes ; // flag abilitazione movimento assi attivi
|
||||
bool m_bShowAxes ; // flag visualizzazione assi attivi
|
||||
STRVECTOR m_AxesName ; // nomi degli assi macchina attivi
|
||||
STRVECTOR m_AxesToken ; // token degli assi macchina attivi
|
||||
BOOLVECTOR m_AxesInvert ; // flag di asse con verso invertito
|
||||
|
||||
Reference in New Issue
Block a user