EgtGeomKernel 2.5e5 :
- migliorato controllo gestione chiave di rete.
This commit is contained in:
+52
-45
@@ -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 <new>
|
||||
#include <stack>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user