EgtExecutor 1.6j4 :

- modifiche per gestione DB utensili e generatore codice CN.
This commit is contained in:
Dario Sassi
2015-10-31 09:46:49 +00:00
parent ceef9cb3ac
commit 0f7805a9a1
4 changed files with 561 additions and 432 deletions
+190 -146
View File
@@ -219,7 +219,7 @@ ExeGetCurrMachGroup( void)
}
//-----------------------------------------------------------------------------
// Raw Parts
// Raw Parts & Parts
//-----------------------------------------------------------------------------
int
ExeGetRawPartCount( void)
@@ -594,146 +594,26 @@ ExeShowOnlyTable( bool bVal)
//-----------------------------------------------------------------------------
int
ExeAddSubPiece( const string& sName, const Point3d& ptPos, double dAngRotDeg)
ExeAddFixture( const string& sName, const Point3d& ptPos, double dAngRotDeg)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// inserisco il sottopezzo nella posizione indicata
return pGseCtx->m_pMachMgr->AddSubPiece( sName, ptPos, dAngRotDeg) ;
}
//-----------------------------------------------------------------------------
// Machine Calc
//-----------------------------------------------------------------------------
bool
ExeSetAxisPos( const string& sAxis, double dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->SetAxisPos( sAxis, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisPos( const string& sAxis, double* pdVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifico il parametro di ritorno
if ( pdVal == nullptr)
return false ;
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->GetAxisPos( sAxis, *pdVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisHomePos( const string& sAxis, double* pdHomeVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifico il parametro di ritorno
if ( pdHomeVal == nullptr)
return false ;
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->GetAxisHomePos( sAxis, *pdHomeVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeResetAxisPos( const string& sAxis)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// metto l'asse nella posizione home
return pGseCtx->m_pMachMgr->ResetAxisPos( sAxis) ;
}
//-----------------------------------------------------------------------------
bool
ExeLoadTool( const string& sHead, int nExit, const string& sTool)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// carico l'utensile sulla macchina della macchinata corrente in posizione indicata
return pGseCtx->m_pMachMgr->LoadTool( sHead, nExit, sTool) ;
}
//-----------------------------------------------------------------------------
bool
ExeResetHeadSet( const string& sHead)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// carico l'utensile sulla macchina della macchinata corrente in posizione indicata
return pGseCtx->m_pMachMgr->ResetHeadSet( sHead) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetCalcTable( const std::string& sTable)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la tavola corrente della macchinata corrente per i calcoli
return pGseCtx->m_pMachMgr->SetCalcTable( sTable) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetCalcTool( const std::string& sTool, const std::string& sHead, int nExit)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto l'utensile corrente per il calcolo sulla macchina della macchinata corrente
return pGseCtx->m_pMachMgr->SetCalcTool( sTool, sHead, nExit) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcTool( std::string& sTool)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// restituisco il nome dell'utensile corrente per il calcolo sulla macchina della macchinata corrente
return pGseCtx->m_pMachMgr->GetCalcTool( sTool) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// calcolo gli angoli macchina dalle direzioni fresa e ausiliaria passate
return pGseCtx->m_pMachMgr->GetCalcAngles( vtDirT, vtDirA, nStat, dAngA1, dAngB1, dAngA2, dAngB2) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcPositions( const Point3d& ptP, double dAngA, double dAngB,
int& nStat, double& dX, double& dY, double& dZ)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// calcolo gli angoli macchina dalla direzione fresa passata
return pGseCtx->m_pMachMgr->GetCalcPositions( ptP, dAngA, dAngB, nStat, dX, dY, dZ) ;
}
//-----------------------------------------------------------------------------
bool
ExeVerifyOutOfStroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifica l'extracorsa degli assi
return pGseCtx->m_pMachMgr->VerifyOutOfStroke( dX, dY, dZ, dAngA, dAngB, nStat) ;
// inserisco il dispositivo di presa nella posizione indicata
return pGseCtx->m_pMachMgr->AddFixture( sName, ptPos, dAngRotDeg) ;
}
//-----------------------------------------------------------------------------
// DB utensili
//-----------------------------------------------------------------------------
bool
ExeTdbGetToolNewName( string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero un nuovo nome a partire da quello passato
return pGseCtx->m_pMachMgr->TdbGetToolNewName( sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbAddTool( const string& sName, int nType)
@@ -786,62 +666,82 @@ ExeTdbGetNextTool( int nFamily, string& sName, int& nType)
//-----------------------------------------------------------------------------
bool
ExeTdbSetToolParam( const string& sName, int nType, int nVal)
ExeTdbSetCurrTool( const std::string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSetToolParam( sName, nType, nVal) ;
return pGseCtx->m_pMachMgr->TdbSetCurrTool( sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetToolParam( const string& sName, int nType, double dVal)
ExeTdbSaveCurrTool( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSaveCurrTool() ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetCurrToolParam( int nType, int nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetCurrToolParam( int nType, double dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSetToolParam( sName, nType, dVal) ;
return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetToolParam( const string& sName, int nType, const string& sVal)
ExeTdbSetCurrToolParam( int nType, const string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSetToolParam( sName, nType, sVal) ;
return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetToolParam( const string& sName, int nType, int& nVal)
ExeTdbGetCurrToolParam( int nType, int& nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbGetToolParam( sName, nType, nVal) ;
return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetToolParam( const string& sName, int nType, double& dVal)
ExeTdbGetCurrToolParam( int nType, double& dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbGetToolParam( sName, nType, dVal) ;
return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetToolParam( const string& sName, int nType, string& sVal)
ExeTdbGetCurrToolParam( int nType, string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbGetToolParam( sName, nType, sVal) ;
return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
@@ -1019,3 +919,147 @@ ExeSimStop( void)
// termino la simulazione della macchinata corrente
return pGseCtx->m_pMachMgr->SimStop() ;
}
//-----------------------------------------------------------------------------
// Generazione
//-----------------------------------------------------------------------------
bool
ExeGenerate( const string& sCncFile)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// avvio la generazione del partprogram della macchinata corrente
return pGseCtx->m_pMachMgr->Generate( sCncFile) ;
}
//-----------------------------------------------------------------------------
// Machine Calc
//-----------------------------------------------------------------------------
bool
ExeSetCalcTable( const std::string& sTable)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la tavola corrente della macchinata corrente per i calcoli
return pGseCtx->m_pMachMgr->SetCalcTable( sTable) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetCalcTool( const std::string& sTool, const std::string& sHead, int nExit)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto l'utensile corrente per il calcolo sulla macchina della macchinata corrente
return pGseCtx->m_pMachMgr->SetCalcTool( sTool, sHead, nExit) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcTool( std::string& sTool)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// restituisco il nome dell'utensile corrente per il calcolo sulla macchina della macchinata corrente
return pGseCtx->m_pMachMgr->GetCalcTool( sTool) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// calcolo gli angoli macchina dalle direzioni fresa e ausiliaria passate
return pGseCtx->m_pMachMgr->GetCalcAngles( vtDirT, vtDirA, nStat, dAngA1, dAngB1, dAngA2, dAngB2) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcPositions( const Point3d& ptP, double dAngA, double dAngB,
int& nStat, double& dX, double& dY, double& dZ)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// calcolo gli angoli macchina dalla direzione fresa passata
return pGseCtx->m_pMachMgr->GetCalcPositions( ptP, dAngA, dAngB, nStat, dX, dY, dZ) ;
}
//-----------------------------------------------------------------------------
bool
ExeVerifyOutOfStroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifica l'extracorsa degli assi
return pGseCtx->m_pMachMgr->VerifyOutOfStroke( dX, dY, dZ, dAngA, dAngB, nStat) ;
}
//-----------------------------------------------------------------------------
// Machine Move
//-----------------------------------------------------------------------------
bool
ExeSetAxisPos( const string& sAxis, double dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->SetAxisPos( sAxis, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisPos( const string& sAxis, double* pdVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifico il parametro di ritorno
if ( pdVal == nullptr)
return false ;
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->GetAxisPos( sAxis, *pdVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisHomePos( const string& sAxis, double* pdHomeVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifico il parametro di ritorno
if ( pdHomeVal == nullptr)
return false ;
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->GetAxisHomePos( sAxis, *pdHomeVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeResetAxisPos( const string& sAxis)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// metto l'asse nella posizione home
return pGseCtx->m_pMachMgr->ResetAxisPos( sAxis) ;
}
//-----------------------------------------------------------------------------
bool
ExeLoadTool( const string& sHead, int nExit, const string& sTool)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// carico l'utensile sulla macchina della macchinata corrente in posizione indicata
return pGseCtx->m_pMachMgr->LoadTool( sHead, nExit, sTool) ;
}
//-----------------------------------------------------------------------------
bool
ExeResetHeadSet( const string& sHead)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// carico l'utensile sulla macchina della macchinata corrente in posizione indicata
return pGseCtx->m_pMachMgr->ResetHeadSet( sHead) ;
}