From 71ba650cc53ff5c805ea57ad05cfd0c48bafd8c9 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 30 May 2023 10:24:23 +0200 Subject: [PATCH] EgtGeomKernel 2.5e5 : - migliorato controllo gestione chiave di rete. --- EgtGeomKernel.rc | Bin 11710 -> 11710 bytes GeomDB.cpp | 97 +++++++++++++++++++++++++---------------------- 2 files changed, 52 insertions(+), 45 deletions(-) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index fdb2becbc7cefaa15b260d2003713a8b212bf3d7..2f5566b0ef43745b3e366806defd50e39b7bc82b 100644 GIT binary patch delta 94 zcmdlNy)SyhFE&Qg&A-_cnHfzdD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-X4V@L delta 94 zcmdlNy)SyhFE&P#&A-_cnHfzcD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-WjGrO 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)