SDC C-Project CF Review 프로그램
LYW
2021-11-15 4139a71f5c0b72f88813a15d7112fdac76756fe4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#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);
}