EgtMachKernel 2.4e3 :

- modifiche per prima versione chiave di rete.
This commit is contained in:
DarioS
2022-05-17 08:26:38 +02:00
parent 88912bf524
commit 156f0f8ef8
5 changed files with 29 additions and 6 deletions
+1
View File
@@ -21,3 +21,4 @@
std::string GetEMkVer( void) ;
ILogger* GetEMkLogger( void) ;
const std::string& GetEMkKey( void) ;
bool GetEMkNetHwKey( void) ;
+15
View File
@@ -98,6 +98,7 @@ GetEMkLogger( void)
//-----------------------------------------------------------------------------
static std::string s_sKey ;
static bool s_bNetHwKey = false ;
//-----------------------------------------------------------------------------
void
@@ -106,9 +107,23 @@ SetEMkKey( const std::string& sKey)
s_sKey = sKey ;
}
//-----------------------------------------------------------------------------
void
SetEMkNetHwKey( bool bNetHwKey)
{
s_bNetHwKey = bNetHwKey ;
}
//-----------------------------------------------------------------------------
const std::string&
GetEMkKey( void)
{
return s_sKey ;
}
//-----------------------------------------------------------------------------
bool
GetEMkNetHwKey( void)
{
return s_bNetHwKey ;
}
BIN
View File
Binary file not shown.
+12 -5
View File
@@ -47,11 +47,18 @@ bool
Generator::Run( const string& sCncFile, const string& sInfo)
{
// verifico sia abilitato dalla licenza
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetKeyOptions( GetEMkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( nRet == KEY_OK && ( nOpt1 & KEYOPT_EMK_NC_OFF) == 0) {
bool bEnabled = false ;
if ( GetEMkNetHwKey()) {
bEnabled = true ;
}
else {
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetKeyOptions( GetEMkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
bEnabled = ( nRet == KEY_OK && ( nOpt1 & KEYOPT_EMK_NC_OFF) == 0) ;
}
if ( bEnabled) {
// emetto info di log
{ string sOut = "Generator Run : " + sCncFile ;
+1 -1
View File
@@ -30,7 +30,7 @@ IMachMgr*
CreateMachMgr( void)
{
// verifico la chiave e le opzioni
if ( ! TestKeyForEMk( GetEMkKey(), 0, GetEMkLogger()))
if ( ! GetEMkNetHwKey() && ! TestKeyForEMk( GetEMkKey(), 0, GetEMkLogger()))
return nullptr ;
// creo il MachMgr
return static_cast<IMachMgr*> ( new(nothrow) MachMgr) ;