EgtInterface 1.6d3 :

- costanti stringa sostituite con costanti numeriche
- modificate funzioni API e LUA per scansione pezzi e layer
- aggiunta pulizia memoria al caricamento messaggi (necessario al cambio lingua)
- migliorie varie a funzioni Lua.
This commit is contained in:
Dario Sassi
2015-04-20 08:43:10 +00:00
parent fd718143e6
commit 9d3dc5e537
38 changed files with 810 additions and 824 deletions
+81 -21
View File
@@ -227,6 +227,36 @@ __stdcall EgtGetCurrMachGroup( void)
return pMachMgr->GetCurrMachGroup() ;
}
//-----------------------------------------------------------------------------
int
EgtGetRawPartNbr( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il numero di grezzi nella macchinata corrente
return pGseCtx->m_pMachMgr->GetRawPartNbr() ;
}
//-----------------------------------------------------------------------------
int
EgtGetFirstRawPart( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero identificativo primo grezzo nella macchinata corrente
return pGseCtx->m_pMachMgr->GetFirstRawPart() ;
}
//-----------------------------------------------------------------------------
int
EgtGetNextRawPart( int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero identificativo successivo grezzo nella macchinata corrente
return pGseCtx->m_pMachMgr->GetNextRawPart( nRawId) ;
}
//-----------------------------------------------------------------------------
int
EgtAddRawPart( Point3d ptOrig, double dWidth, double dLength, double dHeight, Color cCol)
@@ -272,27 +302,6 @@ EgtAddRawPartWithPart( int nPartId, int nCrvId, double dOverMat, Color cCol)
return nId ;
}
//-----------------------------------------------------------------------------
bool
EgtAddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// inserisco pezzo in un grezzo della macchinata corrente
bool bOk = pGseCtx->m_pMachMgr->AddPartToRawPart( nPartId, ptPos, nRawId) ;
pGseCtx->m_bModified = true ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtAddPartToRawPart(" + ToString( nPartId) + ",{" +
ToString( ptPos) + "}," +
ToString( nRawId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
EgtModifyRawPartHeight( int nRawId, double dHeight)
@@ -415,6 +424,57 @@ EgtMoveToCenterRawPart( int nRawId, const Point3d& ptCenter, int nFlag)
return bOk ;
}
//-----------------------------------------------------------------------------
int
EgtGetPartInRawPartNbr( int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il numero di pezzi nel grezzo
return pGseCtx->m_pMachMgr->GetPartInRawPartNbr( nRawId) ;
}
//-----------------------------------------------------------------------------
int
EgtGetFirstPartInRawPart( int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero identificativo primo pezzo nel grezzo
return pGseCtx->m_pMachMgr->GetFirstPartInRawPart( nRawId) ;
}
//-----------------------------------------------------------------------------
int
EgtGetNextPartInRawPart( int nPartId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero identificativo successivo pezzo nello stesso grezzo
return pGseCtx->m_pMachMgr->GetNextPartInRawPart( nPartId) ;
}
//-----------------------------------------------------------------------------
bool
EgtAddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// inserisco pezzo in un grezzo della macchinata corrente
bool bOk = pGseCtx->m_pMachMgr->AddPartToRawPart( nPartId, ptPos, nRawId) ;
pGseCtx->m_bModified = true ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtAddPartToRawPart(" + ToString( nPartId) + ",{" +
ToString( ptPos) + "}," +
ToString( nRawId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
EgtRemovePartFromRawPart( int nPartId)