diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index fdb2bec..2f5566b 100644 Binary files a/EgtGeomKernel.rc and b/EgtGeomKernel.rc differ diff --git a/GeomDB.cpp b/GeomDB.cpp index 87f2b92..8fa03b0 100644 --- a/GeomDB.cpp +++ b/GeomDB.cpp @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2013 +// EgalTech 2013-2023 //---------------------------------------------------------------------------- -// File : GeomDB.cpp Data : 08.04.13 Versione : 1.3a5 +// File : GeomDB.cpp Data : 29.05.23 Versione : 2.5e5 // Contenuto : Implementazione della classe GeomDB. // // @@ -21,12 +21,13 @@ #include "NgeReader.h" #include "NgeWriter.h" #include "/EgtDev/Include/EGkStringUtils3d.h" -#include "/EgtDev/Include/SELkLockId.h" -#include "/EgtDev/Include/SELkKeyProc.h" +#include "/EgtDev/Include/EGnGetKeyData.h" #include "/EgtDev/Include/EgtStringConverter.h" #include "/EgtDev/Include/EgtPointerOwner.h" #include "/EgtDev/Include/EgtNumCollection.h" #include "/EgtDev/Include/EgtKeyCodes.h" +#include "/EgtDev/Include/SELkLockId.h" +#include "/EgtDev/Include/SELkKeyProc.h" #include #include @@ -37,22 +38,24 @@ IGeomDB* CreateGeomDB( void) { // verifico la chiave e le opzioni - if ( ! GetEGkNetHwKey()) { - unsigned int nOpt1, nOpt2 ; - int nOptExpDays ; - int nRet = GetKeyOptions( GetEGkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, + unsigned int nOpt1, nOpt2 ; + int nOptExpDays ; + int nRet = GetEGnKeyOptions( KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, nOpt1, nOpt2, nOptExpDays) ; - if ( nRet != KEY_OK && ! EqualNoCase( GetEGkKey(), "EGkBase")) { - if ( nRet != KEY_OK) { - string sErr = "Error on Key (GKC/" + ToString( nRet) + ")" ; - LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; - return nullptr ; - } - if ( (nOpt1 & KEYOPT_EGK_BASE) == 0 || nOptExpDays < GetCurrDay()) { - string sErr = "Error on Key (GKC/OPT)" ; - LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; - return nullptr ; - } + if ( ! GetEGkNetHwKey()) + nRet = GetKeyOptions( GetEGkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, + nOpt1, nOpt2, nOptExpDays) ; + // controllo i risultati + if ( nRet != KEY_OK && ! EqualNoCase( GetEGkKey(), "EGkBase")) { + if ( nRet != KEY_OK) { + string sErr = "Error on Key (GKC/" + ToString( nRet) + ")" ; + LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; + return nullptr ; + } + if ( ( nOpt1 & KEYOPT_EGK_BASE) == 0 || nOptExpDays < GetCurrDay()) { + string sErr = "Error on Key (GKC/OPT)" ; + LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; + return nullptr ; } } @@ -275,21 +278,23 @@ bool GeomDB::Save( int nId, const string& sFileOut, int nFlag) const { // verifico la chiave e le opzioni - if ( ! GetEGkNetHwKey()) { - unsigned int nOpt1, nOpt2 ; - int nOptExpDays ; + unsigned int nOpt1, nOpt2 ; + int nOptExpDays ; + int nRet = GetEGnKeyOptions( KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, + nOpt1, nOpt2, nOptExpDays) ; + if ( ! GetEGkNetHwKey()) int nRet = GetKeyOptions( GetEGkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, nOpt1, nOpt2, nOptExpDays) ; - if ( nRet != KEY_OK) { - string sErr = "Error on Key (GKS/" + ToString( nRet) + ")" ; - LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; - return false ; - } - if ( (nOpt1 & KEYOPT_EGK_SAVE) == 0 || nOptExpDays < GetCurrDay()) { - string sErr = "Error on Key (GKS/OPT)" ; - LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; - return false ; - } + // controllo i risultati + if ( nRet != KEY_OK) { + string sErr = "Error on Key (GKS/" + ToString( nRet) + ")" ; + LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; + return false ; + } + if ( ( nOpt1 & KEYOPT_EGK_SAVE) == 0 || nOptExpDays < GetCurrDay()) { + string sErr = "Error on Key (GKS/OPT)" ; + LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; + return false ; } // assegno Id base @@ -387,21 +392,23 @@ bool GeomDB::Save( const INTVECTOR& vId, const string& sFileOut, int nFlag) const { // verifico la chiave e le opzioni - if ( ! GetEGkNetHwKey()) { - unsigned int nOpt1, nOpt2 ; - int nOptExpDays ; + unsigned int nOpt1, nOpt2 ; + int nOptExpDays ; + int nRet = GetEGnKeyOptions( KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, + nOpt1, nOpt2, nOptExpDays) ; + if ( ! GetEGkNetHwKey()) int nRet = GetKeyOptions( GetEGkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, nOpt1, nOpt2, nOptExpDays) ; - if ( nRet != KEY_OK) { - string sErr = "Error on Key (GKS/" + ToString( nRet) + ")" ; - LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; - return false ; - } - if ( (nOpt1 & KEYOPT_EGK_SAVE) == 0 || nOptExpDays < GetCurrDay()) { - string sErr = "Error on Key (GKS/OPT)" ; - LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; - return false ; - } + // controllo i risultati + if ( nRet != KEY_OK) { + string sErr = "Error on Key (GKS/" + ToString( nRet) + ")" ; + LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; + return false ; + } + if ( ( nOpt1 & KEYOPT_EGK_SAVE) == 0 || nOptExpDays < GetCurrDay()) { + string sErr = "Error on Key (GKS/OPT)" ; + LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; + return false ; } // assegno Id base (nessuna riduzione degli Id)