[성현모] 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,113 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System">
<section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="SystemX.Product.TRA.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<SystemX.Product.TRA.Properties.Settings>
<setting name="ApplicationThemeName" serializeAs="String">
<value>Coffee</value>
</setting>
</SystemX.Product.TRA.Properties.Settings>
</userSettings>
<applicationSettings>
<DevExpress.LookAndFeel.Design.AppSettings>
<setting name="DPIAwarenessMode" serializeAs="String">
<value>System</value>
</setting>
<setting name="RegisterBonusSkins" serializeAs="String">
<value>True</value>
</setting>
<setting name="DefaultAppSkin" serializeAs="String">
<value></value>
</setting>
<setting name="DefaultPalette" serializeAs="String">
<value>Pine Dark</value>
</setting>
<setting name="TouchUI" serializeAs="String">
<value></value>
</setting>
<setting name="CompactUI" serializeAs="String">
<value></value>
</setting>
<setting name="TouchScaleFactor" serializeAs="String">
<value></value>
</setting>
<setting name="DirectX" serializeAs="String">
<value></value>
</setting>
<setting name="RegisterUserSkins" serializeAs="String">
<value></value>
</setting>
<setting name="FontBehavior" serializeAs="String">
<value></value>
</setting>
<setting name="DefaultAppFont" serializeAs="String">
<value></value>
</setting>
<setting name="CustomPaletteCollection" serializeAs="Xml">
<value />
</setting>
</DevExpress.LookAndFeel.Design.AppSettings>
</applicationSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.32.0" newVersion="3.1.32.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.32.0" newVersion="3.1.32.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.32.0" newVersion="3.1.32.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Caching.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.32.0" newVersion="3.1.32.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.32.0" newVersion="3.1.32.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.32.0" newVersion="3.1.32.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.32.0" newVersion="3.1.32.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraBars;
using SystemX.Product.ALIS.UI.View;
using static SystemX.Product.ALIS.UI.View.ViewCfg;
using SystemX.Net.Platform.Common.Util;
using DataBaseConnection.Control;
using System.Data.SqlClient;
using SystemX.Product.ALIS.UI.Subs;
using System.Diagnostics;
using static SystemX.Net.Platform.Common.Util.LogMessage;
using SystemX.Product.ALIS.Interface;
using System.Net;
using static SystemX.Product.CP.TRA.MainForm;
using SystemX.Product.TRA.UIControl;
namespace SystemX.Product.CP.TRA
{
public partial class MainForm
{
//IChildControl
public void SetOverview()
{
SelectOverviewTab();
}
public void SetDetailOverview()
{
SelectDetailOverviewTab();
}
public void SetHistoryView()
{
SetHostHistoryView();
}
public void SetSummaryView()
{
SetHostTrendView();
}
public void CallDetailOverView()
{
SetDetailOerviewFindData(SelectedData, barToggleSwitchItemOverviewMerge.Checked);
}
public void AnnounceContentsType(eContents GetType)
{
SelectedContents = GetType;
}
public bool GetOverviewMergeState()
{
return barToggleSwitchItemOverviewMerge.Checked;
}
public SelectedDataCollection GetSelectDataOverView(int nDataValue = int.MaxValue)
{
SelectedDataCollection MakeSelectData = (SelectedDataCollection)SelectedData.Clone();
DateTime dtStart = DateTime.Parse(barEditItemDateStart.EditValue.ToString());
DateTime dtEnd = DateTime.Parse(barEditItemDateEnd.EditValue.ToString());
if (nDataValue != int.MaxValue)
dtStart = dtStart.AddDays(-nDataValue);
dtEnd = dtEnd.AddHours(23.99999);
MakeSelectData.SearchRangeStart = dtStart;
MakeSelectData.SearchRangeEnd = dtEnd;
return MakeSelectData;
}
public void SetNgHistView(eContents GetCallType)
{
SetNgHistoryView(GetCallType);
}
}
}

View File

@ -0,0 +1,406 @@
using DevExpress.CodeParser;
using DevExpress.Data.Helpers;
using DevExpress.Data.ODataLinq.Helpers;
using DevExpress.Internal.WinApi.Windows.UI.Notifications;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.Odbc;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using SystemX.Net.Platform.Common.Util;
using static SystemX.Net.Platform.Common.Util.LogMessage;
namespace DataBaseConnection.Control
{
public class DatabaseConnControl
{
/*public static string MainCatalogName = "CPX";
public static string ShortTermCatalogName = "CPX";
public static string LongTermCatalogName = "CPXLog";*/
public static string MainCatalogName = "CPXV2";
public static string ShortTermCatalogName = "";
public static List<string> LongTermCatalogName = new List<string> { "" } ;
public static string SelectLongTermCatalogNameCon1 = string.Empty;
public static string SelectLongTermCatalogNameCon2 = string.Empty;
public static bool ScanLongTermLog = false;
public const string Address = "192.168.0.43";
public const int CatalogConnPort = 1433;
public const string CatalogConnUID = "Alis";
public const string CatalogConnPW = "Kefico!@34";
private static SqlConnection connMain = null;
private static SqlConnection connShortTerm1 = null;
private static Dictionary<string, SqlConnection> connLongTerm1 = new Dictionary<string, SqlConnection>();
private static SqlConnection connShortTerm2 = null;
private static Dictionary<string, SqlConnection> connLongTerm2 = new Dictionary<string, SqlConnection>();
public static SqlConnection GetMainConn()
{
return connMain;
}
public static SqlConnection GetShortTermConn1()
{
return connShortTerm1;
}
public static Dictionary<string, SqlConnection> GetLongTermConn1()
{
return connLongTerm1;
}
public static SqlConnection GetShortTermConn2()
{
return connShortTerm2;
}
public static Dictionary<string, SqlConnection> GetLongTermConn2()
{
return connLongTerm2;
}
public DatabaseConnControl()
{
//conn = new SqlConnection($"Data Source=200.200.200.48,1433; Initial Catalog={CatalogName}; User ID=Alis; Password=kefico; MultipleActiveResultSets=True;");
//conn = new SqlConnection($"Data Source=DESKTOP-5UQ1Q22;Initial Catalog={CatalogName};Integrated Security=True;");
//conn = new SqlConnection($"Data Source = 125.130.37.164,1433; Initial Catalog = {CatalogName}; User ID = Alis; Password = kefico; MultipleActiveResultSets=True;");
//"Data Source = {IP},{Port}; Initial Catalog = {CatalogName}; User ID = Alis; Password = kefico; MultipleActiveResultSets=True;";
//"Data Source = localhost; Initial Catalog = {CatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;";
}
public static void DisconnectDB()
{
if (connMain != null)
{
if (connMain.State == System.Data.ConnectionState.Open)
connMain.Close();
}
//
if (connShortTerm1 != null)
{
if (connShortTerm1.State == System.Data.ConnectionState.Open)
connShortTerm1.Close();
}
//
if (connLongTerm1?.Count > 0)
{
foreach (var logTermConnection in connLongTerm1.Values)
{
if (logTermConnection.State == System.Data.ConnectionState.Open)
logTermConnection.Close();
}
}
//
if (connShortTerm2 != null)
{
if (connShortTerm2.State == System.Data.ConnectionState.Open)
connShortTerm2.Close();
}
//
if (connLongTerm2?.Count > 0)
{
foreach (var logTermConnection in connLongTerm2.Values)
{
if (logTermConnection.State == System.Data.ConnectionState.Open)
logTermConnection.Close();
}
}
}
public static void ConnectTestListDB()
{
try
{
connMain = new SqlConnection($"Data Source=localhost; Initial Catalog={MainCatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;");
connMain.Open();
SqlCommand SQLCmd = new SqlCommand("spGetDBList", connMain);
SQLCmd.CommandType = CommandType.StoredProcedure;
DbDataReader dtReader = SQLCmd.ExecuteReader();
DataTable dtResult = new DataTable();
dtResult.Load(dtReader);
List<string> list = dtResult?.AsEnumerable()?.Select(x=>x.ItemArray?.First()?.ToString())?.ToList();
if(list?.Count > 0)
{
//short term
var shortTermCatalogName = list.Find(x => x.ToLower().Contains("short") && x.ToLower().Contains("json"));
if(string.IsNullOrEmpty(shortTermCatalogName) ==false)
{
ShortTermCatalogName = shortTermCatalogName;
}
//long term
var longTermCatalogName = list.FindAll(x => x.ToLower().Contains("long") && x.ToLower().Contains("json"));
if(longTermCatalogName?.Count() > 0)
{
LongTermCatalogName?.Clear();
LongTermCatalogName.AddRange(longTermCatalogName);
}
}
dtReader.Close();
}
catch (SqlException sqlEx)
{
MessageOutput.ConsoleWrite($"TestList DB Connection Error: {sqlEx.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
connMain = null;
}
}
public static void ConnectDataDB1()
{
try
{
SqlConnection connecction;
connShortTerm1 = new SqlConnection($"Data Source=localhost; Initial Catalog={ShortTermCatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;"); // MultipleActiveResultSets=True;");
connShortTerm1.Open();
foreach(var catalog in LongTermCatalogName)
{
connLongTerm1.Add(catalog, new SqlConnection($"Data Source=localhost; Initial Catalog={catalog}; Integrated Security = SSPI; MultipleActiveResultSets=True;")); // MultipleActiveResultSets=True;");
if (connLongTerm1.TryGetValue(catalog, out connecction) == true)
{
connecction.Open();
}
}
}
catch (SqlException sqlEx)
{
MessageOutput.ConsoleWrite($"Data DB Connection Error: {sqlEx.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
connShortTerm1 = null;
connLongTerm1 = null;
}
}
public static void ConnectDataDB2()
{
try
{
SqlConnection connecction;
connShortTerm2 = new SqlConnection($"Data Source=localhost; Initial Catalog={ShortTermCatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;"); // MultipleActiveResultSets=True;");
connShortTerm2.Open();
foreach (var catalog in LongTermCatalogName)
{
connLongTerm2.Add(catalog, new SqlConnection($"Data Source=localhost; Initial Catalog={catalog}; Integrated Security = SSPI; MultipleActiveResultSets=True;")); // MultipleActiveResultSets=True;");
if (connLongTerm2.TryGetValue(catalog, out connecction) == true)
{
connecction.Open();
}
}
}
catch (SqlException sqlEx)
{
MessageOutput.ConsoleWrite($"Data DB Connection Error: {sqlEx.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
connShortTerm2 = null;
connLongTerm2 = null;
}
}
public static void ConnectTestListDB(string strGetConnIPAddress, int nGetConnPort = CatalogConnPort)
{
try
{
//conn = new SqlConnection("Data Source=200.200.200.48,1433; Initial Catalog=LSU_Trimming_4th_ALIS; User ID=Alis; Password=kefico; MultipleActiveResultSets=True;");
//Data Source = {IP},{Port}; Initial Catalog = {SCHEMA}; User ID = {ID}; Password = {PW}; MultipleActiveResultSets=True;
//conn = new SqlConnection("Data Source=DESKTOP-5UQ1Q22;Initial Catalog=LSU_Trimming_4th_ALIS;Integrated Security=True;");
//conn = new SqlConnection("Data Source = 125.130.37.164,1433; Initial Catalog = LSU_Trimming_4th_ALIS; User ID = Alis; Password = kefico; MultipleActiveResultSets=True;");
//conn = new SqlConnection("Data Source = 127.0.0.1; Initial Catalog = Smart_Inhibitor_1th_ALIS; User ID = Alis; Password = kefico;"); //Integrated Security = SSPI;");
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
if (strGetConnIPAddress.Split(',').Length == 2)
builder.DataSource = strGetConnIPAddress;
else
builder.DataSource = strGetConnIPAddress + "," + nGetConnPort.ToString();
builder.UserID = "Alis";
builder.Password = "Kefico!@34";
builder.InitialCatalog = MainCatalogName;
builder.MultipleActiveResultSets = true;
connMain = new SqlConnection(builder.ConnectionString);
connMain.Open();
//
if (strGetConnIPAddress.Split(',').Length == 2)
builder.DataSource = strGetConnIPAddress;
else
builder.DataSource = strGetConnIPAddress + "," + nGetConnPort.ToString();
SqlCommand SQLCmd = new SqlCommand("spGetDBList", connMain);
SQLCmd.CommandType = CommandType.StoredProcedure;
DbDataReader dtReader = SQLCmd.ExecuteReader();
DataTable dtResult = new DataTable();
dtResult.Load(dtReader);
List<string> list = dtResult?.AsEnumerable()?.Select(x => x.ItemArray?.First()?.ToString())?.ToList();
if (list?.Count > 0)
{
//short term
var shortTermCatalogName = list.Find(x => x.ToLower().Contains("short") && x.ToLower().Contains("json"));
if (string.IsNullOrEmpty(shortTermCatalogName) == false)
{
ShortTermCatalogName = shortTermCatalogName;
}
//long term
var longTermCatalogName = list.FindAll(x => x.ToLower().Contains("long") && x.ToLower().Contains("json"));
if (longTermCatalogName?.Count() > 0)
{
LongTermCatalogName?.Clear();
LongTermCatalogName.AddRange(longTermCatalogName);
}
}
dtReader.Close();
}
catch (SqlException sqlEx)
{
MessageOutput.ConsoleWrite($"TestList DB Connection Error: {sqlEx.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
connMain = null;
}
}
public static void ConnectDataDB1(string strGetConnIPAddress, int nGetConnPort = CatalogConnPort, string CatalogName = "")
{
try
{
//conn = new SqlConnection("Data Source=200.200.200.48,1433; Initial Catalog=LSU_Trimming_4th_ALIS; User ID=Alis; Password=kefico; MultipleActiveResultSets=True;");
//Data Source = {IP},{Port}; Initial Catalog = {SCHEMA}; User ID = {ID}; Password = {PW}; MultipleActiveResultSets=True;
//conn = new SqlConnection("Data Source=DESKTOP-5UQ1Q22;Initial Catalog=LSU_Trimming_4th_ALIS;Integrated Security=True;");
//conn = new SqlConnection("Data Source = 125.130.37.164,1433; Initial Catalog = LSU_Trimming_4th_ALIS; User ID = Alis; Password = kefico; MultipleActiveResultSets=True;");
//conn = new SqlConnection("Data Source = 127.0.0.1; Initial Catalog = Smart_Inhibitor_1th_ALIS; User ID = Alis; Password = kefico;"); //Integrated Security = SSPI;");
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
if (strGetConnIPAddress.Split(',').Length == 2)
builder.DataSource = strGetConnIPAddress;
else
builder.DataSource = strGetConnIPAddress + "," + nGetConnPort.ToString();
builder.UserID = "Alis";
builder.Password = "Kefico!@34"; //"Kefico!@34";
//builder.Password = "KEFICO!@34";
builder.InitialCatalog = ShortTermCatalogName;
//conn = new SqlConnection(builder.ConnectionString);
connShortTerm1 = new SqlConnection(builder.ConnectionString);
//conn = new SqlConnection("Data Source = " + strGetConnIPAddress.ToString() + ",1433; Initial Catalog = Smart_Inhibitor_1th_ALIS; User ID=Alis; Password=KEFICO!@34;"); // MultipleActiveResultSets=True;");
connShortTerm1.Open();
//
builder = new SqlConnectionStringBuilder();
if (strGetConnIPAddress.Split(',').Length == 2)
builder.DataSource = strGetConnIPAddress;
else
builder.DataSource = strGetConnIPAddress + "," + nGetConnPort.ToString(); //9000 50001 50002
builder.UserID = "Alis";
builder.Password = "Kefico!@34";
builder.InitialCatalog = CatalogName;
builder.MultipleActiveResultSets = true;
try
{
var con = new SqlConnection(builder.ConnectionString);
con.Open();
connLongTerm1.Add(CatalogName, con);
}
catch(Exception ex)
{
MessageOutput.ConsoleWrite($"Data DB Connection Error: {ex.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
}
}
catch (SqlException sqlEx)
{
MessageOutput.ConsoleWrite($"Data DB Connection Error: {sqlEx.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
connShortTerm1 = null;
connLongTerm1 = null;
}
}
public static void ConnectDataDB2(string strGetConnIPAddress, int nGetConnPort = CatalogConnPort, string CatalogName = "")
{
try
{
//conn = new SqlConnection("Data Source=200.200.200.48,1433; Initial Catalog=LSU_Trimming_4th_ALIS; User ID=Alis; Password=kefico; MultipleActiveResultSets=True;");
//Data Source = {IP},{Port}; Initial Catalog = {SCHEMA}; User ID = {ID}; Password = {PW}; MultipleActiveResultSets=True;
//conn = new SqlConnection("Data Source=DESKTOP-5UQ1Q22;Initial Catalog=LSU_Trimming_4th_ALIS;Integrated Security=True;");
//conn = new SqlConnection("Data Source = 125.130.37.164,1433; Initial Catalog = LSU_Trimming_4th_ALIS; User ID = Alis; Password = kefico; MultipleActiveResultSets=True;");
//conn = new SqlConnection("Data Source = 127.0.0.1; Initial Catalog = Smart_Inhibitor_1th_ALIS; User ID = Alis; Password = kefico;"); //Integrated Security = SSPI;");
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
if (strGetConnIPAddress.Split(',').Length == 2)
builder.DataSource = strGetConnIPAddress;
else
builder.DataSource = strGetConnIPAddress + "," + nGetConnPort.ToString();
builder.UserID = "Alis";
builder.Password = "Kefico!@34"; //"Kefico!@34";
//builder.Password = "KEFICO!@34";
builder.InitialCatalog = ShortTermCatalogName;
//conn = new SqlConnection(builder.ConnectionString);
connShortTerm2 = new SqlConnection(builder.ConnectionString);
//conn = new SqlConnection("Data Source = " + strGetConnIPAddress.ToString() + ",1433; Initial Catalog = Smart_Inhibitor_1th_ALIS; User ID=Alis; Password=KEFICO!@34;"); // MultipleActiveResultSets=True;");
connShortTerm2.Open();
//
builder = new SqlConnectionStringBuilder();
if (strGetConnIPAddress.Split(',').Length == 2)
builder.DataSource = strGetConnIPAddress;
else
builder.DataSource = strGetConnIPAddress + "," + nGetConnPort.ToString(); //9000 50001 50002
builder.UserID = "Alis";
builder.Password = "Kefico!@34";
builder.InitialCatalog = CatalogName;
builder.MultipleActiveResultSets = true;
try
{
var con = new SqlConnection(builder.ConnectionString);
con.Open();
connLongTerm2.Add(CatalogName, con);
}
catch (Exception ex)
{
MessageOutput.ConsoleWrite($"Data DB Connection Error: {ex.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
}
}
catch (SqlException sqlEx)
{
MessageOutput.ConsoleWrite($"Data DB Connection Error: {sqlEx.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
connShortTerm2 = null;
connLongTerm2 = null;
}
}
}
}

View File

@ -0,0 +1,229 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraBars;
using SystemX.Product.ALIS.UI.View;
using static SystemX.Product.ALIS.UI.View.ViewCfg;
using SystemX.Net.Platform.Common.Util;
using DataBaseConnection.Control;
using System.Data.SqlClient;
using SystemX.Product.ALIS.UI.Subs;
using System.Diagnostics;
using static SystemX.Net.Platform.Common.Util.LogMessage;
using SystemX.Product.ALIS.Interface;
using System.Net;
using static SystemX.Product.CP.TRA.MainForm;
namespace SystemX.Product.CP.TRA
{
public partial class MainForm
{
/// <summary>
/// IDataBaseController
/// </summary>
/// <returns></returns>
public SqlConnection GetMainConn()
{
return DatabaseConnControl.GetMainConn();
}
public SqlConnection GetShortTermConn1()
{
return DatabaseConnControl.GetShortTermConn1();
}
public Dictionary<string, SqlConnection> GetLongTermConn1()
{
return DatabaseConnControl.GetLongTermConn1();
}
public SqlConnection GetShortTermConn2()
{
return DatabaseConnControl.GetShortTermConn2();
}
public Dictionary<string, SqlConnection> GetLongTermConn2()
{
return DatabaseConnControl.GetLongTermConn2();
}
//IDataControl
/*
object objSQLControl = new object();
public UserInfo GetLoginInfo()
{
return CurrentUser;
}
private DataTable QuerySQL(string strQueryText)
{
lock (objSQLControl)
{
SqlDataReader sqlReader = null;
DataTable dt = new DataTable();
try
{
SQLCmd.CommandText = strQueryText;
sqlReader = SQLCmd.ExecuteReader();
if (sqlReader.HasRows != false)
dt.Load(sqlReader);
}
catch (Exception ex)
{
MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>> ") + @"Query process fail. [SystemX.Product.ALIS.UI : IDataControl.getDuplicateCheck]\r\n" + ex.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG);
}
finally
{
if (sqlReader != null)
sqlReader.Close();
}
if (Commons.isHasRow(dt))
return dt;
else
return null;
}
}
public DataTable GetTable(string strQueryText)
{
return QuerySQL(strQueryText);
}
/// <summary>
/// IDataController - GetTable
/// </summary>
/// <param name="tblName"></param>
/// <returns></returns>
public DataTable GetTable(eDbTableList tblName)
{
string strQueryText = string.Empty;
strQueryText = $"SELECT * FROM {tblName.ToString()} ORDER BY No ASC;";
if (tblName == eDbTableList.PROD_TestList)
{
strQueryText = $"SELECT X.No, " +
$"X.ProdNo_P AS 'P_ProdNo', " +
$"X.TestType, " +
$"X.FileName, " +
$"X.Version AS 'FileVersion', " +
$"X.ProdCode, " +
$"X.RegDT, " +
$"X.RegUser, " +
$"X.UpdateDT, " +
$"X.UpdateUser, " +
$"Y.No AS 'GroupNo', " +
$"Y.GroupName, " +
$"Y.ModelName, " +
$"Y.Comment, " +
$"X.Description, " +
$"X.TestListData FROM {tblName.ToString()} AS X INNER JOIN PROD_Group AS Y ON X.GroupNo = Y.No ORDER BY No ASC;";
}
else if (tblName == eDbTableList.PROD_Release)
{
strQueryText = $"SELECT X.No, " +
$"X.ProdNo_C AS 'C_ProdNo', " +
$"Y.No AS 'TestCodeNo', " +
$"Y.TestCode, " +
$"Z.No AS 'TestListNo', " +
$"Z.ProdNo_P AS 'P_ProdNo', " +
$"Z.TestType, " +
$"Z.Version AS 'FileVersion', " +
$"Z.ProdCode, " +
$"X.Config, " +
$"X.RegDT, " +
$"X.RegUser, " +
$"X.RegUserComment " +
$"FROM {tblName.ToString()} AS X INNER JOIN STAT_TestCode AS Y ON X.TestCodeNo = Y.No INNER JOIN PROD_TestList AS Z ON X.TestListNo = Z.No ORDER BY No ASC;";
}
return QuerySQL(strQueryText);
}
public DataTable GetTable(eDbTableList tblName, string strColName, string strParameter)
{
string strQueryText = $"SELECT * FROM {tblName.ToString()} WHERE {strColName} = {strParameter} ORDER BY No ASC;";
return QuerySQL(strQueryText);
}
public string GetServerDateTimeString()
{
string strGetDateTime = string.Empty;
string strQueryText = "SELECT CONVERT(datetime2, GETDATE(), 121) AS CURRENT_DATETIME;";
DataTable getDt = QuerySQL(strQueryText);
if (Commons.isHasRow(getDt))
strGetDateTime = getDt.Rows[0].ItemArray[0].ToString();
return strGetDateTime;
}
public DateTime GetServerDateTime()
{
string strGetDateTime = string.Empty;
string strQueryText = "SELECT CONVERT(datetime2, GETDATE(), 121) AS CURRENT_DATETIME;";
DataTable getDt = QuerySQL(strQueryText);
if (Commons.isHasRow(getDt))
strGetDateTime = getDt.Rows[0].ItemArray[0].ToString();
DateTime dtSetDateTime = new DateTime();
DateTime.TryParse(strGetDateTime, out dtSetDateTime);
return dtSetDateTime;
}
public string SetConvertDateTime(string strGetConvertText)
{
string strQueryConvertText = string.Empty;
if (strGetConvertText.IndexOf("AM") >= 0 || strGetConvertText.IndexOf("PM") >= 0 ||
strGetConvertText.IndexOf("오전") >= 0 || strGetConvertText.IndexOf("오후") >= 0)
{
if (strGetConvertText.IndexOf("AM") >= 0 || strGetConvertText.IndexOf("PM") >= 0)
strQueryConvertText = "SELECT dbo.XConvertDateE('" + strGetConvertText + "') AS CONVERT_DATETIME_E;";
else if (strGetConvertText.IndexOf("오전") >= 0 || strGetConvertText.IndexOf("오후") >= 0)
strQueryConvertText = "SELECT dbo.XConvertDateK('" + strGetConvertText + "') AS CONVERT_DATETIME_K;";
}
DataTable getDt = null;
string strGetResultText1 = string.Empty;
string strGetResultText2 = string.Empty;
if (strQueryConvertText != string.Empty)
getDt = QuerySQL(strQueryConvertText);
else
strGetResultText1 = strGetConvertText;
if (Commons.isHasRow(getDt))
strGetResultText1 = getDt.Rows[0].ItemArray[0].ToString();
string strQueryText = "SELECT CONVERT(VARCHAR, '" + strGetResultText1 + "', 121) AS CONVERT_DATETIME;";
if (strGetResultText1 != string.Empty)
getDt = QuerySQL(strQueryText);
if (Commons.isHasRow(getDt))
strGetResultText2 = getDt.Rows[0].ItemArray[0].ToString();
return strGetResultText2;
}
*/
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.TRA.UIControl;
namespace SystemX.Product.TRA.DataManager
{
public static class DMCommon
{
public static string SummaryHistTable = "HIST_TesterSummary";
public static string SummaryLogTable = "HIST_LogSummary";
public static string ResultLogTable = "HIST_TestResult";
//default, longterm 스위칭할때 필요
public const string SummaryLogTableDefault = "HIST_LogSummary";
public const string ResultLogTableDefault = "HIST_TestResult";
public static int nDefaultScanTime = 1800;
public static int nFullScanTime = 7200;
}
}

View File

@ -0,0 +1,399 @@
using DataBaseConnection.Control;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.TRA.DataManager
{
public class DMDetailOverview
{
public enum eCommand
{
PowerON,
PowerOFF,
QUERY
}
public enum eColList
{
TestDate,
StationName,
Host,
Section,
Start,
Final,
ProductNo,
TestType,
ParentNo,
ProductID,
TestListFileNo,
TestListVariantNo,
TestCode,
FileVersion,
FileCode,
StepVersion,
FirstTestTime,
FinalTestTime,
Total,
OK,
NG, //NOK,
TestListCntID
}
public enum eColListHide
{
TestListCntID,
RN
}
private SqlConnection DBConn { get; set; }
private SqlConnection ShortTermDBConn { get; set; }
private SqlConnection LongTermDBConn { get; set; }
private SqlCommand SQLCmd { get; set; }
private SelectedDataCollection SelectedOverViewItemData;
public string strDetailOverviewUseQuery;
public DataTable dtRaw;
public DataTable dtSubRaw;
eOverviewModelNameInfo GetSelectInfo;
IDataBaseController GetDBController;
public DMDetailOverview(eSelectDataView SelectView, eOverviewModelNameInfo SelectInfo, IDataBaseController getDBController)
{
GetSelectInfo = SelectInfo;
DBConn = getDBController.GetMainConn();
GetDBController = getDBController;
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
ShortTermDBConn = getDBController.GetShortTermConn1();
LongTermDBConn = getDBController.GetLongTermConn1().First().Value;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
ShortTermDBConn = getDBController.GetShortTermConn2();
LongTermDBConn = getDBController.GetLongTermConn2().First().Value;
}
strDetailOverviewUseQuery = string.Empty;
}
public DataTable GetDataView(eSelectDataView SelectView, SelectedDataCollection data, OverviewSearchOption inputOption)
{
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(data.StartTime.Year.ToString()))?.FirstOrDefault().Value;
if (LongTermDBConn == null)
{
LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value;
}
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(data.StartTime.Year.ToString()))?.FirstOrDefault().Value;
if (LongTermDBConn == null)
{
LongTermDBConn = GetDBController.GetLongTermConn2().FirstOrDefault().Value;
}
}
DataTable dtResult = new DataTable();
SelectedOverViewItemData = data;
string strGetUseQuery = string.Empty;
dtRaw = GetRawResult(inputOption, out strGetUseQuery);
if (inputOption.DisplayByStation == false)
dtSubRaw = GetSubRawResult();
else
dtSubRaw = null;
strDetailOverviewUseQuery = strGetUseQuery;
return dtRaw;
}
DataTable GetRawResult(OverviewSearchOption inputOption, out string strGetSendQuery)
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
DateTime dtNow = DateTime.Now;
strGetSendQuery = string.Empty;
strQuery += $"SELECT * FROM (";
strQuery += $"SELECT ";
strQuery += $"CAST({DMCommon.SummaryLogTable}.[TestDT] AS DATE) AS {eColList.TestDate.ToString()},";
if (inputOption.DisplayByStation)
{
strQuery += $"{DMCommon.SummaryLogTable}.[StationName] AS {eColList.StationName.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[HostID] AS {eColList.Host.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[Section] AS {eColList.Section.ToString()},";
}
//
strQuery += $"Y.ModelName,";
strQuery += $"{DMCommon.SummaryLogTable}.[TestType] AS {eColList.TestType.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_C] AS {eColList.ProductNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[Testcode] AS {eColList.TestCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_P] AS {eColList.ParentNo.ToString()},";
if (SelectedOverViewItemData.ProductID.Length > 0)
strQuery += $"{DMCommon.SummaryLogTable}.[ProductID] as {eColList.ProductID.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListFileNo] AS {eColList.TestListFileNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListVariantNo] AS {eColList.TestListVariantNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdCode] AS {eColList.FileCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[Version] AS {eColList.FileVersion.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[StepVersion] AS {eColList.StepVersion.ToString()},";
strQuery += $"CONVERT(CHAR(8), MIN({DMCommon.SummaryLogTable}.[TestDT]), 108) AS {eColList.FirstTestTime.ToString()},";
strQuery += $"CONVERT(CHAR(8), MAX({DMCommon.SummaryLogTable}.[TestDT]), 108) AS {eColList.FinalTestTime.ToString()},";
strQuery += $"COUNT({DMCommon.SummaryLogTable}.[Result]) AS {eColList.Total.ToString()},";
strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.[Result] = 'OK' THEN 1 END) AS {eColList.OK.ToString()},";
strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.[Result] != 'OK' THEN 1 END) AS {eColList.NG.ToString()},";
if (inputOption.DisplayByStation)
{
strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[ProdNo_P] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListCntID] ";
}
else
{
strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[ProdNo_P] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN ";
}
strQuery += $"FROM {DMCommon.SummaryLogTable} ";
strQuery += $"WITH(NOLOCK) ";
switch (GetSelectInfo)
{
case eOverviewModelNameInfo.L:
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
case eOverviewModelNameInfo.P1:
strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
case eOverviewModelNameInfo.P2:
strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
}
/*
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = CONVERT(NVARCHAR, {DMCommon.SummaryLogTable}.[TestListVariantNo]) ";
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
*/
strQuery += $"WHERE TestDT >= '{SelectedOverViewItemData.SearchRangeStart.ToString("yyyy-MM-dd HH:mm:ss")}' AND TestDT <= '{SelectedOverViewItemData.SearchRangeEnd.ToString("yyyy-MM-dd HH:mm:ss")}' AND ";
strQuery += $"ProdNo_C NOT IN('PowerON', 'PowerOFF', 'QUERY') AND ";
strQuery += $"ProductID NOT IN('PowerON', 'PowerOFF', 'QUERY') ";
if (SelectedOverViewItemData.ProductID.Length > 0)
{
strQuery += $"AND ProductID = '{SelectedOverViewItemData.ProductID}' ";
}
strQuery += $"GROUP BY ";
strQuery += $"CAST({DMCommon.SummaryLogTable}.[TestDT] AS DATE),";
//
strQuery += $"Y.ModelName,";
if (inputOption.DisplayByStation)
{
strQuery += $"{DMCommon.SummaryLogTable}.[StationName],";
strQuery += $"{DMCommon.SummaryLogTable}.[HostID],";
strQuery += $"{DMCommon.SummaryLogTable}.[Section],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListCntID],";
}
if (SelectedOverViewItemData.ProductID.Length > 0)
strQuery += $"{DMCommon.SummaryLogTable}.ProductID,";
//strQuery += $"{DMCommon.SummaryLogTable}.[TestListCntID],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestType],";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_C],";
strQuery += $"{DMCommon.SummaryLogTable}.[Testcode],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListFileNo],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListVariantNo],";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_P],";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdCode],";
strQuery += $"{DMCommon.SummaryLogTable}.[Version],";
strQuery += $"{DMCommon.SummaryLogTable}.[StepVersion]";
strQuery += " ";
strQuery += ") AS X ";
if (inputOption.DisplayByStation)
{
strQuery += "WHERE X.Host = '" + SelectedOverViewItemData.HostID + "' AND X.Section = '" + SelectedOverViewItemData.SectionID + "' ";
//strQuery += "ORDER BY X.TestDate, X.Host, X.Section ASC;";
strQuery += "ORDER BY X.TestDate ASC, X.FirstTestTime ASC;";
}
else
{
strQuery += "WHERE X.ProductNo = '" + SelectedOverViewItemData.ProductNo + "' AND X.TestType = '" + SelectedOverViewItemData.TestType + "' AND X.TestCode = '" + SelectedOverViewItemData.TestCode + "' AND X.ParentNo = '" + SelectedOverViewItemData.ParentNo + "' ";
//strQuery += "ORDER BY X.TestDate, X.ProductNo, X.ParentNo ASC;";
strQuery += "ORDER BY X.TestDate ASC, X.FirstTestTime ASC;";
}
//
strGetSendQuery = strQuery;
if (DatabaseConnControl.ScanLongTermLog)
SQLCmd = new SqlCommand(strQuery, LongTermDBConn);
else
SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
DataTable GetSubRawResult()
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
DateTime dtNow = DateTime.Now;
strQuery += $"SELECT * FROM (";
strQuery += $"SELECT ";
strQuery += $"CAST({DMCommon.SummaryLogTable}.[TestDT] AS DATE) AS {eColList.TestDate.ToString()},";
strQuery += $"Y.ModelName,";
strQuery += $"{DMCommon.SummaryLogTable}.[TestType] AS {eColList.TestType.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_C] AS {eColList.ProductNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[Testcode] AS {eColList.TestCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_P] AS {eColList.ParentNo.ToString()},";
if (SelectedOverViewItemData.ProductID.Length > 0)
strQuery += $"{DMCommon.SummaryLogTable}.[ProductID] as {eColList.ProductID.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListFileNo] AS {eColList.TestListFileNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListVariantNo] AS {eColList.TestListVariantNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdCode] AS {eColList.FileCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[Version] AS {eColList.FileVersion.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[StepVersion] AS {eColList.StepVersion.ToString()},";
strQuery += $"CONVERT(CHAR(8), MIN({DMCommon.SummaryLogTable}.[TestDT]), 108) AS {eColList.FirstTestTime.ToString()},";
strQuery += $"CONVERT(CHAR(8), MAX({DMCommon.SummaryLogTable}.[TestDT]), 108) AS {eColList.FinalTestTime.ToString()},";
strQuery += $"COUNT({DMCommon.SummaryLogTable}.[Result]) AS {eColList.Total.ToString()},";
strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.[Result] = 'OK' THEN 1 END) AS {eColList.OK.ToString()},";
strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.[Result] != 'OK' THEN 1 END) AS {eColList.NG.ToString()},";
strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[ProdNo_P] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListCntID] ";
strQuery += $"FROM {DMCommon.SummaryLogTable} ";
strQuery += $"WITH(NOLOCK) ";
switch (GetSelectInfo)
{
case eOverviewModelNameInfo.L:
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
case eOverviewModelNameInfo.P1:
strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
case eOverviewModelNameInfo.P2:
strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
}
/*
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
*/
strQuery += $"WHERE TestDT >= '{SelectedOverViewItemData.SearchRangeStart.ToString("yyyy-MM-dd HH:mm:ss")}' AND TestDT <= '{SelectedOverViewItemData.SearchRangeEnd.ToString("yyyy-MM-dd HH:mm:ss")}' AND ";
strQuery += $"ProdNo_C NOT IN('PowerON', 'PowerOFF', 'QUERY') AND ";
strQuery += $"ProductID NOT IN('PowerON', 'PowerOFF', 'QUERY') ";
if (SelectedOverViewItemData.ProductID.Length > 0)
{
strQuery += $"AND ProductID = '{SelectedOverViewItemData.ProductID}' ";
}
strQuery += $"GROUP BY ";
strQuery += $"CAST({DMCommon.SummaryLogTable}.[TestDT] AS DATE),";
//
strQuery += $"Y.ModelName,";
if (SelectedOverViewItemData.ProductID.Length > 0)
strQuery += $"{DMCommon.SummaryLogTable}.ProductID,";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListCntID],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestType],";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_C],";
strQuery += $"{DMCommon.SummaryLogTable}.[Testcode],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListFileNo],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListVariantNo],";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_P],";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdCode],";
strQuery += $"{DMCommon.SummaryLogTable}.[Version],";
strQuery += $"{DMCommon.SummaryLogTable}.[StepVersion]";
strQuery += " ";
strQuery += ") AS X ";
strQuery += "WHERE X.ProductNo = '" + SelectedOverViewItemData.ProductNo + "' AND X.TestType = '" + SelectedOverViewItemData.TestType + "' AND X.TestCode = '" + SelectedOverViewItemData.TestCode + "' AND X.ParentNo = '" + SelectedOverViewItemData.ParentNo + "' ";
//strQuery += "ORDER BY X.TestDate, X.ProductNo, X.ParentNo ASC;";
strQuery += "ORDER BY X.TestDate ASC, X.FirstTestTime ASC;";
if (DatabaseConnControl.ScanLongTermLog)
SQLCmd = new SqlCommand(strQuery, LongTermDBConn);
else
SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
}
}

View File

@ -0,0 +1,353 @@
using DataBaseConnection.Control;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.TRA.DataManager
{
public class DMOverview
{
public enum eCommand
{
PowerON,
PowerOFF,
QUERY
}
public enum eColList
{
TestDate,
StationName,
Host,
Section,
ProductID,
Start,
Final,
ProductNo,
TestType,
ParentNo,
TestListFileNo,
TestListVariantNo,
TestCode,
FileVersion,
FileCode,
StepVersion,
FirstTestTime,
FinalTestTime,
Total,
OK,
NG, //NOK,
TestListCntID
}
public enum eColListHide
{
TestListCntID,
RN
}
private SqlConnection DBConn { get; set; }
private SqlConnection ShortTermDBConn { get; set; }
private SqlConnection LongTermDBConn { get; set; }
private SqlCommand SQLCmd { get; set; }
public void SetSqlCommandCancel()
{
CTS.Cancel();
}
public bool GetSqlCommandCancelState()
{
return CTS.IsCancellationRequested;
}
public string strOverviewUseQuery;
eOverviewModelNameInfo GetSelectInfo;
CancellationTokenSource CTS;
CancellationToken CT;
IDataBaseController GetDBController;
public DMOverview(eSelectDataView SelectView, eOverviewModelNameInfo SelectInfo, IDataBaseController getDBController)
{
GetSelectInfo = SelectInfo;
DBConn = getDBController.GetMainConn();
GetDBController = getDBController;
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
ShortTermDBConn = getDBController.GetShortTermConn1();
LongTermDBConn = getDBController.GetLongTermConn1().First().Value;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
ShortTermDBConn = getDBController.GetShortTermConn2();
LongTermDBConn = getDBController.GetLongTermConn2().First().Value;
}
strOverviewUseQuery = string.Empty;
CTS = new CancellationTokenSource();
CT = CTS.Token;
}
public async Task<DataTable> GetDataView(eSelectDataView SelectView, DateTime dtStart, DateTime dtEnd, OverviewSearchOption inputOption, bool bUseMainConn = false, string strTestQuery = "")
{
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(dtStart.Year.ToString()))?.FirstOrDefault().Value;
if(LongTermDBConn == null)
{
LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value;
}
DatabaseConnControl.SelectLongTermCatalogNameCon1 = LongTermDBConn.Database;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtStart.Year.ToString()))?.FirstOrDefault().Value;
if (LongTermDBConn == null)
{
LongTermDBConn = GetDBController.GetLongTermConn2().FirstOrDefault().Value;
}
DatabaseConnControl.SelectLongTermCatalogNameCon2 = LongTermDBConn.Database;
}
DataTable dtResult = new DataTable();
string strGetUseQuery = string.Empty;
CTS = new CancellationTokenSource();
CT = CTS.Token;
//For Test
/*
try
{
await Task.Delay(5000, CT);
}
catch
{
}
*/
Tuple<DataTable, string> dtRawInfo = await GetRawResult(dtStart, dtEnd, inputOption, bUseMainConn, strTestQuery);
strOverviewUseQuery = dtRawInfo.Item2;
return dtRawInfo.Item1;
}
private async Task<Tuple<DataTable, string>> GetRawResult(DateTime dtStart, DateTime dtEnd, OverviewSearchOption inputOption, bool bUseMainConn = false, string strTestQuery = "")
{
DataTable dtResult = new DataTable();
bool bFullScanOn = false;
string strQuery = string.Empty;
DateTime dtNow = DateTime.Now;
string strGetSendQuery = string.Empty;
strQuery += $"SELECT * FROM (";
strQuery += $"SELECT ";
strQuery += $"CAST({DMCommon.SummaryLogTable}.[TestDT] AS DATE) AS {eColList.TestDate.ToString()},";
if (inputOption.DisplayByStation)
{
strQuery += $"{DMCommon.SummaryLogTable}.[StationName] AS {eColList.StationName.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[HostID] AS {eColList.Host.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[Section] AS {eColList.Section.ToString()},";
}
//
strQuery += $"Y.ModelName,";
strQuery += $"{DMCommon.SummaryLogTable}.[TestType] AS {eColList.TestType.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_C] AS {eColList.ProductNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[Testcode] AS {eColList.TestCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdNo_P] AS {eColList.ParentNo.ToString()},";
if (inputOption.ProductID.Length > 0)
strQuery += $"{DMCommon.SummaryLogTable}.[ProductID] as {eColList.ProductID.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListFileNo] AS {eColList.TestListFileNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListVariantNo] AS {eColList.TestListVariantNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[ProdCode] AS {eColList.FileCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[Version] AS {eColList.FileVersion.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[StepVersion] AS {eColList.StepVersion.ToString()},";
strQuery += $"CONVERT(CHAR(8), MIN({DMCommon.SummaryLogTable}.[TestDT]), 108) AS {eColList.FirstTestTime.ToString()},";
strQuery += $"CONVERT(CHAR(8), MAX({DMCommon.SummaryLogTable}.[TestDT]), 108) AS {eColList.FinalTestTime.ToString()},";
strQuery += $"COUNT({DMCommon.SummaryLogTable}.[Result]) AS {eColList.Total.ToString()},";
strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.[Result] = 'OK' THEN 1 END) AS {eColList.OK.ToString()},";
strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.[Result] != 'OK' THEN 1 END) AS {eColList.NG.ToString()},";
if (inputOption.DisplayByStation)
{
strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[HostID], {DMCommon.SummaryLogTable}.[Section] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListCntID]";
}
else
{
strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[Testcode] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,";
strQuery = strQuery.Remove(strQuery.Length - 1, 1);
}
strQuery += " ";
strQuery += $"FROM {DMCommon.SummaryLogTable} ";
strQuery += $"WITH(NOLOCK) ";
//strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = CONVERT(NVARCHAR, {DMCommon.SummaryLogTable}.[TestListVariantNo]) ";
switch(GetSelectInfo)
{
case eOverviewModelNameInfo.L:
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
case eOverviewModelNameInfo.P1:
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
case eOverviewModelNameInfo.P2:
strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
break;
}
/*
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] ";
strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo ";
*/
strQuery += $"WHERE ";
if (inputOption.ProductID.Length > 0 && inputOption.FullScanData)
{
bFullScanOn = true;
}
else
strQuery += $"TestDT >= '{dtStart.ToString("yyyy-MM-dd HH:mm:ss")}' AND TestDT <= '{dtEnd.ToString("yyyy-MM-dd HH:mm:ss")}' AND ";
strQuery += $"ProdNo_C NOT IN('PowerON', 'PowerOFF', 'QUERY') AND ";
strQuery += $"ProductID NOT IN('PowerON', 'PowerOFF', 'QUERY') ";
if (inputOption.ProductID.Length > 0)
{
strQuery += $"AND ProductID = '{inputOption.ProductID}' ";
}
strQuery += $"GROUP BY ";
strQuery += $"CAST({DMCommon.SummaryLogTable}.TestDT AS DATE),";
//
strQuery += $"Y.ModelName,";
if (inputOption.DisplayByStation)
{
strQuery += $"{DMCommon.SummaryLogTable}.StationName,";
strQuery += $"{DMCommon.SummaryLogTable}.HostID,";
strQuery += $"{DMCommon.SummaryLogTable}.Section,";
strQuery += $"{DMCommon.SummaryLogTable}.TestListCntID,";
}
if (inputOption.ProductID.Length > 0)
strQuery += $"{DMCommon.SummaryLogTable}.ProductID,";
strQuery += $"{DMCommon.SummaryLogTable}.TestType,";
strQuery += $"{DMCommon.SummaryLogTable}.ProdNo_C,";
strQuery += $"{DMCommon.SummaryLogTable}.Testcode,";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListFileNo],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListVariantNo],";
strQuery += $"{DMCommon.SummaryLogTable}.ProdNo_P,";
strQuery += $"{DMCommon.SummaryLogTable}.ProdCode,";
strQuery += $"{DMCommon.SummaryLogTable}.Version,";
strQuery += $"{DMCommon.SummaryLogTable}.StepVersion";
strQuery += " ";
strQuery += ") AS X WHERE X.RN = 1 ";
if (inputOption.DisplayByStation)
{
strQuery += "ORDER BY Host, Section ASC;";
//strQuery += "ORDER BY Host, Section DESC;";
}
else
{
strQuery += "ORDER BY ProductNo, ParentNo ASC;";
//strQuery += ";";
}
if (strTestQuery.Length > 0)
strQuery = strTestQuery;
strGetSendQuery = strQuery;
if (bUseMainConn)
{
SQLCmd = new SqlCommand(strQuery, DBConn);
}
else
{
if (DatabaseConnControl.ScanLongTermLog)
{
SQLCmd = new SqlCommand(strQuery, LongTermDBConn);
}
else
SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
}
if(bFullScanOn)
SQLCmd.CommandTimeout = DMCommon.nFullScanTime;
else
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = null;
try
{
dtReader = await SQLCmd.ExecuteReaderAsync(CT);
}
catch(Exception e)
{
if (dtReader != null)
{
dtReader.Close();
dtReader = null;
}
}
finally
{
if (dtReader != null)
{
dtResult.Load(dtReader);
dtReader.Close();
}
}
return new Tuple<DataTable, string>(dtResult, strGetSendQuery);
}
}
}

View File

@ -0,0 +1,189 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.TRA.DataManager.DMOverview;
using static SystemX.Product.CP.TRA.Commons;
using DataBaseConnection.Control;
namespace SystemX.Product.TRA.DataManager
{
public class DMProductHistory
{
public enum eColList
{
LastTestDateTime,
ProductID,
ProductNo,
TestType,
TestCode,
ParentNo,
FileVersion,
FileCode,
StepVersion,
AvgDuration,
TestResult,
OK,
NG, //NOK,
TestlistNo,
TestlistFile,
TestlistReqID
}
private SqlConnection DBConn { get; set; }
private SqlConnection ShortTermDBConn { get; set; }
private SqlConnection LongTermDBConn { get; set; }
private SqlCommand SQLCmd { get; set; }
public DMProductHistory(eSelectDataView SelectView, IDataBaseController getDBController)
{
DBConn = getDBController.GetMainConn();
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
ShortTermDBConn = getDBController.GetShortTermConn1();
LongTermDBConn = getDBController.GetLongTermConn1().First().Value;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
ShortTermDBConn = getDBController.GetShortTermConn2();
LongTermDBConn = getDBController.GetLongTermConn2().First().Value;
}
}
public DataTable SearchTestHistory(SelectedDataCollection data, TestHistorySearchOption option)
{
DataTable dtResult = GetRawResult(data, option);
return dtResult;
}
DataTable GetRawResult(SelectedDataCollection data, TestHistorySearchOption option)
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
if (data == null)
return dtResult;
DateTime dtNow = DateTime.Now;
DateTime dtCheckTime = DateTime.Now;
if (option.Time_WholeRange)
dtCheckTime = data.SearchRangeStart;
else if (option.Time_SelectedTest)
dtCheckTime = data.StartTime;
else if (option.Time_Day)
dtCheckTime = data.StartTime;
strQuery += $"select ";
strQuery += $"{DMCommon.SummaryLogTable}.ProductID as {eColList.ProductID.ToString()},";
//strQuery += $"CONVERT(char(20), {DMCommon.SummaryLogTable}.TestDT, 20) as {eColList.LastTestDateTime.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.TestType as {eColList.TestType.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.ProdNo_C as {eColList.ProductNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.Testcode as {eColList.TestCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.ProdNo_P as {eColList.ParentNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.ProdCode as {eColList.FileCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.Version as {eColList.FileVersion.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.StepVersion as {eColList.StepVersion.ToString()},";
strQuery += $"avg(CONVERT(int, {DMCommon.SummaryLogTable}.Duration)) as {eColList.AvgDuration.ToString()},";
strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.Result = 'OK' THEN 1 ELSE 0 END) as {eColList.OK.ToString()},";
strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.Result = '-' THEN 0 WHEN {DMCommon.SummaryLogTable}.Result != 'OK' THEN 1 ELSE 0 END) as {eColList.NG.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[TestlistNo],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestlistFile]";
strQuery += " ";
strQuery += $"from {DMCommon.SummaryLogTable} ";
strQuery += $"WITH(NOLOCK) ";
if (option.Time_WholeRange)
strQuery += $"where TestDT >= '{data.SearchRangeStart.ToString("yyyy-MM-dd 00:00:00")}' and TestDT <= '{data.SearchRangeEnd.ToString("yyyy-MM-dd 23:59:59")}' ";
else if(option.Time_SelectedTest)
strQuery += $"where TestDT >= '{data.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}' and TestDT <= '{data.EndTime.ToString("yyyy-MM-dd HH:mm:ss")}' ";
else if(option.Time_Day)
strQuery += $"where TestDT >= '{data.StartTime.ToShortDateString()} 00:00:00' and TestDT <= '{data.EndTime.ToShortDateString()} 23:59:59' ";
if (option.Station && !string.IsNullOrWhiteSpace(data.StationName))
strQuery += $" and (StationName = '{data.StationName}' or StationName = '-') ";
if (option.Host && !string.IsNullOrWhiteSpace(data.HostID))
strQuery += $" and (HostID = '{data.HostID}' or HostID = '-') ";
if (option.Section && !string.IsNullOrWhiteSpace(data.SectionID))
strQuery += $" and (Section = '{data.SectionID}' or Section = '-') ";
if (option.TestType)
strQuery += $" and (TestType = '{data.TestType}' or TestType = '-') ";
if (option.ProductNo)
{
strQuery += $" and (ProdNo_C = '{data.ProductNo}' ";
if(option.Host && !string.IsNullOrWhiteSpace(data.HostID))
{
foreach(string strCmd in Enum.GetNames(typeof(eCommand)))
strQuery += $"or ProdNo_C = '{strCmd}'";
}
strQuery += $" )";
}
if (option.TestCode)
strQuery += $" and (Testcode = '{data.TestCode}' or Testcode = '-') ";
if (option.ParentNo)
strQuery += $" and (ProdNo_P = '{data.ParentNo}' or ProdNo_P = '-') ";
if (option.ProductionCode)
strQuery += $" and (ProdCode = '{data.ProductionCode}' or ProdCode = '-') ";
if (option.FileVersion)
strQuery += $" and (Version = '{data.FileVersion}' or Version = '-') ";
if (option.StepVersion)
strQuery += $" and (StepVersion = '{data.StepVersion}' or StepVersion = '-1') ";
if (option.Time_SelectedTest)
strQuery += $" and (TestListCntID = '{data.TestRequestID[0]}' or TestListCntID = '-') ";
strQuery += $" group by ";
strQuery += $" {DMCommon.SummaryLogTable}.ProductID, ";
strQuery += $" {DMCommon.SummaryLogTable}.TestType, ";
strQuery += $" {DMCommon.SummaryLogTable}.ProdNo_C, ";
strQuery += $" {DMCommon.SummaryLogTable}.Testcode, ";
strQuery += $" {DMCommon.SummaryLogTable}.ProdNo_P, ";
strQuery += $" {DMCommon.SummaryLogTable}.ProdCode, ";
strQuery += $" {DMCommon.SummaryLogTable}.Version, ";
strQuery += $" {DMCommon.SummaryLogTable}.StepVersion, ";
strQuery += $" {DMCommon.SummaryLogTable}.TestlistNo, ";
strQuery += $" {DMCommon.SummaryLogTable}.TestlistFile ";
strQuery += " ";
//strQuery += $"order by ";
//strQuery += $"{DMCommon.SummaryLogTable}.TestDT";
strQuery += ";";
if (DatabaseConnControl.ScanLongTermLog)
SQLCmd = new SqlCommand(strQuery, LongTermDBConn);
else
SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
}
}

View File

@ -0,0 +1,176 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.TRA.DataManager.DMOverview;
using static SystemX.Product.CP.TRA.Commons;
using DataBaseConnection.Control;
namespace SystemX.Product.TRA.DataManager
{
public class DMStepTrend
{
public SqlConnection DBConn { get; private set; }
public SqlConnection ShortTermDBConn { get; private set; }
public SqlConnection LongTermDBConn { get; private set; }
private SqlCommand SQLCmd { get; set; }
eSelectDataView TrendSelectView { get; set; }
IDataBaseController GetDBController;
public DMStepTrend(eSelectDataView SelectView, IDataBaseController getDBController, DateTime dtStart)
{
GetDBController = getDBController;
DBConn = getDBController.GetMainConn();
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
TrendSelectView = eSelectDataView.DataDocumentViewC1;
ShortTermDBConn = getDBController.GetShortTermConn1();
LongTermDBConn = getDBController.GetLongTermConn1().Where(x=>x.Key.Contains(dtStart.Year.ToString())).First().Value;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
TrendSelectView = eSelectDataView.DataDocumentViewC2;
ShortTermDBConn = getDBController.GetShortTermConn2();
LongTermDBConn = getDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtStart.Year.ToString())).First().Value;
}
}
public DataTable SearchTestResult(DateTime dtTest, ulong nAccNo)
{
if (TrendSelectView == eSelectDataView.DataDocumentViewC1)
{
TrendSelectView = eSelectDataView.DataDocumentViewC1;
ShortTermDBConn = GetDBController.GetShortTermConn1();
LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(dtTest.Year.ToString())).First().Value;
}
else if (TrendSelectView == eSelectDataView.DataDocumentViewC2)
{
TrendSelectView = eSelectDataView.DataDocumentViewC2;
ShortTermDBConn = GetDBController.GetShortTermConn2();
LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtTest.Year.ToString())).First().Value;
}
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
//string strLongTerm = "HIST_TestResult";
//string strShortTerm = "HIST_TestResult";
//DateTime dtNow = DateTime.Now;
//int nDiffMonth = 12 * (dtNow.Year - dtTest.Year) + (dtNow.Month - dtTest.Month);
//string strTableTerm = nDiffMonth > 3 ? strLongTerm : strShortTerm;
strQuery += $"SELECT ";
strQuery += $"*";
strQuery += " ";
strQuery += $"from {DMCommon.ResultLogTable} ";
strQuery += $"WITH(NOLOCK) ";
strQuery += $"where [No] = {nAccNo}";
strQuery += " ";
//strQuery += $"order by ";
//strQuery += $"[No]";
strQuery += ";";
if (DatabaseConnControl.ScanLongTermLog) SQLCmd = new SqlCommand(strQuery, LongTermDBConn);
else SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
public DataTable GetTestStepResults(DateTime dtTest, List<ulong> vnData)
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
//string strLongTerm = "HIST_TestResult";
//string strShortTerm = "HIST_TestResult";
//DateTime dtNow = DateTime.Now;
//int nDiffMonth = 12 * (dtNow.Year - dtTest.Year) + (dtNow.Month - dtTest.Month);
//string strTableTerm = nDiffMonth > 3 ? strLongTerm : strShortTerm;
strQuery += $"SELECT ";
strQuery += $"*";
strQuery += " ";
strQuery += $"from {DMCommon.ResultLogTable} ";
strQuery += $"WITH(NOLOCK) ";
strQuery += $"where ";
int nIdx = 0;
foreach (ulong no in vnData)
{
strQuery += $"No = {no}";
if (nIdx < vnData.Count - 1)
strQuery += " or ";
nIdx++;
}
strQuery += " ";
strQuery += $"order by ";
strQuery += $"[No]";
strQuery += ";";
if (DatabaseConnControl.ScanLongTermLog) SQLCmd = new SqlCommand(strQuery, LongTermDBConn);
else SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
DataTable GetRawResult(DetailTestDataCollection data)
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
if (data == null)
return dtResult;
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
}
}

View File

@ -0,0 +1,303 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.CP.TRA;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.TRA.DataManager.DMOverview;
using static SystemX.Product.CP.TRA.Commons;
using SystemX.Net.Platform.SystemX.Net.XEFCore;
using CPXV2Log = SystemX.Net.Platform.SystemX.Net.XEFCore.DBContext.CPXV2Log;
using CPXV2LogJson = SystemX.Net.Platform.SystemX.Net.XEFCore.DBContext.CPXV2LogJson;
using Newtonsoft.Json;
using DataBaseConnection.Control;
using SystemX.Common.Util;
namespace SystemX.Product.TRA.DataManager
{
public class DMTestDetail
{
public enum eColHideListLog
{
No,
AccessKey,
//TestID
}
public enum eColTestLog
{
No,
StepID,
MeasVal,
MeasValStr,
Message,
GlobalMin,
GlobalMax,
Result,
SpentTime,
DataDT
}
public enum eColHideListTL
{
No,
TestListNo,
StepVersion,
Enable,
IsGlobal,
UpdateDT
}
public enum eColTestlist
{
No,
TestListNo,
StepID,
Variant,
Gate,
Activate,
StepVersion,
Enable,
Position,
StepDesc,
UseFunction,
SpecMin,
SpecMax,
Dim,
IsGlobal,
UpdateDT
}
private SqlConnection DBConn { get; set; }
private SqlConnection ShortTermDBConn { get; set; }
public SqlConnection LongTermDBConn { get; private set; }
private SqlCommand SQLCmd { get; set; }
private IDataBaseController DBControllers { get; set; }
public eSelectDataView NgHistorySelectView { get; set; }
public DMTestDetail(eSelectDataView SelectView, IDataBaseController getDBController, DateTime dtStart)
{
DBControllers = getDBController;
DBConn = getDBController.GetMainConn();
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
NgHistorySelectView = eSelectDataView.DataDocumentViewC1;
ShortTermDBConn = getDBController.GetShortTermConn1();
LongTermDBConn = getDBController.GetLongTermConn1().Where(x=>x.Key.Contains(dtStart.Year.ToString())).First().Value;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
NgHistorySelectView = eSelectDataView.DataDocumentViewC2;
ShortTermDBConn = getDBController.GetShortTermConn2();
LongTermDBConn = getDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtStart.Year.ToString())).First().Value;
}
}
public DataTable SearchTestlist(DetailTestDataCollection data)
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
if (data == null)
return dtResult;
/*
--최신 목록 스텝 Index Seek 특정 버전 이하 만 찾기
SELECT * FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC)
AS RN FROM VRFY_Release WITH (INDEX=[CSK_VRFY_Release_1], NOLOCK) WHERE TestlistNo = 28 AND StepVersion <= 18) AS X
WHERE X.RN = 1 ORDER BY X.StepID ASC;
--최신 목록 스텝 Index Seek
SELECT * FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC)
AS RN FROM VRFY_Release WITH (INDEX=[CSK_VRFY_Release_1], NOLOCK) WHERE TestlistNo = 4) AS X
WHERE X.RN = 1 ORDER BY X.StepID ASC;
*/
/*
strQuery += $"SELECT * FROM(SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC) " +
$"AS RN FROM VRFY_Release WITH(INDEX =[CSK_VRFY_Release_1], NOLOCK) WHERE TestlistNo = {data.TestlistNo}) AS X " +
$"WHERE X.RN = 1 ORDER BY X.StepID ASC;";
*/
strQuery = $"SELECT A.ProdNo_C, B.ProdNo_P, B.UpdateDT, D.TestCode, D.Gate1, D.Gate2, E.FileName, A.RegUserComment, B.Description, C.GroupName, C.ModelName, A.VariantNo AS 'TestListNo', A.Config, E.TestType, E.Version, E.ProdCode, B.UseTLPosition, B.TestListFileNo, E.UpdateDT AS 'TestListFileUpdateDT', A.VariantNo FROM [PROD_Release] AS A WITH(NOLOCK) " +
$"INNER JOIN(SELECT * FROM [PROD_Variant] WITH(NOLOCK)) AS B ON A.VariantNo = B.No " +
$"INNER JOIN(SELECT * FROM [PROD_Group] WITH(NOLOCK)) AS C ON B.GroupNo = C.No " +
$"INNER JOIN(SELECT * FROM [STAT_TestCode] WITH(NOLOCK)) AS D ON A.TestCodeNo = D.No " +
$"INNER JOIN(SELECT * FROM [STOR_TestListFile] WITH(NOLOCK)) AS E ON B.TestListFileNo = E.No " +
$"WHERE A.ProdNo_C = '{data.ProductNo}' AND D.TestCode = '{data.TestCode}' AND E.TestType = '{data.TestType}' AND E.Version = '{data.FileVersion}' AND E.ProdCode = '{data.FileCode}';";
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtCompReader = SQLCmd.ExecuteReader();
DataTable dtCompResult = new DataTable();
dtCompResult.Load(dtCompReader);
if (Commons.isHasRow(dtCompResult) == false)
return dtResult;
string strCompVariNo = dtCompResult.Rows[0]["VariantNo"].ToString();
string strCompFileNo = dtCompResult.Rows[0]["TestListFileNo"].ToString();
dtCompReader.Close();
string strGetTestListFileNo = string.Empty;
if (strCompVariNo.CompareTo(data.TestListVariantNo) == 0 &&
strCompFileNo.CompareTo(data.TestListFileNo) == 0)
strGetTestListFileNo = data.TestListFileNo;
else
strGetTestListFileNo = strCompFileNo;
strQuery = $"SELECT * FROM ( " +
$"SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC) " +
$"AS RN FROM VRFY_TestListFileRelease WITH (NOLOCK, INDEX=[CSK_VRFY_Release_2]) WHERE TestListFileNo = {strGetTestListFileNo} " +
$"AND StepVersion <= {data.StepVersion}) X WHERE RN = 1 ORDER BY X.StepID ASC;";
/*strQuery += $"SELECT ";
strQuery += $"*";
strQuery += " ";
strQuery += $"from [VRFY_Release] ";
strQuery += $"WITH(NOLOCK) ";
strQuery += $"where [TestListNo] = {data.TestlistNo}";
strQuery += " ";
strQuery += $"order by ";
strQuery += $"[StepID]";
strQuery += ";";*/
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
//PK 키 지정
DataColumn[] keys1 = new DataColumn[1];
keys1[0] = new DataColumn();
keys1[0] = dtResult.Columns["StepID"];
dtResult.PrimaryKey = keys1;
//StepID 마다 가장 높은 버전 찾기
//SQL 수정으로 사용 X
//dtResult = RefineStepVersion(dtResult, data);
return dtResult;
}
public DataTable RefineStepVersion(DataTable dtTestlist, DetailTestDataCollection data)
{
var DuplicatedSteps = dtTestlist.AsEnumerable().GroupBy(x => x[eColTestlist.StepID.ToString()]).
Select(x => new { StepID = x.Key, Count = x.Count() }).Where(x => x.Count > 1);
foreach(var value in DuplicatedSteps)
{
List<DataRow> vdtRow = dtTestlist.AsEnumerable().Where(x => x[eColTestlist.StepID.ToString()].ToString() == value.StepID.ToString()).ToList();
DataRow vExcRow = vdtRow.Where(x => x[eColTestlist.StepVersion.ToString()].ToString() == data.StepVersion).FirstOrDefault();
if(vExcRow == null)
{
int nMaxVer = vdtRow.Max(x => Convert.ToInt32(x[eColTestlist.StepVersion.ToString()]));
vExcRow = vdtRow.Where(x => Convert.ToInt32(x[eColTestlist.StepVersion.ToString()]) == nMaxVer).FirstOrDefault();
}
vdtRow.Remove(vExcRow);
foreach (DataRow dtRow in vdtRow)
dtTestlist.Rows.Remove(dtRow);
}
return dtTestlist;
}
public DataTable SearchTestHistory(DetailTestDataCollection data)
{
if (NgHistorySelectView == eSelectDataView.DataDocumentViewC1)
{
ShortTermDBConn = DBControllers.GetShortTermConn1();
LongTermDBConn = DBControllers.GetLongTermConn1().Where(x => x.Key.Contains(data.StartTime.Year.ToString())).First().Value;
}
else if (NgHistorySelectView == eSelectDataView.DataDocumentViewC2)
{
ShortTermDBConn = DBControllers.GetShortTermConn2();
LongTermDBConn = DBControllers.GetLongTermConn2().Where(x => x.Key.Contains(data.StartTime.Year.ToString())).First().Value;
}
DataTable dtResult = new DataTable();
List<CPXV2Log.Tables.HIST_TestResult> list = new List<CPXV2Log.Tables.HIST_TestResult>();
StringBuilder strQuery = new StringBuilder();
if (data == null)
return dtResult;
strQuery.Append($"SELECT ");
strQuery.Append($"*");
strQuery.Append(" ");
strQuery.Append($"FROM {DMCommon.ResultLogTable} ");
strQuery.Append($"WITH(NOLOCK) ");
strQuery.Append($"WHERE No='{data.No}' ");
strQuery.Append(";");
if (DatabaseConnControl.ScanLongTermLog) SQLCmd = new SqlCommand(strQuery.ToString(), LongTermDBConn);
else SQLCmd = new SqlCommand(strQuery.ToString(), ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
if (dtResult.Rows.Count > 0)
{
var logData = dtResult.Rows[0]["LogData"].ToString();
var decompStr = logData.GzipDecompress();
list = JsonConvert.DeserializeObject<List<CPXV2Log.Tables.HIST_TestResult>>(decompStr);
dtResult = list.ToDataTable();
}
return dtResult;
}
DataTable GetRawResult(DetailTestDataCollection data)
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
if (data == null)
return dtResult;
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
}
}

View File

@ -0,0 +1,213 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.TRA.DataManager.DMOverview;
using static SystemX.Product.CP.TRA.Commons;
using DataBaseConnection.Control;
namespace SystemX.Product.TRA.DataManager
{
public class DMTestHistory
{
public enum eColList
{
No,
TestDateTime,
StationName,
Host,
Section,
ProductID,
ProductNo,
TestType,
TestCode,
ParentNo,
FileVersion,
FileCode,
StepVersion,
Duration,
TestResult,
//OK,
//NOK,
TestListFileNo,
TestListVariantNo,
TestlistFileName,
TestlistReqID
}
private SqlConnection DBConn { get; set; }
private SqlConnection ShortTermDBConn { get; set; }
private SqlConnection LongTermDBConn { get; set; }
private SqlCommand SQLCmd { get; set; }
IDataBaseController GetDBController;
public DMTestHistory(eSelectDataView SelectView, IDataBaseController getDBController)
{
GetDBController = getDBController;
DBConn = getDBController.GetMainConn();
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
ShortTermDBConn = getDBController.GetShortTermConn1();
LongTermDBConn = getDBController.GetLongTermConn1().First().Value;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
ShortTermDBConn = getDBController.GetShortTermConn2();
LongTermDBConn = getDBController.GetLongTermConn2().First().Value;
}
}
public DataTable SearchTestHistory(eSelectDataView SelectView, SelectedDataCollection data, TestHistorySearchOption option, int nReqIdPos = int.MaxValue)
{
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(data.StartTime.Year.ToString()))?.FirstOrDefault().Value;
if (LongTermDBConn == null)
{
LongTermDBConn = GetDBController.GetLongTermConn1().FirstOrDefault().Value;
}
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(data.StartTime.Year.ToString()))?.FirstOrDefault().Value;
if (LongTermDBConn == null)
{
LongTermDBConn = GetDBController.GetLongTermConn2().FirstOrDefault().Value;
}
}
DataTable dtResult = GetRawResult(data, option, nReqIdPos);
return dtResult;
}
DataTable GetRawResult(SelectedDataCollection data, TestHistorySearchOption option, int nReqIdPos = int.MaxValue)
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
DateTime dtCheckTime = DateTime.Now;
//데이터 검색 시작 시간 확인
if (option.Time_WholeRange)
dtCheckTime = data.SearchRangeStart;
else if (option.Time_SelectedTest)
dtCheckTime = data.StartTime;
else if (option.Time_Day)
dtCheckTime = data.StartTime;
DateTime dtNow = DateTime.Now;
int nDiffMonth = 12 * (dtNow.Year - dtCheckTime.Year) + (dtNow.Month - dtCheckTime.Month);
if (data == null)
return dtResult;
strQuery += $"SELECT ";
strQuery += $"{DMCommon.SummaryLogTable}.No,";
strQuery += $"CONVERT(char(20), {DMCommon.SummaryLogTable}.TestDT, 20) as {eColList.TestDateTime.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.StationName as {eColList.StationName.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.HostID as {eColList.Host.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.Section as {eColList.Section.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.ProductID as {eColList.ProductID.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.TestType as {eColList.TestType.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.ProdNo_C as {eColList.ProductNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.Testcode as {eColList.TestCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.ProdNo_P as {eColList.ParentNo.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.ProdCode as {eColList.FileCode.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.Version as {eColList.FileVersion.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.StepVersion as {eColList.StepVersion.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.Duration as {eColList.Duration.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.Result as {eColList.TestResult.ToString()},";
//strQuery += $"CASE WHEN {DMCommon.SummaryLogTable}.Result = 'OK' THEN 1 ELSE 0 END as {eColList.OK.ToString()},";
//strQuery += $"CASE WHEN {DMCommon.SummaryLogTable}.Result = '-' THEN 0 WHEN {DMCommon.SummaryLogTable}.Result != 'OK' THEN 1 ELSE 0 END as {eColList.NG.ToString()},";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListFileNo],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListVariantNo],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListFileName],";
strQuery += $"{DMCommon.SummaryLogTable}.[TestListCntID] as {eColList.TestlistReqID.ToString()}";
strQuery += " ";
strQuery += $"FROM {DMCommon.SummaryLogTable} ";
strQuery += $"WITH(NOLOCK) ";
if (option.Time_WholeRange)
strQuery += $"where TestDT >= '{data.SearchRangeStart.ToString("yyyy-MM-dd 00:00:00")}' and TestDT <= '{data.SearchRangeEnd.ToString("yyyy-MM-dd 23:59:59")}' ";
else if(option.Time_SelectedTest)
strQuery += $"where TestDT >= '{data.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}' and TestDT <= '{data.EndTime.ToString("yyyy-MM-dd HH:mm:ss")}' ";
else if(option.Time_Day)
strQuery += $"where TestDT >= '{data.StartTime.ToShortDateString()} 00:00:00' and TestDT <= '{data.EndTime.ToShortDateString()} 23:59:59' ";
if (option.Station && !string.IsNullOrWhiteSpace(data.StationName))
strQuery += $" and (StationName = '{data.StationName}' or StationName = '-') ";
if (option.Host && !string.IsNullOrWhiteSpace(data.HostID))
strQuery += $" and (HostID = '{data.HostID}' or HostID = '-') ";
if (option.Section && !string.IsNullOrWhiteSpace(data.SectionID))
strQuery += $" and (Section = '{data.SectionID}' or Section = '-') ";
if (option.TestType)
strQuery += $" and (TestType = '{data.TestType}' or TestType = '-') ";
if (option.ProductNo)
{
strQuery += $" and (ProdNo_C = '{data.ProductNo}' ";
if(option.Host && !string.IsNullOrWhiteSpace(data.HostID))
{
foreach(string strCmd in Enum.GetNames(typeof(eCommand)))
strQuery += $"or ProdNo_C = '{strCmd}'";
}
strQuery += $" )";
}
if (option.TestCode)
strQuery += $" and (Testcode = '{data.TestCode}' or Testcode = '-') ";
if (option.ParentNo)
strQuery += $" and (ProdNo_P = '{data.ParentNo}' or ProdNo_P = '-') ";
if (option.ProductionCode)
strQuery += $" and (ProdCode = '{data.ProductionCode}' or ProdCode = '-') ";
if (option.FileVersion)
strQuery += $" and (Version = '{data.FileVersion}' or Version = '-') ";
if (option.StepVersion)
strQuery += $" and (StepVersion = '{data.StepVersion}' or StepVersion = '-1') ";
if (option.Time_SelectedTest)
{
if(nReqIdPos == int.MaxValue)
strQuery += $" and (TestListCntID = '{data.TestRequestID[0]}' or TestListCntID = '-') ";
else
strQuery += $" and (TestListCntID = '{data.TestRequestID[nReqIdPos]}' or TestListCntID = '-') ";
}
//if (option.ShowRedundantData)
// strQuery += $" group by {DMCommon.SummaryLogTable}.ProductID ";
strQuery += " ";
strQuery += $"ORDER BY ";
strQuery += $"{DMCommon.SummaryLogTable}.TestDT";
strQuery += ";";
if (DatabaseConnControl.ScanLongTermLog) SQLCmd = new SqlCommand(strQuery, LongTermDBConn);
else SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
}
}

View File

@ -0,0 +1,281 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.CP.TRA;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.TRA.DataManager.DMOverview;
using static SystemX.Product.CP.TRA.Commons;
using DataBaseConnection.Control;
namespace SystemX.Product.TRA.DataManager
{
public class DMTestNgHistory
{
public enum eColList
{
No,
TestDateTime,
StationName,
Host,
Section,
ProductID,
ProductNo,
TestType,
TestCode,
ParentNo,
FileVersion,
FileCode,
StepVersion,
Duration,
TestResult,
//OK,
//NOK,
TestListFileNo,
TestListVariantNo,
TestlistFileName,
TestlistReqID
}
private SqlConnection DBConn { get; set; }
private SqlConnection ShortTermDBConn { get; set; }
private SqlConnection LongTermDBConn { get; set; }
private SqlCommand SQLCmd { get; set; }
private IDataBaseController DBControllers { get; set; }
public eSelectDataView NgHistorySelectView { get; set; }
public DMTestNgHistory(eSelectDataView SelectView, IDataBaseController getDBController, DateTime dtStart)
{
DBControllers = getDBController;
DBConn = getDBController.GetMainConn();
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
NgHistorySelectView = eSelectDataView.DataDocumentViewC1;
ShortTermDBConn = getDBController.GetShortTermConn1();
LongTermDBConn = getDBController.GetLongTermConn1().Where(x=>x.Key.Contains(dtStart.Year.ToString())).First().Value;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
NgHistorySelectView = eSelectDataView.DataDocumentViewC2;
ShortTermDBConn = getDBController.GetShortTermConn2();
LongTermDBConn = getDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtStart.Year.ToString())).First().Value;
}
}
public DataTable SearchTestNgHistory(SelectedDataCollection data, TestHistorySearchOption option, int nReqIdPos = int.MaxValue)
{
DataTable dtResult = GetRawResult(data, option, nReqIdPos);
return dtResult;
}
public int[] CheckTestListFileNo(string strProductNo, string strTestCode, string strTestType, string strFileVer, string strFileCode)
{
DataTable dtResult = new DataTable();
StringBuilder strQuery = new StringBuilder();
//string strQuery = string.Empty;
strQuery.Append($"SELECT A.ProdNo_C, B.ProdNo_P, B.UpdateDT, D.TestCode, D.Gate1, D.Gate2, E.FileName, A.RegUserComment, B.Description, C.GroupName, C.ModelName, A.VariantNo AS 'TestListNo', A.Config, E.TestType, E.Version, E.ProdCode, B.UseTLPosition, B.TestListFileNo, E.UpdateDT AS 'TestListFileUpdateDT', A.VariantNo FROM [PROD_Release] AS A WITH(NOLOCK) " +
$"INNER JOIN(SELECT * FROM [PROD_Variant] WITH(NOLOCK)) AS B ON A.VariantNo = B.No " +
$"INNER JOIN(SELECT * FROM [PROD_Group] WITH(NOLOCK)) AS C ON B.GroupNo = C.No " +
$"INNER JOIN(SELECT * FROM [STAT_TestCode] WITH(NOLOCK)) AS D ON A.TestCodeNo = D.No " +
$"INNER JOIN(SELECT * FROM [STOR_TestListFile] WITH(NOLOCK)) AS E ON B.TestListFileNo = E.No " +
$"WHERE A.ProdNo_C = '{strProductNo}' AND D.TestCode = '{strTestCode}' AND E.TestType = '{strTestType}' AND E.Version = '{strFileVer}' AND E.ProdCode = '{strFileCode}';");
SQLCmd = new SqlCommand(strQuery.ToString(), DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtCompReader = SQLCmd.ExecuteReader();
DataTable dtCompResult = new DataTable();
dtCompResult.Load(dtCompReader);
if (Commons.isHasRow(dtCompResult) == false)
return new int[] { int.MinValue, int.MinValue };
string strCompVariNo = dtCompResult.Rows[0]["VariantNo"].ToString();
string strCompFileNo = dtCompResult.Rows[0]["TestListFileNo"].ToString();
dtCompReader.Close();
return new int[] { int.Parse(strCompFileNo), int.Parse(strCompVariNo) };
}
public DataTable GetUseTestListInformation(int nTestListNo, int nUseStepVersion)
{
DataTable dtResult = new DataTable();
StringBuilder strQuery = new StringBuilder();
//string strQuery = string.Empty;
strQuery.Append($"SELECT * FROM ( " +
$"SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC) " +
$"AS RN FROM VRFY_TestListFileRelease WITH (NOLOCK, INDEX=[CSK_VRFY_Release_2]) WHERE TestListFileNo = {nTestListNo.ToString()} " +
$"AND StepVersion <= {nUseStepVersion.ToString()}) X WHERE RN = 1 ORDER BY X.StepID ASC;");
/*
strQuery.Append($"SELECT * FROM ( " +
$"SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC) " +
$"AS RN FROM VRFY_TestListFileRelease WITH (NOLOCK, INDEX=[CSK_VRFY_Release_2]) WHERE TestListFileNo = {nTestListNo.ToString()} " +
$"AND StepVersion <= {nUseStepVersion.ToString()}) X ORDER BY X.StepID ASC;");
*/
SQLCmd = new SqlCommand(strQuery.ToString(), DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
//PK 지정
DataColumn[] keys1 = new DataColumn[1];
keys1[0] = new DataColumn();
keys1[0] = dtResult.Columns["StepID"];
dtResult.PrimaryKey = keys1;
return dtResult;
}
DataTable GetRawResult(SelectedDataCollection data, TestHistorySearchOption option, int nReqIdPos = int.MaxValue)
{
if (NgHistorySelectView == eSelectDataView.DataDocumentViewC1)
{
ShortTermDBConn = DBControllers.GetShortTermConn1();
LongTermDBConn = DBControllers.GetLongTermConn1().Where(x => x.Key.Contains(data.SearchRangeStart.Year.ToString())).First().Value;
}
else if (NgHistorySelectView == eSelectDataView.DataDocumentViewC2)
{
ShortTermDBConn = DBControllers.GetShortTermConn2();
LongTermDBConn = DBControllers.GetLongTermConn2().Where(x => x.Key.Contains(data.SearchRangeStart.Year.ToString())).First().Value;
}
DataTable dtResult = new DataTable();
//string strQuery = string.Empty;
StringBuilder strQuery = new StringBuilder();
DateTime dtCheckTime = DateTime.Now;
//데이터 검색 시작 시간 확인
if (option.Time_WholeRange)
dtCheckTime = data.SearchRangeStart;
else if (option.Time_SelectedTest)
dtCheckTime = data.StartTime;
else if (option.Time_Day)
dtCheckTime = data.StartTime;
DateTime dtNow = DateTime.Now;
if (data == null)
return dtResult;
strQuery.Append($"SELECT ");
strQuery.Append($"{DMCommon.SummaryLogTable}.No,");
strQuery.Append($"CONVERT(char(20), {DMCommon.SummaryLogTable}.TestDT, 20) as {eColList.TestDateTime.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.StationName as {eColList.StationName.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.HostID as {eColList.Host.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.Section as {eColList.Section.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.ProductID as {eColList.ProductID.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.TestType as {eColList.TestType.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.ProdNo_C as {eColList.ProductNo.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.Testcode as {eColList.TestCode.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.ProdNo_P as {eColList.ParentNo.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.ProdCode as {eColList.FileCode.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.Version as {eColList.FileVersion.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.StepVersion as {eColList.StepVersion.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.Duration as {eColList.Duration.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.Result as {eColList.TestResult.ToString()},");
strQuery.Append($"{DMCommon.SummaryLogTable}.[TestListFileNo],");
strQuery.Append($"{DMCommon.SummaryLogTable}.[TestListVariantNo],");
strQuery.Append($"{DMCommon.SummaryLogTable}.[TestListFileName],");
strQuery.Append($"{DMCommon.SummaryLogTable}.[TestListCntID] as {eColList.TestlistReqID.ToString()}");
strQuery.Append(" ");
strQuery.Append($"FROM {DMCommon.SummaryLogTable} ");
strQuery.Append($"WITH(NOLOCK) ");
if (option.Time_WholeRange)
strQuery.Append($"WHERE TestDT >= '{data.SearchRangeStart.ToString("yyyy-MM-dd 00:00:00")}' AND TestDT <= '{data.SearchRangeEnd.ToString("yyyy-MM-dd 23:59:59")}' ");
else if(option.Time_SelectedTest)
strQuery.Append($"WHERE TestDT >= '{data.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}' AND TestDT <= '{data.EndTime.ToString("yyyy-MM-dd HH:mm:ss")}' ");
else if(option.Time_Day)
strQuery.Append($"WHERE TestDT >= '{data.StartTime.ToShortDateString()} 00:00:00' AND TestDT <= '{data.EndTime.ToShortDateString()} 23:59:59' ");
if (option.Station && !string.IsNullOrWhiteSpace(data.StationName))
strQuery.Append($" AND (StationName = '{data.StationName}' OR StationName = '-') ");
if (option.Host && !string.IsNullOrWhiteSpace(data.HostID))
strQuery.Append($" AND (HostID = '{data.HostID}' OR HostID = '-') ");
if (option.Section && !string.IsNullOrWhiteSpace(data.SectionID))
strQuery.Append($" AND (Section = '{data.SectionID}' OR Section = '-') ");
if (option.TestType)
strQuery.Append($" AND (TestType = '{data.TestType}' OR TestType = '-') ");
if (option.ProductNo)
{
strQuery.Append($" AND (ProdNo_C = '{data.ProductNo}' ");
if(option.Host && !string.IsNullOrWhiteSpace(data.HostID))
{
foreach(string strCmd in Enum.GetNames(typeof(eCommand)))
strQuery.Append($"OR ProdNo_C = '{strCmd}'");
}
strQuery.Append($" )");
}
if (option.TestCode)
strQuery.Append($" AND (Testcode = '{data.TestCode}' OR Testcode = '-') ");
if (option.ParentNo)
strQuery.Append($" AND (ProdNo_P = '{data.ParentNo}' OR ProdNo_P = '-') ");
if (option.ProductionCode)
strQuery.Append($" AND (ProdCode = '{data.ProductionCode}' OR ProdCode = '-') ");
if (option.FileVersion)
strQuery.Append($" AND (Version = '{data.FileVersion}' OR Version = '-') ");
if (option.StepVersion)
strQuery.Append($" AND (StepVersion = '{data.StepVersion}' OR StepVersion = '-1') ");
if (option.Time_SelectedTest)
{
if (nReqIdPos == int.MaxValue)
strQuery.Append($" AND (TestListCntID = '{data.TestRequestID[0]}' OR TestListCntID = '-') ");
else
strQuery.Append($" AND (TestListCntID = '{data.TestRequestID[nReqIdPos]}' OR TestListCntID = '-') ");
}
// strQuery.Append($" AND (Result = 'NG' OR Result = 'SYSTEM_ERROR' OR Result = 'STOP') ";
strQuery.Append($" AND (Result != 'OK') ");
strQuery.Append(" ");
strQuery.Append($"ORDER BY ");
strQuery.Append($"{DMCommon.SummaryLogTable}.TestDT");
strQuery.Append(";");
var query = strQuery.ToString();
if (DatabaseConnControl.ScanLongTermLog) SQLCmd = new SqlCommand(strQuery.ToString(), LongTermDBConn);
else SQLCmd = new SqlCommand(strQuery.ToString(), ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
}
}

View File

@ -0,0 +1,447 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.Interface;
using SystemX.Product.CP.TRA;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.TRA.DataManager.DMOverview;
using static SystemX.Product.CP.TRA.Commons;
using DataBaseConnection.Control;
using Newtonsoft.Json;
using SystemX.Common.Util;
using CPXV2Log = SystemX.Net.Platform.SystemX.Net.XEFCore.DBContext.CPXV2Log;
namespace SystemX.Product.TRA.DataManager
{
public class DMTestSummary
{
public enum eColHideListLog
{
No,
//TestID
}
public enum eColTestLog
{
No,
//TestID,
StepID,
MeasVal,
MeasValStr,
Message,
GlobalMin,
GlobalMax,
Result
//Duration
}
public enum eColHideListTL
{
No,
TestlistNo,
StepVersion,
Enable,
IsGlobal,
UpdateDT
}
public enum eColTestlist
{
No,
TestlistNo,
StepID,
Variant,
Gate,
Activate,
StepVersion,
Enable,
Position,
StepDesc,
UseFunction,
SpecMin,
SpecMax,
Dim,
IsGlobal,
UpdateDT
}
public enum eColTestSummary
{
StepID,
Average,
Total,
OK,
NG //NOK
}
public SqlConnection DBConn { get; private set; }
public SqlConnection ShortTermDBConn { get; private set; }
public SqlConnection LongTermDBConn { get; private set; }
private SqlCommand SQLCmd { get; set; }
public DataTable dtHistVersionTL;
eSelectDataView TestSummarySelectView { get; set; }
IDataBaseController GetDBController;
public int nCurrentTLMaxStepVersion { get; set; }
//public DataTable this[int i] => dtEachVersionTL[i];
public DMTestSummary(eSelectDataView SelectView, IDataBaseController getDBController, DateTime dtStart)
{
GetDBController = getDBController;
DBConn = getDBController.GetMainConn();
if (SelectView == eSelectDataView.DataDocumentViewC1)
{
TestSummarySelectView = eSelectDataView.DataDocumentViewC1;
ShortTermDBConn = getDBController.GetShortTermConn1();
LongTermDBConn = getDBController.GetLongTermConn1().Where(x=>x.Key.Contains(dtStart.Year.ToString())).First().Value;
}
else if (SelectView == eSelectDataView.DataDocumentViewC2)
{
TestSummarySelectView = eSelectDataView.DataDocumentViewC2;
ShortTermDBConn = getDBController.GetShortTermConn2();
LongTermDBConn = getDBController.GetLongTermConn2().Where(x => x.Key.Contains(dtStart.Year.ToString())).First().Value;
}
}
public DataTable SearchTestlist(SelectedDataCollection data, int nHistChkStepVer = int.MinValue, bool bOnlyNewStepVersion = true)
{
DataTable dtResult = new DataTable();
DataTable dtResultChk = new DataTable();
string strQuery = string.Empty;
if (data == null)
return dtResult;
strQuery = $"SELECT A.ProdNo_C, B.ProdNo_P, B.UpdateDT, D.TestCode, D.Gate1, D.Gate2, E.FileName, A.RegUserComment, B.Description, C.GroupName, C.ModelName, A.VariantNo AS 'TestListNo', A.Config, E.TestType, E.Version, E.ProdCode, B.UseTLPosition, B.TestListFileNo, E.UpdateDT AS 'TestListFileUpdateDT', A.VariantNo FROM [PROD_Release] AS A WITH(NOLOCK) " +
$"INNER JOIN(SELECT * FROM [PROD_Variant] WITH(NOLOCK)) AS B ON A.VariantNo = B.No " +
$"INNER JOIN(SELECT * FROM [PROD_Group] WITH(NOLOCK)) AS C ON B.GroupNo = C.No " +
$"INNER JOIN(SELECT * FROM [STAT_TestCode] WITH(NOLOCK)) AS D ON A.TestCodeNo = D.No " +
$"INNER JOIN(SELECT * FROM [STOR_TestListFile] WITH(NOLOCK)) AS E ON B.TestListFileNo = E.No " +
$"WHERE A.ProdNo_C = '{data.ProductNo}' AND D.TestCode = '{data.TestCode}' AND E.TestType = '{data.TestType}' AND E.Version = '{data.FileVersion}' AND E.ProdCode = '{data.ProductionCode}';";
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtCompReader = SQLCmd.ExecuteReader();
DataTable dtCompResult = new DataTable();
dtCompResult.Load(dtCompReader);
if (Commons.isHasRow(dtCompResult) == false)
return dtResult;
string strCompVariNo = dtCompResult.Rows[0]["VariantNo"].ToString();
string strCompFileNo = dtCompResult.Rows[0]["TestListFileNo"].ToString();
dtCompReader.Close();
string strGetTestListFileNo = string.Empty;
if (strCompVariNo.CompareTo(data.TestListVariantNo) == 0 &&
strCompFileNo.CompareTo(data.TestListFileNo) == 0)
strGetTestListFileNo = data.TestListFileNo;
else
strGetTestListFileNo = strCompFileNo;
strQuery = $"SELECT LatestStepVersion FROM [HIST_TestListFileLatestStepVersion] WITH(NOLOCK) WHERE TestListFileNo = {strGetTestListFileNo};";
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReaderChk = SQLCmd.ExecuteReader();
dtResultChk.Clear();
dtResultChk.Load(dtReaderChk);
int nMaxStepVersion = Convert.ToInt32(dtResultChk.Rows[0]["LatestStepVersion"].ToString());
nCurrentTLMaxStepVersion = nMaxStepVersion;
dtReaderChk.Close();
//항상 최신 스텝 버전을 체크
strQuery = $"SELECT * FROM ( " +
$"SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC) " +
$"AS RN FROM VRFY_TestListFileRelease WITH (NOLOCK, INDEX=[CSK_VRFY_Release_2]) WHERE TestListFileNo = {strGetTestListFileNo}) AS X " +
$"WHERE X.RN = 1 ORDER BY X.StepID ASC;";
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Clear();
dtResult.Load(dtReader);
dtReader.Close();
if (bOnlyNewStepVersion)
{
dtHistVersionTL = null;
}
else
{
//Hist 목록 검색 스텝 버전 리스트만 검색하여 사용
dtHistVersionTL = new DataTable();
strQuery = $"SELECT * FROM ( " +
$"SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC) " +
$"AS RN FROM VRFY_TestListFileRelease WITH (NOLOCK, INDEX=[CSK_VRFY_Release_2]) WHERE TestListFileNo = {strGetTestListFileNo} AND StepVersion <= {nHistChkStepVer}) AS X " +
$"WHERE X.RN = 1 ORDER BY X.StepID ASC, StepVersion DESC;";
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtHistReader = SQLCmd.ExecuteReader();
dtHistVersionTL.Clear();
dtHistVersionTL.Load(dtHistReader);
dtHistReader.Close();
//PK 키 지정 >
//TODO : Primary Key Access Error > 업데이트 된 동일 스텝이 존재시 PK 지정 실패
DataColumn[] keysHistStepVer = new DataColumn[1];
keysHistStepVer[0] = new DataColumn();
keysHistStepVer[0] = dtHistVersionTL.Columns["StepID"];
dtHistVersionTL.PrimaryKey = keysHistStepVer;
/*
dtEachVersionTL = new DataTable[nMaxStepVersion + 1];
int nStartStepVer = nMaxStepVersion - 5;
if (nStartStepVer < 0)
nStartStepVer = 0;
for (int i = nStartStepVer; i <= nMaxStepVersion; i++)
{
dtEachVersionTL[i] = new DataTable();
strQuery = $"SELECT * FROM ( " +
$"SELECT *, ROW_NUMBER() OVER(PARTITION BY StepID ORDER BY StepVersion DESC) " +
$"AS RN FROM VRFY_TestListFileRelease WITH (NOLOCK, INDEX=[CSK_VRFY_Release_2]) WHERE TestListFileNo = {strGetTestListFileNo} AND StepVersion <= {i}) AS X " +
$"WHERE X.RN = 1 ORDER BY X.StepID ASC, StepVersion DESC;";
SQLCmd = new SqlCommand(strQuery, DBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtEachVersionTL[i].Clear();
dtEachVersionTL[i].Load(dtReader);
dtReader.Close();
//PK 키 지정 >
//TODO : Primary Key Access Error > 업데이트 된 동일 스텝이 존재시 PK 지정 실패
DataColumn[] keysEachStepVer = new DataColumn[1];
keysEachStepVer[0] = new DataColumn();
keysEachStepVer[0] = dtEachVersionTL[i].Columns["StepID"];
dtEachVersionTL[i].PrimaryKey = keysEachStepVer;
}
*/
}
//PK 키 지정
DataColumn[] keys1 = new DataColumn[1];
keys1[0] = new DataColumn();
keys1[0] = dtResult.Columns["StepID"];
dtResult.PrimaryKey = keys1;
return dtResult;
}
public DataTable RefineStepVersion(DataTable dtTestlist, SelectedDataCollection data)
{
var DuplicatedSteps = dtTestlist.AsEnumerable().GroupBy(x => x[eColTestlist.StepID.ToString()]).
Select(x => new { StepID = x.Key, Count = x.Count() }).Where(x => x.Count > 1);
foreach(var value in DuplicatedSteps)
{
List<DataRow> vdtRow = dtTestlist.AsEnumerable().Where(x => x[eColTestlist.StepID.ToString()].ToString() == value.StepID.ToString()).ToList();
DataRow vExcRow = vdtRow.Where(x => x[eColTestlist.StepVersion.ToString()].ToString() == data.StepVersion).FirstOrDefault();
if(vExcRow == null)
{
int nMaxVer = vdtRow.Max(x => Convert.ToInt32(x[eColTestlist.StepVersion.ToString()]));
vExcRow = vdtRow.Where(x => Convert.ToInt32(x[eColTestlist.StepVersion.ToString()]) == nMaxVer).FirstOrDefault();
}
vdtRow.Remove(vExcRow);
foreach (DataRow dtRow in vdtRow)
dtTestlist.Rows.Remove(dtRow);
}
return dtTestlist;
}
public DataTable SearchTestSummary(string[] testReqID, List<Int64> vnpSummaryNo)
{
DateTime start = DateTime.Now;
try
{
string requId = testReqID?.First();
if (string.IsNullOrEmpty(requId) == false && requId.Contains(";") == true || requId.Contains("@") == true)
{
start = Convert.ToDateTime(requId.Split(';', '@')[0]);
}
}
catch (Exception e)
{
//start = DateTime
}
//string strGetDataTime = testReqID?.First().Split(';')[0];
//int nGetDataTimeYYYY = Convert.ToInt32(strGetDataTime.Substring(0, 4));
//int nGetDataTimemm = Convert.ToInt32(strGetDataTime.Substring(4, 2));
//int nGetDataTimeDD = Convert.ToInt32(strGetDataTime.Substring(6, 2));
//int nGetDataTimeHH = Convert.ToInt32(strGetDataTime.Substring(8, 2));
//int nGetDataTimeMM = Convert.ToInt32(strGetDataTime.Substring(10, 2));
//int nGetDataTimeSS = Convert.ToInt32(strGetDataTime.Substring(12, 2));
//int nGetDataTimeFFF = Convert.ToInt32(strGetDataTime.Substring(14, 3));
//DateTime start = new DateTime(nGetDataTimeYYYY, nGetDataTimemm, nGetDataTimeDD, nGetDataTimeHH, nGetDataTimeMM, nGetDataTimeSS, nGetDataTimeFFF);//Convert.ToDateTime(testReqID?.First().Split('@')[0]);
if (TestSummarySelectView == eSelectDataView.DataDocumentViewC1)
{
ShortTermDBConn = GetDBController.GetShortTermConn1();
LongTermDBConn = GetDBController.GetLongTermConn1().Where(x => x.Key.Contains(start.Year.ToString())).First().Value;
}
else if (TestSummarySelectView == eSelectDataView.DataDocumentViewC2)
{
ShortTermDBConn = GetDBController.GetShortTermConn2();
LongTermDBConn = GetDBController.GetLongTermConn2().Where(x => x.Key.Contains(start.Year.ToString())).First().Value;
}
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
strQuery += $"SELECT * ";
strQuery += $"FROM {DMCommon.SummaryLogTable} AS X ";
strQuery += $"INNER JOIN {DMCommon.ResultLogTable} AS Y ON X.No = Y.No ";
strQuery += $"WHERE ";
for (int i = 0; i < vnpSummaryNo.Count; i++)
{
strQuery += $"X.[No]=N'{vnpSummaryNo[i]}' ";
if (i != vnpSummaryNo.Count - 1)
strQuery += "OR ";
}
//for(int i=0 ; i<testReqID.Length ; i++)
//{
// strQuery += $"TestListCntID=N'{testReqID[i]}' ";
// if (i != testReqID.Length - 1)
// strQuery += "OR ";
//}
strQuery += $";";
if (DatabaseConnControl.ScanLongTermLog) SQLCmd = new SqlCommand(strQuery, LongTermDBConn);
else SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
List<CPXV2Log.Tables.HIST_TestResult> list = new List<CPXV2Log.Tables.HIST_TestResult>();
for (int i=0; i<dtResult.Rows.Count; i++)
{
list.AddRange(JsonConvert.DeserializeObject<List<CPXV2Log.Tables.HIST_TestResult>>(dtResult.Rows[i]["LogData"].ToString().GzipDecompress()));
}
/*
strQuery += $"SELECT ";
strQuery += $"Y.[StepID], ";
strQuery += $"AVG(CASE WHEN (Y.[MeasValStr] = NULL OR Y.[MeasValStr] = '') AND (Y.[Message] = NULL OR Y.[Message] = '') AND (Y.[MeasVal] != 0.00000 AND Y.[Result] != 'NONE') THEN Y.[MeasVal] ELSE NULL END) AS Average, ";
strQuery += $"COUNT(Y.[Result]) AS Total, ";
strQuery += $"COUNT(CASE WHEN Y.[Result] = 'OK' THEN 1 END) AS OK, ";
strQuery += $"COUNT(CASE WHEN Y.[Result] = 'NG' OR X.[Result] = 'ERROR' THEN 1 END) AS NG ";
strQuery += $" ";
strQuery += $"FROM [{DMCommon.SummaryLogTable}] AS X WITH(NOLOCK) ";
strQuery += $"INNER JOIN [{strTableTerm}] AS Y WITH(NOLOCK) ON (Y.AccessKey BETWEEN X.AccessStart AND X.AccessEnd) ";
*/
dtResult = list.GroupBy(x => x.StepID).Select(y => new
{
StepID = y.First().StepID,
Average = GetAvg(y.ToList()),
Total = y.Count(),
OK = y.Count(z => !z.Result.Contains("NG") && !z.Result.Contains("ERROR")),
NG = y.Count() - y.Count(z => !z.Result.Contains("NG") && !z.Result.Contains("ERROR"))
}).OrderBy(y => y.StepID).ToDataTable();
return dtResult;
}
string GetAvg(List<CPXV2Log.Tables.HIST_TestResult> res)
{
CPXV2Log.Tables.HIST_TestResult value = res.First();
if (string.IsNullOrEmpty(value.MeasValStr) &&
string.IsNullOrEmpty(value.Message) &&
((value.MeasVal != 0) &&
string.Compare(value.Result, "NONE") != 0))
return res.Average(x => x.MeasVal).ToString();
string strDefaultValue = string.Empty;
if (string.IsNullOrEmpty(value.MeasValStr) == false)
strDefaultValue = value.MeasValStr;
else if (string.IsNullOrEmpty(value.Message) == false)
strDefaultValue = value.Message;
return strDefaultValue;
}
DataTable GetRawResult(DetailTestDataCollection data)
{
DataTable dtResult = new DataTable();
string strQuery = string.Empty;
if (data == null)
return dtResult;
SQLCmd = new SqlCommand(strQuery, ShortTermDBConn);
SQLCmd.CommandTimeout = DMCommon.nDefaultScanTime;
DbDataReader dtReader = SQLCmd.ExecuteReader();
dtResult.Load(dtReader);
dtReader.Close();
return dtResult;
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.TRA.UIControl;
using static SystemX.Product.ALIS.UI.View.ViewCfg;
namespace SystemX.Product.ALIS.Interface
{
public interface IChildController
{
void SetOverview();
void SetDetailOverview();
void SetHistoryView();
void SetSummaryView();
void CallDetailOverView();
void AnnounceContentsType(eContents GetType);
bool GetOverviewMergeState();
SelectedDataCollection GetSelectDataOverView(int nDataValue = int.MaxValue);
void SetNgHistView(eContents GetCallType);
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.ALIS.Interface
{
interface IChildSubscribe
{
void setLoginStateNotice(LoginAccessLevel CurrentAccessLevel, bool bLoginState);
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.UI;
using static SystemX.Product.CP.TRA.MainForm;
namespace SystemX.Product.ALIS.Interface
{
public interface IDataBaseController
{
SqlConnection GetMainConn();
SqlConnection GetShortTermConn1();
Dictionary<string, SqlConnection> GetLongTermConn1();
SqlConnection GetShortTermConn2();
Dictionary<string, SqlConnection> GetLongTermConn2();
}
}

View File

@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemX.Product.ALIS.UI;
using static SystemX.Product.CP.TRA.MainForm;
namespace SystemX.Product.ALIS.Interface
{
public enum eDbTableList
{
NONE,
STAT_Host,
STAT_User,
STAT_TestCode,
PROD_Group,
PROD_TestList,
PROD_Release,
VRFY_Release,
HIST_LatestStepVersion,
HIST_LatestAccessKey,
HIST_Summary,
HIST_TestList,
HIST_TestResult,
HIST_TestResultShrotTerm,
HIST_TestResultLongTerm
}
public interface IDataController
{
SqlCommand GetConnSqlCmd();
bool GetDuplicateCheck(string strTableName, string strFieldName, string strValue);
UserInfo GetLoginInfo();
//TODO : DB CONTROL
DataTable GetTable(string strQueryText);
DataTable GetTable(eDbTableList tblName);
DataTable GetTable(eDbTableList tblName, string strColName, string strParameter);
string GetServerDateTimeString();
DateTime GetServerDateTime();
string SetConvertDateTime(string strGetConvertText);
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.ALIS.Interface
{
interface IUserControlSubscribe
{
void setLoginStateNotice(LoginAccessLevel CurrentAccessLevel, bool bLoginState);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
DEFAULT
HEX
BIN
STR
STRING
STRCMP
ASCII

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using DevExpress.UserSkins;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using SystemX.Product.TRA;
namespace SystemX.Product.CP.TRA
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SystemX.Product.CP.ALIS_Analysis")]
[assembly: AssemblyDescription("SystemX")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SystemX")]
[assembly: AssemblyProduct("SystemX.Product.CP.ALIS_Analysis")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("CP-ServerX")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9006f149-aa49-4b8e-ba69-386d945fa738")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("20.22.11.29")]
[assembly: AssemblyFileVersion("20.22.11.29")]

View File

@ -0,0 +1,173 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 도구를 사용하여 생성되었습니다.
// 런타임 버전:4.0.30319.42000
//
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
// 이러한 변경 내용이 손실됩니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SystemX.Product.TRA.Properties {
using System;
/// <summary>
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
/// </summary>
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
// 클래스에서 자동으로 생성되었습니다.
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을
// 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SystemX.Product.TRA.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
/// 재정의합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap ExplodedPie3D_16x16 {
get {
object obj = ResourceManager.GetObject("ExplodedPie3D_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap Find_16x16 {
get {
object obj = ResourceManager.GetObject("Find_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap Find2_16x16 {
get {
object obj = ResourceManager.GetObject("Find2_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap HistoryItem_16x16 {
get {
object obj = ResourceManager.GetObject("HistoryItem_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap IpAddress {
get {
object obj = ResourceManager.GetObject("IpAddress", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap Kefico_CI {
get {
object obj = ResourceManager.GetObject("Kefico_CI", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap Linear_16x16 {
get {
object obj = ResourceManager.GetObject("Linear_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap ModelEditor_DetailView {
get {
object obj = ResourceManager.GetObject("ModelEditor_DetailView", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap Password {
get {
object obj = ResourceManager.GetObject("Password", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap UpdateField_16x16 {
get {
object obj = ResourceManager.GetObject("UpdateField_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap UpdateTableOfContents_16x16 {
get {
object obj = ResourceManager.GetObject("UpdateTableOfContents_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,154 @@
<?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>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="UpdateTableOfContents_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UpdateTableOfContents_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Password" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Password.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Linear_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Linear_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="HistoryItem_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\HistoryItem_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Kefico_CI" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Kefico CI.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IpAddress" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IpAddress.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UpdateField_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UpdateField_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Find_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Find_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ModelEditor_DetailView" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ModelEditor_DetailView.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ExplodedPie3D_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ExplodedPie3D_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Find2_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Find2_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -0,0 +1,38 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 도구를 사용하여 생성되었습니다.
// 런타임 버전:4.0.30319.42000
//
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
// 이러한 변경 내용이 손실됩니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SystemX.Product.TRA.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Coffee")]
public string ApplicationThemeName {
get {
return ((string)(this["ApplicationThemeName"]));
}
set {
this["ApplicationThemeName"] = value;
}
}
}
}

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="SystemX.Product.TRA.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ApplicationThemeName" Type="System.String" Scope="User">
<Value Profile="(Default)">Coffee</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -0,0 +1,16 @@
DevExpress.Patch.InMemoryPatch, DevExpress.Patch.Common, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7fc7bfca2443de66
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemProgressBar, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraCharts.ChartControl, DevExpress.XtraCharts.v20.2.UI, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraVerticalGrid.VGridControl, DevExpress.XtraVerticalGrid.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemDateEdit, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

View File

@ -0,0 +1,340 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using SystemX.Net.Platform.Common.ExtensionMethods;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.CP.TRA
{
public class AccessLevelAlarm : EventArgs
{
public AccessLevelAlarm(LoginAccessLevel CurrentAccessLevel, bool bLoginState)
{
this.CurrentLevel = CurrentAccessLevel;
this.GetLoginState = bLoginState;
}
public LoginAccessLevel CurrentLevel { get; private set; }
public bool GetLoginState { get; private set; }
}
public static class Commons
{
static public bool DEBUG_MODE = false;
[Flags]
public enum LoginAccessLevel
{
None = 0x01,
Basic = 0x02,
Admin = 0x04
}
public enum eSelectDataView
{
DataDocumentViewC1 = 0,
DataDocumentViewC2
}
public enum eOverviewModelNameInfo
{
L = 0,
P1,
P2
}
public static bool isHasRow(DataSet ds)
{
return (ds != null) ? ds.Tables.Cast<DataTable>().Any(table => table.Rows.Count != 0) : false;
}
public static bool isHasRow(DataTable dt)
{
return (dt != null) ? dt.Rows.Count > 0 : false;
}
public static bool IsValidEmail(string email)
{
bool valid = Regex.IsMatch(email, @"[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?");
return valid;
}
public static bool CheckGateLetter(char letter)
{
Regex engRegex = new Regex(@"[A-Z]");
return engRegex.IsMatch(letter.ToString());
}
public static byte[] ConvertHexStringToByte(string convertString)
{
byte[] convertArr = new byte[convertString.Length / 2];
for (int i = 0; i < convertArr.Length; i++)
{
convertArr[i] = Convert.ToByte(convertString.Substring(i * 2, 2), 16);
}
return convertArr;
}
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int memcmp(byte[] b1, byte[] b2, long count);
public static bool ByteArrayCompare(byte[] b1, byte[] b2)
{
if (b1 == null || b2 == null)
return false;
// Validate buffers are the same length.
// This also ensures that the count does not exceed the length of either buffer.
return b1.Length == b2.Length && memcmp(b1, b2, b1.Length) == 0;
}
public static T ConvertTextToTryValue<T>(string strText, object objFailValue)
{
object obj;
obj = typeof(T);
int iGetValue = 0;
uint uiGetValue = 0;
double dGetValue = 0;
if (obj.ToString().IndexOf("Int") >= 0)
{
if (!int.TryParse(strText, out iGetValue))
obj = objFailValue;
else
obj = iGetValue;
}
if (obj.ToString().IndexOf("UInt") >= 0)
{
if (!uint.TryParse(strText, out uiGetValue))
obj = objFailValue;
else
obj = uiGetValue;
}
else if (obj.ToString().IndexOf("Double") >= 0)
{
if (!double.TryParse(strText, out dGetValue))
obj = objFailValue;
else
obj = dGetValue;
}
return (T)Convert.ChangeType(obj, typeof(T));
}
public class INICtrl
{
public static int MAX_INFORMATION = 10;
protected static int FILE_ATTRIBUTE_HIDDEN = 2;
[DllImport("kernel32")]
protected static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
protected static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
[DllImport("kernel32")]
protected static extern int SetFileAttributes(string lpFileName, int dwFileAttributes);
public virtual void SetValue(string Section, string Key, string Value, string path = "")
{
WritePrivateProfileString(Section, Key, Value, path);
}
public virtual string GetValue(string Section, string Key, string Default, string path = "")
{
StringBuilder temp = new StringBuilder(255);
int i = GetPrivateProfileString(Section, Key, Default, temp, 255, path);
if (temp != null && temp.Length > 0) return temp.ToString();
else return Default;
}
}
public class ConnectInfoINICtrl : INICtrl
{
private static string ConnectHistoryINIPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\ConnectConfig_TRA_CPXV2.ini";
public ConnectInfoINICtrl()
{
if (File.Exists(ConnectHistoryINIPath) == false)
{
using (File.Create(ConnectHistoryINIPath)) { }
SetFileAttributes(ConnectHistoryINIPath, FILE_ATTRIBUTE_HIDDEN);
SetValue("LastestConnect", "Info", "");
}
}
public string GetUserTheme()
{
return GetValue("UserSelectTheme", "ThemeName", "Basic");
}
public void SetUserTheme(string strThemeName)
{
SetValue("UserSelectTheme", "ThemeName", strThemeName);
}
public void SetLastestConnectInfo(string strSuccessInfo1, string strSuccessInfo2, string strSuccessInfo3,
bool bCheckedInfo, int nOverInfoC1, int nOverInfoC2)
{
string strSetUpperText = strSuccessInfo1.ToUpper();
string[] strInfoSet = null;
int? findIdx = null;
if (strSuccessInfo1.CompareTo("") == 0 ||
strSuccessInfo1.CompareTo("127.0.0.1") == 0 ||
strSetUpperText.CompareTo("LOCALHOST") == 0 ||
strSuccessInfo1.IndexOf("If you do not enter the ip, will be connected to the local area.") >= 0)
{
;//
}
else
{
SetValue("LastestConnect", "Info1", strSuccessInfo1);
strInfoSet = new string[MAX_INFORMATION];
for (int i = 0; i < MAX_INFORMATION; i++)
strInfoSet[i] = GetValue("HistoryConnect" + i.ToString(), "Info1", "");
findIdx = strInfoSet.FindIndex(x => x == strSuccessInfo1);
if (findIdx == null)
{
for (int i = MAX_INFORMATION - 1; i > 0; i--)
{
if (i > 0)
strInfoSet[i] = strInfoSet[i - 1];
}
strInfoSet[0] = strSuccessInfo1;
for (int i = 0; i < MAX_INFORMATION; i++)
SetValue("HistoryConnect" + i.ToString(), "Info1", strInfoSet[i]);
}
}
//
strSetUpperText = strSuccessInfo2.ToUpper();
if (strSuccessInfo2.CompareTo("") == 0 ||
strSuccessInfo2.CompareTo("127.0.0.1") == 0 ||
strSetUpperText.CompareTo("LOCALHOST") == 0 ||
strSuccessInfo2.IndexOf("If you do not enter the ip, will be connected to the local area.") >= 0)
{
;//
}
else
{
SetValue("LastestConnect", "Info2", strSuccessInfo2);
strInfoSet = new string[MAX_INFORMATION];
for (int i = 0; i < MAX_INFORMATION; i++)
strInfoSet[i] = GetValue("HistoryConnect" + i.ToString(), "Info2", "");
findIdx = strInfoSet.FindIndex(x => x == strSuccessInfo2);
if (findIdx == null)
{
for (int i = MAX_INFORMATION - 1; i > 0; i--)
{
if (i > 0)
strInfoSet[i] = strInfoSet[i - 1];
}
strInfoSet[0] = strSuccessInfo2;
for (int i = 0; i < MAX_INFORMATION; i++)
SetValue("HistoryConnect" + i.ToString(), "Info2", strInfoSet[i]);
}
}
//
if (bCheckedInfo)
SetValue("LastestConnect", "UseDataServer2", "True");
else
SetValue("LastestConnect", "UseDataServer2", "False");
//
SetValue("LastestConnect", "OverviewModelInfoC1", nOverInfoC1.ToString());
SetValue("LastestConnect", "OverviewModelInfoC2", nOverInfoC2.ToString());
//
if (bCheckedInfo == false)
{
;//
}
else
{
strSetUpperText = strSuccessInfo3.ToUpper();
if (strSuccessInfo3.CompareTo("") == 0 ||
strSuccessInfo3.CompareTo("127.0.0.1") == 0 ||
strSetUpperText.CompareTo("LOCALHOST") == 0 ||
strSuccessInfo3.IndexOf("If you do not enter the ip, will be connected to the local area.") >= 0)
{
;//
}
else
{
SetValue("LastestConnect", "Info3", strSuccessInfo3);
strInfoSet = new string[MAX_INFORMATION];
for (int i = 0; i < MAX_INFORMATION; i++)
strInfoSet[i] = GetValue("HistoryConnect" + i.ToString(), "Info3", "");
findIdx = strInfoSet.FindIndex(x => x == strSuccessInfo3);
if (findIdx == null)
{
for (int i = MAX_INFORMATION - 1; i > 0; i--)
{
if (i > 0)
strInfoSet[i] = strInfoSet[i - 1];
}
strInfoSet[0] = strSuccessInfo3;
for (int i = 0; i < MAX_INFORMATION; i++)
SetValue("HistoryConnect" + i.ToString(), "Info3", strInfoSet[i]);
}
}
}
}
public override void SetValue(string Section, string Key, string Value, string path = "")
{
if (path.Length <= 0)
path = ConnectHistoryINIPath;
WritePrivateProfileString(Section, Key, Value, path);
}
public override string GetValue(string Section, string Key, string Default, string path = "")
{
if (path.Length <= 0)
path = ConnectHistoryINIPath;
StringBuilder temp = new StringBuilder(255);
int i = GetPrivateProfileString(Section, Key, Default, temp, 255, path);
if (temp != null && temp.Length > 0) return temp.ToString();
else return Default;
}
}
}
}

View File

@ -0,0 +1,390 @@

namespace SystemX.Product.ALIS.UI.Subs
{
partial class ConnectForm
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConnectForm));
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.simpleButtonOK = new DevExpress.XtraEditors.SimpleButton();
this.panel1 = new System.Windows.Forms.Panel();
this.simpleButtonReset = new DevExpress.XtraEditors.SimpleButton();
this.panel2 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.maskedTextBoxTLIP = new DevExpress.XtraEditors.ComboBoxEdit();
this.panel4 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.maskedTextBoxDT1IP = new DevExpress.XtraEditors.ComboBoxEdit();
this.panel6 = new System.Windows.Forms.Panel();
this.comboBoxOverviewModel1 = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.panel7 = new System.Windows.Forms.Panel();
this.maskedTextBoxDT2IP = new DevExpress.XtraEditors.ComboBoxEdit();
this.panel8 = new System.Windows.Forms.Panel();
this.comboBoxOverviewModel2 = new System.Windows.Forms.ComboBox();
this.checkBoxUseDT2 = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxTLIP.Properties)).BeginInit();
this.panel4.SuspendLayout();
this.panel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxDT1IP.Properties)).BeginInit();
this.panel6.SuspendLayout();
this.panel7.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxDT2IP.Properties)).BeginInit();
this.panel8.SuspendLayout();
this.SuspendLayout();
//
// labelControl1
//
this.labelControl1.Appearance.BackColor = System.Drawing.Color.Transparent;
this.labelControl1.Appearance.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelControl1.Appearance.ForeColor = System.Drawing.Color.Black;
this.labelControl1.Appearance.Options.UseBackColor = true;
this.labelControl1.Appearance.Options.UseFont = true;
this.labelControl1.Appearance.Options.UseForeColor = true;
this.labelControl1.AutoEllipsis = true;
this.labelControl1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.labelControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.labelControl1.Location = new System.Drawing.Point(0, 0);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(366, 36);
this.labelControl1.TabIndex = 2;
this.labelControl1.Text = "Input - Access information";
//
// simpleButtonOK
//
this.simpleButtonOK.Appearance.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
this.simpleButtonOK.Appearance.Options.UseFont = true;
this.simpleButtonOK.Dock = System.Windows.Forms.DockStyle.Right;
this.simpleButtonOK.Location = new System.Drawing.Point(1071, 0);
this.simpleButtonOK.Name = "simpleButtonOK";
this.simpleButtonOK.Size = new System.Drawing.Size(66, 64);
this.simpleButtonOK.TabIndex = 4;
this.simpleButtonOK.Text = "OK";
this.simpleButtonOK.Click += new System.EventHandler(this.simpleButtonOK_Click);
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Controls.Add(this.simpleButtonReset);
this.panel1.Controls.Add(this.simpleButtonOK);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 396);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1137, 64);
this.panel1.TabIndex = 5;
//
// simpleButtonReset
//
this.simpleButtonReset.Appearance.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
this.simpleButtonReset.Appearance.Options.UseFont = true;
this.simpleButtonReset.Dock = System.Windows.Forms.DockStyle.Left;
this.simpleButtonReset.Location = new System.Drawing.Point(0, 0);
this.simpleButtonReset.Name = "simpleButtonReset";
this.simpleButtonReset.Size = new System.Drawing.Size(66, 64);
this.simpleButtonReset.TabIndex = 5;
this.simpleButtonReset.Text = "Reset";
this.simpleButtonReset.Click += new System.EventHandler(this.simpleButtonReset_Click);
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.Transparent;
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 36);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1137, 3);
this.panel2.TabIndex = 6;
//
// panel3
//
this.panel3.BackColor = System.Drawing.Color.Transparent;
this.panel3.Controls.Add(this.maskedTextBoxTLIP);
this.panel3.Controls.Add(this.panel4);
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel3.Location = new System.Drawing.Point(0, 39);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(1137, 108);
this.panel3.TabIndex = 8;
//
// maskedTextBoxTLIP
//
this.maskedTextBoxTLIP.Dock = System.Windows.Forms.DockStyle.Fill;
this.maskedTextBoxTLIP.EditValue = "If you do not enter the ip, will be connected to the local area.";
this.maskedTextBoxTLIP.Location = new System.Drawing.Point(0, 65);
this.maskedTextBoxTLIP.Name = "maskedTextBoxTLIP";
this.maskedTextBoxTLIP.Properties.Appearance.BackColor = System.Drawing.Color.White;
this.maskedTextBoxTLIP.Properties.Appearance.Font = new System.Drawing.Font("Times New Roman", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.maskedTextBoxTLIP.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.maskedTextBoxTLIP.Properties.Appearance.Options.UseBackColor = true;
this.maskedTextBoxTLIP.Properties.Appearance.Options.UseFont = true;
this.maskedTextBoxTLIP.Properties.Appearance.Options.UseForeColor = true;
this.maskedTextBoxTLIP.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.maskedTextBoxTLIP.Size = new System.Drawing.Size(1137, 28);
this.maskedTextBoxTLIP.TabIndex = 8;
this.maskedTextBoxTLIP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown);
//
// panel4
//
this.panel4.BackColor = System.Drawing.Color.Transparent;
this.panel4.Controls.Add(this.label2);
this.panel4.Dock = System.Windows.Forms.DockStyle.Top;
this.panel4.Location = new System.Drawing.Point(0, 0);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(1137, 65);
this.panel4.TabIndex = 7;
//
// label2
//
this.label2.BackColor = System.Drawing.Color.WhiteSmoke;
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
this.label2.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.Color.Black;
this.label2.Location = new System.Drawing.Point(0, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(1137, 51);
this.label2.TabIndex = 9;
this.label2.Text = "TestList Server";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// panel5
//
this.panel5.BackColor = System.Drawing.Color.Transparent;
this.panel5.Controls.Add(this.maskedTextBoxDT1IP);
this.panel5.Controls.Add(this.panel6);
this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
this.panel5.Location = new System.Drawing.Point(0, 147);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(1137, 129);
this.panel5.TabIndex = 9;
//
// maskedTextBoxDT1IP
//
this.maskedTextBoxDT1IP.Dock = System.Windows.Forms.DockStyle.Fill;
this.maskedTextBoxDT1IP.EditValue = "If you do not enter the ip, will be connected to the local area.";
this.maskedTextBoxDT1IP.Location = new System.Drawing.Point(0, 85);
this.maskedTextBoxDT1IP.Name = "maskedTextBoxDT1IP";
this.maskedTextBoxDT1IP.Properties.Appearance.BackColor = System.Drawing.Color.White;
this.maskedTextBoxDT1IP.Properties.Appearance.Font = new System.Drawing.Font("Times New Roman", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.maskedTextBoxDT1IP.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.maskedTextBoxDT1IP.Properties.Appearance.Options.UseBackColor = true;
this.maskedTextBoxDT1IP.Properties.Appearance.Options.UseFont = true;
this.maskedTextBoxDT1IP.Properties.Appearance.Options.UseForeColor = true;
this.maskedTextBoxDT1IP.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.maskedTextBoxDT1IP.Size = new System.Drawing.Size(1137, 28);
this.maskedTextBoxDT1IP.TabIndex = 8;
this.maskedTextBoxDT1IP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown);
//
// panel6
//
this.panel6.BackColor = System.Drawing.Color.Transparent;
this.panel6.Controls.Add(this.comboBoxOverviewModel1);
this.panel6.Controls.Add(this.label1);
this.panel6.Dock = System.Windows.Forms.DockStyle.Top;
this.panel6.Location = new System.Drawing.Point(0, 0);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(1137, 85);
this.panel6.TabIndex = 7;
//
// comboBoxOverviewModel1
//
this.comboBoxOverviewModel1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxOverviewModel1.FormattingEnabled = true;
this.comboBoxOverviewModel1.Items.AddRange(new object[] {
"L",
"P1",
"P2"});
this.comboBoxOverviewModel1.Location = new System.Drawing.Point(280, 22);
this.comboBoxOverviewModel1.Name = "comboBoxOverviewModel1";
this.comboBoxOverviewModel1.Size = new System.Drawing.Size(106, 28);
this.comboBoxOverviewModel1.TabIndex = 10;
this.comboBoxOverviewModel1.Visible = false;
//
// label1
//
this.label1.BackColor = System.Drawing.Color.WhiteSmoke;
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.Black;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(1137, 70);
this.label1.TabIndex = 9;
this.label1.Text = "Log Server [1]";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label1.DoubleClick += new System.EventHandler(this.label1_DoubleClick);
//
// panel7
//
this.panel7.BackColor = System.Drawing.Color.Transparent;
this.panel7.Controls.Add(this.maskedTextBoxDT2IP);
this.panel7.Controls.Add(this.panel8);
this.panel7.Dock = System.Windows.Forms.DockStyle.Top;
this.panel7.Location = new System.Drawing.Point(0, 276);
this.panel7.Name = "panel7";
this.panel7.Size = new System.Drawing.Size(1137, 150);
this.panel7.TabIndex = 10;
//
// maskedTextBoxDT2IP
//
this.maskedTextBoxDT2IP.Dock = System.Windows.Forms.DockStyle.Fill;
this.maskedTextBoxDT2IP.EditValue = "If you do not enter the ip, will be connected to the local area.";
this.maskedTextBoxDT2IP.Location = new System.Drawing.Point(0, 83);
this.maskedTextBoxDT2IP.Name = "maskedTextBoxDT2IP";
this.maskedTextBoxDT2IP.Properties.Appearance.BackColor = System.Drawing.Color.White;
this.maskedTextBoxDT2IP.Properties.Appearance.Font = new System.Drawing.Font("Times New Roman", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.maskedTextBoxDT2IP.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.maskedTextBoxDT2IP.Properties.Appearance.Options.UseBackColor = true;
this.maskedTextBoxDT2IP.Properties.Appearance.Options.UseFont = true;
this.maskedTextBoxDT2IP.Properties.Appearance.Options.UseForeColor = true;
this.maskedTextBoxDT2IP.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.maskedTextBoxDT2IP.Size = new System.Drawing.Size(1137, 28);
this.maskedTextBoxDT2IP.TabIndex = 8;
this.maskedTextBoxDT2IP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.maskedTextBoxIP_PreviewKeyDown);
//
// panel8
//
this.panel8.BackColor = System.Drawing.Color.Transparent;
this.panel8.Controls.Add(this.comboBoxOverviewModel2);
this.panel8.Controls.Add(this.checkBoxUseDT2);
this.panel8.Controls.Add(this.label3);
this.panel8.Dock = System.Windows.Forms.DockStyle.Top;
this.panel8.Location = new System.Drawing.Point(0, 0);
this.panel8.Name = "panel8";
this.panel8.Size = new System.Drawing.Size(1137, 83);
this.panel8.TabIndex = 7;
//
// comboBoxOverviewModel2
//
this.comboBoxOverviewModel2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxOverviewModel2.FormattingEnabled = true;
this.comboBoxOverviewModel2.Items.AddRange(new object[] {
"L",
"P1",
"P2"});
this.comboBoxOverviewModel2.Location = new System.Drawing.Point(280, 21);
this.comboBoxOverviewModel2.Name = "comboBoxOverviewModel2";
this.comboBoxOverviewModel2.Size = new System.Drawing.Size(106, 28);
this.comboBoxOverviewModel2.TabIndex = 13;
this.comboBoxOverviewModel2.Visible = false;
//
// checkBoxUseDT2
//
this.checkBoxUseDT2.AutoSize = true;
this.checkBoxUseDT2.BackColor = System.Drawing.Color.WhiteSmoke;
this.checkBoxUseDT2.ForeColor = System.Drawing.Color.Black;
this.checkBoxUseDT2.Location = new System.Drawing.Point(43, 23);
this.checkBoxUseDT2.Name = "checkBoxUseDT2";
this.checkBoxUseDT2.Size = new System.Drawing.Size(63, 24);
this.checkBoxUseDT2.TabIndex = 12;
this.checkBoxUseDT2.Text = "Use";
this.checkBoxUseDT2.UseVisualStyleBackColor = false;
//
// label3
//
this.label3.BackColor = System.Drawing.Color.WhiteSmoke;
this.label3.Dock = System.Windows.Forms.DockStyle.Top;
this.label3.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.ForeColor = System.Drawing.Color.Black;
this.label3.Location = new System.Drawing.Point(0, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(1137, 69);
this.label3.TabIndex = 9;
this.label3.Text = "Log Server [2]";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label3.DoubleClick += new System.EventHandler(this.label3_DoubleClick);
//
// ConnectForm
//
this.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.Appearance.Options.UseBackColor = true;
this.Appearance.Options.UseFont = true;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackgroundImageLayoutStore = System.Windows.Forms.ImageLayout.Stretch;
this.BackgroundImageStore = global::SystemX.Product.TRA.Properties.Resources.IpAddress;
this.ClientSize = new System.Drawing.Size(1137, 460);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel7);
this.Controls.Add(this.panel5);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel2);
this.Controls.Add(this.labelControl1);
this.DoubleBuffered = true;
this.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.IconOptions.Icon = ((System.Drawing.Icon)(resources.GetObject("ConnectForm.IconOptions.Icon")));
this.IconOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("ConnectForm.IconOptions.SvgImage")));
this.Name = "ConnectForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Connect CP-ALIS";
this.TopMost = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ConnectForm_FormClosing);
this.panel1.ResumeLayout(false);
this.panel3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxTLIP.Properties)).EndInit();
this.panel4.ResumeLayout(false);
this.panel5.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxDT1IP.Properties)).EndInit();
this.panel6.ResumeLayout(false);
this.panel7.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.maskedTextBoxDT2IP.Properties)).EndInit();
this.panel8.ResumeLayout(false);
this.panel8.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private DevExpress.XtraEditors.LabelControl labelControl1;
private DevExpress.XtraEditors.SimpleButton simpleButtonOK;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel3;
private DevExpress.XtraEditors.ComboBoxEdit maskedTextBoxTLIP;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Panel panel5;
private DevExpress.XtraEditors.ComboBoxEdit maskedTextBoxDT1IP;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panel7;
private DevExpress.XtraEditors.ComboBoxEdit maskedTextBoxDT2IP;
private System.Windows.Forms.Panel panel8;
private System.Windows.Forms.Label label3;
private DevExpress.XtraEditors.SimpleButton simpleButtonReset;
private System.Windows.Forms.CheckBox checkBoxUseDT2;
private System.Windows.Forms.ComboBox comboBoxOverviewModel1;
private System.Windows.Forms.ComboBox comboBoxOverviewModel2;
}
}

View File

@ -0,0 +1,327 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DataBaseConnection.Control;
using DevExpress.XtraBars.Docking;
using DevExpress.XtraEditors;
using SystemX.Product.ALIS.Interface;
using static SystemX.Product.CP.TRA.Commons;
namespace SystemX.Product.ALIS.UI.Subs
{
public partial class ConnectForm : DevExpress.XtraEditors.XtraForm
{
private enum eCehckType
{
TestListServer = 1,
DataLogServer1 = 2,
DataLogServer2 = 3
}
private IDataController ctrlDB;
//TL Server
public string strInputTextTL;
private string strSetIPAddressTL;
public string strGetIPAddressTL { get { return strSetIPAddressTL; } private set { strSetIPAddressTL = value; } }
private int nSetConnPortTL;
public int nGetConnPortTL { get { return nSetConnPortTL; } private set { nSetConnPortTL = value; } }
//DT Server 1
public string strInputTextDT1;
private string strSetIPAddressDT1;
public string strGetIPAddressDT1 { get { return strSetIPAddressDT1; } private set { strSetIPAddressDT1 = value; } }
private int nSetConnPortDT1;
public int nGetConnPortDT1 { get { return nSetConnPortDT1; } private set { nSetConnPortDT1 = value; } }
//
//DT Server 2
public bool bSelectUseDataServer2;
public string strInputTextDT2;
private string strSetIPAddressDT2;
public string strGetIPAddressDT2 { get { return strSetIPAddressDT2; } private set { strSetIPAddressDT2 = value; } }
private int nSetConnPortDT2;
public int nGetConnPortDT2 { get { return nSetConnPortDT2; } private set { nSetConnPortDT2 = value; } }
//
public int nOverviewModelC1;
public int nOverviewModelC2;
public DialogResult TestListServerCheckResult;
public DialogResult DataServerCheckResult1;
public DialogResult DataServerCheckResult2;
public ConnectForm(IDataController ctrlDB)
{
InitializeComponent();
//this.MinimumSize = new Size(400, 250);
//this.MaximumSize = new Size(400, 250);
this.ctrlDB = ctrlDB;
//maskedTextBoxIP.Mask = "###.###.###.###";
//maskedTextBoxIP.ValidatingType = typeof(System.Net.IPAddress);
this.BringToFront();
this.Focus();
DialogResult = DialogResult.None;
comboBoxOverviewModel1.SelectedIndex = 0;
comboBoxOverviewModel2.SelectedIndex = 1;
ConnectInfoINICtrl CCtrl = new ConnectInfoINICtrl();
string strGetConnectInfo1 = CCtrl.GetValue("LastestConnect", "Info1", "");
string strGetConnectInfo2 = CCtrl.GetValue("LastestConnect", "Info2", "");
string strGetConnectInfo3 = CCtrl.GetValue("LastestConnect", "Info3", "");
string strGetConnectInfo4 = CCtrl.GetValue("LastestConnect", "UseDataServer2", "False");
string strGetConnectInfo5 = CCtrl.GetValue("LastestConnect", "OverviewModelInfoC1", "0");
string strGetConnectInfo6 = CCtrl.GetValue("LastestConnect", "OverviewModelInfoC2", "1");
int nOverInfoC1 = 0;
int nOverInfoC2 = 1;
if(int.TryParse(strGetConnectInfo5, out nOverInfoC1))
comboBoxOverviewModel1.SelectedIndex = nOverInfoC1;
if(int.TryParse(strGetConnectInfo6, out nOverInfoC2))
comboBoxOverviewModel2.SelectedIndex = nOverInfoC2;
if (strGetConnectInfo1.Length > 0)
maskedTextBoxTLIP.Text = strGetConnectInfo1;
if (strGetConnectInfo2.Length > 0)
maskedTextBoxDT1IP.Text = strGetConnectInfo2;
if (strGetConnectInfo3.Length > 0)
maskedTextBoxDT2IP.Text = strGetConnectInfo3;
if (strGetConnectInfo4.Length > 0)
{
bool bGetUseState = false;
if (bool.TryParse(strGetConnectInfo4, out bGetUseState))
checkBoxUseDT2.Checked = bGetUseState;
else
checkBoxUseDT2.Checked = false;
}
for (int i = 0; i < INICtrl.MAX_INFORMATION; i++)
{
string strGetInfo1 = CCtrl.GetValue("HistoryConnect" + i.ToString(), "Info1", "");
string strGetInfo2 = CCtrl.GetValue("HistoryConnect" + i.ToString(), "Info2", "");
string strGetInfo3 = CCtrl.GetValue("HistoryConnect" + i.ToString(), "Info3", "");
if (strGetInfo1.Length > 0)
maskedTextBoxTLIP.Properties.Items.Add(strGetInfo1);
if (strGetInfo2.Length > 0)
maskedTextBoxDT1IP.Properties.Items.Add(strGetInfo2);
if (strGetInfo3.Length > 0)
maskedTextBoxDT2IP.Properties.Items.Add(strGetInfo3);
}
}
private void InvaildIPAlarm()
{
MessageBox.Show("Invalid IP. Enter it in the normal format. (An empty string or [localhost] will attempt to connect to the local server.)", "[SystemX.Product.ALIS.UI]", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
private DialogResult CheckInformation(eCehckType ChkTyp, object sender, string strText)
{
DialogResult CheckResult = DialogResult.None;
IPAddress getIPAddress = null;
string strGetText = strText;
string[] strGetSplitCommaText = strGetText.Split(',');
string[] strGetSplitDotText = strGetText.Split('.');
if (ChkTyp == eCehckType.TestListServer)
{
strGetIPAddressTL = string.Empty;
nGetConnPortTL = DatabaseConnControl.CatalogConnPort;
strInputTextTL = strText;
}
else if (ChkTyp == eCehckType.DataLogServer1)
{
strGetIPAddressDT1 = string.Empty;
nGetConnPortDT1 = DatabaseConnControl.CatalogConnPort;
strInputTextDT1 = strText;
}
else if (ChkTyp == eCehckType.DataLogServer2)
{
strGetIPAddressDT2 = string.Empty;
nGetConnPortDT2 = DatabaseConnControl.CatalogConnPort;
strInputTextDT2 = strText;
}
if (IPAddress.TryParse(strText, out getIPAddress) == false)
{
if (strGetSplitCommaText.Length == 2)
{
string strGetIP = strGetSplitCommaText[0];
string strGetPort = strGetSplitCommaText[1];
int nGetPort = int.MaxValue;
if (IPAddress.TryParse(strGetIP, out getIPAddress) &&
int.TryParse(strGetPort, out nGetPort))
{
if (ChkTyp == eCehckType.TestListServer)
{
strGetIPAddressTL = strGetIP;
nGetConnPortTL = nGetPort;
}
else if (ChkTyp == eCehckType.DataLogServer1)
{
strGetIPAddressDT1 = strGetIP;
nGetConnPortDT1 = nGetPort;
}
else if (ChkTyp == eCehckType.DataLogServer2)
{
strGetIPAddressDT2 = strGetIP;
nGetConnPortDT2 = nGetPort;
}
CheckResult = DialogResult.OK;
return CheckResult;
}
}
string strGetUpperText = strText.ToUpper();
if (strText.Length == 0)
CheckResult = DialogResult.Ignore;
else if (strGetUpperText.CompareTo("LOCALHOST") == 0)
CheckResult = DialogResult.Ignore;
else if (strText.CompareTo("If you do not enter the ip, will be connected to the local area.") == 0)
CheckResult = DialogResult.Ignore;
else
{
((ComboBoxEdit)sender).Text = "";
InvaildIPAlarm();
}
}
else
{
if (strGetSplitDotText.Length == 4)
{
if (ChkTyp == eCehckType.TestListServer)
strGetIPAddressTL = strText;
else if (ChkTyp == eCehckType.DataLogServer1)
strGetIPAddressDT1 = strText;
else if (ChkTyp == eCehckType.DataLogServer2)
strGetIPAddressDT2 = strText;
CheckResult = DialogResult.OK;
}
else
{
((ComboBoxEdit)sender).Text = "";
InvaildIPAlarm();
}
}
return CheckResult;
}
private void simpleButtonOK_Click(object sender, EventArgs e)
{
bSelectUseDataServer2 = checkBoxUseDT2.Checked;
//
nOverviewModelC1 = comboBoxOverviewModel1.SelectedIndex;
nOverviewModelC2 = comboBoxOverviewModel2.SelectedIndex;
TestListServerCheckResult = DialogResult.None;
DataServerCheckResult1 = DialogResult.None;
TestListServerCheckResult = CheckInformation(eCehckType.TestListServer, maskedTextBoxTLIP, maskedTextBoxTLIP.Text);
DataServerCheckResult1 = CheckInformation(eCehckType.DataLogServer1, maskedTextBoxDT1IP, maskedTextBoxDT1IP.Text);
if (bSelectUseDataServer2)
DataServerCheckResult2 = CheckInformation(eCehckType.DataLogServer2, maskedTextBoxDT2IP, maskedTextBoxDT2IP.Text);
else
DataServerCheckResult2 = DialogResult.Ignore;
if ((TestListServerCheckResult.HasFlag(DialogResult.OK) || TestListServerCheckResult.HasFlag(DialogResult.Ignore)) &&
(DataServerCheckResult1.HasFlag(DialogResult.OK) || DataServerCheckResult1.HasFlag(DialogResult.Ignore)) &&
(DataServerCheckResult2.HasFlag(DialogResult.OK) || DataServerCheckResult2.HasFlag(DialogResult.Ignore)))
DialogResult = DialogResult.OK;
}
private void ConnectForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (DialogResult == DialogResult.None)
DialogResult = DialogResult.Abort;
/*if (maskedTextBoxIP.Text.Length == 0)
DialogResult = DialogResult.Cancel;
else if (maskedTextBoxIP.Text.CompareTo("localhost") == 0)
DialogResult = DialogResult.Cancel;
else if (maskedTextBoxIP.Text.CompareTo("If you do not enter the ip, will be connected to the local area.") == 0)
DialogResult = DialogResult.Cancel;
else
{
e.Cancel = true;
if (IPAddress.TryParse(maskedTextBoxIP.Text, out IPAddress))
e.Cancel = false;
}*/
}
private void maskedTextBoxIP_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (((ComboBoxEdit)sender).Text.CompareTo("If you do not enter the ip, will be connected to the local area.") == 0)
((ComboBoxEdit)sender).Text = string.Empty;
}
private void simpleButtonReset_Click(object sender, EventArgs e)
{
maskedTextBoxTLIP.Text = "If you do not enter the ip, will be connected to the local area.";
maskedTextBoxDT1IP.Text = "If you do not enter the ip, will be connected to the local area.";
maskedTextBoxDT2IP.Text = "If you do not enter the ip, will be connected to the local area.";
checkBoxUseDT2.Checked = false;
}
private void label1_DoubleClick(object sender, EventArgs e)
{
comboBoxOverviewModel1.Visible = !comboBoxOverviewModel1.Visible;
}
private void label3_DoubleClick(object sender, EventArgs e)
{
comboBoxOverviewModel2.Visible = !comboBoxOverviewModel2.Visible;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,189 @@

namespace SystemX.Product.ALIS.UI.Subs
{
partial class LoginForm
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginForm));
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
this.btnLogin = new System.Windows.Forms.Button();
this.labelAlarm = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.txtUserId = new DevExpress.XtraEditors.TextEdit();
this.panel2 = new System.Windows.Forms.Panel();
this.txtPassword = new System.Windows.Forms.MaskedTextBox();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.txtUserId.Properties)).BeginInit();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// labelControl1
//
this.labelControl1.Appearance.BackColor = System.Drawing.Color.White;
this.labelControl1.Appearance.Font = new System.Drawing.Font("Arial Black", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelControl1.Appearance.ForeColor = System.Drawing.Color.MidnightBlue;
this.labelControl1.Appearance.Options.UseBackColor = true;
this.labelControl1.Appearance.Options.UseFont = true;
this.labelControl1.Appearance.Options.UseForeColor = true;
this.labelControl1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
this.labelControl1.Dock = System.Windows.Forms.DockStyle.Left;
this.labelControl1.Location = new System.Drawing.Point(0, 0);
this.labelControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(52, 21);
this.labelControl1.TabIndex = 2;
this.labelControl1.Text = "User ID";
//
// labelControl2
//
this.labelControl2.Appearance.BackColor = System.Drawing.Color.White;
this.labelControl2.Appearance.Font = new System.Drawing.Font("Arial Black", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelControl2.Appearance.ForeColor = System.Drawing.Color.MidnightBlue;
this.labelControl2.Appearance.Options.UseBackColor = true;
this.labelControl2.Appearance.Options.UseFont = true;
this.labelControl2.Appearance.Options.UseForeColor = true;
this.labelControl2.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
this.labelControl2.Dock = System.Windows.Forms.DockStyle.Left;
this.labelControl2.Location = new System.Drawing.Point(0, 0);
this.labelControl2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.labelControl2.Name = "labelControl2";
this.labelControl2.Size = new System.Drawing.Size(67, 21);
this.labelControl2.TabIndex = 4;
this.labelControl2.Text = "Password";
//
// btnLogin
//
this.btnLogin.Dock = System.Windows.Forms.DockStyle.Bottom;
this.btnLogin.Font = new System.Drawing.Font("Arial Black", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnLogin.Location = new System.Drawing.Point(0, 86);
this.btnLogin.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnLogin.Name = "btnLogin";
this.btnLogin.Size = new System.Drawing.Size(298, 32);
this.btnLogin.TabIndex = 5;
this.btnLogin.Text = "Login";
this.btnLogin.UseVisualStyleBackColor = true;
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
//
// labelAlarm
//
this.labelAlarm.BackColor = System.Drawing.Color.LightGray;
this.labelAlarm.Dock = System.Windows.Forms.DockStyle.Bottom;
this.labelAlarm.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelAlarm.Location = new System.Drawing.Point(0, 54);
this.labelAlarm.Name = "labelAlarm";
this.labelAlarm.Size = new System.Drawing.Size(298, 32);
this.labelAlarm.TabIndex = 6;
this.labelAlarm.Text = "-";
this.labelAlarm.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.labelAlarm.Visible = false;
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Controls.Add(this.txtUserId);
this.panel1.Controls.Add(this.labelControl1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(298, 25);
this.panel1.TabIndex = 7;
//
// txtUserId
//
this.txtUserId.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtUserId.Location = new System.Drawing.Point(52, 0);
this.txtUserId.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtUserId.Name = "txtUserId";
this.txtUserId.Size = new System.Drawing.Size(246, 20);
this.txtUserId.TabIndex = 3;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.Transparent;
this.panel2.Controls.Add(this.txtPassword);
this.panel2.Controls.Add(this.labelControl2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 25);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(298, 25);
this.panel2.TabIndex = 8;
//
// txtPassword
//
this.txtPassword.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtPassword.Location = new System.Drawing.Point(67, 0);
this.txtPassword.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtPassword.Name = "txtPassword";
this.txtPassword.PasswordChar = '*';
this.txtPassword.Size = new System.Drawing.Size(231, 21);
this.txtPassword.TabIndex = 5;
this.txtPassword.UseSystemPasswordChar = true;
//
// LoginForm
//
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImageLayoutStore = System.Windows.Forms.ImageLayout.Stretch;
this.BackgroundImageStore = global::SystemX.Product.TRA.Properties.Resources.Password;
this.ClientSize = new System.Drawing.Size(298, 118);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.labelAlarm);
this.Controls.Add(this.btnLogin);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
this.IconOptions.Icon = ((System.Drawing.Icon)(resources.GetObject("LoginForm.IconOptions.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MaximumSize = new System.Drawing.Size(300, 150);
this.MinimumSize = new System.Drawing.Size(300, 130);
this.Name = "LoginForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Login";
this.TopMost = true;
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.txtUserId.Properties)).EndInit();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private DevExpress.XtraEditors.LabelControl labelControl1;
private DevExpress.XtraEditors.LabelControl labelControl2;
private System.Windows.Forms.Button btnLogin;
private System.Windows.Forms.Label labelAlarm;
private System.Windows.Forms.Panel panel1;
private DevExpress.XtraEditors.TextEdit txtUserId;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.MaskedTextBox txtPassword;
}
}

View File

@ -0,0 +1,90 @@
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SystemX.Product.ALIS.Interface;
namespace SystemX.Product.ALIS.UI.Subs
{
public partial class LoginForm : DevExpress.XtraEditors.XtraForm
{
private IDataController ctrlDB;
private DataSet ds = new DataSet();
private DataTable dt = new DataTable();
public string UserID { internal set; get; }
public string UserName { internal set; get; }
public string UserDept { internal set; get; }
public string UserEmail { internal set; get; }
public string UserComment { internal set; get; }
public string UserPassword { internal set; get; }
public LoginForm(IDataController ctrlDB)
{
InitializeComponent();
this.ctrlDB = ctrlDB;
}
private void btnLogin_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.None;
SqlDataReader dr = null;
try
{
ctrlDB.GetConnSqlCmd().CommandText = "SELECT * FROM STAT_User WHERE UserID = '" + txtUserId.Text + "' AND Password = '" + txtPassword.Text + "';";
dr = ctrlDB.GetConnSqlCmd().ExecuteReader();
if (dr != null)
{
DataSet ds = new DataSet();
DataTable dt = new DataTable();
int iFieldCnt = dr.FieldCount;
int iRecordsAffectedCnt = dr.RecordsAffected;
bool bHasRow = dr.HasRows;
dt.Load(dr);
ds.Tables.Add(dt);
if (dt.Rows.Count > 0)
{
UserID = dt.Rows[0]["UserID"].ToString();
UserName = dt.Rows[0]["Name"].ToString();
UserDept = dt.Rows[0]["Dept"].ToString();
UserEmail = dt.Rows[0]["Email"].ToString();
UserComment = dt.Rows[0]["Comment"].ToString();
UserPassword = dt.Rows[0]["Password"].ToString();
this.DialogResult = DialogResult.OK;
}
}
}
finally
{
if (dr != null)
dr.Close();
}
if (this.DialogResult == DialogResult.None)
{
this.MaximumSize = new Size(300, 180);
this.MinimumSize = new Size(300, 180);
this.Size = new Size(300, 180);
labelAlarm.Visible = true;
labelAlarm.Text = "User information does not match or\r\n the password is incorrect.";
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,296 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using SystemX.Net.Platform.Common.Util;
using static SystemX.Product.ALIS.UI.View.ViewCfg;
namespace SystemX.Product.ALIS.UI.View
{
public static class ViewCfg
{
public enum eOperationMode
{
ALL,
AUTO,
MANUAL
}
public enum eWorkMode
{
NORMAL,
RETEST,
REWORK
}
public enum eAppFunctionType
{
None = 0,
M_HostList,
M_UserList,
M_GroupList,
M_TestCodeList,
M_TestList,
M_TestListRel,
A_AnalysisPartID,
A_LogSearchTrend,
A_AnalysisProcessTrend
}
public enum eSelectType
{
None = 0,
HostList,
UserList,
GroupList,
TestCodeList,
TestList,
TestListRel
}
public enum eEditType
{
Insert = 0,
Modify
}
public enum eModelType
{
NONE,
IMAGE,
TEXT,
CPLOG,
PARTID_MAP
}
public enum eProcessTable
{
HIST_ProdLoad = 0,
HIST_CapDeassy,
HIST_PreHeating,
HIST_PreMeas,
HIST_Leak,
HIST_LaserTrim,
HIST_LaserTrimVision,
HIST_IsoRes,
HIST_CapAssy,
HIST_Function,
HIST_OutSealPress,
HIST_PinLVDT,
HIST_PinVision,
HIST_ProdUnload
}
private enum eProcessTableNumber
{
HIST_ProdLoad = 180,
HIST_CapDeassy = 180,
HIST_PreHeating = 190,
HIST_PreMeas = 190,
HIST_Leak = 200,
HIST_LaserTrim = 210,
HIST_LaserTrimVision = 220,
HIST_IsoRes = 220,
HIST_CapAssy = 230,
HIST_Function = 240,
HIST_OutSealPress = 250,
HIST_PinLVDT = 260,
HIST_PinVision = 260,
HIST_ProdUnload = 270
}
public static string GetTableProcessNumber(eProcessTable processTable)
{
string[] strSetProcessNumberList = new string[]
{ "180", "180", "190", "190", "200", "210", "220", "220", "230", "240", "250", "260", "260", "270" };
if (strSetProcessNumberList.Length > (int)processTable)
return strSetProcessNumberList[(int)processTable];
else
return "";
}
public enum eDataTable
{
HIST_TestResultData,
HIST_TestResultDatail
}
public const string SystemConfigPath = @"./Config/SystemConfig.xml";
public const string SaveLayoutPath = @"./Layout/Search/";
public enum eConfigElemList
{
Root,
RegisteredModels,
Model
}
public static XElement OpenSystemConfig()
{
var xElement = XMLControl.OpenXMLDocument(SystemConfigPath, eConfigElemList.Root.ToString());
if (xElement == null) return null;
return xElement;
}
public static XElement SaveSystemConfig(List<SysModelDef> registeredModels)
{
XDocument xmlDoc = new XDocument();
XElement xRoot = new XElement(eConfigElemList.Root.ToString());
XElement xRegModels = new XElement(eConfigElemList.RegisteredModels.ToString());
foreach (SysModelDef modeldef in registeredModels)
xRegModels.Add(modeldef.SaveXML());
xRoot.Add(xRegModels);
xmlDoc.Add(xRoot);
xmlDoc.Save(SystemConfigPath);
return xRoot;
}
public static List<SysModelDef> GetRegisteredModels(XElement xelemRoot)
{
XElement elemModelRoot = xelemRoot.Element(eConfigElemList.RegisteredModels.ToString());
List<SysModelDef> modeldef = new List<SysModelDef>();
foreach (XElement elemModel in elemModelRoot.Elements())
modeldef.Add(new SysModelDef(elemModel));
return modeldef;
}
public static Dictionary<string, string> GetProcessTableNameMap()
{
Dictionary<string, string> NameMap = new Dictionary<string, string>();
NameMap.Add(eProcessTable.HIST_ProdLoad.ToString(), "LX/LU-180:Loading");
NameMap.Add(eProcessTable.HIST_CapDeassy.ToString(), "LX/LU-180:Cap De-Ass'y");
NameMap.Add(eProcessTable.HIST_PreHeating.ToString(), "LX/LU-190:Pre-Heating");
NameMap.Add(eProcessTable.HIST_PreMeas.ToString(), "LX/LU-190:Pre-Measuring");
NameMap.Add(eProcessTable.HIST_Leak.ToString(), "LX/LU-200:Leak Test");
NameMap.Add(eProcessTable.HIST_LaserTrim.ToString(), "LX/LU-210:Laser Trimming");
NameMap.Add(eProcessTable.HIST_LaserTrimVision.ToString(), "LX/LU-220:Trimming Vision Inspection");
NameMap.Add(eProcessTable.HIST_IsoRes.ToString(), "LX/LU-220:Isolation Resistance Test");
NameMap.Add(eProcessTable.HIST_CapAssy.ToString(), "LX/LU-230:Cap Ass'y");
NameMap.Add(eProcessTable.HIST_Function.ToString(), "LX/LU-240:Function Test");
NameMap.Add(eProcessTable.HIST_OutSealPress.ToString(), "LX/LU-250:Outer Seal Press");
NameMap.Add(eProcessTable.HIST_PinLVDT.ToString(), "LX/LU-260:Pin Height Inspection");
NameMap.Add(eProcessTable.HIST_PinVision.ToString(), "LX/LU-260:Pin-Align Vision Inspection");
NameMap.Add(eProcessTable.HIST_ProdUnload.ToString(), "LX/LU-270:Unloading");
return NameMap;
}
public class NameMapItem
{
public string TableName { get; set; }
public string ProcName { get; set; }
}
}
public class SysModelDef
{
public string ID { get; set; }
public string Path { get; set; }
public string Type { get; set; }
public eModelType eType { get; set; } = eModelType.NONE;
public SysModelDef(XElement elem)
{
SetModelDef(elem);
SetType(Type);
}
public SysModelDef(string strPath)
{
Path = strPath;
}
public bool SetType(string strType)
{
eModelType eparsetype = eModelType.NONE;
if (!Enum.TryParse(strType.ToUpper(), out eparsetype))
return false;
eType = eparsetype;
return true;
}
public bool SetModelDef(XElement elem)
{
try
{
foreach (XAttribute regAttrb in elem.Attributes())
{
string strAttrbName = regAttrb.Name.LocalName;
if (CommonUtil.GetProperty(this, strAttrbName) == null)
continue;
CommonUtil.SetPropertyValue(this, strAttrbName, regAttrb.Value);
}
}
catch (Exception ex)
{
LogMessage.MessageOutput.ConsoleWrite("Error during Read Mdoel Definition in System Config.", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
LogMessage.MessageOutput.ConsoleWrite($" - Message: {ex.Message}", ConsoleColor.Red, LogMessage.LogMessageLevel.FATAL);
throw;
}
return true;
}
public XElement SaveXML()
{
XElement xelemSave = new XElement(eConfigElemList.Model.ToString());
xelemSave.SetAttributeValue("ID", ID);
xelemSave.SetAttributeValue("Path", Path);
xelemSave.SetAttributeValue("Type", Type);
return xelemSave;
}
}
public class LogInfo
{
public string LogAccKey { get; set; }
public string ProductID { get; set; }
public string PalletID { get; set; }
public string UpdateDT { get; set; }
public string ProcessNo { get; set; }
public string PalletNo { get; set; }
public string PalletIndex { get; set; }
public string Status { get; set; }
public string TestTime { get; set; }
public string Result { get; set; }
public Dictionary<int, string> TestResult { get; set; }
}
public class ChartLogInfo
{
public string TableName { get; set; }
public string StartDateTime { get; set; }
public string EndDateTime { get; set; }
public string ProductNo { get; set; }
public string PalletNo { get; set; }
public string PalletIndex { get; set; }
public string WorkMode { get; set; }
public string OperationMode { get; set; }
public string StepNo { get; set; }
public string MO { get; set; }
public string FuncName { get; set; }
public string Min { get; set; }
public string Max { get; set; }
public Dictionary<string, double> MeasuredData = new Dictionary<string, double>();
}
}

View File

@ -0,0 +1,94 @@

namespace SystemX.Product.ALIS.UI.Subs
{
partial class WaitProgressForm
{
/// <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.progressPanel1 = new DevExpress.XtraWaitForm.ProgressPanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// progressPanel1
//
this.progressPanel1.Appearance.BackColor = System.Drawing.Color.Transparent;
this.progressPanel1.Appearance.Font = new System.Drawing.Font("Arial Rounded MT", 9F);
this.progressPanel1.Appearance.Options.UseBackColor = true;
this.progressPanel1.Appearance.Options.UseFont = true;
this.progressPanel1.AppearanceCaption.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.progressPanel1.AppearanceCaption.Options.UseFont = true;
this.progressPanel1.AppearanceDescription.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.progressPanel1.AppearanceDescription.Options.UseFont = true;
this.progressPanel1.Description = "";
this.progressPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.progressPanel1.ImageHorzOffset = 20;
this.progressPanel1.Location = new System.Drawing.Point(0, 16);
this.progressPanel1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.progressPanel1.Name = "progressPanel1";
this.progressPanel1.Size = new System.Drawing.Size(287, 35);
this.progressPanel1.TabIndex = 0;
this.progressPanel1.Text = "progressPanel1";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.AutoSize = true;
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.progressPanel1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 13, 0, 13);
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(287, 67);
this.tableLayoutPanel1.TabIndex = 1;
//
// WaitProgressForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(287, 67);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "WaitProgressForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private DevExpress.XtraWaitForm.ProgressPanel progressPanel1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}

View File

@ -0,0 +1,52 @@
using DevExpress.XtraWaitForm;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SystemX.Product.ALIS.UI.Subs
{
public partial class WaitProgressForm : WaitForm
{
public WaitProgressForm()
{
InitializeComponent();
this.progressPanel1.AutoHeight = true;
}
#region Overrides
public override void SetCaption(string caption)
{
base.SetCaption(caption);
this.progressPanel1.Caption = caption;
}
public override void SetDescription(string description)
{
base.SetDescription(description);
this.progressPanel1.Description = description;
}
public override void ProcessCommand(Enum cmd, object arg)
{
base.ProcessCommand(cmd, arg);
}
#endregion
public void setDescription(string sText)
{
this.SetDescription(sText);
}
public enum WaitFormCommand
{
}
}
}

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,467 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{74C67745-2E9A-4F85-A170-2C1F5990E6F4}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SystemX.Product.TRA</RootNamespace>
<AssemblyName>SystemX.Product.TRA</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>TRA-Logo.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.BonusSkins.v20.2" />
<Reference Include="DevExpress.Charts.v20.2.Core, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Data.Desktop.v20.2" />
<Reference Include="DevExpress.Data.v20.2" />
<Reference Include="DevExpress.DataAccess.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.DataVisualization.v20.2.Core, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\DevExpress.DataVisualization.v20.2.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Docs.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Images.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Office.v20.2.Core, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Pdf.v20.2.Core, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.RichEdit.v20.2.Core, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Spreadsheet.v20.2.Core, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Utils.v20.2" />
<Reference Include="DevExpress.Sparkline.v20.2.Core" />
<Reference Include="DevExpress.Utils.v20.2.UI, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraBars.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraCharts.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraCharts.v20.2.UI, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraCharts.v20.2.Wizard, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraEditors.v20.2" />
<Reference Include="DevExpress.Printing.v20.2.Core" />
<Reference Include="DevExpress.XtraGrid.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraLayout.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraPrinting.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraRichEdit.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraVerticalGrid.v20.2, Version=20.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="log4net">
<HintPath>.\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.1\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.1.1\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.SqlClient, Version=1.13.20136.2, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.SqlClient.1.1.3\lib\net46\Microsoft.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Include="Microsoft.EntityFrameworkCore, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.EntityFrameworkCore.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll</HintPath>
</Reference>
<Reference Include="Microsoft.EntityFrameworkCore.Abstractions, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.EntityFrameworkCore.Abstractions.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.EntityFrameworkCore.Relational, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.EntityFrameworkCore.Relational.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll</HintPath>
</Reference>
<Reference Include="Microsoft.EntityFrameworkCore.SqlServer, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.EntityFrameworkCore.SqlServer.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Caching.Abstractions, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Caching.Abstractions.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Caching.Memory, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Caching.Memory.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration.Binder, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.Binder.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.3.1.32\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.3.1.32\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Options, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Options.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Primitives, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Primitives.3.1.32\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Identity.Client, Version=3.0.8.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Identity.Client.3.0.8\lib\net45\Microsoft.Identity.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.5.5.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Logging, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Logging.5.5.0\lib\net461\Microsoft.IdentityModel.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Protocols, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.5.5.0\lib\net461\Microsoft.IdentityModel.Protocols.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.5.5.0\lib\net461\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Tokens, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.5.5.0\lib\net461\Microsoft.IdentityModel.Tokens.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.ComponentModel.Annotations.4.7.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Common, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.Common.4.3.0\lib\net451\System.Data.Common.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.Linq" />
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.7.1\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference>
<Reference Include="System.IdentityModel" />
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.5.5.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Core">
<HintPath>..\..\RPDM\Output.SystemX\System.Reactive.Core.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Interfaces">
<HintPath>..\..\RPDM\Output.SystemX\System.Reactive.Interfaces.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Linq">
<HintPath>..\..\RPDM\Output.SystemX\System.Reactive.Linq.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="SystemX.Net.Platform">
<HintPath>..\..\Output.SystemX\SystemX.Net.Platform.dll</HintPath>
</Reference>
<Reference Include="SystemX.Net.XAdaptor.PC.UIM">
<HintPath>..\..\Output.SystemX\SystemX.Net.XAdaptor.PC.UIM.dll</HintPath>
</Reference>
<Reference Include="SystemX.Product.CP.TRA.BaseView">
<HintPath>..\SystemX.Product.CP.TRA.BaseView\bin\x64\SystemX.Product.CP.TRA.BaseView.dll</HintPath>
</Reference>
<Reference Include="SystemX.XEFCore">
<HintPath>..\..\Output.SystemX\SystemX.XEFCore.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ChildControl.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="DataControl.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="DataManager\DMCommon.cs" />
<Compile Include="DataManager\DMDetailOverview.cs" />
<Compile Include="DataManager\DMOverview.cs" />
<Compile Include="DataManager\DMStepTrend.cs" />
<Compile Include="DataManager\DMProductHistory.cs" />
<Compile Include="DataManager\DMTestNgHistory.cs" />
<Compile Include="DataManager\DMTestSummary.cs" />
<Compile Include="DataManager\DMTestDetail.cs" />
<Compile Include="DataManager\DMTestHistory.cs" />
<Compile Include="DB\DataBaseConn.cs" />
<Compile Include="Interface\IChildControl.cs" />
<Compile Include="Interface\IChildSubscribe.cs" />
<Compile Include="Interface\IDataBaseControl.cs" />
<Compile Include="Interface\IDataControl.cs" />
<Compile Include="Interface\IUserControlSubscribe.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Subs\Commons.cs" />
<Compile Include="Subs\ConnectForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Subs\ConnectForm.Designer.cs">
<DependentUpon>ConnectForm.cs</DependentUpon>
</Compile>
<Compile Include="Subs\LoginForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Subs\LoginForm.Designer.cs">
<DependentUpon>LoginForm.cs</DependentUpon>
</Compile>
<Compile Include="Subs\ViewCfg.cs" />
<Compile Include="Subs\WaitProgressForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Subs\WaitProgressForm.Designer.cs">
<DependentUpon>WaitProgressForm.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\FrmOptionOverview.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UIControl\FrmOptionOverview.Designer.cs">
<DependentUpon>FrmOptionOverview.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\FrmOptionStationSearch.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UIControl\FrmOptionStationSearch.Designer.cs">
<DependentUpon>FrmOptionStationSearch.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\FrmOptionSummary.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UIControl\FrmOptionSummary.Designer.cs">
<DependentUpon>FrmOptionSummary.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\Helper\MergedRowsHelper.cs" />
<Compile Include="UIControl\UcTRADetailOverview.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRADetailOverview.Designer.cs">
<DependentUpon>UcTRADetailOverview.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRAStepTrend.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRAStepTrend.Designer.cs">
<DependentUpon>UcTRAStepTrend.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRASummaryTestResult.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRASummaryTestResult.Designer.cs">
<DependentUpon>UcTRASummaryTestResult.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRADetailTestResult.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRADetailTestResult.Designer.cs">
<DependentUpon>UcTRADetailTestResult.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRAOverview.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRAOverview.Designer.cs">
<DependentUpon>UcTRAOverview.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRAProductHist.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRAProductHist.Designer.cs">
<DependentUpon>UcTRAProductHist.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRAProdHistHost.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRAProdHistHost.Designer.cs">
<DependentUpon>UcTRAProdHistHost.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRATestNgHist.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRATestNgHist.Designer.cs">
<DependentUpon>UcTRATestNgHist.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRATestHistHost.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIControl\UcTRATestHistHost.Designer.cs">
<DependentUpon>UcTRATestHistHost.cs</DependentUpon>
</Compile>
<Compile Include="UIControl\UcTRAViewStatic.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Subs\ConnectForm.resx">
<DependentUpon>ConnectForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Subs\LoginForm.resx">
<DependentUpon>LoginForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Subs\WaitProgressForm.resx">
<DependentUpon>WaitProgressForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\FrmOptionOverview.resx">
<DependentUpon>FrmOptionOverview.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\FrmOptionStationSearch.resx">
<DependentUpon>FrmOptionStationSearch.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\FrmOptionSummary.resx">
<DependentUpon>FrmOptionSummary.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRADetailOverview.resx">
<DependentUpon>UcTRADetailOverview.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRAStepTrend.resx">
<DependentUpon>UcTRAStepTrend.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRASummaryTestResult.resx">
<DependentUpon>UcTRASummaryTestResult.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRADetailTestResult.resx">
<DependentUpon>UcTRADetailTestResult.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRAOverview.resx">
<DependentUpon>UcTRAOverview.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRAProductHist.resx">
<DependentUpon>UcTRAProductHist.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRAProdHistHost.resx">
<DependentUpon>UcTRAProdHistHost.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRATestNgHist.resx">
<DependentUpon>UcTRATestNgHist.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIControl\UcTRATestHistHost.resx">
<DependentUpon>UcTRATestHistHost.cs</DependentUpon>
</EmbeddedResource>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="NoChartSpec.def" />
<None Include="Resources\IpAddress.PNG" />
<None Include="Resources\Kefico CI.PNG" />
<None Include="Resources\Password.jpg" />
<None Include="Resources\Find_16x16.png" />
<None Include="Resources\HistoryItem_16x16.png" />
<None Include="Resources\Linear_16x16.png" />
<None Include="Resources\UpdateField_16x16.png" />
<None Include="Resources\UpdateTableOfContents_16x16.png" />
<None Include="Resources\ModelEditor_DetailView.png" />
<None Include="Resources\ExplodedPie3D_16x16.png" />
<None Include="Resources\Find2_16x16.png" />
<Content Include="TRA-Logo.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy /Y "$(SolutionDir)\\SystemX.Product.CP.TRA\NoChartSpec.def" "$(TargetDir)\NoChartSpec.def"</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>이 프로젝트는 이 컴퓨터에 없는 NuGet 패키지를 참조합니다. 해당 패키지를 다운로드하려면 NuGet 패키지 복원을 사용하십시오. 자세한 내용은 http://go.microsoft.com/fwlink/?LinkID=322105를 참조하십시오. 누락된 파일은 {0}입니다.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

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);
}
}
}

Binary file not shown.

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.1" targetFramework="net48" />
<package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net48" />
<package id="Microsoft.Data.SqlClient" version="1.1.3" targetFramework="net48" />
<package id="Microsoft.Data.SqlClient.SNI" version="1.1.0" targetFramework="net48" />
<package id="Microsoft.EntityFrameworkCore" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.EntityFrameworkCore.Abstractions" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.EntityFrameworkCore.Analyzers" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.EntityFrameworkCore.Relational" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.EntityFrameworkCore.SqlServer" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Caching.Abstractions" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Caching.Memory" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration.Binder" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Logging" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Options" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Extensions.Primitives" version="3.1.32" targetFramework="net48" />
<package id="Microsoft.Identity.Client" version="3.0.8" targetFramework="net48" />
<package id="Microsoft.IdentityModel.JsonWebTokens" version="5.5.0" targetFramework="net48" />
<package id="Microsoft.IdentityModel.Logging" version="5.5.0" targetFramework="net48" />
<package id="Microsoft.IdentityModel.Protocols" version="5.5.0" targetFramework="net48" />
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="5.5.0" targetFramework="net48" />
<package id="Microsoft.IdentityModel.Tokens" version="5.5.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Collections.Immutable" version="1.7.1" targetFramework="net48" />
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net48" />
<package id="System.Data.Common" version="4.3.0" targetFramework="net48" />
<package id="System.Diagnostics.DiagnosticSource" version="4.7.1" targetFramework="net48" />
<package id="System.IdentityModel.Tokens.Jwt" version="5.5.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.4" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
</packages>