#include "StdAfx.h"
|
#include "CHReviewSetting/SystemManager.h"
|
|
#include "CHReviewSetting/Sys_SystemManager.h"
|
#include "CHReviewSetting/Sys_GlassTypeManager.h"
|
#include "CHReviewSetting/Sys_AlignManager.h"
|
#include "CHReviewSetting/Sys_SignalManager.h"
|
#include "CHReviewSetting/Sys_MotorManager.h"
|
#include "CHReviewSetting/Sys_NetworkManager.h"
|
|
CSystemManager::CSystemManager(void)
|
{
|
m_pSysSystemManager = new CSys_SystemManager;
|
m_pSysGlassTypeManager = new CSys_GlassTypeManager;
|
m_pSysAlignManager = new CSys_AlignManager;
|
m_pSysSignalManager = new CSys_SignalManager;
|
m_pSysMotorManager = new CSys_MotorManager;
|
m_pSysNetworkManager = new CSys_NetworkManager;
|
}
|
|
CSystemManager::~CSystemManager(void)
|
{
|
if(m_pSysSystemManager)
|
{
|
delete m_pSysSystemManager;
|
m_pSysSystemManager = NULL;
|
}
|
|
if(m_pSysGlassTypeManager)
|
{
|
delete m_pSysGlassTypeManager;
|
m_pSysGlassTypeManager = NULL;
|
}
|
|
if(m_pSysAlignManager)
|
{
|
delete m_pSysAlignManager;
|
m_pSysAlignManager = NULL;
|
}
|
|
if(m_pSysSignalManager)
|
{
|
delete m_pSysSignalManager;
|
m_pSysSignalManager = NULL;
|
}
|
|
if(m_pSysMotorManager)
|
{
|
delete m_pSysMotorManager;
|
m_pSysMotorManager = NULL;
|
}
|
|
if(m_pSysNetworkManager)
|
{
|
delete m_pSysNetworkManager;
|
m_pSysNetworkManager = NULL;
|
}
|
}
|
|
BOOL CSystemManager::ReadSystemConfigFile(const CString& strFilename)
|
{
|
BOOL bReturn = TRUE;
|
|
CMacroFile macroFile;
|
macroFile.Clear();
|
|
if (FALSE == macroFile.Read(strFilename))
|
{
|
bReturn = FALSE;
|
}
|
else
|
{
|
if(m_pSysSystemManager)
|
{
|
m_pSysSystemManager->GetProfile(macroFile);
|
}
|
|
if(m_pSysGlassTypeManager)
|
{
|
m_pSysGlassTypeManager->GetProfile(macroFile);
|
}
|
|
if(m_pSysAlignManager)
|
{
|
m_pSysAlignManager->GetProfile(macroFile);
|
}
|
|
if(m_pSysSignalManager)
|
{
|
m_pSysSignalManager->GetProfile(macroFile);
|
}
|
|
if(m_pSysMotorManager)
|
{
|
m_pSysMotorManager->GetProfile(macroFile);
|
}
|
|
if(m_pSysNetworkManager)
|
{
|
m_pSysNetworkManager->GetProfile(macroFile);
|
}
|
}
|
|
return bReturn;
|
}
|
|
BOOL CSystemManager::WriteSystemConfigFile(const CString& strFilename)
|
{
|
CMacroFile macroFile;
|
macroFile.Clear();
|
|
if(m_pSysSystemManager)
|
{
|
m_pSysSystemManager->SetProfile(macroFile);
|
}
|
|
if(m_pSysGlassTypeManager)
|
{
|
m_pSysGlassTypeManager->SetProfile(macroFile);
|
}
|
|
if(m_pSysAlignManager)
|
{
|
m_pSysAlignManager->SetProfile(macroFile);
|
}
|
|
if(m_pSysSignalManager)
|
{
|
m_pSysSignalManager->SetProfile(macroFile);
|
}
|
|
if(m_pSysMotorManager)
|
{
|
m_pSysMotorManager->SetProfile(macroFile);
|
}
|
|
if(m_pSysNetworkManager)
|
{
|
m_pSysNetworkManager->SetProfile(macroFile);
|
}
|
|
return macroFile.Write(strFilename);
|
}
|