EgtMachKernel :
- aggiunta ImportSetup.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "DllMain.h"
|
||||
#include "MachMgr.h"
|
||||
#include "/EgtDev/Include/EgtIniFile.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -24,3 +25,35 @@ MachMgr::GetCurrSetup( void) const
|
||||
{
|
||||
return GetCurrSetupGroupId() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::ImportSetup( const string& sName)
|
||||
{
|
||||
// definisco path completa del file di attrezzaggio
|
||||
string sFileName = GetCurrSetupDir() + "\\" ;
|
||||
// se ricevuto nome
|
||||
if ( ! IsEmptyOrSpaces( sName)) {
|
||||
sFileName += sName + "." + SETUP_EXT ;
|
||||
}
|
||||
// altrimenti cerco default
|
||||
else {
|
||||
string sMachIni = m_sMachinesDir + "\\" + GetCurrMGeoName() + "\\" + GetCurrMGeoName() + ".ini" ;
|
||||
string sDefault = GetPrivateProfileStringUtf8( SETUP_SEC.c_str(), SETUP_DEF_KEY.c_str(), "", sMachIni.c_str()) ;
|
||||
if ( ! IsEmptyOrSpaces( sDefault))
|
||||
sFileName += sDefault + "." + SETUP_EXT ;
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
|
||||
// gestione attrezzaggio
|
||||
SetupMgr stuMgr ;
|
||||
stuMgr.Init( this) ;
|
||||
|
||||
// importo l'attrezzaggio
|
||||
if ( ! stuMgr.Import( sFileName))
|
||||
return false ;
|
||||
|
||||
// lo inserisco nel progetto
|
||||
return stuMgr.Save() ;
|
||||
}
|
||||
Reference in New Issue
Block a user