From a4169bb683695d17d16043b20b8eb81ab6da1f16 Mon Sep 17 00:00:00 2001 From: t001310 Date: Fri, 28 Feb 2025 15:00:32 +0900 Subject: [PATCH] jhlim 20240202_2 --- DDUtilityApp/App.config | 73 ++-- DDUtilityApp/DDUtilityApp.csproj | 14 + DDUtilityApp/GlobalVariable.cs | 6 + DDUtilityApp/MESDOWNLOADER/MESDOWNLOADER.7z | Bin 0 -> 9308 bytes .../MESDOWNLOADER/ProgressForm.Designer.cs | 75 ++++ DDUtilityApp/MESDOWNLOADER/ProgressForm.cs | 28 ++ .../MESDOWNLOADER/ServerLog.Designer.cs | 376 ++++++++++++++++++ DDUtilityApp/MESDOWNLOADER/ServerLog.cs | 374 +++++++++++++++++ DDUtilityApp/MESDOWNLOADER/Utili.cs | 99 +++++ .../MESDOWNLOADER/XmlToDsConverter.cs | 55 +++ DDUtilityApp/Program.cs | 6 +- 11 files changed, 1068 insertions(+), 38 deletions(-) create mode 100644 DDUtilityApp/MESDOWNLOADER/MESDOWNLOADER.7z create mode 100644 DDUtilityApp/MESDOWNLOADER/ProgressForm.Designer.cs create mode 100644 DDUtilityApp/MESDOWNLOADER/ProgressForm.cs create mode 100644 DDUtilityApp/MESDOWNLOADER/ServerLog.Designer.cs create mode 100644 DDUtilityApp/MESDOWNLOADER/ServerLog.cs create mode 100644 DDUtilityApp/MESDOWNLOADER/Utili.cs create mode 100644 DDUtilityApp/MESDOWNLOADER/XmlToDsConverter.cs diff --git a/DDUtilityApp/App.config b/DDUtilityApp/App.config index 013eddd..f339ce0 100644 --- a/DDUtilityApp/App.config +++ b/DDUtilityApp/App.config @@ -1,37 +1,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DDUtilityApp/DDUtilityApp.csproj b/DDUtilityApp/DDUtilityApp.csproj index 0e8e6c6..93ad132 100644 --- a/DDUtilityApp/DDUtilityApp.csproj +++ b/DDUtilityApp/DDUtilityApp.csproj @@ -397,6 +397,20 @@ FrmEqSelector.cs + + Form + + + ProgressForm.cs + + + Form + + + ServerLog.cs + + + Form diff --git a/DDUtilityApp/GlobalVariable.cs b/DDUtilityApp/GlobalVariable.cs index 3d320d2..ae58f39 100644 --- a/DDUtilityApp/GlobalVariable.cs +++ b/DDUtilityApp/GlobalVariable.cs @@ -28,6 +28,11 @@ namespace DDUtilityApp /// public string DownloadPath { get; set; } + /// + /// 로그파일 다운로드 경로 jhlim 20250202 + /// + public string MesDownloadPath { get; set; } + /// /// Workflow 다운로드 경로 /// @@ -109,6 +114,7 @@ namespace DDUtilityApp this.DefaultPath = defaultPath.Replace("%MyDocuments%", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); this.DownloadPath = $@"{this.DefaultPath}Download\"; this.WorkflowPath = $@"{this.DefaultPath}Workflow\"; + this.MesDownloadPath = $@"{this.DefaultPath}MesDownload\"; //jhlim 20250202 } public void LoadSetting() diff --git a/DDUtilityApp/MESDOWNLOADER/MESDOWNLOADER.7z b/DDUtilityApp/MESDOWNLOADER/MESDOWNLOADER.7z new file mode 100644 index 0000000000000000000000000000000000000000..9ff87a1aaa4fa5acee790e012a695c573d4ad25c GIT binary patch literal 9308 zcmV-iB%|9mdc3bE8~_A#5#QYzBme*a0000Z000000000OHrLzW;dvtUT>y8k)8`o& z(Y`&Am{!Pg8?b$tCR}flSJ!7Ps@pQw#STV?Op%IrPV7 zIc?Mfe6HyZ`KQf?I?sYjJ+IN4^ZD{I7Ux6c%NJL(;Q+!Cq;#f@4{7{J71EU9yX=pfw|)WK9d8#n zwnd1c6?crU4T+4LVaAEVfT^I^Vx{ZJH1K4p4Y)9ZWjdQrSMWN}C z2?w|+LIjTb&p36A{J_6MM*eX<5eRZS^XKe`ySBuctOv>)YJ2j4_F2%V6bY8wcZCX$NRDE(S^ zgu-lv`9pa$OA<{YcM=(yPm$_34ejSTse55#)P#boxUvHoiW5*tE=e5-XFoU($+!dhH(L z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aS!eL&vxsp=dX z|A9WRyWto86P*36B8AVwv?UwMeYQDx&fNXTj%6x8IKFAQu4t|dfZ8S)M~I}^2}-Yr z^uYUjKYSYFtLOAlq0xmk5@J2|s}yK8u~@M)+`k}JzQ>$IdJa>S4LR$ui}`-}F&YRh zoc;AgHj6Q`Dx{DL?w*Y^d!<)Rgo#*jYakZtgy0)jP={cd`{Y_eJ);Orrq~&lyUF}|EPxs1*JW{Dni42jmd&>W8`V#L z=KJ00AQd0RaVF01yBG41!h) K0Rnm=H2?tqMkqD_ literal 0 HcmV?d00001 diff --git a/DDUtilityApp/MESDOWNLOADER/ProgressForm.Designer.cs b/DDUtilityApp/MESDOWNLOADER/ProgressForm.Designer.cs new file mode 100644 index 0000000..13f69c8 --- /dev/null +++ b/DDUtilityApp/MESDOWNLOADER/ProgressForm.Designer.cs @@ -0,0 +1,75 @@ + +namespace DDUtilityApp.MESDOWNLOADER +{ + partial class ProgressForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.progressBar = new System.Windows.Forms.ProgressBar(); + this.lblStatus = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // progressBar + // + this.progressBar.Location = new System.Drawing.Point(20, 20); + this.progressBar.Name = "progressBar"; + this.progressBar.Size = new System.Drawing.Size(250, 20); + this.progressBar.TabIndex = 0; + // + // lblStatus + // + this.lblStatus.AutoSize = true; + this.lblStatus.Location = new System.Drawing.Point(28, 54); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(38, 12); + this.lblStatus.TabIndex = 1; + this.lblStatus.Text = "label1"; + this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // ProgressForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 93); + this.ControlBox = false; + this.Controls.Add(this.lblStatus); + this.Controls.Add(this.progressBar); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "ProgressForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "다운로드 진행 중"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ProgressBar progressBar; + private System.Windows.Forms.Label lblStatus; + } +} \ No newline at end of file diff --git a/DDUtilityApp/MESDOWNLOADER/ProgressForm.cs b/DDUtilityApp/MESDOWNLOADER/ProgressForm.cs new file mode 100644 index 0000000..afef5c7 --- /dev/null +++ b/DDUtilityApp/MESDOWNLOADER/ProgressForm.cs @@ -0,0 +1,28 @@ +using System; +using System.Windows.Forms; + +namespace DDUtilityApp.MESDOWNLOADER +{ + public partial class ProgressForm : Form + { + public ProgressForm(int maxFiles) + { + InitializeComponent(); + progressBar.Maximum = maxFiles + 1; + lblStatus.Text = string.Empty; + } + + public void UpdateProgress(string fileName, int current) + { + if (this.InvokeRequired) + { + this.Invoke(new Action(() => UpdateProgress(fileName, current))); + } + else + { + lblStatus.Text = $"{fileName}\r\n{current} / {progressBar.Maximum - 1}"; + progressBar.Value = current; + } + } + } +} diff --git a/DDUtilityApp/MESDOWNLOADER/ServerLog.Designer.cs b/DDUtilityApp/MESDOWNLOADER/ServerLog.Designer.cs new file mode 100644 index 0000000..241309f --- /dev/null +++ b/DDUtilityApp/MESDOWNLOADER/ServerLog.Designer.cs @@ -0,0 +1,376 @@ + +namespace DDUtilityApp.MESDOWNLOADER +{ + partial class ServerLog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + Telerik.WinControls.UI.TableViewDefinition tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition(); + Telerik.WinControls.UI.TableViewDefinition tableViewDefinition2 = new Telerik.WinControls.UI.TableViewDefinition(); + this.cboxServer = new System.Windows.Forms.ComboBox(); + this.btnConnect = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.btnFoder = new System.Windows.Forms.Button(); + this.panel4 = new System.Windows.Forms.FlowLayoutPanel(); + this.label1 = new System.Windows.Forms.Label(); + this.txtPath = new System.Windows.Forms.TextBox(); + this.panel2 = new System.Windows.Forms.Panel(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.panel3 = new System.Windows.Forms.Panel(); + this.panel6 = new System.Windows.Forms.Panel(); + this.gridServer = new JWH.CONTROL.GridViewEx(); + this.panel5 = new System.Windows.Forms.Panel(); + this.panel7 = new System.Windows.Forms.Panel(); + this.gridLogFiles = new JWH.CONTROL.GridViewEx(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel8 = new System.Windows.Forms.Panel(); + this.plSubPart = new System.Windows.Forms.FlowLayoutPanel(); + this.btnPath = new System.Windows.Forms.Button(); + this.panel4.SuspendLayout(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + this.panel3.SuspendLayout(); + this.panel6.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gridServer)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.gridServer.MasterTemplate)).BeginInit(); + this.panel5.SuspendLayout(); + this.panel7.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gridLogFiles)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.gridLogFiles.MasterTemplate)).BeginInit(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // cboxServer + // + this.cboxServer.FormattingEnabled = true; + this.cboxServer.Location = new System.Drawing.Point(100, 4); + this.cboxServer.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cboxServer.Name = "cboxServer"; + this.cboxServer.Size = new System.Drawing.Size(215, 20); + this.cboxServer.TabIndex = 1; + this.cboxServer.SelectedIndexChanged += new System.EventHandler(this.cboxServer_SelectedIndexChanged); + // + // btnConnect + // + this.btnConnect.Location = new System.Drawing.Point(321, 4); + this.btnConnect.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.btnConnect.Name = "btnConnect"; + this.btnConnect.Size = new System.Drawing.Size(87, 23); + this.btnConnect.TabIndex = 1; + this.btnConnect.Text = "연결"; + this.btnConnect.UseVisualStyleBackColor = true; + this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click); + // + // label2 + // + this.label2.Dock = System.Windows.Forms.DockStyle.Left; + this.label2.Location = new System.Drawing.Point(414, 2); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(88, 27); + this.label2.TabIndex = 5; + this.label2.Text = "로컬디렉토리 :"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // btnFoder + // + this.btnFoder.Location = new System.Drawing.Point(855, 4); + this.btnFoder.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.btnFoder.Name = "btnFoder"; + this.btnFoder.Size = new System.Drawing.Size(66, 23); + this.btnFoder.TabIndex = 4; + this.btnFoder.Text = "폴더"; + this.btnFoder.UseVisualStyleBackColor = true; + this.btnFoder.Click += new System.EventHandler(this.btnFoder_Click); + // + // panel4 + // + this.panel4.Controls.Add(this.label1); + this.panel4.Controls.Add(this.cboxServer); + this.panel4.Controls.Add(this.btnConnect); + this.panel4.Controls.Add(this.label2); + this.panel4.Controls.Add(this.txtPath); + this.panel4.Controls.Add(this.btnFoder); + this.panel4.Controls.Add(this.btnPath); + this.panel4.Dock = System.Windows.Forms.DockStyle.Top; + this.panel4.Location = new System.Drawing.Point(0, 0); + this.panel4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel4.MinimumSize = new System.Drawing.Size(0, 19); + this.panel4.Name = "panel4"; + this.panel4.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel4.Size = new System.Drawing.Size(1007, 31); + this.panel4.TabIndex = 0; + // + // label1 + // + this.label1.Dock = System.Windows.Forms.DockStyle.Left; + this.label1.Location = new System.Drawing.Point(6, 2); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(88, 27); + this.label1.TabIndex = 0; + this.label1.Text = "Server : "; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtPath + // + this.txtPath.Location = new System.Drawing.Point(508, 5); + this.txtPath.Name = "txtPath"; + this.txtPath.Size = new System.Drawing.Size(341, 21); + this.txtPath.TabIndex = 2; + // + // panel2 + // + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.plSubPart); + this.panel2.Controls.Add(this.panel8); + this.panel2.Controls.Add(this.panel4); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(1009, 73); + this.panel2.TabIndex = 2; + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.Location = new System.Drawing.Point(3, 2); + this.splitContainer1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.panel2); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); + this.splitContainer1.Size = new System.Drawing.Size(1009, 622); + this.splitContainer1.SplitterDistance = 73; + this.splitContainer1.SplitterWidth = 2; + this.splitContainer1.TabIndex = 1; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.panel3); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.panel5); + this.splitContainer2.Size = new System.Drawing.Size(1009, 547); + this.splitContainer2.SplitterDistance = 570; + this.splitContainer2.TabIndex = 1; + // + // panel3 + // + this.panel3.Controls.Add(this.panel6); + this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel3.Location = new System.Drawing.Point(0, 0); + this.panel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel3.Name = "panel3"; + this.panel3.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel3.Size = new System.Drawing.Size(570, 547); + this.panel3.TabIndex = 1; + // + // panel6 + // + this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel6.Controls.Add(this.gridServer); + this.panel6.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel6.Location = new System.Drawing.Point(3, 2); + this.panel6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel6.Name = "panel6"; + this.panel6.Size = new System.Drawing.Size(564, 543); + this.panel6.TabIndex = 3; + // + // gridServer + // + this.gridServer.ColumnResizeKey = System.Windows.Forms.Keys.F6; + this.gridServer.Dock = System.Windows.Forms.DockStyle.Fill; + this.gridServer.Location = new System.Drawing.Point(0, 0); + this.gridServer.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + // + // + // + this.gridServer.MasterTemplate.ViewDefinition = tableViewDefinition1; + this.gridServer.Name = "gridServer"; + this.gridServer.Size = new System.Drawing.Size(562, 541); + this.gridServer.TabIndex = 0; + // + // panel5 + // + this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel5.Controls.Add(this.panel7); + this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel5.Location = new System.Drawing.Point(0, 0); + this.panel5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(435, 547); + this.panel5.TabIndex = 3; + // + // panel7 + // + this.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel7.Controls.Add(this.gridLogFiles); + this.panel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel7.Location = new System.Drawing.Point(0, 0); + this.panel7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel7.Name = "panel7"; + this.panel7.Size = new System.Drawing.Size(433, 545); + this.panel7.TabIndex = 4; + // + // gridLogFiles + // + this.gridLogFiles.ColumnResizeKey = System.Windows.Forms.Keys.F6; + this.gridLogFiles.Dock = System.Windows.Forms.DockStyle.Fill; + this.gridLogFiles.Location = new System.Drawing.Point(0, 0); + this.gridLogFiles.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + // + // + // + this.gridLogFiles.MasterTemplate.ViewDefinition = tableViewDefinition2; + this.gridLogFiles.Name = "gridLogFiles"; + this.gridLogFiles.Size = new System.Drawing.Size(431, 543); + this.gridLogFiles.TabIndex = 1; + // + // panel1 + // + this.panel1.Controls.Add(this.splitContainer1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel1.Name = "panel1"; + this.panel1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel1.Size = new System.Drawing.Size(1015, 626); + this.panel1.TabIndex = 2; + // + // panel8 + // + this.panel8.Dock = System.Windows.Forms.DockStyle.Left; + this.panel8.Location = new System.Drawing.Point(0, 31); + this.panel8.Name = "panel8"; + this.panel8.Size = new System.Drawing.Size(46, 40); + this.panel8.TabIndex = 1; + // + // plSubPart + // + this.plSubPart.Dock = System.Windows.Forms.DockStyle.Fill; + this.plSubPart.Location = new System.Drawing.Point(46, 31); + this.plSubPart.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.plSubPart.MinimumSize = new System.Drawing.Size(0, 19); + this.plSubPart.Name = "plSubPart"; + this.plSubPart.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.plSubPart.Size = new System.Drawing.Size(961, 40); + this.plSubPart.TabIndex = 2; + // + // btnPath + // + this.btnPath.Location = new System.Drawing.Point(927, 4); + this.btnPath.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.btnPath.Name = "btnPath"; + this.btnPath.Size = new System.Drawing.Size(66, 23); + this.btnPath.TabIndex = 6; + this.btnPath.Text = "경로열기"; + this.btnPath.UseVisualStyleBackColor = true; + this.btnPath.Click += new System.EventHandler(this.btnPath_Click); + // + // ServerLog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1015, 626); + this.Controls.Add(this.panel1); + this.Name = "ServerLog"; + this.Text = "ServerLog"; + this.WindowState = System.Windows.Forms.FormWindowState.Minimized; + this.Shown += new System.EventHandler(this.ServerLog_Shown); + this.Resize += new System.EventHandler(this.ServerLog_Resize); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.panel2.ResumeLayout(false); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + this.panel3.ResumeLayout(false); + this.panel6.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.gridServer.MasterTemplate)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.gridServer)).EndInit(); + this.panel5.ResumeLayout(false); + this.panel7.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.gridLogFiles.MasterTemplate)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.gridLogFiles)).EndInit(); + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ComboBox cboxServer; + private System.Windows.Forms.Button btnConnect; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button btnFoder; + private System.Windows.Forms.FlowLayoutPanel panel4; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txtPath; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Panel panel6; + private JWH.CONTROL.GridViewEx gridServer; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.Panel panel7; + private JWH.CONTROL.GridViewEx gridLogFiles; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.FlowLayoutPanel plSubPart; + private System.Windows.Forms.Panel panel8; + private System.Windows.Forms.Button btnPath; + } +} \ No newline at end of file diff --git a/DDUtilityApp/MESDOWNLOADER/ServerLog.cs b/DDUtilityApp/MESDOWNLOADER/ServerLog.cs new file mode 100644 index 0000000..1016ea9 --- /dev/null +++ b/DDUtilityApp/MESDOWNLOADER/ServerLog.cs @@ -0,0 +1,374 @@ +using JWH.CONTROL; +using JWH.NETWORK; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; +using Telerik.WinControls.Data; +using Telerik.WinControls.UI; + +namespace DDUtilityApp.MESDOWNLOADER +{ + public partial class ServerLog : Form + { + DataSet dsXml; + DataTable dtFiles; + public ServerLog() + { + InitializeComponent(); + SetDataTable(); + GetXmlFile(); + gridLogFiles.CellDoubleClick += Grid_CellDoubleClick; + gridLogFiles.KeyDown += Grid_KeyDown; + } + + + private void ServerLog_Shown(object sender, EventArgs e) + { + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + txtPath.Text = GlobalVariable.Instance.MesDownloadPath; //Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + SetGridView(); + } + private void ServerLog_Resize(object sender, EventArgs e) + { + splitContainer2.SplitterDistance = splitContainer2.ClientSize.Width / 2; + } + private void btnConnect_Click(object sender, EventArgs e) + { + gridLogFiles.DataSource = null; + dtFiles.Rows.Clear(); + LoadFiles(gridServer.ChildRows); + } + private void btnFoder_Click(object sender, EventArgs e) + { + // 폴더 선택 대화 상자를 생성 + using (FolderBrowserDialog folderDialog = new FolderBrowserDialog()) + { + // txtPath.Text에 값이 있으면 해당 경로로 설정, 없으면 문서 폴더로 설정 + if (!string.IsNullOrEmpty(txtPath.Text)) + { + folderDialog.SelectedPath = txtPath.Text; + } + else + { + // 초기값이 없으면 문서 폴더를 기본 경로로 설정 + folderDialog.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + } + + // 폴더 선택 대화 상자가 "확인" 버튼을 클릭했을 경우 + if (folderDialog.ShowDialog() == DialogResult.OK) + { + // 선택한 경로를 텍스트 박스에 표시 + txtPath.Text = folderDialog.SelectedPath; + GlobalVariable.Instance.MesDownloadPath = folderDialog.SelectedPath; + } + } + } + private void btnPath_Click(object sender, EventArgs e) + { + System.Diagnostics.Process.Start("explorer.exe", txtPath.Text); + } + private void cboxServer_SelectedIndexChanged(object sender, EventArgs e) + { + gridServer.DataSource = null; + if (dsXml == null || !dsXml.Tables.Contains("Item")) return; + + int serverId = 0; + if (cboxServer.SelectedValue == null) return; + if (cboxServer.SelectedValue is DataRowView dataRowView) + { + serverId = Convert.ToInt32(dataRowView["Server_Id"]); // Replace "ColumnName" with the actual column name + } + else + { + serverId = Convert.ToInt32(cboxServer.SelectedValue); + } + + DataTable filteredTable = dsXml.Tables["Item"].Clone(); + + + + // LINQ를 사용하여 Server Item Server_Id 기준으로 조인 + var query = from table1 in dsXml.Tables["Server"].AsEnumerable() + join table2 in dsXml.Tables["Item"].AsEnumerable() + on table1.Field("Server_Id") equals table2.Field("Server_Id") + where table2.Field("Server_Id") == serverId // 필터 조건을 추가 + select new + { + name = table1.Field("name"), + nameap = table2.Field("name"), + url = table2.Field("url"), + dir = table2.Field("dir"), + conkey = table2.Field("conkey"), + Server_Id = table2.Field("Server_Id") + }; + + gridServer.DataSource = query; + var uniqueNames = query.Select(x => x.nameap).Distinct(); + UpdateCheckBoxes(uniqueNames); + SetGridView(); + } + private void Grid_KeyDown(object sender, KeyEventArgs e) //jhlim 20250202 + { + if (e.KeyCode == Keys.Enter) + { + Grid_CellDoubleClick((GridViewEx)sender, null); + } + } + private bool isProcessing = false; // 중복 실행 방지 플래그 + + private async void Grid_CellDoubleClick(object sender, GridViewCellEventArgs e) // jhlim 20250202 + { + if (isProcessing) return; // 이미 실행 중이면 종료 + + isProcessing = true; // 실행 상태 설정 + + RadGridView gd = sender.GetType().Name.Contains("GridDataCellElement") ? + ((GridDataCellElement)sender)?.RowElement?.GridControl : (GridViewEx)sender; + + try + { + List mergefileList = new List(); + bool rtnBool = false; + int totalFiles = gd.SelectedRows.Count; + + if (totalFiles == 0) + { + MessageBox.Show("선택된 파일이 없습니다."); + isProcessing = false; + return; + } + + // 프로그래스 바 폼 생성 및 표시 + using (ProgressForm progressForm = new ProgressForm(totalFiles)) + { + progressForm.Show(); + progressForm.UpdateProgress(string.Empty, 0); // 초기 상태 업데이트 + + int processedCount = 0; + + // 파일 다운로드 비동기 처리 + foreach (GridViewRowInfo row in gd.SelectedRows) + { + var host = Util.GetStr(row.Cells["url"].Value); + var dir = row.Cells["dir"].Value; + var fileName = row.Cells["FileName"].Value; + var userId = Util.GetStr(row.Cells["userId"].Value); + var password = Util.GetStr(row.Cells["password"].Value); + + // 진행 상태 업데이트 + processedCount++; + progressForm.UpdateProgress(fileName?.ToString(), processedCount); + + FtpsClient.Disconnect(); + FtpsClient.Initialize(host, userId, password); + + rtnBool = await Task.Run(() => + FtpsClient.DownloadFtpsFile($"{dir}/{fileName}", $"{txtPath.Text}\\{fileName}") + ); + + if (!rtnBool) + { + MessageBox.Show($"{fileName} 다운로드에 실패했습니다."); + break; + } + + mergefileList.Add($"{txtPath.Text}\\{fileName}"); + } + + progressForm.Close(); // 프로그래스 바 폼 닫기 + } + + // 다운로드 완료 후 병합 처리 + if (rtnBool) + { + if (totalFiles > 1) + { + Util.GetFileMerge(mergefileList); + MessageBox.Show($"{totalFiles}개의 파일을 머지 하였습니다."); + } + else + { + MessageBox.Show($"{gd.SelectedRows[0].Cells["Name"].Value} 파일을 저장 하였습니다."); + } + } + } + catch (Exception ex) + { + MessageBox.Show($"에러 발생: {ex.Message}"); + } + finally + { + isProcessing = false; // 실행 완료 후 플래그 해제 + } + } + + private void GetXmlFile() + { + string xmlPath = ConfigurationManager.AppSettings["BULK_VIEWER"]; + dsXml = XmlToDsConverter.ConvertXmlToDataSet(xmlPath); + + if (dsXml == null || dsXml.Tables.Count == 0) + { + MessageBox.Show("XML 데이터를 불러올 수 없습니다.", "오류", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + PopulateComboBox(); + } + private void PopulateComboBox() + { + if (dsXml == null || !dsXml.Tables.Contains("Server")) return; + + cboxServer.DataSource = dsXml.Tables["Server"]; + cboxServer.DisplayMember = "name"; // 사용자가 볼 값 (서버 이름) + cboxServer.ValueMember = "Server_Id"; // 내부적으로 사용할 값 (서버 ID) + cboxServer.SelectedIndex = 0; + } + private void SetDataTable() + { + dtFiles = new DataTable(); + dtFiles.Columns.Add("Name", typeof(string)); + dtFiles.Columns.Add("nameap", typeof(string)); + dtFiles.Columns.Add("FileName", typeof(string)); + dtFiles.Columns.Add("Size", typeof(string)); + dtFiles.Columns.Add("Modified", typeof(string)); + dtFiles.Columns.Add("Type", typeof(string)); + dtFiles.Columns.Add("url", typeof(string)); + dtFiles.Columns.Add("dir", typeof(string)); + dtFiles.Columns.Add("userId", typeof(string)); + dtFiles.Columns.Add("password", typeof(string)); + } + private void SetGridView() + { + gridServer.Columns.Clear(); + gridLogFiles.Columns.Clear(); + + gridLogFiles.MultiSelect = true; + gridLogFiles.SelectionMode = GridViewSelectionMode.FullRowSelect; + + gridServer.AutoGenerateColumns = false; + gridServer.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None; // 컬럼 크기 자동 조정 끄기 + // 컬럼 추가 + gridServer.Columns.Add(new GridViewTextBoxColumn("name") { HeaderText = "시스템명", Width = 100, ReadOnly = true }); + gridServer.Columns.Add(new GridViewTextBoxColumn("nameap") { HeaderText = "서버명", Width = 100, ReadOnly = true }); + gridServer.Columns.Add(new GridViewTextBoxColumn("url") { HeaderText = "FTP 서버", Width = 300, ReadOnly = true }); + gridServer.Columns.Add(new GridViewTextBoxColumn("dir") { HeaderText = "FTP 폴더", Width = 300, ReadOnly = true }); + gridServer.Columns.Add(new GridViewTextBoxColumn("conkey") { IsVisible = false }); + + gridLogFiles.AutoGenerateColumns = false; + gridLogFiles.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None; // 컬럼 크기 자동 조정 끄기 + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("name") { HeaderText = "시스템", Width = 100, ReadOnly = true }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("nameap") { HeaderText = "서버", Width = 100, ReadOnly = true }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("FileName") { HeaderText = "파일명", Width = 300, ReadOnly = true }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("Size") { HeaderText = "파일 크기", Width = 100, TextAlignment = ContentAlignment.MiddleRight, ReadOnly = true }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("Modified") { HeaderText = "수정 날짜", Width = 150, TextAlignment = ContentAlignment.MiddleCenter, ReadOnly = true }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("Type") { HeaderText = "파일 유형", Width = 100, ReadOnly = true }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("url") { IsVisible = false }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("dir") { IsVisible = false }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("userId") { IsVisible = false }); + gridLogFiles.Columns.Add(new GridViewTextBoxColumn("password") { IsVisible = false }); + + FilterGridByNameap(); + } + private void FilterGridByNameap() + { + + var checkedNames = plSubPart.Controls.OfType() + .Where(c => c.Checked) + .Select(c => c.Text) + .ToList(); + + // 기존 필터 제거 + gridServer.FilterDescriptors.Clear(); + gridLogFiles.FilterDescriptors.Clear(); + // 체크된 항목이 없으면 전체 표시 + if (checkedNames == null || checkedNames.Count == 0) + return; + + // 필터 생성 + CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor(); + compositeFilter.LogicalOperator = FilterLogicalOperator.Or; + + foreach (var name in checkedNames) + { + compositeFilter.FilterDescriptors.Add(new FilterDescriptor("nameap", FilterOperator.IsEqualTo, name)); + } + + // 필터 적용 + gridServer.FilterDescriptors.Add(compositeFilter); + gridLogFiles.FilterDescriptors.Add(compositeFilter); + } + private void UpdateCheckBoxes(IEnumerable uniqueNames) + { + // 기존 체크박스 삭제 + plSubPart.Controls.Clear(); + + // 이름을 정렬 + var sortedNames = uniqueNames.OrderBy(name => name); + + // 체크박스 동적 생성 + foreach (var name in sortedNames) + { + CheckBox checkBox = new CheckBox(); + checkBox.Text = name; + checkBox.AutoSize = true; + checkBox.Checked = true; // 기본값 체크 상태 + + // 체크박스 이벤트 + checkBox.CheckedChanged += (s, ev) => + { + FilterGridByNameap(); + }; + + // 패널에 추가 + plSubPart.Controls.Add(checkBox); + } + } + private void LoadFiles(GridViewChildRowCollection rows) + { + try + { + foreach (GridViewRowInfo row in gridServer.ChildRows) // 필터된 행 제외 + { + if (row.IsVisible && row.Cells.Count > 1) // 표시된 행만 처리 + { + var path = Util.GetStr(row.Cells[3].Value); + string[] userInfo = Util.GetUser(Util.GetStr(row.Cells[4].Value)); + + if (userInfo != null) + { + FtpsClient.Initialize(Util.GetStr(row.Cells[2].Value), userInfo[0], userInfo[1]); + + // FTPS 서버에서 파일 목록 가져오기 + var fileList = FtpsClient.GetFtpsList(path); + + if (fileList == null || fileList.Length == 0) + { + MessageBox.Show("파일 목록을 가져올 수 없습니다.", "오류", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + // 데이터 테이블 생성 후 바인딩 + foreach (var item in fileList) + { + dtFiles.Rows.Add(row.Cells["name"].Value, row.Cells["nameap"].Value, item.Name, item.Size.ToString("N0") + , item.Modified.ToString("yyyy-MM-dd HH:mm:ss"), item.Type, row.Cells["url"].Value, row.Cells["dir"].Value, userInfo[0], userInfo[1]); + } + + } + } + } + gridLogFiles.DataSource = dtFiles; + SetGridView(); + } + catch (Exception ex) + { + MessageBox.Show($"파일 목록 로드 오류: {ex.Message}", "오류", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/DDUtilityApp/MESDOWNLOADER/Utili.cs b/DDUtilityApp/MESDOWNLOADER/Utili.cs new file mode 100644 index 0000000..b82d3a6 --- /dev/null +++ b/DDUtilityApp/MESDOWNLOADER/Utili.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; + +namespace DDUtilityApp.MESDOWNLOADER +{ + public static class Util + { + public static int GetFileMerge(List filePaths) + { + int rtnBint = 9; // 기본 실패 코드 + + if (filePaths.Count == 0) + { + Console.WriteLine("병합할 파일이 없습니다."); + return 1; + } + + // 실행 시간 측정을 위한 Stopwatch 시작 + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + + // 첫 번째 파일명에서 경로 제외 + string firstFileName = Path.GetFileName(filePaths.First()); + string mergedFileName = "merge_" + firstFileName; + + // 병합된 파일을 저장할 경로 (첫 번째 파일과 동일한 폴더) + string mergedFilePath = Path.Combine(Path.GetDirectoryName(filePaths.First()), mergedFileName); + + try + { + using (StreamWriter writer = new StreamWriter(mergedFilePath, false)) // false: 새 파일 생성 + { + foreach (string file in filePaths) + { + if (File.Exists(file)) + { + using (StreamReader reader = new StreamReader(file)) + { + writer.Write(reader.ReadToEnd()); + } + Console.WriteLine($"{file} -> 병합 완료"); + } + else + { + Console.WriteLine($"파일 없음: {file}"); + } + } + } + + // 실행 시간 측정 종료 + stopwatch.Stop(); + Console.WriteLine($"모든 파일이 {mergedFileName}로 병합되었습니다."); + Console.WriteLine($"병합 실행 시간: {stopwatch.ElapsedMilliseconds} ms"); + + rtnBint = 0; // 성공 코드 + } + catch (Exception ex) + { + Console.WriteLine($"오류 발생: {ex.Message}"); + } + + return rtnBint; + } + + public static string GetStr(object str ) + { + return string.IsNullOrEmpty(str.ToString())?"": str.ToString(); + } + + public static string GetBase64(string base64, string type = "decoded") + { + string rtnStr = string.Empty; + if (string.IsNullOrEmpty(base64) == false) + { + if (type == "decoded") + // Base64 디코딩 + rtnStr = Encoding.UTF8.GetString(Convert.FromBase64String(base64)); + else + // Base64 디코딩 + rtnStr = Convert.ToBase64String(Encoding.UTF8.GetBytes(base64)); + } + return rtnStr; + } + + public static string[] GetUser(string userInfo) + { + string[] rtnArry = null; + if (string.IsNullOrEmpty(userInfo) == false) + { + rtnArry = GetBase64(userInfo).Split(':'); + } + return rtnArry; + } + } +} \ No newline at end of file diff --git a/DDUtilityApp/MESDOWNLOADER/XmlToDsConverter.cs b/DDUtilityApp/MESDOWNLOADER/XmlToDsConverter.cs new file mode 100644 index 0000000..e665e52 --- /dev/null +++ b/DDUtilityApp/MESDOWNLOADER/XmlToDsConverter.cs @@ -0,0 +1,55 @@ +using System; +using System.Data; +using System.IO; +using System.Xml; + +namespace DDUtilityApp.MESDOWNLOADER +{ + + public static class XmlToDsConverter + { + public static DataSet ConvertXmlToDataSet(string xmlFilePath) + { + try + { + DataSet dataSet = new DataSet(); + using (StreamReader reader = new StreamReader(xmlFilePath, System.Text.Encoding.UTF8)) + { + dataSet.ReadXml(reader); + } + return dataSet; + } + catch (Exception ex) + { + Console.WriteLine($"XML 변환 오류: {ex.Message}"); + return null; + } + } + + + public static void PrintDataSet(DataSet dataSet) + { + if (dataSet == null) + { + Console.WriteLine("데이터셋이 비어 있습니다."); + return; + } + + foreach (DataTable table in dataSet.Tables) + { + Console.WriteLine($"테이블: {table.TableName}"); + foreach (DataRow row in table.Rows) + { + foreach (DataColumn column in table.Columns) + { + Console.WriteLine($"{column.ColumnName}: {row[column]}"); + } + } + } + } + } +} +// 사용 예제 +// string xmlPath = "ViewList.xml"; +// DataSet ds = XmlToDataSetConverter.ConvertXmlToDataSet(xmlPath); +// XmlToDataSetConverter.PrintDataSet(ds); diff --git a/DDUtilityApp/Program.cs b/DDUtilityApp/Program.cs index b5d46b0..d994dd3 100644 --- a/DDUtilityApp/Program.cs +++ b/DDUtilityApp/Program.cs @@ -70,15 +70,15 @@ namespace DDUtilityApp #region [ 버튼 생성 정보 ] frmMain.Buttons.Add("EIS Log Viewer", new EisParser0()); - //frmMain.Buttons.Add("MES Log Download", typeof(SPECDOCUMENT.FrmSpecDocument)); // 위치 - //frmMain.Buttons.Add("MIS Log Viewer", new AgvParser()); // 제거 + frmMain.Buttons.Add("MES Log Download", typeof(MESDOWNLOADER.ServerLog)); // 위치 + frmMain.Buttons.Add("MIS Log Viewer", new AgvParser()); // 제거 frmMain.Buttons.Add("FDC Mongo Viewer", typeof(MONGO.FrmFDCMongo)); frmMain.Buttons.Add("TIB Simulator", typeof(TIBRENDEZVOUS.FrmSimulator01)); frmMain.Buttons.Add("HSMS Converter", typeof(LOGPARSER.FrmHsmsViewer)); frmMain.Buttons.Add("TibcoConfig.Xml", typeof(ETC.FrmTIbcoConfig)); #if DEBUG frmMain.Buttons.Add("FTP Test", typeof(SPECDOCUMENT.FrmSpecDocument)); - frmMain.Buttons.Add("MES Log Download", typeof(SPECDOCUMENT.FrmSpecDocument)); +// frmMain.Buttons.Add("MES Log Download", typeof(MESDOWNLOADER.ServerLog)); #endif #endregion