TestEGr 2.1a2 :
- ricompilazione con VS2017 - primo utilizzo di EgtInterface.
This commit is contained in:
+21
-47
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2014
|
||||
// EgalTech 2014-2019
|
||||
//----------------------------------------------------------------------------
|
||||
// File : TestEGr.cpp Data : 29.01.14 Versione : 1.5a1
|
||||
// File : TestEGr.cpp Data : 18.01.19 Versione : 2.1a2
|
||||
// Contenuto : Implementazione della classe applicazione test grafica.
|
||||
//
|
||||
//
|
||||
@@ -15,16 +15,10 @@
|
||||
#include "stdafx.h"
|
||||
#include "TestEGr.h"
|
||||
#include "TestEGrDlg.h"
|
||||
#include "/EgtDev/Include/EGkDllMain.h"
|
||||
#include "/EgtDev/Include/ENkDllMain.h"
|
||||
#include "/EgtDev/Include/EGnDllMain.h"
|
||||
#include "/EgtDev/Include/EExDllMain.h"
|
||||
#include "/EgtDev/Include/EGrDllMain.h"
|
||||
#include "/EgtDev/Include/EInAPI.h"
|
||||
#include "/EgtDev/Include/EGnGetModuleVer.h"
|
||||
#include "/EgtDev/Include/EgtStringConverter.h"
|
||||
#include "/EgtDev/Include/EgtIniFile.h"
|
||||
#include "/EgtDev/Include/EgtLogger.h"
|
||||
#include <fstream>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifdef _DEBUG
|
||||
@@ -43,7 +37,6 @@
|
||||
#endif
|
||||
|
||||
using namespace std ;
|
||||
using namespace egtlogger ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// The one and only CTestEGrApp object
|
||||
@@ -83,46 +76,28 @@ CTestEGrApp::InitInstance( void)
|
||||
free( (void*) m_pszProfileName) ;
|
||||
m_pszProfileName = p ;
|
||||
|
||||
// livello di debug
|
||||
int nDebug = GetPrivateProfileInt( "General", "Debug", 0, m_pszProfileName) ;
|
||||
|
||||
// inizializzazioni del logger generale
|
||||
Logger logGen( ( nDebug > 0 ? LL_DEBUG : LL_INFO), "TestEGr") ;
|
||||
logGen.AddOutputStream( new ofstream( "TestEgr.log"), true) ;
|
||||
SetEGnLogger( &logGen) ;
|
||||
SetENkLogger( &logGen) ;
|
||||
SetEGkLogger( &logGen) ;
|
||||
SetEExLogger( &logGen) ;
|
||||
SetEGrLogger( &logGen) ;
|
||||
|
||||
// imposto la chiave di protezione
|
||||
// imposto chiave di protezione
|
||||
string sKey = GetPrivateProfileStringUtf8( "General", "Key", "", m_pszProfileName) ;
|
||||
SetEGkKey( sKey) ;
|
||||
SetEGrKey( sKey) ;
|
||||
SetEExKey( sKey) ;
|
||||
EgtSetKey( stringtoW( sKey)) ;
|
||||
|
||||
// inizializzo
|
||||
int nDebug = GetPrivateProfileInt( "General", "Debug", 0, m_pszProfileName) ;
|
||||
string sMsg = GetExeNameVer() ;
|
||||
EgtInit( nDebug, L"TestEgr.log", stringtoW( sMsg)) ;
|
||||
|
||||
// inizializzo il font manager
|
||||
string sNfeFontDir = GetPrivateProfileStringUtf8( "GeomDB", "NfeFontDir", "", m_pszProfileName) ;
|
||||
string sDefaultFont = GetPrivateProfileStringUtf8( "GeomDB", "DefaultFont", "", m_pszProfileName) ;
|
||||
InitFontManager( sNfeFontDir, sDefaultFont) ;
|
||||
EgtSetFont( stringtoW( sNfeFontDir), stringtoW( sDefaultFont)) ;
|
||||
|
||||
// inizio programma
|
||||
LOG_DATETIME( &logGen, " Start")
|
||||
|
||||
// versione del programma
|
||||
LOG_INFO( &logGen, GetExeNameVer().c_str())
|
||||
|
||||
// versione delle librerie
|
||||
LOG_INFO( &logGen, GetEGnVersion())
|
||||
LOG_INFO( &logGen, GetENkVersion())
|
||||
LOG_INFO( &logGen, GetEGkVersion())
|
||||
LOG_INFO( &logGen, GetEExVersion())
|
||||
LOG_INFO( &logGen, GetEGrVersion())
|
||||
|
||||
// inizializzazione logger dei comandi
|
||||
Logger logCmd( LL_INFO, "TestEGr") ;
|
||||
logCmd.AddOutputStream( new ofstream( "TestEgr.tsc"), true) ;
|
||||
LOG_INFO( &logCmd, ( "// " + CurrDateTime()).c_str()) ;
|
||||
// imposto dir di default per libreria Lua e lancio libreria di base
|
||||
string sLuaLibsDir = GetPrivateProfileStringUtf8( "Lua", "LibsDir", "", m_pszProfileName) ;
|
||||
EgtSetLuaLibs( stringtoW( sLuaLibsDir)) ;
|
||||
string sLuaBaseLib = GetPrivateProfileStringUtf8( "Lua", "BaseLib", "EgtBase", m_pszProfileName) ;
|
||||
EgtLuaRequire( stringtoW( sLuaBaseLib)) ;
|
||||
|
||||
// imposto logger dei comandi
|
||||
EgtSetCommandLogger( L"TestEgr.tua") ;
|
||||
|
||||
// gestione linea di comando
|
||||
string sFileToOpen ;
|
||||
@@ -132,13 +107,12 @@ CTestEGrApp::InitInstance( void)
|
||||
sFileToOpen = WtoA( cmdInfo.m_strFileName) ;
|
||||
|
||||
// Dialog interface
|
||||
CTestEGrDlg dlg( sFileToOpen, &logGen, &logCmd) ;
|
||||
CTestEGrDlg dlg( sFileToOpen, nullptr, nullptr) ;
|
||||
m_pMainWnd = &dlg ;
|
||||
dlg.DoModal() ;
|
||||
|
||||
// fine programma
|
||||
LOG_INFO( &logCmd, "// EXIT") ;
|
||||
LOG_DATETIME( &logGen, " End")
|
||||
EgtExit() ;
|
||||
|
||||
// Exit application with FALSE
|
||||
return FALSE ;
|
||||
|
||||
BIN
Binary file not shown.
+2
-2
@@ -29,7 +29,7 @@
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
@@ -44,7 +44,7 @@
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
|
||||
+18
-1
@@ -30,6 +30,7 @@
|
||||
#include "/EgtDev/Include/EExImportCnc.h"
|
||||
#include "/EgtDev/Include/EExImportDxf.h"
|
||||
#include "/EgtDev/Include/EExImportStl.h"
|
||||
#include "/EgtDev/Include/EExImportBtl.h"
|
||||
#include "/EgtDev/Include/EExExportDxf.h"
|
||||
#include "/EgtDev/Include/EExExportStl.h"
|
||||
|
||||
@@ -786,6 +787,7 @@ CTestEGrDlg::OnFileImport( void)
|
||||
L"All Files (*.*)|*.*|"
|
||||
L"AutoCAD Drawing Exchange (*.dxf) |*.dxf|"
|
||||
L"Stereolithography (*.stl) |*.stl|"
|
||||
L"Beam (*.btl) |*.btl|"
|
||||
L"Part Program (*.cnc) |*.cnc||",
|
||||
NULL, 0, FALSE) ;
|
||||
|
||||
@@ -1218,7 +1220,7 @@ CTestEGrDlg::FileImport( const string& sFilePath)
|
||||
ToUpper( sFileExt) ;
|
||||
|
||||
// verifico che l'estensione sia supportata
|
||||
if ( sFileExt != "CNC" && sFileExt != "DXF" && sFileExt != "STL") {
|
||||
if ( sFileExt != "CNC" && sFileExt != "DXF" && sFileExt != "STL" && sFileExt != "BTL") {
|
||||
// emetto info
|
||||
string sInfo = "File type (" + sFileExt + ") not recognized" ;
|
||||
LOG_INFO( m_pLogGen, sInfo.c_str())
|
||||
@@ -1300,6 +1302,21 @@ CTestEGrDlg::FileImport( const string& sFilePath)
|
||||
LOG_INFO( m_pLogCmd, "GR.XY( $L1, $P1, ORIG)")
|
||||
LOG_INFO( m_pLogCmd, ( "IMPORTSTL( " + sFilePath + ", $L1)").c_str())
|
||||
}
|
||||
// importo il file BTL
|
||||
else if ( sFileExt == "BTL") {
|
||||
// preparo l'importatore
|
||||
PtrOwner<IImportBtl> pImpBtl( CreateImportBtl()) ;
|
||||
if ( IsNull( pImpBtl)) {
|
||||
LOG_ERROR( m_pLogGen, "Error : CreateImportBtl")
|
||||
bOk = false ;
|
||||
}
|
||||
// eseguo l'importazione
|
||||
else if ( ! pImpBtl->Import( sFilePath, m_pGeomDB)) {
|
||||
LoadTree() ;
|
||||
bOk = false ;
|
||||
}
|
||||
// nessun log dei comandi
|
||||
}
|
||||
|
||||
// visualizzo con zoom all
|
||||
PerformanceCounter Counter ;
|
||||
|
||||
+5
-5
@@ -97,11 +97,11 @@ TestEGrView::Create( CWnd* pParent, int nID)
|
||||
m_pScene = CreateEGrScene() ;
|
||||
|
||||
// configuro le gesture
|
||||
CGestureConfig cfg ;
|
||||
GetGestureConfig( &cfg) ;
|
||||
cfg.EnablePan( TRUE, GC_PAN) ;
|
||||
cfg.EnableRotate( TRUE) ;
|
||||
SetGestureConfig( &cfg) ;
|
||||
//CGestureConfig cfg ;
|
||||
//GetGestureConfig( &cfg) ;
|
||||
//cfg.EnablePan( TRUE, GC_PAN) ;
|
||||
//cfg.EnableRotate( TRUE) ;
|
||||
//SetGestureConfig( &cfg) ;
|
||||
|
||||
return ( m_pDC != nullptr && m_pScene != nullptr) ;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
#pragma comment(lib, EGTLIBDIR "EgtGeomKernel" EGTLIBVER ".lib")
|
||||
#pragma comment(lib, EGTLIBDIR "EgtExchange" EGTLIBVER ".lib")
|
||||
#pragma comment(lib, EGTLIBDIR "EgtGraphics" EGTLIBVER ".lib")
|
||||
#pragma comment(lib, EGTLIBDIR "EgtExecutor" EGTLIBVER ".lib")
|
||||
#pragma comment(lib, EGTLIBDIR "EgtInterface" EGTLIBVER ".lib")
|
||||
|
||||
#ifdef _UNICODE
|
||||
#if defined _M_IX86
|
||||
|
||||
Reference in New Issue
Block a user