MES Log Download

This commit is contained in:
2025-02-28 16:47:40 +09:00
parent f6d430550f
commit 8b39c28efb
7 changed files with 54 additions and 13 deletions

View File

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

View File

@@ -403,6 +403,20 @@
<Compile Include="LOGPARSER\FrmEqSelector.Designer.cs">
<DependentUpon>FrmEqSelector.cs</DependentUpon>
</Compile>
<Compile Include="MESDOWNLOADER\ProgressForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MESDOWNLOADER\ProgressForm.Designer.cs">
<DependentUpon>ProgressForm.cs</DependentUpon>
</Compile>
<Compile Include="MESDOWNLOADER\ServerLog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MESDOWNLOADER\ServerLog.Designer.cs">
<DependentUpon>ServerLog.cs</DependentUpon>
</Compile>
<Compile Include="MESDOWNLOADER\Utili.cs" />
<Compile Include="MESDOWNLOADER\XmlToDsConverter.cs" />
<Compile Include="MONGO\FDCMongoDB.cs" />
<Compile Include="MONGO\FrmFDCMongo.cs">
<SubType>Form</SubType>
@@ -465,6 +479,9 @@
<Content Include="tibrvcm.dll" />
<Content Include="tibrvcmq.dll" />
<Content Include="tibrvft.dll" />
<Content Include="ViewList.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="ETC\FrmTIbcoConfig.resx">
<DependentUpon>FrmTIbcoConfig.cs</DependentUpon>
</EmbeddedResource>

View File

@@ -793,7 +793,7 @@ namespace DDUtilityApp.LOGPARSER
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Grid_KeyDown(object sender, KeyEventArgs e) //jhlim 20250202
private void Grid_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
@@ -806,7 +806,7 @@ namespace DDUtilityApp.LOGPARSER
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Grid_CellDoubleClick(object sender, GridViewCellEventArgs e) //jhlim 20250202
private void Grid_CellDoubleClick(object sender, GridViewCellEventArgs e)
{
RadGridView gd = sender.GetType().Name.Contains("GridDataCellElement") ?
((GridDataCellElement)sender)?.RowElement?.GridControl : (GridViewEx)sender;

View File

@@ -1,10 +1,12 @@
using JWH.CONTROL;
using JWH.NETWORK;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -188,12 +190,21 @@ namespace DDUtilityApp.MESDOWNLOADER
{
if (totalFiles > 1)
{
Util.GetFileMerge(mergefileList);
string filename = Util.GetFileMerge(mergefileList);
MessageBox.Show($"{totalFiles}개의 파일을 머지 하였습니다.");
System.Diagnostics.Process.Start(filename);
}
else
{
MessageBox.Show($"{gd.SelectedRows[0].Cells["Name"].Value} 파일을 저장 하였습니다.");
string fileName = mergefileList[0];
string extension = Path.GetExtension(fileName);
if (string.Compare(extension, ".Log", true) != 0)
{
fileName += ".Log";
File.Move(mergefileList[0], fileName);
}
System.Diagnostics.Process.Start(fileName);
}
}
}

View File

@@ -9,14 +9,14 @@ namespace DDUtilityApp.MESDOWNLOADER
{
public static class Util
{
public static int GetFileMerge(List<string> filePaths)
public static string GetFileMerge(List<string> filePaths)
{
int rtnBint = 9; // 기본 실패 코드
string mergedFilePath = string.Empty;
if (filePaths.Count == 0)
{
Console.WriteLine("병합할 파일이 없습니다.");
return 1;
return mergedFilePath;
}
// 실행 시간 측정을 위한 Stopwatch 시작
@@ -26,9 +26,10 @@ namespace DDUtilityApp.MESDOWNLOADER
// 첫 번째 파일명에서 경로 제외
string firstFileName = Path.GetFileName(filePaths.First());
string mergedFileName = "merge_" + firstFileName;
// 병합된 파일을 저장할 경로 (첫 번째 파일과 동일한 폴더)
string mergedFilePath = Path.Combine(Path.GetDirectoryName(filePaths.First()), mergedFileName);
mergedFilePath = Path.Combine(Path.GetDirectoryName(filePaths.First()), mergedFileName);
string extension = Path.GetExtension(mergedFilePath);
if (string.Compare(extension, ".Log", true) != 0) mergedFilePath = mergedFilePath + ".Log";
try
{
@@ -56,14 +57,14 @@ namespace DDUtilityApp.MESDOWNLOADER
Console.WriteLine($"모든 파일이 {mergedFileName}로 병합되었습니다.");
Console.WriteLine($"병합 실행 시간: {stopwatch.ElapsedMilliseconds} ms");
rtnBint = 0; // 성공 코드
return mergedFilePath;
}
catch (Exception ex)
{
Console.WriteLine($"오류 발생: {ex.Message}");
}
return rtnBint;
return mergedFilePath;
}
public static string GetStr(object str )

View File

@@ -70,7 +70,7 @@ namespace DDUtilityApp
#region [ ]
frmMain.Buttons.Add("EIS Log Viewer", new EisParser0());
frmMain.Buttons.Add("MES Log Download", typeof(SPECDOCUMENT.FrmSpecDocument));
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));

14
DDUtilityApp/ViewList.xml Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<Viewer>
<Server name="MES">
<!-- ?޺????? ???? -->
<Item name="AP01" url="192.168.7.215" dir="/EISLog/testlog" conkey="dGVzdDpkYWVkdWNrITE="/>
<Item name="AP02" url="192.168.7.215" dir="/EISLog/testlog1" conkey="dGVzdDpkYWVkdWNrITE="/>
<Item name="AP03" url="192.168.7.215" dir="/EISLog/testlog2" conkey="dGVzdDpkYWVkdWNrITE="/>
</Server>
<Server name="MES(AUTO)">
<Item name="AP01" url="192.168.7.215" dir="/EISLog/testbackup/logs" conkey="dGVzdDpkYWVkdWNrITE="/>
<Item name="AP02" url="192.168.7.215" dir="/EISLog/testbackup/logs1" conkey="dGVzdDpkYWVkdWNrITE="/>
<Item name="AP03" url="192.168.7.215" dir="/EISLog/testbackup/logs2" conkey="dGVzdDpkYWVkdWNrITE="/>
</Server>
</Viewer>