EgtMachKernel 2.7k1 :

- adattamenti e ricompilazione per passaggio a C++ 20.
This commit is contained in:
Dario Sassi
2025-11-01 17:39:23 +01:00
parent 7bad9a5cc6
commit 06261b64be
5 changed files with 45 additions and 41 deletions
BIN
View File
Binary file not shown.
+4 -4
View File
@@ -105,7 +105,7 @@
<OpenMPSupport>false</OpenMPSupport>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAs>CompileAsCpp</CompileAs>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -132,7 +132,7 @@ copy $(TargetPath) \EgtProg\DllD32</Command>
<OpenMPSupport>true</OpenMPSupport>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAs>CompileAsCpp</CompileAs>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
</ClCompile>
<Link>
@@ -167,7 +167,7 @@ copy $(TargetPath) \EgtProg\DllD64</Command>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
@@ -202,7 +202,7 @@ copy $(TargetPath) \EgtProg\Dll32</Command>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
</ClCompile>
<Link>
+3
View File
@@ -34,6 +34,7 @@ Machine::Machine( void)
{
m_pMchMgr = nullptr ;
m_pGeomDB = nullptr ;
m_nContextId = 0 ;
m_nGroupId = GDB_ID_NULL ;
m_nTempGroupId = GDB_ID_NULL ;
m_dAxisMaxAdjust = EPS_SMALL ;
@@ -90,6 +91,7 @@ Machine::Clear( void)
// reset membri
m_pMchMgr = nullptr ;
m_pGeomDB = nullptr ;
m_nContextId = 0 ;
m_sName.clear() ;
m_sMachineDir.clear() ;
m_nGroupId = GDB_ID_NULL ;
@@ -109,6 +111,7 @@ Machine::Init( const string& sMachineName, const string& sMachineDir, MachMgr* p
return false ;
m_pMchMgr = pMchMgr ;
m_pGeomDB = m_pMchMgr->GetGeomDB() ;
m_nContextId = m_pMchMgr->GetContextId() ;
// verifico direttorio dati macchina
m_sMachineDir = sMachineDir ;
if ( ! ExistsDirectory( m_sMachineDir))
+7 -6
View File
@@ -295,6 +295,7 @@ class Machine
// generali
MachMgr* m_pMchMgr ; // puntatore al gestore di tutte le lavorazioni
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico
int m_nContextId ; // indice contesto corrente (1-based)
LuaMgr m_LuaMgr ; // interprete lua della macchina
Writer m_Writer ; // scrittore di file di testo
// dati macchina
@@ -415,15 +416,15 @@ Machine::LuaSetGlobVar( const std::string& sVar, const T& Val)
{
// imposto contesto corretto
int nOldCtx = ExeGetCurrentContext() ;
if ( nOldCtx != m_pMchMgr->GetContextId())
ExeSetCurrentContext( m_pMchMgr->GetContextId()) ;
if ( nOldCtx != m_nContextId)
ExeSetCurrentContext( m_nContextId) ;
// imposto l'oggetto corrente per Lua
Machine* pOldMchLua = m_pMchLua ;
m_pMchLua = this ;
// eseguo l'assegnamento
bool bOk = ::LuaSetGlobVar( m_LuaMgr.GetLuaState(), sVar, Val) ;
// ripristino contesto originale
if ( nOldCtx != m_pMchMgr->GetContextId())
if ( nOldCtx != m_nContextId)
ExeSetCurrentContext( nOldCtx) ;
// ripristino dell'oggetto corrente per Lua
m_pMchLua = pOldMchLua ;
@@ -437,15 +438,15 @@ Machine::LuaGetGlobVar( const std::string& sVar, T& Val)
{
// imposto contesto corretto
int nOldCtx = ExeGetCurrentContext() ;
if ( nOldCtx != m_pMchMgr->GetContextId())
ExeSetCurrentContext( m_pMchMgr->GetContextId()) ;
if ( nOldCtx != m_nContextId)
ExeSetCurrentContext( m_nContextId) ;
// imposto l'oggetto corrente per Lua
Machine* pOldMchLua = m_pMchLua ;
m_pMchLua = this ;
// eseguo la lettura
bool bOk = ::LuaGetGlobVar( m_LuaMgr.GetLuaState(), sVar, Val) ;
// ripristino contesto originale
if ( nOldCtx != m_pMchMgr->GetContextId())
if ( nOldCtx != m_nContextId)
ExeSetCurrentContext( nOldCtx) ;
// ripristino dell'oggetto corrente per Lua
m_pMchLua = pOldMchLua ;
+31 -31
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2025
//----------------------------------------------------------------------------
// File : MachiningDataFactory.h Data : 05.06.15 Versione : 1.6f1
// File : MachiningDataFactory.h Data : 31.10.25 Versione : 2.7k1
// Contenuto : Factory della classe MachiningData.
//
//
@@ -26,35 +26,6 @@
#define MCHDATA_CREATE( nType) MachiningDataFactory::Create( nType)
#define MCHDATA_GETLIST( vsList) MachiningDataFactory::GetList( vsList)
//----------------------------------------------------------------------------
template <typename T>
class MachiningDataRegister
{
public :
static bool DoRegister( int nType, const std::string& sName)
{ if ( ! MachiningDataFactory::Register( nType, sName, Create))
return false ;
GetTypePrivate() = nType ;
GetNamePrivate() = sName ;
return true ; }
static MachiningData* Create( void)
{ return new(nothrow) T ; }
static int GetType( void)
{ return GetTypePrivate() ; }
static const std::string& GetName( void)
{ return GetNamePrivate() ; }
private :
MachiningDataRegister( void) {}
~MachiningDataRegister( void) {}
static int& GetTypePrivate( void)
{ static int s_nType ;
return s_nType ; }
static std::string& GetNamePrivate( void)
{ static std::string s_sName ;
return s_sName ; }
} ;
//----------------------------------------------------------------------------
class MachiningDataFactory
{
@@ -108,3 +79,32 @@ class MachiningDataFactory
return s_CreatorMap ;
}
} ;
//----------------------------------------------------------------------------
template <typename T>
class MachiningDataRegister
{
public :
static bool DoRegister( int nType, const std::string& sName)
{ if ( ! MachiningDataFactory::Register( nType, sName, Create))
return false ;
GetTypePrivate() = nType ;
GetNamePrivate() = sName ;
return true ; }
static MachiningData* Create( void)
{ return new( std::nothrow) T ; }
static int GetType( void)
{ return GetTypePrivate() ; }
static const std::string& GetName( void)
{ return GetNamePrivate() ; }
private :
MachiningDataRegister( void) {}
~MachiningDataRegister( void) {}
static int& GetTypePrivate( void)
{ static int s_nType ;
return s_nType ; }
static std::string& GetNamePrivate( void)
{ static std::string s_sName ;
return s_sName ; }
} ;