[성현모] TRA HEX 값 표기 수정

This commit is contained in:
SHM
2025-03-20 08:35:24 +09:00
parent b76569d02f
commit 773aa49a27
118 changed files with 172244 additions and 0 deletions

View File

@ -0,0 +1,178 @@
namespace SystemX.Product.TRA.UIControl
{
partial class FrmOptionOverview
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.checkedListBoxControlOption = new DevExpress.XtraEditors.CheckedListBoxControl();
this.simpleButtonOK = new DevExpress.XtraEditors.SimpleButton();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit();
this.groupControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.checkedListBoxControlOption)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
this.SuspendLayout();
//
// groupControl1
//
this.groupControl1.AppearanceCaption.BackColor = System.Drawing.Color.Transparent;
this.groupControl1.AppearanceCaption.BorderColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Primary;
this.groupControl1.AppearanceCaption.Options.UseBackColor = true;
this.groupControl1.AppearanceCaption.Options.UseBorderColor = true;
this.groupControl1.Controls.Add(this.layoutControl1);
this.groupControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupControl1.Location = new System.Drawing.Point(0, 0);
this.groupControl1.Name = "groupControl1";
this.groupControl1.Size = new System.Drawing.Size(373, 456);
this.groupControl1.TabIndex = 0;
this.groupControl1.Text = "Data Overview Option";
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.checkedListBoxControlOption);
this.layoutControl1.Controls.Add(this.simpleButtonOK);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(2, 23);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(369, 431);
this.layoutControl1.TabIndex = 0;
this.layoutControl1.Text = "layoutControl1";
//
// checkedListBoxControlOption
//
this.checkedListBoxControlOption.Location = new System.Drawing.Point(12, 12);
this.checkedListBoxControlOption.Name = "checkedListBoxControlOption";
this.checkedListBoxControlOption.Size = new System.Drawing.Size(345, 371);
this.checkedListBoxControlOption.StyleController = this.layoutControl1;
this.checkedListBoxControlOption.TabIndex = 6;
this.checkedListBoxControlOption.ItemCheck += new DevExpress.XtraEditors.Controls.ItemCheckEventHandler(this.checkedListBoxControlOption_ItemCheck);
this.checkedListBoxControlOption.Click += new System.EventHandler(this.checkedListBoxControlOption_Click);
//
// simpleButtonOK
//
this.simpleButtonOK.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Primary;
this.simpleButtonOK.Appearance.Options.UseBackColor = true;
this.simpleButtonOK.Location = new System.Drawing.Point(12, 387);
this.simpleButtonOK.Name = "simpleButtonOK";
this.simpleButtonOK.Size = new System.Drawing.Size(345, 22);
this.simpleButtonOK.StyleController = this.layoutControl1;
this.simpleButtonOK.TabIndex = 5;
this.simpleButtonOK.Text = "Search";
this.simpleButtonOK.Click += new System.EventHandler(this.simpleButtonOK_Click);
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.emptySpaceItem1,
this.layoutControlItem2,
this.layoutControlItem3});
this.Root.Name = "Root";
this.Root.Size = new System.Drawing.Size(369, 431);
this.Root.TextVisible = false;
//
// emptySpaceItem1
//
this.emptySpaceItem1.AllowHotTrack = false;
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 401);
this.emptySpaceItem1.Name = "emptySpaceItem1";
this.emptySpaceItem1.Size = new System.Drawing.Size(349, 10);
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
//
// layoutControlItem2
//
this.layoutControlItem2.Control = this.simpleButtonOK;
this.layoutControlItem2.Location = new System.Drawing.Point(0, 375);
this.layoutControlItem2.MaxSize = new System.Drawing.Size(0, 26);
this.layoutControlItem2.MinSize = new System.Drawing.Size(89, 26);
this.layoutControlItem2.Name = "layoutControlItem2";
this.layoutControlItem2.Size = new System.Drawing.Size(349, 26);
this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem2.TextVisible = false;
//
// layoutControlItem3
//
this.layoutControlItem3.Control = this.checkedListBoxControlOption;
this.layoutControlItem3.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem3.Name = "layoutControlItem3";
this.layoutControlItem3.Size = new System.Drawing.Size(349, 375);
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem3.TextVisible = false;
//
// FrmOptionOverview
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(373, 456);
this.ControlBox = false;
this.Controls.Add(this.groupControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FrmOptionOverview";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "FrmOptionStationSearch";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmOptionStationSearch_Load);
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit();
this.groupControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.checkedListBoxControlOption)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.GroupControl groupControl1;
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraEditors.CheckedListBoxControl checkedListBoxControlOption;
private DevExpress.XtraEditors.SimpleButton simpleButtonOK;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
}
}

View File

@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SystemX.Product.TRA.UIControl
{
public partial class FrmOptionOverview : Form
{
OverviewSearchOption Option { get; set; } = new OverviewSearchOption();
public FrmOptionOverview()
{
InitializeComponent();
}
public OverviewSearchOption GetSelectedResult()
{
return Option;
}
void DispData()
{
string strTypeName = "SystemX.Product.TRA.UIControl.OverviewSearchOption";
try
{
Type typeObj = Type.GetType(strTypeName);
foreach(PropertyInfo info in typeObj.GetProperties())
{
if (info.PropertyType == typeof(string))
continue;
string strProp = info.Name;
string strValue = info.GetValue(Option, null).ToString();
bool bState = Convert.ToBoolean(strValue);
checkedListBoxControlOption.Items.Add(strProp, bState ? CheckState.Checked : CheckState.Unchecked, true);
}
}
catch(Exception ex)
{
MessageBox.Show("Error during option display: " + ex.Message);
}
}
private void FrmOptionStationSearch_Load(object sender, EventArgs e)
{
DispData();
}
private void simpleButtonOK_Click(object sender, EventArgs e)
{
string strTypeName = "SystemX.Product.TRA.UIControl.OverviewSearchOption";
try
{
Type typeObj = Type.GetType(strTypeName);
foreach (PropertyInfo info in typeObj.GetProperties())
{
if (info.PropertyType == typeof(string))
continue;
string strProp = info.Name;
bool bChecked = checkedListBoxControlOption.Items[strProp].CheckState == CheckState.Checked ? true : false;
info.SetValue(Option, bChecked);
}
this.DialogResult = DialogResult.OK;
}
catch (Exception ex)
{
MessageBox.Show("Error during option matching: " + ex.Message);
}
this.Close();
}
private void checkedListBoxControlOption_Click(object sender, EventArgs e)
{
}
private void checkedListBoxControlOption_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,179 @@
namespace SystemX.Product.TRA.UIControl
{
partial class FrmOptionStationSearch
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.checkedListBoxControlOption = new DevExpress.XtraEditors.CheckedListBoxControl();
this.simpleButtonOK = new DevExpress.XtraEditors.SimpleButton();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit();
this.groupControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.checkedListBoxControlOption)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
this.SuspendLayout();
//
// groupControl1
//
this.groupControl1.AppearanceCaption.BackColor = System.Drawing.Color.Transparent;
this.groupControl1.AppearanceCaption.BorderColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Primary;
this.groupControl1.AppearanceCaption.Options.UseBackColor = true;
this.groupControl1.AppearanceCaption.Options.UseBorderColor = true;
this.groupControl1.Controls.Add(this.layoutControl1);
this.groupControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupControl1.Location = new System.Drawing.Point(0, 0);
this.groupControl1.Name = "groupControl1";
this.groupControl1.Size = new System.Drawing.Size(373, 456);
this.groupControl1.TabIndex = 0;
this.groupControl1.Text = "Station Test History Search Option";
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.checkedListBoxControlOption);
this.layoutControl1.Controls.Add(this.simpleButtonOK);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(2, 23);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(369, 431);
this.layoutControl1.TabIndex = 0;
this.layoutControl1.Text = "layoutControl1";
//
// checkedListBoxControlOption
//
this.checkedListBoxControlOption.Location = new System.Drawing.Point(12, 12);
this.checkedListBoxControlOption.Name = "checkedListBoxControlOption";
this.checkedListBoxControlOption.Size = new System.Drawing.Size(345, 371);
this.checkedListBoxControlOption.StyleController = this.layoutControl1;
this.checkedListBoxControlOption.TabIndex = 6;
this.checkedListBoxControlOption.ItemCheck += new DevExpress.XtraEditors.Controls.ItemCheckEventHandler(this.checkedListBoxControlOption_ItemCheck);
this.checkedListBoxControlOption.CheckMemberChanged += new System.EventHandler(this.checkedListBoxControlOption_CheckMemberChanged);
this.checkedListBoxControlOption.SelectedValueChanged += new System.EventHandler(this.checkedListBoxControlOption_SelectedValueChanged);
//
// simpleButtonOK
//
this.simpleButtonOK.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Primary;
this.simpleButtonOK.Appearance.Options.UseBackColor = true;
this.simpleButtonOK.Location = new System.Drawing.Point(12, 387);
this.simpleButtonOK.Name = "simpleButtonOK";
this.simpleButtonOK.Size = new System.Drawing.Size(345, 22);
this.simpleButtonOK.StyleController = this.layoutControl1;
this.simpleButtonOK.TabIndex = 5;
this.simpleButtonOK.Text = "Search";
this.simpleButtonOK.Click += new System.EventHandler(this.simpleButtonOK_Click);
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.emptySpaceItem1,
this.layoutControlItem2,
this.layoutControlItem3});
this.Root.Name = "Root";
this.Root.Size = new System.Drawing.Size(369, 431);
this.Root.TextVisible = false;
//
// emptySpaceItem1
//
this.emptySpaceItem1.AllowHotTrack = false;
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 401);
this.emptySpaceItem1.Name = "emptySpaceItem1";
this.emptySpaceItem1.Size = new System.Drawing.Size(349, 10);
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
//
// layoutControlItem2
//
this.layoutControlItem2.Control = this.simpleButtonOK;
this.layoutControlItem2.Location = new System.Drawing.Point(0, 375);
this.layoutControlItem2.MaxSize = new System.Drawing.Size(0, 26);
this.layoutControlItem2.MinSize = new System.Drawing.Size(89, 26);
this.layoutControlItem2.Name = "layoutControlItem2";
this.layoutControlItem2.Size = new System.Drawing.Size(349, 26);
this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem2.TextVisible = false;
//
// layoutControlItem3
//
this.layoutControlItem3.Control = this.checkedListBoxControlOption;
this.layoutControlItem3.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem3.Name = "layoutControlItem3";
this.layoutControlItem3.Size = new System.Drawing.Size(349, 375);
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem3.TextVisible = false;
//
// FrmOptionStationSearch
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(373, 456);
this.ControlBox = false;
this.Controls.Add(this.groupControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FrmOptionStationSearch";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "FrmOptionStationSearch";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmOptionStationSearch_Load);
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit();
this.groupControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.checkedListBoxControlOption)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.GroupControl groupControl1;
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraEditors.CheckedListBoxControl checkedListBoxControlOption;
private DevExpress.XtraEditors.SimpleButton simpleButtonOK;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
}
}

View File

@ -0,0 +1,159 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SystemX.Product.TRA.UIControl
{
public partial class FrmOptionStationSearch : Form
{
TestHistorySearchOption Option { get; set; } = new TestHistorySearchOption();
private bool bSelectedTime_DaySearched = false;
public enum eExclusion
{
Time_SelectedTest,
Time_Day,
Time_WholeRange
}
public FrmOptionStationSearch(bool bDialog = true, bool bSelectTime_Day = false)
{
InitializeComponent();
bSelectedTime_DaySearched = bSelectTime_Day;
DispData();
if(bDialog == false)
SetOption();
}
public TestHistorySearchOption GetSelectedResult()
{
return Option;
}
void DispData()
{
string strTypeName = "SystemX.Product.TRA.UIControl.TestHistorySearchOption";
try
{
Type typeObj = Type.GetType(strTypeName);
foreach(PropertyInfo info in typeObj.GetProperties())
{
string strProp = info.Name;
string strValue = info.GetValue(Option, null).ToString();
bool bState = Convert.ToBoolean(strValue);
checkedListBoxControlOption.Items.Add(strProp, bState ? CheckState.Checked : CheckState.Unchecked, true);
if (strProp == "StepVersion" || strProp == "FileVersion")
checkedListBoxControlOption.Items[strProp].Enabled = false;
}
}
catch(Exception ex)
{
MessageBox.Show("Error during option display: " + ex.Message);
}
if (bSelectedTime_DaySearched)
{
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_SelectedTest.ToString()).FirstOrDefault().CheckState = CheckState.Checked;
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_WholeRange.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_Day.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
}
}
private void FrmOptionStationSearch_Load(object sender, EventArgs e)
{
DispData();
}
private void SetOption()
{
string strTypeName = "SystemX.Product.TRA.UIControl.TestHistorySearchOption";
try
{
if (checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_SelectedTest.ToString()).FirstOrDefault().CheckState == CheckState.Unchecked &&
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_Day.ToString()).FirstOrDefault().CheckState == CheckState.Unchecked &&
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_WholeRange.ToString()).FirstOrDefault().CheckState == CheckState.Unchecked)
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_SelectedTest.ToString()).FirstOrDefault().CheckState = CheckState.Checked;
Type typeObj = Type.GetType(strTypeName);
foreach (PropertyInfo info in typeObj.GetProperties())
{
string strProp = info.Name;
bool bChecked = checkedListBoxControlOption.Items[strProp].CheckState == CheckState.Checked ? true : false;
info.SetValue(Option, bChecked);
}
}
catch (Exception ex)
{
MessageBox.Show("Error during option matching: " + ex.Message);
}
}
private void simpleButtonOK_Click(object sender, EventArgs e)
{
SetOption();
this.DialogResult = DialogResult.OK;
this.Close();
}
private void checkedListBoxControlOption_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
bool bChecked = e.State == CheckState.Checked ? true : false;
string strName = checkedListBoxControlOption.Items[e.Index].Value.ToString();
if (strName == eExclusion.Time_SelectedTest.ToString() && bChecked)
{
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_Day.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_WholeRange.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
}
else if (strName == eExclusion.Time_Day.ToString() && bChecked)
{
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_SelectedTest.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_WholeRange.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
}
else if (strName == eExclusion.Time_WholeRange.ToString() && bChecked)
{
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_SelectedTest.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_Day.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
}
//else if (!bChecked)
//{
// checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_SelectedTest.ToString()).FirstOrDefault().CheckState = CheckState.Checked;
// checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_Day.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
// checkedListBoxControlOption.Items.Where(x => x.Value.ToString() == eExclusion.Time_WholeRange.ToString()).FirstOrDefault().CheckState = CheckState.Unchecked;
//}
}
private void checkedListBoxControlOption_CheckMemberChanged(object sender, EventArgs e)
{
}
private void checkedListBoxControlOption_SelectedValueChanged(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,164 @@
namespace SystemX.Product.TRA.UIControl
{
partial class FrmOptionSummary
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.simpleButtonOptionB = new DevExpress.XtraEditors.SimpleButton();
this.simpleButtonOptionA = new DevExpress.XtraEditors.SimpleButton();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
this.simpleButtonCancel = new DevExpress.XtraEditors.SimpleButton();
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
this.SuspendLayout();
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.simpleButtonCancel);
this.layoutControl1.Controls.Add(this.simpleButtonOptionB);
this.layoutControl1.Controls.Add(this.simpleButtonOptionA);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(463, 144);
this.layoutControl1.TabIndex = 0;
this.layoutControl1.Text = "layoutControl1";
//
// simpleButtonOptionB
//
this.simpleButtonOptionB.Location = new System.Drawing.Point(233, 12);
this.simpleButtonOptionB.Name = "simpleButtonOptionB";
this.simpleButtonOptionB.Size = new System.Drawing.Size(218, 94);
this.simpleButtonOptionB.StyleController = this.layoutControl1;
this.simpleButtonOptionB.TabIndex = 5;
this.simpleButtonOptionB.Text = "All Testlist Version Base";
this.simpleButtonOptionB.Click += new System.EventHandler(this.simpleButtonOptionB_Click);
//
// simpleButtonOptionA
//
this.simpleButtonOptionA.Location = new System.Drawing.Point(12, 12);
this.simpleButtonOptionA.Name = "simpleButtonOptionA";
this.simpleButtonOptionA.Size = new System.Drawing.Size(217, 94);
this.simpleButtonOptionA.StyleController = this.layoutControl1;
this.simpleButtonOptionA.TabIndex = 4;
this.simpleButtonOptionA.Text = "New Testlist Version Base";
this.simpleButtonOptionA.Click += new System.EventHandler(this.simpleButtonOptionA_Click);
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem1,
this.layoutControlItem2,
this.layoutControlItem3});
this.Root.Name = "Root";
this.Root.Size = new System.Drawing.Size(463, 144);
this.Root.TextVisible = false;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.simpleButtonOptionA;
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem1.MinSize = new System.Drawing.Size(89, 26);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Size = new System.Drawing.Size(221, 98);
this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem1.TextVisible = false;
//
// layoutControlItem2
//
this.layoutControlItem2.Control = this.simpleButtonOptionB;
this.layoutControlItem2.Location = new System.Drawing.Point(221, 0);
this.layoutControlItem2.MinSize = new System.Drawing.Size(89, 26);
this.layoutControlItem2.Name = "layoutControlItem2";
this.layoutControlItem2.Size = new System.Drawing.Size(222, 98);
this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem2.TextVisible = false;
//
// simpleButtonCancel
//
this.simpleButtonCancel.Location = new System.Drawing.Point(12, 110);
this.simpleButtonCancel.Name = "simpleButtonCancel";
this.simpleButtonCancel.Size = new System.Drawing.Size(439, 22);
this.simpleButtonCancel.StyleController = this.layoutControl1;
this.simpleButtonCancel.TabIndex = 6;
this.simpleButtonCancel.Text = "Cancel";
this.simpleButtonCancel.Click += new System.EventHandler(this.simpleButtonCancel_Click);
//
// layoutControlItem3
//
this.layoutControlItem3.Control = this.simpleButtonCancel;
this.layoutControlItem3.Location = new System.Drawing.Point(0, 98);
this.layoutControlItem3.Name = "layoutControlItem3";
this.layoutControlItem3.Size = new System.Drawing.Size(443, 26);
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem3.TextVisible = false;
//
// FrmOptionSummary
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(463, 144);
this.Controls.Add(this.layoutControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FrmOptionSummary";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Summary Display Option";
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraEditors.SimpleButton simpleButtonOptionB;
private DevExpress.XtraEditors.SimpleButton simpleButtonOptionA;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
private DevExpress.XtraEditors.SimpleButton simpleButtonCancel;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
}
}

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SystemX.Product.TRA.UIControl
{
public partial class FrmOptionSummary : Form
{
public FrmOptionSummary()
{
InitializeComponent();
}
public bool OptaionA { get; set; } = false;
public bool OptaionB { get; set; } = false;
private void simpleButtonOptionA_Click(object sender, EventArgs e)
{
OptaionA = true;
DialogResult = DialogResult.OK;
}
private void simpleButtonOptionB_Click(object sender, EventArgs e)
{
OptaionB = true;
DialogResult = DialogResult.OK;
}
private void simpleButtonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DevExpress.XtraGrid.Views.Grid;
namespace SystemX.Product.TRA.UIControl.Helper {
public class MergedRowsHelper {
List<int> _rows = new List<int>();
GridView _gridView;
public void Register(GridView gridView) {
if(gridView == null) return;
_gridView = gridView;
gridView.FocusedRowChanged += gridView_FocusedRowChanged;
gridView.RowStyle += gridView_RowStyle;
gridView.GridControl.Load += GridControl_Load;
gridView.RowCellStyle += gridView_RowCellStyle;
}
void GridControl_Load(object sender, EventArgs e) {
RefreshMergedRows();
}
void gridView_RowStyle(object sender, RowStyleEventArgs e) {
if (_rows.Contains(_gridView.GetDataSourceRowIndex(e.RowHandle))) {
e.Appearance.Assign(_gridView.PaintAppearance.FocusedRow);
e.HighPriority = true;
}
}
void gridView_RowCellStyle(object sender, RowCellStyleEventArgs e)
{
e.Appearance.TextOptions.HAlignment = e.Column.AppearanceCell.HAlignment;
}
void gridView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) {
RefreshMergedRows();
_gridView.LayoutChanged();
}
void RefreshMergedRows() {
_rows = GetMergedRows(_gridView.FocusedRowHandle);
_gridView.RefreshData();
}
List<int> GetMergedRows(int rowHandle) {
HashSet<int> mergedRows = new HashSet<int>();
foreach(DevExpress.XtraGrid.Columns.GridColumn col in _gridView.VisibleColumns) {
var originalCell = _gridView.GetRowCellDisplayText(rowHandle, col);
for(int i = rowHandle; ; i--) {
if(!_gridView.IsValidRowHandle(i)) break;
var cell = _gridView.GetRowCellDisplayText(i, col);
if(cell == originalCell) mergedRows.Add(i);
else break;
}
for(int i = rowHandle; ; i++) {
if(!_gridView.IsValidRowHandle(i)) break;
var cell = _gridView.GetRowCellDisplayText(i, col);
if(cell == originalCell) mergedRows.Add(i);
else break;
}
}
List<int> result = new List<int>();
foreach(var item in mergedRows) {
result.Add(_gridView.GetDataSourceRowIndex(item));
}
return result;
}
}
}

View File

@ -0,0 +1,130 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRADetailOverview
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.filterModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.filtrToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
this.SuspendLayout();
//
// gridControlMain
//
this.gridControlMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControlMain.Location = new System.Drawing.Point(0, 0);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(1040, 576);
this.gridControlMain.TabIndex = 0;
this.gridControlMain.UseDirectXPaint = DevExpress.Utils.DefaultBoolean.True;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.FocusedRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.FocusedRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.FocusedRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.FocusedRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Bold);
this.gridViewMain.Appearance.FocusedRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.FocusedRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.FocusedRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseFont = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseForeColor = true;
this.gridViewMain.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.HideSelectionRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.HideSelectionRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Bold);
this.gridViewMain.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.HideSelectionRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseFont = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseForeColor = true;
this.gridViewMain.Appearance.SelectedRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.SelectedRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.SelectedRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.SelectedRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gridViewMain.Appearance.SelectedRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.SelectedRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.SelectedRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseFont = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseForeColor = true;
this.gridViewMain.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsScrollAnnotations.ShowSelectedRows = DevExpress.Utils.DefaultBoolean.True;
this.gridViewMain.OptionsSelection.EnableAppearanceFocusedCell = false;
this.gridViewMain.OptionsSelection.MultiSelect = true;
this.gridViewMain.OptionsView.AllowHtmlDrawGroups = false;
this.gridViewMain.OptionsView.BestFitMode = DevExpress.XtraGrid.Views.Grid.GridBestFitMode.Fast;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
this.gridViewMain.RowClick += new DevExpress.XtraGrid.Views.Grid.RowClickEventHandler(this.gridViewMain_RowClick);
this.gridViewMain.RowCellClick += new DevExpress.XtraGrid.Views.Grid.RowCellClickEventHandler(this.gridViewMain_RowCellClick);
this.gridViewMain.RowStyle += new DevExpress.XtraGrid.Views.Grid.RowStyleEventHandler(this.gridViewMain_RowStyle);
this.gridViewMain.MouseDown += new System.Windows.Forms.MouseEventHandler(this.gridViewMain_MouseDown);
//
// filterModeToolStripMenuItem
//
this.filterModeToolStripMenuItem.Name = "filterModeToolStripMenuItem";
this.filterModeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.filterModeToolStripMenuItem.Text = "Merge Mode";
//
// filtrToolStripMenuItem
//
this.filtrToolStripMenuItem.Name = "filtrToolStripMenuItem";
this.filtrToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.filtrToolStripMenuItem.Text = "Filter Row";
//
// UcTRADetailOverview
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.gridControlMain);
this.Name = "UcTRADetailOverview";
this.Size = new System.Drawing.Size(1040, 576);
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ToolStripMenuItem filterModeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem filtrToolStripMenuItem;
private DevExpress.XtraGrid.GridControl gridControlMain;
public DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
}
}

View File

@ -0,0 +1,384 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using SystemX.Product.TRA.DataManager;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Columns;
using SystemX.Product.TRA.UIControl.Helper;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using SystemX.Product.ALIS.Interface;
using static SystemX.Net.Platform.Common.Util.LogMessage;
using SystemX.Net.Platform.Common.Util;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRADetailOverview : UcTRABaseView
{
public enum eColHide
{
TestlistNo,
StepVersion,
RN
}
DMDetailOverview DataManager { get; set; }
public string GetUseQuery()
{
return DataManager.strDetailOverviewUseQuery;
}
public OverviewSearchOption Option { get; set; }
public delegate void evtDataSelectHandler(SelectedDataCollection data);
public event evtDataSelectHandler OnSelect;
public DateTime SearchStart { get; set; }
public DateTime SearchEnd { get; set; }
private IChildController refChildInterface;
private string GridViewGetActiveFilterText;
private bool bProductMergeOption = false;
private int nMergeDataCnt;
private string[] strMergeReqIDs;
eSelectDataView eCurrentView;
public UcTRADetailOverview(IChildController getChildControl, bool bAllowMerge = false, bool bAutoFilterRow = false)
{
ContentsType = eContents.DetailOverview;
refChildInterface = getChildControl;
this.ContextMenuStrip = base.contextMenuStripTest;
this.ContextMenuStrip.ItemClicked += contextMenuStrip_ItemClicked;
base.toolStripMenuItemBeginRelDate.Click += contextMenuStripBeginRelDate_ItemClicked;
SetMenuEnabled(ContentsType);
bProductMergeOption = bAllowMerge;
InitializeComponent();
gridViewMain.OptionsView.AllowCellMerge = true;
gridViewMain.OptionsView.ShowAutoFilterRow = bAutoFilterRow;
}
~UcTRADetailOverview()
{
this.ContextMenuStrip.ItemClicked -= contextMenuStrip_ItemClicked;
base.toolStripMenuItemBeginRelDate.Click -= contextMenuStripBeginRelDate_ItemClicked;
}
private void contextMenuStripBeginRelDate_ItemClicked(object sender, EventArgs e)
{
int nTag = Convert.ToInt32(((ToolStripMenuItem)sender).Tag);
switch (nTag)
{
case 7:
{
string GetDateValue = base.toolStripTextBoxBeginRelDate.Text;
int nGetDateValue = int.MaxValue;
if (int.TryParse(GetDateValue, out nGetDateValue))
{
if (nGetDateValue > 7)
nGetDateValue = 7;
if (nGetDateValue < -7)
nGetDateValue = -7;
ViewData(eCurrentView, nGetDateValue);
}
}
break;
}
}
private void contextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
ToolStripItem tsp = e.ClickedItem;
int nTag = Convert.ToInt32(tsp.Tag);
switch (nTag)
{
case 0:
refChildInterface.SetOverview();
break;
case 1:
refChildInterface.SetHistoryView();
break;
case 2:
break;
case 3:
break;
case 4:
refChildInterface.SetNgHistView(ContentsType);
break;
}
}
public void SetSQLConnection(eSelectDataView SelectView, eOverviewModelNameInfo SelectInfo, IDataBaseController getDBController)
{
DataManager = new DMDetailOverview(SelectView, SelectInfo, getDBController);
}
public void SetGridViewStyle()
{
gridViewMain.BeginUpdate();
foreach (GridColumn gc in gridViewMain.Columns)
{
if (gc.FieldName.CompareTo("TestDate") == 0)
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
else if (gc.FieldName.CompareTo("Host") == 0)
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
else
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
}
gridViewMain.EndUpdate();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
public void ViewData(eSelectDataView SelectView, int nGetDateValue = int.MaxValue)
{
eCurrentView = SelectView;
Option = new OverviewSearchOption();
Option.DisplayByStation = !refChildInterface.GetOverviewMergeState();
DataTable dtResult = DataManager.GetDataView(SelectView, refChildInterface.GetSelectDataOverView(nGetDateValue), Option);
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.DataSource = null;
gridControlMain.RefreshDataSource();
gridViewMain.RefreshData();
gridControlMain.DataSource = dtResult;
gridControlMain.RefreshDataSource();
gridViewMain.RefreshData();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
foreach (string strName in Enum.GetNames(typeof(eColHide)))
{
if (gridViewMain.Columns.ColumnByFieldName(strName) != null)
gridViewMain.Columns[strName].Visible = false;
}
gridControlMain.Update();
SetGridViewStyle();
}
public void ViewData(eSelectDataView SelectView, SelectedDataCollection data, bool bMergeByPartNumber = false)
{
eCurrentView = SelectView;
Option = new OverviewSearchOption();
Option.DisplayByStation = !bMergeByPartNumber;
DataTable dtResult = DataManager.GetDataView(SelectView, data, Option);
if(bProductMergeOption)
{
nMergeDataCnt = DataManager.dtSubRaw.Rows.Count;
strMergeReqIDs = new string[nMergeDataCnt];
for (int i = 0; i < nMergeDataCnt; i++)
strMergeReqIDs[i] = DataManager.dtSubRaw.Rows[i]["TestListCntID"].ToString();
}
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.DataSource = null;
gridControlMain.RefreshDataSource();
gridViewMain.RefreshData();
gridControlMain.DataSource = dtResult;
gridControlMain.RefreshDataSource();
gridViewMain.RefreshData();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
foreach (string strName in Enum.GetNames(typeof(eColHide)))
{
if (gridViewMain.Columns.ColumnByFieldName(strName) != null)
gridViewMain.Columns[strName].Visible = false;
}
gridControlMain.Update();
SetGridViewStyle();
}
public bool DoSelect(DataRow dtRow)
{
if (dtRow == null)
return false;
bool bDataCheckResult = true;
try
{
string strDate = dtRow[DMDetailOverview.eColList.TestDate.ToString()].ToString();
string strStartTime = dtRow[DMDetailOverview.eColList.FirstTestTime.ToString()].ToString();
string strEndTime = dtRow[DMDetailOverview.eColList.FinalTestTime.ToString()].ToString();
DateTime dtDate = DateTime.Parse(strDate);
strStartTime = dtDate.ToShortDateString() + " " + strStartTime;
strEndTime = dtDate.ToShortDateString() + " " + strEndTime;
DateTime dtStart = DateTime.Parse(strStartTime);
DateTime dtEnd = DateTime.Parse(strEndTime);
//dtEnd = dtEnd.AddHours(-dtStart.Hour);
//dtEnd = dtEnd.AddHours(23.9999);
//string strStnName, string strHostID, string strSectionID, string strTestType,
//string strProdNo, string strTestCode, string strParentNo, string strProdCode,
//string strFileVer, string strStepVer)
string strTestListCntID = string.Empty;
if (bProductMergeOption == false)
strTestListCntID = dtRow[DMDetailOverview.eColList.TestListCntID.ToString()].ToString();
SelectedDataCollection selData = new SelectedDataCollection(
SearchStart,
SearchEnd,
dtStart,
dtEnd,
Option.DisplayByStation ? dtRow[DMDetailOverview.eColList.StationName.ToString()].ToString() : string.Empty,
Option.DisplayByStation ? dtRow[DMDetailOverview.eColList.Host.ToString()].ToString() : string.Empty,
Option.DisplayByStation ? dtRow[DMDetailOverview.eColList.Section.ToString()].ToString() : string.Empty,
dtRow[DMDetailOverview.eColList.TestType.ToString()].ToString(),
dtRow[DMDetailOverview.eColList.ProductNo.ToString()].ToString(),
dtRow[DMDetailOverview.eColList.TestCode.ToString()].ToString(),
dtRow[DMDetailOverview.eColList.ParentNo.ToString()].ToString(),
dtRow[DMDetailOverview.eColList.FileCode.ToString()].ToString(),
dtRow[DMOverview.eColList.TestListFileNo.ToString()].ToString(),
dtRow[DMOverview.eColList.TestListVariantNo.ToString()].ToString(),
dtRow[DMDetailOverview.eColList.FileVersion.ToString()].ToString(),
dtRow[DMDetailOverview.eColList.StepVersion.ToString()].ToString(),
strTestListCntID);
if (bProductMergeOption)
{
selData.SetCountRequestID(nMergeDataCnt);
selData.CopyReqIDs(strMergeReqIDs);
}
refChildInterface.AnnounceContentsType(ContentsType);
OnSelect(selData);
}
catch (Exception e)
{
MessageOutput.ConsoleWrite($"Detail Overview DoSelect Error: {e.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
bDataCheckResult = false;
}
finally
{
;//
}
return bDataCheckResult;
}
private DataRow GetRowInfo(object Viewer, int nRowHndl)
{
DataRow dtRow = null;
try
{
GridView view = Viewer as GridView;
var dvRow = view.GetRow(nRowHndl);
dtRow = (dvRow as DataRowView).Row;
}
catch
{
dtRow = null;
}
return dtRow;
}
private void gridViewMain_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
{
int nRowHndl = e.RowHandle;
if (nRowHndl < 0)
return;
DoSelect(GetRowInfo(sender, nRowHndl));
}
private void gridViewMain_RowStyle(object sender, RowStyleEventArgs e)
{
GridView view = sender as GridView;
if (view.FocusedRowHandle == e.RowHandle)
{
GridViewInfo viewInfo = gridViewMain.GetViewInfo() as GridViewInfo;
e.Appearance.Assign(viewInfo.PaintAppearance.FocusedRow);
e.HighPriority = true;
}
}
private void gridViewMain_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
GridHitInfo hInfo = gridViewMain.CalcHitInfo(gridControlMain.PointToClient(Cursor.Position));
if (hInfo.RowInfo != null)
{
int nGetRowHandle = hInfo.RowInfo.RowHandle;
DoSelect(GetRowInfo(gridViewMain, nGetRowHandle));
}
}
}
private void gridViewMain_RowCellClick(object sender, RowCellClickEventArgs e)
{
int nClickCnt = e.Clicks;
if (nClickCnt < 2)
return;
int nRowHndl = e.RowHandle;
if (nRowHndl < 0)
return;
if(DoSelect(GetRowInfo(sender, nRowHndl)))
refChildInterface.SetHistoryView();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,234 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRADetailTestResult
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.panelControlResult = new DevExpress.XtraEditors.PanelControl();
this.simpleButtonTypeConv = new DevExpress.XtraEditors.SimpleButton();
this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
this.vGridControlInfo = new DevExpress.XtraVerticalGrid.VGridControl();
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.panelControlResult)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit();
this.groupControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.vGridControlInfo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
this.SuspendLayout();
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.panelControlResult);
this.layoutControl1.Controls.Add(this.simpleButtonTypeConv);
this.layoutControl1.Controls.Add(this.groupControl1);
this.layoutControl1.Controls.Add(this.gridControlMain);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(1179, 635);
this.layoutControl1.TabIndex = 0;
this.layoutControl1.Text = "layoutControl1";
//
// panelControlResult
//
this.panelControlResult.Appearance.BackColor = System.Drawing.Color.DarkGray;
this.panelControlResult.Appearance.Options.UseBackColor = true;
this.panelControlResult.Location = new System.Drawing.Point(12, 12);
this.panelControlResult.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Flat;
this.panelControlResult.LookAndFeel.UseDefaultLookAndFeel = false;
this.panelControlResult.Name = "panelControlResult";
this.panelControlResult.Size = new System.Drawing.Size(321, 38);
this.panelControlResult.TabIndex = 1;
//
// simpleButtonTypeConv
//
this.simpleButtonTypeConv.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Primary;
this.simpleButtonTypeConv.Appearance.Options.UseBackColor = true;
this.simpleButtonTypeConv.Location = new System.Drawing.Point(12, 601);
this.simpleButtonTypeConv.Name = "simpleButtonTypeConv";
this.simpleButtonTypeConv.Size = new System.Drawing.Size(321, 22);
this.simpleButtonTypeConv.StyleController = this.layoutControl1;
this.simpleButtonTypeConv.TabIndex = 1;
this.simpleButtonTypeConv.Text = "-";
this.simpleButtonTypeConv.Click += new System.EventHandler(this.simpleButtonTypeConv_Click);
//
// groupControl1
//
this.groupControl1.Controls.Add(this.vGridControlInfo);
this.groupControl1.Location = new System.Drawing.Point(12, 54);
this.groupControl1.Name = "groupControl1";
this.groupControl1.Size = new System.Drawing.Size(321, 543);
this.groupControl1.TabIndex = 5;
this.groupControl1.Text = "Test Information";
//
// vGridControlInfo
//
this.vGridControlInfo.Cursor = System.Windows.Forms.Cursors.Default;
this.vGridControlInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.vGridControlInfo.Location = new System.Drawing.Point(2, 23);
this.vGridControlInfo.Name = "vGridControlInfo";
this.vGridControlInfo.Size = new System.Drawing.Size(317, 518);
this.vGridControlInfo.TabIndex = 0;
//
// gridControlMain
//
this.gridControlMain.Location = new System.Drawing.Point(337, 12);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(830, 611);
this.gridControlMain.TabIndex = 4;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.Row.BackColor = System.Drawing.Color.Transparent;
this.gridViewMain.Appearance.Row.Options.UseBackColor = true;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsBehavior.ReadOnly = true;
this.gridViewMain.OptionsView.HeaderFilterButtonShowMode = DevExpress.XtraEditors.Controls.FilterButtonShowMode.SmartTag;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.ShowAlways;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem1,
this.layoutControlItem2,
this.layoutControlItem3,
this.layoutControlItem4});
this.Root.Name = "Root";
this.Root.Size = new System.Drawing.Size(1179, 635);
this.Root.TextVisible = false;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.gridControlMain;
this.layoutControlItem1.Location = new System.Drawing.Point(325, 0);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Size = new System.Drawing.Size(834, 615);
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem1.TextVisible = false;
//
// layoutControlItem2
//
this.layoutControlItem2.Control = this.groupControl1;
this.layoutControlItem2.Location = new System.Drawing.Point(0, 42);
this.layoutControlItem2.MaxSize = new System.Drawing.Size(325, 0);
this.layoutControlItem2.MinSize = new System.Drawing.Size(325, 5);
this.layoutControlItem2.Name = "layoutControlItem2";
this.layoutControlItem2.Size = new System.Drawing.Size(325, 547);
this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem2.TextVisible = false;
//
// layoutControlItem3
//
this.layoutControlItem3.Control = this.simpleButtonTypeConv;
this.layoutControlItem3.Location = new System.Drawing.Point(0, 589);
this.layoutControlItem3.MaxSize = new System.Drawing.Size(325, 26);
this.layoutControlItem3.MinSize = new System.Drawing.Size(325, 26);
this.layoutControlItem3.Name = "layoutControlItem3";
this.layoutControlItem3.Size = new System.Drawing.Size(325, 26);
this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem3.TextVisible = false;
//
// layoutControlItem4
//
this.layoutControlItem4.Control = this.panelControlResult;
this.layoutControlItem4.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem4.MaxSize = new System.Drawing.Size(325, 42);
this.layoutControlItem4.MinSize = new System.Drawing.Size(325, 42);
this.layoutControlItem4.Name = "layoutControlItem4";
this.layoutControlItem4.Size = new System.Drawing.Size(325, 42);
this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem4.TextVisible = false;
//
// UcTRADetailTestResult
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layoutControl1);
this.Name = "UcTRADetailTestResult";
this.Size = new System.Drawing.Size(1179, 635);
this.Load += new System.EventHandler(this.UcTRADetailTestResult_Load);
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.panelControlResult)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit();
this.groupControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vGridControlInfo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraEditors.GroupControl groupControl1;
private DevExpress.XtraGrid.GridControl gridControlMain;
private DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
private DevExpress.XtraVerticalGrid.VGridControl vGridControlInfo;
private DevExpress.XtraEditors.SimpleButton simpleButtonTypeConv;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
private DevExpress.XtraEditors.PanelControl panelControlResult;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
}
}

View File

@ -0,0 +1,313 @@
using DevExpress.Spreadsheet;
using DevExpress.XtraPrinting;
using DevExpress.XtraVerticalGrid;
using DevExpress.XtraVerticalGrid.Rows;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.TRA.DataManager;
using static SystemX.Product.CP.TRA.Commons;
using static SystemX.Product.TRA.DataManager.DMTestDetail;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRADetailTestResult : UcTRABaseView
{
public enum eColDataTable
{
StepNo,
Position,
Variant,
Gate,
MO,
Function,
Min,
MeasuredValue,
Max,
Dimension,
Result,
Duration
}
DMTestDetail DataManager { get; set; }
DetailTestDataCollection SearchSource { get; set; }
DataTable DTTestlistSrc { get; set; } = null;
DataTable DTTestLogSrc { get; set; } = null;
string TextShowTL { get; } = "Display the Testlist";
string TextShowLOG { get; } = "Display the Test Result";
private string GridViewGetActiveFilterText;
public UcTRADetailTestResult()
{
ContentsType = eContents.TestResult;
//this.ContextMenuStrip = base.contextMenuStripTest;
InitializeComponent();
}
public void SetSQLConnection(eSelectDataView SelectView, IDataBaseController getDBController, DateTime dtStart)
{
DataManager = new DMTestDetail(SelectView, getDBController, dtStart);
}
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 = "Detail Test Data";
gridControlMain.ExportToXlsx(strFile, option);
Workbook wbook = new Workbook();
wbook.LoadDocument(strFile);
Worksheet worksheetInfo = wbook.Worksheets.Add("Detail Test Info.");
int nIdx = 0;
foreach (var row in vGridControlInfo.Rows)
{
if (row is CategoryRow)
{
worksheetInfo.Cells[nIdx, 0].Value = row.Properties.Caption.ToString();
CellRange cr = worksheetInfo.Range.FromLTRB(0, nIdx, 2, nIdx);
worksheetInfo.MergeCells(cr);
}
else
{
worksheetInfo.Cells[nIdx, 1].Value = row.Properties.Caption.ToString();
worksheetInfo.Cells[nIdx, 2].Value = row.Properties.Value?.ToString();
}
nIdx++;
}
worksheetInfo.Columns.AutoFit(0, 3);
worksheetInfo.AutoOutline();
wbook.SaveDocument(strFile);
}
}
public string CreateExportFileName()
{
string strFileName = $"{this.ContentsType.ToString()}_{SearchSource.ProductID}_{SearchSource.ProductNo}_{SearchSource.TestCode}_{SearchSource.StationName}_{SearchSource.TestResult}";
strFileName += $"_{SearchSource.StartTime.ToString("yyyyMMddHHmmss")}";
return strFileName;
}
public void ViewData(DetailTestDataCollection data)
{
if (data == null)
return;
SearchSource = data;
ShowProperties(data);
DTTestLogSrc = DataManager.SearchTestHistory(data);
DTTestlistSrc = DataManager.SearchTestlist(data);
ShowDetailData(data);
}
DataTable CombineLogForm()
{
if (DTTestLogSrc == null || DTTestlistSrc == null)
return null;
DataTable dtFinal = new DataTable();
foreach(string strCol in Enum.GetNames(typeof(eColDataTable)))
{
Type typCol = typeof(string);
if (strCol == eColDataTable.StepNo.ToString())
typCol = typeof(int);
if (strCol == eColDataTable.Position.ToString())
typCol = typeof(int);
else if (strCol == eColDataTable.Duration.ToString())
typCol = typeof(double);
dtFinal.Columns.Add(strCol, typCol);
}
foreach (DataRow drLog in DTTestLogSrc.AsEnumerable())
{
//DataRow drTL = DTTestlistSrc.AsEnumerable().Where(x => Convert.ToInt32(x[eColTestlist.StepID.ToString()]) == Convert.ToInt32(drLog[eColTestLog.StepID.ToString()])).FirstOrDefault();
//PK 기준 검색
DataRow drTL = DTTestlistSrc.Rows.Find(drLog[eColTestLog.StepID.ToString()]);
if (drTL == null)
continue;
DataRow drDisp = dtFinal.NewRow();
drDisp[eColDataTable.StepNo.ToString()] = Convert.ToInt32(Convert.ToInt32(drLog[eColTestLog.StepID.ToString()]));
drDisp[eColDataTable.Position.ToString()] = Convert.ToInt32(Convert.ToInt32(drTL[eColTestlist.Position.ToString()]));
drDisp[eColDataTable.Variant.ToString()] = drTL[eColTestlist.Variant.ToString()].ToString();
drDisp[eColDataTable.Gate.ToString()] = drTL[eColTestlist.Gate.ToString()].ToString();
drDisp[eColDataTable.MO.ToString()] = drTL[eColTestlist.StepDesc.ToString()].ToString();
drDisp[eColDataTable.Function.ToString()] = drTL[eColTestlist.UseFunction.ToString()].ToString();
bool bIsGlobal = (Convert.ToInt32(drTL[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false;
drDisp[eColDataTable.Min.ToString()] = bIsGlobal ? drLog[eColTestLog.GlobalMin.ToString()].ToString() : drTL[eColTestlist.SpecMin.ToString()].ToString();
drDisp[eColDataTable.Max.ToString()] = bIsGlobal ? drLog[eColTestLog.GlobalMax.ToString()].ToString() : drTL[eColTestlist.SpecMax.ToString()].ToString();
string strMessage = drLog[eColTestLog.Message.ToString()].ToString();
string strMeasValStr = drLog[eColTestLog.MeasValStr.ToString()].ToString();
string strMeasVal = drLog[eColTestLog.MeasVal.ToString()].ToString();
string strMin = drDisp[eColDataTable.Min.ToString()].ToString();
string strMax = drDisp[eColDataTable.Max.ToString()].ToString();
bool bJustCallMacro = false;
if (string.IsNullOrWhiteSpace(strMin) &&
string.IsNullOrWhiteSpace(strMax) &&
strMeasVal == "0.00000")
bJustCallMacro = true;
/*
string strDispValue = string.IsNullOrWhiteSpace(strMessage) ?
(string.IsNullOrWhiteSpace(strMeasValStr) ? strMeasVal : strMeasValStr) : strMessage;
*/
string strDispValue = string.IsNullOrWhiteSpace(strMessage) ?
(string.IsNullOrWhiteSpace(strMeasValStr) ? (bJustCallMacro ? "" : strMeasVal) : strMeasValStr) : strMessage;
drDisp[eColDataTable.MeasuredValue.ToString()] = strDispValue;
drDisp[eColDataTable.Dimension.ToString()] = drTL[eColTestlist.Dim.ToString()].ToString();
drDisp[eColDataTable.Result.ToString()] = drLog[eColTestLog.Result.ToString()].ToString();
string strValue = drLog[(int)eColTestLog.SpentTime].ToString();
double dVal = string.IsNullOrWhiteSpace(strValue) ? double.NaN : Convert.ToDouble(strValue);
drDisp[eColDataTable.Duration.ToString()] = dVal;
dtFinal.Rows.Add(drDisp);
}
return dtFinal;
}
void ShowDetailData(DetailTestDataCollection data)
{
DataTable dtResult = CombineLogForm();
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.BeginInit();
gridControlMain.DataSource = dtResult;
gridControlMain.Update();
gridControlMain.RefreshDataSource();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
gridControlMain.EndInit();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
void ShowTestlistData(DetailTestDataCollection data)
{
DataTable dtResult = DTTestlistSrc;
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.BeginInit();
gridControlMain.DataSource = dtResult;
gridControlMain.Update();
gridControlMain.RefreshDataSource();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
foreach (string strColName in Enum.GetNames(typeof(eColHideListTL)))
{
if (gridViewMain.Columns.ColumnByFieldName(strColName) != null)
gridViewMain.Columns[strColName].Visible = false;
}
gridControlMain.EndInit();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
void ShowProperties(DetailTestDataCollection data)
{
vGridControlInfo.Rows.Clear();
foreach (PropertyInfo propInf in data.GetType().GetProperties())
{
EditorRow dtRow = new EditorRow();
dtRow.Properties.Caption = propInf.Name;
dtRow.Properties.Value = propInf.GetValue(data, null)?.ToString();
vGridControlInfo.Rows.Add(dtRow);
}
OnSizeChanged(vGridControlInfo);
if (data.TestResult.ToUpper() == "OK")
panelControlResult.Appearance.BackColor = Color.LightGreen;
else
panelControlResult.Appearance.BackColor = Color.IndianRed;
}
void OnSizeChanged(VGridControl grid)
{
int width = grid.ClientSize.Width / (grid.RecordCount + 1);
grid.RecordWidth = width;
grid.RowHeaderWidth = width;
}
private void UcTRADetailTestResult_Load(object sender, System.EventArgs e)
{
simpleButtonTypeConv.Text = TextShowTL;
}
private void simpleButtonTypeConv_Click(object sender, System.EventArgs e)
{
if(simpleButtonTypeConv.Text == TextShowLOG)
{
simpleButtonTypeConv.Text = TextShowTL;
ShowDetailData(SearchSource);
}
else
{
simpleButtonTypeConv.Text = TextShowLOG;
ShowTestlistData(SearchSource);
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,130 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRAOverview
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.filterModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.filtrToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
this.SuspendLayout();
//
// gridControlMain
//
this.gridControlMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControlMain.Location = new System.Drawing.Point(0, 0);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(1040, 576);
this.gridControlMain.TabIndex = 0;
this.gridControlMain.UseDirectXPaint = DevExpress.Utils.DefaultBoolean.True;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.FocusedRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.FocusedRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.FocusedRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.FocusedRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Bold);
this.gridViewMain.Appearance.FocusedRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.FocusedRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.FocusedRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseFont = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseForeColor = true;
this.gridViewMain.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.HideSelectionRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.HideSelectionRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Bold);
this.gridViewMain.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.HideSelectionRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseFont = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseForeColor = true;
this.gridViewMain.Appearance.SelectedRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.SelectedRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.SelectedRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.SelectedRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gridViewMain.Appearance.SelectedRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.SelectedRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.SelectedRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseFont = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseForeColor = true;
this.gridViewMain.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsScrollAnnotations.ShowSelectedRows = DevExpress.Utils.DefaultBoolean.True;
this.gridViewMain.OptionsSelection.EnableAppearanceFocusedCell = false;
this.gridViewMain.OptionsSelection.MultiSelect = true;
this.gridViewMain.OptionsView.AllowHtmlDrawGroups = false;
this.gridViewMain.OptionsView.BestFitMode = DevExpress.XtraGrid.Views.Grid.GridBestFitMode.Fast;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
this.gridViewMain.RowClick += new DevExpress.XtraGrid.Views.Grid.RowClickEventHandler(this.gridViewMain_RowClick);
this.gridViewMain.RowCellClick += new DevExpress.XtraGrid.Views.Grid.RowCellClickEventHandler(this.gridViewMain_RowCellClick);
this.gridViewMain.RowStyle += new DevExpress.XtraGrid.Views.Grid.RowStyleEventHandler(this.gridViewMain_RowStyle);
this.gridViewMain.MouseDown += new System.Windows.Forms.MouseEventHandler(this.gridViewMain_MouseDown);
//
// filterModeToolStripMenuItem
//
this.filterModeToolStripMenuItem.Name = "filterModeToolStripMenuItem";
this.filterModeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.filterModeToolStripMenuItem.Text = "Merge Mode";
//
// filtrToolStripMenuItem
//
this.filtrToolStripMenuItem.Name = "filtrToolStripMenuItem";
this.filtrToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.filtrToolStripMenuItem.Text = "Filter Row";
//
// UcTRAOverview
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.gridControlMain);
this.Name = "UcTRAOverview";
this.Size = new System.Drawing.Size(1040, 576);
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ToolStripMenuItem filterModeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem filtrToolStripMenuItem;
private DevExpress.XtraGrid.GridControl gridControlMain;
public DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
}
}

View File

@ -0,0 +1,378 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using SystemX.Product.TRA.DataManager;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Columns;
using SystemX.Product.TRA.UIControl.Helper;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using SystemX.Product.ALIS.Interface;
using SystemX.Net.Platform.Common.Util;
using static SystemX.Net.Platform.Common.Util.LogMessage;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRAOverview : UcTRABaseView
{
public enum eColHide
{
TestlistNo,
StepVersion,
RN
}
DMOverview DataManager { get; set; }
public string GetUseQuery()
{
return DataManager.strOverviewUseQuery;
}
public OverviewSearchOption Option { get; set; }
public delegate void evtDataSelectHandler(SelectedDataCollection data);
public event evtDataSelectHandler OnSelect;
public DateTime SearchStart { get; set; }
public DateTime SearchEnd { get; set; }
public bool bAllowCheckedState;
private IChildController refChildInterface;
private string GridViewGetActiveFilterText;
public UcTRAOverview(IChildController getChildControl, eContents SetContentsType = eContents.Overview, bool bAllowMerge = false, bool bAutoFilterRow = false)
{
ContentsType = SetContentsType;
refChildInterface = getChildControl;
this.ContextMenuStrip = base.contextMenuStripTest;
this.ContextMenuStrip.ItemClicked += contextMenuStrip_ItemClicked;
SetMenuEnabled(ContentsType);
InitializeComponent();
gridViewMain.OptionsView.AllowCellMerge = true;
bAllowCheckedState = bAllowMerge;
gridViewMain.OptionsView.ShowAutoFilterRow = bAutoFilterRow;
/*MergedRowsHelper helper = new MergedRowsHelper();
helper.Register(gridViewMain);
gridViewMain.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
gridViewMain.OptionsBehavior.Editable = false;
gridViewMain.OptionsSelection.EnableAppearanceFocusedCell = false;
DevExpress.Skins.Skin currentSkin = DevExpress.Skins.CommonSkins.GetSkin(gridControlMain.LookAndFeel);
Color color = currentSkin.Colors["Highlight"];
gridViewMain.Appearance.FocusedRow.BackColor = color;*/
}
~UcTRAOverview()
{
this.ContextMenuStrip.ItemClicked -= contextMenuStrip_ItemClicked;
}
public void SetSqlCommandCancel()
{
DataManager.SetSqlCommandCancel();
}
public bool GetSqlCommandCancelState()
{
return DataManager.GetSqlCommandCancelState();
}
private void contextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
ToolStripItem tsp = e.ClickedItem;
int nTag = Convert.ToInt32(tsp.Tag);
switch (nTag)
{
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
refChildInterface.SetNgHistView(ContentsType);
break;
case 8:
refChildInterface.SetDetailOverview();
break;
}
}
public void SetSQLConnection(eSelectDataView SelectView, eOverviewModelNameInfo SelectInfo, IDataBaseController getDBController)
{
DataManager = new DMOverview(SelectView, SelectInfo, getDBController);
}
public void SetGridViewStyle()
{
gridViewMain.BeginUpdate();
foreach (GridColumn gc in gridViewMain.Columns)
{
if (gc.FieldName.CompareTo("TestDate") == 0)
{
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
gc.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
if(ContentsType == eContents.HostUseHistory)
gc.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm:ss.fff";
}
else if (gc.FieldName.CompareTo("Host") == 0)
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
else
{
/*
if (bAllowCheckedState)
{
if (gc.FieldName.CompareTo("ProductNo") == 0)
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
else if (gc.FieldName.CompareTo("TestCode") == 0)
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
else
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
}
else
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
*/
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
}
}
/*
int[] nGroupIdx = null;
nGroupIdx = new int[2] { 5, 6 };
for (int i = 0; i < nGroupIdx.Count(); i++)
{
if (bAllowCheckedState)
gridViewMain.Columns[nGroupIdx[0]].Group();
else
gridViewMain.Columns[nGroupIdx[0]].UnGroup();
}
if (bAllowCheckedState)
gridViewMain.CollapseAllGroups();
*/
gridViewMain.EndUpdate();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
public async Task<OverviewSearchOption> ViewData(eSelectDataView SelectView, DateTime dtStart, DateTime dtEnd, OverviewSearchOption OvOp, bool bMergeByPartNumber = false, bool bUseMainConn = false, string strTestQuery = "")
{
FrmOptionOverview dlgOption = new FrmOptionOverview();
Option = dlgOption.GetSelectedResult();
Option.DisplayByStation = OvOp.DisplayByStation;
Option.ViewOptionPanel = OvOp.ViewOptionPanel;
Option.FullScanData = OvOp.FullScanData;
Option.ProductID = OvOp.ProductID;
if (OvOp.ViewOptionPanel)
{
dlgOption.ShowDialog();
Option = dlgOption.GetSelectedResult();
}
else
{
Option.DisplayByStation = !bMergeByPartNumber;
}
if (bMergeByPartNumber)
SetMenuFindErrorEnabled(!bMergeByPartNumber);
DataTable dtResult = await DataManager.GetDataView(SelectView, dtStart, dtEnd, Option, bUseMainConn, strTestQuery);
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.DataSource = null;
gridControlMain.RefreshDataSource();
gridViewMain.RefreshData();
gridControlMain.DataSource = dtResult;
gridControlMain.RefreshDataSource();
gridViewMain.RefreshData();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
foreach (string strName in Enum.GetNames(typeof(eColHide)))
{
if(gridViewMain.Columns.ColumnByFieldName(strName) != null)
gridViewMain.Columns[strName].Visible = false;
}
gridControlMain.Update();
SetGridViewStyle();
return Option;
}
public bool DoSelect(DataRow dtRow)
{
if (dtRow == null)
return false;
bool bDataCheckResult = true;
try
{
string strDate = dtRow[DMOverview.eColList.TestDate.ToString()].ToString();
string strStartTime = dtRow[DMOverview.eColList.FirstTestTime.ToString()].ToString();
string strEndTime = dtRow[DMOverview.eColList.FinalTestTime.ToString()].ToString();
DateTime dtDate = DateTime.Parse(strDate);
strStartTime = dtDate.ToShortDateString() + " " + strStartTime;
strEndTime = dtDate.ToShortDateString() + " " + strEndTime;
DateTime dtStart = DateTime.Parse(strStartTime);
DateTime dtEnd = DateTime.Parse(strEndTime);
//string strStnName, string strHostID, string strSectionID, string strTestType,
//string strProdNo, string strTestCode, string strParentNo, string strProdCode,
//string strFileVer, string strStepVer)
string strTestListCntID = string.Empty;
if (Option.DisplayByStation)
strTestListCntID = dtRow[DMOverview.eColList.TestListCntID.ToString()].ToString();
SelectedDataCollection selData = new SelectedDataCollection(
SearchStart,
SearchEnd,
dtStart,
dtEnd,
Option.DisplayByStation ? dtRow[DMOverview.eColList.StationName.ToString()].ToString() : string.Empty,
Option.DisplayByStation ? dtRow[DMOverview.eColList.Host.ToString()].ToString() : string.Empty,
Option.DisplayByStation ? dtRow[DMOverview.eColList.Section.ToString()].ToString() : string.Empty,
dtRow[DMOverview.eColList.TestType.ToString()].ToString(),
dtRow[DMOverview.eColList.ProductNo.ToString()].ToString(),
dtRow[DMOverview.eColList.TestCode.ToString()].ToString(),
dtRow[DMOverview.eColList.ParentNo.ToString()].ToString(),
dtRow[DMOverview.eColList.FileCode.ToString()].ToString(),
dtRow[DMOverview.eColList.TestListFileNo.ToString()].ToString(),
dtRow[DMOverview.eColList.TestListVariantNo.ToString()].ToString(),
dtRow[DMOverview.eColList.FileVersion.ToString()].ToString(),
dtRow[DMOverview.eColList.StepVersion.ToString()].ToString(),
strTestListCntID);
if (Option.ProductID.Length > 0)
selData.SetProdcutID(Option.ProductID);
refChildInterface.AnnounceContentsType(ContentsType);
OnSelect(selData);
}
catch(Exception e)
{
MessageOutput.ConsoleWrite($"Overview DoSelect Error: {e.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
bDataCheckResult = false;
}
finally
{
;//
}
return bDataCheckResult;
}
private DataRow GetRowInfo(object Viewer, int nRowHndl)
{
DataRow dtRow = null;
try
{
GridView view = Viewer as GridView;
var dvRow = view.GetRow(nRowHndl);
dtRow = (dvRow as DataRowView).Row;
}
catch{
dtRow = null;
}
return dtRow;
}
private void gridViewMain_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
{
int nRowHndl = e.RowHandle;
if (nRowHndl < 0)
return;
DoSelect(GetRowInfo(sender, nRowHndl));
}
private void gridViewMain_RowStyle(object sender, RowStyleEventArgs e)
{
GridView view = sender as GridView;
if (view.FocusedRowHandle == e.RowHandle)
{
GridViewInfo viewInfo = gridViewMain.GetViewInfo() as GridViewInfo;
e.Appearance.Assign(viewInfo.PaintAppearance.FocusedRow);
e.HighPriority = true;
}
}
private void gridViewMain_RowCellClick(object sender, RowCellClickEventArgs e)
{
int nClickCnt = e.Clicks;
if (nClickCnt < 2)
return;
int nRowHndl = e.RowHandle;
if (nRowHndl < 0)
return;
if(DoSelect(GetRowInfo(sender, nRowHndl)))
refChildInterface.CallDetailOverView();
}
private void gridViewMain_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
GridHitInfo hInfo = gridViewMain.CalcHitInfo(gridControlMain.PointToClient(Cursor.Position));
if (hInfo.RowInfo != null)
{
int nGetRowHandle = hInfo.RowInfo.RowHandle;
DoSelect(GetRowInfo(gridViewMain, nGetRowHandle));
}
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,127 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRAProdHistHost
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
this.SuspendLayout();
//
// gridControlMain
//
this.gridControlMain.Location = new System.Drawing.Point(2, 2);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(916, 578);
this.gridControlMain.TabIndex = 0;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.Row.BackColor = System.Drawing.Color.Transparent;
this.gridViewMain.Appearance.Row.Options.UseBackColor = true;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsBehavior.ReadOnly = true;
this.gridViewMain.OptionsView.HeaderFilterButtonShowMode = DevExpress.XtraEditors.Controls.FilterButtonShowMode.SmartTag;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.ShowAlways;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
this.gridViewMain.DoubleClick += new System.EventHandler(this.gridViewMain_DoubleClick);
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.gridControlMain);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(920, 582);
this.layoutControl1.TabIndex = 1;
this.layoutControl1.Text = "layoutControl1";
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem1});
this.Root.Name = "Root";
this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
this.Root.Size = new System.Drawing.Size(920, 582);
this.Root.Spacing = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
this.Root.TextVisible = false;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.gridControlMain;
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
this.layoutControlItem1.Size = new System.Drawing.Size(916, 578);
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem1.TextVisible = false;
//
// UcTRAProdHistHost
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layoutControl1);
this.Name = "UcTRAProdHistHost";
this.Size = new System.Drawing.Size(920, 582);
this.Load += new System.EventHandler(this.UcTRATestHistHost_Load);
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraGrid.GridControl gridControlMain;
private DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
}
}

View File

@ -0,0 +1,161 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using SystemX.Product.TRA.DataManager;
using static SystemX.Product.CP.TRA.MainForm;
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraPrinting;
using SystemX.Product.ALIS.Interface;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRAProdHistHost : UcTRABaseView
{
public enum eColHide
{
TestListNo,
TestlistFile
}
DMTestHistory DataManager { get; set; }
TestHistorySearchOption Option { get; set; }
SelectedDataCollection SelectedData { get; set; }
public DataTable DataResult { get; private set; }
public delegate void evtDataDetailViewHandler(DetailTestDataCollection data);
public event evtDataDetailViewHandler OnDetailSelect;
private string GridViewGetActiveFilterText;
public UcTRAProdHistHost()
{
ContentsType = eContents.ProductHistory;
InitializeComponent();
}
public void SetSQLConnection(eSelectDataView SelectView, IDataBaseController getDBController)
{
DataManager = new DMTestHistory(SelectView, getDBController);
}
public DetailTestDataCollection GetSearchInfo(DataRow dtRow)
{
DetailTestDataCollection drDetail = new DetailTestDataCollection();
//drDetail.TestID = dtRow[DMTestHistory.eColList.TestID.ToString()].ToString();
drDetail.No = Convert.ToInt64(dtRow[DMTestHistory.eColList.No.ToString()]);
drDetail.StartTime = DateTime.Parse(dtRow[DMTestHistory.eColList.TestDateTime.ToString()].ToString());
drDetail.Duration = Convert.ToInt64(dtRow[DMTestHistory.eColList.Duration.ToString()]);
drDetail.StationName = dtRow[DMTestHistory.eColList.StationName.ToString()].ToString();
drDetail.HostID = dtRow[DMTestHistory.eColList.Host.ToString()].ToString();
drDetail.SectionID = dtRow[DMTestHistory.eColList.Section.ToString()].ToString();
drDetail.TestType = dtRow[DMTestHistory.eColList.TestType.ToString()].ToString();
drDetail.ProductID = dtRow[DMTestHistory.eColList.ProductID.ToString()].ToString();
drDetail.ProductNo = dtRow[DMTestHistory.eColList.ProductNo.ToString()].ToString();
drDetail.TestCode = dtRow[DMTestHistory.eColList.TestCode.ToString()].ToString();
drDetail.ParentNo = dtRow[DMTestHistory.eColList.ParentNo.ToString()].ToString();
drDetail.FileCode = dtRow[DMTestHistory.eColList.FileCode.ToString()].ToString();
drDetail.FileVersion = dtRow[DMTestHistory.eColList.FileVersion.ToString()].ToString();
drDetail.TestlistFileName = dtRow[DMTestHistory.eColList.TestlistFileName.ToString()].ToString();
drDetail.TestListFileNo = dtRow[DMTestHistory.eColList.TestListFileNo.ToString()].ToString();
drDetail.TestListVariantNo = dtRow[DMTestHistory.eColList.TestListVariantNo.ToString()].ToString();
drDetail.StepVersion = dtRow[DMTestHistory.eColList.StepVersion.ToString()].ToString();
drDetail.TestRequestID = dtRow[DMTestHistory.eColList.TestlistReqID.ToString()].ToString();
drDetail.TestResult = dtRow[DMTestHistory.eColList.TestResult.ToString()].ToString();
return drDetail;
}
private void UcTRATestHistHost_Load(object sender, EventArgs e)
{
Option = new TestHistorySearchOption();
FrmOptionStationSearch dlgSearch = new FrmOptionStationSearch();
dlgSearch.ShowDialog();
if (dlgSearch.DialogResult == DialogResult.OK)
Option = dlgSearch.GetSelectedResult();
}
private void gridViewMain_DoubleClick(object sender, EventArgs e)
{
DXMouseEventArgs ea = e as DXMouseEventArgs;
GridView view = sender as GridView;
GridHitInfo info = view.CalcHitInfo(ea.Location);
if (info.InRow || info.InRowCell)
{
int nRow = int.MinValue;
nRow = info.RowHandle;
if (nRow < 0)
return;
var dvRow = view.GetRow(nRow);
DataRow dtRow = (dvRow as DataRowView).Row;
DetailTestDataCollection drDetail = GetSearchInfo(dtRow);
OnDetailSelect(drDetail);
}
}
public List<DetailTestDataCollection> GetResultContents()
{
List<DetailTestDataCollection> vDetailData = new List<DetailTestDataCollection>();
GridView view = gridViewMain as GridView;
for(int i=0; i<view.RowCount; i++)
{
DataRow dtRow = (view.GetRow(i) as DataRowView).Row;
DetailTestDataCollection dtContent = GetSearchInfo(dtRow);
vDetailData.Add(dtContent);
}
return vDetailData;
}
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;
}
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 History";
gridControlMain.ExportToXlsx(strFile, option);
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,127 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRAProductHist
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
this.SuspendLayout();
//
// gridControlMain
//
this.gridControlMain.Location = new System.Drawing.Point(2, 2);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(916, 578);
this.gridControlMain.TabIndex = 0;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.Row.BackColor = System.Drawing.Color.Transparent;
this.gridViewMain.Appearance.Row.Options.UseBackColor = true;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsBehavior.ReadOnly = true;
this.gridViewMain.OptionsView.HeaderFilterButtonShowMode = DevExpress.XtraEditors.Controls.FilterButtonShowMode.SmartTag;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.ShowAlways;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
this.gridViewMain.DoubleClick += new System.EventHandler(this.gridViewMain_DoubleClick);
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.gridControlMain);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(920, 582);
this.layoutControl1.TabIndex = 1;
this.layoutControl1.Text = "layoutControl1";
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem1});
this.Root.Name = "Root";
this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
this.Root.Size = new System.Drawing.Size(920, 582);
this.Root.Spacing = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
this.Root.TextVisible = false;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.gridControlMain;
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
this.layoutControlItem1.Size = new System.Drawing.Size(916, 578);
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem1.TextVisible = false;
//
// UcTRATestHistHost
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layoutControl1);
this.Name = "UcTRATestHistHost";
this.Size = new System.Drawing.Size(920, 582);
this.Load += new System.EventHandler(this.UcTRATestHistHost_Load);
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraGrid.GridControl gridControlMain;
private DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
}
}

View File

@ -0,0 +1,144 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using SystemX.Product.TRA.DataManager;
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraPrinting;
using SystemX.Product.ALIS.Interface;
using static SystemX.Product.CP.TRA.MainForm;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRAProductHist : UcTRABaseView
{
public enum eColHide
{
TestlistNo,
TestlistFile
}
DMProductHistory DataManager { get; set; }
TestHistorySearchOption Option { get; set; }
SelectedDataCollection SelectedData { get; set; }
public DataTable DataResult { get; private set; }
public delegate void evtStepTrendViewHandler(TestTrendDataCollection data);
public event evtStepTrendViewHandler OnHistorySelect;
private string GridViewGetActiveFilterText;
public UcTRAProductHist()
{
ContentsType = eContents.ProductHistory;
InitializeComponent();
}
public void SetSQLConnection(eSelectDataView SelectView, IDataBaseController getDBController)
{
DataManager = new DMProductHistory(SelectView, getDBController);
}
public void ViewData(SelectedDataCollection data)
{
if (data == null)
return;
SelectedData = data;
DataTable dtResult = DataManager.SearchTestHistory(data, Option);
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
DataResult = dtResult;
gridControlMain.BeginInit();
gridControlMain.DataSource = dtResult;
gridControlMain.Update();
gridControlMain.RefreshDataSource();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
foreach (string strColName in Enum.GetNames(typeof(eColHide)))
gridViewMain.Columns[strColName].Visible = false;
gridControlMain.EndInit();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
private void UcTRATestHistHost_Load(object sender, EventArgs e)
{
Option = new TestHistorySearchOption();
FrmOptionStationSearch dlgSearch = new FrmOptionStationSearch();
dlgSearch.ShowDialog();
if (dlgSearch.DialogResult == DialogResult.OK)
Option = dlgSearch.GetSelectedResult();
}
private void gridViewMain_DoubleClick(object sender, EventArgs e)
{
DXMouseEventArgs ea = e as DXMouseEventArgs;
GridView view = sender as GridView;
GridHitInfo info = view.CalcHitInfo(ea.Location);
if (info.InRow || info.InRowCell)
{
int nRow = int.MinValue;
nRow = info.RowHandle;
if (nRow < 0)
return;
var dvRow = view.GetRow(nRow);
DataRow dtRow = (dvRow as DataRowView).Row;
//GetSearchInfo(dtRow);
}
}
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;
}
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 History";
gridControlMain.ExportToXlsx(strFile, option);
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,404 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRAStepTrend
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.toggleSwitchAutoRange = new DevExpress.XtraEditors.ToggleSwitch();
this.simpleButtonAllData = new DevExpress.XtraEditors.SimpleButton();
this.simpleButtonOKDataOnly = new DevExpress.XtraEditors.SimpleButton();
this.groupControl2 = new DevExpress.XtraEditors.GroupControl();
this.vGridControlStepSummary = new DevExpress.XtraVerticalGrid.VGridControl();
this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
this.vGridControlInfo = new DevExpress.XtraVerticalGrid.VGridControl();
this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.chartControlMain = new DevExpress.XtraCharts.ChartControl();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.toggleSwitchAutoRange.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.groupControl2)).BeginInit();
this.groupControl2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.vGridControlStepSummary)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit();
this.groupControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.vGridControlInfo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel1)).BeginInit();
this.splitContainerControl1.Panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel2)).BeginInit();
this.splitContainerControl1.Panel2.SuspendLayout();
this.splitContainerControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.chartControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
this.SuspendLayout();
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.labelControl1);
this.layoutControl1.Controls.Add(this.toggleSwitchAutoRange);
this.layoutControl1.Controls.Add(this.simpleButtonAllData);
this.layoutControl1.Controls.Add(this.simpleButtonOKDataOnly);
this.layoutControl1.Controls.Add(this.groupControl2);
this.layoutControl1.Controls.Add(this.groupControl1);
this.layoutControl1.Controls.Add(this.splitContainerControl1);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(1684, 952);
this.layoutControl1.TabIndex = 0;
this.layoutControl1.Text = "layoutControl1";
//
// labelControl1
//
this.labelControl1.Location = new System.Drawing.Point(17, 868);
this.labelControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(110, 22);
this.labelControl1.StyleController = this.layoutControl1;
this.labelControl1.TabIndex = 9;
this.labelControl1.Text = "Auto Range : ";
//
// toggleSwitchAutoRange
//
this.toggleSwitchAutoRange.Location = new System.Drawing.Point(133, 868);
this.toggleSwitchAutoRange.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.toggleSwitchAutoRange.Name = "toggleSwitchAutoRange";
this.toggleSwitchAutoRange.Properties.OffText = "Off";
this.toggleSwitchAutoRange.Properties.OnText = "On";
this.toggleSwitchAutoRange.Size = new System.Drawing.Size(279, 27);
this.toggleSwitchAutoRange.StyleController = this.layoutControl1;
this.toggleSwitchAutoRange.TabIndex = 2;
//
// simpleButtonAllData
//
this.simpleButtonAllData.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Question;
this.simpleButtonAllData.Appearance.Options.UseBackColor = true;
this.simpleButtonAllData.Location = new System.Drawing.Point(211, 901);
this.simpleButtonAllData.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.simpleButtonAllData.Name = "simpleButtonAllData";
this.simpleButtonAllData.Size = new System.Drawing.Size(201, 33);
this.simpleButtonAllData.StyleController = this.layoutControl1;
this.simpleButtonAllData.TabIndex = 8;
this.simpleButtonAllData.Text = "All Data";
this.simpleButtonAllData.Click += new System.EventHandler(this.simpleButtonAllData_Click);
//
// simpleButtonOKDataOnly
//
this.simpleButtonOKDataOnly.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Primary;
this.simpleButtonOKDataOnly.Appearance.Options.UseBackColor = true;
this.simpleButtonOKDataOnly.Location = new System.Drawing.Point(17, 901);
this.simpleButtonOKDataOnly.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.simpleButtonOKDataOnly.Name = "simpleButtonOKDataOnly";
this.simpleButtonOKDataOnly.Size = new System.Drawing.Size(188, 33);
this.simpleButtonOKDataOnly.StyleController = this.layoutControl1;
this.simpleButtonOKDataOnly.TabIndex = 6;
this.simpleButtonOKDataOnly.Text = "Only OK Data";
this.simpleButtonOKDataOnly.Click += new System.EventHandler(this.simpleButtonOKDataOnly_Click);
//
// groupControl2
//
this.groupControl2.Controls.Add(this.vGridControlStepSummary);
this.groupControl2.Location = new System.Drawing.Point(17, 471);
this.groupControl2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupControl2.Name = "groupControl2";
this.groupControl2.Size = new System.Drawing.Size(395, 391);
this.groupControl2.TabIndex = 7;
this.groupControl2.Text = "Measured Data Analysis";
//
// vGridControlStepSummary
//
this.vGridControlStepSummary.BandsInterval = 3;
this.vGridControlStepSummary.Cursor = System.Windows.Forms.Cursors.Default;
this.vGridControlStepSummary.Dock = System.Windows.Forms.DockStyle.Fill;
this.vGridControlStepSummary.Location = new System.Drawing.Point(2, 34);
this.vGridControlStepSummary.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.vGridControlStepSummary.Name = "vGridControlStepSummary";
this.vGridControlStepSummary.OptionsView.FixedLineWidth = 3;
this.vGridControlStepSummary.OptionsView.MinRowAutoHeight = 15;
this.vGridControlStepSummary.RecordWidth = 143;
this.vGridControlStepSummary.RowHeaderWidth = 143;
this.vGridControlStepSummary.Size = new System.Drawing.Size(391, 355);
this.vGridControlStepSummary.TabIndex = 1;
//
// groupControl1
//
this.groupControl1.Controls.Add(this.vGridControlInfo);
this.groupControl1.Location = new System.Drawing.Point(17, 18);
this.groupControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupControl1.Name = "groupControl1";
this.groupControl1.Size = new System.Drawing.Size(395, 447);
this.groupControl1.TabIndex = 6;
this.groupControl1.Text = "Test Step Info.";
//
// vGridControlInfo
//
this.vGridControlInfo.BandsInterval = 3;
this.vGridControlInfo.Cursor = System.Windows.Forms.Cursors.Default;
this.vGridControlInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.vGridControlInfo.Location = new System.Drawing.Point(2, 34);
this.vGridControlInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.vGridControlInfo.Name = "vGridControlInfo";
this.vGridControlInfo.OptionsView.FixedLineWidth = 3;
this.vGridControlInfo.OptionsView.MinRowAutoHeight = 15;
this.vGridControlInfo.RecordWidth = 143;
this.vGridControlInfo.RowHeaderWidth = 143;
this.vGridControlInfo.Size = new System.Drawing.Size(391, 411);
this.vGridControlInfo.TabIndex = 1;
//
// splitContainerControl1
//
this.splitContainerControl1.Location = new System.Drawing.Point(418, 18);
this.splitContainerControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.splitContainerControl1.Name = "splitContainerControl1";
//
// splitContainerControl1.Panel1
//
this.splitContainerControl1.Panel1.Controls.Add(this.gridControlMain);
this.splitContainerControl1.Panel1.Text = "Panel1";
//
// splitContainerControl1.Panel2
//
this.splitContainerControl1.Panel2.Controls.Add(this.chartControlMain);
this.splitContainerControl1.Panel2.Text = "Panel2";
this.splitContainerControl1.Size = new System.Drawing.Size(1249, 916);
this.splitContainerControl1.SplitterPosition = 674;
this.splitContainerControl1.TabIndex = 6;
//
// gridControlMain
//
this.gridControlMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControlMain.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridControlMain.Location = new System.Drawing.Point(0, 0);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(674, 916);
this.gridControlMain.TabIndex = 5;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.Row.BackColor = System.Drawing.Color.Transparent;
this.gridViewMain.Appearance.Row.Options.UseBackColor = true;
this.gridViewMain.DetailHeight = 525;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsBehavior.ReadOnly = true;
this.gridViewMain.OptionsView.HeaderFilterButtonShowMode = DevExpress.XtraEditors.Controls.FilterButtonShowMode.SmartTag;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.ShowAlways;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
this.gridViewMain.RowCellClick += new DevExpress.XtraGrid.Views.Grid.RowCellClickEventHandler(this.gridViewMain_RowCellClick);
//
// chartControlMain
//
this.chartControlMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.chartControlMain.Location = new System.Drawing.Point(0, 0);
this.chartControlMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chartControlMain.Name = "chartControlMain";
this.chartControlMain.SeriesSerializable = new DevExpress.XtraCharts.Series[0];
this.chartControlMain.Size = new System.Drawing.Size(560, 916);
this.chartControlMain.TabIndex = 0;
this.chartControlMain.DoubleClick += new System.EventHandler(this.chartControlMain_DoubleClick);
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem3,
this.layoutControlItem1,
this.layoutControlItem4,
this.layoutControlItem5,
this.layoutControlItem2,
this.layoutControlItem7,
this.layoutControlItem6});
this.Root.Name = "Root";
this.Root.Size = new System.Drawing.Size(1684, 952);
this.Root.TextVisible = false;
//
// layoutControlItem3
//
this.layoutControlItem3.Control = this.splitContainerControl1;
this.layoutControlItem3.Location = new System.Drawing.Point(401, 0);
this.layoutControlItem3.Name = "layoutControlItem3";
this.layoutControlItem3.Size = new System.Drawing.Size(1255, 922);
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem3.TextVisible = false;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.groupControl1;
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem1.MaxSize = new System.Drawing.Size(401, 0);
this.layoutControlItem1.MinSize = new System.Drawing.Size(401, 7);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Size = new System.Drawing.Size(401, 453);
this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem1.TextVisible = false;
//
// layoutControlItem4
//
this.layoutControlItem4.Control = this.simpleButtonOKDataOnly;
this.layoutControlItem4.Location = new System.Drawing.Point(0, 883);
this.layoutControlItem4.MaxSize = new System.Drawing.Size(0, 39);
this.layoutControlItem4.MinSize = new System.Drawing.Size(127, 39);
this.layoutControlItem4.Name = "layoutControlItem4";
this.layoutControlItem4.Size = new System.Drawing.Size(194, 39);
this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem4.TextVisible = false;
//
// layoutControlItem5
//
this.layoutControlItem5.Control = this.simpleButtonAllData;
this.layoutControlItem5.Location = new System.Drawing.Point(194, 883);
this.layoutControlItem5.MaxSize = new System.Drawing.Size(0, 39);
this.layoutControlItem5.MinSize = new System.Drawing.Size(127, 39);
this.layoutControlItem5.Name = "layoutControlItem5";
this.layoutControlItem5.Size = new System.Drawing.Size(207, 39);
this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem5.TextVisible = false;
//
// layoutControlItem2
//
this.layoutControlItem2.Control = this.groupControl2;
this.layoutControlItem2.Location = new System.Drawing.Point(0, 453);
this.layoutControlItem2.Name = "layoutControlItem2";
this.layoutControlItem2.Size = new System.Drawing.Size(401, 397);
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem2.TextVisible = false;
//
// layoutControlItem7
//
this.layoutControlItem7.Control = this.labelControl1;
this.layoutControlItem7.Location = new System.Drawing.Point(0, 850);
this.layoutControlItem7.Name = "layoutControlItem7";
this.layoutControlItem7.Size = new System.Drawing.Size(116, 33);
this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem7.TextVisible = false;
//
// layoutControlItem6
//
this.layoutControlItem6.Control = this.toggleSwitchAutoRange;
this.layoutControlItem6.Location = new System.Drawing.Point(116, 850);
this.layoutControlItem6.Name = "layoutControlItem6";
this.layoutControlItem6.Size = new System.Drawing.Size(285, 33);
this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem6.TextVisible = false;
//
// UcTRAStepTrend
//
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layoutControl1);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "UcTRAStepTrend";
this.Size = new System.Drawing.Size(1684, 952);
this.Load += new System.EventHandler(this.UcTRADetailTestResult_Load);
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.toggleSwitchAutoRange.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.groupControl2)).EndInit();
this.groupControl2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vGridControlStepSummary)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit();
this.groupControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vGridControlInfo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel1)).EndInit();
this.splitContainerControl1.Panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel2)).EndInit();
this.splitContainerControl1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).EndInit();
this.splitContainerControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.chartControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraEditors.GroupControl groupControl1;
private DevExpress.XtraEditors.SplitContainerControl splitContainerControl1;
private DevExpress.XtraGrid.GridControl gridControlMain;
private DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
private DevExpress.XtraVerticalGrid.VGridControl vGridControlInfo;
private DevExpress.XtraCharts.ChartControl chartControlMain;
private DevExpress.XtraEditors.SimpleButton simpleButtonAllData;
private DevExpress.XtraEditors.SimpleButton simpleButtonOKDataOnly;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
private DevExpress.XtraEditors.LabelControl labelControl1;
private DevExpress.XtraEditors.ToggleSwitch toggleSwitchAutoRange;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
private DevExpress.XtraEditors.GroupControl groupControl2;
private DevExpress.XtraVerticalGrid.VGridControl vGridControlStepSummary;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
}
}

View File

@ -0,0 +1,886 @@
using DevExpress.DataAccess.Excel;
using DevExpress.Export.Xl;
using DevExpress.Utils;
using DevExpress.XtraCharts;
using DevExpress.XtraPrinting;
using DevExpress.XtraVerticalGrid;
using DevExpress.XtraVerticalGrid.Rows;
using DevExpress.Spreadsheet;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using SystemX.Net.Platform.Common.ExtensionMethods;
using SystemX.Product.ALIS.UI.Subs;
using SystemX.Product.TRA.DataManager;
using DevExpress.XtraGrid.Views.Grid;
using SystemX.Product.ALIS.Interface;
using static SystemX.Product.TRA.DataManager.DMTestHistory;
using static SystemX.Product.TRA.DataManager.DMTestSummary;
using static SystemX.Product.TRA.UIControl.UcTRAStepTrend.TrendDataResult;
using static SystemX.Product.CP.TRA.Commons;
using Newtonsoft.Json;
using CPXV2Log = SystemX.Net.Platform.SystemX.Net.XEFCore.DBContext.CPXV2Log;
using SystemX.Common.Util;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRAStepTrend : UcTRABaseView
{
public enum eColDataTable
{
RowNo,
TestTime,
MO,
ProductID,
Min,
Value,
Max,
Result,
Duration
}
public enum eResultType
{
OK,
NG,
NONE
}
DMStepTrend DataManager { get; set; }
TestTrendDataCollection SelectedData { get; set; }
DataTable DTTestlistSrc { get; set; } = null;
DataTable DTTestLogList { get; set; } = null;
DataTable DTTestSummary { get; set; } = null;
WaitProgressForm SplashFormWaiting = null;
List<string> NoChartDispSpec = new List<string>();
delegate void evtDBQueryFinished();
event evtDBQueryFinished evtDBFin;
private string GridViewGetActiveFilterText;
private double dThisMaxLimit;
private double dThisMinLimit;
private double dThisUnitSize;
public UcTRAStepTrend()
{
ContentsType = eContents.TestTrend;
//this.ContextMenuStrip = base.contextMenuStripTest;
InitializeComponent();
FileStream fs = new FileStream("NoChartSpec.def", FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
while (!sr.EndOfStream)
NoChartDispSpec.Add(sr.ReadLine());
sr.Close();
fs.Close();
}
public void SetSQLConnection(eSelectDataView SelectView, IDataBaseController getDBController, DateTime dtStart)
{
DataManager = new DMStepTrend(SelectView, getDBController, dtStart);
}
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 = "Trend Data";
gridControlMain.ExportToXlsx(strFile, option);
Workbook wbook = new Workbook();
wbook.LoadDocument(strFile);
Worksheet worksheetInfo = wbook.Worksheets.Add("Test Trend Info.");
int nIdx = 0;
foreach (var row in vGridControlInfo.Rows)
{
if (row is CategoryRow)
{
worksheetInfo.Cells[nIdx, 0].Value = row.Properties.Caption.ToString();
CellRange cr = worksheetInfo.Range.FromLTRB(0, nIdx, 2, nIdx);
worksheetInfo.MergeCells(cr);
}
else
{
worksheetInfo.Cells[nIdx, 1].Value = row.Properties.Caption.ToString();
worksheetInfo.Cells[nIdx, 2].Value = row.Properties.Value.ToString();
}
nIdx++;
}
worksheetInfo.Cells[nIdx, 0].Value = "Test Step Analysis";
nIdx++;
foreach (var row in vGridControlStepSummary.Rows)
{
if (row is CategoryRow)
{
worksheetInfo.Cells[nIdx, 0].Value = row.Properties.Caption.ToString();
CellRange cr = worksheetInfo.Range.FromLTRB(0, nIdx, 2, nIdx);
worksheetInfo.MergeCells(cr);
}
else
{
worksheetInfo.Cells[nIdx, 1].Value = row.Properties.Caption.ToString();
worksheetInfo.Cells[nIdx, 2].Value = row.Properties.Value.ToString();
}
nIdx++;
}
worksheetInfo.Columns.AutoFit(0, 3);
worksheetInfo.AutoOutline();
wbook.SaveDocument(strFile);
}
}
public string CreateExportFileName()
{
string strFileName = $"{this.ContentsType.ToString()}_{SelectedData.SelectedData.ProductNo}_{SelectedData.SelectedData.TestCode}_{SelectedData.SelectedData.StationName}_{SelectedData.StepNo}";
strFileName += $"_{SelectedData.SelectedData.StartTime.ToString("yyyyMMddHHmmss")}-{SelectedData.SelectedData.StartTime.ToString("yyyyMMddHHmmss")}";
return strFileName;
}
public void ViewData(TestTrendDataCollection data)
{
if (data == null)
return;
SelectedData = data;
DTTestlistSrc = data.DTTestlistSrc;
DTTestLogList = data.DTTestLogList;
try
{
DataRow dtRow = GetTestStepInfo(data.StepNo, data.DTTestlistSrc);
List<DataRow> vdtRowLogs = DTTestLogList.AsEnumerable().Where(x =>
(!Enum.GetNames(typeof(DMOverview.eCommand)).Contains(x[DMTestHistory.eColList.ProductNo.ToString()].ToString())
&& !Enum.GetNames(typeof(DMOverview.eCommand)).Contains(x[DMTestHistory.eColList.ProductID.ToString()].ToString()))).ToList();
ShowProperties(data, dtRow);
DataRow dtRowLogFirst = vdtRowLogs[0];
DateTime dtTested = Convert.ToDateTime(dtRowLogFirst[DMTestHistory.eColList.TestDateTime.ToString()]);
ulong ulAccessNo = Convert.ToUInt64(dtRowLogFirst[DMTestHistory.eColList.No.ToString()]);
CPXV2Log.Tables.HIST_TestResult drStep = null;
for (int i = 0; i < vdtRowLogs.Count; i++)
{
dtRowLogFirst = vdtRowLogs[i];
dtTested = Convert.ToDateTime(dtRowLogFirst[DMTestHistory.eColList.TestDateTime.ToString()]);
ulAccessNo = Convert.ToUInt64(dtRowLogFirst[DMTestHistory.eColList.No.ToString()]);
DataTable dtFirstLog = DataManager.SearchTestResult(dtTested, ulAccessNo);
var logData = dtFirstLog.Rows[0]["LogData"].ToString();
var decompStr = logData.GzipDecompress();
var list = JsonConvert.DeserializeObject<List<CPXV2Log.Tables.HIST_TestResult>>(decompStr);
drStep = list.Where(x => x.StepID.ToString() == data.StepNo.ToString()).FirstOrDefault();
if (drStep != null)
break;
}
if (drStep == null)
return;
int nPoint = 0;
DataTable dtResult = GetTrendData(dtTested, vdtRowLogs);
nPoint = 1;
dtResult = CombineLogForm(dtResult, dtRow);
nPoint = 2;
TrendDataResult resultUnit = MakeTrendSummary(dtResult, dtRow, data);
nPoint = 3;
ShowDataTable(dtResult);
nPoint = 4;
ShowTestStepSummary(resultUnit);
nPoint = 5;
ShowTrendChart(resultUnit);
}
catch (Exception ex)
{
MessageBox.Show($"Searching Failure - {ex.Message}", "Test Trend - Error");
}
}
void CloseWaitingForm()
{
this.Do(() => SplashFormWaiting.Close());
}
DataTable GetTrendData(DateTime dtTested, List<DataRow> vnData)
{
DataTable dtResult = DataManager.GetTestStepResults(dtTested, vnData.Select(x => Convert.ToUInt64(x[0])).ToList());
dtResult.Columns.Add(eColDataTable.RowNo.ToString(), typeof(ulong));
for (int i = 0; i < dtResult.Rows.Count; i++)
dtResult.Rows[i][eColDataTable.RowNo.ToString()] = i + 1;
return dtResult;
}
DataTable CombineLogForm(DataTable dtResult, DataRow dtRowTestlistSpec)
{
DataTable dtFinal = new DataTable();
foreach (string strCol in Enum.GetNames(typeof(eColDataTable)))
{
Type typCol = strCol == eColDataTable.RowNo.ToString() ? typeof(int) : typeof(string);
dtFinal.Columns.Add(strCol, typCol);
}
int index = 0;
foreach (DataRow drLog in dtResult.AsEnumerable())
{
index += 1;
/*string strValue = drLog[DMTestHistory.eColList.TestID.ToString()].ToString();
DataRow drTL = DTTestLogList.AsEnumerable().Where(x =>
x[DMTestHistory.eColList.TestID.ToString()].ToString() == drLog[DMTestHistory.eColList.TestID.ToString()].ToString()).FirstOrDefault();*/
try
{
string logData = drLog["LogData"].ToString();
string decompStr = logData.GzipDecompress();
List<CPXV2Log.Tables.HIST_TestResult> list = JsonConvert.DeserializeObject<List<CPXV2Log.Tables.HIST_TestResult>>(decompStr);
long outValue = 0;
if (Int64.TryParse(dtRowTestlistSpec[2].ToString(), out outValue))
{
CPXV2Log.Tables.HIST_TestResult row = list.Where(x => x.StepID == outValue)?.First();
if(row == null)
{
continue;
}
if (string.IsNullOrEmpty(row.MeasValStr) == true)
{
if (//!string.IsNullOrEmpty(row.MeasValStr) ||
//!string.IsNullOrEmpty(row.Message) ||
((row.MeasVal == 0) ||
string.Compare(row.Result, "NONE") == 0))
continue;
}
//string strValue = drLog[DMTestHistory.eColList.No.ToString()].ToString();
try
{
DataRow drTL = DTTestLogList.AsEnumerable()
.Where(x => Convert.ToInt64(x[DMTestHistory.eColList.No.ToString()]) == Convert.ToInt64(drLog[0].ToString())).FirstOrDefault();
DataRow drDisp = dtFinal.NewRow();
if (drTL == null)
continue;
drDisp[0] = index;
drDisp[1] = drTL[1].ToString();
drDisp[2] = dtRowTestlistSpec[9].ToString();
drDisp[3] = drTL[5].ToString();
bool bIsGlobal = (Convert.ToInt32(dtRowTestlistSpec[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false;
drDisp[4] = bIsGlobal ? row.GlobalMin.ToString() : dtRowTestlistSpec[eColTestlist.SpecMin.ToString()].ToString();
drDisp[5] = bIsGlobal ? row.GlobalMAx.ToString() : dtRowTestlistSpec[eColTestlist.SpecMax.ToString()].ToString();
string strMessage = row.Message.ToString();
string strMeasValStr = row.MeasValStr.ToString();
string strMeasVal = row.MeasVal.ToString();
drDisp[6] = string.IsNullOrWhiteSpace(strMessage) ? (string.IsNullOrWhiteSpace(strMeasValStr) ? strMeasVal : strMeasValStr) : strMessage;
drDisp[7] = row.Result.ToString();
/*
public enum eColDataTable
{
RowNo,
TestTime,
ProductID,
Min,
Value,
Max,
Result,
Duration
}
drDisp[eColDataTable.RowNo.ToString()] = drLog[eColDataTable.RowNo.ToString()];
drDisp[eColDataTable.TestTime.ToString()] = drTL[1].ToString();
drDisp[eColDataTable.ProductID.ToString()] = drTL[5].ToString();
drDisp[eColDataTable.Result.ToString()] = row.Result.ToString();
bool bIsGlobal = (Convert.ToInt32(dtRowTestlistSpec[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false;
drDisp[eColDataTable.Min.ToString()] = bIsGlobal ? row.GlobalMin.ToString() : dtRowTestlistSpec[eColTestlist.SpecMin.ToString()].ToString();
drDisp[eColDataTable.Max.ToString()] = bIsGlobal ? row.GlobalMAx.ToString() : dtRowTestlistSpec[eColTestlist.SpecMax.ToString()].ToString();
string strMessage = row.Message.ToString();
string strMeasValStr = row.MeasValStr.ToString();
string strMeasVal = row.MeasVal.ToString();
drDisp[eColDataTable.Value.ToString()] = string.IsNullOrWhiteSpace(strMessage) ? (string.IsNullOrWhiteSpace(strMeasValStr) ? strMeasVal : strMeasValStr) : strMessage;
drDisp[eColDataTable.Result.ToString()] = row.Result.ToString();
*/
dtFinal.Rows.Add(drDisp);
}
catch (Exception e)
{
}
}
}
catch (Exception ex)
{
}
}
return dtFinal;
}
void ShowDataTable(DataTable dtResult)
{
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.BeginInit();
gridControlMain.DataSource = dtResult;
gridControlMain.Update();
gridControlMain.RefreshDataSource();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
gridControlMain.EndInit();
gridViewMain.BestFitColumns();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
void ShowTrendChart(TrendDataResult resultUnit, bool bAutoRange = false)
{
foreach (Series srsData in chartControlMain.Series)
srsData.Points.Clear();
chartControlMain.Series.Clear();
if (resultUnit == null || resultUnit.DataElements == null || resultUnit.DataElements.Count <= 0)
return;
chartControlMain.CrosshairOptions.ArgumentLineColor = Color.Black;
chartControlMain.CrosshairOptions.CrosshairLabelTextOptions.TextColor = Color.Black;
chartControlMain.CrosshairOptions.CrosshairLabelBackColor = Color.White;
chartControlMain.CrosshairOptions.ValueLineColor = Color.Black;
chartControlMain.CrosshairOptions.GroupHeaderTextOptions.TextColor = Color.Blue;
int nSrsIdxValue = AddSeries("Value", ScaleType.Qualitative, ScaleType.Numerical, Color.Red);
int nSrsIdxMin = AddSeries("Lower Limit", ScaleType.Qualitative, ScaleType.Numerical, Color.Blue);
int nSrsIdxMax = AddSeries("Upper Limit", ScaleType.Qualitative, ScaleType.Numerical, Color.Blue);
AddToolTip("{HINT} \r\n {Value:#0.00}");
SetAxisXRange(DateTimeMeasureUnit.Second, DateTimeGridAlignment.Second);
AxisYRangeAuto(bAutoRange, resultUnit);
SwiftPlotDiagram diagram = (SwiftPlotDiagram)chartControlMain.Diagram;
foreach (StepDataElement item in resultUnit.DataElements)
{
if (item.Result == eResultType.NONE && item.Value == 0)
continue;
if (item.UseMin)
chartControlMain.Series[nSrsIdxMin].Points.Add(new SeriesPoint(item.RowNo, item.Min));
if (item.UseMax)
chartControlMain.Series[nSrsIdxMax].Points.Add(new SeriesPoint(item.RowNo, item.Max));
chartControlMain.Series[nSrsIdxValue].Points.Add(new SeriesPoint(item.RowNo, item.Value));
if (item.Value < item.Min || item.Value > item.Max)
{
if (diagram.AxisY.WholeRange.Auto != true)
{
//diagram.AxisY.WholeRange.Auto = true;
if (chartControlMain.BackColor != Color.WhiteSmoke)
chartControlMain.BackColor = Color.WhiteSmoke;
}
}
}
//diagram.AxisX.Interlaced = false;
diagram.DefaultPane.BackColor = Color.White;
diagram.DefaultPane.RuntimeCollapse = DefaultBoolean.False;
}
private void SetAxisXRange(DateTimeMeasureUnit dtimeUnit, DateTimeGridAlignment dtimeGrid)
{
SwiftPlotDiagram diagram = (SwiftPlotDiagram)chartControlMain.Diagram;
diagram.AxisX.NumericScaleOptions.ScaleMode = ScaleMode.Continuous;
diagram.AxisX.NumericScaleOptions.AutoGrid = true;
diagram.AxisX.Logarithmic = false;
//diagram.AxisX.DateTimeScaleOptions.MeasureUnit = dtimeUnit;
//.AxisX.DateTimeScaleOptions.GridAlignment = dtimeGrid;
diagram.AxisX.Interlaced = true;
diagram.AxisX.InterlacedColor = Color.GhostWhite;
diagram.AxisX.InterlacedFillStyle.FillMode = FillMode.Solid;
diagram.AxisX.NumericScaleOptions.ScaleMode = ScaleMode.Automatic;
diagram.AxisX.LabelPosition = AxisLabelPosition.Outside;
diagram.EnableAxisXScrolling = true;
diagram.EnableAxisXZooming = true;
//
diagram.EnableAxisYScrolling = true;
diagram.EnableAxisYZooming = true;
//
diagram.AxisX.Color = Color.Black;
diagram.AxisX.Label.TextColor = Color.Black;
diagram.AxisY.Color = Color.Black;
diagram.AxisY.Label.TextColor = Color.Black;
chartControlMain.BackColor = Color.White;
}
public void AxisYRangeAuto(bool bAuto, TrendDataResult resultUnit)
{
SwiftPlotDiagram diagram = (SwiftPlotDiagram)chartControlMain.Diagram;
if (diagram == null)
return;
diagram.AxisY.WholeRange.Auto = bAuto;
if (!bAuto)
{
dThisMaxLimit = resultUnit.MaxSpec == resultUnit.dSpecNotUse ? resultUnit.Max : resultUnit.MaxSpec;
dThisMinLimit = resultUnit.MinSpec == resultUnit.dSpecNotUse ? resultUnit.Min : resultUnit.MinSpec;
dThisUnitSize = Math.Abs((dThisMaxLimit - dThisMinLimit) / 10);
diagram.AxisY.WholeRange.SetMinMaxValues(dThisMinLimit - dThisUnitSize, dThisMaxLimit + dThisUnitSize);
}
}
public int AddSeries(string name, ScaleType ArgumentType, ScaleType ValueType, Color seriesColor)
{
Series series = new Series(name, ViewType.SwiftPlot);
chartControlMain.Series.Add(series);
series.ArgumentScaleType = ArgumentType;
series.ValueScaleType = ValueType;
SwiftPlotSeriesView plotSeriesView = new DevExpress.XtraCharts.SwiftPlotSeriesView();
plotSeriesView.Color = seriesColor;
//plotSeriesView.LineMarkerOptions.Color = seriesColor;
//plotSeriesView.LineMarkerOptions.Size = 3;
plotSeriesView.LineStyle.Thickness = 2;
//plotSeriesView.MarkerVisibility = DefaultBoolean.True;
series.View = plotSeriesView;
return chartControlMain.Series.Count - 1;
}
private void AddToolTip(string ToolTipPattern)
{
// Disable a crosshair cursor.
chartControlMain.CrosshairEnabled = DefaultBoolean.True;
// Enable chart tooltips.
chartControlMain.ToolTipEnabled = DefaultBoolean.True;
ToolTipController controller = new ToolTipController();
chartControlMain.ToolTipController = controller;
controller.ShowBeak = true;
// Change the default tooltip mouse position to relative position.
ToolTipRelativePosition relativePosition = new ToolTipRelativePosition();
chartControlMain.ToolTipOptions.ToolTipPosition = relativePosition;
// Specify the tooltip relative position offsets.
relativePosition.OffsetX = 2;
relativePosition.OffsetY = 2;
// Specify the tooltip point pattern.
chartControlMain.Series[0].ToolTipPointPattern = ToolTipPattern;
}
TrendDataResult MakeTrendSummary(DataTable dtResult, DataRow dtRowTestlist, TestTrendDataCollection data, bool bOKDataOnly = true)
{
string strDim = dtRowTestlist[DMTestDetail.eColTestlist.Dim.ToString()].ToString();
if (NoChartDispSpec.Contains(strDim))
return null;
bool bIsGlobal = (Convert.ToInt32(dtRowTestlist[DMTestDetail.eColTestlist.IsGlobal.ToString()])) > 0 ? true : false;
TrendDataResult resultUnit = new TrendDataResult();
StepDataElement elemUnit = null;
foreach (DataRow drValue in dtResult.AsEnumerable())
{
DateTime dtTestedTime = DateTime.Parse(drValue[eColDataTable.TestTime.ToString()].ToString());
string strProdID = drValue[eColDataTable.ProductID.ToString()].ToString();
string strValue = drValue[eColDataTable.Value.ToString()].ToString();
string strMin = drValue[eColDataTable.Min.ToString()].ToString();
string strMax = drValue[eColDataTable.Max.ToString()].ToString();
string strResult = drValue[eColDataTable.Result.ToString()].ToString();
double dValue = 0.0;
if (string.IsNullOrWhiteSpace(strValue))
continue;
if (!double.TryParse(strValue, out dValue))
continue;
elemUnit = new StepDataElement();
elemUnit.RowNo = (int)drValue[eColDataTable.RowNo.ToString()];
elemUnit.TestTime = dtTestedTime;
elemUnit.ProductID = strProdID;
elemUnit.Value = dValue;
if (string.IsNullOrWhiteSpace(strMin))
elemUnit.UseMin = false;
else
{
elemUnit.UseMin = true;
elemUnit.Min = Convert.ToDouble(strMin);
}
if (string.IsNullOrWhiteSpace(strMax))
elemUnit.UseMax = false;
else
{
elemUnit.UseMax = true;
elemUnit.Max = Convert.ToDouble(strMax);
}
if (elemUnit.UseMin && elemUnit.UseMax)
elemUnit.Tolerance = elemUnit.Max - elemUnit.Min;
elemUnit.Result = strResult == "NG" || strResult == "ERROR" ? eResultType.NG : strResult == "OK" ? eResultType.OK : eResultType.NONE;
if (bOKDataOnly && elemUnit.Result != eResultType.OK)
continue;
resultUnit.DataElements.Add(elemUnit);
}
if (resultUnit.DataElements == null || resultUnit.DataElements.Count <= 0)
return null;
double dSpecNotUse = -999999;
List<double> vdValue = (from elem in resultUnit.DataElements let dValue = elem.Value select dValue).ToList();
resultUnit.Average = vdValue.Average();
resultUnit.Min = vdValue.Min();
resultUnit.Max = vdValue.Max();
resultUnit.Variance = vdValue.Variance();
resultUnit.StdDev = vdValue.StandardDeviation();
resultUnit.MinSpec = resultUnit.DataElements[0].UseMin ?
(from elem in resultUnit.DataElements let dValue = elem.Min select dValue).Average() : dSpecNotUse;
resultUnit.MaxSpec = resultUnit.DataElements[0].UseMax ?
(from elem in resultUnit.DataElements let dValue = elem.Max select dValue).Average() : dSpecNotUse;
resultUnit.Cp = resultUnit.DataElements[0].UseMin && resultUnit.DataElements[0].UseMax ?
vdValue.Cp(resultUnit.MaxSpec - resultUnit.MinSpec) : 0.0;
resultUnit.Cpk = resultUnit.DataElements[0].UseMin && resultUnit.DataElements[0].UseMax ?
vdValue.Cpk(resultUnit.MaxSpec, resultUnit.MinSpec) : 0.0;
resultUnit.Cg = resultUnit.DataElements[0].UseMin && resultUnit.DataElements[0].UseMax ?
vdValue.Cg(resultUnit.MaxSpec - resultUnit.MinSpec) : 0.0;
return resultUnit;
}
DataRow GetTestStepInfo(string strStepID, DataTable dtTestlist)
{
int nStepID = Convert.ToInt32(strStepID);
DataRow dtRow = (from dtStepRow in dtTestlist.AsEnumerable()
where dtStepRow[eColTestlist.StepID.ToString()].ToString() == strStepID
select dtStepRow).FirstOrDefault();
return dtRow;
}
void ShowTestStepSummary(TrendDataResult resultUnit)
{
vGridControlStepSummary.Rows.Clear();
if (resultUnit == null || resultUnit.DataElements == null || resultUnit.DataElements.Count <= 0)
return;
EditorRow etRowStep;
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Average";
etRowStep.Properties.Value = resultUnit.Average.ToString();
vGridControlStepSummary.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Min";
etRowStep.Properties.Value = resultUnit.Min.ToString();
vGridControlStepSummary.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Max";
etRowStep.Properties.Value = resultUnit.Max.ToString();
vGridControlStepSummary.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Varaince";
etRowStep.Properties.Value = resultUnit.Variance.ToString();
vGridControlStepSummary.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Std. Dev.";
etRowStep.Properties.Value = resultUnit.StdDev.ToString();
vGridControlStepSummary.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Cp";
etRowStep.Properties.Value = resultUnit.Cp.ToString();
vGridControlStepSummary.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Cpk";
etRowStep.Properties.Value = resultUnit.Cpk.ToString();
vGridControlStepSummary.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Cg";
etRowStep.Properties.Value = resultUnit.Cg.ToString();
vGridControlStepSummary.Rows.Add(etRowStep);
OnSizeChanged(vGridControlStepSummary);
}
void ShowProperties(TestTrendDataCollection data, DataRow dtRow)
{
vGridControlInfo.Rows.Clear();
CategoryRow ctRow = new CategoryRow("Step Info.");
vGridControlInfo.Rows.Add(ctRow);
EditorRow etRowStep = new EditorRow();
etRowStep.Properties.Caption = eColTestlist.StepID.ToString();
etRowStep.Properties.Value = dtRow[eColTestlist.StepID.ToString()].ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = eColTestlist.Variant.ToString();
etRowStep.Properties.Value = dtRow[eColTestlist.Variant.ToString()].ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = eColTestlist.Gate.ToString();
etRowStep.Properties.Value = dtRow[eColTestlist.Gate.ToString()].ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = eColTestlist.Position.ToString();
etRowStep.Properties.Value = dtRow[eColTestlist.Position.ToString()].ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = eColTestlist.StepDesc.ToString();
etRowStep.Properties.Value = dtRow[eColTestlist.StepDesc.ToString()].ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = eColTestlist.UseFunction.ToString();
etRowStep.Properties.Value = dtRow[eColTestlist.UseFunction.ToString()].ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = eColTestlist.Dim.ToString();
etRowStep.Properties.Value = dtRow[eColTestlist.Dim.ToString()].ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "Total";
etRowStep.Properties.Value = data.Total.ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "OK";
etRowStep.Properties.Value = data.OK.ToString();
vGridControlInfo.Rows.Add(etRowStep);
etRowStep = new EditorRow();
etRowStep.Properties.Caption = "NG";
etRowStep.Properties.Value = data.NG.ToString();
vGridControlInfo.Rows.Add(etRowStep);
ctRow = new CategoryRow("Test Data Info.");
vGridControlInfo.Rows.Add(ctRow);
foreach (PropertyInfo propInf in data.SelectedData.GetType().GetProperties())
{
EditorRow etRow = new EditorRow();
etRow.Properties.FieldName = propInf.Name;
etRow.Name = propInf.Name;
etRow.Properties.Caption = propInf.Name;
if (propInf.Name == "TestRequestID")
etRow.Properties.Value = ((string[])propInf.GetValue(data.SelectedData, null))[0];
else
etRow.Properties.Value = propInf.GetValue(data.SelectedData, null)?.ToString();
//etRow.Properties.Value = propInf.GetValue(data.SelectedData, null)?.ToString();
vGridControlInfo.Rows.Add(etRow);
}
OnSizeChanged(vGridControlInfo);
}
void OnSizeChanged(VGridControl grid)
{
int width = grid.ClientSize.Width / (grid.RecordCount + 1);
grid.RecordWidth = width;
grid.RowHeaderWidth = width;
}
private void UcTRADetailTestResult_Load(object sender, System.EventArgs e)
{
}
private void simpleButtonAllData_Click(object sender, EventArgs e)
{
DataRow dtTestlistRow = GetTestStepInfo(SelectedData.StepNo, DTTestlistSrc);
DataTable dtResult = gridControlMain.DataSource as DataTable;
TrendDataResult resultUnit = MakeTrendSummary(dtResult, dtTestlistRow, SelectedData, false);
bool bAutoRange = toggleSwitchAutoRange.IsOn;
ShowTestStepSummary(resultUnit);
ShowTrendChart(resultUnit, bAutoRange);
}
private void simpleButtonOKDataOnly_Click(object sender, EventArgs e)
{
DataRow dtTestlistRow = GetTestStepInfo(SelectedData.StepNo, DTTestlistSrc);
DataTable dtResult = gridControlMain.DataSource as DataTable;
TrendDataResult resultUnit = MakeTrendSummary(dtResult, dtTestlistRow, SelectedData);
bool bAutoRange = toggleSwitchAutoRange.IsOn;
ShowTestStepSummary(resultUnit);
ShowTrendChart(resultUnit, bAutoRange);
}
public class TrendDataResult
{
public class StepDataElement
{
public int RowNo { get; set; }
public DateTime TestTime { get; set; }
public string ProductID { get; set; }
public double Value { get; set; }
public bool UseMin { get; set; }
public bool UseMax { get; set; }
public double Min { get; set; }
public double Max { get; set; }
public double Tolerance { get; set; }
public eResultType Result { get; set; }
}
public double dSpecNotUse = -999999;
public List<StepDataElement> DataElements { get; set; } = new List<StepDataElement>();
public double Average { get; set; }
public double Min { get; set; }
public double Max { get; set; }
public double Variance { get; set; }
public double StdDev { get; set; }
public double MinSpec { get; set; }
public double MaxSpec { get; set; }
public double Cp { get; set; }
public double Cpk { get; set; }
public double Cg { get; set; }
}
private void gridViewMain_RowCellClick(object sender, RowCellClickEventArgs e)
{
int nClickCnt = e.Clicks;
int nRowHndl = e.RowHandle;
if (nRowHndl < 0)
return;
string strGetId = DTTestLogList.Rows[e.RowHandle][18].ToString();
BaseRow br = vGridControlInfo.Rows.GetRowByFieldName("TestRequestID");
vGridControlInfo.SetCellValue(br, 0, strGetId);
}
private void chartControlMain_DoubleClick(object sender, EventArgs e)
{
SwiftPlotDiagram diagram = (SwiftPlotDiagram)chartControlMain.Diagram;
if (diagram != null)
{
diagram.AxisY.WholeRange.Auto = !diagram.AxisY.WholeRange.Auto;
if (diagram.AxisY.WholeRange.Auto)
chartControlMain.BackColor = Color.WhiteSmoke;
else
{
diagram.AxisY.WholeRange.SetMinMaxValues(dThisMinLimit - dThisUnitSize, dThisMaxLimit + dThisUnitSize);
chartControlMain.BackColor = Color.White;
}
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,170 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRASummaryTestResult
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
this.vGridControlInfo = new DevExpress.XtraVerticalGrid.VGridControl();
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit();
this.groupControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.vGridControlInfo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
this.SuspendLayout();
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.groupControl1);
this.layoutControl1.Controls.Add(this.gridControlMain);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(1179, 635);
this.layoutControl1.TabIndex = 0;
this.layoutControl1.Text = "layoutControl1";
//
// groupControl1
//
this.groupControl1.Controls.Add(this.vGridControlInfo);
this.groupControl1.Location = new System.Drawing.Point(12, 12);
this.groupControl1.Name = "groupControl1";
this.groupControl1.Size = new System.Drawing.Size(321, 611);
this.groupControl1.TabIndex = 5;
this.groupControl1.Text = "Test Data Information";
//
// vGridControlInfo
//
this.vGridControlInfo.Cursor = System.Windows.Forms.Cursors.Default;
this.vGridControlInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.vGridControlInfo.Location = new System.Drawing.Point(2, 23);
this.vGridControlInfo.Name = "vGridControlInfo";
this.vGridControlInfo.Size = new System.Drawing.Size(317, 586);
this.vGridControlInfo.TabIndex = 0;
//
// gridControlMain
//
this.gridControlMain.Location = new System.Drawing.Point(337, 12);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(830, 611);
this.gridControlMain.TabIndex = 4;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.Row.BackColor = System.Drawing.Color.Transparent;
this.gridViewMain.Appearance.Row.Options.UseBackColor = true;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsBehavior.ReadOnly = true;
this.gridViewMain.OptionsView.HeaderFilterButtonShowMode = DevExpress.XtraEditors.Controls.FilterButtonShowMode.SmartTag;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.ShowAlways;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
this.gridViewMain.DoubleClick += new System.EventHandler(this.gridViewMain_DoubleClick);
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem1,
this.layoutControlItem2});
this.Root.Name = "Root";
this.Root.Size = new System.Drawing.Size(1179, 635);
this.Root.TextVisible = false;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.gridControlMain;
this.layoutControlItem1.Location = new System.Drawing.Point(325, 0);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Size = new System.Drawing.Size(834, 615);
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem1.TextVisible = false;
//
// layoutControlItem2
//
this.layoutControlItem2.Control = this.groupControl1;
this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem2.MaxSize = new System.Drawing.Size(325, 0);
this.layoutControlItem2.MinSize = new System.Drawing.Size(325, 5);
this.layoutControlItem2.Name = "layoutControlItem2";
this.layoutControlItem2.Size = new System.Drawing.Size(325, 615);
this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem2.TextVisible = false;
//
// UcTRASummaryTestResult
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layoutControl1);
this.Name = "UcTRASummaryTestResult";
this.Size = new System.Drawing.Size(1179, 635);
this.Load += new System.EventHandler(this.UcTRADetailTestResult_Load);
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit();
this.groupControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vGridControlInfo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraEditors.GroupControl groupControl1;
private DevExpress.XtraGrid.GridControl gridControlMain;
private DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
private DevExpress.XtraVerticalGrid.VGridControl vGridControlInfo;
}
}

View File

@ -0,0 +1,408 @@
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraVerticalGrid;
using DevExpress.XtraVerticalGrid.Rows;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using SystemX.Net.Platform.Common.ExtensionMethods;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.ALIS.UI.Subs;
using SystemX.Product.TRA.DataManager;
using static SystemX.Product.CP.TRA.Commons;
using static SystemX.Product.TRA.DataManager.DMTestHistory;
using static SystemX.Product.TRA.DataManager.DMTestSummary;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRASummaryTestResult : UcTRABaseView
{
public enum eColDataTable
{
StepNo,
Variant,
Gate,
MO,
Function,
Min,
Average,
Max,
Dimension,
Total,
OK,
NG, //NOK,
Duration
}
DMTestSummary DataManager { get; set; }
SelectedDataCollection SelectedData { get; set; }
DataTable DTLastestTestlistSrc { get; set; } = null;
DataTable DTTestLogList { get; set; } = null;
DataTable DTTestSummary { get; set; } = null;
WaitProgressForm SplashFormWaiting = null;
string TextShowTL { get; } = "Display the Testlist";
string TextShowLOG { get; } = "Display the Test Result";
delegate void evtDBQueryFinished();
event evtDBQueryFinished evtDBFin;
public delegate void evtStepTrendViewHandler(TestTrendDataCollection data);
public event evtStepTrendViewHandler OnStepSelect;
private string GridViewGetActiveFilterText;
bool bOptionNewStepVersionBase { get; set; }
IDataBaseController DBController;
eSelectDataView CurrentSelectView;
public UcTRASummaryTestResult()
{
ContentsType = eContents.TestSummary;
InitializeComponent();
}
public void SetSQLConnection(eSelectDataView SelectView, IDataBaseController getDBController, DateTime dtStart)
{
CurrentSelectView = SelectView;
DBController = getDBController;
DataManager = new DMTestSummary(SelectView, DBController, dtStart);
}
public void ViewData(SelectedDataCollection data, DataTable DataList)
{
if (data == null)
return;
//TODO : TL Version Find
bOptionNewStepVersionBase = false;
SplashFormWaiting = new WaitProgressForm();
SplashFormWaiting.Parent = this.Parent.Parent;
SplashFormWaiting.ShowOnTopMode = DevExpress.XtraWaitForm.ShowFormOnTopMode.AboveParent;
SplashFormWaiting.TopLevel = true;
SplashFormWaiting.setDescription("Querying ...");
SplashFormWaiting.Location = new Point(this.Width / 2, this.Height / 2);
SplashFormWaiting.Show();
SplashFormWaiting.BringToFront();
evtDBFin += CloseWaitingForm;
Thread.Sleep(100);
try
{
ShowProperties(data);
SelectedData = data;
DTTestLogList = DataList;
int nGetStepVersion = int.MinValue;
//Check Step Version
foreach (DataRow dr in DataList.Rows)
{
string strGetStepVersion = dr[eColList.StepVersion.ToString()].ToString();
int nCurStepVersion = int.MinValue;
if (int.TryParse(strGetStepVersion, out nCurStepVersion) == false)
{
bOptionNewStepVersionBase = true;
nGetStepVersion = int.MinValue;
break;
}
else
{
if (nGetStepVersion == int.MinValue)
nGetStepVersion = nCurStepVersion;
else if (nGetStepVersion != nCurStepVersion)
{
bOptionNewStepVersionBase = true;
nGetStepVersion = int.MinValue;
break;
}
}
}
DTLastestTestlistSrc = DataManager.SearchTestlist(data, nGetStepVersion, bOptionNewStepVersionBase);
DTTestSummary = GetSummaryData(data, DataList);
ShowDetailData();
}
catch (Exception ex)
{
MessageBox.Show($"Searching Failure - {ex.Message}", "Test Trend - Error");
}
}
void CloseWaitingForm()
{
this.Do(() => SplashFormWaiting.Close());
}
DataTable GetSummaryData(SelectedDataCollection data, DataTable DataList)
{
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();
dtSummary = DataManager.SearchTestSummary(data.TestRequestID, vnpHistSummaryNo);
evtDBFin();
return dtSummary;
}
DataTable CombineLogForm()
{
//if (DTTestLogSrc == null || DTTestlistSrc == null)
// return null;
DataTable dtFinal = new DataTable();
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()
|| strCol == eColDataTable.Total.ToString()
|| strCol == eColDataTable.OK.ToString()
|| strCol == eColDataTable.NG.ToString())
typCol = typeof(int);
dtFinal.Columns.Add(strCol, typCol);
}
DataRow drTL = null;
List<DataRow> vdrTL = null;
Stopwatch stChkTime = new Stopwatch();
stChkTime.Start();
foreach (DataRow drLog in DTTestSummary.AsEnumerable())
{
//if (drLog[eColTestLog.StepID.ToString()].ToString() == "54860")
//{
// ;
//}
//PK 기준 검색
if (bOptionNewStepVersionBase)
{
drTL = DTLastestTestlistSrc.Rows.Find(drLog[eColTestLog.StepID.ToString()]);
if (drTL == null)
continue;
}
else
{
/*
int nAccessPos = int.MaxValue;
for (int i = 0; i <= DataManager.nCurrentTLMaxStepVersion; i++)
{
string strChkResult = drLog["SV" + i.ToString()].ToString();
if (strChkResult.CompareTo("O") == 0)
{
nAccessPos = i;
break;
}
}
if (nAccessPos == int.MaxValue)
continue;
*/
//drTL = DataManager[nAccessPos].Rows.Find(drLog[eColTestLog.StepID.ToString()]);
/*
try
{
drTL = DataManager.dtHistVersionTL.Rows.Find(drLog[eColTestLog.StepID.ToString()]);
}
catch
{
drTL = null;
}
*/
drTL = DataManager.dtHistVersionTL.Rows.Find(drLog[eColTestLog.StepID.ToString()]);
if (drTL == null)
continue;
/*vdrTL = DTLastestTestlistSrc.AsEnumerable().Where(x => Convert.ToInt32(x[eColTestlist.StepID.ToString()]) == Convert.ToInt32(drLog[eColTestSummary.StepID.ToString()])).ToList();
if (vdrTL.IsNullOrEmpty())
continue;
drTL = GetProperTestStepVersion(vdrTL, drLog);*/
}
DataRow drDisp = dtFinal.NewRow();
drDisp[eColDataTable.StepNo.ToString()] = Convert.ToInt32(Convert.ToInt32(drLog[eColTestSummary.StepID.ToString()]));
if (drTL != null)
{
drDisp[eColDataTable.Variant.ToString()] = drTL[eColTestlist.Variant.ToString()].ToString();
drDisp[eColDataTable.Gate.ToString()] = drTL[eColTestlist.Gate.ToString()].ToString();
drDisp[eColDataTable.MO.ToString()] = drTL[eColTestlist.StepDesc.ToString()].ToString();
drDisp[eColDataTable.Function.ToString()] = drTL[eColTestlist.UseFunction.ToString()].ToString();
bool bIsGlobal = (Convert.ToInt32(drTL[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false;
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()]);
drDisp[eColDataTable.Average.ToString()] = strMeasVal == null ? string.Empty : (nOK + nNOK) == 0 ? string.Empty : strMeasVal.ToString();
if (drTL != null)
{
drDisp[eColDataTable.Dimension.ToString()] = drTL[eColTestlist.Dim.ToString()].ToString();
}
/*
else
{
drDisp[eColDataTable.Dimension.ToString()] = drLog[eColTestlist.Dim.ToString()].ToString();
}
*/
drDisp[eColDataTable.Total.ToString()] = Convert.ToInt32(drLog[eColTestSummary.Total.ToString()]);
drDisp[eColDataTable.OK.ToString()] = nOK;
drDisp[eColDataTable.NG.ToString()] = nNOK;
//drDisp[eColDataTable.Duration.ToString()] = 0; //Convert.ToInt32(Convert.ToInt32(drLog[eColTestLog.Duration.ToString()]));
dtFinal.Rows.Add(drDisp);
}
long lTime = stChkTime.ElapsedMilliseconds;
return dtFinal;
}
DataRow GetProperTestStepVersion(List<DataRow> vTestStepDef, DataRow drLog)
{
return vTestStepDef.FirstOrDefault();
}
void ShowDetailData()
{
DataTable dtResult = CombineLogForm();
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.BeginInit();
gridControlMain.DataSource = dtResult;
gridControlMain.Update();
gridControlMain.RefreshDataSource();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
gridControlMain.EndInit();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
void ShowProperties(SelectedDataCollection data)
{
vGridControlInfo.Rows.Clear();
foreach (PropertyInfo propInf in data.GetType().GetProperties())
{
EditorRow dtRow = new EditorRow();
dtRow.Properties.Caption = propInf.Name;
if (propInf.Name == "TestRequestID")
dtRow.Properties.Value = ((string[])propInf.GetValue(data, null))[0];
else
dtRow.Properties.Value = propInf.GetValue(data, null)?.ToString();
vGridControlInfo.Rows.Add(dtRow);
}
OnSizeChanged(vGridControlInfo);
}
void OnSizeChanged(VGridControl grid)
{
int width = grid.ClientSize.Width / (grid.RecordCount + 1);
grid.RecordWidth = width;
grid.RowHeaderWidth = width;
}
private void UcTRADetailTestResult_Load(object sender, System.EventArgs e)
{
}
private void gridViewMain_DoubleClick(object sender, EventArgs e)
{
DXMouseEventArgs ea = e as DXMouseEventArgs;
GridView view = sender as GridView;
GridHitInfo info = view.CalcHitInfo(ea.Location);
if (info.InRow || info.InRowCell)
{
int nRow = int.MinValue;
nRow = info.RowHandle;
if (nRow < 0)
return;
var dvRow = view.GetRow(nRow);
DataRow dtRow = (dvRow as DataRowView).Row;
TestTrendDataCollection dataSend = new TestTrendDataCollection();
dataSend.DTTestlistSrc = DTLastestTestlistSrc;
dataSend.DTTestLogList = DTTestLogList;
dataSend.SelectedData = SelectedData;
dataSend.StepNo = dtRow[eColDataTable.StepNo.ToString()].ToString();
dataSend.Variant = dtRow[eColDataTable.Variant.ToString()].ToString();
dataSend.Gate = dtRow[eColDataTable.Gate.ToString()].ToString();
dataSend.MO = dtRow[eColDataTable.MO.ToString()].ToString();
dataSend.Function = dtRow[eColDataTable.Function.ToString()].ToString();
dataSend.Total = dtRow[eColDataTable.Total.ToString()].ToString();
dataSend.OK = dtRow[eColDataTable.OK.ToString()].ToString();
dataSend.NG = dtRow[eColDataTable.NG.ToString()].ToString();
OnStepSelect(dataSend);
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,238 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRATestHistHost
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
this.labelControlTestTime = new DevExpress.XtraEditors.LabelControl();
this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
this.labelControlTestResult = new DevExpress.XtraEditors.LabelControl();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit();
this.groupControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
this.SuspendLayout();
//
// gridControlMain
//
this.gridControlMain.Location = new System.Drawing.Point(2, 59);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(916, 521);
this.gridControlMain.TabIndex = 0;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.FocusedRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.FocusedRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.FocusedRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.FocusedRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gridViewMain.Appearance.FocusedRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.FocusedRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.FocusedRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseFont = true;
this.gridViewMain.Appearance.FocusedRow.Options.UseForeColor = true;
this.gridViewMain.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.HideSelectionRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.HideSelectionRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gridViewMain.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.HideSelectionRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseFont = true;
this.gridViewMain.Appearance.HideSelectionRow.Options.UseForeColor = true;
this.gridViewMain.Appearance.Row.BackColor = System.Drawing.Color.Transparent;
this.gridViewMain.Appearance.Row.Options.UseBackColor = true;
this.gridViewMain.Appearance.SelectedRow.BackColor = System.Drawing.Color.Snow;
this.gridViewMain.Appearance.SelectedRow.BackColor2 = System.Drawing.Color.WhiteSmoke;
this.gridViewMain.Appearance.SelectedRow.BorderColor = System.Drawing.Color.Red;
this.gridViewMain.Appearance.SelectedRow.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gridViewMain.Appearance.SelectedRow.ForeColor = System.Drawing.Color.Black;
this.gridViewMain.Appearance.SelectedRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
this.gridViewMain.Appearance.SelectedRow.Options.UseBackColor = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseBorderColor = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseFont = true;
this.gridViewMain.Appearance.SelectedRow.Options.UseForeColor = true;
this.gridViewMain.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsBehavior.ReadOnly = true;
this.gridViewMain.OptionsScrollAnnotations.ShowSelectedRows = DevExpress.Utils.DefaultBoolean.True;
this.gridViewMain.OptionsView.HeaderFilterButtonShowMode = DevExpress.XtraEditors.Controls.FilterButtonShowMode.SmartTag;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.ShowAlways;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
this.gridViewMain.CellMerge += new DevExpress.XtraGrid.Views.Grid.CellMergeEventHandler(this.gridViewMain_CellMerge);
this.gridViewMain.RowStyle += new DevExpress.XtraGrid.Views.Grid.RowStyleEventHandler(this.gridViewMain_RowStyle);
this.gridViewMain.DoubleClick += new System.EventHandler(this.gridViewMain_DoubleClick);
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.groupControl1);
this.layoutControl1.Controls.Add(this.gridControlMain);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(920, 582);
this.layoutControl1.TabIndex = 1;
this.layoutControl1.Text = "layoutControl1";
//
// groupControl1
//
this.groupControl1.Controls.Add(this.labelControlTestTime);
this.groupControl1.Controls.Add(this.labelControl3);
this.groupControl1.Controls.Add(this.labelControlTestResult);
this.groupControl1.Controls.Add(this.labelControl1);
this.groupControl1.Location = new System.Drawing.Point(4, 4);
this.groupControl1.Name = "groupControl1";
this.groupControl1.Size = new System.Drawing.Size(912, 53);
this.groupControl1.TabIndex = 5;
this.groupControl1.Text = "Summary";
//
// labelControlTestTime
//
this.labelControlTestTime.Location = new System.Drawing.Point(453, 29);
this.labelControlTestTime.Name = "labelControlTestTime";
this.labelControlTestTime.Size = new System.Drawing.Size(4, 14);
this.labelControlTestTime.TabIndex = 3;
this.labelControlTestTime.Text = "-";
//
// labelControl3
//
this.labelControl3.Location = new System.Drawing.Point(379, 29);
this.labelControl3.Name = "labelControl3";
this.labelControl3.Size = new System.Drawing.Size(68, 14);
this.labelControl3.TabIndex = 2;
this.labelControl3.Text = "Test Time : ";
//
// labelControlTestResult
//
this.labelControlTestResult.Location = new System.Drawing.Point(94, 29);
this.labelControlTestResult.Name = "labelControlTestResult";
this.labelControlTestResult.Size = new System.Drawing.Size(4, 14);
this.labelControlTestResult.TabIndex = 1;
this.labelControlTestResult.Text = "-";
//
// labelControl1
//
this.labelControl1.Location = new System.Drawing.Point(14, 29);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(74, 14);
this.labelControl1.TabIndex = 0;
this.labelControl1.Text = "Test Result : ";
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem1,
this.layoutControlItem3});
this.Root.Name = "Root";
this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
this.Root.Size = new System.Drawing.Size(920, 582);
this.Root.Spacing = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
this.Root.TextVisible = false;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.gridControlMain;
this.layoutControlItem1.Location = new System.Drawing.Point(0, 57);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
this.layoutControlItem1.Size = new System.Drawing.Size(916, 521);
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem1.TextVisible = false;
//
// layoutControlItem3
//
this.layoutControlItem3.Control = this.groupControl1;
this.layoutControlItem3.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem3.MaxSize = new System.Drawing.Size(0, 57);
this.layoutControlItem3.MinSize = new System.Drawing.Size(5, 57);
this.layoutControlItem3.Name = "layoutControlItem3";
this.layoutControlItem3.Size = new System.Drawing.Size(916, 57);
this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem3.TextVisible = false;
//
// UcTRATestHistHost
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layoutControl1);
this.Name = "UcTRATestHistHost";
this.Size = new System.Drawing.Size(920, 582);
this.Load += new System.EventHandler(this.UcTRATestHistHost_Load);
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit();
this.groupControl1.ResumeLayout(false);
this.groupControl1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraGrid.GridControl gridControlMain;
private DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
private DevExpress.XtraEditors.GroupControl groupControl1;
private DevExpress.XtraEditors.LabelControl labelControlTestResult;
private DevExpress.XtraEditors.LabelControl labelControl1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
private DevExpress.XtraEditors.LabelControl labelControl3;
private DevExpress.XtraEditors.LabelControl labelControlTestTime;
}
}

View File

@ -0,0 +1,380 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using SystemX.Product.TRA.DataManager;
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraPrinting;
using SystemX.Product.ALIS.Interface;
using static SystemX.Product.CP.TRA.MainForm;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRATestHistHost : UcTRABaseView
{
public enum eColHide
{
TestListFileNo,
TestListVariantNo,
TestListFileName
}
DMTestHistory DataManager { get; set; }
TestHistorySearchOption Option { get; set; }
SelectedDataCollection SelectedData { get; set; }
private bool bSelectedTime_DaySearched = false;
public DataTable DataResult { get; private set; }
public delegate void evtDataDetailViewHandler(DetailTestDataCollection data);
public event evtDataDetailViewHandler OnDetailSelect;
private IChildController refChildInterface;
int nCurrentRowSelected = int.MaxValue;
private bool bSearchVisibleOption = false;
private string GridViewGetActiveFilterText;
public UcTRATestHistHost(IChildController getChildControl, bool bSearchOptionVisible = false, bool bSelectTime_Day = false)
{
ContentsType = eContents.TestHistory;
refChildInterface = getChildControl;
this.ContextMenuStrip = base.contextMenuStripTest;
this.ContextMenuStrip.ItemClicked += contextMenuStrip_ItemClicked;
SetMenuEnabled(ContentsType);
bSelectedTime_DaySearched = bSelectTime_Day;
InitializeComponent();
gridViewMain.RowClick += gridViewMain_Click;
bSearchVisibleOption = bSearchOptionVisible;
}
~UcTRATestHistHost()
{
this.ContextMenuStrip.ItemClicked -= contextMenuStrip_ItemClicked;
}
private void contextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
ToolStripItem tsp = e.ClickedItem;
int nTag = Convert.ToInt32(tsp.Tag);
switch (nTag)
{
case 0:
refChildInterface.SetOverview();
break;
case 1:
break;
case 2:
refChildInterface.SetSummaryView();
break;
case 3:
SetDetailDataView();
break;
case 4:
break;
case 8:
refChildInterface.SetDetailOverview();
break;
}
}
public void SetSQLConnection(eSelectDataView SelectView, IDataBaseController getDBController)
{
DataManager = new DMTestHistory(SelectView, getDBController);
}
public void ViewData(eSelectDataView SelectView, SelectedDataCollection data)
{
if (data == null)
return;
SelectedData = data;
DataTable dtResult = null;
DataTable dtMergeResult = new DataTable();
if (SelectedData.GetCountRequestID() > 1)
{
int nCnt = SelectedData.GetCountRequestID();
for (int i = 0; i < nCnt; i++)
{
dtResult = DataManager.SearchTestHistory(SelectView, data, Option, i);
dtMergeResult.Merge(dtResult);
}
}
else
{
dtResult = DataManager.SearchTestHistory(SelectView, data, Option);
dtMergeResult.Merge(dtResult);
}
DataColumn dcVal = dtMergeResult.Columns.Add("No.", typeof(int));
DisplayResultTable(dtMergeResult);
DisplayResultSummary(dtMergeResult);
}
void DisplayResultSummary(DataTable dtResult)
{
int nOKTestCount = (from drData in dtResult.AsEnumerable()
where drData[DMTestHistory.eColList.TestResult.ToString()].ToString() == "OK"
select drData).Count();
int nNGTestCount = (from drData in dtResult.AsEnumerable()
where drData[DMTestHistory.eColList.TestResult.ToString()].ToString() == "NG"
select drData).Count();
List<int> vnTestTime = (from drData in dtResult.AsEnumerable()
where drData[DMTestHistory.eColList.TestResult.ToString()].ToString() == "OK"
|| drData[DMTestHistory.eColList.TestResult.ToString()].ToString() == "NG"
let nTime = Convert.ToInt32(drData[DMTestHistory.eColList.Duration.ToString()].ToString())
select nTime).ToList();
double dRatio = (((double)(nOKTestCount * 100)) / (nOKTestCount + nNGTestCount));
labelControlTestResult.Text = $"{nOKTestCount + nNGTestCount} (OK: {nOKTestCount}/NG: {nNGTestCount}) - Ratio: {dRatio.ToString(".##")}%";
labelControlTestTime.Text = vnTestTime.Count > 0 ?
$"Average = {(vnTestTime.Average()/1000).ToString(".##")}s, Min = {(((double)vnTestTime.Min()) / 1000).ToString(".##")}s, Max = {(((double)vnTestTime.Max()) / 1000).ToString(".##")}s" :
$"Average = -, Min = -, Max = -";
}
void DisplayResultTable(DataTable dtResult)
{
DataResult = dtResult;
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.BeginInit();
gridControlMain.DataSource = dtResult;
gridControlMain.Update();
gridControlMain.RefreshDataSource();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtResult);
foreach (string strColName in Enum.GetNames(typeof(eColHide)))
gridViewMain.Columns[strColName].Visible = false;
gridControlMain.EndInit();
gridViewMain.BeginUpdate();
int nRowNoIdx = 0;
for (int i = 0; i < gridViewMain.RowCount; i++)
{
DataRowView drvRow = gridViewMain.GetRow(i) as DataRowView;
string strResult = drvRow[DMTestHistory.eColList.TestResult.ToString()].ToString();
if (strResult == "NG" || strResult == "OK" || strResult == "STOP")
{
nRowNoIdx++;
drvRow["No."] = nRowNoIdx;
}
else
drvRow["No."] = -1;
}
gridViewMain.Columns["No."].VisibleIndex = 0;
gridViewMain.OptionsView.AllowCellMerge = true;
gridViewMain.Columns[DMTestHistory.eColList.TestlistReqID.ToString()].OptionsColumn.AllowMerge = DefaultBoolean.True;
gridViewMain.BestFitColumns();
gridViewMain.EndUpdate();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
public DetailTestDataCollection GetSearchInfo(DataRow dtRow)
{
DetailTestDataCollection drDetail = new DetailTestDataCollection();
//drDetail.TestID = dtRow[DMTestHistory.eColList.TestID.ToString()].ToString();
drDetail.No = Convert.ToInt64(dtRow[DMTestHistory.eColList.No.ToString()]);
drDetail.StartTime = DateTime.Parse(dtRow[DMTestHistory.eColList.TestDateTime.ToString()].ToString());
drDetail.Duration = Convert.ToInt64(dtRow[DMTestHistory.eColList.Duration.ToString()]);
drDetail.StationName = dtRow[DMTestHistory.eColList.StationName.ToString()].ToString();
drDetail.HostID = dtRow[DMTestHistory.eColList.Host.ToString()].ToString();
drDetail.SectionID = dtRow[DMTestHistory.eColList.Section.ToString()].ToString();
drDetail.TestType = dtRow[DMTestHistory.eColList.TestType.ToString()].ToString();
drDetail.ProductID = dtRow[DMTestHistory.eColList.ProductID.ToString()].ToString();
drDetail.ProductNo = dtRow[DMTestHistory.eColList.ProductNo.ToString()].ToString();
drDetail.TestCode = dtRow[DMTestHistory.eColList.TestCode.ToString()].ToString();
drDetail.ParentNo = dtRow[DMTestHistory.eColList.ParentNo.ToString()].ToString();
drDetail.FileCode = dtRow[DMTestHistory.eColList.FileCode.ToString()].ToString();
drDetail.FileVersion = dtRow[DMTestHistory.eColList.FileVersion.ToString()].ToString();
drDetail.TestlistFileName = dtRow[DMTestHistory.eColList.TestlistFileName.ToString()].ToString();
drDetail.TestListFileNo = dtRow[DMTestHistory.eColList.TestListFileNo.ToString()].ToString();
drDetail.TestListVariantNo = dtRow[DMTestHistory.eColList.TestListVariantNo.ToString()].ToString();
drDetail.StepVersion = dtRow[DMTestHistory.eColList.StepVersion.ToString()].ToString();
drDetail.TestRequestID = dtRow[DMTestHistory.eColList.TestlistReqID.ToString()].ToString();
drDetail.TestResult = dtRow[DMTestHistory.eColList.TestResult.ToString()].ToString();
return drDetail;
}
private void UcTRATestHistHost_Load(object sender, EventArgs e)
{
Option = new TestHistorySearchOption();
FrmOptionStationSearch dlgSearch = new FrmOptionStationSearch(bSearchVisibleOption, bSelectedTime_DaySearched);
if (bSearchVisibleOption)
{
dlgSearch.ShowDialog();
if (dlgSearch.DialogResult == DialogResult.OK)
Option = dlgSearch.GetSelectedResult();
}
else
Option = dlgSearch.GetSelectedResult();
}
private void SetDetailDataView()
{
if(nCurrentRowSelected != int.MaxValue)
{
var dvRow = gridViewMain.GetRow(nCurrentRowSelected);
DataRow dtRow = (dvRow as DataRowView).Row;
DetailTestDataCollection drDetail = GetSearchInfo(dtRow);
OnDetailSelect(drDetail);
}
}
private void gridViewMain_Click(object sender, EventArgs e)
{
DXMouseEventArgs ea = e as DXMouseEventArgs;
GridView view = sender as GridView;
GridHitInfo info = view.CalcHitInfo(ea.Location);
if (info.InRow || info.InRowCell)
nCurrentRowSelected = info.RowHandle;
else
nCurrentRowSelected = int.MaxValue;
}
private void gridViewMain_DoubleClick(object sender, EventArgs e)
{
DXMouseEventArgs ea = e as DXMouseEventArgs;
GridView view = sender as GridView;
GridHitInfo info = view.CalcHitInfo(ea.Location);
if (info.InRow || info.InRowCell)
{
int nRow = int.MinValue;
nRow = info.RowHandle;
if (nRow < 0)
return;
var dvRow = view.GetRow(nRow);
DataRow dtRow = (dvRow as DataRowView).Row;
DetailTestDataCollection drDetail = GetSearchInfo(dtRow);
OnDetailSelect(drDetail);
}
}
public List<DetailTestDataCollection> GetResultContents()
{
List<DetailTestDataCollection> vDetailData = new List<DetailTestDataCollection>();
GridView view = gridViewMain as GridView;
for(int i=0; i<view.RowCount; i++)
{
DataRow dtRow = (view.GetRow(i) as DataRowView).Row;
DetailTestDataCollection dtContent = GetSearchInfo(dtRow);
vDetailData.Add(dtContent);
}
return vDetailData;
}
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;
}
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 History";
gridControlMain.ExportToXlsx(strFile, option);
}
}
private void gridViewMain_CellMerge(object sender, CellMergeEventArgs e)
{
if (e.Column.FieldName == DMTestHistory.eColList.TestlistReqID.ToString())
{
GridView view = sender as GridView;
string val1 = view.GetRowCellValue(e.RowHandle1, e.Column).ToString();
string val2 = view.GetRowCellValue(e.RowHandle2, e.Column).ToString();
e.Merge = val1 == val2;
e.Handled = true;
}
else
{
e.Merge = false;
e.Handled = true;
}
}
private void gridViewMain_RowStyle(object sender, RowStyleEventArgs e)
{
GridView view = sender as GridView;
if (view.FocusedRowHandle == e.RowHandle)
{
GridViewInfo viewInfo = gridViewMain.GetViewInfo() as GridViewInfo;
e.Appearance.Assign(viewInfo.PaintAppearance.FocusedRow);
e.HighPriority = true;
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,206 @@
namespace SystemX.Product.TRA.UIControl
{
partial class UcTRATestNgHist
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.gridControlMain = new DevExpress.XtraGrid.GridControl();
this.gridViewMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.groupControlSummary = new DevExpress.XtraEditors.GroupControl();
this.labelControlTestTime = new DevExpress.XtraEditors.LabelControl();
this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
this.labelControlTestResult = new DevExpress.XtraEditors.LabelControl();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItemSummary = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.groupControlSummary)).BeginInit();
this.groupControlSummary.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItemSummary)).BeginInit();
this.SuspendLayout();
//
// gridControlMain
//
this.gridControlMain.Location = new System.Drawing.Point(2, 59);
this.gridControlMain.MainView = this.gridViewMain;
this.gridControlMain.Name = "gridControlMain";
this.gridControlMain.Size = new System.Drawing.Size(916, 521);
this.gridControlMain.TabIndex = 0;
this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridViewMain});
//
// gridViewMain
//
this.gridViewMain.Appearance.Row.BackColor = System.Drawing.Color.Transparent;
this.gridViewMain.Appearance.Row.Options.UseBackColor = true;
this.gridViewMain.GridControl = this.gridControlMain;
this.gridViewMain.Name = "gridViewMain";
this.gridViewMain.OptionsBehavior.Editable = false;
this.gridViewMain.OptionsBehavior.ReadOnly = true;
this.gridViewMain.OptionsView.HeaderFilterButtonShowMode = DevExpress.XtraEditors.Controls.FilterButtonShowMode.SmartTag;
this.gridViewMain.OptionsView.ShowAutoFilterRow = true;
this.gridViewMain.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.ShowAlways;
this.gridViewMain.OptionsView.ShowGroupPanel = false;
this.gridViewMain.CellMerge += new DevExpress.XtraGrid.Views.Grid.CellMergeEventHandler(this.gridViewMain_CellMerge);
this.gridViewMain.DoubleClick += new System.EventHandler(this.gridViewMain_DoubleClick);
//
// layoutControl1
//
this.layoutControl1.Controls.Add(this.groupControlSummary);
this.layoutControl1.Controls.Add(this.gridControlMain);
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.Root;
this.layoutControl1.Size = new System.Drawing.Size(920, 582);
this.layoutControl1.TabIndex = 1;
this.layoutControl1.Text = "layoutControl1";
//
// groupControlSummary
//
this.groupControlSummary.Controls.Add(this.labelControlTestTime);
this.groupControlSummary.Controls.Add(this.labelControl3);
this.groupControlSummary.Controls.Add(this.labelControlTestResult);
this.groupControlSummary.Controls.Add(this.labelControl1);
this.groupControlSummary.Location = new System.Drawing.Point(4, 4);
this.groupControlSummary.Name = "groupControlSummary";
this.groupControlSummary.Size = new System.Drawing.Size(912, 53);
this.groupControlSummary.TabIndex = 5;
this.groupControlSummary.Text = "Summary";
//
// labelControlTestTime
//
this.labelControlTestTime.Location = new System.Drawing.Point(453, 29);
this.labelControlTestTime.Name = "labelControlTestTime";
this.labelControlTestTime.Size = new System.Drawing.Size(4, 14);
this.labelControlTestTime.TabIndex = 3;
this.labelControlTestTime.Text = "-";
//
// labelControl3
//
this.labelControl3.Location = new System.Drawing.Point(379, 29);
this.labelControl3.Name = "labelControl3";
this.labelControl3.Size = new System.Drawing.Size(68, 14);
this.labelControl3.TabIndex = 2;
this.labelControl3.Text = "Test Time : ";
//
// labelControlTestResult
//
this.labelControlTestResult.Location = new System.Drawing.Point(94, 29);
this.labelControlTestResult.Name = "labelControlTestResult";
this.labelControlTestResult.Size = new System.Drawing.Size(4, 14);
this.labelControlTestResult.TabIndex = 1;
this.labelControlTestResult.Text = "-";
//
// labelControl1
//
this.labelControl1.Location = new System.Drawing.Point(14, 29);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(74, 14);
this.labelControl1.TabIndex = 0;
this.labelControl1.Text = "Test Result : ";
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem1,
this.layoutControlItemSummary});
this.Root.Name = "Root";
this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
this.Root.Size = new System.Drawing.Size(920, 582);
this.Root.Spacing = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
this.Root.TextVisible = false;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.gridControlMain;
this.layoutControlItem1.Location = new System.Drawing.Point(0, 57);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
this.layoutControlItem1.Size = new System.Drawing.Size(916, 521);
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem1.TextVisible = false;
//
// layoutControlItemSummary
//
this.layoutControlItemSummary.Control = this.groupControlSummary;
this.layoutControlItemSummary.Location = new System.Drawing.Point(0, 0);
this.layoutControlItemSummary.MaxSize = new System.Drawing.Size(0, 57);
this.layoutControlItemSummary.MinSize = new System.Drawing.Size(5, 57);
this.layoutControlItemSummary.Name = "layoutControlItemSummary";
this.layoutControlItemSummary.Size = new System.Drawing.Size(916, 57);
this.layoutControlItemSummary.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
this.layoutControlItemSummary.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItemSummary.TextVisible = false;
this.layoutControlItemSummary.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
//
// UcTRATestNgHist
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layoutControl1);
this.Name = "UcTRATestNgHist";
this.Size = new System.Drawing.Size(920, 582);
this.Load += new System.EventHandler(this.UcTRATestHistHost_Load);
((System.ComponentModel.ISupportInitialize)(this.gridControlMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.groupControlSummary)).EndInit();
this.groupControlSummary.ResumeLayout(false);
this.groupControlSummary.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItemSummary)).EndInit();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraGrid.GridControl gridControlMain;
private DevExpress.XtraGrid.Views.Grid.GridView gridViewMain;
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraLayout.LayoutControlGroup Root;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
private DevExpress.XtraEditors.GroupControl groupControlSummary;
private DevExpress.XtraEditors.LabelControl labelControlTestResult;
private DevExpress.XtraEditors.LabelControl labelControl1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItemSummary;
private DevExpress.XtraEditors.LabelControl labelControl3;
private DevExpress.XtraEditors.LabelControl labelControlTestTime;
}
}

View File

@ -0,0 +1,807 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using SystemX.Product.TRA.DataManager;
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraPrinting;
using SystemX.Product.ALIS.Interface;
using DevExpress.XtraGrid.Columns;
using SystemX.Product.CP.TRA;
using System.Diagnostics;
using static SystemX.Product.CP.TRA.MainForm;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.TRA.UIControl
{
public partial class UcTRATestNgHist : UcTRABaseView
{
public enum eColHide
{
No,
AccessKey
}
DMTestNgHistory DataManager { get; set; }
TestHistorySearchOption Option { get; set; }
SelectedDataCollection SelectedData { get; set; }
DetailTestDataCollection[] drNgDetailInfo;
DMTestDetail DetailDataManager { get; set; }
private bool bSelectedTime_DaySearched = false;
public DataTable DataResult { get; private set; }
public delegate void evtDataDetailViewHandler(DetailTestDataCollection data);
public event evtDataDetailViewHandler OnDetailSelect;
private IChildController refChildInterface;
int nCurrentRowSelected = int.MaxValue;
private bool bSearchVisibleOption = false;
private string GridViewGetActiveFilterText;
public UcTRATestNgHist(IChildController getChildControl, bool bSearchOptionVisible = false, bool bSelectTime_Day = false)
{
ContentsType = eContents.NgHistory;
refChildInterface = getChildControl;
SetMenuEnabled(ContentsType);
bSelectedTime_DaySearched = bSelectTime_Day;
InitializeComponent();
gridViewMain.RowClick += gridViewMain_Click;
bSearchVisibleOption = bSearchOptionVisible;
drNgDetailInfo = null;
}
~UcTRATestNgHist()
{
}
public void SetSQLConnection(eSelectDataView SelectView, IDataBaseController getDBController, DateTime dtStart)
{
DataManager = new DMTestNgHistory(SelectView, getDBController, dtStart);
DetailDataManager = new DMTestDetail(SelectView, getDBController, dtStart);
}
public void ViewData(SelectedDataCollection data)
{
if (data == null)
return;
SelectedData = data;
/*
DataTable dtResult = DataManager.SearchTestHistory(data, Option);
DataColumn dcVal = dtResult.Columns.Add("No.", typeof(int));
DisplayResultTable(dtResult);
*/
DataTable dtResult = null;
DataTable dtMergeResult = new DataTable();
if (SelectedData.GetCountRequestID() > 1)
{
int nCnt = SelectedData.GetCountRequestID();
for (int i = 0; i < nCnt; i++)
{
dtResult = DataManager.SearchTestNgHistory(data, Option, i);
dtMergeResult.Merge(dtResult);
}
}
else
{
dtResult = DataManager.SearchTestNgHistory(data, Option);
dtMergeResult.Merge(dtResult);
}
DataColumn dcVal = dtMergeResult.Columns.Add("No.", typeof(int));
DisplayResultTable(dtMergeResult);
}
void DisplayResultSummary(DataTable dtResult)
{
int nOKTestCount = (from drData in dtResult.AsEnumerable()
where drData[DMTestHistory.eColList.TestResult.ToString()].ToString() == "OK"
select drData).Count();
int nNGTestCount = (from drData in dtResult.AsEnumerable()
where drData[DMTestHistory.eColList.TestResult.ToString()].ToString() == "NG"
select drData).Count();
List<int> vnTestTime = (from drData in dtResult.AsEnumerable()
where drData[DMTestHistory.eColList.TestResult.ToString()].ToString() == "OK"
|| drData[DMTestHistory.eColList.TestResult.ToString()].ToString() == "NG"
let nTime = Convert.ToInt32(drData[DMTestHistory.eColList.Duration.ToString()].ToString())
select nTime).ToList();
double dRatio = (((double)(nOKTestCount * 100)) / (nOKTestCount + nNGTestCount));
labelControlTestResult.Text = $"{nOKTestCount + nNGTestCount} (OK: {nOKTestCount}/NG: {nNGTestCount}) - Ratio: {dRatio.ToString(".##")}%";
labelControlTestTime.Text = vnTestTime.Count > 0 ?
$"Average = {(vnTestTime.Average()/1000).ToString(".##")}s, Min = {(((double)vnTestTime.Min()) / 1000).ToString(".##")}s, Max = {(((double)vnTestTime.Max()) / 1000).ToString(".##")}s" :
$"Average = -, Min = -, Max = -";
}
private DataTable MakeNgTable()
{
// Create a new DataTable titled 'Names.'
DataTable NgTable = new DataTable("TestResult");
/*
public ulong LogNo { get; set; }
public int LogCount { get; set; }
public ulong AccessStart { get; set; }
public ulong AccessEnd { get; set; }
public DateTime StartTime { get; set; }
public long Duration { get; set; }
public string StationName { get; set; }
public string HostID { get; set; }
public string SectionID { get; set; }
public string TestType { get; set; }
public string ProductID { get; set; }
public string ProductNo { get; set; }
public string TestCode { get; set; }
public string ParentNo { get; set; }
public string FileCode { get; set; }
public string FileVersion { get; set; }
public string TestlistFile { get; set; }
public string TestlistNo { get; set; }
public string StepVersion { get; set; }
public string TestRequestID { get; set; }
public string TestResult { get; set; }
*/
// Add three column objects to the table.
DataColumn Column1000 = new DataColumn();
Column1000.DataType = System.Type.GetType("System.Int64");
Column1000.ColumnName = "No.";
Column1000.AllowDBNull = true;
NgTable.Columns.Add(Column1000);
DataColumn Column0 = new DataColumn();
Column0.DataType = System.Type.GetType("System.DateTime");
Column0.ColumnName = "StartTime";
Column0.AllowDBNull = true;
NgTable.Columns.Add(Column0);
DataColumn Column1 = new DataColumn();
Column1.DataType = System.Type.GetType("System.Int64");
Column1.ColumnName = "Duration";
Column1.AllowDBNull = true;
NgTable.Columns.Add(Column1);
DataColumn Column2 = new DataColumn();
Column2.DataType = System.Type.GetType("System.String");
Column2.ColumnName = "StationName";
Column2.AllowDBNull = true;
NgTable.Columns.Add(Column2);
DataColumn Column3= new DataColumn();
Column3.DataType = System.Type.GetType("System.String");
Column3.ColumnName = "HostID";
Column3.AllowDBNull = true;
NgTable.Columns.Add(Column3);
DataColumn Column4= new DataColumn();
Column4.DataType = System.Type.GetType("System.String");
Column4.ColumnName = "SectionID";
Column4.AllowDBNull = true;
NgTable.Columns.Add(Column4);
DataColumn Column5 = new DataColumn();
Column5.DataType = System.Type.GetType("System.String");
Column5.ColumnName = "ProductID";
Column5.AllowDBNull = true;
NgTable.Columns.Add(Column5);
DataColumn Column6= new DataColumn();
Column6.DataType = System.Type.GetType("System.String");
Column6.ColumnName = "ProductNo";
Column6.AllowDBNull = true;
NgTable.Columns.Add(Column6);
DataColumn Column7 = new DataColumn();
Column7.DataType = System.Type.GetType("System.String");
Column7.ColumnName = "ParentNo";
Column7.AllowDBNull = true;
NgTable.Columns.Add(Column7);
DataColumn Column101 = new DataColumn();
Column101.DataType = System.Type.GetType("System.Int64");
Column101.ColumnName = "AccessKey";
Column101.AutoIncrement = false;
Column101.AllowDBNull = false;
NgTable.Columns.Add(Column101);
DataColumn Column102 = new DataColumn();
Column102.DataType = System.Type.GetType("System.Int64");
Column102.ColumnName = "Position";
Column102.AllowDBNull = true;
NgTable.Columns.Add(Column102);
DataColumn Column103 = new DataColumn();
Column103.DataType = System.Type.GetType("System.Int64");
Column103.ColumnName = "Step";
Column103.AllowDBNull = false;
NgTable.Columns.Add(Column103);
DataColumn Column104 = new DataColumn();
Column104.DataType = System.Type.GetType("System.String");
Column104.ColumnName = "ModName";
Column104.AllowDBNull = false;
NgTable.Columns.Add(Column104);
DataColumn Column105 = new DataColumn();
Column105.DataType = System.Type.GetType("System.String");
Column105.ColumnName = "Min";
Column105.AllowDBNull = true;
NgTable.Columns.Add(Column105);
DataColumn Column106 = new DataColumn();
Column106.DataType = System.Type.GetType("System.String");
Column106.ColumnName = "Value";
Column106.AllowDBNull = true;
NgTable.Columns.Add(Column106);
DataColumn Column107 = new DataColumn();
Column107.DataType = System.Type.GetType("System.String");
Column107.ColumnName = "Max";
Column107.AllowDBNull = true;
NgTable.Columns.Add(Column107);
DataColumn Column1001 = new DataColumn();
Column1001.DataType = System.Type.GetType("System.String");
Column1001.ColumnName = "Dim";
Column1001.AllowDBNull = true;
NgTable.Columns.Add(Column1001);
/*
DataColumn Column103= new DataColumn();
Column103.DataType = System.Type.GetType("System.Decimal");
Column103.ColumnName = "MeasVal";
Column103.AllowDBNull = true;
NgTable.Columns.Add(Column103);
DataColumn Column104 = new DataColumn();
Column104.DataType = System.Type.GetType("System.String");
Column104.ColumnName = "MeasValStr";
Column104.AllowDBNull = true;
NgTable.Columns.Add(Column104);
DataColumn Column105 = new DataColumn();
Column105.DataType = System.Type.GetType("System.String");
Column105.ColumnName = "Message";
Column105.AllowDBNull = true;
NgTable.Columns.Add(Column105);
DataColumn Column106 = new DataColumn();
Column106.DataType = System.Type.GetType("System.String");
Column106.ColumnName = "GlobalMin";
Column106.AllowDBNull = true;
NgTable.Columns.Add(Column106);
DataColumn Column107 = new DataColumn();
Column107.DataType = System.Type.GetType("System.String");
Column107.ColumnName = "GlobalMax";
Column107.AllowDBNull = true;
NgTable.Columns.Add(Column107);
*/
DataColumn Column108 = new DataColumn();
Column108.DataType = System.Type.GetType("System.String");
Column108.ColumnName = "Result";
Column108.AllowDBNull = false;
NgTable.Columns.Add(Column108);
DataColumn Column109 = new DataColumn();
Column109.DataType = System.Type.GetType("System.String");
Column109.ColumnName = "SpentTime";
Column109.AllowDBNull = true;
NgTable.Columns.Add(Column109);
// Create an array for DataColumn objects.
DataColumn[] keys = new DataColumn[1];
keys[0] = Column101;
NgTable.PrimaryKey = keys;
// Return the new DataTable.
return NgTable;
}
void DisplayResultTable(DataTable dtResult)
{
DataResult = dtResult;
int nLoopCnt = 0;
/* DataResult.Rows.Count;
for (int i = 0; i < nLoopCnt; i++)
{
for (int j = 0; j < DataResult.Rows.Count; j++)
{
string strResult = DataResult.Rows[j][DMTestHistory.eColList.TestResult.ToString()].ToString();
if (strResult != "NG" && strResult != "SYSTEM_ERROR" && strResult != "STOP")
{
DataResult.Rows.RemoveAt(j);
break;
}
}
}
*/
//
nLoopCnt = DataResult.Rows.Count;
DataRow[] drNgs = new DataRow[nLoopCnt];
DataTable dtNg = MakeNgTable();
drNgDetailInfo = new DetailTestDataCollection[nLoopCnt];
int[] nCheckTestListFileNo = new int[2];
nCheckTestListFileNo[0] = int.MinValue;
nCheckTestListFileNo[1] = int.MinValue;
string[] strCheckTestListFileNo = new string[2];
strCheckTestListFileNo[0] = string.Empty;
strCheckTestListFileNo[1] = string.Empty;
int nSetTestListFileNo = int.MinValue;
int nUseVersion = int.MaxValue;
DataTable dtTLInfo = null;
StringBuilder sbCheckTestListInfo = new StringBuilder();
/*
Stopwatch stTimeCheck = new Stopwatch();
stTimeCheck.Start();
*/
for (int i = 0; i < nLoopCnt; i++)
{
drNgDetailInfo[i] = new DetailTestDataCollection();
DataRow dr = DataResult.Rows[i];
drNgDetailInfo[i] = GetSearchInfo(dr);
int nSetCurTestListFileNo = int.MinValue;
int nUseTestListFileNo = int.MaxValue;
int nUseTestListVariantNo = int.MaxValue;
if (int.TryParse(drNgDetailInfo[i].TestListFileNo, out nUseTestListFileNo) == false)
continue;
if (int.TryParse(drNgDetailInfo[i].TestListVariantNo, out nUseTestListVariantNo) == false)
continue;
int nCurUseVersion = int.MaxValue;
if (int.TryParse(drNgDetailInfo[i].StepVersion, out nCurUseVersion) == false)
continue;
if (sbCheckTestListInfo.Length <= 0)
{
sbCheckTestListInfo.Append(drNgDetailInfo[i].ProductNo +
drNgDetailInfo[i].TestCode +
drNgDetailInfo[i].TestType +
drNgDetailInfo[i].FileVersion +
drNgDetailInfo[i].FileCode);
nCheckTestListFileNo = DataManager.CheckTestListFileNo(drNgDetailInfo[i].ProductNo, drNgDetailInfo[i].TestCode, drNgDetailInfo[i].TestType, drNgDetailInfo[i].FileVersion, drNgDetailInfo[i].FileCode);
}
else
{
string strSetTestListInfo = drNgDetailInfo[i].ProductNo +
drNgDetailInfo[i].TestCode +
drNgDetailInfo[i].TestType +
drNgDetailInfo[i].FileVersion +
drNgDetailInfo[i].FileCode;
if (sbCheckTestListInfo.ToString().CompareTo(strSetTestListInfo) != 0)
{
sbCheckTestListInfo.Clear();
sbCheckTestListInfo.Append(strSetTestListInfo);
nCheckTestListFileNo = DataManager.CheckTestListFileNo(drNgDetailInfo[i].ProductNo, drNgDetailInfo[i].TestCode, drNgDetailInfo[i].TestType, drNgDetailInfo[i].FileVersion, drNgDetailInfo[i].FileCode);
}
}
strCheckTestListFileNo[0] = nCheckTestListFileNo[0].ToString();
strCheckTestListFileNo[1] = nCheckTestListFileNo[1].ToString();
if (nCheckTestListFileNo[0] == int.MinValue)
nSetCurTestListFileNo = nUseTestListFileNo;
else
{
if (strCheckTestListFileNo[0].CompareTo(nUseTestListFileNo.ToString()) == 0 &&
strCheckTestListFileNo[1].CompareTo(nUseTestListVariantNo.ToString()) == 0)
nSetCurTestListFileNo = nUseTestListFileNo;
else
nSetCurTestListFileNo = nCheckTestListFileNo[0];
}
if (nSetTestListFileNo == int.MinValue || nUseVersion == int.MaxValue)
{
nSetTestListFileNo = nSetCurTestListFileNo;
nUseVersion = nCurUseVersion;
dtTLInfo = DataManager.GetUseTestListInformation(nSetTestListFileNo, nUseVersion);
}
else
{
if(nSetTestListFileNo != nSetCurTestListFileNo || nUseVersion != nCurUseVersion)
{
nSetTestListFileNo = nSetCurTestListFileNo;
nUseVersion = nCurUseVersion;
dtTLInfo = DataManager.GetUseTestListInformation(nSetTestListFileNo, nUseVersion);
}
}
if (Commons.isHasRow(dtTLInfo) == false)
continue;
DataTable dtTestLog = DetailDataManager.SearchTestHistory(drNgDetailInfo[i]);
drNgs[i] = null;
Int64 nAccessKey = Int64.MaxValue;
try
{
drNgs[i] = dtNg.NewRow();
DataRow drNgInfo = null;
//drNgInfo = dtTestLog.AsEnumerable().Where(Row => Row.Field<string>("Result") == "NG").OrderBy(Row => Row.Field<Int64>("StepID")).ElementAt(0);
//lTime[6] = stTime.ElapsedMilliseconds;
//drNgInfo = dtTestLog.AsEnumerable().First(Row => Row.Field<string>("Result") == "NG");
//lTime[7] = stTime.ElapsedMilliseconds;
drNgInfo = dtTestLog.Select("Result = 'NG'", "StepID ASC").First();
if (drNgInfo != null)
{
drNgs[i][0] = (i + 1).ToString();
drNgs[i][1] = drNgDetailInfo[i].StartTime;
drNgs[i][2] = drNgDetailInfo[i].Duration;
drNgs[i][3] = drNgDetailInfo[i].StationName;
drNgs[i][4] = drNgDetailInfo[i].HostID;
drNgs[i][5] = drNgDetailInfo[i].SectionID;
drNgs[i][6] = drNgDetailInfo[i].ProductID;
drNgs[i][7] = drNgDetailInfo[i].ProductNo;
drNgs[i][8] = drNgDetailInfo[i].ParentNo;
DataRow GetTLRow = null;
try
{
GetTLRow = dtTLInfo.Rows.Find(drNgInfo["StepID"]);
}
catch
{
GetTLRow = null;
}
/*
DataRow[] GetTLRows = null;
try
{
GetTLRows = dtTLInfo.Select($"StepID = {drNgInfo["StepID"].ToString()}", "StepVersion DESC");
}
catch
{
GetTLRows = null;
}
DataRow GetTLRow = null;
if (GetTLRows != null)
{
try
{
GetTLRow = GetTLRows.First(x => x.ItemArray[6].ToString() == nUseVersion.ToString());
}
catch
{
GetTLRow = null;
}
finally
{
if (GetTLRow == null)
GetTLRow = GetTLRows[0];
}
}
*/
bool bIsGlobal = (Convert.ToInt32(GetTLRow["IsGlobal"])) > 0 ? true : false;
//nAccessKey = Int64.Parse(drNgInfo["AccessKey"].ToString());
//drNgs[i][9] = drNgInfo["AccessKey"];
drNgs[i][9] = drNgs[i][0];
drNgs[i][10] = (GetTLRow != null) ? GetTLRow[8] : "";
drNgs[i][11] = drNgInfo["StepID"];
drNgs[i][12] = (GetTLRow != null) ? GetTLRow[9] : "";
//
drNgs[i][13] = bIsGlobal ? drNgInfo["GlobalMin"] : GetTLRow["SpecMin"];
if (GetTLRow != null)
{
if (drNgInfo["Message"].ToString().Length > 0)
drNgs[i][14] = drNgInfo["Message"];
else if (drNgInfo["MeasValStr"].ToString().Length > 0)
drNgs[i][14] = drNgInfo["MeasValStr"];
else
drNgs[i][14] = drNgInfo["MeasVal"].ToString();
}
else
drNgs[i][14] = "";
drNgs[i][15] = bIsGlobal ? drNgInfo["GlobalMax"] : GetTLRow["SpecMax"];
//
drNgs[i][16] = (GetTLRow != null) ? GetTLRow[16] : "";
drNgs[i][17] = drNgInfo["Result"];
drNgs[i][18] = drNgInfo["SpentTime"];
}
}
catch (Exception e)
{
drNgs[i] = null;
}
if (drNgs[i] != null)
{
if (dtNg.Rows.Find(nAccessKey) == null)
dtNg.Rows.Add(drNgs[i]);
else
{
;// Debug Pt
}
}
}
//long lCheckTime = stTimeCheck.ElapsedMilliseconds;
GridViewGetActiveFilterText = gridViewMain.ActiveFilterString;
gridControlMain.BeginInit();
gridControlMain.DataSource = dtNg;
gridControlMain.Update();
gridControlMain.RefreshDataSource();
gridControlMain.ForceInitialize();
gridViewMain.PopulateColumns(dtNg);
foreach (string strColName in Enum.GetNames(typeof(eColHide)))
{
if (gridViewMain.Columns.ColumnByFieldName(strColName) != null)
gridViewMain.Columns[strColName].Visible = false;
}
gridControlMain.EndInit();
gridViewMain.BeginUpdate();
foreach (GridColumn gc in gridViewMain.Columns)
{
if (gc.FieldName.CompareTo("StartTime") == 0)
{
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
gc.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
gc.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm:ss.fff";
}
else
gc.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
}
/*
int nRowNoIdx = 0;
for (int i = 0; i < gridViewMain.RowCount; i++)
{
DataRowView drvRow = gridViewMain.GetRow(i) as DataRowView;
string strResult = drvRow[DMTestHistory.eColList.TestResult.ToString()].ToString();
if (strResult == "NG" || strResult == "OK" || strResult == "STOP")
{
nRowNoIdx++;
drvRow["No."] = nRowNoIdx;
}
else
drvRow["No."] = -1;
}
gridViewMain.Columns["No."].VisibleIndex = 0;
gridViewMain.OptionsView.AllowCellMerge = true;
gridViewMain.Columns[DMTestHistory.eColList.TestlistReqID.ToString()].OptionsColumn.AllowMerge = DefaultBoolean.True;
*/
gridViewMain.BestFitColumns();
gridViewMain.EndUpdate();
gridViewMain.ActiveFilterString = GridViewGetActiveFilterText;
}
public DetailTestDataCollection GetSearchInfo(DataRow dtRow)
{
DetailTestDataCollection drDetail = new DetailTestDataCollection();
//drDetail.TestID = dtRow[DMTestHistory.eColList.TestID.ToString()].ToString();
drDetail.No = Convert.ToInt64(dtRow[DMTestHistory.eColList.No.ToString()]);
drDetail.StartTime = DateTime.Parse(dtRow[DMTestHistory.eColList.TestDateTime.ToString()].ToString());
drDetail.Duration = Convert.ToInt64(dtRow[DMTestHistory.eColList.Duration.ToString()]);
drDetail.StationName = dtRow[DMTestHistory.eColList.StationName.ToString()].ToString();
drDetail.HostID = dtRow[DMTestHistory.eColList.Host.ToString()].ToString();
drDetail.SectionID = dtRow[DMTestHistory.eColList.Section.ToString()].ToString();
drDetail.TestType = dtRow[DMTestHistory.eColList.TestType.ToString()].ToString();
drDetail.ProductID = dtRow[DMTestHistory.eColList.ProductID.ToString()].ToString();
drDetail.ProductNo = dtRow[DMTestHistory.eColList.ProductNo.ToString()].ToString();
drDetail.TestCode = dtRow[DMTestHistory.eColList.TestCode.ToString()].ToString();
drDetail.ParentNo = dtRow[DMTestHistory.eColList.ParentNo.ToString()].ToString();
drDetail.FileCode = dtRow[DMTestHistory.eColList.FileCode.ToString()].ToString();
drDetail.FileVersion = dtRow[DMTestHistory.eColList.FileVersion.ToString()].ToString();
drDetail.TestlistFileName = dtRow[DMTestHistory.eColList.TestlistFileName.ToString()].ToString();
drDetail.TestListFileNo = dtRow[DMTestHistory.eColList.TestListFileNo.ToString()].ToString();
drDetail.TestListVariantNo = dtRow[DMTestHistory.eColList.TestListVariantNo.ToString()].ToString();
drDetail.StepVersion = dtRow[DMTestHistory.eColList.StepVersion.ToString()].ToString();
drDetail.TestRequestID = dtRow[DMTestHistory.eColList.TestlistReqID.ToString()].ToString();
drDetail.TestResult = dtRow[DMTestHistory.eColList.TestResult.ToString()].ToString();
return drDetail;
}
private void UcTRATestHistHost_Load(object sender, EventArgs e)
{
Option = new TestHistorySearchOption();
FrmOptionStationSearch dlgSearch = new FrmOptionStationSearch(bSearchVisibleOption, bSelectedTime_DaySearched);
if (bSearchVisibleOption)
{
dlgSearch.ShowDialog();
if (dlgSearch.DialogResult == DialogResult.OK)
Option = dlgSearch.GetSelectedResult();
}
else
Option = dlgSearch.GetSelectedResult();
}
private void SetDetailDataView()
{
if(nCurrentRowSelected != int.MaxValue)
{
var dvRow = gridViewMain.GetRow(nCurrentRowSelected);
DataRow dtRow = (dvRow as DataRowView).Row;
DetailTestDataCollection drDetail = GetSearchInfo(dtRow);
OnDetailSelect(drDetail);
}
}
private void gridViewMain_Click(object sender, EventArgs e)
{
DXMouseEventArgs ea = e as DXMouseEventArgs;
GridView view = sender as GridView;
GridHitInfo info = view.CalcHitInfo(ea.Location);
if (info.InRow || info.InRowCell)
nCurrentRowSelected = info.RowHandle;
else
nCurrentRowSelected = int.MaxValue;
}
private void gridViewMain_DoubleClick(object sender, EventArgs e)
{
DXMouseEventArgs ea = e as DXMouseEventArgs;
GridView view = sender as GridView;
GridHitInfo info = view.CalcHitInfo(ea.Location);
if (info.InRow || info.InRowCell)
{
int nRow = int.MinValue;
nRow = info.RowHandle;
if (nRow < 0)
return;
/*
var dvRow = view.GetRow(nRow);
DataRow dtRow = (dvRow as DataRowView).Row;
DetailTestDataCollection drDetail = GetSearchInfo(dtRow);
OnDetailSelect(drDetail);
*/
if (drNgDetailInfo != null)
OnDetailSelect(drNgDetailInfo[nRow]);
}
}
public List<DetailTestDataCollection> GetResultContents()
{
List<DetailTestDataCollection> vDetailData = new List<DetailTestDataCollection>();
GridView view = gridViewMain as GridView;
for(int i=0; i<view.RowCount; i++)
{
DataRow dtRow = (view.GetRow(i) as DataRowView).Row;
DetailTestDataCollection dtContent = GetSearchInfo(dtRow);
vDetailData.Add(dtContent);
}
return vDetailData;
}
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;
}
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 History";
gridControlMain.ExportToXlsx(strFile, option);
}
}
private void gridViewMain_CellMerge(object sender, CellMergeEventArgs e)
{
if (e.Column.FieldName == DMTestHistory.eColList.TestlistReqID.ToString())
{
GridView view = sender as GridView;
string val1 = view.GetRowCellValue(e.RowHandle1, e.Column).ToString();
string val2 = view.GetRowCellValue(e.RowHandle2, e.Column).ToString();
e.Merge = val1 == val2;
e.Handled = true;
}
else
{
e.Merge = false;
e.Handled = true;
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,294 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SystemX.Product.TRA.UIControl
{
public class OverviewSearchOption
{
public bool DisplayByStation { get; set; } = true;
public bool ViewOptionPanel { get; set; } = false;
public bool FullScanData { get; set; } = false;
public string ProductID { get; set; } = string.Empty;
public OverviewSearchOption()
{
;//
}
public OverviewSearchOption(bool bViewOpPanel,
bool bFullScanOp,
string strSetProductID)
{
ViewOptionPanel = bViewOpPanel;
FullScanData = bFullScanOp;
ProductID = strSetProductID;
}
}
public class TestHistorySearchOption
{
public bool Time_SelectedTest { get; set; } = true;
public bool Time_Day { get; set; } = false;
public bool Time_WholeRange { get; set; } = false;
public bool Station { get; set; } = true;
public bool Host { get; set; } = true;
public bool Section { get; set; } = true;
public bool TestType { get; set; } = true;
public bool ProductNo { get; set; } = true;
public bool TestCode { get; set; } = false;
public bool ParentNo { get; set; } = false;
public bool ProductionCode { get; set; } = false;
public bool FileVersion { get; set; } = false;
public bool StepVersion { get; set; } = false;
}
public class SelectedDataCollection : ICloneable
{
public DateTime SearchRangeStart { get; set; }
public DateTime SearchRangeEnd { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string StationName { get; set; }
public string HostID { get; set; }
public string SectionID { get; set; }
public string TestType { get; set; }
public string ProductNo { get; set; }
public string ProductID { get; set; }
public string TestCode { get; set; }
public string ParentNo { get; set; }
public string TestListFileNo { get; set; }
public string TestListVariantNo { get; set; }
public string ProductionCode { get; set; }
public string FileVersion { get; set; }
public string StepVersion { get; set; }
public string[] TestRequestID { get; set; }
private int nUseReqCnt { get; set; }
public int GetCountRequestID()
{
return nUseReqCnt;
}
public void SetCountRequestID(int nCnt)
{
nUseReqCnt = nCnt;
TestRequestID = new string[nUseReqCnt];
}
public void CopyReqIDs(string[] strReqId)
{
Array.Copy(strReqId, 0, TestRequestID, 0, nUseReqCnt);
}
public void SetProdcutID(string strProductID)
{
ProductID = strProductID;
}
public SelectedDataCollection(DateTime dtSRStart, DateTime dtSREnd, DateTime dtStart, DateTime dtEnd, string strStnName, string strHostID, string strSectionID, string strTestType,
string strProdNo, string strTestCode, string strParentNo, string strProdCode,
string strTestListFileNo, string strTestListVariantNo, string strFileVer, string strStepVer, string strReqID)
{
nUseReqCnt = 1;
TestRequestID = new string[nUseReqCnt];
SearchRangeStart = dtSRStart;
SearchRangeEnd = dtSREnd;
StartTime = dtStart;
EndTime = dtEnd;
StationName = strStnName;
HostID = strHostID;
SectionID = strSectionID;
TestType = strTestType;
ProductNo = strProdNo;
ProductID = string.Empty;
TestCode = strTestCode;
ParentNo = strParentNo;
TestListFileNo = strTestListFileNo;
TestListVariantNo = strTestListVariantNo;
ProductionCode = strProdCode;
FileVersion = strFileVer;
StepVersion = strStepVer;
TestRequestID[0] = strReqID;
}
public SelectedDataCollection() { }
public object Clone()
{
SelectedDataCollection newSelectData = new SelectedDataCollection();
newSelectData.SearchRangeStart = this.SearchRangeStart;
newSelectData.SearchRangeEnd = this.SearchRangeEnd;
newSelectData.StartTime = this.StartTime;
newSelectData.EndTime = this.EndTime;
newSelectData.StationName = this.StationName;
newSelectData.HostID = this.HostID;
newSelectData.SectionID = this.SectionID;
newSelectData.TestType = this.TestType;
newSelectData.ProductNo = this.ProductNo;
newSelectData.ProductID = this.ProductID;
newSelectData.TestCode = this.TestCode;
newSelectData.ParentNo = this.ParentNo;
newSelectData.TestListFileNo = this.TestListFileNo;
newSelectData.TestListVariantNo = this.TestListVariantNo;
newSelectData.ProductionCode = this.ProductionCode;
newSelectData.FileVersion = this.FileVersion;
newSelectData.StepVersion = this.StepVersion;
newSelectData.TestRequestID = this.TestRequestID;
return newSelectData;
}
}
public class DetailTestDataCollection
{
public long No { get; set; }
//public string TestID { get; set; }
public DateTime StartTime { get; set; }
public long Duration { get; set; }
public string StationName { get; set; }
public string HostID { get; set; }
public string SectionID { get; set; }
public string TestType { get; set; }
public string ProductID { get; set; }
public string ProductNo { get; set; }
public string TestCode { get; set; }
public string ParentNo { get; set; }
public string FileCode { get; set; }
public string FileVersion { get; set; }
public string TestlistFileName { get; set; }
public string TestListFileNo { get; set; }
public string TestListVariantNo { get; set; }
public string StepVersion { get; set; }
public string TestRequestID { get; set; }
public string TestResult { get; set; }
}
public class TestTrendDataCollection
{
public SelectedDataCollection SelectedData { get; set; }
public DataTable DTTestLogList { get; set; }
public DataTable DTTestlistSrc { get; set; }
public string StepNo { get; set; }
public string Variant { get; set; }
public string Gate { get; set; }
public string MO { get; set; }
public string Function { get; set; }
public string Total { get; set; }
public string OK { get; set; }
public string NG { get; set; }//NOK { get; set; }
}
public class TestHistoryDataCollection
{
}
public static class MyListExtensions
{
const int CG_DEV = 6; // the number of standard deviations you wish to include(default is 6)
public static double Cg(this List<double> values, double dAllowance)
{
double dCg = (0.2 * dAllowance) / (CG_DEV * values.StandardDeviation());
return dCg;
}
const int CGK_DEV = 3; // the number of standard deviations you wish to include(default is 3)
public static double Cgk(this List<double> values, double dAllowance, double dStdVal)
{
double dCgk = ((0.1 * dAllowance) - Math.Abs(values.Mean() - dStdVal)) / (CGK_DEV * values.StandardDeviation());
return dCgk;
}
const int CP_DEV = 6; // the number of standard deviations you wish to include(default is 6)
public static double Cp(this List<double> values, double dAllowance)
{
double dCp = (dAllowance) / (CP_DEV * values.StandardDeviation());
return dCp;
}
const int CPK_DEV = 3; // the number of standard deviations you wish to include(default is 3)
public static double Cpk(this List<double> values, double dUpperLimit, double dLowerLimit)
{
double dCpkL = (Math.Abs(values.Mean() - dLowerLimit)) / (CPK_DEV * values.StandardDeviation());
double dCpkU = (Math.Abs(values.Mean() - dUpperLimit)) / (CPK_DEV * values.StandardDeviation());
return Math.Min(dCpkL, dCpkU);
}
public static double Mean(this List<double> values)
{
return values.Count == 0 ? 0 : values.Mean(0, values.Count);
}
public static double Mean(this List<double> values, int start, int end)
{
double s = 0;
for (int i = start; i < end; i++)
{
s += values[i];
}
return s / (end - start);
}
public static double Variance(this List<double> values)
{
return values.Variance(values.Mean(), 0, values.Count);
}
public static double Variance(this List<double> values, double mean)
{
return values.Variance(mean, 0, values.Count);
}
public static double Variance(this List<double> values, double mean, int start, int end)
{
double variance = 0;
for (int i = start; i < end; i++)
{
variance += Math.Pow((values[i] - mean), 2);
}
int n = end - start;
if (start > 0) n -= 1;
return variance / (n);
}
public static double StandardDeviation(this List<double> values)
{
return values.Count == 0 ? 0 : values.StandardDeviation(0, values.Count);
}
public static double StandardDeviation(this List<double> values, int start, int end)
{
double mean = values.Mean(start, end);
double variance = values.Variance(mean, start, end);
return Math.Sqrt(variance);
}
}
}