EgtExchange 1.5i4 :

- tolto controllo antidebug da release per VB.NET
- aggiunta importazione CNC e relatico comando TSC.
This commit is contained in:
Dario Sassi
2014-09-18 14:58:12 +00:00
parent 6347441c69
commit f8942da9bc
8 changed files with 879 additions and 52 deletions
+75 -44
View File
@@ -17,10 +17,11 @@
#include "DllMain.h"
#include "/EgtDev/Include/EgnStringUtils.h"
#include "/EgtDev/Include/EgnCmdParser.h"
#include "/EgtDev/Include/EExExportStl.h"
#include "/EgtDev/Include/EExExportDxf.h"
#include "/EgtDev/Include/EExImportStl.h"
#include "/EgtDev/Include/EExExportStl.h"
#include "/EgtDev/Include/EExImportCnc.h"
#include "/EgtDev/Include/EExImportDxf.h"
#include "/EgtDev/Include/EExImportStl.h"
using namespace std ;
@@ -37,10 +38,11 @@ ExcExecutor::ExcExecutor( void)
{
// assegno chiavi a funzioni di esecuzione
m_ExecMgr.Init( 8) ;
m_ExecMgr.Insert( "EXPORTSTL", &ExcExecutor::ExecuteExportStl) ;
m_ExecMgr.Insert( "EXPORTDXF", &ExcExecutor::ExecuteExportDxf) ;
m_ExecMgr.Insert( "IMPORTSTL", &ExcExecutor::ExecuteImportStl) ;
m_ExecMgr.Insert( "EXPORTSTL", &ExcExecutor::ExecuteExportStl) ;
m_ExecMgr.Insert( "IMPORTCNC", &ExcExecutor::ExecuteImportCnc) ;
m_ExecMgr.Insert( "IMPORTDXF", &ExcExecutor::ExecuteImportDxf) ;
m_ExecMgr.Insert( "IMPORTSTL", &ExcExecutor::ExecuteImportStl) ;
}
//----------------------------------------------------------------------------
@@ -82,34 +84,6 @@ ExcExecutor::SetGeomDB( IGeomDB* pGdb)
return ( m_pGDB != nullptr) ;
}
//----------------------------------------------------------------------------
bool
ExcExecutor::ExecuteExportStl( const string& sCmd2, const STRVECTOR& vsParams)
{
// 2 parametri : Id del gruppo, nome del file
if ( vsParams.size() != 2)
return false ;
// recupero l'Id
int nId = m_pParser->GetIdParam( vsParams[0]) ;
if ( nId == CMD_ID_ERROR)
return false ;
// eventuale conversione di token nel nome file
string sFile = vsParams[1] ;
m_pParser->DirReplace( sFile) ;
// preparo l'esportatore
IExportStl* pExpStl = CreateExportStl() ;
if ( pExpStl == nullptr) {
LOG_ERROR( GetEExLogger(), "Error : CreateExportStl")
return false ;
}
// eseguo l'esportazione
bool bOk = pExpStl->Export( m_pGDB, nId, sFile) ;
// cancello l'esportatore
delete pExpStl ;
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExcExecutor::ExecuteExportDxf( const string& sCmd2, const STRVECTOR& vsParams)
@@ -140,10 +114,38 @@ ExcExecutor::ExecuteExportDxf( const string& sCmd2, const STRVECTOR& vsParams)
//----------------------------------------------------------------------------
bool
ExcExecutor::ExecuteImportStl( const string& sCmd2, const STRVECTOR& vsParams)
ExcExecutor::ExecuteExportStl( const string& sCmd2, const STRVECTOR& vsParams)
{
// 2 o 3 parametri : nome del file, Id del gruppo[, ScaleFactor]
if ( vsParams.size() != 2 && vsParams.size() != 3)
// 2 parametri : Id del gruppo, nome del file
if ( vsParams.size() != 2)
return false ;
// recupero l'Id
int nId = m_pParser->GetIdParam( vsParams[0]) ;
if ( nId == CMD_ID_ERROR)
return false ;
// eventuale conversione di token nel nome file
string sFile = vsParams[1] ;
m_pParser->DirReplace( sFile) ;
// preparo l'esportatore
IExportStl* pExpStl = CreateExportStl() ;
if ( pExpStl == nullptr) {
LOG_ERROR( GetEExLogger(), "Error : CreateExportStl")
return false ;
}
// eseguo l'esportazione
bool bOk = pExpStl->Export( m_pGDB, nId, sFile) ;
// cancello l'esportatore
delete pExpStl ;
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExcExecutor::ExecuteImportCnc( const string& sCmd2, const STRVECTOR& vsParams)
{
// 2 : nome del file, Id del gruppo
if ( vsParams.size() != 2)
return false ;
// eventuale conversione di token nel nome file
string sFile = vsParams[0] ;
@@ -152,21 +154,17 @@ ExcExecutor::ExecuteImportStl( const string& sCmd2, const STRVECTOR& vsParams)
int nId = m_pParser->GetIdParam( vsParams[1]) ;
if ( nId == CMD_ID_ERROR)
return false ;
// gestisco ScaleFactor
double dScaleFactor = 1 ;
if ( vsParams.size() >= 3)
FromString( vsParams[2], dScaleFactor) ;
// preparo l'importatore
IImportStl* pImpStl = CreateImportStl() ;
if ( pImpStl == nullptr) {
LOG_ERROR( GetEExLogger(), "Error : CreateImportStl")
IImportCnc* pImpCnc = CreateImportCnc() ;
if ( pImpCnc == nullptr) {
LOG_ERROR( GetEExLogger(), "Error : CreateImportCnc")
return false ;
}
// eseguo l'importazione
bool bOk = pImpStl->Import( sFile, m_pGDB, nId, dScaleFactor) ;
bool bOk = pImpCnc->Import( sFile, m_pGDB, nId) ;
// cancello l'importatore
delete pImpStl ;
delete pImpCnc ;
return bOk ;
}
@@ -203,3 +201,36 @@ ExcExecutor::ExecuteImportDxf( const string& sCmd2, const STRVECTOR& vsParams)
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExcExecutor::ExecuteImportStl( const string& sCmd2, const STRVECTOR& vsParams)
{
// 2 o 3 parametri : nome del file, Id del gruppo[, ScaleFactor]
if ( vsParams.size() != 2 && vsParams.size() != 3)
return false ;
// eventuale conversione di token nel nome file
string sFile = vsParams[0] ;
m_pParser->DirReplace( sFile) ;
// recupero l'Id
int nId = m_pParser->GetIdParam( vsParams[1]) ;
if ( nId == CMD_ID_ERROR)
return false ;
// gestisco ScaleFactor
double dScaleFactor = 1 ;
if ( vsParams.size() >= 3)
FromString( vsParams[2], dScaleFactor) ;
// preparo l'importatore
IImportStl* pImpStl = CreateImportStl() ;
if ( pImpStl == nullptr) {
LOG_ERROR( GetEExLogger(), "Error : CreateImportStl")
return false ;
}
// eseguo l'importazione
bool bOk = pImpStl->Import( sFile, m_pGDB, nId, dScaleFactor) ;
// cancello l'importatore
delete pImpStl ;
return bOk ;
}