EgtExecutor 2.6f1 :

- estesa gestione LockId
- passato nuovo parametro LockId a EgtConverter.
This commit is contained in:
DarioS
2023-06-05 08:11:36 +02:00
parent 150b35bb9e
commit 7d3bec9f44
4 changed files with 36 additions and 26 deletions
+1
View File
@@ -25,6 +25,7 @@ const std::string& ExeGetIniFile( void) ;
//----------------------------------------------------------------------------
const std::string& ExeGetKey( void) ;
const std::string& ExeGetNestKey( void) ;
const std::string& ExeGetLockId( void) ;
//----------------------------------------------------------------------------
ILogger* GetLogger( void) ;
+2 -1
View File
@@ -413,7 +413,8 @@ ExeAdvancedImport( const string& sFilePath, double dToler)
sExec = "EgtConverterR32.exe" ;
#endif
string sCmdLine = "\"" + sExec + "\" \"" + sFilePath + "\" \"" + sFileOut + "\" \"" +
ToString( dToler, 3) + "\" \"" + ToString( ExeGetDebugLevel()) +"\" \"" + ExeGetKey() + "\"" ;
ToString( dToler, 3) + "\" \"" + ToString( ExeGetDebugLevel()) + "\" \"" +
ExeGetKey() + "\" \"" + ExeGetLockId() + "\"" ;
STARTUPINFO si ;
PROCESS_INFORMATION pi ;
ZeroMemory( &si, sizeof( si)) ;
+33 -25
View File
@@ -52,6 +52,7 @@ static bool s_bNetHwKey = false ;
static int s_nKeyExpDays = 0 ;
static int s_nKeyOptExpDays = 0 ;
static string s_sNestKey ;
static string s_sLockId ;
static string s_sIniFile ;
static bool s_bEnableUI = true ;
static pfProcEvents s_pFunProcEvents = nullptr ;
@@ -260,34 +261,41 @@ ExeSetLockType( int nType)
//-----------------------------------------------------------------------------
bool
ExeSetLockId( string sLockId)
ExeSetLockId( const string& sLockId)
{
// divido in tre parti XXX-YYY-ZZZ
STRVECTOR vsTok ;
Tokenize( sLockId, "-", vsTok) ;
if ( vsTok.size() != 3)
return false ;
// se chiave software
if ( vsTok[0] != KEY_LOCK_HW_START) {
int nKeyType ;
bool bNetKey ;
int nUserId ;
GetLockIdStringInfo( sLockId, nKeyType, bNetKey, nUserId) ;
bool bOk ;
switch ( nKeyType) {
default :
ExeSetNetHwKey( false) ;
return ( s_nKeyType != KEY_LOCK_TYPE_HW) ;
}
// se chiave locale
if (vsTok[1].front() != '1') {
bOk = false ;
break ;
case KEY_LOCK_TYPE_SW :
ExeSetNetHwKey( false) ;
return true ;
bOk = ( s_nKeyType != KEY_LOCK_TYPE_HW) ;
break ;
case KEY_LOCK_TYPE_HW :
ExeSetNetHwKey( bNetKey, nUserId) ;
bOk = true ;
break ;
}
// altrimenti chiave di rete
int nKey ;
if ( ! FromString( vsTok[1], nKey)) {
ExeSetNetHwKey( false) ;
return false ;
}
int nUserId = ( nKey % 10) ;
if ( nKey < 100110)
nUserId = 0 ;
ExeSetNetHwKey( true, nUserId) ;
return true ;
if ( bOk)
s_sLockId = sLockId ;
else
s_sLockId = "" ;
return bOk ;
}
//-----------------------------------------------------------------------------
const string&
ExeGetLockId( void)
{
if ( s_sLockId.empty())
GetLockId( s_sLockId) ;
return s_sLockId ;
}
//-----------------------------------------------------------------------------
@@ -296,7 +304,7 @@ ExeSetNetHwKey( bool bNetHwKey, int nUserId)
{
s_bNetHwKey = bNetHwKey ;
SetEGnNetHwKey( s_bNetHwKey) ;
return SetNetHwKey( bNetHwKey, nUserId) ;
return SetNetHwKey( s_bNetHwKey, nUserId) ;
}
//-----------------------------------------------------------------------------
BIN
View File
Binary file not shown.