Files
EgtMachKernel/MachMgrGeneration.cpp
T
Dario Sassi 4b835a27be EgtMachKernel 2.6i1 :
- introduzione secondo simulatore sperimentale per macchine multiprocesso.
2024-09-05 08:29:20 +02:00

78 lines
2.3 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2018
//----------------------------------------------------------------------------
// File : MachMgrGeneration.cpp Data : 29.05.18 Versione : 1.8e6
// Contenuto : Implementazione gestione generazione della classe MachMgr.
//
//
//
// Modifiche : 28.10.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "DllMain.h"
#include "MachMgr.h"
#include "MachConst.h"
#include "Generator.h"
#include "Estimator.h"
#include "/EgtDev/Include/EGnFileUtils.h"
using namespace std ;
//----------------------------------------------------------------------------
bool
MachMgr::Generate( const string& sCncFile, const string& sInfo)
{
// se macchina multiprocesso è necessaria stima speciale
if ( GetCurrMachine() != nullptr && GetCurrMachine()->GetMultiProcess()) {
// inizializzazione stimatore
Estimator estPP ;
if ( ! estPP.Init( this)) {
LOG_ERROR( GetEMkLogger(), "Error on Estimate Init")
return false ;
}
// esecuzione della stima
string sEstFile = ChangeFileExtension( sCncFile, "sest") ;
if ( ! estPP.Run( sEstFile, sInfo)) {
LOG_ERROR( GetEMkLogger(), "Error on Estimate Run")
return false ;
}
}
// inizializzazione generatore
Generator genPP ;
if ( ! genPP.Init( this)) {
LOG_ERROR( GetEMkLogger(), "Error on Generate Init")
return false ;
}
// esecuzione della generazione
if ( ! genPP.Run( sCncFile, sInfo)) {
LOG_ERROR( GetEMkLogger(), "Error on Generate Run")
return false ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::Estimate( const string& sEstFile, const string& sInfo)
{
// inizializzazione stimatore
Estimator estPP ;
if ( ! estPP.Init( this)) {
LOG_ERROR( GetEMkLogger(), "Error on Estimate Init")
return false ;
}
// esecuzione della stima
if ( ! estPP.Run( sEstFile, sInfo)) {
LOG_ERROR( GetEMkLogger(), "Error on Estimate Run")
return false ;
}
return true ;
}