EgtMachKernel :

- aggiunto controllo abilitazione lavorazioni avanzate in simulazione, stima e generazione.
This commit is contained in:
Dario Sassi
2024-10-01 13:11:39 +02:00
parent 2e6abe561d
commit 05f96209f7
4 changed files with 188 additions and 18 deletions
+48
View File
@@ -35,8 +35,11 @@
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EMkToolConst.h"
#include "/EgtDev/Include/EMkOperationConst.h"
#include "/EgtDev/Include/EGnGetKeyData.h"
#include "/EgtDev/Include/EgtPerfCounter.h"
#include "/EgtDev/Include/EgtNumUtils.h"
#include "/EgtDev/Include/EgtKeyCodes.h"
#include "/EgtDev/Include/SELkKeyProc.h"
using namespace std ;
@@ -142,6 +145,51 @@ SimulatorSP::Start( bool bFirst)
m_pMchMgr->ResetLastError() ;
m_pMchMgr->ResetWarnings() ;
// Se appena entrati, verifico abilitazioni
if ( m_nStatus == SIS_INITIALIZED) {
// Controllo della licenza
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetEGnKeyOptions( KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( ! GetEMkNetHwKey())
nRet = GetKeyOptions( GetEMkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
// Verifica della abilitazione
bool bMinTime = false ;
if ( nOptExpDays >= GetMinDay())
bMinTime = true ;
bool bCurrTime = false ;
if ( nOptExpDays >= GetCurrDay())
bCurrTime = true ;
bool bKey = false ;
if ( nRet == KEY_OK)
bKey = true ;
bool bAdvMach = false ;
if ( ( nOpt1 & KEYOPT_EMK_ADV) == 1)
bAdvMach = true ;
if ( ! bMinTime || ! bCurrTime || ! bKey) {
m_pMchMgr->SetLastError( 1000, "NC_OFF") ;
std::string sErr = "Warning on Key (MKC/KYO)" ;
LOG_ERROR( GetEMkLogger(), sErr.c_str()) ;
return false ;
}
if ( ! bAdvMach) {
int nOpId = m_pMchMgr->GetFirstActiveOperation() ;
while ( nOpId != GDB_ID_NULL) {
int nType = m_pMchMgr->GetOperationType( nOpId) ;
if ( nType == OPER_SURFROUGHING || nType == OPER_SURFFINISHING || nType == OPER_FIVEAXISMILLING) {
m_pMchMgr->SetLastError( 1001, "ADVANCED_MACH_OFF") ;
std::string sErr = "Warning on Key (MKC/AMO)" ;
LOG_ERROR( GetEMkLogger(), sErr.c_str()) ;
return false ;
}
nOpId = m_pMchMgr->GetNextActiveOperation( nOpId) ;
}
}
}
bool bOk = true ;
// Se appena entrati in simulazione