Main 업데이트부분 완료

main
DESKTOP-999R8N3\CJY 2023-04-10 15:48:48 +09:00
parent e0db61600d
commit e4ec44441f
5 changed files with 77 additions and 56 deletions

View File

@ -45,7 +45,7 @@
// buttonOK // buttonOK
// //
this.buttonOK.BackGround = null; this.buttonOK.BackGround = null;
this.buttonOK.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(110)))), ((int)(((byte)(165))))); this.buttonOK.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.buttonOK.ButtonColor = System.Drawing.Color.Silver; this.buttonOK.ButtonColor = System.Drawing.Color.Silver;
this.buttonOK.ButtonDownColor = System.Drawing.Color.Silver; this.buttonOK.ButtonDownColor = System.Drawing.Color.Silver;
this.buttonOK.ButtonImageAutoSize = true; this.buttonOK.ButtonImageAutoSize = true;
@ -56,7 +56,7 @@
this.buttonOK.ImageDisable = null; this.buttonOK.ImageDisable = null;
this.buttonOK.ImageDown = null; this.buttonOK.ImageDown = null;
this.buttonOK.ImageUp = null; this.buttonOK.ImageUp = null;
this.buttonOK.Location = new System.Drawing.Point(345, 126); this.buttonOK.Location = new System.Drawing.Point(345, 122);
this.buttonOK.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.buttonOK.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL;
this.buttonOK.Name = "buttonOK"; this.buttonOK.Name = "buttonOK";
this.buttonOK.NestedClickEventPrevent = false; this.buttonOK.NestedClickEventPrevent = false;
@ -83,7 +83,7 @@
this.labelMessage1.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.labelMessage1.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.labelMessage1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(42)))), ((int)(((byte)(82))))); this.labelMessage1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(42)))), ((int)(((byte)(82)))));
this.labelMessage1.BorderStyle = SmartX.SmartLabel.BorderStyles.None; this.labelMessage1.BorderStyle = SmartX.SmartLabel.BorderStyles.None;
this.labelMessage1.Font = new System.Drawing.Font("New Gulim", 10F, System.Drawing.FontStyle.Regular); this.labelMessage1.Font = new System.Drawing.Font("새굴림", 10F, System.Drawing.FontStyle.Regular);
this.labelMessage1.LineSpacing = 0F; this.labelMessage1.LineSpacing = 0F;
this.labelMessage1.Location = new System.Drawing.Point(76, 61); this.labelMessage1.Location = new System.Drawing.Point(76, 61);
this.labelMessage1.Name = "labelMessage1"; this.labelMessage1.Name = "labelMessage1";
@ -106,7 +106,7 @@
this.labelMessage2.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.labelMessage2.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.labelMessage2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(42)))), ((int)(((byte)(82))))); this.labelMessage2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(42)))), ((int)(((byte)(82)))));
this.labelMessage2.BorderStyle = SmartX.SmartLabel.BorderStyles.None; this.labelMessage2.BorderStyle = SmartX.SmartLabel.BorderStyles.None;
this.labelMessage2.Font = new System.Drawing.Font("New Gulim", 10F, System.Drawing.FontStyle.Regular); this.labelMessage2.Font = new System.Drawing.Font("새굴림", 10F, System.Drawing.FontStyle.Regular);
this.labelMessage2.LineSpacing = 0F; this.labelMessage2.LineSpacing = 0F;
this.labelMessage2.Location = new System.Drawing.Point(76, 87); this.labelMessage2.Location = new System.Drawing.Point(76, 87);
this.labelMessage2.Name = "labelMessage2"; this.labelMessage2.Name = "labelMessage2";

View File

@ -30,7 +30,7 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.smartGroupBox1 = new SmartX.SmartGroupBox(); this.smartGroupBox1 = new SmartX.SmartGroupBox();
this.buttonOK = new SmartX.SmartButton(); this.buttonCancel = new SmartX.SmartButton();
this.labelMessage2 = new SmartX.SmartLabel(); this.labelMessage2 = new SmartX.SmartLabel();
this.progressBarUpdate = new SmartX.SmartProgressBar(); this.progressBarUpdate = new SmartX.SmartProgressBar();
this.labelMessage1 = new SmartX.SmartLabel(); this.labelMessage1 = new SmartX.SmartLabel();
@ -48,7 +48,7 @@
this.smartGroupBox1.BackGround = null; this.smartGroupBox1.BackGround = null;
this.smartGroupBox1.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.smartGroupBox1.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.smartGroupBox1.BackImage = null; this.smartGroupBox1.BackImage = null;
this.smartGroupBox1.Controls.Add(this.buttonOK); this.smartGroupBox1.Controls.Add(this.buttonCancel);
this.smartGroupBox1.Controls.Add(this.labelMessage2); this.smartGroupBox1.Controls.Add(this.labelMessage2);
this.smartGroupBox1.Controls.Add(this.progressBarUpdate); this.smartGroupBox1.Controls.Add(this.progressBarUpdate);
this.smartGroupBox1.Controls.Add(this.labelMessage1); this.smartGroupBox1.Controls.Add(this.labelMessage1);
@ -65,41 +65,40 @@
this.smartGroupBox1.Text = "Update"; this.smartGroupBox1.Text = "Update";
this.smartGroupBox1.TextColor = System.Drawing.Color.White; this.smartGroupBox1.TextColor = System.Drawing.Color.White;
// //
// buttonOK // buttonCancel
// //
this.buttonOK.BackGround = null; this.buttonCancel.BackGround = null;
this.buttonOK.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(110)))), ((int)(((byte)(165))))); this.buttonCancel.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.buttonOK.ButtonColor = System.Drawing.Color.Silver; this.buttonCancel.ButtonColor = System.Drawing.Color.Silver;
this.buttonOK.ButtonDownColor = System.Drawing.Color.Silver; this.buttonCancel.ButtonDownColor = System.Drawing.Color.Silver;
this.buttonOK.ButtonImageAutoSize = true; this.buttonCancel.ButtonImageAutoSize = true;
this.buttonOK.ButtonStyle = SmartX.SmartButton.ButtonStyles.Round3D; this.buttonCancel.ButtonStyle = SmartX.SmartButton.ButtonStyles.Round3D;
this.buttonOK.ButtonText = "OK"; this.buttonCancel.ButtonText = "Cancel";
this.buttonOK.ColorKeySamplePosition = new System.Drawing.Point(0, 0); this.buttonCancel.ColorKeySamplePosition = new System.Drawing.Point(0, 0);
this.buttonOK.GroupID = 0; this.buttonCancel.GroupID = 0;
this.buttonOK.ImageDisable = null; this.buttonCancel.ImageDisable = null;
this.buttonOK.ImageDown = null; this.buttonCancel.ImageDown = null;
this.buttonOK.ImageUp = null; this.buttonCancel.ImageUp = null;
this.buttonOK.Location = new System.Drawing.Point(179, 158); this.buttonCancel.Location = new System.Drawing.Point(179, 158);
this.buttonOK.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.buttonCancel.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL;
this.buttonOK.Name = "buttonOK"; this.buttonCancel.Name = "buttonCancel";
this.buttonOK.NestedClickEventPrevent = false; this.buttonCancel.NestedClickEventPrevent = false;
this.buttonOK.OutlinePixel = 2; this.buttonCancel.OutlinePixel = 2;
this.buttonOK.OverlapOptimize = true; this.buttonCancel.OverlapOptimize = true;
this.buttonOK.RepeatInterval = 200; this.buttonCancel.RepeatInterval = 200;
this.buttonOK.RepeatIntervalAccelerate = null; this.buttonCancel.RepeatIntervalAccelerate = null;
this.buttonOK.RoundSize = 10; this.buttonCancel.RoundSize = 10;
this.buttonOK.SafeInterval = 200; this.buttonCancel.SafeInterval = 200;
this.buttonOK.Size = new System.Drawing.Size(90, 25); this.buttonCancel.Size = new System.Drawing.Size(90, 25);
this.buttonOK.SpecialFunction = SmartX.SmartButton.SPECIALFUNC.NONE; this.buttonCancel.SpecialFunction = SmartX.SmartButton.SPECIALFUNC.NONE;
this.buttonOK.TabIndex = 7; this.buttonCancel.TabIndex = 7;
this.buttonOK.Text = null; this.buttonCancel.Text = null;
this.buttonOK.TextColor = System.Drawing.Color.Black; this.buttonCancel.TextColor = System.Drawing.Color.Black;
this.buttonOK.TextColorDisable = System.Drawing.Color.Gray; this.buttonCancel.TextColorDisable = System.Drawing.Color.Gray;
this.buttonOK.TextDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.buttonCancel.TextDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(238)))), ((int)(((byte)(255)))));
this.buttonOK.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; this.buttonCancel.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle;
this.buttonOK.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; this.buttonCancel.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle;
this.buttonOK.Visible = false; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
// //
// labelMessage2 // labelMessage2
// //
@ -136,7 +135,7 @@
this.progressBarUpdate.BarStyle = SmartX.SmartProgressBar.BARTYPE.Normal; this.progressBarUpdate.BarStyle = SmartX.SmartProgressBar.BARTYPE.Normal;
this.progressBarUpdate.Direction = SmartX.SmartProgressBar.DIR.Horizontal; this.progressBarUpdate.Direction = SmartX.SmartProgressBar.DIR.Horizontal;
this.progressBarUpdate.FormatString = ""; this.progressBarUpdate.FormatString = "";
this.progressBarUpdate.Location = new System.Drawing.Point(25, 123); this.progressBarUpdate.Location = new System.Drawing.Point(25, 119);
this.progressBarUpdate.Maximum = new decimal(new int[] { this.progressBarUpdate.Maximum = new decimal(new int[] {
100, 100,
0, 0,
@ -275,7 +274,7 @@
private SmartX.SmartTimer timerUpdate; private SmartX.SmartTimer timerUpdate;
private SmartX.SmartTimer smartTimerUpdate; private SmartX.SmartTimer smartTimerUpdate;
private SmartX.SmartSerialPort smartSerialPort2; private SmartX.SmartSerialPort smartSerialPort2;
private SmartX.SmartButton buttonOK; private SmartX.SmartButton buttonCancel;
private SmartX.SmartTimer timerForMainBoard; private SmartX.SmartTimer timerForMainBoard;
private SmartX.SmartTimer smartTimerReboot; private SmartX.SmartTimer smartTimerReboot;
private SmartX.SmartFile smartFileCommunicationLog; private SmartX.SmartFile smartFileCommunicationLog;

View File

@ -242,9 +242,13 @@ namespace INT_PT002.DialogForms
{ {
} }
fullPath = "SD Card\\DataBackup\\Communicationlog.txt";
this.smartFileCommunicationLog.FilePathName = fullPath;
this.smartFileCommunicationLog.Open();
} }
public void CloseSerialPort2() public void CloseSerialPort2()
{ {
this.smartFileCommunicationLog.Close();
this.smartSerialPort2.Close(); this.smartSerialPort2.Close();
} }
@ -465,7 +469,7 @@ namespace INT_PT002.DialogForms
public void UpdateMainBoardFail(Define.E_LanguageID language) public void UpdateMainBoardFail(Define.E_LanguageID language)
{ {
this.progressBarUpdate.Visible = false; this.progressBarUpdate.Visible = false;
this.buttonOK.Visible = true; this.buttonCancel.Visible = true;
switch (language) switch (language)
{ {
@ -522,7 +526,7 @@ namespace INT_PT002.DialogForms
int ret = 0, index = 0; int ret = 0, index = 0;
byte[] beforeData; byte[] beforeData;
string ack = "", data = ""; string ack = "", data = "";
string cmd = "", address = "", lane = "", receiveData = ""; string cmd = "", address = "", lane = "", receiveData = "", error = "";
string strTemp = ""; string strTemp = "";
byte[] readByte; byte[] readByte;
Define.E_ResponseData response = Define.E_ResponseData.NAK; Define.E_ResponseData response = Define.E_ResponseData.NAK;
@ -545,25 +549,41 @@ namespace INT_PT002.DialogForms
} }
cmd = strTemp.Substring(0, 3); cmd = strTemp.Substring(0, 3);
lane = strTemp.Substring(5, 1);
address = strTemp.Substring(10, 4);
receiveData = strTemp.Substring(14, strTemp.Length - 16);
try try
{ {
switch (strTemp[0]) switch (strTemp[0])
{ {
case 'C': case 'C':
error = strTemp.Substring(4, 1);
// 로그
//if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.StringType.Write(string.Format("Update Receive ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, strTemp));
switch (cmd) switch (cmd)
{ {
case "CBU": case "CBU":
this.UpdateMainBoardFinish(Language); if (error == "1")
this.UpdateMainBoardFail(Language);
else
{
this.CloseSerialPort2();
this.progressBarUpdate.Value += 100;
this.UpdateMainBoardFinish(Language);
}
break; break;
default: default:
break; break;
} }
break; break;
case 'P': case 'P':
lane = strTemp.Substring(5, 1);
address = strTemp.Substring(10, 4);
receiveData = strTemp.Substring(14, strTemp.Length - 16);
this.smartFileCommunicationLog.StringType.Write(string.Format("Update Receive ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, strTemp.Substring(0, 14)));
switch (address) switch (address)
{ {
case "1651": case "1651":
@ -605,7 +625,7 @@ namespace INT_PT002.DialogForms
} }
else else
{ {
this.progressBarUpdate.Value += 5; this.progressBarUpdate.Value += 10;
} }
} }
else else
@ -694,11 +714,11 @@ namespace INT_PT002.DialogForms
SmartX.SmartConfigs.ReBoot(); SmartX.SmartConfigs.ReBoot();
} }
private void buttonOK_Click(object sender, EventArgs e) private void buttonCancel_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.Cancel;
this.CloseSerialPort2(); this.CloseSerialPort2();
this.Close(); this.Close();
} }
#endregion #endregion
} }

View File

@ -44,7 +44,7 @@
// buttonYes // buttonYes
// //
this.buttonYes.BackGround = null; this.buttonYes.BackGround = null;
this.buttonYes.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(110)))), ((int)(((byte)(165))))); this.buttonYes.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.buttonYes.ButtonColor = System.Drawing.Color.Silver; this.buttonYes.ButtonColor = System.Drawing.Color.Silver;
this.buttonYes.ButtonDownColor = System.Drawing.Color.Silver; this.buttonYes.ButtonDownColor = System.Drawing.Color.Silver;
this.buttonYes.ButtonImageAutoSize = true; this.buttonYes.ButtonImageAutoSize = true;
@ -79,7 +79,7 @@
// buttonNo // buttonNo
// //
this.buttonNo.BackGround = null; this.buttonNo.BackGround = null;
this.buttonNo.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(110)))), ((int)(((byte)(165))))); this.buttonNo.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.buttonNo.ButtonColor = System.Drawing.Color.Silver; this.buttonNo.ButtonColor = System.Drawing.Color.Silver;
this.buttonNo.ButtonDownColor = System.Drawing.Color.Silver; this.buttonNo.ButtonDownColor = System.Drawing.Color.Silver;
this.buttonNo.ButtonImageAutoSize = true; this.buttonNo.ButtonImageAutoSize = true;
@ -132,7 +132,7 @@
this.smartGroupBox1.Location = new System.Drawing.Point(0, 0); this.smartGroupBox1.Location = new System.Drawing.Point(0, 0);
this.smartGroupBox1.Name = "smartGroupBox1"; this.smartGroupBox1.Name = "smartGroupBox1";
this.smartGroupBox1.RoundRadius = 5; this.smartGroupBox1.RoundRadius = 5;
this.smartGroupBox1.Size = new System.Drawing.Size(450, 160); this.smartGroupBox1.Size = new System.Drawing.Size(450, 155);
this.smartGroupBox1.TabIndex = 7; this.smartGroupBox1.TabIndex = 7;
this.smartGroupBox1.Text = "ErrorCode"; this.smartGroupBox1.Text = "ErrorCode";
this.smartGroupBox1.TextColor = System.Drawing.Color.White; this.smartGroupBox1.TextColor = System.Drawing.Color.White;
@ -217,7 +217,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoScroll = true; this.AutoScroll = true;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(110)))), ((int)(((byte)(165))))); this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(110)))), ((int)(((byte)(165)))));
this.ClientSize = new System.Drawing.Size(450, 160); this.ClientSize = new System.Drawing.Size(450, 155);
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.smartGroupBox1); this.Controls.Add(this.smartGroupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;

View File

@ -671,6 +671,8 @@ namespace INT_PT002.Forms
} }
public void CloseSmartUartLink() public void CloseSmartUartLink()
{ {
this.IsCommunicationLogOpen = false;
this.smartFileCommunicationLog.Close();
this.smartSerialPortLink.Close(); this.smartSerialPortLink.Close();
} }