EgtExecutor :

- aggiunta funzione ExeAdvancedImportIsEnabled.
This commit is contained in:
Dario Sassi
2020-09-29 16:44:47 +00:00
parent 21c6c210d2
commit 09da1c79c8
+24 -14
View File
@@ -273,6 +273,29 @@ ExeImportStl( const string& sFilePath, double dScaleFactor)
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeAdvancedImportIsEnabled( void)
{
// verifico la chiave e le opzioni per l'import avanzato
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetKeyOptions( ExeGetKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( nRet != KEY_OK) {
std::string sErr = "Error on Key (EXA/" + ToString( nRet) + ")" ;
LOG_ERROR( GetLogger(), sErr.c_str()) ;
return false ;
}
if ( ( nOpt1 & ( KEYOPT_EEX_INPADV)) == 0 ||
nOptExpDays < GetCurrDay()) {
std::string sErr = "Warning on Key (EXA/OPT)" ;
LOG_ERROR( GetLogger(), sErr.c_str()) ;
return false ;
}
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeAdvancedImport( const string& sFilePath)
@@ -293,21 +316,8 @@ ExeAdvancedImport( const string& sFilePath)
return false ;
}
// verifico la chiave e le opzioni per l'import avanzato
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetKeyOptions( ExeGetKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( nRet != KEY_OK) {
std::string sErr = "Error on Key (EXA/" + ToString( nRet) + ")" ;
LOG_ERROR( GetLogger(), sErr.c_str()) ;
if ( ! ExeAdvancedImportIsEnabled())
return false ;
}
if ( ( nOpt1 & ( KEYOPT_EEX_INPADV)) == 0 ||
nOptExpDays < GetCurrDay()) {
std::string sErr = "Warning on Key (EXA/OPT)" ;
LOG_ERROR( GetLogger(), sErr.c_str()) ;
return false ;
}
// file intermedio stl
string sTempDir ; ExeGetTempDir( sTempDir) ;
string sFileOut = sTempDir + "\\AdvImp.stl" ;