[성현모] TestTrend 기능 추가
This commit is contained in:
@ -1,9 +1,9 @@
|
|||||||
<RadzenCard Style="@($"height:100%;{CardStyle};")" class="rz-mb-3 rz-p-0">
|
<RadzenCard Style="@($"height:100%;{CardStyle}; margin:0 !important;")" class="rz-mb-3 rz-p-0">
|
||||||
<RadzenStack Style="width:100%; height:2.7rem; background-color:var(--rz-primary-lighter);" class="rz-pl-3">
|
<RadzenStack Style="width:100%; height:2.7rem; background-color:var(--rz-primary-lighter);" class="rz-pl-3">
|
||||||
<RadzenLabel class="rz-p-1" Text="@HeaderText">
|
<RadzenLabel class="rz-p-1" Text="@HeaderText">
|
||||||
</RadzenLabel>
|
</RadzenLabel>
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
<RadzenStack Style="@($"height:{ContentsHeight}")" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Start">
|
<RadzenStack Style="@($"height:{ContentsHeight}; overflow:auto;")" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Start">
|
||||||
@ChildContent
|
@ChildContent
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
</RadzenCard>
|
</RadzenCard>
|
||||||
|
|||||||
@ -107,7 +107,10 @@
|
|||||||
public EventCallback<TDataModel> OnSelectRow { get; set; }
|
public EventCallback<TDataModel> OnSelectRow { get; set; }
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<TDataModel> OnDoubleClickRow{ get; set; }
|
public EventCallback<SelectRow> OnDoubleClickRow { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public int ParentTabId { get; set; }
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public bool VisibleRowNo { get; set; }
|
public bool VisibleRowNo { get; set; }
|
||||||
@ -197,6 +200,12 @@
|
|||||||
|
|
||||||
private async Task OnRowDoublClick(DataGridRowMouseEventArgs<TDataModel> args)
|
private async Task OnRowDoublClick(DataGridRowMouseEventArgs<TDataModel> args)
|
||||||
{
|
{
|
||||||
await OnDoubleClickRow.InvokeAsync(args.Data);
|
var selectRow = new SelectRow
|
||||||
|
{
|
||||||
|
Row = args.Data as IDataModel,
|
||||||
|
ParentTabID = ParentTabId
|
||||||
|
};
|
||||||
|
|
||||||
|
await OnDoubleClickRow.InvokeAsync(selectRow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
<!--Function Block-->
|
<!--Function Block-->
|
||||||
<RadzenStack Style="height:10rem; width:fit-content;" class="rz-border-right rz-pr-5" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Start">
|
<RadzenStack Style="height:10rem; width:fit-content;" class="rz-border-right rz-pr-5" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Start">
|
||||||
<RadzenStack Style="font-size:1.5rem;" Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Center">
|
<RadzenStack Style="font-size:1.5rem;" Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Center">
|
||||||
<RadzenStack Style="cursor: pointer;" class="" Orientation="Orientation.Vertical" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Start" @onclick="@OnSummary">
|
<RadzenStack Style="cursor: pointer;" class="" Orientation="Orientation.Vertical" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Start" @onclick="@(() => OnSummary())">
|
||||||
<RadzenIcon Style="font-size: 3.5rem; font-weight:400; color:var(--rz-info)" Icon="ssid_chart"></RadzenIcon>
|
<RadzenIcon Style="font-size: 3.5rem; font-weight:400; color:var(--rz-info)" Icon="ssid_chart"></RadzenIcon>
|
||||||
<RadzenLabel Style="font-size: 1.5rem; cursor:pointer; color:var(--rz-info)" Text="Summary"></RadzenLabel>
|
<RadzenLabel Style="font-size: 1.5rem; cursor:pointer; color:var(--rz-info)" Text="Summary"></RadzenLabel>
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
@ -124,14 +124,14 @@
|
|||||||
|
|
||||||
@if (tab.Key.EnumTab == EnumTabs.OverviewC1Detail || tab.Key.EnumTab == EnumTabs.OverviewC1DetailMerged)
|
@if (tab.Key.EnumTab == EnumTabs.OverviewC1Detail || tab.Key.EnumTab == EnumTabs.OverviewC1DetailMerged)
|
||||||
{
|
{
|
||||||
<TraGrid TDataModel="Overview" DataList="@(tab.Value.Cast<Overview>())" EnumTab="@tab.Key.EnumTab"
|
<TraGrid TDataModel="Overview" DataList="@(tab.Value.Cast<Overview>())" EnumTab="@tab.Key.EnumTab" ParentTabId="@tab.Key.Id"
|
||||||
OnSelectRow="@OnSelectRowOverview" OnDoubleClickRow="@OnDoubleClickRowDetailOverview" HostColumnMerge>
|
OnSelectRow="@OnSelectRowOverview" OnDoubleClickRow="@OnDoubleClickRowDetailOverview" HostColumnMerge>
|
||||||
</TraGrid>
|
</TraGrid>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (tab.Key.EnumTab == EnumTabs.TestHistoryC1)
|
@if (tab.Key.EnumTab == EnumTabs.TestHistoryC1)
|
||||||
{
|
{
|
||||||
<TraGrid TDataModel="TestHistory" DataList="@(tab.Value.Cast<TestHistory>())" EnumTab="@tab.Key.EnumTab"
|
<TraGrid TDataModel="TestHistory" DataList="@(tab.Value.Cast<TestHistory>())" EnumTab="@tab.Key.EnumTab" ParentTabId="@tab.Key.Id"
|
||||||
OnSelectRow="@OnSelectRowOverview" OnDoubleClickRow="@OnDoubleClickRowHistory" VisibleRowNo HostColumnMerge="false">
|
OnSelectRow="@OnSelectRowOverview" OnDoubleClickRow="@OnDoubleClickRowHistory" VisibleRowNo HostColumnMerge="false">
|
||||||
</TraGrid>
|
</TraGrid>
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@
|
|||||||
<!--Test Info-->
|
<!--Test Info-->
|
||||||
<RadzenStack Style="width:35rem; font-size: 1.5rem; height: inherit;">
|
<RadzenStack Style="width:35rem; font-size: 1.5rem; height: inherit;">
|
||||||
@{
|
@{
|
||||||
var history = tab.Key.Parent as TestHistory;
|
var history = tab.Key.Parent.Parent as TestHistory;
|
||||||
if(history.TestResult.ToLower().Contains("ok") == true)
|
if(history.TestResult.ToLower().Contains("ok") == true)
|
||||||
{
|
{
|
||||||
<RadzenLabel Style="width:inherit; height: 5rem; min-height:5rem; background:var(--rz-success); border: solid 2px var(--rz-grid-hover-color); overflow:auto;" class="rz-shadow-1"/>
|
<RadzenLabel Style="width:inherit; height: 5rem; min-height:5rem; background:var(--rz-success); border: solid 2px var(--rz-grid-hover-color); overflow:auto;" class="rz-shadow-1"/>
|
||||||
@ -174,7 +174,7 @@
|
|||||||
@if(tab.Value?.Count > 0)
|
@if(tab.Value?.Count > 0)
|
||||||
{
|
{
|
||||||
<TraGrid TDataModel="ParseTestResult" DataList="@(tab.Value.Cast<ParseTestResult>())"
|
<TraGrid TDataModel="ParseTestResult" DataList="@(tab.Value.Cast<ParseTestResult>())"
|
||||||
HostColumnMerge="false" EnumTab="@tab.Key.EnumTab">
|
HostColumnMerge="false" EnumTab="@tab.Key.EnumTab" ParentTabId="@tab.Key.Id">
|
||||||
</TraGrid>
|
</TraGrid>
|
||||||
}
|
}
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
@ -187,7 +187,7 @@
|
|||||||
<!--Test Info-->
|
<!--Test Info-->
|
||||||
<RadzenStack Style="width:35rem; font-size: 1.5rem; height: inherit;">
|
<RadzenStack Style="width:35rem; font-size: 1.5rem; height: inherit;">
|
||||||
@{
|
@{
|
||||||
var history = tab.Key.Parent as TestSummaryInformation;
|
var history = tab.Key.Parent.Parent as TestSummaryInformation;
|
||||||
<TitleCard HeaderText="Test Information" ContentsHeight="calc(100% - 5rem);" CardStyle="overflow:auto;">
|
<TitleCard HeaderText="Test Information" ContentsHeight="calc(100% - 5rem);" CardStyle="overflow:auto;">
|
||||||
<RadzenStack Style="padding:1rem; color: var(--rz-grid-hover-color); overflow-y:auto; align-items:flex-start;">
|
<RadzenStack Style="padding:1rem; color: var(--rz-grid-hover-color); overflow-y:auto; align-items:flex-start;">
|
||||||
@foreach (var prop in history.GetType().GetProperties())
|
@foreach (var prop in history.GetType().GetProperties())
|
||||||
@ -206,9 +206,92 @@
|
|||||||
<RadzenStack Style="height:inherit;">
|
<RadzenStack Style="height:inherit;">
|
||||||
@if (tab.Value?.Count > 0)
|
@if (tab.Value?.Count > 0)
|
||||||
{
|
{
|
||||||
<TraGrid TDataModel="ParseTestSummary" DataList="@(tab.Value.Cast<ParseTestSummary>())"
|
<TraGrid TDataModel="ParseTestSummary" DataList="@(tab.Value.Cast<ParseTestSummary>())" ParentTabId="@tab.Key.Parent.TabID"
|
||||||
|
HostColumnMerge="false" EnumTab="@tab.Key.EnumTab" OnDoubleClickRow="@OnDoubleClickRowSummary">
|
||||||
|
</TraGrid>
|
||||||
|
}
|
||||||
|
</RadzenStack>
|
||||||
|
</RadzenStack>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (tab.Key.EnumTab == EnumTabs.TestTrendC1)
|
||||||
|
{
|
||||||
|
<!--Test Info-->
|
||||||
|
<RadzenStack Orientation="Orientation.Horizontal">
|
||||||
|
<RadzenStack Style="width:35rem; font-size: 1.5rem; height: inherit; overflow:auto;">
|
||||||
|
@{
|
||||||
|
var trend = tab.Key.Parent.Parent as TestTrend;
|
||||||
|
<TitleCard HeaderText="Test Step Info." ContentsHeight="27rem" CardStyle="">
|
||||||
|
<RadzenStack Style="padding:1rem; color: var(--rz-grid-hover-color); overflow-y:auto; align-items:flex-start;">
|
||||||
|
@foreach (var prop in trend.TestStepInfo.GetType().GetProperties())
|
||||||
|
{
|
||||||
|
if (prop.Name.ToLower().Contains("min") || prop.Name.ToLower().Contains("max") || prop.Name.ToLower().Contains("average"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
<RadzenStack Style="width:100%; background-color:transparent;" class="rz-border-bottom rz-p-1 rz-pb-2" Orientation="Orientation.Horizontal">
|
||||||
|
<span style="width:12rem; min-width:12rem; font-size: 1.3rem;">@prop.Name</span>
|
||||||
|
<BlockLabel Text="@prop.GetValue(trend.TestStepInfo).ToString()" MaxWidth="20rem"></BlockLabel>
|
||||||
|
</RadzenStack>
|
||||||
|
}
|
||||||
|
</RadzenStack>
|
||||||
|
</TitleCard>
|
||||||
|
|
||||||
|
<TitleCard HeaderText="Test Data Info." ContentsHeight="27rem" CardStyle="">
|
||||||
|
<RadzenStack Style="padding:1rem; color: var(--rz-grid-hover-color); overflow-y:auto; align-items:flex-start;">
|
||||||
|
@foreach (var prop in trend.TestDataInfo.GetType().GetProperties())
|
||||||
|
{
|
||||||
|
if (prop.Name.ToLower().Contains("min") || prop.Name.ToLower().Contains("max") || prop.Name.ToLower().Contains("average"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
<RadzenStack Style="width:100%; background-color:transparent;" class="rz-border-bottom rz-p-1 rz-pb-2" Orientation="Orientation.Horizontal">
|
||||||
|
<span style="width:12rem; min-width:12rem; font-size: 1.3rem;">@prop.Name</span>
|
||||||
|
<BlockLabel Text="@prop.GetValue(trend.TestDataInfo).ToString()" MaxWidth="20rem"></BlockLabel>
|
||||||
|
</RadzenStack>
|
||||||
|
}
|
||||||
|
</RadzenStack>
|
||||||
|
</TitleCard>
|
||||||
|
|
||||||
|
<TitleCard HeaderText="Measured Data Analysis" ContentsHeight="27rem" CardStyle="">
|
||||||
|
<RadzenStack Style="padding:1rem; color: var(--rz-grid-hover-color); overflow-y:auto; align-items:flex-start;">
|
||||||
|
@foreach (var prop in trend.MesuredDataAnalysis.GetType().GetProperties())
|
||||||
|
{
|
||||||
|
<RadzenStack Style="width:100%; background-color:transparent;" class="rz-border-bottom rz-p-1 rz-pb-2" Orientation="Orientation.Horizontal">
|
||||||
|
<span style="width:12rem; min-width:12rem; font-size: 1.3rem;">@prop.Name</span>
|
||||||
|
<BlockLabel Text="@prop.GetValue(trend.MesuredDataAnalysis).ToString()" MaxWidth="20rem"></BlockLabel>
|
||||||
|
</RadzenStack>
|
||||||
|
}
|
||||||
|
</RadzenStack>
|
||||||
|
</TitleCard>
|
||||||
|
}
|
||||||
|
</RadzenStack>
|
||||||
|
<RadzenStack Style="width:calc(100vw - 40rem); height:inherit;" Orientation="Orientation.Horizontal">
|
||||||
|
<!--TestResult-->
|
||||||
|
@if (tab.Value?.Count > 0)
|
||||||
|
{
|
||||||
|
<RadzenStack Style="width:170rem; height:calc(100vh - 29rem);">
|
||||||
|
<TraGrid TDataModel="ParseTestTrend" DataList="@(tab.Value.Cast<ParseTestTrend>().Where(x=>x.Result.ToLower().Contains("ok")))" ParentTabId="@tab.Key.Parent.TabID"
|
||||||
HostColumnMerge="false" EnumTab="@tab.Key.EnumTab">
|
HostColumnMerge="false" EnumTab="@tab.Key.EnumTab">
|
||||||
</TraGrid>
|
</TraGrid>
|
||||||
|
</RadzenStack>
|
||||||
|
<RadzenStack Style="width:100%; height:inherit;">
|
||||||
|
<RadzenChart Style="height:100%;" ColorScheme="ColorScheme.Divergent">
|
||||||
|
<RadzenLineSeries Data="@(tab.Value.Cast<ParseTestTrend>().Where(x=>x.Result.ToLower().Contains("ok")).Select(x => new TrendPoint { Category = Convert.ToInt32(x.RowNo), Value = Convert.ToDouble(x.Value) }))"
|
||||||
|
TItem="TrendPoint" LineType="LineType.Solid" ValueProperty="Value" CategoryProperty="Category" Title="Value" Stroke="rgba(255,0,0)">
|
||||||
|
</RadzenLineSeries>
|
||||||
|
<RadzenLineSeries Data="@(tab.Value.Cast<ParseTestTrend>().Where(x => x.Result.ToLower().Contains("ok")).Select(x => new TrendPoint { Category = Convert.ToInt32(x.RowNo), Value = Convert.ToDouble(x.Min) }))"
|
||||||
|
TItem="TrendPoint" LineType="LineType.Dashed" ValueProperty="Value" CategoryProperty="Category" Title="MIN" Stroke="#2196f3" >
|
||||||
|
</RadzenLineSeries>
|
||||||
|
<RadzenLineSeries Data="@(tab.Value.Cast<ParseTestTrend>().Where(x => x.Result.ToLower().Contains("ok")).Select(x => new TrendPoint { Category = Convert.ToInt32(x.RowNo), Value = Convert.ToDouble(x.Max) }))"
|
||||||
|
TItem="TrendPoint" LineType="LineType.Dashed" ValueProperty="Value" CategoryProperty="Category" Title="MAX" Stroke="#2196f3">
|
||||||
|
</RadzenLineSeries>
|
||||||
|
|
||||||
|
<RadzenValueAxis Min="3" Max="11">
|
||||||
|
<RadzenGridLines Visible="true" />
|
||||||
|
</RadzenValueAxis>
|
||||||
|
<RadzenCategoryAxis Step="5">
|
||||||
|
</RadzenCategoryAxis>
|
||||||
|
</RadzenChart>
|
||||||
|
</RadzenStack>
|
||||||
}
|
}
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
@ -304,9 +387,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnDoubleClickRowOverview(IDataModel row)
|
private async Task OnDoubleClickRowOverview(SelectRow row)
|
||||||
{
|
{
|
||||||
var selectRow = row as Overview;
|
var selectRow = row.Row as Overview;
|
||||||
if(selectRow is not null)
|
if(selectRow is not null)
|
||||||
{
|
{
|
||||||
List<Overview> detailOverviews = new();
|
List<Overview> detailOverviews = new();
|
||||||
@ -317,7 +400,7 @@
|
|||||||
|
|
||||||
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
||||||
Tabs.AddOrUpdate(
|
Tabs.AddOrUpdate(
|
||||||
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.OverviewC1Detail} ({tabId})", EnumTab = EnumTabs.OverviewC1Detail, Parent = row },
|
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.OverviewC1Detail} ({tabId})", EnumTab = EnumTabs.OverviewC1Detail, Parent = new ParentRow { TabID = row.ParentTabID, Parent = row.Row } },
|
||||||
key => detailOverviews.Cast<IDataModel>().ToList(), (key, oldValue) => detailOverviews.Cast<IDataModel>().ToList());
|
key => detailOverviews.Cast<IDataModel>().ToList(), (key, oldValue) => detailOverviews.Cast<IDataModel>().ToList());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -326,7 +409,7 @@
|
|||||||
|
|
||||||
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
||||||
Tabs.AddOrUpdate(
|
Tabs.AddOrUpdate(
|
||||||
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.OverviewC1Detail} ({tabId})", EnumTab = EnumTabs.OverviewC1DetailMerged, Parent = row },
|
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.OverviewC1Detail} ({tabId})", EnumTab = EnumTabs.OverviewC1DetailMerged, Parent = new ParentRow { TabID = row.ParentTabID, Parent = row.Row } },
|
||||||
key => detailOverviews.Cast<IDataModel>().ToList(), (key, oldValue) => detailOverviews.Cast<IDataModel>().ToList());
|
key => detailOverviews.Cast<IDataModel>().ToList(), (key, oldValue) => detailOverviews.Cast<IDataModel>().ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,16 +418,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnDoubleClickRowDetailOverview(IDataModel row)
|
private async Task OnDoubleClickRowDetailOverview(SelectRow row)
|
||||||
{
|
{
|
||||||
List<TestHistory> histories = new();
|
List<TestHistory> histories = new();
|
||||||
if (IsMergePartNumberOption == false)
|
if (IsMergePartNumberOption == false)
|
||||||
{
|
{
|
||||||
histories = await CPXV2LogService.GetTestHistory(SearchDataOverviews, row);
|
histories = await CPXV2LogService.GetTestHistory(SearchDataOverviews, row.Row);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
histories = await CPXV2LogService.GetTestHistoryMerged(SearchDataOverviews, row);
|
histories = await CPXV2LogService.GetTestHistoryMerged(SearchDataOverviews, row.Row);
|
||||||
}
|
}
|
||||||
|
|
||||||
//test summary
|
//test summary
|
||||||
@ -358,7 +441,7 @@
|
|||||||
|
|
||||||
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
||||||
Tabs.AddOrUpdate(
|
Tabs.AddOrUpdate(
|
||||||
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.TestHistoryC1}({tabId})", EnumTab = EnumTabs.TestHistoryC1, Parent = row ,
|
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.TestHistoryC1}({tabId})", EnumTab = EnumTabs.TestHistoryC1, Parent = new ParentRow { TabID = row.ParentTabID, Parent = row.Row } ,
|
||||||
SummaryTestResult = $"Test Result: {ok + ng} (OK:{ok}/NG:{ng}) - Ratio:{ratio.ToString("F2")}%",
|
SummaryTestResult = $"Test Result: {ok + ng} (OK:{ok}/NG:{ng}) - Ratio:{ratio.ToString("F2")}%",
|
||||||
SummaryTestTime = $"Test Time: Average={testTimeAvg.ToString("F2")}sec Min={testTimeMin.ToString("F2")}sec Max={testTimeMax.ToString("F2")}sec" },
|
SummaryTestTime = $"Test Time: Average={testTimeAvg.ToString("F2")}sec Min={testTimeMin.ToString("F2")}sec Max={testTimeMax.ToString("F2")}sec" },
|
||||||
key => histories.Cast<IDataModel>().ToList(), (key, oldValue) => histories.Cast<IDataModel>().ToList());
|
key => histories.Cast<IDataModel>().ToList(), (key, oldValue) => histories.Cast<IDataModel>().ToList());
|
||||||
@ -367,26 +450,102 @@
|
|||||||
SelectedTabIndex = Tabs.Count - 1;
|
SelectedTabIndex = Tabs.Count - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnDoubleClickRowHistory(IDataModel row)
|
private async Task OnDoubleClickRowHistory(SelectRow row)
|
||||||
{
|
{
|
||||||
var selectRow = row as TestHistory;
|
var selectRow = row.Row as TestHistory;
|
||||||
int testStepVersion = selectRow.StepVersion;
|
int testStepVersion = selectRow.StepVersion;
|
||||||
if(Int32.TryParse(SelectionStepVersion, out var inputStepVersion) == true)
|
if(Int32.TryParse(SelectionStepVersion, out var inputStepVersion) == true)
|
||||||
{
|
{
|
||||||
testStepVersion = inputStepVersion;
|
testStepVersion = inputStepVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
var s = await CPXV2LogService.GetTestResult(row, testStepVersion);
|
var s = await CPXV2LogService.GetTestResult(row.Row, testStepVersion);
|
||||||
|
|
||||||
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
||||||
Tabs.AddOrUpdate(
|
Tabs.AddOrUpdate(
|
||||||
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.TestResultC1}({tabId})", EnumTab = EnumTabs.TestResultC1, Parent = row },
|
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.TestResultC1}({tabId})", EnumTab = EnumTabs.TestResultC1, Parent = new ParentRow { TabID = row.ParentTabID, Parent = row.Row } },
|
||||||
key => s?.ParseTestResult?.Cast<IDataModel>()?.ToList(), (key, oldValue) => s?.ParseTestResult?.Cast<IDataModel>()?.ToList());
|
key => s?.ParseTestResult?.Cast<IDataModel>()?.ToList(), (key, oldValue) => s?.ParseTestResult?.Cast<IDataModel>()?.ToList());
|
||||||
|
|
||||||
tabs.Reload();
|
tabs.Reload();
|
||||||
SelectedTabIndex = Tabs.Count - 1;
|
SelectedTabIndex = Tabs.Count - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task OnSummary()
|
||||||
|
{
|
||||||
|
var selectedTab = Tabs.Select(x => x.Key)?.FirstOrDefault(x => x.Id == SelectedTabIndex);
|
||||||
|
if (selectedTab is not null)
|
||||||
|
{
|
||||||
|
//history에서만 summary 사용
|
||||||
|
if (selectedTab.EnumTab == EnumTabs.TestHistoryC1)
|
||||||
|
{
|
||||||
|
if (Tabs.TryGetValue(selectedTab, out var data) == true)
|
||||||
|
{
|
||||||
|
if (Int32.TryParse(SelectionStepVersion, out int stepVersion) == true)
|
||||||
|
{
|
||||||
|
var testHistories = data.Cast<TestHistory>().ToList();
|
||||||
|
var summary = await CPXV2LogService.GetTestSummary(testHistories, stepVersion);
|
||||||
|
var summaryInformation = testHistories.GetTestSummaryInformation();
|
||||||
|
|
||||||
|
if (summary is not null && summaryInformation is not null)
|
||||||
|
{
|
||||||
|
summaryInformation.SearchRangeStart = (DateTime)new DateTime(RequestSearch.SearchStart, TimeOnly.MinValue);
|
||||||
|
summaryInformation.SearchRangeEnd = (DateTime)new DateTime(RequestSearch.SearchEnd, TimeOnly.MaxValue);
|
||||||
|
|
||||||
|
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
||||||
|
Tabs.AddOrUpdate(
|
||||||
|
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.TestSummaryC1}({tabId})", EnumTab = EnumTabs.TestSummaryC1, Parent = new ParentRow { TabID = selectedTab.Id, Parent = summaryInformation } },
|
||||||
|
key => summary?.ParseTestSummary?.Cast<IDataModel>()?.ToList(), (key, oldValue) => summary?.ParseTestSummary?.Cast<IDataModel>()?.ToList());
|
||||||
|
|
||||||
|
tabs.Reload();
|
||||||
|
SelectedTabIndex = Tabs.Count - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine("Not history", LogXLabel.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OnDoubleClickRowSummary(SelectRow row)
|
||||||
|
{
|
||||||
|
var selectRow = row.Row as ParseTestSummary;
|
||||||
|
if(selectRow is not null)
|
||||||
|
{
|
||||||
|
var historyTabId = Tabs.Select(x => x.Key)?.FirstOrDefault(x => x.Id == row.ParentTabID);
|
||||||
|
var selectedTab = Tabs.Select(x => x.Key)?.FirstOrDefault(x => x.Id == historyTabId.Id);
|
||||||
|
|
||||||
|
if (selectedTab is not null)
|
||||||
|
{
|
||||||
|
if (selectedTab.EnumTab == EnumTabs.TestHistoryC1)
|
||||||
|
{
|
||||||
|
if (Tabs.TryGetValue(selectedTab, out var data) == true)
|
||||||
|
{
|
||||||
|
if (Int32.TryParse(SelectionStepVersion, out int stepVersion) == true)
|
||||||
|
{
|
||||||
|
var testHistories = data.Cast<TestHistory>().ToList();
|
||||||
|
var trend = await CPXV2LogService.GetTestTrend(testHistories, stepVersion, selectRow.StepNo);
|
||||||
|
|
||||||
|
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
||||||
|
Tabs.AddOrUpdate(
|
||||||
|
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.TestTrendC1}({tabId})", EnumTab = EnumTabs.TestTrendC1, Parent = new ParentRow { TabID = selectedTab.Id, Parent = trend } },
|
||||||
|
key => trend?.ParseTestTrend?.Cast<IDataModel>()?.ToList(), (key, oldValue) => trend?.ParseTestTrend?.Cast<IDataModel>()?.ToList());
|
||||||
|
|
||||||
|
tabs.Reload();
|
||||||
|
SelectedTabIndex = Tabs.Count - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogXnet.WriteLine("Not history", LogXLabel.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnClickClose(int tabId)
|
private void OnClickClose(int tabId)
|
||||||
{
|
{
|
||||||
CloseTab(tabId);
|
CloseTab(tabId);
|
||||||
@ -429,45 +588,6 @@
|
|||||||
await JS.InvokeVoidAsync("open", $"/testlist/{history.ProductNo}/{history.TestCode}/{SelectionStepVersion}", "_blank");
|
await JS.InvokeVoidAsync("open", $"/testlist/{history.ProductNo}/{history.TestCode}/{SelectionStepVersion}", "_blank");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnSummary()
|
|
||||||
{
|
|
||||||
var selectedTab = Tabs.Select(x => x.Key)?.FirstOrDefault(x=>x.Id == SelectedTabIndex);
|
|
||||||
if(selectedTab is not null)
|
|
||||||
{
|
|
||||||
//history에서만 summary 사용
|
|
||||||
if(selectedTab.EnumTab == EnumTabs.TestHistoryC1)
|
|
||||||
{
|
|
||||||
if(Tabs.TryGetValue(selectedTab, out var data) == true)
|
|
||||||
{
|
|
||||||
if(Int32.TryParse(SelectionStepVersion, out int stepVersion) == true)
|
|
||||||
{
|
|
||||||
var testHistories = data.Cast<TestHistory>().ToList();
|
|
||||||
var summary = await CPXV2LogService.GetTestSummary(testHistories, stepVersion);
|
|
||||||
var summaryInformation = testHistories.GetTestSummaryInformation();
|
|
||||||
|
|
||||||
if(summary is not null && summaryInformation is not null)
|
|
||||||
{
|
|
||||||
summaryInformation.SearchRangeStart = (DateTime)new DateTime(RequestSearch.SearchStart, TimeOnly.MinValue);
|
|
||||||
summaryInformation.SearchRangeEnd = (DateTime)new DateTime(RequestSearch.SearchEnd, TimeOnly.MaxValue);
|
|
||||||
|
|
||||||
int tabId = Tabs.Max(x => x.Key.Id) + 1;
|
|
||||||
Tabs.AddOrUpdate(
|
|
||||||
new OrderdTab { Id = tabId, TabName = $"{EnumTabs.TestSummaryC1}({tabId})", EnumTab = EnumTabs.TestSummaryC1, Parent = summaryInformation },
|
|
||||||
key => summary?.ParseTestSummary?.Cast<IDataModel>()?.ToList(), (key, oldValue) => summary?.ParseTestSummary?.Cast<IDataModel>()?.ToList());
|
|
||||||
|
|
||||||
tabs.Reload();
|
|
||||||
SelectedTabIndex = Tabs.Count - 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogXnet.WriteLine("Not history",LogXLabel.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task OnExportExcel()
|
private async Task OnExportExcel()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
using SystemX.Core.DB;
|
using SystemX.Core.DB;
|
||||||
using Web.Tra.Model;
|
using Web.Tra.Model;
|
||||||
using SystemX.Core.Utils;
|
using SystemX.Core.Utils;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||||
|
using Radzen.Blazor;
|
||||||
|
|
||||||
public static class ObjectExtend
|
public static class ObjectExtend
|
||||||
{
|
{
|
||||||
@ -101,6 +103,7 @@ public static class ObjectExtend
|
|||||||
//parse
|
//parse
|
||||||
var parse = logData.Select(x=>x.ParseTestResult(testList)).Where(x=> x is not null && string.IsNullOrEmpty(x.MeasuredValue) == false).ToList();
|
var parse = logData.Select(x=>x.ParseTestResult(testList)).Where(x=> x is not null && string.IsNullOrEmpty(x.MeasuredValue) == false).ToList();
|
||||||
testResult.ParseTestResult = parse;
|
testResult.ParseTestResult = parse;
|
||||||
|
testResult.No = (long)histTestResult.No;
|
||||||
|
|
||||||
return testResult;
|
return testResult;
|
||||||
}
|
}
|
||||||
@ -194,9 +197,16 @@ public static class ObjectExtend
|
|||||||
//calculate dim
|
//calculate dim
|
||||||
if (rows.FirstOrDefault().Dimension.ToLower() == "dez" || rows.FirstOrDefault().Dimension.ToLower() == "v" ||
|
if (rows.FirstOrDefault().Dimension.ToLower() == "dez" || rows.FirstOrDefault().Dimension.ToLower() == "v" ||
|
||||||
rows.FirstOrDefault().Dimension.ToLower() == "float" || rows.FirstOrDefault().Dimension.ToLower() == "int")
|
rows.FirstOrDefault().Dimension.ToLower() == "float" || rows.FirstOrDefault().Dimension.ToLower() == "int")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
summary.Average = rows.Average(x => Convert.ToDouble(x.MeasuredValue)).ToString();
|
summary.Average = rows.Average(x => Convert.ToDouble(x.MeasuredValue)).ToString();
|
||||||
}
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
summary.Average = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (summary.Average == "0.0")
|
if (summary.Average == "0.0")
|
||||||
@ -231,4 +241,50 @@ public static class ObjectExtend
|
|||||||
TestRequestsID = testHistories.FirstOrDefault().TestListReqID,
|
TestRequestsID = testHistories.FirstOrDefault().TestListReqID,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TestTrend ToTestTrend(this List<TestHistory> histories, List<TestResult> testResult, TestSummary summary, int stepId)
|
||||||
|
{
|
||||||
|
TestTrend result = new TestTrend();
|
||||||
|
result.ParseTestTrend = new List<ParseTestTrend>();
|
||||||
|
result.TestStepInfo = summary.ParseTestSummary.Where(x=>x.StepNo == stepId)?.FirstOrDefault();
|
||||||
|
result.TestDataInfo = histories.GetTestSummaryInformation();
|
||||||
|
|
||||||
|
if (histories?.Count > 0)
|
||||||
|
{
|
||||||
|
int rowNo = 0;
|
||||||
|
foreach (var history in histories.OrderBy(x=>x.TestDateTime))
|
||||||
|
{
|
||||||
|
var r = testResult.Where(x => x.No == history.No)?.FirstOrDefault();
|
||||||
|
if (r is not null)
|
||||||
|
{
|
||||||
|
var step = r.ParseTestResult.Where(x => x.StepNo == stepId)?.FirstOrDefault();
|
||||||
|
if(step is not null)
|
||||||
|
{
|
||||||
|
result.ParseTestTrend.Add(new ParseTestTrend
|
||||||
|
{
|
||||||
|
RowNo = rowNo + 1,
|
||||||
|
TestTime = (DateTime)history.TestDateTime,
|
||||||
|
MO = step.MO,
|
||||||
|
ProductID = history.ProductID,
|
||||||
|
Min = step.Min,
|
||||||
|
Value = step.MeasuredValue,
|
||||||
|
Max = step.Max,
|
||||||
|
Result = step.Result,
|
||||||
|
Duration = step.Duration
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rowNo += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result.MesuredDataAnalysis = new MesuredDataAnalysis
|
||||||
|
{
|
||||||
|
Average = result.ParseTestTrend.Average(x => x.Value.GetType()== typeof(double) ? Convert.ToDouble(x.Value) : 0.0),
|
||||||
|
Min = result.ParseTestTrend.Min(x => x.Value.GetType() == typeof(double) ? Convert.ToDouble(x.Value) : 0.0),
|
||||||
|
Max = result.ParseTestTrend.Max(x => x.Value.GetType() == typeof(double) ? Convert.ToDouble(x.Value) : 0.0),
|
||||||
|
};
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
TestSummaryC1 = 50,
|
TestSummaryC1 = 50,
|
||||||
|
|
||||||
|
TestTrendC1 = 60,
|
||||||
|
|
||||||
TestListFile = 1000,
|
TestListFile = 1000,
|
||||||
|
|
||||||
End = 10000
|
End = 10000
|
||||||
|
|||||||
@ -8,7 +8,7 @@ namespace Web.Tra.Model
|
|||||||
public string TabName { get; set; }
|
public string TabName { get; set; }
|
||||||
public EnumTabs EnumTab { get; set; }
|
public EnumTabs EnumTab { get; set; }
|
||||||
|
|
||||||
public IDataModel Parent { get; set; }
|
public ParentRow Parent { get; set; }
|
||||||
|
|
||||||
public string SummaryTestResult { get; set; }
|
public string SummaryTestResult { get; set; }
|
||||||
public string SummaryTestTime { get; set; }
|
public string SummaryTestTime { get; set; }
|
||||||
|
|||||||
@ -23,4 +23,16 @@ namespace Web.Tra.Model
|
|||||||
public PROD_Group PROD_Group { get; set; }
|
public PROD_Group PROD_Group { get; set; }
|
||||||
public PROD_Variant PROD_Variant { get; set; }
|
public PROD_Variant PROD_Variant { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SelectRow()
|
||||||
|
{
|
||||||
|
public int ParentTabID { get; set; }
|
||||||
|
public IDataModel Row { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ParentRow()
|
||||||
|
{
|
||||||
|
public int TabID { get; set; }
|
||||||
|
public IDataModel Parent { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ namespace Web.Tra.Model
|
|||||||
public List<ParseTestResult> ParseTestResult { get; set; }
|
public List<ParseTestResult> ParseTestResult { get; set; }
|
||||||
|
|
||||||
//test list data
|
//test list data
|
||||||
|
public long No { get; set; }
|
||||||
public TestList? TestList { get; set; }
|
public TestList? TestList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
44
Projects/WebClient/Web.Tra/Model/TestTrend.cs
Normal file
44
Projects/WebClient/Web.Tra/Model/TestTrend.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
namespace Web.Tra.Model
|
||||||
|
{
|
||||||
|
public class TestTrend : IDataModel
|
||||||
|
{
|
||||||
|
public ParseTestSummary TestStepInfo { get; set; }
|
||||||
|
public TestSummaryInformation TestDataInfo { get; set; }
|
||||||
|
|
||||||
|
public MesuredDataAnalysis MesuredDataAnalysis { get; set; }
|
||||||
|
|
||||||
|
public List<ParseTestTrend> ParseTestTrend { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ParseTestTrend : IDataModel
|
||||||
|
{
|
||||||
|
public int RowNo { get; set; }
|
||||||
|
public DateTime TestTime { get; set; }
|
||||||
|
public string MO { get; set; }
|
||||||
|
public string ProductID { get; set; }
|
||||||
|
public string Min { get; set; }
|
||||||
|
public string Value { get; set; }
|
||||||
|
public string Max { get; set; }
|
||||||
|
public string Result { get; set; }
|
||||||
|
public string Duration { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MesuredDataAnalysis : IDataModel
|
||||||
|
{
|
||||||
|
public double Average { get; set; }
|
||||||
|
public double Min { get; set; }
|
||||||
|
public double Max { get; set; }
|
||||||
|
public double Varaince { get; set; }
|
||||||
|
public double Std_Dev { get; set; }
|
||||||
|
public double Cp { get; set; }
|
||||||
|
public double Cpk { get; set; }
|
||||||
|
public double Cg { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrendPoint
|
||||||
|
{
|
||||||
|
public int inex { get; set; }
|
||||||
|
public int Category { get; set; }
|
||||||
|
public double Value { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -329,6 +329,27 @@ namespace Web.Tra.Services
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<TestTrend> GetTestTrend(List<TestHistory> histories, int stepVersion, int stepId)
|
||||||
|
{
|
||||||
|
TestTrend result = new TestTrend();
|
||||||
|
|
||||||
|
if (histories?.Count() > 0)
|
||||||
|
{
|
||||||
|
List<TestResult> getTestResults = new List<TestResult>();
|
||||||
|
|
||||||
|
//test result parse
|
||||||
|
foreach (var hist in histories)
|
||||||
|
{
|
||||||
|
getTestResults.Add(await GetTestResult(hist, stepVersion));
|
||||||
|
}
|
||||||
|
|
||||||
|
result = histories.ToTestTrend(getTestResults, getTestResults.ToTestSummary(), stepId);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Task.CompletedTask;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public bool TryParseTestCode(string testCode, out int outValue)
|
public bool TryParseTestCode(string testCode, out int outValue)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user