Compare commits

34 Commits

Author SHA1 Message Date
jungwoois
f0114e7b3f Ver 2025.05.01.0
B2 Database 변경
2025-05-01 11:59:58 +09:00
jungwoois
395102ffea LogViewer B2 CEID=308,309 Name to ModelID
ServerLog ViewList.xml 내문서/DDUtility 폴더로 복제 및 사용
2025-04-24 14:04:20 +09:00
jungwoois
de709d7030 EIS LogServer 추가등록 2025-04-09 15:44:12 +09:00
jungwoois
53e734f5e2 Deploy 2025.03.27.0 2025-03-27 14:39:26 +09:00
jungwoois
06499030a6 ServerLog:: Merge기능 옵션 2025-03-27 13:46:30 +09:00
4b73deabf3 Merge branch 'master' of https://git.e1soft.co.kr/T001084/DDUtility 2025-03-27 13:34:20 +09:00
68d51f64d0 Ver 2025.03.25.0
TibSimulator Patch:: AutoReply Enable의 경우, 텍스트박스에 출력하지 않고 메시지 즉시전송
2025-03-27 13:33:21 +09:00
jungwoois
15a0127778 Deply 2025.03.25.0 2025-03-25 17:22:15 +09:00
e7a8c36412 Ver 2025.03.25.0
FrmLogParser :: LogFile DragDrop 패치
2025-03-25 17:06:01 +09:00
jungwoois
0507461566 Depoly 2025-03-20 16:54:12 +09:00
d9d9d7b71f Ver 2025.03.20.0
:: SECS 메시지. 한글패치
2025-03-20 16:38:08 +09:00
0ddef9106b Ver 2025.03.19.4
:: TibSimulator Display Patch
2025-03-19 15:44:34 +09:00
7b11a3e1b1 Ver 2025.03.19.3
:: FrmSimulator Disable Patch
2025-03-19 14:40:27 +09:00
jungwoois
1d77f7a2cd Ver 2025.03.19.2 2025-03-19 13:38:31 +09:00
fe76ce56d4 Ver 2025.03.19.0
FrmEqSelector 로그파일 목록수집 개선(2회 to 1회)
FrmServerLog 파일명 중복에 따른 다운로드 파일명 수정
2025-03-19 13:12:53 +09:00
jungwoois
0c12d15092 Ver 2025.03.18.05 2025-03-18 15:12:57 +09:00
f3d11daf94 한글 Encoding, 병합시 파일시간 기준 2025-03-18 15:00:37 +09:00
fda27adace 파일일자 변경 ToLocalTime 2025-03-18 13:46:23 +09:00
f57a9ae1ff Ver.2025.03.18.2 2025-03-18 11:43:59 +09:00
1ee9e948d9 ViewList 배포 포함 2025-03-18 11:24:22 +09:00
63897c889e 충돌병합 2025-03-18 10:58:56 +09:00
29a0c365c5 Ver 2025.03.18.0 2025-03-18 10:50:14 +09:00
1ffb8e0785 FrmServerLog 2025-03-18 10:49:29 +09:00
05390839fc FrmServerLog 추가 (개발중...) 2025-03-17 17:42:03 +09:00
4f59f1ab2f HSMS 로그파일 갱신오류 2025-03-17 10:52:33 +09:00
010aa6aa49 Ver. 2025.03.14.0 2025-03-14 14:58:31 +09:00
c3e6aad895 Ver. 2025.03.14.0 2025-03-14 09:36:32 +09:00
00b3a5e643 Revert "Setup Setting"
This reverts commit 3e9339195e.
2025-03-14 09:07:45 +09:00
f43ffb1e30 Merge branch 'master' into 20250203_SFTP 2025-03-14 09:06:40 +09:00
9be4b773a5 F1 Change 2025-03-07 11:57:24 +09:00
0790ae42f9 FDC MongoDB 패치(컬럼추가) 2025-03-06 09:40:18 +09:00
0b7f4ba366 HSMS, Workflow Download 2025-03-05 17:08:54 +09:00
933519164e EISLog OpenWindow 2025-03-05 12:59:00 +09:00
3e9339195e Setup Setting 2025-02-27 13:22:31 +09:00
34 changed files with 1869 additions and 708 deletions

View File

@@ -6,7 +6,7 @@
<appSettings>
<add key="ClientSettingsProvider.ServiceUri" value=""/>
<add key="BULK_VIEWER" value="ViewList.xml" />
</appSettings>
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>

View File

@@ -35,7 +35,7 @@
<WebPage>index.htm</WebPage>
<TrustUrlParameters>true</TrustUrlParameters>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>2025.01.07.0</ApplicationVersion>
<ApplicationVersion>2025.05.01.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@@ -404,6 +404,12 @@
<Compile Include="LOGPARSER\FrmEqSelector.Designer.cs">
<DependentUpon>FrmEqSelector.cs</DependentUpon>
</Compile>
<Compile Include="MESDOWNLOADER\FrmServerLog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MESDOWNLOADER\FrmServerLog.Designer.cs">
<DependentUpon>FrmServerLog.cs</DependentUpon>
</Compile>
<Compile Include="MESDOWNLOADER\ProgressForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -522,6 +528,9 @@
<EmbeddedResource Include="LOGPARSER\FrmWorkFlow.resx">
<DependentUpon>FrmWorkFlow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MESDOWNLOADER\FrmServerLog.resx">
<DependentUpon>FrmServerLog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MONGO\FrmFDCMongo.resx">
<DependentUpon>FrmFDCMongo.cs</DependentUpon>
</EmbeddedResource>
@@ -623,6 +632,16 @@
<IncludeHash>True</IncludeHash>
<FileType>File</FileType>
</PublishFile>
<PublishFile Include="ViewList.xml">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>File</FileType>
</PublishFile>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\AWSSDK.SecurityToken.3.7.100.14\analyzers\dotnet\cs\AWSSDK.SecurityToken.CodeAnalysis.dll" />

View File

@@ -7,6 +7,6 @@ using System.Threading.Tasks;
namespace DDUtilityApp
{
public enum AccessType { SMB, FTP, FTPS, SFTP };
public enum AccessType { SMB, FTP, FTPS, SFTP, LOCAL };
}

View File

@@ -1,8 +1,11 @@
using JWH;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.Windows.Forms;
using Telerik.WinControls.UI;
using static DDUtilityApp.GlobalVariable;
namespace DDUtilityApp
{
@@ -11,7 +14,7 @@ namespace DDUtilityApp
public object SelectedObject { get; set; } = null;
public Dictionary<string, object> Buttons { get; set; } = new Dictionary<string, object>();
public List<DynamicControl> Buttons { get; set; } = new List<DynamicControl>();
public FrmMain()
{
@@ -21,7 +24,7 @@ namespace DDUtilityApp
this.SetEventHandler();
}
public FrmMain(Dictionary<string, object> args) : this()
public FrmMain(List<DynamicControl> args) : this()
{
this.Buttons = args;
this.SetButtons();
@@ -48,21 +51,23 @@ namespace DDUtilityApp
{
try
{
eUserLevel userLevel = GlobalVariable.Instance.UserLevel;
int btnWidth = 200;
int btnHeight = 32;
int tabIndex = 0;
int tabIndex = 10;
List<Button> lstControls = new List<Button>();
foreach(string name in this.Buttons.Keys)
foreach(DynamicControl obj in this.Buttons)
{
object obj = this.Buttons[name];
Button button = new Button();
button.Text = name;
button.Text = obj.Name;
button.Size = new Size(btnWidth, btnHeight);
button.Dock = DockStyle.Top;
button.TabIndex = tabIndex++;
button.Tag = obj;
button.Tag = obj.Value;
button.Visible = obj.Visible;
if (obj.Visible == false && userLevel > eUserLevel.Normal) button.Visible = true;
button.Click += Button_Click;
lstControls.Add(button);
}

View File

@@ -1,4 +1,5 @@
using JWH;
using log4net.Core;
using System;
using System.ComponentModel;
using System.Configuration;
@@ -31,7 +32,7 @@ namespace DDUtilityApp
/// <summary>
/// 로그파일 다운로드 경로 jhlim 20250202
/// </summary>
public string MesDownloadPath { get; set; }
public string DownloadPathServerLog { get; set; }
/// <summary>
/// Workflow 다운로드 경로
@@ -56,6 +57,8 @@ namespace DDUtilityApp
public Size FormSize { get; set; } = new Size(1300, 750);
public eUserLevel UserLevel { get; set; } = eUserLevel.None;
#region [ LogParser ]
public string EisParser_GridHeader { get; set; } = string.Empty;
@@ -106,22 +109,32 @@ namespace DDUtilityApp
}
}
/// <summary>
/// Loading AppSettings
/// </summary>
private void LodConfig()
{
// DefaultPath
string defaultPath = ConfigurationManager.AppSettings["DefaultPath"];
if (string.IsNullOrEmpty(defaultPath)) defaultPath = $@"%MyDocuments%\DDUtility\";
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
this.DownloadPath = Path.Combine(this.DefaultPath, "Download");
this.WorkflowPath = Path.Combine(this.DefaultPath, "Workflow");
this.DownloadPathServerLog = Path.Combine(this.DefaultPath, "DownloadServer");
}
/// <summary>
/// Loading Setting.xml
/// </summary>
public void LoadSetting()
{
this.LoadSetting($@"{this.DefaultPath}Setting.xml");
}
/// <summary>
/// Loading Setting File
/// </summary>
/// <param name="filename"></param>
private void LoadSetting(string filename)
{
try
@@ -208,6 +221,14 @@ namespace DDUtilityApp
}
}
public enum eUserLevel
{
None = 0,
Normal = 1,
Admin = 16,
SupperAdmin = 128
}
}
}

View File

@@ -58,13 +58,13 @@ namespace DDUtilityApp.LOGPARSER.DATA
{
get
{
string value = string.Empty;
foreach(string name in this.DisplayNameOrder.Split(';'))
{
value = this.PropertyGet(name);
if (!string.IsNullOrEmpty(value)) break;
}
return value;
//string value = string.Empty;
//foreach(string name in this.DisplayNameOrder.Split(';'))
//{
// value = this.PropertyGet(name).ToString();
// if (!string.IsNullOrEmpty(value)) break;
//}
return this.MesName;
}
}

View File

@@ -1,4 +1,6 @@
using System;
using System.IO;
using System.Windows.Forms.DataVisualization.Charting;
using DDUtilityApp.DATA;
using JWH.DATA;
@@ -11,33 +13,74 @@ namespace DDUtilityApp.LOGPARSER.DATA
public class LogFile : DataTableBase
{
private string m_FullName = string.Empty;
public Account Account { get; set; } = null;
public string Name { get; set; }
public string FullName
{
get { return this.m_FullName; }
set
{
this.m_FullName = value;
this.DirectoryName = Path.GetDirectoryName(value);
this.FileName = Path.GetFileName(value);
this.Name = Path.GetFileNameWithoutExtension(value);
this.Extension = Path.GetExtension(value);
}
}
public string DirectoryName { get; private set; }
public string FileName { get; private set; }
public string Name { get; private set; }
public string Extension { get; private set; }
public long Length { get; set; }
public string Extension { get; set; }
public string FullName { get; set; }
public DateTime CreationTime { get; set; }
public DateTime LastAccessTime { get; set; }
public DateTime LastWriteTime { get; set; }
public string DestFullName { get; set; }
public LogFile()
{
}
public LogFile(string fullName)
{
this.Name = System.IO.Path.GetFileNameWithoutExtension(fullName);
this.FullName = fullName;
this.Extension = System.IO.Path.GetExtension(fullName);
}
public string GetFileSize(FileSizeType format = FileSizeType.Auto)
{
int index = 0;
int nFormat = (int)format;
double value = this.Length;
for (index = 0; index < nFormat; index++)
{
if (format == FileSizeType.Auto && value < 1024) break;
value /= 1024;
}
return $"{value.ToString("N2")} {(FileSizeType)index}";
}
}
public enum FileSizeType
{
Bt = 0,
KB = 1,
MB = 2,
GB = 3,
TB = 4,
Auto = 9,
}
}

View File

@@ -58,15 +58,15 @@
this.panel5 = new System.Windows.Forms.Panel();
this.panel7 = new System.Windows.Forms.Panel();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabLogFiles = new System.Windows.Forms.TabPage();
this.gridLogFiles = new JWH.CONTROL.GridViewEx();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabModelHistory = new System.Windows.Forms.TabPage();
this.gridModelDetail = new JWH.CONTROL.GridViewEx();
this.panel10 = new System.Windows.Forms.Panel();
this.tboxModelDescription = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabWorkflow = new System.Windows.Forms.TabPage();
this.gridWorkflow = new JWH.CONTROL.GridViewEx();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.tabHSMS = new System.Windows.Forms.TabPage();
this.gridHsms = new JWH.CONTROL.GridViewEx();
this.radStatusStrip1 = new Telerik.WinControls.UI.RadStatusStrip();
this.rstatus1 = new Telerik.WinControls.UI.RadLabelElement();
@@ -92,17 +92,17 @@
this.panel5.SuspendLayout();
this.panel7.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabLogFiles.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridLogFiles)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridLogFiles.MasterTemplate)).BeginInit();
this.tabPage2.SuspendLayout();
this.tabModelHistory.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridModelDetail)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridModelDetail.MasterTemplate)).BeginInit();
this.panel10.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabWorkflow.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridWorkflow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridWorkflow.MasterTemplate)).BeginInit();
this.tabPage4.SuspendLayout();
this.tabHSMS.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridHsms)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridHsms.MasterTemplate)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.radStatusStrip1)).BeginInit();
@@ -384,10 +384,10 @@
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabLogFiles);
this.tabControl1.Controls.Add(this.tabModelHistory);
this.tabControl1.Controls.Add(this.tabWorkflow);
this.tabControl1.Controls.Add(this.tabHSMS);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
@@ -397,16 +397,16 @@
this.tabControl1.TabIndex = 6;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPage1
// tabLogFiles
//
this.tabPage1.Controls.Add(this.gridLogFiles);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(539, 463);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Log Files";
this.tabPage1.UseVisualStyleBackColor = true;
this.tabLogFiles.Controls.Add(this.gridLogFiles);
this.tabLogFiles.Location = new System.Drawing.Point(4, 22);
this.tabLogFiles.Name = "tabLogFiles";
this.tabLogFiles.Padding = new System.Windows.Forms.Padding(3);
this.tabLogFiles.Size = new System.Drawing.Size(539, 463);
this.tabLogFiles.TabIndex = 0;
this.tabLogFiles.Text = "Log Files";
this.tabLogFiles.UseVisualStyleBackColor = true;
//
// gridLogFiles
//
@@ -427,17 +427,17 @@
this.gridLogFiles.Size = new System.Drawing.Size(533, 457);
this.gridLogFiles.TabIndex = 3;
//
// tabPage2
// tabModelHistory
//
this.tabPage2.Controls.Add(this.gridModelDetail);
this.tabPage2.Controls.Add(this.panel10);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(539, 463);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Model History";
this.tabPage2.UseVisualStyleBackColor = true;
this.tabModelHistory.Controls.Add(this.gridModelDetail);
this.tabModelHistory.Controls.Add(this.panel10);
this.tabModelHistory.Location = new System.Drawing.Point(4, 22);
this.tabModelHistory.Name = "tabModelHistory";
this.tabModelHistory.Padding = new System.Windows.Forms.Padding(3);
this.tabModelHistory.Size = new System.Drawing.Size(539, 463);
this.tabModelHistory.TabIndex = 1;
this.tabModelHistory.Text = "Model History";
this.tabModelHistory.UseVisualStyleBackColor = true;
//
// gridModelDetail
//
@@ -478,16 +478,16 @@
this.tboxModelDescription.Size = new System.Drawing.Size(533, 96);
this.tboxModelDescription.TabIndex = 0;
//
// tabPage3
// tabWorkflow
//
this.tabPage3.Controls.Add(this.gridWorkflow);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(539, 463);
this.tabPage3.TabIndex = 3;
this.tabPage3.Text = "Workflow";
this.tabPage3.UseVisualStyleBackColor = true;
this.tabWorkflow.Controls.Add(this.gridWorkflow);
this.tabWorkflow.Location = new System.Drawing.Point(4, 22);
this.tabWorkflow.Name = "tabWorkflow";
this.tabWorkflow.Padding = new System.Windows.Forms.Padding(3);
this.tabWorkflow.Size = new System.Drawing.Size(539, 463);
this.tabWorkflow.TabIndex = 3;
this.tabWorkflow.Text = "Workflow";
this.tabWorkflow.UseVisualStyleBackColor = true;
//
// gridWorkflow
//
@@ -508,16 +508,16 @@
this.gridWorkflow.Size = new System.Drawing.Size(533, 457);
this.gridWorkflow.TabIndex = 4;
//
// tabPage4
// tabHSMS
//
this.tabPage4.Controls.Add(this.gridHsms);
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(539, 463);
this.tabPage4.TabIndex = 2;
this.tabPage4.Text = "HSMS";
this.tabPage4.UseVisualStyleBackColor = true;
this.tabHSMS.Controls.Add(this.gridHsms);
this.tabHSMS.Location = new System.Drawing.Point(4, 22);
this.tabHSMS.Name = "tabHSMS";
this.tabHSMS.Padding = new System.Windows.Forms.Padding(3);
this.tabHSMS.Size = new System.Drawing.Size(539, 463);
this.tabHSMS.TabIndex = 2;
this.tabHSMS.Text = "HSMS";
this.tabHSMS.UseVisualStyleBackColor = true;
//
// gridHsms
//
@@ -556,6 +556,7 @@
// rstatus1
//
this.rstatus1.Name = "rstatus1";
this.radStatusStrip1.SetSpring(this.rstatus1, false);
this.rstatus1.Text = "";
this.rstatus1.TextWrap = true;
//
@@ -597,18 +598,18 @@
this.panel5.ResumeLayout(false);
this.panel7.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabLogFiles.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridLogFiles.MasterTemplate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridLogFiles)).EndInit();
this.tabPage2.ResumeLayout(false);
this.tabModelHistory.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridModelDetail.MasterTemplate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridModelDetail)).EndInit();
this.panel10.ResumeLayout(false);
this.panel10.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.tabWorkflow.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridWorkflow.MasterTemplate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridWorkflow)).EndInit();
this.tabPage4.ResumeLayout(false);
this.tabHSMS.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridHsms.MasterTemplate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridHsms)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.radStatusStrip1)).EndInit();
@@ -642,17 +643,17 @@
private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox chkAllEquipment;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabLogFiles;
private JWH.CONTROL.GridViewEx gridLogFiles;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage tabModelHistory;
private JWH.CONTROL.GridViewEx gridModelDetail;
private System.Windows.Forms.Panel panel10;
private System.Windows.Forms.TextBox tboxModelDescription;
private Telerik.WinControls.UI.RadStatusStrip radStatusStrip1;
private Telerik.WinControls.UI.RadLabelElement rstatus1;
private System.Windows.Forms.CheckBox chkUseSMB;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabHSMS;
private System.Windows.Forms.TabPage tabWorkflow;
private JWH.CONTROL.GridViewEx gridHsms;
private JWH.CONTROL.GridViewEx gridWorkflow;
}

View File

@@ -8,6 +8,7 @@ using JWH.CONTROL;
using JWH.DATA;
using JWH.NETWORK;
using Org.BouncyCastle.Tls.Crypto;
using Renci.SshNet;
using Renci.SshNet.Sftp;
using System;
using System.Collections.Generic;
@@ -19,6 +20,7 @@ using System.IO;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using Telerik.WinControls.UI;
@@ -52,10 +54,10 @@ namespace DDUtilityApp.LOGPARSER
public string ServerName { get; set; } = string.Empty;
//public string EquipmentID { get; set; } = string.Empty;
public SECSDefine SECSDefine { get; set; } = null;
private int InitializeStatus { get; set; } = 0;
#endregion
#region [ FrmEqSelector ] ---------------------------------------------
@@ -79,20 +81,15 @@ namespace DDUtilityApp.LOGPARSER
this.tboxName.ImeMode = ImeMode.Hangul;
this.tboxEquipmentID.ImeMode = ImeMode.Alpha;
this.chkAllEquipment.Checked = GlobalVariable.Instance.FrmEqSelector_AllEquipment;
this.chkUseSMB.Checked = GlobalVariable.Instance.FrmEqSelector_UseSMB;
this.chkUseSMB.Checked = true; // = GlobalVariable.Instance.FrmEqSelector_UseSMB
this.chkUseSMB.Visible = false;
this.tabControl1.SelectedIndex = 0;
this.tboxModelDescription.Font = font;
this.GridEquipments_Setting();
this.GridLogFiles_Setting(this.gridLogFiles); //jhlim 20250202
this.GridLogFiles_Setting(this.gridHsms); //jhlim 20250202
this.GridLogFiles_Setting(this.gridWorkflow); //jhlim 20250202
this.GridModelDetail_Setting();
}
protected void SetEventHandler()
{
this.Load += FrmEquipments_Load;
this.Shown += this.FrmEqSelector_Shown;
this.FormClosing += FrmEqSelector_FormClosing;
this.FormClosed += this.FrmEqSelector_FormClosed;
this.Disposed += this.FrmEqSelector_Disposed;
@@ -113,12 +110,44 @@ namespace DDUtilityApp.LOGPARSER
this.gridLogFiles.CellDoubleClick += GridLogFiles_CellDoubleClick;
this.gridLogFiles.KeyDown += GridLogFiles_KeyDown;
//jhlim 20250202 start
this.gridWorkflow.CellDoubleClick += Grid_CellDoubleClick;
this.gridWorkflow.KeyDown += Grid_KeyDown;
this.gridHsms.CellDoubleClick += Grid_CellDoubleClick;
this.gridHsms.KeyDown += Grid_KeyDown;
//jhlim 20250202 end
}
private async void FrmEqSelector_Shown(object sender, EventArgs e)
{
await Task.Delay(200);
try
{
this.SuspendLayout();
this.GridEquipments_Setting();
this.GridLogFiles_Setting(this.gridLogFiles);
this.GridLogFiles_Setting(this.gridHsms);
this.GridLogFiles_Setting(this.gridWorkflow);
this.GridModelDetail_Setting();
this.InitializeStatus = 1;
this.SetLogServer();
if (this.Equipment != null) this.SetEquipment(this.Equipment);
else this.SetEquipment(this.ServerName, this.Equipment?.EquipmentID);
this.InitializeStatus = 0;
this.GridEquipments_SelectionChanged(this.gridEquipments, null);
this.SetSelectedLogFiles(this.SelectedLogFiles);
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
finally
{
this.InitializeStatus = 0;
this.ResumeLayout();
}
}
private void FrmEqSelector_Disposed(object sender, EventArgs e)
@@ -140,7 +169,7 @@ namespace DDUtilityApp.LOGPARSER
switch (keyData)
{
case Keys.F1:
Process.Start($"http://jungwoois.dothome.co.kr");
Process.Start("IEXPLORE.EXE", "http://pms.e1soft.co.kr:8090/Deploy/eqview/");
break;
case Keys.F6:
this.gridEquipments.BestFitColumns(BestFitColumnMode.DisplayedCells);
@@ -157,14 +186,6 @@ namespace DDUtilityApp.LOGPARSER
return base.ProcessCmdKey(ref msg, keyData);
}
private void FrmEquipments_Load(object sender, EventArgs e)
{
this.SetLogServer();
if (this.Equipment != null) this.SetEquipment(this.Equipment);
else this.SetEquipment(this.ServerName, this.Equipment?.EquipmentID);
this.SetSelectedLogFiles(this.SelectedLogFiles);
}
private void FrmEqSelector_FormClosing(object sender, FormClosingEventArgs e)
{
}
@@ -214,27 +235,71 @@ namespace DDUtilityApp.LOGPARSER
/// <param name="e"></param>
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl1.SelectedIndex >= 2)
try
{
int selectIdx = tabControl1.SelectedIndex;
string subPath = tabControl1.SelectedTab.Text.Contains("Workflow") ? "Workflow" : "THiRA_SECSGEM/HSMS";
var equipment = this.Equipment;
//StpClientWrap.Connect();
FtpsClient.Connect();
// SFTP 파일 목록 가져오기
// var rtnObj = StpClientWrap.GetSftpList($"/{equipment.EquipmentID}/{subPath}");
var rtnObj = FtpsClient.GetFtpsList($"/EISLog/{equipment.EquipmentID}/{subPath}");
if (rtnObj == null) return;
GridViewEx grid = tabControl1.SelectedTab.Controls.OfType<GridViewEx>().FirstOrDefault();
if (grid != null)
if (this.tabControl1.SelectedTab == this.tabHSMS)
{
//grid.AutoBinding(GetSftplogFiles(rtnObj));
grid.AutoBinding(GetLogFiles(rtnObj));
if (this.gridHsms.DataSource != null) return;
string remotePath = $"/{this.Account.DefaultPath}/{this.Equipment.EquipmentID}/THiRA_SECSGEM/HSMS";
switch (this.Account.Access)
{
case AccessType.SMB:
break;
case AccessType.FTPS:
{
FtpsClient.Connect();
FtpListItem[] items = FtpsClient.GetFtpsList(remotePath);
this.gridHsms.AutoBinding(this.GetLogFiles(items));
FtpsClient.Disconnect();
}
break;
case AccessType.SFTP:
{
StpClientWrap.Connect();
ISftpFile[] items = (ISftpFile[])StpClientWrap.GetSftpList(remotePath);
this.gridHsms.AutoBinding(this.GetLogFiles(items));
StpClientWrap.Disconnect();
}
break;
case AccessType.FTP:
break;
}
}
else if (this.tabControl1.SelectedTab == this.tabWorkflow)
{
if (this.gridWorkflow.DataSource != null) return;
string remotePath = $"/{this.Account.DefaultPath}/{this.Equipment.EquipmentID}/Workflow";
switch (this.Account.Access)
{
case AccessType.SMB:
break;
case AccessType.FTPS:
{
FtpsClient.Connect();
FtpListItem[] items = FtpsClient.GetFtpsList(remotePath);
LogFile[] logFiles = this.GetLogFiles(items);
this.gridWorkflow.AutoBinding(logFiles);
FtpsClient.Disconnect();
}
break;
case AccessType.SFTP:
{
StpClientWrap.Connect();
ISftpFile[] items = (ISftpFile[])StpClientWrap.GetSftpList(remotePath);
this.gridWorkflow.AutoBinding(this.GetLogFiles(items));
StpClientWrap.Disconnect();
}
break;
case AccessType.FTP:
break;
}
}
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
@@ -312,7 +377,7 @@ namespace DDUtilityApp.LOGPARSER
{
GridViewEx grid = this.gridEquipments;
grid.TableElement.RowHeight = 20;
grid.MultiSelect = true;
grid.MultiSelect = false;
Dictionary<string, string> dicColumnText = new Dictionary<string, string>();
dicColumnText.Add("Facility", "");
@@ -380,9 +445,13 @@ namespace DDUtilityApp.LOGPARSER
{
try
{
if (this.InitializeStatus > 0) return;
if (this.gridEquipments.SelectedRows.Count < 1) return;
this.gridLogFiles.DataSource = null;
this.gridModelDetail.DataSource = null;
this.gridWorkflow.DataSource = null;
this.gridHsms.DataSource = null;
EisEquipment equipment = this.gridEquipments.SelectedRows[0].DataBoundItem as EisEquipment;
if (equipment == null) return;
@@ -393,6 +462,7 @@ namespace DDUtilityApp.LOGPARSER
string path = string.Empty;
#region [ Model Details ]
// 모델 버전 정보
EisModelDetails[] modelDetails = this.GetModelDetails(equipment);
this.gridModelDetail.AutoBinding(modelDetails);
@@ -415,6 +485,7 @@ namespace DDUtilityApp.LOGPARSER
{
this.tboxModelDescription.Text = modelInfo[0].Description;
}
#endregion
#region [ LogFiles ]
@@ -464,10 +535,8 @@ namespace DDUtilityApp.LOGPARSER
if (ftpFiles != null) this.gridLogFiles.AutoBinding(this.GetLogFiles(ftpFiles));
this.rstatus1.Text = $"Path={this.Account.IPAddress}{path}";
if (FtpsClient.IsDirExists($"{path}/THiRA_SECSGEM/HSMS"))
{ if (!tabControl1.TabPages.Contains(tabPage4)) tabControl1.TabPages.Add(tabPage4); }
else
{ if (tabControl1.TabPages.Contains(tabPage4)) tabControl1.TabPages.Remove(tabPage4); }
//if (FtpsClient.IsDirExists($"{path}/THiRA_SECSGEM/HSMS") && !this.tabControl1.TabPages.Contains(tabHSMS))
// this.tabControl1.TabPages.Add(this.tabHSMS);
FtpsClient.Disconnect();
}
@@ -482,10 +551,8 @@ namespace DDUtilityApp.LOGPARSER
if (ftpFiles != null) this.gridLogFiles.AutoBinding(this.GetLogFiles(ftpFiles));
this.rstatus1.Text = $"Path={this.Account.IPAddress}{path}";
if (StpClientWrap.IsDirExists($"{path}/THiRA_SECSGEM/HSMS"))
{ if (!tabControl1.TabPages.Contains(tabPage4)) tabControl1.TabPages.Add(tabPage4); }
else
{ if (tabControl1.TabPages.Contains(tabPage4)) tabControl1.TabPages.Remove(tabPage4); }
//if (StpClientWrap.IsDirExists($"{path}/THiRA_SECSGEM/HSMS") && !this.tabControl1.TabPages.Contains(tabHSMS))
// this.tabControl1.TabPages.Add(this.tabHSMS);
StpClientWrap.Disconnect();
}
@@ -500,6 +567,12 @@ namespace DDUtilityApp.LOGPARSER
#endregion
#region [ Workflow & HSMS ]
this.tabControl1_SelectedIndexChanged(this.tabControl1, new EventArgs());
#endregion
}
catch (Exception ex)
{
@@ -519,165 +592,6 @@ namespace DDUtilityApp.LOGPARSER
}
}
/// <summary>
/// [CheckPoint] 선택된 설비의 로그파일 목록을 표시한다.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void xGridEquipments_SelectionChanged(object sender, EventArgs e)
{
try
{
if (this.gridEquipments.SelectedRows.Count < 1) return;
this.gridLogFiles.DataSource = null;
this.gridModelDetail.DataSource = null;
EisEquipment equipment = this.gridEquipments.SelectedRows[0].DataBoundItem as EisEquipment;
if (equipment == null) return;
this.Cursor = Cursors.WaitCursor;
this.Equipment = equipment;
LogServer logServer = this.cboxServer.SelectedItem as LogServer;
string path = string.Empty;
#region [ Model Details ]
// 모델 버전 정보
EisModelDetails[] modelDetails = this.GetModelDetails(equipment);
this.gridModelDetail.AutoBinding(modelDetails);
this.gridModelDetail.SetRowForeColor("LockState", $"LockState = 'BLOCKED'", Color.LightGray);
foreach (GridViewRowInfo row in this.gridModelDetail.Rows)
{
EisModelDetails item = row.DataBoundItem as EisModelDetails;
if (item == null) continue;
if (item.Version == equipment.Version)
{
row.IsSelected = true;
row.IsCurrent = true;
break;
}
}
// 모델 정보
EisModelInfo[] modelInfo = this.GetModelInfo(equipment);
if (modelInfo?.Length > 0)
{
this.tboxModelDescription.Text = modelInfo[0].Description;
}
#endregion
#region [ LogFiles ]
if (logServer.NetworkAccount.ContainsKey(equipment.LogServerIP)) //jhlim 20250202 jj
{
// Checking Local IP-Address
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
foreach (UnicastIPAddressInformation ip in nic.GetIPProperties().UnicastAddresses)
{
if (ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
if (ip.Address.ToString() == equipment.LogServerIP)
{
path = $@"{equipment.LogPath}\{equipment.EquipmentID}";
break;
}
}
}
}
// SMB (Server Message Block)
//if (string.IsNullOrEmpty(path) && this.chkUseSMB.Checked)
//{
// Account account = logServer.NetworkAccount[equipment.LogServerIP];
// int result = ExtensionAPI.ConnectRemoteServer(account.IPAddress, account.UserID, account.Password);
// if (result != 0 && result != 1219) { MessageBox.Show($@"네트워크 접근에 실패하였습니다. (Code:{result})"); return; }
// path = logServer.GetLogPath(equipment.LogServerIP, equipment.EquipmentID);
//}
if (string.IsNullOrEmpty(path) && this.chkUseSMB.Checked) //jhlim 20250202
{
Account account = logServer.NetworkAccount[equipment.LogServerIP];
object rtnObj = null;
// StpClientWrap 사용
//StpClientWrap.Initialize(equipment?.LogServerIP, "test", "daeduck!1");
//StpClientWrap.Connect();
var svrInfo = (DDUtilityApp.DATA.Account)GetNetworkAccount(equipment?.LogServerIP);
FtpsClient.Initialize(equipment?.LogServerIP, svrInfo.UserID, svrInfo.Password);
FtpsClient.Connect();
var remotePath = $"/{svrInfo.DefaultPath}/{equipment.EquipmentID}";
//var remotePath = $"{equipment.EquipmentID}";
// SFTP 파일 목록 가져오기
//rtnObj = StpClientWrap.GetSftpList(remotePath);
rtnObj = FtpsClient.GetFtpsList(remotePath);
if (rtnObj == null) return;
//StpClientWrap.IsDirectory( "/302304/THiRA_SECSGEM/HSMS")
//var hsmsEnabled = (StpClientWrap.IsDirExists( $"{remotePath}/THiRA_SECSGEM/HSMS"));
var hsmsEnabled = (FtpsClient.IsDirExists($"{remotePath}/THiRA_SECSGEM/HSMS"));
if (hsmsEnabled == false)
{
if (tabControl1.TabPages.Contains(tabPage4))
{
tabControl1.TabPages.Remove(tabPage4);
}
}
else
{
if (!tabControl1.TabPages.Contains(tabPage4))
{
tabControl1.TabPages.Add(tabPage4);
}
}
this.gridLogFiles.AutoBinding(GetFtpslogFiles(rtnObj));
// 연결 종료 //jhlim 20250202
//StpClientWrap.Disconnect();
FtpsClient.Disconnect();
}
else if (string.IsNullOrEmpty(path) == false)
{
// 로그 파일 목록
DirectoryInfo directory = new DirectoryInfo(path);
if (directory.Exists == false)
{
MessageBox.Show($@"폴더가 존재하지 않습니다" + Environment.NewLine + Environment.NewLine + $@"Path: {path}");
return;
}
LogFile[] logFiles = directory.GetFiles().ToClass<LogFile>().OrderByDescending(x => x.Name).ToArray();
this.gridLogFiles.AutoBinding(logFiles);
}
}
else
{
path = $@"{equipment.LogPath}\{equipment.EquipmentID}";
}
this.rstatus1.Text = path;
if (string.IsNullOrEmpty(path)) return;
#endregion
//// 로그 파일 목록
//DirectoryInfo directory = new DirectoryInfo(path);
//if (directory.Exists == false)
//{
// MessageBox.Show($@"폴더가 존재하지 않습니다" + Environment.NewLine + Environment.NewLine + $@"Path: {path}");
// return;
//}
//LogFile[] logFiles = directory.GetFiles().ToClass<LogFile>().OrderByDescending(x => x.Name).ToArray();
//this.gridLogFiles.AutoBinding(logFiles);
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
finally
{
this.Cursor = Cursors.Default;
}
}
private void GridEquipments_CellDoubleClick(object sender, GridViewCellEventArgs e)
{
try
@@ -768,7 +682,7 @@ namespace DDUtilityApp.LOGPARSER
grid.AddColumn("Length");
grid.AddColumn("LastWriteTime");
grid.AddContextMenu("");
//grid.AddContextMenu("");
//grid.AddContextMenu("Open Log", GridEquipments_OpenWindows);
}
@@ -813,28 +727,56 @@ namespace DDUtilityApp.LOGPARSER
/// <param name="e"></param>
private void Grid_CellDoubleClick(object sender, GridViewCellEventArgs e)
{
RadGridView gd = sender.GetType().Name.Contains("GridDataCellElement") ?
((GridDataCellElement)sender)?.RowElement?.GridControl : (GridViewEx)sender;
try
{
List<string> downfiles = new List<string>();
foreach (GridViewRowInfo row in gd.SelectedRows)
{
LogFile item = row.DataBoundItem as LogFile;
var fullPath = item.FullName;
string destPath = GlobalVariable.Instance.DownloadPath;
string destPath = Path.Combine(GlobalVariable.Instance.DownloadPath, this.Equipment.EquipmentID);
if (System.IO.Directory.Exists(destPath) == false) System.IO.Directory.CreateDirectory(destPath);
string destFileName = $@"{destPath}{System.IO.Path.GetFileName(fullPath)}";
FtpsClient.DownloadFtpsFile(fullPath, destFileName);
downfiles.Add(destFileName);
RadGridView grid = sender as RadGridView;
if (grid == null && sender.GetType() == typeof(GridDataCellElement))
{
GridDataCellElement element = sender as GridDataCellElement;
grid = element.RowElement.GridControl;
}
if (grid == null) return;
if (grid == this.gridHsms) destPath = Path.Combine(destPath, "HSMS");
else if (grid == this.gridWorkflow) destPath = Path.Combine(destPath, "Workflow");
if (System.IO.Directory.Exists(destPath) == false) System.IO.Directory.CreateDirectory(destPath);
List<string> downfiles = new List<string>();
foreach (GridViewRowInfo row in grid.SelectedRows)
{
LogFile logFile = row.DataBoundItem as LogFile;
string destFileName = Path.Combine(destPath, logFile.FileName);
switch (this.Account.Access)
{
case AccessType.SMB:
{ }
break;
case AccessType.FTPS:
{
FtpsClient.DownloadFtpsFile(logFile.FullName, destFileName);
downfiles.Add(destFileName);
logFile.DestFullName = destFileName;
}
break;
case AccessType.SFTP:
{
StpClientWrap.DownloadSftpFile(logFile.FullName, destFileName);
downfiles.Add(destFileName);
logFile.DestFullName = destFileName;
}
break;
case AccessType.FTP:
{ }
break;
}
}
MessageBox.Show($"{gd.SelectedRows.Count}개의 파일을 저장하였습니다.");
//System.Diagnostics.Process.Start($"explorer.exe", $"/select,{argument}");
foreach(string command in downfiles)
System.Diagnostics.Process.Start(command);
//MessageBox.Show($"{grid.SelectedRows.Count}개의 파일을 저장하였습니다.");
foreach (string file in downfiles)
System.Diagnostics.Process.Start(file);
}
catch (Exception ex)
{
@@ -1017,7 +959,6 @@ namespace DDUtilityApp.LOGPARSER
logServer.NetworkAccount.Add("192.168.7.219", new Account("192.168.7.219", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
//logServer.NetworkAccount.Add("192.168.7.150", new Account("192.168.7.150", "T001084@DAEDUCK.COM", "daeduck!1", @"Vol2\EIS서버\"));
// B1 (Multi-NIC)
logServer.NetworkAccount.Add("192.168.115.214", new Account("192.168.7.214", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.115.215", new Account("192.168.7.215", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.115.216", new Account("192.168.7.216", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
@@ -1031,7 +972,6 @@ namespace DDUtilityApp.LOGPARSER
logServer.NetworkAccount.Add("192.168.235.218", new Account("192.168.7.218", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.235.219", new Account("192.168.7.219", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
// B1.PLC
logServer.NetworkAccount.Add("192.168.113.231", new Account("192.168.113.231", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.113.232", new Account("192.168.113.232", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.113.233", new Account("192.168.113.233", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
@@ -1046,6 +986,10 @@ namespace DDUtilityApp.LOGPARSER
logServer.NetworkAccount.Add("192.168.143.233", new Account("192.168.143.233", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.143.235", new Account("192.168.143.235", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
// B4, MTV
logServer.NetworkAccount.Add("192.168.163.232", new Account("192.168.163.232", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.173.232", new Account("192.168.173.232", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.FTPAddress = "192.168.7.208";
logServer.FTPPort = 7000;
logServer.FTPUserID = "anonymous";
@@ -1057,10 +1001,11 @@ namespace DDUtilityApp.LOGPARSER
#region [ EIS.B2 ]
logServer = new LogServer("EIS.B2");
logServer.DBConnectionString = $@"server=192.168.8.217;database=EIS;uid=EIS_Service;pwd=Yi^d!3dqpc%m;";
logServer.DBConnectionString = $@"server=192.168.8.214;database=EIS;uid=EIS_Service;pwd=Yi^d!3dqpc%m;";
logServer.DBGetEquipments = sbEquipments.ToString();
logServer.DBGetModelDetails = sbModelDetails.ToString();
logServer.DBGetModelInfo = sbModelInfo.ToString();
logServer.NetworkAccount.Add("192.168.8.215", new Account("192.168.8.215", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.8.216", new Account("192.168.8.216", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
logServer.NetworkAccount.Add("192.168.8.217", new Account("192.168.8.217", "loguser", "Daeduck!1", @"EISLog", AccessType.FTPS));
@@ -1232,7 +1177,7 @@ namespace DDUtilityApp.LOGPARSER
foreach (LogFile logFile in logFiles)
{
if (string.Compare(item.FullName, logFile.FullName, true) == 0)
if (string.Compare(item.FileName, logFile.FileName, true) == 0)
{
if (current == null)
{
@@ -1365,9 +1310,7 @@ namespace DDUtilityApp.LOGPARSER
.Select(item => new LogFile
{
Account = this.Account,
Name = Path.GetFileNameWithoutExtension(item.Name),
FullName = item.FullName,
Extension = Path.GetExtension(item.Name),
Length = item.Length,
CreationTime = item.CreationTime,
LastAccessTime = item.LastAccessTime,
@@ -1390,13 +1333,11 @@ namespace DDUtilityApp.LOGPARSER
.Select(item => new LogFile
{
Account = this.Account,
Name = Path.GetFileNameWithoutExtension(item.Name),
FullName = item.FullName,
Extension = Path.GetExtension(item.Name),
Length = item.Size,
CreationTime = item.Modified,
LastAccessTime = item.Modified,
LastWriteTime = item.Modified
CreationTime = item.Created.ToLocalTime(),
LastAccessTime = item.Modified.ToLocalTime(),
LastWriteTime = item.Modified.ToLocalTime()
})
.OrderByDescending(x => x.Name)
.ToArray();
@@ -1415,9 +1356,7 @@ namespace DDUtilityApp.LOGPARSER
.Select(item => new LogFile
{
Account = this.Account,
Name = Path.GetFileNameWithoutExtension(item.Name),
FullName = item.FullName,
Extension = Path.GetExtension(item.Name),
Length = item.Length,
CreationTime = item.LastAccessTime,
LastAccessTime = item.LastAccessTime,
@@ -1440,9 +1379,7 @@ namespace DDUtilityApp.LOGPARSER
.Select(item => new LogFile
{
Account = this.Account,
Name = Path.GetFileNameWithoutExtension(item.Name),
FullName = item.FullName,
Extension = Path.GetExtension(item.Name),
Length = item.Size,
CreationTime = item.Modified,
LastAccessTime = item.Modified,

View File

@@ -34,14 +34,14 @@ namespace DDUtilityApp.LOGPARSER
private bool IsLogFolderOpen { get; set; } = false;
private XLogger Logger { get; set; } = null;
#endregion
#region [ Properties ] ------------------------------------------------
private bool RadGridControlKey { get; set; } = false;
private Account Account { get; set; } = null;
private StandardCollection StandardCollection { get; set; } = new StandardCollection();
public LogParser LogParser
@@ -77,6 +77,8 @@ namespace DDUtilityApp.LOGPARSER
public FrmLogParser()
{
InitializeComponent();
XLogger.Instance = new XLogger("LogViewer");
this.SetLayout();
this.SetEventHandler();
@@ -254,7 +256,7 @@ namespace DDUtilityApp.LOGPARSER
switch (keyData)
{
case Keys.F1:
Process.Start($"http://192.168.7.221:8081/");
Process.Start("IEXPLORE.EXE", "http://pms.e1soft.co.kr:8090/Deploy/eqview/");
break;
case Keys.F2:
this.Location = new Point(0, 0);
@@ -302,7 +304,10 @@ namespace DDUtilityApp.LOGPARSER
{
ListViewItem lviewItem = this.lviewFiles.Items.Add(Path.GetFileName(filePath));
lviewItem.Checked = true;
lviewItem.Tag = filePath;
LogFile logFile = new LogFile(filePath);
logFile.Account = new Account();
logFile.Account.Access = AccessType.LOCAL;
lviewItem.Tag = logFile;
}
this.tboxEISInfo01.Clear();
@@ -359,8 +364,10 @@ namespace DDUtilityApp.LOGPARSER
int index = -1;
index = this.lviewFiles.SelectedItems[0].Index;
LogFile logFile = this.lviewFiles.Items[index].Tag as LogFile;
if (logFile == null) return;
this.tboxFilename.Text = Path.GetFileName(logFile.FullName);
this.tboxFilename.Text = logFile.FileName;
this.tboxFilename.Tag = logFile;
if (string.IsNullOrEmpty(this.tboxFilename.Text) == false && this.tboxFilename.Text.Length > 6)
{
this.tboxFilename.SelectionStart = this.tboxFilename.Text.Length - 6;
@@ -457,28 +464,25 @@ namespace DDUtilityApp.LOGPARSER
{
try
{
LogFile logFile = this.tboxFilename.Tag as LogFile;
string fileName = this.tboxFilename.Text;
if (string.IsNullOrEmpty(fileName)) return;
foreach (ListViewItem item in this.lviewFiles.Items)
if (string.Compare(item.Text, fileName, true) == 0) return;
if (logFile == null)
LogFile srcLogFile = this.tboxFilename.Tag as LogFile;
if (srcLogFile == null)
{
if (this.lviewFiles.Items.Count < 1) return;
LogFile src = this.lviewFiles.Items[0].Tag as LogFile;
if (src != null)
{
string path = Path.GetDirectoryName(src.FullName);
string fullName = Path.Combine(path, fileName);
logFile = new LogFile(fullName);
logFile.Account = src.Account;
}
srcLogFile = this.lviewFiles.Items[0].Tag as LogFile;
if (srcLogFile == null) return;
}
ListViewItem lviewItem = this.lviewFiles.Items.Add(fileName);
lviewItem.Tag = logFile;
string fullName = Path.Combine(srcLogFile.DirectoryName, fileName);
LogFile newLogFile = new LogFile(fullName) { Account = srcLogFile.Account };
ListViewItem lviewItem = this.lviewFiles.Items.Add(newLogFile.FileName);
lviewItem.Tag = newLogFile;
lviewItem.Checked = true;
}
catch (Exception ex)
@@ -520,7 +524,7 @@ namespace DDUtilityApp.LOGPARSER
this.Cursor = Cursors.WaitCursor;
System.GC.Collect();
this.Parsing();
this.DownLoad_Parsing();
StandardData[] array = this.Filtering(this.StandardCollection.ToArray());
this.grid.AutoBinding(array);
@@ -570,14 +574,15 @@ namespace DDUtilityApp.LOGPARSER
{
if (this.LogParser == null) return;
List<LogFile> lstFileNames = new List<LogFile>();
List<LogFile> lstLogFile = new List<LogFile>();
foreach (ListViewItem item in this.lviewFiles.Items)
{
if (item.Tag != null && item.Tag.GetType() == typeof(LogFile))
lstFileNames.Add((LogFile)item.Tag);
lstLogFile.Add((LogFile)item.Tag);
}
LogFile[] logfiles = this.LogParser.FileSelector(this, lstFileNames.ToArray());
this.Account = this.LogParser.Account;
// LogPaser > FrmEqSelector
LogFile[] logfiles = this.LogParser.FileSelector(this, lstLogFile.ToArray());
if (logfiles == null || logfiles.Length < 1) return;
if (this.chkAutoClear.Checked) this.BtnFileClear_Click(this.btnFileClear, new EventArgs());
@@ -599,7 +604,7 @@ namespace DDUtilityApp.LOGPARSER
foreach (LogFile logfile in logfiles)
{
this.tboxFilename.Tag = logfile;
this.tboxFilename.Text = Path.GetFileName(logfile.FullName);
this.tboxFilename.Text = logfile.FileName;
this.BtnFileAdd_Click(this.btnFileAdd, new EventArgs());
}
this.tboxFilename.Tag = null;
@@ -793,7 +798,7 @@ namespace DDUtilityApp.LOGPARSER
string propertyName = values[0].Trim();
string valueB = values[1].Trim().Replace("'", "");
string valueA = data.PropertyGet(propertyName);
string valueA = data.PropertyGet(propertyName).ToString();
if (valueA != valueB) flag = false;
}
@@ -810,25 +815,20 @@ namespace DDUtilityApp.LOGPARSER
{
try
{
List<string> lstFileName = new List<string>();
List<string> lstFullName = new List<string>();
foreach (ListViewItem lviewItem in this.lviewFiles.Items)
{
if (lviewItem.Checked == false) continue;
XLogger.Instance.Info(lviewItem.Text);
string sourceFileName = lviewItem.Tag as string;
string destPath = GlobalVariable.Instance.DownloadPath;
if (System.IO.Directory.Exists(destPath) == false) System.IO.Directory.CreateDirectory(destPath);
LogFile logFile = lviewItem.Tag as LogFile;
if (logFile == null) continue;
string destFileName = $@"{destPath}{System.IO.Path.GetFileName(sourceFileName)}";
if (this.chkDownload.Checked == false) System.IO.File.Copy(sourceFileName, destFileName, true);
sourceFileName = destFileName;
lstFileName.Add(sourceFileName);
lstFullName.Add(logFile.DestFullName);
}
foreach (string filename in lstFileName)
Process.Start(filename);
foreach (string fullName in lstFullName)
Process.Start(fullName);
}
catch (Exception ex)
{
@@ -958,6 +958,7 @@ namespace DDUtilityApp.LOGPARSER
private void BtnDeploySite_Click(object sender, EventArgs e)
{
Process.Start("IEXPLORE.EXE", "http://pms.e1soft.co.kr:8090/Deploy/eqview/");
Clipboard.SetText("http://pms.e1soft.co.kr:8090/Deploy/eqview/");
}
private void BtnTest01_Click(object sender, EventArgs e)
@@ -1298,7 +1299,7 @@ namespace DDUtilityApp.LOGPARSER
/// [CheckPoint] 로그파일을 로컬에 복제(다운로드)후, 데이터를 생성한다
/// </summary>
/// <returns></returns>
private StandardCollection Parsing()
private StandardCollection DownLoad_Parsing()
{
try
{
@@ -1309,7 +1310,6 @@ namespace DDUtilityApp.LOGPARSER
List<string> lstFileName = new List<string>();
string strTitle = string.Empty;
string destPath = string.Empty;
string destFileName = string.Empty;
// Process Unit: File
foreach (ListViewItem lviewItem in this.lviewFiles.Items) //jhlim 20250202
@@ -1318,6 +1318,7 @@ namespace DDUtilityApp.LOGPARSER
XLogger.Instance.Info(lviewItem.Text);
LogFile logFile = lviewItem.Tag as LogFile;
if (logFile == null) continue;
switch(logFile.Account.Access)
{
case AccessType.SMB:
@@ -1325,40 +1326,42 @@ namespace DDUtilityApp.LOGPARSER
FileInfo fileInfo = new FileInfo(logFile.FullName);
if (fileInfo.Exists == false) continue;
if (lviewItem.SubItems.Count < 2) lviewItem.SubItems.Add($"{((float)fileInfo.Length / 1024 / 1024).ToString("F2")} MB");
else lviewItem.SubItems[1].Text = $"{((float)fileInfo.Length / 1024 / 1024).ToString("F2")} MB";
logFile.Length = fileInfo.Length;
if (lviewItem.SubItems.Count < 2) lviewItem.SubItems.Add(logFile.GetFileSize());
else lviewItem.SubItems[1].Text = logFile.GetFileSize();
if (this.chkDownload.Checked)
{
destPath = Path.Combine(GlobalVariable.Instance.DownloadPath, this.Equipment.EquipmentID);
if (System.IO.Directory.Exists(destPath) == false) System.IO.Directory.CreateDirectory(destPath);
if (Directory.Exists(destPath) == false) Directory.CreateDirectory(destPath);
if (string.IsNullOrEmpty(strTitle)) strTitle = logFile.Name;
destFileName = $@"{destPath}{System.IO.Path.GetFileName(logFile.FullName)}";
if (string.IsNullOrEmpty(strTitle)) strTitle = this.Equipment.MesName;
logFile.DestFullName = Path.Combine(destPath, logFile.FileName);
if (logFile.FullName != destFileName)
System.IO.File.Copy(logFile.FullName, destFileName, true);
File.Copy(logFile.FullName, logFile.DestFullName, true);
}
}
break;
case AccessType.FTPS:
{
FtpsClient.Initialize(logFile.Account.IPAddress, logFile.Account.UserID, logFile.Account.Password);
if (FtpsClient._host != logFile.Account.IPAddress)
FtpsClient.Initialize(logFile.Account.IPAddress, logFile.Account.UserID, logFile.Account.Password);
FtpListItem ftpsFileInfo = FtpsClient.GetFileInfo(logFile.FullName);
if (ftpsFileInfo == null) continue;
if (lviewItem.SubItems.Count < 2) lviewItem.SubItems.Add($"{((float)ftpsFileInfo.Size / 1024 / 1024).ToString("F2")} MB");
else lviewItem.SubItems[1].Text = $"{((float)ftpsFileInfo.Size / 1024 / 1024).ToString("F2")} MB";
logFile.Length = ftpsFileInfo.Size;
if (lviewItem.SubItems.Count < 2) lviewItem.SubItems.Add(logFile.GetFileSize());
else lviewItem.SubItems[1].Text = logFile.GetFileSize();
if (this.chkDownload.Checked)
{
destPath = Path.Combine(GlobalVariable.Instance.DownloadPath, this.Equipment.EquipmentID);
if (System.IO.Directory.Exists(destPath) == false) System.IO.Directory.CreateDirectory(destPath);
if (Directory.Exists(destPath) == false) Directory.CreateDirectory(destPath);
if (string.IsNullOrEmpty(strTitle)) strTitle = logFile.Name;
destFileName = Path.Combine(destPath, $"{logFile.Name}{logFile.Extension}");
if (string.IsNullOrEmpty(strTitle)) strTitle = this.Equipment.MesName;
logFile.DestFullName = Path.Combine(destPath, logFile.FileName);
FtpsClient.DownloadFtpsFile(logFile.FullName, destFileName);
FtpsClient.DownloadFtpsFile(logFile.FullName, logFile.DestFullName);
}
}
break;
@@ -1366,9 +1369,18 @@ namespace DDUtilityApp.LOGPARSER
break;
case AccessType.FTP:
break;
case AccessType.LOCAL:
{
destPath = Path.Combine(GlobalVariable.Instance.DownloadPath, "Local");
if (Directory.Exists(destPath) == false) Directory.CreateDirectory(destPath);
logFile.DestFullName = Path.Combine(destPath, logFile.FileName);
System.IO.File.Copy(logFile.FullName, logFile.DestFullName, true);
}
break;
}
lstFileName.Add(destFileName);
lstFileName.Add(logFile.DestFullName);
}
if (!string.IsNullOrEmpty(this.tboxEISInfo04.Text)) this.LogParser.ModelID = this.tboxEISInfo04.Text;
@@ -1382,7 +1394,7 @@ namespace DDUtilityApp.LOGPARSER
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex);
XLogger.Instance.Fatal(ex, true);
return this.StandardCollection;
}
}

View File

@@ -566,7 +566,7 @@ namespace DDUtilityApp.LOGPARSER
string propertyName = values[0].Trim();
string valueB = values[1].Trim().Replace("'", "");
string valueA = data.PropertyGet(propertyName);
string valueA = data.PropertyGet(propertyName).ToString();
if (valueA != valueB) flag = false;
}

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http.Headers;
using System.Reflection;
using System.Text;
using System.Windows.Forms;
@@ -74,7 +75,7 @@ namespace DDUtilityApp.LOGPARSER.PARSER
}
catch (Exception ex01)
{
XLogger.Instance.Fatal(ex01);
XLogger.Instance.Fatal(ex01, true);
}
if (reader != null) reader.Close();
@@ -98,6 +99,7 @@ namespace DDUtilityApp.LOGPARSER.PARSER
Parser parser = null;
try
{
// 0.LogLevel 1.DateTime 2.Server
if (string.IsNullOrWhiteSpace(strLine)) return parser;
if (strLine.Length < this.LogDTime.Length) return parser;
string[] strValues = this.GetHeaderValues(strLine);
@@ -131,6 +133,10 @@ namespace DDUtilityApp.LOGPARSER.PARSER
{
parser = this.MES_Parser;
}
else if (strValues[2].Trim() == "TRACE")
{
return null;
}
else if (strValues[2].Trim() == "ADD" || strValues[1].Trim() == "DISPOSE")
{
parser = this.TID_Parser;
@@ -216,7 +222,7 @@ namespace DDUtilityApp.LOGPARSER.PARSER
try
{
MemoryStream stream = new MemoryStream(text.ConvertBytes());
StreamReader reader = new StreamReader(stream);
StreamReader reader = new StreamReader(stream, Encoding.Default);
SECSItem parent = null;
SECSItem item = null;
@@ -373,16 +379,21 @@ namespace DDUtilityApp.LOGPARSER.PARSER
FrmEqSelector dlg = null;
try
{
List<LogFile> logFiles = new List<LogFile>();
logFiles.AddRange(args);
List<LogFile> lstLogFile = new List<LogFile>();
lstLogFile.AddRange(args);
dlg = new FrmEqSelector();
dlg.Owner = sender;
dlg.Size = sender.Size;
dlg.StartPosition = FormStartPosition.CenterParent;
dlg.StartPosition = FormStartPosition.Manual;
int nWidth = sender.Width - 10;
int nHeight = sender.Height - 48;
int nLeft = sender.Left + ((sender.Width - nWidth) / 2);
int nTop = Math.Max(0, sender.Top) + ((sender.Height - nHeight)) - 10;
dlg.Size = new System.Drawing.Size(nWidth, nHeight);
dlg.Location = new System.Drawing.Point(nLeft, nTop);
dlg.ServerName = this.ServerName;
dlg.Equipment = sender.Equipment;
dlg.SelectedLogFiles = logFiles.ToArray();
dlg.Equipment = sender.Equipment == null ? new EisEquipment() { EquipmentID = this.EquipmentID, Server = new LogServer(this.ServerName)} : sender.Equipment;
dlg.SelectedLogFiles = lstLogFile.ToArray();
DialogResult dlgResult = dlg.ShowDialog();
if (dlgResult != DialogResult.OK) return null;
@@ -598,11 +609,13 @@ namespace DDUtilityApp.LOGPARSER.PARSER
{
if (this.SECSDefine != null) this.SECSDefine.SetInformation(rootSECS);
this.LogString_Append(rootSECS.ToFullString());
string ceid = string.Empty;
// CEID
secsItem = rootSECS.GetItemByName("CEID").FirstOrDefault();
if (secsItem == null && rootSECS.ChildItems.Count == 3) secsItem = rootSECS[1];
standardData.Value = $"CEID: {secsItem.Value}" + (string.IsNullOrEmpty(secsItem.Description) ? "" : $" {secsItem.Description}");
ceid = secsItem.Value;
// LOTID
secsItems = rootSECS.GetItemByName("LOT_ID", "LOTID", "LotID", "LEFT_LOTID", "RIGHT_LOTID");
@@ -664,6 +677,15 @@ namespace DDUtilityApp.LOGPARSER.PARSER
standardData.ModuleID += item.Value;
}
// 308:ModuleIn, 309:ModuleOut 'Name' 항목을 추가한다.
if (new string[] { "308", "309" }.Contains(ceid))
secsItems = rootSECS.GetItemByName("NAME");
foreach (SECSItem item in secsItems)
{
if (!string.IsNullOrEmpty(standardData.ModuleID)) standardData.HostPanelID += " ";
standardData.ModuleID += item.Value;
}
this.SendStandardData.Add(standardData.SystemByte, standardData);
}

View File

@@ -112,8 +112,8 @@ namespace DDUtilityApp.LOGPARSER.PARSER
string fileName = string.Empty;
if (args != null && args.Length > 0)
{
directoryName = Path.GetDirectoryName(args[0].Name);
fileName = Path.GetFileName(args[0].Name);
directoryName = args[0].DirectoryName;
fileName = args[0].FileName;
}
OpenFileDialog dlg = new OpenFileDialog();

View File

@@ -0,0 +1,285 @@
namespace DDUtilityApp.MESDOWNLOADER
{
partial class FrmServerLog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel();
this.pnlAPList = new System.Windows.Forms.FlowLayoutPanel();
this.pnlCommand = new System.Windows.Forms.Panel();
this.btnDownPathOpen = new System.Windows.Forms.Button();
this.btnDownPathChange = new System.Windows.Forms.Button();
this.btnRefresh = new System.Windows.Forms.Button();
this.tboxDownPath = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.cboxServer = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.treeFolder = new System.Windows.Forms.TreeView();
this.gridFiles = new JWH.CONTROL.GridViewEx();
this.chkMerge = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.panel1.SuspendLayout();
this.pnlCommand.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridFiles)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridFiles.MasterTemplate)).BeginInit();
this.SuspendLayout();
//
// 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, 3);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.panel1);
this.splitContainer1.Panel1MinSize = 94;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(987, 569);
this.splitContainer1.SplitterDistance = 94;
this.splitContainer1.TabIndex = 0;
//
// panel1
//
this.panel1.Controls.Add(this.pnlAPList);
this.panel1.Controls.Add(this.pnlCommand);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(987, 94);
this.panel1.TabIndex = 0;
//
// pnlAPList
//
this.pnlAPList.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlAPList.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.pnlAPList.Location = new System.Drawing.Point(825, 0);
this.pnlAPList.Name = "pnlAPList";
this.pnlAPList.Padding = new System.Windows.Forms.Padding(0, 10, 0, 0);
this.pnlAPList.Size = new System.Drawing.Size(162, 94);
this.pnlAPList.TabIndex = 1;
//
// pnlCommand
//
this.pnlCommand.Controls.Add(this.chkMerge);
this.pnlCommand.Controls.Add(this.btnDownPathOpen);
this.pnlCommand.Controls.Add(this.btnDownPathChange);
this.pnlCommand.Controls.Add(this.btnRefresh);
this.pnlCommand.Controls.Add(this.tboxDownPath);
this.pnlCommand.Controls.Add(this.label2);
this.pnlCommand.Controls.Add(this.cboxServer);
this.pnlCommand.Controls.Add(this.label1);
this.pnlCommand.Dock = System.Windows.Forms.DockStyle.Left;
this.pnlCommand.Location = new System.Drawing.Point(0, 0);
this.pnlCommand.Name = "pnlCommand";
this.pnlCommand.Size = new System.Drawing.Size(825, 94);
this.pnlCommand.TabIndex = 0;
//
// btnDownPathOpen
//
this.btnDownPathOpen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnDownPathOpen.Location = new System.Drawing.Point(637, 63);
this.btnDownPathOpen.Name = "btnDownPathOpen";
this.btnDownPathOpen.Size = new System.Drawing.Size(90, 23);
this.btnDownPathOpen.TabIndex = 6;
this.btnDownPathOpen.Text = "Open";
this.btnDownPathOpen.UseVisualStyleBackColor = true;
//
// btnDownPathChange
//
this.btnDownPathChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnDownPathChange.Location = new System.Drawing.Point(637, 38);
this.btnDownPathChange.Name = "btnDownPathChange";
this.btnDownPathChange.Size = new System.Drawing.Size(90, 23);
this.btnDownPathChange.TabIndex = 5;
this.btnDownPathChange.Text = "Change";
this.btnDownPathChange.UseVisualStyleBackColor = true;
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRefresh.Location = new System.Drawing.Point(637, 11);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(90, 23);
this.btnRefresh.TabIndex = 4;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.UseVisualStyleBackColor = true;
//
// tboxDownPath
//
this.tboxDownPath.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tboxDownPath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tboxDownPath.Location = new System.Drawing.Point(136, 38);
this.tboxDownPath.Multiline = true;
this.tboxDownPath.Name = "tboxDownPath";
this.tboxDownPath.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.tboxDownPath.Size = new System.Drawing.Size(495, 47);
this.tboxDownPath.TabIndex = 3;
//
// label2
//
this.label2.Location = new System.Drawing.Point(10, 38);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(120, 23);
this.label2.TabIndex = 2;
this.label2.Text = "로컬디렉토리 : ";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cboxServer
//
this.cboxServer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cboxServer.FormattingEnabled = true;
this.cboxServer.Location = new System.Drawing.Point(136, 12);
this.cboxServer.Name = "cboxServer";
this.cboxServer.Size = new System.Drawing.Size(495, 20);
this.cboxServer.TabIndex = 1;
//
// label1
//
this.label1.Location = new System.Drawing.Point(10, 10);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(120, 23);
this.label1.TabIndex = 0;
this.label1.Text = "Server : ";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.treeFolder);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.gridFiles);
this.splitContainer2.Size = new System.Drawing.Size(987, 471);
this.splitContainer2.SplitterDistance = 328;
this.splitContainer2.TabIndex = 0;
//
// treeFolder
//
this.treeFolder.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeFolder.Location = new System.Drawing.Point(0, 0);
this.treeFolder.Name = "treeFolder";
this.treeFolder.Size = new System.Drawing.Size(328, 471);
this.treeFolder.TabIndex = 0;
//
// gridFiles
//
this.gridFiles.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.gridFiles.ColumnResizeKey = System.Windows.Forms.Keys.F6;
this.gridFiles.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridFiles.Location = new System.Drawing.Point(0, 0);
//
//
//
this.gridFiles.MasterTemplate.ViewDefinition = tableViewDefinition1;
this.gridFiles.Name = "gridFiles";
//
//
//
this.gridFiles.RootElement.ControlBounds = new System.Drawing.Rectangle(0, 0, 240, 150);
this.gridFiles.Size = new System.Drawing.Size(655, 471);
this.gridFiles.TabIndex = 0;
//
// chkMerge
//
this.chkMerge.AutoSize = true;
this.chkMerge.Location = new System.Drawing.Point(734, 15);
this.chkMerge.Name = "chkMerge";
this.chkMerge.Size = new System.Drawing.Size(60, 16);
this.chkMerge.TabIndex = 7;
this.chkMerge.Text = "Merge";
this.chkMerge.UseVisualStyleBackColor = true;
//
// FrmServerLog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(993, 575);
this.Controls.Add(this.splitContainer1);
this.Name = "FrmServerLog";
this.Padding = new System.Windows.Forms.Padding(3);
this.Text = "FrmServerLog";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.pnlCommand.ResumeLayout(false);
this.pnlCommand.PerformLayout();
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridFiles.MasterTemplate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridFiles)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.FlowLayoutPanel pnlAPList;
private System.Windows.Forms.Panel pnlCommand;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tboxDownPath;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox cboxServer;
private System.Windows.Forms.Button btnDownPathOpen;
private System.Windows.Forms.Button btnDownPathChange;
private System.Windows.Forms.Button btnRefresh;
private System.Windows.Forms.TreeView treeFolder;
private JWH.CONTROL.GridViewEx gridFiles;
private System.Windows.Forms.CheckBox chkMerge;
}
}

View File

@@ -0,0 +1,589 @@
using DDUtilityApp.LOGPARSER.DATA;
using JWH;
using JWH.NETWORK;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Telerik.WinControls.UI;
namespace DDUtilityApp.MESDOWNLOADER
{
public partial class FrmServerLog: Form
{
private DataSet DSSetting { get; set; } = null;
private DataTable DTFileInfo { get; set; } = null;
public FrmServerLog()
{
InitializeComponent();
this.SetLayout();
this.SetEventHandler();
}
private void SetLayout()
{
try
{
#if DEBUG
this.Text = $"ServerLog Download - Ver. {Application.ProductVersion} : DEBUG";
#else
this.Text = $"ServerLog Download - Ver. {Application.ProductVersion}";
#endif
this.Font = new Font("돋움체", 9);
this.CreateDTFileInfo();
this.SetCboxServer();
this.GridFiles_Setting();
this.tboxDownPath.ReadOnly = true;
this.tboxDownPath.Text = GlobalVariable.Instance.DownloadPathServerLog;
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
private void SetEventHandler()
{
try
{
this.cboxServer.SelectedIndexChanged += this.CboxServer_SelectedIndexChanged;
this.btnRefresh.Click += this.BtnRefresh_Click;
this.btnDownPathChange.Click += this.BtnDownPathChange_Click;
this.btnDownPathOpen.Click += this.BtnDownPathOpen_Click;
this.treeFolder.AfterSelect += this.TreeFolder_AfterSelect;
this.gridFiles.CellDoubleClick += this.GridFiles_CellDoubleClick;
this.gridFiles.KeyDown += this.GridFiles_KeyDown;
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
#region [ Controls ] --------------------------------------------------
/// <summary>
/// 서버선택
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CboxServer_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
this.GridFiles_Setting();
if (this.DSSetting == null || this.DSSetting.Tables.Contains("Item") == false) return;
int value = (int)this.cboxServer.SelectedValue;
var query = from dtServer in DSSetting.Tables["Server"].AsEnumerable()
join dtItem in DSSetting.Tables["Item"].AsEnumerable()
on dtServer.Field<int>("Server_Id") equals dtItem.Field<int>("Server_Id")
where dtItem.Field<int>("Server_Id") == value
select new
{
name = dtServer.Field<string>("name"),
nameap = dtItem.Field<string>("name"),
url = dtItem.Field<string>("url"),
dir = dtItem.Field<string>("dir"),
conkey = dtItem.Field<string>("conkey"),
Server_Id = dtItem.Field<int>("Server_Id"),
};
foreach (Control control in this.pnlAPList.Controls)
control.Dispose();
this.pnlAPList.Controls.Clear();
int index = 0;
foreach (var item in query)
{
string[] splitIP = item.url.Split('.');
CheckBox chk = new CheckBox()
{
Text = $"{item.nameap} ({splitIP[splitIP.Length - 1]})",
AutoSize = true,
Checked = true,
Padding = new Padding(5, 3, 3, 5),
Margin = new Padding(0),
Tag = item.nameap,
};
index++;
this.pnlAPList.Controls.Add(chk);
}
this.treeFolder.Nodes.Clear();
TreeNode rootNode = this.treeFolder.Nodes.Add("ROOT");
this.treeFolder.SelectedNode = rootNode;
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
/// <summary>
/// 현재 (Treeview.SelectedNode)경로의 파일목록 갱신
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnRefresh_Click(object sender, EventArgs e)
{
try
{
this.Cursor = Cursors.WaitCursor;
this.SuspendLayout();
this.DTFileInfo.Rows.Clear();
this.gridFiles.DataSource = null;
int server_Id = (int)this.cboxServer.SelectedValue;
TreeNode currentNode = this.treeFolder.SelectedNode;
if (currentNode == null) return;
string subPath = currentNode.Tag as string;
foreach (Control control in this.pnlAPList.Controls)
{
CheckBox chk = control as CheckBox;
if (chk == null || chk.Checked == false) continue;
string nameap = control.Tag as string;
if (string.IsNullOrEmpty(nameap)) continue;
DataRow[] rows = this.DSSetting.Tables["Item"].Select($"Server_Id='{server_Id}' AND name='{nameap}'");
foreach (DataRow row in rows)
{
try
{
string url = row["url"] as string;
string dir = row["dir"] as string;
string conkey = row["conkey"] as string;
string userId = this.GetUserIdFromConkey(conkey);
string password = this.GetPasswordFromConkey(conkey);
string currentPath = string.IsNullOrEmpty(subPath) ? dir : System.IO.Path.Combine(dir, subPath);
FtpsClient.Initialize(url, userId, password);
var files = FtpsClient.GetFtpsList(currentPath);
foreach (var file in files)
{
DataRow rowFile = this.DTFileInfo.NewRow();
rowFile["nameap"] = nameap;
rowFile["Name"] = file.Name;
rowFile["FileName"] = file.Name;
rowFile["Size"] = this.GetFileSize(file.Size, FileSizeType.MB);
rowFile["Modified"] = file.Modified.ToLocalTime();
rowFile["Type"] = file.Type;
rowFile["url"] = url;
rowFile["dir"] = dir;
rowFile["subpath"] = subPath;
rowFile["userId"] = userId;
rowFile["password"] = password;
this.DTFileInfo.Rows.Add(rowFile);
}
}
catch
{
chk.Checked = false;
chk.Enabled = false;
}
}
}
this.DTFileInfo.DefaultView.RowFilter = $"Type='Directory'";
this.DTFileInfo.DefaultView.Sort = "FileName ASC";
foreach (DataRow row in this.DTFileInfo.DefaultView.ToTable(true, "FileName").Rows)
{
string fileName = row["FileName"] as string;
if (string.IsNullOrEmpty(fileName)) continue;
if (currentNode.Nodes.ContainsKey(fileName)) continue;
TreeNode node = currentNode.Nodes.Add(fileName, fileName);
node.Tag = string.IsNullOrEmpty(currentNode.Tag as string) ? fileName : System.IO.Path.Combine(currentNode.Tag as string, fileName);
}
currentNode.Expand();
this.DTFileInfo.DefaultView.RowFilter = "Type='File'";
this.DTFileInfo.DefaultView.Sort = "Modified DESC";
this.gridFiles.DataSource = this.DTFileInfo;
this.gridFiles.BestFitColumns();
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
finally
{
this.ResumeLayout();
this.Cursor = Cursors.Default;
}
}
/// <summary>
/// 로그파일 다운로드 폴더설정
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnDownPathChange_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrEmpty(this.tboxDownPath.Text))
this.tboxDownPath.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
using (FolderBrowserDialog dlg = new FolderBrowserDialog())
{
dlg.SelectedPath = this.tboxDownPath.Text;
if (dlg.ShowDialog() == DialogResult.OK)
{
this.tboxDownPath.Text = dlg.SelectedPath;
GlobalVariable.Instance.DownloadPathServerLog = this.tboxDownPath.Text;
}
}
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
/// <summary>
/// 로그파일 다운로드 폴더열기
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnDownPathOpen_Click(object sender, EventArgs e)
{
try
{
string path = System.IO.Path.Combine(this.tboxDownPath.Text, this.cboxServer.Text);
Process.Start("explorer.exe", path);
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
private void TreeFolder_AfterSelect(object sender, TreeViewEventArgs e)
{
this.BtnRefresh_Click(this.btnRefresh, new EventArgs());
}
#endregion
#region [ GridFiles ] -------------------------------------------------
private void GridFiles_Setting()
{
try
{
this.gridFiles.SelectionMode = GridViewSelectionMode.FullRowSelect;
this.gridFiles.MultiSelect = true;
this.gridFiles.TableElement.RowHeight = 22;
this.gridFiles.Columns.Clear();
this.gridFiles.Columns.Add(new GridViewTextBoxColumn("nameap") { HeaderText = "Server", ReadOnly = true });
this.gridFiles.Columns.Add(new GridViewTextBoxColumn("Name") { ReadOnly=true, IsVisible = false });
this.gridFiles.Columns.Add(new GridViewTextBoxColumn("FileName") { ReadOnly = true });
this.gridFiles.Columns.Add(new GridViewTextBoxColumn("Size") { ReadOnly = true, TextAlignment = ContentAlignment.MiddleRight });
this.gridFiles.Columns.Add(new GridViewDateTimeColumn("Modified") { ReadOnly = true });
this.gridFiles.Columns.Add(new GridViewTextBoxColumn("Type") { ReadOnly = true });
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
private void GridFiles_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.KeyCode != Keys.Enter) return;
this.GridFiles_CellDoubleClick(this.gridFiles, null);
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
/// <summary>
/// FileDownload
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void GridFiles_CellDoubleClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
try
{
List<DataRow> rows = new List<DataRow>();
List<string> downloads = new List<string>();
if (e != null)
{
// 더블클릭된 파일 추가
DataRowView view = e.Row.DataBoundItem as DataRowView;
if (view != null && view.Row != null) rows.Add(view.Row);
}
else
{
// 선택된 파일들 추가
List<DataRow> rowsSRC = new List<DataRow>();
foreach(GridViewRowInfo row in this.gridFiles.SelectedRows)
{
DataRowView view = row.DataBoundItem as DataRowView;
if (view != null && view.Row != null) rowsSRC.Add(view.Row);
}
// 수정일자 정렬
foreach (DataRow row in rowsSRC.OrderBy(row => row.Field<DateTime>("Modified")))
rows.Add(row);
}
// 다운로드
bool hasZip = false;
using (ProgressForm frmProgress = new ProgressForm(rows.Count))
{
int countDown = 0;
frmProgress.Show();
frmProgress.UpdateProgress(string.Empty, countDown);
foreach(DataRow row in rows)
{
string nameap = row["nameap"] as string;
string fileName = row["FileName"] as string;
string url = row["url"] as string;
string dir = row["dir"] as string;
string subpath = row["subpath"] as string;
string userId = row["userId"] as string;
string password = row["password"] as string;
string fileNameDST = $"{nameap}_{fileName}";
string extension = System.IO.Path.GetExtension(fileNameDST);
if (string.Compare(extension, ".Zip", true) == 0) hasZip = true;
else if (string.Compare(extension, ".Log", false) != 0) fileNameDST += ".Log";
List<string> paths = new List<string>();
if (!string.IsNullOrEmpty(dir)) paths.Add(dir);
if (!string.IsNullOrEmpty(subpath)) paths.Add(subpath);
if (!string.IsNullOrEmpty(fileName)) paths.Add(fileName);
string pathSRC = System.IO.Path.Combine(paths.ToArray());
string pathDST = System.IO.Path.Combine(this.tboxDownPath.Text, this.cboxServer.Text, fileNameDST);
frmProgress.UpdateProgress($"{fileName}", countDown);
FtpsClient.Disconnect();
FtpsClient.Initialize(url, userId, password);
bool isSuccess = await Task.Run(() =>
FtpsClient.DownloadFtpsFile(pathSRC, pathDST)
);
countDown++;
if (isSuccess) downloads.Add(pathDST);
}
}
if (downloads.Count < 1)
{
MessageBox.Show($"다운로드된 파일이 없습니다.", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// FileMerge
if (this.chkMerge.Checked)
{
if (downloads.Count == 1)
{
string fileName = downloads[0];
if (hasZip)
{
string path = System.IO.Path.Combine(this.tboxDownPath.Text, this.cboxServer.Text, fileName);
string command = $"/select,{path}";
Process.Start($"explorer.exe", command);
}
else
{
string extension = System.IO.Path.GetExtension(fileName);
if (string.Compare(extension, ".Log", true) != 0)
System.IO.File.Move(fileName, fileName += ".log");
System.Diagnostics.Process.Start(fileName);
}
}
else
{
if (hasZip)
{
string path = System.IO.Path.Combine(this.tboxDownPath.Text, this.cboxServer.Text);
string command = $"/select,{path}";
Process.Start($"explorer.exe", path);
}
else
{
string fileName = Util.GetFileMerge(downloads);
string extension = System.IO.Path.GetExtension(fileName);
if (string.Compare(extension, ".Log", true) != 0)
System.IO.File.Move(fileName, fileName += ".log");
System.Diagnostics.Process.Start(fileName);
}
}
}
else
{
if (hasZip)
{
string path = System.IO.Path.Combine(this.tboxDownPath.Text, this.cboxServer.Text);
string command = $"/select,{path}";
Process.Start($"explorer.exe", path);
}
else
{
foreach (string download in downloads)
System.Diagnostics.Process.Start(download);
}
}
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
#endregion
/// <summary>
/// Server + File 저장테이블 생성
/// </summary>
/// <returns></returns>
private void CreateDTFileInfo()
{
try
{
this.DTFileInfo = new DataTable();
this.DTFileInfo.Columns.Add("nameap", typeof(string));
this.DTFileInfo.Columns.Add("Name", typeof(string));
this.DTFileInfo.Columns.Add("FileName", typeof(string));
this.DTFileInfo.Columns.Add("Size", typeof(string));
this.DTFileInfo.Columns.Add("Modified", typeof(DateTime));
this.DTFileInfo.Columns.Add("Type", typeof(string));
this.DTFileInfo.Columns.Add("url", typeof(string));
this.DTFileInfo.Columns.Add("dir", typeof(string));
this.DTFileInfo.Columns.Add("subpath", typeof(string));
this.DTFileInfo.Columns.Add("userId", typeof(string));
this.DTFileInfo.Columns.Add("password", typeof(string));
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
/// <summary>
/// XML 설정파일 로딩 및 CboxServer 셋팅
/// </summary>
private void SetCboxServer()
{
try
{
string srcFileName = ConfigurationManager.AppSettings["BULK_VIEWER"];
string myFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "DDUtility", "ViewList.xml");
if (!File.Exists(myFileName))
{
if (!File.Exists(srcFileName)) throw new FileNotFoundException($"Source file not found: {srcFileName}");
File.Copy(srcFileName, myFileName);
}
this.DSSetting = XmlToDsConverter.ConvertXmlToDataSet(myFileName);
if (this.DSSetting == null || this.DSSetting.Tables.Count < 1 || this.DSSetting.Tables.Contains("Server") == false)
{
MessageBox.Show("XML 데이터를 불러올 수 없습니다.", "오류", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
this.cboxServer.DropDownStyle = ComboBoxStyle.DropDownList;
this.cboxServer.DataSource = DSSetting.Tables["Server"];
this.cboxServer.DisplayMember = "name";
this.cboxServer.ValueMember = "Server_Id";
this.cboxServer.SelectedIndex = -1;
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
}
}
/// <summary>
/// conkey to Base64
/// </summary>
/// <param name="conkey"></param>
/// <returns></returns>
private string GetUserIdFromConkey(string conkey)
{
try
{
string value = Util.GetBase64(conkey);
string[] items = value.Split(':');
if (items == null || items.Length < 1) return string.Empty;
return items[0];
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
return string.Empty;
}
}
/// <summary>
/// conkey to Base64
/// </summary>
/// <param name="conkey"></param>
/// <returns></returns>
private string GetPasswordFromConkey(string conkey)
{
try
{
string value = Util.GetBase64(conkey);
string[] items = value.Split(':');
if (items == null || items.Length < 2) return string.Empty;
return items[1];
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex, true);
return string.Empty;
}
}
public string GetFileSize(long length, FileSizeType format = FileSizeType.Auto)
{
int index = 0;
int nFormat = (int)format;
double value = length;
for (index = 0; index < nFormat; index++)
{
if (format == FileSizeType.Auto && value < 1024) break;
value /= 1024;
}
return $"{value.ToString("N2")} {(FileSizeType)index}";
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -32,7 +32,7 @@ namespace DDUtilityApp.MESDOWNLOADER
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);
txtPath.Text = GlobalVariable.Instance.DownloadPathServerLog; //Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
SetGridView();
}
private void ServerLog_Resize(object sender, EventArgs e)
@@ -66,7 +66,7 @@ namespace DDUtilityApp.MESDOWNLOADER
{
// 선택한 경로를 텍스트 박스에 표시
txtPath.Text = folderDialog.SelectedPath;
GlobalVariable.Instance.MesDownloadPath = folderDialog.SelectedPath;
GlobalVariable.Instance.DownloadPathServerLog = folderDialog.SelectedPath;
}
}
}
@@ -366,8 +366,16 @@ namespace DDUtilityApp.MESDOWNLOADER
// 데이터 테이블 생성 후 바인딩
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]);
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]);
}
}

View File

@@ -33,13 +33,13 @@ namespace DDUtilityApp.MESDOWNLOADER
try
{
using (StreamWriter writer = new StreamWriter(mergedFilePath, false)) // false: 새 파일 생성
using (StreamWriter writer = new StreamWriter(mergedFilePath, false, Encoding.Default))
{
foreach (string file in filePaths)
{
if (File.Exists(file))
{
using (StreamReader reader = new StreamReader(file))
using (StreamReader reader = new StreamReader(file, Encoding.Default))
{
writer.Write(reader.ReadToEnd());
}

View File

@@ -28,38 +28,71 @@ namespace JWH.MONGODB
return item;
}
public static List<TraceCollection> GetCollectionData(string collectionName, DateTime dtStart, DateTime dtEnd, TraceCollection condition = null)
public static async void GetCollectionColumns(string collectionName)
{
MongoClient client = new MongoClient(ConnectionString);
IMongoDatabase database = client.GetDatabase(DatabaseName);
IMongoCollection<TraceCollection> collection = database.GetCollection<TraceCollection>(collectionName);
var collection = database.GetCollection<BsonDocument>(collectionName);
// # ALL Data
//var lst = collection.Find(_ => true).ToList();
// # Use BsonDocument
//var filter = new BsonDocument("LotID", "13089570006B");
// # Use Builders.Filter
//var filterBuilder = Builders<TraceCollection>.Filter;
//var filter = filterBuilder.Eq(x => x.LotID, "13109360026B");
var pipeline = new[]
{
new BsonDocument("$project", new BsonDocument("fields", new BsonDocument("$objectToArray", "$$ROOT"))),
new BsonDocument("$unwind", "$fields"),
new BsonDocument("$group", new BsonDocument("_id", BsonNull.Value).Add("uniqueFields", new BsonDocument("$addToSet", "$fields.k")))
};
FilterDefinitionBuilder<TraceCollection> filterBuilder = Builders<TraceCollection>.Filter;
FilterDefinition<TraceCollection> filter = filterBuilder.Gte(x => x.EVENTTIME, dtStart) & filterBuilder.Lt(x => x.EVENTTIME, dtEnd);
if (condition != null)
var result = await collection.Aggregate<BsonDocument>(pipeline).FirstOrDefaultAsync();
if (result != null && result.Contains("uniqueFields"))
{
string[] SkipPropertys = new string[] { "_id", "EVENTTIME" };
foreach (PropertyInfo property in condition.GetType().GetProperties())
var fields = result["uniqueFields"].AsBsonArray.Select(f => f.AsString);
Console.WriteLine("컬렉션의 필드 목록:");
foreach (var field in fields)
{
object value = property.GetValue(condition);
if (value != null)
{
if (property.Name.Equals("LotID")) filter &= filterBuilder.Eq(x => x.LotID, value);
continue;
}
Console.WriteLine(field);
}
}
List<TraceCollection> document = collection.Find(filter).ToList();
}
return document;
public static List<TraceCollection> GetCollectionData(string collectionName, DateTime dtStart, DateTime dtEnd, TraceCollection condition = null)
{
try
{
MongoClient client = new MongoClient(ConnectionString);
IMongoDatabase database = client.GetDatabase(DatabaseName);
IMongoCollection<TraceCollection> collection = database.GetCollection<TraceCollection>(collectionName);
// # ALL Data
//var lst = collection.Find(_ => true).ToList();
// # Use BsonDocument
//var filter = new BsonDocument("LotID", "13089570006B");
// # Use Builders.Filter
//var filterBuilder = Builders<TraceCollection>.Filter;
//var filter = filterBuilder.Eq(x => x.LotID, "13109360026B");
FilterDefinitionBuilder<TraceCollection> filterBuilder = Builders<TraceCollection>.Filter;
FilterDefinition<TraceCollection> filter = filterBuilder.Gte(x => x.EVENTTIME, dtStart) & filterBuilder.Lt(x => x.EVENTTIME, dtEnd);
if (condition != null)
{
string[] SkipPropertys = new string[] { "_id", "EVENTTIME" };
foreach (PropertyInfo property in condition.GetType().GetProperties())
{
object value = property.GetValue(condition);
if (value != null)
{
if (property.Name.Equals("LotID")) filter &= filterBuilder.Eq(x => x.LotID, value);
continue;
}
}
}
List<TraceCollection> document = collection.Find(filter).ToList();
return document;
}
catch (Exception ex)
{
throw ex;
}
}
public static bool GetCollectionSize_Flag = false;
@@ -150,35 +183,52 @@ namespace JWH.MONGODB
public ObjectId _id { get; set; }
public List<object> LotList { get; set; }
[BsonDateTimeOptions(Kind = DateTimeKind.Local)]
public DateTime EVENTTIME { get; set; }
public string ProcessID { get; set; }
public string UnitState { get; set; }
public string VIDName { get; set; }
public object Value { get; set; }
public string LotID { get; set; }
public string Sign { get; set; }
public string MaterialID { get; set; }
public List<object> LotList { get; set; }
public string LotID { get; set; }
public string ProductID { get; set; }
public object UnitNO { get; set; }
public string Recipe { get; set; }
public string ProcessID { get; set; }
public object UnitNO { get; set; }
public string VORNR { get; set; }
public string UnitState { get; set; }
public string MaterialID { get; set; }
public string Sign { get; set; }
public string CarrierId { get; set; }
public string PanelId { get; set; }
public string Position { get; set; }
public string MarkingId { get; set; }
public string Step { get; set; }
public double LowerSV { get; set; }
public double UpperSV { get; set; }
public string MongGoUnitName { get; set; }
}
}
}

View File

@@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using JWH;
using JWH.MONGODB;
using MongoDB.Bson;
@@ -101,19 +102,22 @@ namespace DDUtilityApp.MONGO
List<TraceCollection> data = null;
try
{
string collectionName = $"{this.EquipmentID}.{this.VID}";
//FDCMongoDB.GetCollectionColumns(collectionName);
this.Cursor = Cursors.WaitCursor;
this.ssName.Text = "GRID";
DateTime dtStart = this.DateTimeStart;
DateTime dtEnd = this.DateTimeEnd;
data = FDCMongoDB.GetCollectionData($"{this.EquipmentID}.{this.VID}", dtStart, dtEnd);
data = FDCMongoDB.GetCollectionData(collectionName, dtStart, dtEnd);
timeStart = this.StatusLabelDisplay(this.ssStatus01, "수집", timeStart, DateTime.Now);
this.grid.AutoBinding(data.ToArray());
}
catch (Exception ex)
{
throw ex;
XLogger.Instance.Fatal(ex, true);
}
finally
{
@@ -369,6 +373,7 @@ namespace DDUtilityApp.MONGO
this.grid.AddColumn("EVENTTIME", "EventTime");
this.grid.AddColumn("VIDName");
this.grid.AddColumn("Value");
this.grid.AddColumn("Sign");
this.grid.AddColumn("LotID");
this.grid.AddColumn("MaterialID");
this.grid.AddColumn("ProductID");
@@ -377,7 +382,14 @@ namespace DDUtilityApp.MONGO
this.grid.AddColumn("ProcessID");
this.grid.AddColumn("VORNR");
this.grid.AddColumn("UnitState");
this.grid.AddColumn("Sign");
this.grid.AddColumn("Step");
this.grid.AddColumn("LowerSV");
this.grid.AddColumn("UpperSV");
this.grid.AddColumn("CarrierId");
this.grid.AddColumn("PanelId");
this.grid.AddColumn("Position");
this.grid.AddColumn("MarkingId");
this.grid.AddColumn("MongGoUnitName");
}
#endregion

View File

@@ -30,7 +30,6 @@ namespace DDUtilityApp
Application.SetCompatibleTextRenderingDefault(false);
Form frm = null;
if (args.Length > 0)
{
if (string.Compare(args[0], "FrmLogParser", true) == 0 && args.Length >= 3)
@@ -69,15 +68,16 @@ namespace DDUtilityApp
frmMain.FormBorderStyle = FormBorderStyle.FixedDialog;
#region [ ]
frmMain.Buttons.Add("EIS Log Viewer", new EisParser0());
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("HSMS Converter", typeof(LOGPARSER.FrmHsmsViewer));
frmMain.Buttons.Add("TIB Simulator", typeof(TIBRENDEZVOUS.FrmSimulator01));
frmMain.Buttons.Add("TibcoConfig.Xml", typeof(ETC.FrmTIbcoConfig));
frmMain.Buttons.Add(new DynamicControl("EIS Log Viewer", new EisParser0()));
//frmMain.Buttons.Add("MES Log Download", typeof(MESDOWNLOADER.ServerLog));
frmMain.Buttons.Add(new DynamicControl("ServerLog Download", typeof(MESDOWNLOADER.FrmServerLog), false));
//frmMain.Buttons.Add("MIS Log Viewer", new AgvParser());
frmMain.Buttons.Add(new DynamicControl("FDC Mongo Viewer", typeof(MONGO.FrmFDCMongo)));
frmMain.Buttons.Add(new DynamicControl("HSMS Converter", typeof(LOGPARSER.FrmHsmsViewer)));
frmMain.Buttons.Add(new DynamicControl("TIB Simulator", typeof(TIBRENDEZVOUS.FrmSimulator01)));
frmMain.Buttons.Add(new DynamicControl("TibcoConfig.Xml", typeof(ETC.FrmTIbcoConfig)));
#if DEBUG
frmMain.Buttons.Add("FTP Test", typeof(SPECDOCUMENT.FrmSpecDocument));
frmMain.Buttons.Add(new DynamicControl("FTP Test", typeof(SPECDOCUMENT.FrmSpecDocument)));
#endif
#endregion
@@ -218,4 +218,24 @@ namespace DDUtilityApp
}
public class DynamicControl
{
public string Name { get; set; } = string.Empty;
public object Value { get; set; } = null;
public bool Visible { get; set; } = true;
public DynamicControl(string name, object value, bool visible = true)
{
this.Name = name;
this.Value = value;
this.Visible = visible;
}
}
}

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로
// 지정되도록 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2025.02.28.0")]
[assembly: AssemblyFileVersion("2025.02.28.0")]
[assembly: AssemblyVersion("2025.05.01.0")]
[assembly: AssemblyFileVersion("2025.05.01.0")]

View File

@@ -294,8 +294,13 @@
this.lviewSubject.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.lviewSubject.AutoScroll = true;
this.lviewSubject.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lviewSubject.Location = new System.Drawing.Point(112, 46);
this.lviewSubject.Name = "lviewSubject";
//
//
//
this.lviewSubject.RootElement.ControlBounds = new System.Drawing.Rectangle(0, 0, 120, 95);
this.lviewSubject.Size = new System.Drawing.Size(350, 89);
this.lviewSubject.TabIndex = 13;
//
@@ -1201,6 +1206,7 @@
//
// gridValue
//
this.gridValue.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.gridValue.ColumnResizeKey = System.Windows.Forms.Keys.F6;
this.gridValue.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridValue.Location = new System.Drawing.Point(0, 0);
@@ -1209,6 +1215,10 @@
//
this.gridValue.MasterTemplate.ViewDefinition = tableViewDefinition1;
this.gridValue.Name = "gridValue";
//
//
//
this.gridValue.RootElement.ControlBounds = new System.Drawing.Rectangle(0, 0, 240, 150);
this.gridValue.Size = new System.Drawing.Size(402, 420);
this.gridValue.TabIndex = 2;
//

View File

@@ -997,7 +997,6 @@ namespace DDUtilityApp.TIBRENDEZVOUS
this.Logger.Info($"Started");
this.tboxSettingInfo.Text = sb.ToString();
this.Text = $"TibSimulator - {this.cboxServer.Text} :: {this.cboxTarget.Text}";
List<Control.ControlCollection> lstControls = new List<Control.ControlCollection>();
lstControls.Add(this.gboxTransport.Controls);
@@ -1008,7 +1007,7 @@ namespace DDUtilityApp.TIBRENDEZVOUS
{
if (ctrl.GetType() == typeof(Label)) continue;
else if (ctrl.GetType() == typeof(TextBox)) ((TextBox)ctrl).ReadOnly = true;
else if (ctrl.GetType() == typeof(ComboBox)) ((ComboBox)ctrl).Enabled = false;
else if (ctrl.GetType() == typeof(ComboBox)) { ComboBox cbox = ctrl as ComboBox; cbox.DropDownStyle = ComboBoxStyle.DropDownList; cbox.Enabled = false; }
else ctrl.Enabled = false;
}
}
@@ -1038,7 +1037,7 @@ namespace DDUtilityApp.TIBRENDEZVOUS
{
if (ctrl.GetType() == typeof(Label)) continue;
else if (ctrl.GetType() == typeof(TextBox)) ((TextBox)ctrl).ReadOnly = false;
else if (ctrl.GetType() == typeof(ComboBox)) ((ComboBox)ctrl).Enabled = true;
else if (ctrl.GetType() == typeof(ComboBox)) { ComboBox cbox = ctrl as ComboBox; cbox.DropDownStyle = ComboBoxStyle.DropDown; cbox.Enabled = true; }
else ctrl.Enabled = true;
}
}
@@ -1052,19 +1051,19 @@ namespace DDUtilityApp.TIBRENDEZVOUS
{
string sendSubject = string.Empty;
string msgName = string.Empty;
string msgSendName = string.Empty;
string msgReplyName = string.Empty;
string msgSendSubjectName = string.Empty;
string msgReplySubjectName = string.Empty;
sendSubject = xmlMessage?.SendSubject;
msgName = xmlMessage?.XmlData?.MessageName;
msgSendName = xmlMessage?.XmlData?.SendSubjectName;
msgReplyName = xmlMessage?.XmlData?.ReplySubjectName;
msgSendSubjectName = xmlMessage?.XmlData?.SendSubjectName;
msgReplySubjectName = xmlMessage?.XmlData?.ReplySubjectName;
bool isOnlyHeader = false;
if (msgName.ToLower().StartsWith("AreYouThereRequest".ToLower()) && this.chkHideAreYouThere.Checked) isOnlyHeader = true;
if (isOnlyHeader) this.Logger.Info($"[S] {sendSubject} - {msgName}", this.ColorOfSend);
else this.Logger.Info($"[S] {sendSubject}{Environment.NewLine}{xmlMessage.XmlData.GetText()}", this.ColorOfSend);
if (isOnlyHeader) this.Logger.Info($"[S] {msgSendSubjectName} - {msgName}", this.ColorOfSend);
else this.Logger.Info($"[S] {msgReplySubjectName}{Environment.NewLine}{xmlMessage.XmlData.GetText()}", this.ColorOfSend);
}
catch (Exception ex)
{
@@ -1084,20 +1083,20 @@ namespace DDUtilityApp.TIBRENDEZVOUS
string listenerSubject = string.Empty;
string msgName = string.Empty;
string msgSendName = string.Empty;
string msgReplyName = string.Empty;
string msgSendSubjectName = string.Empty;
string msgReplySubjectName = string.Empty;
if (sender != null) listenerSubject = sender.Subject;
msgName = xmlReceived?.XmlData?.MessageName;
msgSendName = xmlReceived?.XmlData?.SendSubjectName;
msgReplyName = xmlReceived?.XmlData?.ReplySubjectName;
msgSendSubjectName = xmlReceived?.XmlData?.SendSubjectName;
msgReplySubjectName = xmlReceived?.XmlData?.ReplySubjectName;
// Log Write
bool isOnlyHeader = false;
if (msgName.ToLower().StartsWith("AreYouThereRequest".ToLower()) && this.chkHideAreYouThere.Checked) isOnlyHeader = true;
if (isOnlyHeader) this.Logger.Info($"[R] {listenerSubject} - {msgName}", this.ColorOfRecived);
else this.Logger.Info($"[R] {listenerSubject}{Environment.NewLine}{xmlReceived.XmlData.GetText()}", this.ColorOfRecived);
if (isOnlyHeader) this.Logger.Info($"[R] {msgReplySubjectName} - {msgName}", this.ColorOfRecived);
else this.Logger.Info($"[R] {msgReplySubjectName}{Environment.NewLine}{xmlReceived.XmlData.GetText()}", this.ColorOfRecived);
// Reply Message
bool isReply = false;
@@ -1113,24 +1112,23 @@ namespace DDUtilityApp.TIBRENDEZVOUS
foreach (XmlMessage xmlReply in xmlReplys)
{
this.cboxSendSubject.Text = xmlReply.XmlData.SendSubjectName;
this.tboxSendMessage.Text = xmlReply.XmlData.GetText();
this.tboxSendMessage.Tag = xmlReply;
if (xmlReply.IsReply && xmlReply.RequestMessage != null)
if (!string.IsNullOrEmpty(xmlReply.RequestMessage.ReplySubject)) this.SendButtons_Focus(this.btnSendReply);
else this.SendButtons_Focus(this.btnSend);
//else if (xmlReply.SendRequestFlag) this.SendButtons_Focus(this.btnSendRequest);
else this.SendButtons_Focus(this.btnSend);
if (xmlReceived.XmlData.MessageName.ToLower().StartsWith("AreYouThereRequest".ToLower()))
{
if (this.chkSendAreYouThereReply.Checked)
{
this.TibRendezvous.SendMessage(xmlReply);
this.tboxSendMessage.Clear();
this.tboxSendMessage.Tag = null;
return;
}
else
{
this.cboxSendSubject.Text = xmlReply.SendSubject;
this.tboxSendMessage.Text = xmlReply.XmlData.GetText();
this.tboxSendMessage.Tag = xmlReply;
if (xmlReply.IsReply && xmlReply.RequestMessage != null)
if (!string.IsNullOrEmpty(xmlReply.RequestMessage.ReplySubject)) this.SendButtons_Focus(this.btnSendReply);
else this.SendButtons_Focus(this.btnSend);
else this.SendButtons_Focus(this.btnSend);
}
}
else
@@ -1138,9 +1136,17 @@ namespace DDUtilityApp.TIBRENDEZVOUS
if (this.chkSendReply.Checked)
{
this.TibRendezvous.SendMessage(xmlReply);
this.tboxSendMessage.Clear();
this.tboxSendMessage.Tag = null;
return;
}
else
{
this.cboxSendSubject.Text = xmlReply.SendSubject;
this.tboxSendMessage.Text = xmlReply.XmlData.GetText();
this.tboxSendMessage.Tag = xmlReply;
if (xmlReply.IsReply && xmlReply.RequestMessage != null)
if (!string.IsNullOrEmpty(xmlReply.RequestMessage.ReplySubject)) this.SendButtons_Focus(this.btnSendReply);
else this.SendButtons_Focus(this.btnSend);
else this.SendButtons_Focus(this.btnSend);
}
}
}

View File

@@ -117,6 +117,15 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="lviewSubject.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="gridValue.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>138, 17</value>
</metadata>
<metadata name="radStatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>243, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@@ -15,7 +15,7 @@
<Server name="FDC">
<Item name="AP01" url="192.168.8.212" dir="/FDCLog" conkey="bG9ndXNlcjpEYWVkdWNrITE="/>
</Server>
<Server name="RMS">
<Server name="RTD">
<Item name="AP01" url="192.168.8.221" dir="/RTDLog" conkey="bG9ndXNlcjpEYWVkdWNrITE="/>
<Item name="AP02" url="192.168.8.222" dir="/RTDLog" conkey="bG9ndXNlcjpEYWVkdWNrITE="/>
</Server>

View File

@@ -6,9 +6,9 @@
<!--<appender-ref ref="database" />-->
</root>
<logger name="DEFAULT">
<logger name="LogViewer">
<level value="INFO"/>
<appender-ref ref="DefaultRolling"/>
<appender-ref ref="LogViewerRolling"/>
</logger>
<logger name="TibSimulator">
@@ -46,6 +46,23 @@
</layout>
</appender>
<appender name="LogViewerRolling" type="log4net.Appender.RollingFileAppender">
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<file type="log4net.Util.PatternString" value="%envFolderPath{MyDocuments}\DDUtility\Logs\LogViewer_" />
<!--<file type="log4net.Util.PatternString" value="X:\EIS서버\DDUtility\Logs\" />-->
<datePattern value="yyyyMMdd'.log'" />
<maxSizeRollBackups value="50" />
<maximumFileSize value="10MB" />
<staticLogFileName value="false" />
<appendToFile value="true" />
<preserveLogFileNameExtension value="true"/>
<rollingStyle value="Composite" />
<countDirection value="0" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}] %level %logger %X{id} : %X{class}.%X{method}() %message%newline" />
</layout>
</appender>
<appender name="TibSimulator" type="log4net.Appender.RollingFileAppender">
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<file type="log4net.Util.PatternString" value="%envFolderPath{MyDocuments}\DDUtility\Logs\TibSimulator_" />

View File

@@ -19,16 +19,16 @@ Global
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Debug|Any CPU.Build.0 = Debug|x64
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Debug|x64.ActiveCfg = Debug|x64
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Debug|x64.Build.0 = Debug|x64
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Release|Any CPU.Build.0 = Release|Any CPU
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Release|Any CPU.ActiveCfg = Release|x64
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Release|Any CPU.Build.0 = Release|x64
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Release|x64.ActiveCfg = Release|x64
{B8459F14-92D3-482C-A932-65E76E6D11F6}.Release|x64.Build.0 = Release|x64
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Debug|Any CPU.ActiveCfg = Debug|x64
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Debug|Any CPU.Build.0 = Debug|x64
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Debug|x64.ActiveCfg = Debug|x64
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Debug|x64.Build.0 = Debug|x64
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Release|Any CPU.Build.0 = Release|Any CPU
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Release|Any CPU.ActiveCfg = Release|x64
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Release|Any CPU.Build.0 = Release|x64
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Release|x64.ActiveCfg = Release|x64
{004BC1F3-B24A-402D-92ED-C5FC501E915A}.Release|x64.Build.0 = Release|x64
EndGlobalSection

View File

@@ -1,4 +1,6 @@
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -17,50 +19,74 @@ namespace JWH
public static bool IsDesignMode = LicenseManager.UsageMode == LicenseUsageMode.Designtime;
/// <summary>
/// 속성 정보를 캐싱하기 위한 사전입니다.
/// </summary>
private static readonly ConcurrentDictionary<Type, Dictionary<string, PropertyInfo>> PropertyCache =
new ConcurrentDictionary<Type, Dictionary<string, PropertyInfo>>();
/// <summary>
/// 주어진 타입의 속성 정보를 캐싱하여 반환합니다.
/// </summary>
/// <param name="type">대상 타입</param>
/// <returns>속성 정보 사전</returns>
private static Dictionary<string, PropertyInfo> GetCachedProperties(Type type)
{
return PropertyCache.GetOrAdd(type, t =>
t.GetProperties().ToDictionary(p => p.Name, StringComparer.OrdinalIgnoreCase));
}
#region [ PropertiesCopy ] --------------------------------------------
/// <summary>
/// 현재객체의 속성값을 대상객체의 속성에 복사합니다
/// 현재 객체의 속성 값을 대상 객체의 속성에 복사합니다.
/// </summary>
/// <param name="sender"></param>
/// <param name="dest">대상객체</param>
/// <param name="sender">원본 객체</param>
/// <param name="dest">대상 객체</param>
/// <param name="overwrite">기존 값을 덮어쓸지 여부</param>
public static void PropertiesCopy(this object sender, object dest, bool overwrite = true)
{
try
if (sender == null) throw new ArgumentNullException(nameof(sender));
if (dest == null) throw new ArgumentNullException(nameof(dest));
var sourceProperties = GetCachedProperties(sender.GetType());
var destProperties = GetCachedProperties(dest.GetType());
foreach (var sourceProp in sourceProperties)
{
foreach (PropertyInfo property in sender.GetType().GetProperties())
if (!destProperties.TryGetValue(sourceProp.Key, out var destProp)) continue;
if (!destProp.CanWrite) continue;
if (typeof(IList).IsAssignableFrom(sourceProp.Value.PropertyType))
{
try
{
PropertyInfo destProp = dest.GetType().GetProperty(property.Name, property.PropertyType);
if (destProp == null || property.GetType() != destProp.GetType()) continue;
//if (!property.CanWrite) continue;
if (!destProp.CanWrite) continue;
var sourceList = sourceProp.Value.GetValue(sender) as IList;
if (sourceList == null) continue;
var destValue = destProp.GetValue(dest);
if (overwrite == false && destValue != null) continue;
var destList = destProp.GetValue(dest) as IList ?? (IList)Activator.CreateInstance(sourceProp.Value.PropertyType);
if (overwrite) destList.Clear();
destProp.SetValue(dest, property.GetValue(sender));
}
catch (Exception ex)
foreach (var item in sourceList)
{
XLogger.Instance.Fatal(ex);
destList.Add(item);
}
destProp.SetValue(dest, destList);
}
else
{
var sourceValue = sourceProp.Value.GetValue(sender);
if (!overwrite && destProp.GetValue(dest) != null) continue;
destProp.SetValue(dest, sourceValue);
}
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex);
throw ex;
}
}
/// <summary>
/// 현재객체의 속성값을 대상객체의 속성에 복사합니다
/// DataTable의 데이터를 대상 객체의 속성에 복사합니다.
/// </summary>
/// <param name="sender"></param>
/// <param name="dest">대상객체</param>
/// <param name="sender">원본 DataTable</param>
/// <param name="dest">대상 객체</param>
public static void PropertiesCopy(this DataTable sender, object dest)
{
try
@@ -83,7 +109,6 @@ namespace JWH
catch
{
// Object of type 'System.DBNull' cannot be converted to type 'System.String'.
// XLogger.Instance.Warn(ex);
}
}
catch (Exception ex)
@@ -100,10 +125,10 @@ namespace JWH
}
/// <summary>
/// Dictionary<string, object>의 값을 대상객체의 속성에 복사합니다.
/// Dictionary의 데이터를 대상 객체의 속성에 복사합니다.
/// </summary>
/// <param name="sender"></param>
/// <param name="dest"></param>
/// <param name="sender">원본 Dictionary</param>
/// <param name="dest">대상 객체</param>
public static void PropertiesCopy(this Dictionary<string, object> sender, object dest)
{
try
@@ -134,74 +159,150 @@ namespace JWH
#endregion
#region [ Property Set/Get ] ------------------------------------------
/// <summary>
/// value 값을 현재객체의 속성에 복사합니다.
/// 주어진 값을 현재 객체의 속성에 설정합니다.
/// </summary>
/// <param name="sender"></param>
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="sender">대상 객체</param>
/// <param name="name">속성 이름</param>
/// <param name="value">설정할 값</param>
public static void PropertySet(this object sender, string name, object value)
{
try
{
PropertyInfo property = sender.GetType().GetProperty(name);
if (property == null)
foreach (PropertyInfo item in sender.GetType().GetProperties())
if (string.Compare(item.Name, name, true) == 0)
{
property = item;
break;
}
if (property == null) return;
if (property.PropertyType != value.GetType())
{
try
{ value = Convert.ChangeType(value, property.PropertyType); }
catch
{ return; }
}
PropertyInfo property;
GetCachedProperties(sender.GetType()).TryGetValue(name, out property);
if (property == null || !property.CanWrite) return;
property.SetValue(sender, value);
}
catch (Exception ex)
if (value != null && property.PropertyType != value.GetType())
{
XLogger.Instance.Fatal(ex);
throw ex;
value = Convert.ChangeType(value, property.PropertyType);
}
property.SetValue(sender, value);
}
/// <summary>
/// 객체의 속성값을 반환합니다.
/// 객체의 특정 속성 값을 반환합니다.
/// </summary>
/// <param name="sender"></param>
/// <param name="name"></param>
/// <returns></returns>
public static string PropertyGet(this object sender, string name)
/// <param name="sender">대상 객체</param>
/// <param name="name">속성 이름</param>
/// <returns>속성 값</returns>
public static object PropertyGet(this object sender, string name)
{
PropertyInfo property;
GetCachedProperties(sender.GetType()).TryGetValue(name, out property);
return property?.GetValue(sender);
}
#endregion
#region [ ToClass() ] -------------------------------------------------
/// <summary>
/// DataTable을 제네릭 객체 리스트로 변환합니다.
/// </summary>
/// <typeparam name="T">제네릭 객체 타입</typeparam>
/// <param name="dataTable">원본 DataTable</param>
/// <returns>제네릭 객체 배열</returns>
public static T[] ToClass<T>(this DataTable dataTable) where T : class, new()
{
var properties = GetCachedProperties(typeof(T));
var list = new List<T>();
foreach (DataRow row in dataTable.Rows)
{
var obj = new T();
foreach (var prop in properties)
{
if (!dataTable.Columns.Contains(prop.Key) || row[prop.Key] is DBNull) continue;
var value = Convert.ChangeType(row[prop.Key], prop.Value.PropertyType);
prop.Value.SetValue(obj, value);
}
list.Add(obj);
}
return list.ToArray();
}
/// <param name="srcArray">원본 객체 배열</param>
/// <returns>제네릭 객체 배열</returns>
public static T[] ToClass<T>(this object[] srcArray) where T : class, new()
{
try
{
PropertyInfo property = sender.GetType().GetProperty(name);
if (property == null)
List<T> list = new List<T>();
var desProperties = GetCachedProperties(typeof(T));
foreach (object src in srcArray)
{
foreach (PropertyInfo item in sender.GetType().GetProperties())
T des = new T();
list.Add(des);
var srcProperties = GetCachedProperties(src.GetType());
foreach (var srcProperty in srcProperties)
{
if (string.Compare(item.Name, name, true) == 0)
try
{
property = item;
break;
if (!desProperties.TryGetValue(srcProperty.Key, out var desProperty)) continue;
var srcValue = srcProperty.Value.GetValue(src);
if (srcProperty.Value.PropertyType != desProperty.PropertyType)
{
srcValue = Convert.ChangeType(srcValue, desProperty.PropertyType);
}
desProperty.SetValue(des, srcValue);
}
catch (Exception ex)
{
XLogger.Instance.Warn(ex);
}
}
}
if (property == null) return string.Empty;
return property.GetValue(sender)?.ToString();
}
catch (Exception ex)
{
XLogger.Instance.Fatal(ex);
return string.Empty;
return list.ToArray();
}
catch { throw; }
}
/// <param name="src">DataTable</param>
/// <returns>List with generic objects</returns>
public static T ToClass<T>(this object src) where T : class, new()
{
try
{
T des = new T();
var desProperties = GetCachedProperties(typeof(T));
var srcProperties = GetCachedProperties(src.GetType());
foreach (var srcProperty in srcProperties)
{
try
{
if (!desProperties.TryGetValue(srcProperty.Key, out var desProperty)) continue;
var srcValue = srcProperty.Value.GetValue(src);
if (srcProperty.Value.PropertyType != desProperty.PropertyType)
{
srcValue = Convert.ChangeType(srcValue, desProperty.PropertyType);
}
desProperty.SetValue(des, srcValue);
}
catch (Exception ex)
{
XLogger.Instance.Warn(ex);
}
}
return des;
}
catch { throw; }
}
#endregion
/// <summary>
/// 객체의 메소드를 호출합니다.
/// </summary>
@@ -352,141 +453,6 @@ namespace JWH
return null;
}
#region [ ToClass() ] -------------------------------------------------
/// <summary>
/// Converts a DataTable to a list with generic objects
/// dataTable.ToClass<Employee>();
/// </summary>
/// <typeparam name="T">Generic object</typeparam>
/// <param name="dataTable">DataTable</param>
/// <returns>List with generic objects</returns>
public static T[] ToClass<T>(this DataTable dataTable) where T : class, new()
{
try
{
List<T> list = new List<T>();
foreach (var row in dataTable.AsEnumerable())
{
T obj = new T();
foreach (PropertyInfo property in obj.GetType().GetProperties())
{
try
{
if (dataTable.Columns.Contains(property.Name) == false) continue;
if (row[property.Name] is System.DBNull) continue;
var val = row[property.Name];
//if (property.PropertyType == typeof(DateTime) && val.GetType() == typeof(string))
// DateTime.TryParse(val.ToString(), out val);
property.SetValue(obj, Convert.ChangeType(val, property.PropertyType, CultureInfo.CurrentCulture), null);
}
catch
{
continue;
}
}
list.Add(obj);
}
return list.ToArray();
}
catch { throw; }
}
/// <summary>
/// Converts a object to a list with generic objects
/// dataTable.ToClass<Employee>();
/// </summary>
/// <typeparam name="T">Generic object</typeparam>
/// <param name="src">DataTable</param>
/// <returns>List with generic objects</returns>
public static T ToClass<T>(this object src) where T : class, new()
{
try
{
T des = new T();
Type desType = des.GetType();
Type srcType = src.GetType();
foreach (PropertyInfo srcProperty in srcType.GetProperties())
{
try
{
PropertyInfo desProperty = desType.GetProperty(srcProperty.Name);
if (desProperty == null) continue;
var srcValue = srcProperty.GetValue(src);
if (srcProperty.PropertyType != desProperty.PropertyType)
{
srcValue = Convert.ChangeType(srcValue, desProperty.PropertyType);
}
desProperty.SetValue(des, srcValue);
}
catch (Exception ex)
{
XLogger.Instance.Warn(ex);
}
}
return des;
}
catch { throw; }
}
/// <summary>
/// Converts a object to a list with generic objects
/// dataTable.ToClass<Employee>();
/// </summary>
/// <typeparam name="T">Generic object</typeparam>
/// <param name="srcArray">DataTable</param>
/// <returns>List with generic objects</returns>
public static T[] ToClass<T>(this object[] srcArray) where T : class, new()
{
try
{
List<T> list = new List<T>();
foreach (object src in srcArray)
{
T des = new T();
list.Add(des);
Type desType = des.GetType();
Type srcType = src.GetType();
foreach (PropertyInfo srcProperty in srcType.GetProperties())
{
try
{
PropertyInfo desProperty = desType.GetProperty(srcProperty.Name);
if (desProperty == null) continue;
var srcValue = srcProperty.GetValue(src);
if (srcProperty.PropertyType != desProperty.PropertyType)
{
srcValue = Convert.ChangeType(srcValue, desProperty.PropertyType);
}
desProperty.SetValue(des, srcValue);
}
catch (Exception ex)
{
XLogger.Instance.Warn(ex);
}
}
}
return list.ToArray();
}
catch { throw; }
}
#endregion
public static CultureInfo CultureInfo { get; set; }
public static string ToTitleCase(this string sender)

View File

@@ -1,13 +1,14 @@
using System;
using System.Net;
using FluentFTP;
using Org.BouncyCastle.Crypto.Agreement.JPake;
namespace JWH.NETWORK
{
public static class FtpsClient
{
private static FluentFTP.FtpClient _ftpClient;
private static string _host;
public static string _host { get; private set; }
private static int _port = 990; // FTPS 기본 포트
private static string _userId;
private static string _password;

View File

@@ -60,8 +60,8 @@ namespace JWH.TIB
XmlMessage xmlMessage = new XmlMessage(xmlData);
if (isValueSetting)
{
this.SetMessageValue(xmlMessage.XmlData.Header);
this.SetMessageValue(xmlMessage.XmlData.Body);
this.SetMessageBodyValue(xmlMessage.XmlData.Header);
this.SetMessageBodyValue(xmlMessage.XmlData.Body);
}
return xmlMessage;
@@ -90,11 +90,11 @@ namespace JWH.TIB
DirectoryInfo directoryInfo = new DirectoryInfo(this.PathMessageReply);
foreach (FileInfo fileInfo in directoryInfo.GetFiles($"{xmlRequest.XmlData.MessageName}_*.xml"))
{
StreamReader reader = new StreamReader(fileInfo.FullName, Encoding.UTF8, true);
StreamReader reader = new StreamReader(fileInfo.FullName, Encoding.Default, true);
strReply = reader.ReadToEnd();
xmlReply = new XmlMessage(strReply);
xmlReply.SetRequstMessage(xmlRequest);
this.SetMessageValue(xmlReply.XmlData.Body, xmlRequest);
xmlReply.SetSubjectName(xmlRequest);
this.SetMessageBodyValue(xmlReply.XmlData.Body, xmlRequest);
lstReply.Add(xmlReply);
}
@@ -131,8 +131,11 @@ namespace JWH.TIB
XmlMessage xmlReply = new XmlMessage(xmlRequest.XmlData.GetText());
xmlReply.XmlData.MessageName += "Reply";
xmlReply.XmlData.SendRequestFlag = false;
xmlReply.XmlData.ReplySubjectName = xmlRequest.XmlData.SendSubjectName;
xmlReply.XmlData.SendSubjectName = xmlRequest.XmlData.ReplySubjectName;
xmlReply.SendSubject = xmlReply.XmlData.SendSubjectName;
xmlReply.SendRequestFlag = xmlReply.XmlData.SendRequestFlag;
xmlReply.RequestMessage = xmlRequest;
if (xmlRequest.SendRequestFlag) xmlReply.IsReply = true;
@@ -150,10 +153,12 @@ namespace JWH.TIB
if (xmlRequest == null) return null;
XmlMessage xmlReply = new XmlMessage(xmlRequest.XmlData.GetText());
xmlReply.XmlData.SendRequestFlag = false;
xmlReply.XmlData.MessageName += "Reply";
xmlReply.XmlData.SendRequestFlag = false;
xmlReply.XmlData.ReplySubjectName = xmlRequest.XmlData.SendSubjectName;
xmlReply.XmlData.SendSubjectName = xmlRequest.XmlData.ReplySubjectName;
xmlReply.SendSubject = xmlReply.XmlData.SendSubjectName;
xmlReply.SendRequestFlag = xmlReply.XmlData.SendRequestFlag;
XmlNode nodeReturn = xmlReply.XmlData.Message.CreateChildNode("return");
nodeReturn.CreateChildNode("returncode", "0");
@@ -176,7 +181,7 @@ namespace JWH.TIB
/// </summary>
/// <param name="node"></param>
/// <param name="srcMessage">RequestMessage</param>
private void SetMessageValue(XmlNode node, XmlMessage srcMessage = null)
private void SetMessageBodyValue(XmlNode node, XmlMessage srcMessage = null)
{
// MessageValue(UI)
if (node.GetText() == string.Empty)
@@ -220,7 +225,7 @@ namespace JWH.TIB
foreach (XmlNode child in node.ChildNodes)
{
if (child.GetType() == typeof(XmlText)) continue;
this.SetMessageValue(child, srcMessage);
this.SetMessageBodyValue(child, srcMessage);
}
}

View File

@@ -175,7 +175,7 @@ namespace JWH.TIB
#region [ Method ] ====================================================
/// <summary>
/// FromString
/// 전달된 메시지(문자열)로 속성을 셋팅한다.
/// </summary>
/// <param name="xmlData"></param>
public void FromString(string xmlData)

View File

@@ -174,7 +174,11 @@ namespace JWH.TIB
#region [ Public Method ] =============================================
public void SetRequstMessage(XmlMessage xmlRequest)
/// <summary>
/// Set Value of SendSubject, ReplySubject
/// </summary>
/// <param name="xmlRequest"></param>
public void SetSubjectName(XmlMessage xmlRequest)
{
this.RequestMessage = xmlRequest;
this.IsReply = true;

View File

@@ -1,29 +1,28 @@
<log4net>
<root>
<level value="DEBUG" />
<appender-ref ref="file" />
<!--<appender-ref ref="console" />-->
<appender-ref ref="Console" />
<appender-ref ref="RollingFile" />
<!--<appender-ref ref="database" />-->
</root>
<appender name="console" type="log4net.Appender.ConsoleAppender">
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff} %level] %logger %X{id} : %X{class}.%X{method}() %message%newline" />
</layout>
</appender>
<appender name="file" type="log4net.Appender.RollingFileAppender">
<appender name="LogViewerRolling" type="log4net.Appender.RollingFileAppender">
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<file type="log4net.Util.PatternString" value="%envFolderPath{MyDocuments}\DDUtility\Logs\" />
<appendToFile value="true" />
<preserveLogFileNameExtension value="true"/>
<rollingStyle value="Composite" />
<file type="log4net.Util.PatternString" value="Logs/" />
<datePattern value="yyyyMMdd'.log'" />
<maxSizeRollBackups value="100" />
<maximumFileSize value="30MB" />
<maxSizeRollBackups value="50" />
<maximumFileSize value="10MB" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff} %level] %logger %X{id} : %X{class}.%X{method}() %message%newline" />
</layout>