개정판 fab4f207
dev issue #000 : minor
Change-Id: Iac715292affae9b604f4003f1075bb0fa7505a14
DTI_PID/SPPIDConverter_AutoModeling/ConverterForm.cs | ||
---|---|---|
34 | 34 |
{ |
35 | 35 |
InitializeComponent(); |
36 | 36 |
|
37 |
CultureInfo culture = CultureInfo.GetCultureInfo("en");
|
|
37 |
CultureInfo culture = CultureInfo.GetCultureInfo("ko");
|
|
38 | 38 |
Msg.Culture = culture; |
39 | 39 |
|
40 |
//Color color = Color.FromArgb(67, 117, 219); |
|
41 |
//layoutControlGroupAutoConverter.AppearanceGroup.BorderColor = color; |
|
42 |
//layoutControlGroupAutoConverter.AllowBorderColorBlending = true; |
|
43 |
//layoutControlGroupSPPIDDB.AppearanceGroup.BorderColor = color; |
|
44 |
//layoutControlGroupSPPIDDB.AllowBorderColorBlending = true; |
|
45 |
//layoutControlGroupID2Project.AppearanceGroup.BorderColor = color; |
|
46 |
//layoutControlGroupID2Project.AllowBorderColorBlending = true; |
|
47 |
//layoutControlGroupItemMapping.AppearanceGroup.BorderColor = color; |
|
48 |
//layoutControlGroupItemMapping.AllowBorderColorBlending = true; |
|
49 |
|
|
50 |
SPPIDUtil.ReadSPPIDInfo(); |
|
51 |
SPPIDUtil.ReadID2ProjectInfo(); |
|
52 |
|
|
53 | 40 |
InitGridControl(); |
54 |
SetID2ProjectUI(); |
|
55 |
SetSPPIDDBUI(); |
|
41 |
InitID2Project(); |
|
56 | 42 |
} |
57 | 43 |
|
58 | 44 |
private void InitGridControl() |
... | ... | |
98 | 84 |
|
99 | 85 |
private void btnID2Project_ButtonClick(object sender, ButtonPressedEventArgs e) |
100 | 86 |
{ |
87 |
xtraFolderBrowserDialog.SelectedPath = btnID2Project.Text; |
|
88 |
|
|
101 | 89 |
if (xtraFolderBrowserDialog.ShowDialog() == DialogResult.OK) |
102 | 90 |
{ |
103 |
bool result = false; |
|
104 |
string dirPath = xtraFolderBrowserDialog.SelectedPath; |
|
105 |
if (IsID2Project(dirPath)) |
|
106 |
{ |
|
107 |
_ProjectInfo.DefaultPath = dirPath; |
|
108 |
_ProjectInfo.Enable = true; |
|
109 |
if (SPPIDUtil.SaveID2ProjectInfo()) |
|
110 |
{ |
|
111 |
result = true; |
|
112 |
SetID2ProjectUI(); |
|
113 |
MessageBox.Show(Msg.SuccessProjectSelect, Msg.Information, MessageBoxButtons.OK, MessageBoxIcon.Information); |
|
114 |
} |
|
115 |
} |
|
116 |
|
|
117 |
if (!result) |
|
118 |
{ |
|
119 |
_ProjectInfo.Enable = false; |
|
120 |
SetID2ProjectUI(); |
|
91 |
if (xtraFolderBrowserDialog.SelectedPath[xtraFolderBrowserDialog.SelectedPath.Length - 1] == '\\') |
|
92 |
xtraFolderBrowserDialog.SelectedPath = xtraFolderBrowserDialog.SelectedPath.Remove(xtraFolderBrowserDialog.SelectedPath.Length - 1); |
|
93 |
Settings.Default.LatestProjectPath = xtraFolderBrowserDialog.SelectedPath; |
|
94 |
Settings.Default.Save(); |
|
95 |
if (InitID2Project()) |
|
96 |
MessageBox.Show(Msg.SuccessProjectSelect, Msg.Information, MessageBoxButtons.OK, MessageBoxIcon.Information); |
|
97 |
else |
|
121 | 98 |
MessageBox.Show(Msg.FailProjectSelect, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
122 |
} |
|
123 | 99 |
} |
124 | 100 |
} |
125 | 101 |
|
126 |
private void SetID2ProjectUI()
|
|
102 |
private bool InitID2Project()
|
|
127 | 103 |
{ |
128 |
if (_ProjectInfo.Enable) |
|
104 |
_ProjectInfo.DefaultPath = Settings.Default.LatestProjectPath; |
|
105 |
if (Project_DB.ConnTestAndCreateTable()) |
|
129 | 106 |
{ |
107 |
_ProjectInfo.Enable = true; |
|
130 | 108 |
btnID2Project.Text = _ProjectInfo.DefaultPath; |
131 | 109 |
labelID2ProjectName.Text = _ProjectInfo.Name; |
132 | 110 |
labelID2ProjectName.AppearanceItemCaption.ForeColor = Color.Blue; |
133 | 111 |
labelID2ProjectStatus.Text = Msg.ConnectionSuccessful; |
134 | 112 |
labelID2ProjectStatus.AppearanceItemCaption.ForeColor = Color.Blue; |
113 |
layoutControlGroupSPPIDDB.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; |
|
114 |
layoutControlGroupItemMapping.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; |
|
115 |
|
|
116 |
InitSPPIDDB(); |
|
117 |
return true; |
|
135 | 118 |
} |
136 | 119 |
else |
137 | 120 |
{ |
121 |
_ProjectInfo.Enable = false; |
|
138 | 122 |
btnID2Project.Text = ""; |
139 | 123 |
labelID2ProjectName.Text = " "; |
140 | 124 |
labelID2ProjectName.AppearanceItemCaption.ForeColor = Color.Red; |
141 | 125 |
labelID2ProjectStatus.Text = Msg.ConnectionFail; |
142 | 126 |
labelID2ProjectStatus.AppearanceItemCaption.ForeColor = Color.Red; |
127 |
layoutControlGroupSPPIDDB.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
|
128 |
layoutControlGroupItemMapping.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
|
129 |
|
|
130 |
InitSPPIDDB(); |
|
131 |
return false; |
|
143 | 132 |
} |
144 | 133 |
} |
145 | 134 |
|
146 |
private void SetSPPIDDBUI()
|
|
135 |
private void InitSPPIDDB()
|
|
147 | 136 |
{ |
137 |
if (_ProjectInfo.Enable) |
|
138 |
{ |
|
139 |
DataTable dt = Project_DB.SelectSPPID_DB_INFO(); |
|
140 |
SPPIDUtil.ConvertToSPPIDInfo(dt.Rows[0][0].ToString()); |
|
141 |
} |
|
142 |
|
|
148 | 143 |
if (_SPPIDInfo.Enable) |
149 | 144 |
{ |
150 | 145 |
labelSPPIDPlantName.Text = _SPPIDInfo.SelectedPlant; |
... | ... | |
219 | 214 |
{ |
220 | 215 |
SPPID_DB_SettingForm form = new SPPID_DB_SettingForm(); |
221 | 216 |
if (form.ShowDialog() == DialogResult.OK) |
222 |
SetSPPIDDBUI();
|
|
217 |
InitSPPIDDB();
|
|
223 | 218 |
} |
224 | 219 |
|
225 | 220 |
private void btnItemMapping_Click(object sender, EventArgs e) |
내보내기 Unified diff