2023-07-21 04:42:01 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
|
|
|
|
using SmartX;
|
|
|
|
|
|
using INT69DC_7C.DialogForms;
|
|
|
|
|
|
|
|
|
|
|
|
namespace INT69DC_7C.Forms
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class FormDataViewer : Form
|
|
|
|
|
|
{
|
|
|
|
|
|
#region Field
|
|
|
|
|
|
private int m_SelectNodeIndex;
|
|
|
|
|
|
private int RemainCNT;
|
|
|
|
|
|
private int StartIndex;
|
2023-09-05 06:48:00 +00:00
|
|
|
|
private int CurrentCount;
|
|
|
|
|
|
private int TotalCount;
|
|
|
|
|
|
private static int ListBoxLineCount = 50; // 화면에 보여지는 listBox 줄 수
|
|
|
|
|
|
public bool IsFileOpen;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
public string PathDestinationFileName;
|
|
|
|
|
|
private FormMain m_ParentForm;
|
|
|
|
|
|
|
|
|
|
|
|
private Collection<string[]> CollectionHistoryData; // 파일에서 읽은 데이터
|
|
|
|
|
|
|
|
|
|
|
|
private List<string> ListTime;
|
|
|
|
|
|
private List<string> ListLoginID;
|
|
|
|
|
|
private List<string> ListEvent;
|
|
|
|
|
|
private List<string> ListDetail;
|
|
|
|
|
|
private List<string> ListBefore;
|
|
|
|
|
|
private List<string> ListAfter;
|
|
|
|
|
|
private List<string> ListType;
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Constructor
|
|
|
|
|
|
public FormDataViewer(FormMain parent)
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
this.ParentForm = parent;
|
|
|
|
|
|
|
|
|
|
|
|
this.InitializeDesign();
|
|
|
|
|
|
this.DefaultSetting();
|
|
|
|
|
|
this.InitializeControl();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Property
|
|
|
|
|
|
public int SelectNodeIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return this.m_SelectNodeIndex; }
|
|
|
|
|
|
set { this.m_SelectNodeIndex = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public FormMain ParentForm
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return this.m_ParentForm; }
|
|
|
|
|
|
private set { this.m_ParentForm = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Method
|
|
|
|
|
|
private void InitializeDesign()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
private void InitializeControl()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ClearData();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void DefaultSetting()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.SelectNodeIndex = -1;
|
|
|
|
|
|
this.StartIndex = 0;
|
|
|
|
|
|
this.RemainCNT = 0;
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.CurrentCount = 0;
|
|
|
|
|
|
this.TotalCount = 0;
|
|
|
|
|
|
this.IsFileOpen = false;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
|
|
|
|
|
|
this.PathDestinationFileName = "";
|
|
|
|
|
|
this.CollectionHistoryData = new Collection<string[]>();
|
|
|
|
|
|
//this.CollectionFileClassification = new Collection<List<string>>();
|
|
|
|
|
|
|
|
|
|
|
|
this.ListTime = new List<string>();
|
|
|
|
|
|
this.ListLoginID = new List<string>();
|
|
|
|
|
|
this.ListEvent = new List<string>();
|
|
|
|
|
|
this.ListDetail = new List<string>();
|
|
|
|
|
|
this.ListBefore = new List<string>();
|
|
|
|
|
|
this.ListAfter = new List<string>();
|
|
|
|
|
|
this.ListType = new List<string>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ListBoxScrollDown()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxTime.ScrollDown();
|
|
|
|
|
|
this.listBoxLoginID.ScrollDown();
|
|
|
|
|
|
this.listBoxEvent.ScrollDown();
|
|
|
|
|
|
this.listBoxDetail.ScrollDown();
|
|
|
|
|
|
this.listBoxBefore.ScrollDown();
|
|
|
|
|
|
this.listBoxAfter.ScrollDown();
|
|
|
|
|
|
this.listBoxType.ScrollDown();
|
|
|
|
|
|
|
|
|
|
|
|
this.ListBoxItemsCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ListBoxScrollDown(int value)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxTime.ScrollDown(value);
|
|
|
|
|
|
this.listBoxLoginID.ScrollDown(value);
|
|
|
|
|
|
this.listBoxEvent.ScrollDown(value);
|
|
|
|
|
|
this.listBoxDetail.ScrollDown(value);
|
|
|
|
|
|
this.listBoxBefore.ScrollDown(value);
|
|
|
|
|
|
this.listBoxAfter.ScrollDown(value);
|
|
|
|
|
|
this.listBoxType.ScrollDown(value);
|
|
|
|
|
|
|
|
|
|
|
|
this.ListBoxItemsCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ListBoxScrollUp()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxTime.ScrollUp();
|
|
|
|
|
|
this.listBoxLoginID.ScrollUp();
|
|
|
|
|
|
this.listBoxEvent.ScrollUp();
|
|
|
|
|
|
this.listBoxDetail.ScrollUp();
|
|
|
|
|
|
this.listBoxBefore.ScrollUp();
|
|
|
|
|
|
this.listBoxAfter.ScrollUp();
|
|
|
|
|
|
this.listBoxType.ScrollUp();
|
|
|
|
|
|
|
|
|
|
|
|
this.ListBoxItemsCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ListBoxScrollUp(int value)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxTime.ScrollUp(value);
|
|
|
|
|
|
this.listBoxLoginID.ScrollUp(value);
|
|
|
|
|
|
this.listBoxEvent.ScrollUp(value);
|
|
|
|
|
|
this.listBoxDetail.ScrollUp(value);
|
|
|
|
|
|
this.listBoxBefore.ScrollUp(value);
|
|
|
|
|
|
this.listBoxAfter.ScrollUp(value);
|
|
|
|
|
|
this.listBoxType.ScrollUp(value);
|
|
|
|
|
|
|
|
|
|
|
|
this.ListBoxItemsCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ListBoxItemsCount()
|
|
|
|
|
|
{
|
2023-09-05 06:48:00 +00:00
|
|
|
|
if (this.listBoxTime.ItemCount == 0)
|
2023-07-21 04:42:01 +00:00
|
|
|
|
{
|
|
|
|
|
|
this.StartIndex = 0;
|
|
|
|
|
|
this.RemainCNT = 0;
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.CurrentCount = 0;
|
|
|
|
|
|
this.TotalCount = 0;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
this.StartIndex = this.listBoxType.ViewStartItemIndex;
|
|
|
|
|
|
this.RemainCNT = this.listBoxType.ViewRemainCount;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.labelItemsCount.Text = this.StartIndex.ToString() + " / " + this.RemainCNT.ToString();
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.labelRemainDataCount.Text = this.CurrentCount.ToString();
|
2023-07-21 04:42:01 +00:00
|
|
|
|
|
2023-09-05 06:48:00 +00:00
|
|
|
|
if (this.listBoxTime.ItemCount == 0)
|
2023-07-21 04:42:01 +00:00
|
|
|
|
this.labelItemCount.Text = "0 / 0";
|
|
|
|
|
|
else
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.labelItemCount.Text = (this.StartIndex + 29).ToString() + " / " + this.TotalCount.ToString();
|
2023-07-21 04:42:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
private void UpdateDisplay()
|
|
|
|
|
|
{
|
|
|
|
|
|
int cnt = 0;
|
2023-09-05 06:48:00 +00:00
|
|
|
|
if (this.ListTime.Count > ListBoxLineCount)
|
2023-07-21 04:42:01 +00:00
|
|
|
|
{
|
2023-09-05 06:48:00 +00:00
|
|
|
|
cnt = ListBoxLineCount;
|
|
|
|
|
|
this.CurrentCount = this.ListTime.Count - ListBoxLineCount;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
2023-09-05 06:48:00 +00:00
|
|
|
|
cnt = this.ListTime.Count;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < cnt; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxTime.AddItem(this.ListTime[i]);
|
|
|
|
|
|
this.listBoxLoginID.AddItem(this.ListLoginID[i]);
|
|
|
|
|
|
this.listBoxEvent.AddItem(this.ListEvent[i]);
|
|
|
|
|
|
this.listBoxDetail.AddItem(this.ListDetail[i]);
|
|
|
|
|
|
this.listBoxBefore.AddItem(this.ListBefore[i]);
|
|
|
|
|
|
this.listBoxAfter.AddItem(this.ListAfter[i]);
|
|
|
|
|
|
this.listBoxType.AddItem(this.ListType[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.ListBoxItemsCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void UpdateDisplayAddListBox()
|
|
|
|
|
|
{
|
|
|
|
|
|
int index = 0, range = 0;
|
|
|
|
|
|
SmartX.SmartSplash splash;
|
|
|
|
|
|
|
|
|
|
|
|
// 화면 표시 로딩시간 타이머 on
|
|
|
|
|
|
this.smartTimer1.StartWatch();
|
|
|
|
|
|
|
|
|
|
|
|
splash = new SmartX.SmartSplash();
|
|
|
|
|
|
splash.CenterPosition = true;
|
|
|
|
|
|
splash.AnimationInterval = 100;
|
|
|
|
|
|
splash.LoadingImagePathname = "SmartLoading4";
|
|
|
|
|
|
splash.Start();
|
|
|
|
|
|
|
2023-09-05 06:48:00 +00:00
|
|
|
|
index = this.ListTime.Count - this.CurrentCount;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
|
2023-09-05 06:48:00 +00:00
|
|
|
|
if (this.CurrentCount > ListBoxLineCount)
|
2023-07-21 04:42:01 +00:00
|
|
|
|
{
|
2023-09-05 06:48:00 +00:00
|
|
|
|
range = index + ListBoxLineCount;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
for (int i = index; i < range; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxTime.AddItem(this.ListTime[i]);
|
|
|
|
|
|
this.listBoxLoginID.AddItem(this.ListLoginID[i]);
|
|
|
|
|
|
this.listBoxEvent.AddItem(this.ListEvent[i]);
|
|
|
|
|
|
this.listBoxDetail.AddItem(this.ListDetail[i]);
|
|
|
|
|
|
this.listBoxBefore.AddItem(this.ListBefore[i]);
|
|
|
|
|
|
this.listBoxAfter.AddItem(this.ListAfter[i]);
|
|
|
|
|
|
this.listBoxType.AddItem(this.ListType[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.CurrentCount = this.CurrentCount - ListBoxLineCount;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2023-09-05 06:48:00 +00:00
|
|
|
|
for (int i = index; i < this.ListTime.Count; i++)
|
2023-07-21 04:42:01 +00:00
|
|
|
|
{
|
|
|
|
|
|
this.listBoxTime.AddItem(this.ListTime[i]);
|
|
|
|
|
|
this.listBoxLoginID.AddItem(this.ListLoginID[i]);
|
|
|
|
|
|
this.listBoxEvent.AddItem(this.ListEvent[i]);
|
|
|
|
|
|
this.listBoxDetail.AddItem(this.ListDetail[i]);
|
|
|
|
|
|
this.listBoxBefore.AddItem(this.ListBefore[i]);
|
|
|
|
|
|
this.listBoxAfter.AddItem(this.ListAfter[i]);
|
|
|
|
|
|
this.listBoxType.AddItem(this.ListType[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.CurrentCount = 0;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.ListBoxItemsCount();
|
|
|
|
|
|
|
|
|
|
|
|
splash.Finish();
|
|
|
|
|
|
|
|
|
|
|
|
// 화면 표시 로딩시간 타이머 off
|
|
|
|
|
|
this.smartTimer1.StopWatch();
|
|
|
|
|
|
this.labelDisplayUpdateElapsedTime.Text = this.smartTimer1.StopWatchElapsedMicrosecond.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-05 06:48:00 +00:00
|
|
|
|
private void UpdateListItem(DataViewerFilter filter)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool enable = false;
|
|
|
|
|
|
// List Item Add
|
|
|
|
|
|
for (int i = 0; i < this.CollectionHistoryData.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 필터 적용
|
|
|
|
|
|
switch (this.CollectionHistoryData[i][7])
|
|
|
|
|
|
{
|
|
|
|
|
|
case "Alarm":
|
|
|
|
|
|
enable = filter.TpyeAlarm;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "Operation":
|
|
|
|
|
|
enable = filter.TypeOperation;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "Parameter":
|
|
|
|
|
|
enable = filter.TypeParameter;
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
enable = false;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (enable == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ListTime.Add(this.CollectionHistoryData[i][1]);
|
|
|
|
|
|
this.ListLoginID.Add(this.CollectionHistoryData[i][2]);
|
|
|
|
|
|
this.ListEvent.Add(this.CollectionHistoryData[i][3]);
|
|
|
|
|
|
this.ListDetail.Add(this.CollectionHistoryData[i][4]);
|
|
|
|
|
|
this.ListBefore.Add(this.CollectionHistoryData[i][5]);
|
|
|
|
|
|
this.ListAfter.Add(this.CollectionHistoryData[i][6]);
|
|
|
|
|
|
this.ListType.Add(this.CollectionHistoryData[i][7]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void UpdateListItemByFilter(DataViewerFilter filter)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool enable = false;
|
|
|
|
|
|
// List Item Add
|
|
|
|
|
|
for (int i = 0; i < this.CollectionHistoryData.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 필터 적용
|
|
|
|
|
|
switch (this.CollectionHistoryData[i][7])
|
|
|
|
|
|
{
|
|
|
|
|
|
case "Alarm":
|
|
|
|
|
|
enable = filter.TpyeAlarm;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "Operation":
|
|
|
|
|
|
enable = filter.TypeOperation;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case "Parameter":
|
|
|
|
|
|
enable = filter.TypeParameter;
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
enable = false;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (enable == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ListTime.Add(this.CollectionHistoryData[i][1]);
|
|
|
|
|
|
this.ListLoginID.Add(this.CollectionHistoryData[i][2]);
|
|
|
|
|
|
this.ListEvent.Add(this.CollectionHistoryData[i][3]);
|
|
|
|
|
|
this.ListDetail.Add(this.CollectionHistoryData[i][4]);
|
|
|
|
|
|
this.ListBefore.Add(this.CollectionHistoryData[i][5]);
|
|
|
|
|
|
this.ListAfter.Add(this.CollectionHistoryData[i][6]);
|
|
|
|
|
|
this.ListType.Add(this.CollectionHistoryData[i][7]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateListData()
|
|
|
|
|
|
{
|
|
|
|
|
|
// List Item Add
|
|
|
|
|
|
for (int i = 0; i < this.CollectionHistoryData.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ListTime.Add(this.CollectionHistoryData[i][1]);
|
|
|
|
|
|
this.ListLoginID.Add(this.CollectionHistoryData[i][2]);
|
|
|
|
|
|
this.ListEvent.Add(this.CollectionHistoryData[i][3]);
|
|
|
|
|
|
this.ListDetail.Add(this.CollectionHistoryData[i][4]);
|
|
|
|
|
|
this.ListBefore.Add(this.CollectionHistoryData[i][5]);
|
|
|
|
|
|
this.ListAfter.Add(this.CollectionHistoryData[i][6]);
|
|
|
|
|
|
this.ListType.Add(this.CollectionHistoryData[i][7]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void UpdateListBoxDataDisplay()
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = 0; i < this.ListTime.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxTime.AddItem(this.ListTime[i]);
|
|
|
|
|
|
this.listBoxLoginID.AddItem(this.ListLoginID[i]);
|
|
|
|
|
|
this.listBoxEvent.AddItem(this.ListEvent[i]);
|
|
|
|
|
|
this.listBoxDetail.AddItem(this.ListDetail[i]);
|
|
|
|
|
|
this.listBoxBefore.AddItem(this.ListBefore[i]);
|
|
|
|
|
|
this.listBoxAfter.AddItem(this.ListAfter[i]);
|
|
|
|
|
|
this.listBoxType.AddItem(this.ListType[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void UpdateListBoxCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.labelTotalIndex.Text = this.TotalCount.ToString();
|
|
|
|
|
|
this.labelCurrentIndex.Text = this.CurrentCount.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void UpdateData(int startIndex, int endIndex)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = startIndex; i < endIndex; i++)
|
|
|
|
|
|
this.CollectionHistoryData.Add(this.ParentForm.smartFileIO.ReadStringBuffer(i).Split(','));
|
|
|
|
|
|
|
|
|
|
|
|
this.UpdateListData();
|
|
|
|
|
|
this.UpdateListBoxDataDisplay();
|
|
|
|
|
|
this.UpdateListBoxCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-07-21 04:42:01 +00:00
|
|
|
|
public int DataRead(string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
//string path = "";
|
|
|
|
|
|
int ret = 0, flag = 0;
|
|
|
|
|
|
long count = 0;
|
|
|
|
|
|
|
|
|
|
|
|
SmartSplash splash;
|
|
|
|
|
|
|
|
|
|
|
|
splash = new SmartSplash();
|
|
|
|
|
|
splash.CenterPosition = true;
|
|
|
|
|
|
splash.AnimationInterval = 100;
|
|
|
|
|
|
splash.LoadingImagePathname = "SmartLoading4";
|
|
|
|
|
|
splash.Start();
|
|
|
|
|
|
|
|
|
|
|
|
this.ClearData();
|
|
|
|
|
|
this.CollectionHistoryData.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
// 파일 로딩 시간 타이머 ON
|
|
|
|
|
|
this.smartTimer1.StartWatch();
|
|
|
|
|
|
|
|
|
|
|
|
this.ParentForm.smartFileIO.FilePathName = filePath;
|
|
|
|
|
|
this.ParentForm.smartFileIO.Open(2000000);
|
|
|
|
|
|
this.ParentForm.smartFileIO.ReadStringAllBuffer();
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
count = this.ParentForm.smartFileIO.GetCount();
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (flag == 100)
|
|
|
|
|
|
{
|
|
|
|
|
|
Thread.Sleep(5);
|
|
|
|
|
|
flag = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.CollectionHistoryData.Add(this.ParentForm.smartFileIO.ReadStringBuffer(i).Split(','));
|
|
|
|
|
|
flag++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.ParentForm.smartFileIO.Close();
|
|
|
|
|
|
this.CollectionHistoryData.RemoveAt(0);
|
|
|
|
|
|
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.TotalCount = this.CollectionHistoryData.Count;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
|
|
|
|
|
|
// 파일 로딩 시간 타이머 off
|
|
|
|
|
|
this.smartTimer1.StopWatch();
|
|
|
|
|
|
this.labelFileReadElapsedTime.Text = this.smartTimer1.StopWatchElapsedMicrosecond.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
// 화면 표시 로딩시간 타이머 on
|
|
|
|
|
|
this.smartTimer1.StartWatch();
|
|
|
|
|
|
|
|
|
|
|
|
// File Name
|
|
|
|
|
|
string[] data = filePath.Split('\\');
|
|
|
|
|
|
this.labelFileName.Text = data[data.Length - 1];
|
|
|
|
|
|
// List 갱신
|
|
|
|
|
|
this.UpdateListItem(this.ParentForm.CurrentDataViewerFilter);
|
|
|
|
|
|
// 화면 표시
|
|
|
|
|
|
this.UpdateDisplay();
|
|
|
|
|
|
|
|
|
|
|
|
// 화면 표시 로딩시간 타이머 off
|
|
|
|
|
|
this.smartTimer1.StopWatch();
|
|
|
|
|
|
this.labelDisplayUpdateElapsedTime.Text = this.smartTimer1.StopWatchElapsedMicrosecond.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
this.CollectionHistoryData.Clear();
|
|
|
|
|
|
ret = 0;
|
|
|
|
|
|
splash.Finish();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
this.CollectionHistoryData.Clear();
|
|
|
|
|
|
ret = -1;
|
|
|
|
|
|
splash.Finish();
|
|
|
|
|
|
DialogFormMessage msg = new DialogFormMessage(13, this.ParentForm.SystemConfig.Language);
|
|
|
|
|
|
msg.ShowDialog();
|
|
|
|
|
|
|
|
|
|
|
|
this.ParentForm.smartFileIO.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
2023-09-05 06:48:00 +00:00
|
|
|
|
public int DataRead1(string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
//string path = "";
|
|
|
|
|
|
int startIndex = 0, endIndex = 0;
|
|
|
|
|
|
int ret = 0, flag = 0;
|
|
|
|
|
|
long lineNum = 0;
|
|
|
|
|
|
|
|
|
|
|
|
SmartSplash splash;
|
|
|
|
|
|
|
|
|
|
|
|
splash = new SmartSplash();
|
|
|
|
|
|
splash.CenterPosition = true;
|
|
|
|
|
|
splash.AnimationInterval = 100;
|
|
|
|
|
|
splash.LoadingImagePathname = "SmartLoading4";
|
|
|
|
|
|
splash.Start();
|
|
|
|
|
|
|
|
|
|
|
|
this.ClearData();
|
|
|
|
|
|
this.CollectionHistoryData.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
// 파일 로딩 시간 타이머 ON
|
|
|
|
|
|
this.smartTimer1.StartWatch();
|
|
|
|
|
|
|
|
|
|
|
|
this.ParentForm.smartFileIO.FilePathName = filePath;
|
|
|
|
|
|
if(this.ParentForm.smartFileIO.Open(2000000)== true)
|
|
|
|
|
|
this.IsFileOpen = true;
|
|
|
|
|
|
bool bValue = this.ParentForm.smartFileIO.ReadStringAllBuffer();
|
|
|
|
|
|
if (bValue == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ParentForm.smartFileIO.Close();
|
|
|
|
|
|
this.IsFileOpen = false;
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
lineNum = this.ParentForm.smartFileIO.GetCount();
|
|
|
|
|
|
this.TotalCount = (int)lineNum;
|
|
|
|
|
|
|
|
|
|
|
|
if (this.TotalCount > ListBoxLineCount)
|
|
|
|
|
|
{
|
|
|
|
|
|
startIndex = this.TotalCount - ListBoxLineCount;
|
|
|
|
|
|
endIndex = this.TotalCount;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
startIndex = 0 + 1; // 맨 첫 줄은 제목
|
|
|
|
|
|
endIndex = this.TotalCount;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.TotalCount = (int)lineNum - 1; // 맨 첫 줄 제외
|
|
|
|
|
|
this.CurrentCount = this.TotalCount;
|
|
|
|
|
|
|
|
|
|
|
|
this.UpdateData(startIndex, endIndex);
|
|
|
|
|
|
|
|
|
|
|
|
// 파일 로딩 시간 타이머 off
|
|
|
|
|
|
this.smartTimer1.StopWatch();
|
|
|
|
|
|
this.labelFileReadElapsedTime.Text = this.smartTimer1.StopWatchElapsedMicrosecond.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
// 화면 표시 로딩시간 타이머 on
|
|
|
|
|
|
this.smartTimer1.StartWatch();
|
|
|
|
|
|
|
|
|
|
|
|
// File Name
|
|
|
|
|
|
string[] data = filePath.Split('\\');
|
|
|
|
|
|
this.labelFileName.Text = data[data.Length - 1];
|
|
|
|
|
|
//// List 갱신
|
|
|
|
|
|
//this.UpdateListItem(this.ParentForm.CurrentDataViewerFilter);
|
|
|
|
|
|
//// 화면 표시
|
|
|
|
|
|
//this.UpdateDisplay();
|
|
|
|
|
|
|
|
|
|
|
|
// 화면 표시 로딩시간 타이머 off
|
|
|
|
|
|
this.smartTimer1.StopWatch();
|
|
|
|
|
|
this.labelDisplayUpdateElapsedTime.Text = this.smartTimer1.StopWatchElapsedMicrosecond.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
//this.CollectionHistoryData.Clear();
|
|
|
|
|
|
ret = 0;
|
|
|
|
|
|
splash.Finish();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
this.CollectionHistoryData.Clear();
|
|
|
|
|
|
ret = -1;
|
|
|
|
|
|
splash.Finish();
|
|
|
|
|
|
DialogFormMessage msg = new DialogFormMessage(13, this.ParentForm.SystemConfig.Language);
|
|
|
|
|
|
msg.ShowDialog();
|
|
|
|
|
|
|
|
|
|
|
|
this.ParentForm.smartFileIO.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
2023-07-21 04:42:01 +00:00
|
|
|
|
public void ClearData()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.CollectionHistoryData.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
this.listBoxTime.ClearAll();
|
|
|
|
|
|
this.listBoxLoginID.ClearAll();
|
|
|
|
|
|
this.listBoxEvent.ClearAll();
|
|
|
|
|
|
this.listBoxDetail.ClearAll();
|
|
|
|
|
|
this.listBoxBefore.ClearAll();
|
|
|
|
|
|
this.listBoxAfter.ClearAll();
|
|
|
|
|
|
this.listBoxType.ClearAll();
|
|
|
|
|
|
|
|
|
|
|
|
this.ListTime.Clear();
|
|
|
|
|
|
this.ListLoginID.Clear();
|
|
|
|
|
|
this.ListEvent.Clear();
|
|
|
|
|
|
this.ListDetail.Clear();
|
|
|
|
|
|
this.ListBefore.Clear();
|
|
|
|
|
|
this.ListAfter.Clear();
|
|
|
|
|
|
this.ListType.Clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
public void DisplayRefresh()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.labelFileName.Text = "";
|
|
|
|
|
|
this.ClearData();
|
|
|
|
|
|
this.ListBoxItemsCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Event Handler
|
|
|
|
|
|
private void buttonBack_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ParentForm.ChildFormMenu.DisplayRefresh();
|
|
|
|
|
|
((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormMenu);
|
|
|
|
|
|
}
|
|
|
|
|
|
private void buttonFileSelect_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.SelectNodeIndex = -1;
|
|
|
|
|
|
|
|
|
|
|
|
DialogFormHistoryData form = new DialogFormHistoryData(this);
|
|
|
|
|
|
if (form.ShowDialog() == DialogResult.OK)
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.buttonSave.Enabled = true;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
else
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.buttonSave.Enabled = false;
|
2023-07-21 04:42:01 +00:00
|
|
|
|
}
|
2023-09-05 06:48:00 +00:00
|
|
|
|
private void buttonSave_Click(object sender, EventArgs e)
|
2023-07-21 04:42:01 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
private void buttonFilter_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DialogFormDataViewerFilter form = new DialogFormDataViewerFilter(this);
|
|
|
|
|
|
if (form.ShowDialog() == DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 필터적용
|
|
|
|
|
|
this.ClearData();
|
|
|
|
|
|
this.UpdateListItem(this.ParentForm.CurrentDataViewerFilter);
|
|
|
|
|
|
this.UpdateDisplay();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void buttonUp_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.StartIndex == 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (this.StartIndex < 6)
|
|
|
|
|
|
this.ListBoxScrollUp();
|
|
|
|
|
|
else
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.ListBoxScrollUp(ListBoxLineCount);
|
2023-07-21 04:42:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
private void buttonDown_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.RemainCNT == 0)
|
|
|
|
|
|
{
|
2023-09-05 06:48:00 +00:00
|
|
|
|
if (this.CurrentCount != 0)
|
2023-07-21 04:42:01 +00:00
|
|
|
|
{
|
|
|
|
|
|
this.UpdateDisplayAddListBox();
|
|
|
|
|
|
}
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.RemainCNT < 6)
|
|
|
|
|
|
this.ListBoxScrollDown();
|
|
|
|
|
|
else
|
2023-09-05 06:48:00 +00:00
|
|
|
|
this.ListBoxScrollDown(ListBoxLineCount);
|
2023-07-21 04:42:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void listBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
SmartListBox lb = sender as SmartListBox;
|
|
|
|
|
|
|
|
|
|
|
|
if (lb == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
this.listBoxTime.SelectItemIndex = lb.SelectItemIndex;
|
|
|
|
|
|
this.listBoxLoginID.SelectItemIndex = lb.SelectItemIndex;
|
|
|
|
|
|
this.listBoxEvent.SelectItemIndex = lb.SelectItemIndex;
|
|
|
|
|
|
this.listBoxDetail.SelectItemIndex = lb.SelectItemIndex;
|
|
|
|
|
|
this.listBoxBefore.SelectItemIndex = lb.SelectItemIndex;
|
|
|
|
|
|
this.listBoxAfter.SelectItemIndex = lb.SelectItemIndex;
|
|
|
|
|
|
this.listBoxType.SelectItemIndex = lb.SelectItemIndex;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|