[성현모] tra 날짜 오류 수정, tra recovery 온도그래프, 버전셀렉트, ok avg 기능 추가
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
||||
using DevExpress.XtraPrinting;
|
||||
using DevExpress.XtraVerticalGrid;
|
||||
using DevExpress.XtraVerticalGrid.Rows;
|
||||
using System;
|
||||
@ -57,7 +58,7 @@ namespace SystemX.Product.TRA.UIControl
|
||||
|
||||
delegate void evtDBQueryFinished();
|
||||
event evtDBQueryFinished evtDBFin;
|
||||
|
||||
|
||||
public delegate void evtStepTrendViewHandler(TestTrendDataCollection data);
|
||||
|
||||
public event evtStepTrendViewHandler OnStepSelect;
|
||||
@ -84,9 +85,9 @@ namespace SystemX.Product.TRA.UIControl
|
||||
DBController = getDBController;
|
||||
|
||||
DataManager = new DMTestSummary(SelectView, DBController, dtStart);
|
||||
}
|
||||
}
|
||||
|
||||
public void ViewData(SelectedDataCollection data, DataTable DataList)
|
||||
public void ViewData(SelectedDataCollection data, DataTable DataList, int stepVersion = -1)
|
||||
{
|
||||
if (data == null)
|
||||
return;
|
||||
@ -109,7 +110,7 @@ namespace SystemX.Product.TRA.UIControl
|
||||
|
||||
try
|
||||
{
|
||||
ShowProperties(data);
|
||||
data.StepVersion = stepVersion.ToString();
|
||||
|
||||
SelectedData = data;
|
||||
DTTestLogList = DataList;
|
||||
@ -122,7 +123,12 @@ namespace SystemX.Product.TRA.UIControl
|
||||
string strGetStepVersion = dr[eColList.StepVersion.ToString()].ToString();
|
||||
int nCurStepVersion = int.MinValue;
|
||||
|
||||
if (int.TryParse(strGetStepVersion, out nCurStepVersion) == false)
|
||||
if (stepVersion > -1)
|
||||
{
|
||||
nGetStepVersion = stepVersion;
|
||||
ShowProperties(data);
|
||||
}
|
||||
else if (int.TryParse(strGetStepVersion, out nCurStepVersion) == false)
|
||||
{
|
||||
bOptionNewStepVersionBase = true;
|
||||
|
||||
@ -149,12 +155,12 @@ namespace SystemX.Product.TRA.UIControl
|
||||
DTLastestTestlistSrc = DataManager.SearchTestlist(data, nGetStepVersion, bOptionNewStepVersionBase);
|
||||
DTTestSummary = GetSummaryData(data, DataList);
|
||||
|
||||
ShowDetailData();
|
||||
ShowDetailData();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Searching Failure - {ex.Message}", "Test Trend - Error");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CloseWaitingForm()
|
||||
@ -166,12 +172,12 @@ namespace SystemX.Product.TRA.UIControl
|
||||
{
|
||||
DataTable dtSummary = new DataTable();
|
||||
List<Int64> vnpHistSummaryNo = (from drTest in DataList.AsEnumerable()
|
||||
where drTest[eColList.ParentNo.ToString()].ToString() != "-"
|
||||
let npValue = Convert.ToInt64(drTest[eColList.No.ToString()])
|
||||
select npValue).ToList();
|
||||
where drTest[eColList.ParentNo.ToString()].ToString() != "-"
|
||||
let npValue = Convert.ToInt64(drTest[eColList.No.ToString()])
|
||||
select npValue).ToList();
|
||||
|
||||
dtSummary = DataManager.SearchTestSummary(data.TestRequestID, vnpHistSummaryNo);
|
||||
|
||||
|
||||
evtDBFin();
|
||||
|
||||
return dtSummary;
|
||||
@ -184,13 +190,13 @@ namespace SystemX.Product.TRA.UIControl
|
||||
|
||||
DataTable dtFinal = new DataTable();
|
||||
|
||||
foreach(string strCol in Enum.GetNames(typeof(eColDataTable)))
|
||||
foreach (string strCol in Enum.GetNames(typeof(eColDataTable)))
|
||||
{
|
||||
Type typCol = typeof(string);
|
||||
|
||||
if (strCol == eColDataTable.StepNo.ToString())
|
||||
typCol = typeof(int);
|
||||
else if (strCol == eColDataTable.Duration.ToString()
|
||||
else if (strCol == eColDataTable.Duration.ToString()
|
||||
|| strCol == eColDataTable.Total.ToString()
|
||||
|| strCol == eColDataTable.OK.ToString()
|
||||
|| strCol == eColDataTable.NG.ToString())
|
||||
@ -266,7 +272,7 @@ namespace SystemX.Product.TRA.UIControl
|
||||
}
|
||||
|
||||
DataRow drDisp = dtFinal.NewRow();
|
||||
|
||||
|
||||
drDisp[eColDataTable.StepNo.ToString()] = Convert.ToInt32(Convert.ToInt32(drLog[eColTestSummary.StepID.ToString()]));
|
||||
|
||||
if (drTL != null)
|
||||
@ -277,14 +283,14 @@ namespace SystemX.Product.TRA.UIControl
|
||||
drDisp[eColDataTable.Function.ToString()] = drTL[eColTestlist.UseFunction.ToString()].ToString();
|
||||
|
||||
bool bIsGlobal = (Convert.ToInt32(drTL[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false;
|
||||
if(bIsGlobal == true)
|
||||
if (bIsGlobal == true)
|
||||
{
|
||||
}
|
||||
|
||||
drDisp[eColDataTable.Min.ToString()] = bIsGlobal ? "Global Var" : drTL[eColTestlist.SpecMin.ToString()].ToString();
|
||||
drDisp[eColDataTable.Max.ToString()] = bIsGlobal ? "Global Var" : drTL[eColTestlist.SpecMax.ToString()].ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var strMeasVal = drLog[eColTestSummary.Average.ToString()];
|
||||
int nOK = Convert.ToInt32(drLog[eColTestSummary.OK.ToString()]);
|
||||
int nNOK = Convert.ToInt32(drLog[eColTestSummary.NG.ToString()]);
|
||||
@ -337,7 +343,7 @@ namespace SystemX.Product.TRA.UIControl
|
||||
|
||||
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
|
||||
}
|
||||
|
||||
|
||||
void ShowProperties(SelectedDataCollection data)
|
||||
{
|
||||
vGridControlInfo.Rows.Clear();
|
||||
@ -357,7 +363,7 @@ namespace SystemX.Product.TRA.UIControl
|
||||
}
|
||||
|
||||
OnSizeChanged(vGridControlInfo);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void OnSizeChanged(VGridControl grid)
|
||||
@ -404,5 +410,36 @@ namespace SystemX.Product.TRA.UIControl
|
||||
OnStepSelect(dataSend);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExportData()
|
||||
{
|
||||
FolderBrowserDialog dlg = new FolderBrowserDialog();
|
||||
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
|
||||
string strFileName = CreateExportFileName();
|
||||
string strExpPath = dlg.SelectedPath + "\\" + strFileName;
|
||||
XlsxExportOptionsEx option = new XlsxExportOptionsEx();
|
||||
string strFile = strExpPath + ".xlsx";
|
||||
|
||||
option.ShowGridLines = true;
|
||||
option.ExportType = DevExpress.Export.ExportType.WYSIWYG;
|
||||
option.ExportMode = XlsxExportMode.SingleFile;
|
||||
option.SheetName = "Test Summary";
|
||||
gridControlMain.ExportToXlsx(strFile, option);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public string CreateExportFileName()
|
||||
{
|
||||
string strFileName = $"{this.ContentsType.ToString()}_{SelectedData.ProductNo}_{SelectedData.TestCode}_{SelectedData.StationName}";
|
||||
|
||||
strFileName += $"_{SelectedData.StartTime.ToString("yyyyMMddHHmmss")}-{SelectedData.EndTime.ToString("yyyyMMddHHmmss")}";
|
||||
|
||||
return strFileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user