데이터 통계 수정

master
sj84 2023-08-30 16:27:25 +09:00
parent 5add729191
commit e0cb32cee1
6 changed files with 1056 additions and 1201 deletions

View File

@ -17,6 +17,9 @@ namespace INT69DC_7C.DialogForms
{ {
#region Field #region Field
private FormDataStatistics m_ParentForm; private FormDataStatistics m_ParentForm;
public List<string> ListFiles; // 파일 리스트 - Part11 미사용 시
public List<DataBackupYear> ListInspectionFile; // 파일 리스트 - Part11 사용 시
#endregion #endregion
#region Constructor #region Constructor
@ -57,7 +60,13 @@ namespace INT69DC_7C.DialogForms
} }
private void DefaultSetting() private void DefaultSetting()
{ {
this.DisplayTreeViewUpdate(); this.ListFiles = new List<string>();
this.ListInspectionFile = new List<DataBackupYear>();
if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == false)
this.DisplayTreeViewUpdate11();
else
this.DisplayTreeViewUpdate2();
this.labelNodeIndex.Text = "-"; this.labelNodeIndex.Text = "-";
this.labelFileName.Text = "-"; this.labelFileName.Text = "-";
@ -66,94 +75,89 @@ namespace INT69DC_7C.DialogForms
this.labelId.Text = "-"; this.labelId.Text = "-";
} }
private Collection<List<string>> FileClassification(List<string> files) private List<string> DirectorySort(DirectoryInfo[] directorys)
{ {
string date = "", date1 = ""; List<string> listDirectory = new List<string>();
Collection<List<string>> fileClassification = new Collection<List<string>>(); Dictionary<string, int> dirNames = new Dictionary<string, int>();
List<string> list = new List<string>();
for (int i = 0; i < files.Count; i++) foreach (DirectoryInfo dir in directorys)
{ dirNames.Add(dir.Name, int.Parse(dir.Name));
date = files[i].Substring(0, 12);
if (i == 0)
date1 = date;
if (date == date1) // 순서데로 오름차순 정렬
{ var vrList = dirNames.OrderBy(x => x.Value);
list.Add(files[i]); foreach (var v in vrList)
} listDirectory.Add(v.Key);
else
{
date1 = date;
List<string> l = new List<string>(); return listDirectory;
foreach (string s in list)
l.Add(s);
fileClassification.Add(l);
list = new List<string>();
list.Add(files[i]);
}
}
List<string> ls = new List<string>();
foreach (string s in list)
ls.Add(s);
fileClassification.Add(ls);
return fileClassification;
} }
private List<string> FileSort(FileInfo[] files) private List<string> DayInspectionDirectorySort(FileInfo[] files)
{ {
List<string> listFiles = new List<string>(); string[] fileName;
Dictionary<string, int> fileNames = new Dictionary<string, int>(); List<string> listFile = new List<string>();
Dictionary<string, int> fileNamesSort = new Dictionary<string, int>(); Dictionary<string, int> dirNames = new Dictionary<string, int>();
#region File List 품번 순서데로 정렬
foreach (FileInfo file in files) foreach (FileInfo file in files)
{ {
if (file.Name.StartsWith("20") == true) fileName = file.Name.Split('_');
fileNames.Add(file.Name, int.Parse(file.Name.Substring(11, 1))); dirNames.Add(file.Name, int.Parse(fileName[1].Substring(0, fileName[1].Length - 4)));
} }
var vrList = fileNames.Keys.ToList(); var vrList = dirNames.OrderBy(x => x.Value);
vrList.Sort();
foreach (var v in vrList) foreach (var v in vrList)
fileNamesSort.Add(v, fileNames[v]); listFile.Add(v.Key);
#endregion
foreach (var v in fileNamesSort) #region File List 날짜 순서데로 정렬
listFiles.Add(v.Key); dirNames = new Dictionary<string, int>();
foreach (string f in listFile)
dirNames.Add(f, int.Parse(f.Substring(0, 8)));
return listFiles; listFile.Clear();
vrList = dirNames.OrderBy(x => x.Value);
foreach (var v in vrList)
listFile.Add(v.Key);
#endregion
return listFile;
} }
private List<string> FileSort(List<string> lst) private List<string> DayInspectionDirectorySort2(FileInfo[] files)
{ {
List<string> listFiles = new List<string>(); string[] fileName;
Dictionary<string, int> fileNames = new Dictionary<string, int>(); List<string> listFile = new List<string>();
Dictionary<string, int> fileNamesSort = new Dictionary<string, int>(); Dictionary<string, int> dirNames = new Dictionary<string, int>();
foreach (string list in lst) #region File List 품번 순서데로 정렬
foreach (FileInfo file in files)
{ {
if (list.Length == 22) fileName = file.Name.Split('_');
fileNames.Add(list, int.Parse(list.Substring(13, 1))); dirNames.Add(file.Name, int.Parse(fileName[1].Substring(0, fileName[1].Length - 4)));
else
fileNames.Add(list, int.Parse(list.Substring(13, 2)));
} }
// Lane 순서데로 오름차순 정렬 var vrList = dirNames.OrderBy(x => x.Value);
var vrList = fileNames.OrderBy(x => x.Value);
foreach (var v in vrList) foreach (var v in vrList)
listFiles.Add(v.Key); listFile.Add(v.Key);
#endregion
return listFiles; #region File List 날짜 순서데로 정렬
dirNames = new Dictionary<string, int>();
foreach (string f in listFile)
dirNames.Add(f, int.Parse(f.Substring(1, 8)));
listFile.Clear();
vrList = dirNames.OrderBy(x => x.Value);
foreach (var v in vrList)
listFile.Add(v.Key);
#endregion
return listFile;
} }
private void DisplayTreeViewUpdate() /// <summary>
/// Part11 미사용
/// </summary>
private void DisplayTreeViewUpdate11()
{ {
int fileCount = 0;
DirectoryInfo dir = new DirectoryInfo(this.ParentForm.ParentForm.PathDataBackupFolder); DirectoryInfo dir = new DirectoryInfo(this.ParentForm.ParentForm.PathDataBackupFolder);
List<string> fileNames = new List<string>(); List<string> fileNames = new List<string>();
@ -163,44 +167,108 @@ namespace INT69DC_7C.DialogForms
FileInfo[] files = dir.GetFiles(); FileInfo[] files = dir.GetFiles();
foreach (FileInfo file in files) if (files.Length != 0)
{ {
if (file.Name.StartsWith("20") == true) // 날짜, 품번 순으로 정렬
fileCount++; fileNames = this.DayInspectionDirectorySort(files);
} this.ListFiles = fileNames;
if (fileCount != 0) foreach (string name in fileNames)
{
// 파일 이름 순으로 정렬
fileNames = this.FileSort(files);
// 파일 날짜 순으로 분류
this.ParentForm.CollectionFileClassification = this.FileClassification(fileNames);
foreach (List<string> list in this.ParentForm.CollectionFileClassification)
{ {
List<string> myList = new List<string>(); this.treeView1.Nodes.Add(name);
}
}
}
/// <summary>
/// Part11 사용
/// </summary>
private void DisplayTreeViewUpdate2()
{
int fileCount = 0;
//TreeNode node;
List<string> years = new List<string>();
List<string> months = new List<string>();
List<string> days = new List<string>();
// Lane 순서데로 오름 차순 정렬 this.treeView1.Nodes.Clear();
if (list.Count > 1 && list[0].Length > 18) this.ListInspectionFile.Clear();
myList = this.FileSort(list);
else
myList = list;
TreeNode node = new TreeNode(myList[0].Substring(0, 12)); DirectoryInfo dir = new DirectoryInfo(this.ParentForm.ParentForm.PathDataInspectionFolder);
List<string> fileNames = new List<string>();
for (int i = 0; i < myList.Count; i++) // 폴더 체크
if (dir.Exists == false)
dir.Create();
// year 폴더 가져오기
DirectoryInfo[] yearDirectorys = dir.GetDirectories();
// year 폴더 정렬
years = this.DirectorySort(yearDirectorys);
// Inspection File 리스트 생성
if (years.Count != 0)
{
// Year
foreach (string year in years)
{
DataBackupYear y = new DataBackupYear(year);
DirectoryInfo monthDir = new DirectoryInfo(string.Format("{0}{1}", this.ParentForm.ParentForm.PathDataInspectionFolder, year));
DirectoryInfo[] monthDirectorys = monthDir.GetDirectories();
months = this.DirectorySort(monthDirectorys);
if (months.Count != 0)
{ {
node.Nodes.Add(myList[i]); // Month
} foreach (string month in months)
{
DirectoryInfo dayDir = new DirectoryInfo(string.Format("{0}{1}\\{2}", this.ParentForm.ParentForm.PathDataInspectionFolder, year, month));
FileInfo[] dayFiles = dayDir.GetFiles();
days = this.DayInspectionDirectorySort2(dayFiles);
DataBackupMonth m = new DataBackupMonth(month);
m.Days = days;
y.Months.Add(m);
}
this.ListInspectionFile.Add(y);
}
else
{
this.ListInspectionFile.Add(y);
}
}
// node 생성
for (int i = 0; i < this.ListInspectionFile.Count; i++)
{
TreeNode node = new TreeNode(this.ListInspectionFile[i].Year);
for (int j = 0; j < this.ListInspectionFile[i].Months.Count; j++)
{
TreeNode nodeMonth = new TreeNode(this.ListInspectionFile[i].Months[j].Month);
for (int k = 0; k < this.ListInspectionFile[i].Months[j].Days.Count; k++)
{
nodeMonth.Nodes.Add(this.ListInspectionFile[i].Months[j].Days[k]);
fileCount++;
}
node.Nodes.Add(nodeMonth);
}
this.treeView1.Nodes.Add(node); this.treeView1.Nodes.Add(node);
} }
} }
//this.labelInspectionFileCount.Text = fileCount.ToString();
} }
public void DisplayRefresh() public void DisplayRefresh()
{ {
this.DisplayTreeViewUpdate(); if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == false)
this.DisplayTreeViewUpdate11();
else
this.DisplayTreeViewUpdate2();
} }
#endregion #endregion
@ -209,30 +277,23 @@ namespace INT69DC_7C.DialogForms
{ {
int ret = 0; int ret = 0;
if (this.ParentForm.SelectNodeIndex == -1) if (this.ParentForm.SelectFilePath == "")
return; return;
this.treeView1.Enabled = false; this.treeView1.Enabled = false;
this.buttonRead.Enabled = false; this.buttonRead.Enabled = false;
this.buttonClose.Enabled = false; this.buttonClose.Enabled = false;
if (this.treeView1.Nodes.Count != 0) this.ParentForm.ClearData();
ret = this.ParentForm.DataRead();
if (ret == 0)
{ {
this.ParentForm.ClearData(); this.DialogResult = DialogResult.OK;
this.Close();
if (this.ParentForm.ParentForm.SystemConfig.EquipmentMode == 2)
ret = this.ParentForm.DataRead2();
else
ret = this.ParentForm.DataRead1();
if (ret == 0)
{
this.DialogResult = DialogResult.OK;
this.Close();
}
else
this.DialogResult = DialogResult.Cancel;
} }
else
this.DialogResult = DialogResult.Cancel;
this.treeView1.Enabled = true; this.treeView1.Enabled = true;
this.buttonRead.Enabled = true; this.buttonRead.Enabled = true;
@ -246,25 +307,34 @@ namespace INT69DC_7C.DialogForms
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{ {
string fileName = ""; string fileName = "", pathFileName = "";
string[] name;
if (e.Node.Parent == null) if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == false)
{ {
fileName = e.Node.Text; fileName = e.Node.Text;
this.ParentForm.SelectNodeIndex = e.Node.Index;
//this.labelNodeIndex.Text = string.Format("{0}", this.ParentForm.SelectNodeIndex + 1); this.ParentForm.SelectFilePath = string.Format("{0}{1}", this.ParentForm.ParentForm.PathDataBackupFolder, fileName);
name = fileName.Split('_');
this.labelFileName.Text = fileName;
this.labelDate.Text = string.Format("{0}.{1}.{2}", name[0].Substring(0, 4), name[0].Substring(4, 2), name[0].Substring(6, 2));
this.labelProductNo.Text = name[1].Substring(0, name[1].Length - 4);
} }
else else
{ {
fileName = e.Node.Parent.Text; if (e.Node.Text.Length > 10)
this.ParentForm.SelectNodeIndex = e.Node.Parent.Index; {
//this.labelNodeIndex.Text = string.Format("{0}", this.ParentForm.SelectNodeIndex + 1); fileName = e.Node.Text;
} pathFileName = string.Format("{0}{1}\\{2}\\{3}",
this.ParentForm.ParentForm.PathDataInspectionFolder, fileName.Substring(1, 4), int.Parse(fileName.Substring(5, 2)), fileName);
this.ParentForm.SelectFilePath = pathFileName;
this.labelFileName.Text = fileName; name = fileName.Split('_');
this.labelDate.Text = string.Format("{0}.{1}.{2}", fileName.Substring(0, 4), fileName.Substring(4, 2), fileName.Substring(6, 2)); this.labelFileName.Text = fileName;
this.labelProductNo.Text = fileName.Substring(9, 1); this.labelDate.Text = string.Format("{0}.{1}.{2}", name[0].Substring(1, 4), name[0].Substring(5, 2), name[0].Substring(7, 2));
this.labelId.Text = fileName.Substring(11, 1); this.labelProductNo.Text = name[1].Substring(0, name[1].Length - 4);
}
}
} }
#endregion #endregion
} }

View File

@ -21,16 +21,14 @@ namespace INT69DC_7C.Forms
public partial class FormDataStatistics : Form public partial class FormDataStatistics : Form
{ {
#region Field #region Field
private int m_SelectNodeIndex;
private int FileIndex; private int FileIndex;
public string SelectFilePath;
private FormMain m_ParentForm; private FormMain m_ParentForm;
public DataCommonList CurrentDataCommonList; public DataCommonList CurrentDataCommonList;
private Collection<string[]> CollectionWeightData; //스틱1 파일에서 읽은 데이터 private Collection<string[]> CollectionWeightData; //파일에서 읽은 데이터
private Collection<DataCollector> CollectionLaneData; //파일에서 읽은 데이터를 통계 계산 처리된 데이터 private Collection<DataCollector> CollectionLaneData; //파일에서 읽은 데이터를 통계 계산 처리된 데이터
public Collection<List<string>> CollectionFileClassification; // 스틱2 파일 리스트
private Collection<List<string[]>> CollectionWeightDataStick2; // 스틱2 파일에서 읽은 데이터
private Collection<SmartLabel> CollectionCommonLabel; private Collection<SmartLabel> CollectionCommonLabel;
private Collection<SmartLabel> CollectionLane; private Collection<SmartLabel> CollectionLane;
@ -66,12 +64,6 @@ namespace INT69DC_7C.Forms
#endregion #endregion
#region Property #region Property
public int SelectNodeIndex
{
get { return this.m_SelectNodeIndex; }
set { this.m_SelectNodeIndex = value; }
}
public FormMain ParentForm public FormMain ParentForm
{ {
get { return this.m_ParentForm; } get { return this.m_ParentForm; }
@ -256,11 +248,9 @@ namespace INT69DC_7C.Forms
private void DefaultSetting() private void DefaultSetting()
{ {
this.FileIndex = 0; this.FileIndex = 0;
this.SelectNodeIndex = -1; this.SelectFilePath = "";
this.CurrentDataCommonList = new DataCommonList(); this.CurrentDataCommonList = new DataCommonList();
this.CollectionFileClassification = new Collection<List<string>>();
this.CollectionWeightDataStick2 = new Collection<List<string[]>>();
this.CollectionWeightData = new Collection<string[]>(); this.CollectionWeightData = new Collection<string[]>();
this.CollectionLaneData = new Collection<DataCollector>(); this.CollectionLaneData = new Collection<DataCollector>();
@ -324,10 +314,7 @@ namespace INT69DC_7C.Forms
} }
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++) for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
this.CollectionWeightDataStick2.Add(new List<string[]>());
this.CollectionLaneData.Add(new DataCollector()); this.CollectionLaneData.Add(new DataCollector());
}
this.InitializeLabels(); this.InitializeLabels();
} }
@ -418,77 +405,6 @@ namespace INT69DC_7C.Forms
this.CurrentDataCommonList.TotalPassAverageWeight = passAverageWeight; this.CurrentDataCommonList.TotalPassAverageWeight = passAverageWeight;
this.CurrentDataCommonList.TotalPassVariance = passVariance; this.CurrentDataCommonList.TotalPassVariance = passVariance;
} }
private void SetCommonData(Collection<List<string[]>> datas, Collection<DataCollector> laneDatas)
{
double dValue1 = 0.0, dValue2 = 0.0, passSumWeight = 0.0, overSumWeight = 0.0, underSumWeight = 0.0, passAverageWeight = 0.0, passVariance = 0.0;
string sValue = "";
int underCount = 0, passCount = 0, overCount = 0, exNGCount = 0, index = -1;
for (int i = 0; i < datas.Count; i++)
{
if (datas[i].Count != 0)
{
index = i;
break;
}
}
this.CurrentDataCommonList.ProductName = datas[index][datas[index].Count - 1][3];
this.CurrentDataCommonList.Lot = datas[index][datas[index].Count - 1][4];
this.CurrentDataCommonList.StartTime = string.Format("{0} {1}", datas[index][0][0], datas[index][0][1]);
this.CurrentDataCommonList.EndTime = string.Format("{0} {1}", datas[index][datas[index].Count - 1][0], datas[index][datas[index].Count - 1][1]);
dValue1 = double.Parse(datas[index][datas[index].Count - 1][5]);
sValue = Helper.DoubleToString(dValue1, 1);
this.CurrentDataCommonList.UnderRange = sValue;
dValue1 = double.Parse(datas[index][datas[index].Count - 1][6]);
sValue = Helper.DoubleToString(dValue1, 1);
this.CurrentDataCommonList.PassRange = sValue;
dValue1 = double.Parse(datas[index][datas[index].Count - 1][7]);
sValue = Helper.DoubleToString(dValue1, 1);
this.CurrentDataCommonList.OverRange = sValue;
dValue1 = double.Parse(datas[index][datas[index].Count - 1][8]);
sValue = Helper.DoubleToString(dValue1, 1);
this.CurrentDataCommonList.TareRange = sValue;
for (int i = 0; i < laneDatas.Count; i++)
{
underCount += laneDatas[i].UnderTotalCount;
passCount += laneDatas[i].PassTotalCount;
overCount += laneDatas[i].OverTotalCount;
exNGCount += laneDatas[i].ExNgTotalCount;
passSumWeight += laneDatas[i].PassSumWeight;
overSumWeight += laneDatas[i].OverSumWeight;
underSumWeight += laneDatas[i].UnderSumWeight;
}
// 전체 정량 평균
passAverageWeight = passSumWeight / passCount;
// 전체 정량 분산
for (int i = 0; i < laneDatas.Count; i++)
{
for (int j = 0; j < laneDatas[i].PassWeightData.Count; j++)
{
dValue1 = passAverageWeight - laneDatas[i].PassWeightData[j];
dValue2 += dValue1 * dValue1;
}
}
passVariance = dValue2 / passCount;
this.CurrentDataCommonList.TotalUnderCount = underCount;
this.CurrentDataCommonList.TotalPassCount = passCount;
this.CurrentDataCommonList.TotalOverCount = overCount;
this.CurrentDataCommonList.TotalExNgCount = exNGCount;
this.CurrentDataCommonList.TotalPassSumWeight = passSumWeight;
this.CurrentDataCommonList.TotalOverSumWeight = overSumWeight;
this.CurrentDataCommonList.TotalUnderSumWeight = underSumWeight;
this.CurrentDataCommonList.TotalPassAverageWeight = passAverageWeight;
this.CurrentDataCommonList.TotalPassVariance = passVariance;
}
private void SetData(DataCollector data, string weight, DataStore.JudgmentStatus grade) private void SetData(DataCollector data, string weight, DataStore.JudgmentStatus grade)
{ {
if (grade == DataStore.JudgmentStatus.Pass) if (grade == DataStore.JudgmentStatus.Pass)
@ -580,105 +496,86 @@ namespace INT69DC_7C.Forms
} }
private void DataAnalysis() private void DataAnalysis()
{ {
if (this.ParentForm.SystemConfig.EquipmentMode == 2) #region Set Data
if (this.ParentForm.SystemConfig.EquipmentColumns == 7)
{ {
#region Stick 2 for (int i = 0; i < this.CollectionWeightData.Count; i++)
for (int i = 0; i < this.CollectionWeightDataStick2.Count; i++)
{ {
for (int j = 0; j < this.CollectionWeightDataStick2[i].Count; j++) this.SetData(this.CollectionLaneData[0], this.CollectionWeightData[i][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][10]));
{ this.SetData(this.CollectionLaneData[1], this.CollectionWeightData[i][11], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][12]));
this.SetData(this.CollectionLaneData[i], this.CollectionWeightDataStick2[i][j][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightDataStick2[i][j][10])); this.SetData(this.CollectionLaneData[2], this.CollectionWeightData[i][13], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][14]));
} this.SetData(this.CollectionLaneData[3], this.CollectionWeightData[i][15], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][16]));
this.SetData(this.CollectionLaneData[4], this.CollectionWeightData[i][17], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][18]));
this.SetData(this.CollectionLaneData[5], this.CollectionWeightData[i][19], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][20]));
this.SetData(this.CollectionLaneData[6], this.CollectionWeightData[i][21], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][22]));
}
}
else if (this.ParentForm.SystemConfig.EquipmentColumns == 8)
{
for (int i = 0; i < this.CollectionWeightData.Count; i++)
{
this.SetData(this.CollectionLaneData[0], this.CollectionWeightData[i][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][10]));
this.SetData(this.CollectionLaneData[1], this.CollectionWeightData[i][11], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][12]));
this.SetData(this.CollectionLaneData[2], this.CollectionWeightData[i][13], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][14]));
this.SetData(this.CollectionLaneData[3], this.CollectionWeightData[i][15], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][16]));
this.SetData(this.CollectionLaneData[4], this.CollectionWeightData[i][17], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][18]));
this.SetData(this.CollectionLaneData[5], this.CollectionWeightData[i][19], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][20]));
this.SetData(this.CollectionLaneData[6], this.CollectionWeightData[i][21], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][22]));
this.SetData(this.CollectionLaneData[7], this.CollectionWeightData[i][23], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][24]));
}
}
else if (this.ParentForm.SystemConfig.EquipmentColumns == 10)
{
for (int i = 0; i < this.CollectionWeightData.Count; i++)
{
this.SetData(this.CollectionLaneData[0], this.CollectionWeightData[i][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][10]));
this.SetData(this.CollectionLaneData[1], this.CollectionWeightData[i][11], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][12]));
this.SetData(this.CollectionLaneData[2], this.CollectionWeightData[i][13], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][14]));
this.SetData(this.CollectionLaneData[3], this.CollectionWeightData[i][15], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][16]));
this.SetData(this.CollectionLaneData[4], this.CollectionWeightData[i][17], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][18]));
this.SetData(this.CollectionLaneData[5], this.CollectionWeightData[i][19], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][20]));
this.SetData(this.CollectionLaneData[6], this.CollectionWeightData[i][21], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][22]));
this.SetData(this.CollectionLaneData[7], this.CollectionWeightData[i][23], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][24]));
this.SetData(this.CollectionLaneData[8], this.CollectionWeightData[i][25], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][26]));
this.SetData(this.CollectionLaneData[9], this.CollectionWeightData[i][27], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][28]));
} }
#endregion
} }
else else
{ {
#region Stick 1,3 for (int i = 0; i < this.CollectionWeightData.Count; i++)
if (this.ParentForm.SystemConfig.EquipmentColumns == 7)
{ {
for (int i = 0; i < this.CollectionWeightData.Count; i++) this.SetData(this.CollectionLaneData[0], this.CollectionWeightData[i][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][10]));
{ this.SetData(this.CollectionLaneData[1], this.CollectionWeightData[i][11], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][12]));
this.SetData(this.CollectionLaneData[0], this.CollectionWeightData[i][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][10])); this.SetData(this.CollectionLaneData[2], this.CollectionWeightData[i][13], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][14]));
this.SetData(this.CollectionLaneData[1], this.CollectionWeightData[i][11], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][12])); this.SetData(this.CollectionLaneData[3], this.CollectionWeightData[i][15], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][16]));
this.SetData(this.CollectionLaneData[2], this.CollectionWeightData[i][13], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][14])); this.SetData(this.CollectionLaneData[4], this.CollectionWeightData[i][17], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][18]));
this.SetData(this.CollectionLaneData[3], this.CollectionWeightData[i][15], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][16])); this.SetData(this.CollectionLaneData[5], this.CollectionWeightData[i][19], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][20]));
this.SetData(this.CollectionLaneData[4], this.CollectionWeightData[i][17], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][18])); this.SetData(this.CollectionLaneData[6], this.CollectionWeightData[i][21], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][22]));
this.SetData(this.CollectionLaneData[5], this.CollectionWeightData[i][19], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][20])); this.SetData(this.CollectionLaneData[7], this.CollectionWeightData[i][23], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][24]));
this.SetData(this.CollectionLaneData[6], this.CollectionWeightData[i][21], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][22])); this.SetData(this.CollectionLaneData[8], this.CollectionWeightData[i][25], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][26]));
} this.SetData(this.CollectionLaneData[9], this.CollectionWeightData[i][27], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][28]));
this.SetData(this.CollectionLaneData[10], this.CollectionWeightData[i][29], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][30]));
this.SetData(this.CollectionLaneData[11], this.CollectionWeightData[i][31], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][32]));
} }
else if (this.ParentForm.SystemConfig.EquipmentColumns == 8) }
{ #endregion
for (int i = 0; i < this.CollectionWeightData.Count; i++)
{
this.SetData(this.CollectionLaneData[0], this.CollectionWeightData[i][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][10]));
this.SetData(this.CollectionLaneData[1], this.CollectionWeightData[i][11], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][12]));
this.SetData(this.CollectionLaneData[2], this.CollectionWeightData[i][13], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][14]));
this.SetData(this.CollectionLaneData[3], this.CollectionWeightData[i][15], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][16]));
this.SetData(this.CollectionLaneData[4], this.CollectionWeightData[i][17], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][18]));
this.SetData(this.CollectionLaneData[5], this.CollectionWeightData[i][19], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][20]));
this.SetData(this.CollectionLaneData[6], this.CollectionWeightData[i][21], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][22]));
this.SetData(this.CollectionLaneData[7], this.CollectionWeightData[i][23], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][24]));
}
}
else if (this.ParentForm.SystemConfig.EquipmentColumns == 10)
{
for (int i = 0; i < this.CollectionWeightData.Count; i++)
{
this.SetData(this.CollectionLaneData[0], this.CollectionWeightData[i][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][10]));
this.SetData(this.CollectionLaneData[1], this.CollectionWeightData[i][11], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][12]));
this.SetData(this.CollectionLaneData[2], this.CollectionWeightData[i][13], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][14]));
this.SetData(this.CollectionLaneData[3], this.CollectionWeightData[i][15], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][16]));
this.SetData(this.CollectionLaneData[4], this.CollectionWeightData[i][17], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][18]));
this.SetData(this.CollectionLaneData[5], this.CollectionWeightData[i][19], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][20]));
this.SetData(this.CollectionLaneData[6], this.CollectionWeightData[i][21], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][22]));
this.SetData(this.CollectionLaneData[7], this.CollectionWeightData[i][23], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][24]));
this.SetData(this.CollectionLaneData[8], this.CollectionWeightData[i][25], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][26]));
this.SetData(this.CollectionLaneData[9], this.CollectionWeightData[i][27], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][28]));
}
}
else
{
for (int i = 0; i < this.CollectionWeightData.Count; i++)
{
this.SetData(this.CollectionLaneData[0], this.CollectionWeightData[i][9], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][10]));
this.SetData(this.CollectionLaneData[1], this.CollectionWeightData[i][11], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][12]));
this.SetData(this.CollectionLaneData[2], this.CollectionWeightData[i][13], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][14]));
this.SetData(this.CollectionLaneData[3], this.CollectionWeightData[i][15], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][16]));
this.SetData(this.CollectionLaneData[4], this.CollectionWeightData[i][17], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][18]));
this.SetData(this.CollectionLaneData[5], this.CollectionWeightData[i][19], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][20]));
this.SetData(this.CollectionLaneData[6], this.CollectionWeightData[i][21], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][22]));
this.SetData(this.CollectionLaneData[7], this.CollectionWeightData[i][23], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][24]));
this.SetData(this.CollectionLaneData[8], this.CollectionWeightData[i][25], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][26]));
this.SetData(this.CollectionLaneData[9], this.CollectionWeightData[i][27], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][28]));
this.SetData(this.CollectionLaneData[10], this.CollectionWeightData[i][29], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][30]));
this.SetData(this.CollectionLaneData[11], this.CollectionWeightData[i][31], Helper.StringToJudgmentStatusStatistics(this.CollectionWeightData[i][32]));
}
}
#endregion
}
for (int i = 0; i < this.CollectionLaneData.Count; i++) for (int i = 0; i < this.CollectionLaneData.Count; i++)
this.CollectionLaneData[i].StatisticalAnalysis(); this.CollectionLaneData[i].StatisticalAnalysis();
if (this.ParentForm.SystemConfig.EquipmentMode == 2) this.SetCommonData(this.CollectionWeightData, this.CollectionLaneData);
this.SetCommonData(this.CollectionWeightDataStick2, this.CollectionLaneData);
else
this.SetCommonData(this.CollectionWeightData, this.CollectionLaneData);
this.UpdateDisplay(this.CurrentDataCommonList, this.CollectionLaneData); this.UpdateDisplay(this.CurrentDataCommonList, this.CollectionLaneData);
} }
public int DataRead1() public int DataRead()
{ {
string path = "";
int ret = 0, flag = 0; int ret = 0, flag = 0;
long count = 0; long count = 0;
SmartX.SmartSplash splash; if (this.SelectFilePath == "")
return ret = -1;
splash = new SmartX.SmartSplash(); SmartSplash splash = new SmartSplash();
splash.CenterPosition = true; splash.CenterPosition = true;
splash.AnimationInterval = 100; splash.AnimationInterval = 100;
splash.LoadingImagePathname = "SmartLoading4"; splash.LoadingImagePathname = "SmartLoading4";
@ -686,9 +583,7 @@ namespace INT69DC_7C.Forms
this.CollectionWeightData.Clear(); this.CollectionWeightData.Clear();
path = string.Format("{0}{1}", this.ParentForm.PathDataBackupFolder, this.CollectionFileClassification[this.SelectNodeIndex][0]); this.ParentForm.smartFileIO.FilePathName = this.SelectFilePath;
this.ParentForm.smartFileIO.FilePathName = path;
this.ParentForm.smartFileIO.Open(2000000); this.ParentForm.smartFileIO.Open(2000000);
this.ParentForm.smartFileIO.ReadStringAllBuffer(); this.ParentForm.smartFileIO.ReadStringAllBuffer();
@ -725,57 +620,6 @@ namespace INT69DC_7C.Forms
return ret; return ret;
} }
public int DataRead2()
{
string path = "", lane = "";
int ret = 0, index = 0;
List<string[]> lt;
SmartX.SmartSplash splash;
splash = new SmartX.SmartSplash();
splash.CenterPosition = true;
splash.AnimationInterval = 100;
splash.LoadingImagePathname = "SmartLoading4";
splash.Start();
lt = new List<string[]>();
// 열별로 삭제
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
this.CollectionWeightDataStick2[i].Clear();
try
{
for (int i = 0; i < this.CollectionFileClassification[this.SelectNodeIndex].Count; i++)
{
lt.Clear();
if (this.CollectionFileClassification[this.SelectNodeIndex][i].Length == 22)
lane = this.CollectionFileClassification[this.SelectNodeIndex][i].Substring(13, 1);
else
lane = this.CollectionFileClassification[this.SelectNodeIndex][i].Substring(13, 2);
index = int.Parse(lane);
path = string.Format("{0}{1}", this.ParentForm.PathDataBackupFolder, this.CollectionFileClassification[this.SelectNodeIndex][i]);
this.LoadDataBackupFile(ref this.CollectionWeightDataStick2, path, index - 1);
}
this.DataAnalysis();
splash.Finish();
ret = 0;
}
catch
{
ret = -1;
splash.Finish();
DialogFormMessage msg = new DialogFormMessage(13, this.ParentForm.SystemConfig.Language);
msg.ShowDialog();
this.ParentForm.smartFileIO.Close();
}
return ret;
}
public void ClearData() public void ClearData()
{ {
this.InitializeLabels(); this.InitializeLabels();
@ -1050,7 +894,7 @@ namespace INT69DC_7C.Forms
} }
private void buttonFileSelect_Click(object sender, EventArgs e) private void buttonFileSelect_Click(object sender, EventArgs e)
{ {
this.SelectNodeIndex = -1; this.SelectFilePath = "";
DialogFormDataStatistics form = new DialogFormDataStatistics(this); DialogFormDataStatistics form = new DialogFormDataStatistics(this);
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)

View File

@ -47,10 +47,11 @@
this.timerTimeoutOPT4_OnlineCheck = new System.Windows.Forms.Timer(); this.timerTimeoutOPT4_OnlineCheck = new System.Windows.Forms.Timer();
this.smartSerialPortCom3 = new SmartX.SmartSerialPort(); this.smartSerialPortCom3 = new SmartX.SmartSerialPort();
this.smartTCPMultiServer = new SmartX.SmartTCPMultiServer(); this.smartTCPMultiServer = new SmartX.SmartTCPMultiServer();
this.timerTimeOutOPT = new System.Windows.Forms.Timer(); this.timerTimeOutCOM3 = new System.Windows.Forms.Timer();
this.timerTimeOutOPT_Ethernet = new System.Windows.Forms.Timer(); this.timerTimeOutEthernet = new System.Windows.Forms.Timer();
this.timerTimeOutOPT2 = new System.Windows.Forms.Timer(); this.timerTimeOutATPC = new System.Windows.Forms.Timer();
this.timerUserList = new System.Windows.Forms.Timer(); this.timerUserList = new System.Windows.Forms.Timer();
this.timerTimeOutDB = new System.Windows.Forms.Timer();
((System.ComponentModel.ISupportInitialize)(this.smartForm)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.smartForm)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -190,26 +191,31 @@
this.smartTCPMultiServer.ReceiveTimeout = 3000; this.smartTCPMultiServer.ReceiveTimeout = 3000;
this.smartTCPMultiServer.OnReceiveHandler += new SmartX.SmartTCPMultiServer.ReceiveHandler(this.smartTCPMultiServer_OnReceiveHandler); this.smartTCPMultiServer.OnReceiveHandler += new SmartX.SmartTCPMultiServer.ReceiveHandler(this.smartTCPMultiServer_OnReceiveHandler);
// //
// timerTimeOutOPT // timerTimeOutCOM3
// //
this.timerTimeOutOPT.Interval = 300; this.timerTimeOutCOM3.Interval = 300;
this.timerTimeOutOPT.Tick += new System.EventHandler(this.timerTimeOutOPT_Tick); this.timerTimeOutCOM3.Tick += new System.EventHandler(this.timerTimeOutCOM3_Tick);
// //
// timerTimeOutOPT_Ethernet // timerTimeOutEthernet
// //
this.timerTimeOutOPT_Ethernet.Interval = 300; this.timerTimeOutEthernet.Interval = 300;
this.timerTimeOutOPT_Ethernet.Tick += new System.EventHandler(this.timerTimeOutOPT_Ethernet_Tick); this.timerTimeOutEthernet.Tick += new System.EventHandler(this.timerTimeOutEthernet_Tick);
// //
// timerTimeOutOPT2 // timerTimeOutATPC
// //
this.timerTimeOutOPT2.Interval = 300; this.timerTimeOutATPC.Interval = 300;
this.timerTimeOutOPT2.Tick += new System.EventHandler(this.timerTimeOutOPT2_Tick); this.timerTimeOutATPC.Tick += new System.EventHandler(this.timerTimeOutATPC_Tick);
// //
// timerUserList // timerUserList
// //
this.timerUserList.Interval = 1000; this.timerUserList.Interval = 1000;
this.timerUserList.Tick += new System.EventHandler(this.timerUserList_Tick); this.timerUserList.Tick += new System.EventHandler(this.timerUserList_Tick);
// //
// timerTimeOutDB
//
this.timerTimeOutDB.Interval = 300;
this.timerTimeOutDB.Tick += new System.EventHandler(this.timerTimeOutDB_Tick);
//
// FormMain // FormMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@ -244,9 +250,10 @@
private System.Windows.Forms.Timer timerTimeoutOPT4_OnlineCheck; private System.Windows.Forms.Timer timerTimeoutOPT4_OnlineCheck;
public SmartX.SmartSerialPort smartSerialPortCom3; public SmartX.SmartSerialPort smartSerialPortCom3;
public SmartX.SmartTCPMultiServer smartTCPMultiServer; public SmartX.SmartTCPMultiServer smartTCPMultiServer;
public System.Windows.Forms.Timer timerTimeOutOPT; public System.Windows.Forms.Timer timerTimeOutCOM3;
public System.Windows.Forms.Timer timerTimeOutOPT_Ethernet; public System.Windows.Forms.Timer timerTimeOutEthernet;
public System.Windows.Forms.Timer timerTimeOutOPT2; public System.Windows.Forms.Timer timerTimeOutATPC;
private System.Windows.Forms.Timer timerUserList; private System.Windows.Forms.Timer timerUserList;
public System.Windows.Forms.Timer timerTimeOutDB;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -168,18 +168,21 @@
<metadata name="smartTCPMultiServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="smartTCPMultiServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1063, 54</value> <value>1063, 54</value>
</metadata> </metadata>
<metadata name="timerTimeOutOPT.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timerTimeOutCOM3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>141, 93</value> <value>141, 93</value>
</metadata> </metadata>
<metadata name="timerTimeOutOPT_Ethernet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timerTimeOutEthernet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>293, 93</value> <value>293, 93</value>
</metadata> </metadata>
<metadata name="timerTimeOutOPT2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timerTimeOutATPC.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1231, 54</value> <value>1231, 54</value>
</metadata> </metadata>
<metadata name="timerUserList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timerUserList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 93</value> <value>17, 93</value>
</metadata> </metadata>
<metadata name="timerTimeOutDB.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>469, 93</value>
</metadata>
<metadata name="$this.FormFactorShadowProperty" xml:space="preserve"> <metadata name="$this.FormFactorShadowProperty" xml:space="preserve">
<value>WEBPAD</value> <value>WEBPAD</value>
</metadata> </metadata>
@ -187,6 +190,6 @@
<value>False</value> <value>False</value>
</metadata> </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>92</value> <value>145</value>
</metadata> </metadata>
</root> </root>

View File

@ -1275,8 +1275,10 @@ namespace INT69DC_7C.Forms
this.timerTimeout.Enabled = false; this.timerTimeout.Enabled = false;
this.labelTimeroutCount.Visible = false; this.labelTimeroutCount.Visible = false;
this.ParentForm.timerTimeOutOPT.Enabled = false; this.ParentForm.timerTimeOutCOM3.Enabled = false;
this.ParentForm.timerTimeOutOPT.Interval = jItem.JudgmentDelayTime - 100; this.ParentForm.timerTimeOutCOM3.Interval = jItem.JudgmentDelayTime - 100;
this.ParentForm.timerTimeOutEthernet.Enabled = false;
this.ParentForm.timerTimeOutEthernet.Interval = jItem.JudgmentDelayTime - 100;
value = pItem.Number.ToString(); value = pItem.Number.ToString();
if (this.buttonProductNo.Text != value) if (this.buttonProductNo.Text != value)