- 각 창들 추가

- Analysis Panel 계산 준비
This commit is contained in:
2017-06-19 14:07:56 +09:00
parent 5e26c490b8
commit cc42695fd8
16 changed files with 761 additions and 32 deletions

View File

@@ -11,6 +11,19 @@ namespace friction
{ {
public class DataHandler public class DataHandler
{ {
public class CalcResult
{
public int m_iCnt;
public float m_fAvgRPN;
public float m_fStdRPN;
public float m_fDiffByForce;
public float m_fDiffByTemp;
public float m_fDiffByHumid;
public float m_fDiffByVel;
}
DataTable m_Data = new DataTable(); DataTable m_Data = new DataTable();
string m_strFileName = ""; string m_strFileName = "";
@@ -19,8 +32,8 @@ namespace friction
List<string> m_ColumnsNames = new List<string>(); List<string> m_ColumnsNames = new List<string>();
List<string> m_ActiveColumns = new List<string>(); List<string> m_ActiveColumns = new List<string>();
List<string> m_NonactiveColumns = new List<string>(); List<string> m_NonactiveColumns = new List<string>();
List<string> m_Material1 = new List<string>(); List<string> m_MaterialSpring = new List<string>();
List<string> m_Material2 = new List<string>(); List<string> m_MaterialTable = new List<string>();
Dictionary<string, string> m_ColumnMap = new Dictionary<string, string>(); Dictionary<string, string> m_ColumnMap = new Dictionary<string, string>();
@@ -28,14 +41,23 @@ namespace friction
{ {
m_ColumnMap["spring"] = "Material spring"; m_ColumnMap["spring"] = "Material spring";
m_ColumnMap["table"] = "material 2 table"; m_ColumnMap["table"] = "material 2 table";
m_ColumnMap["priority"] = "Risk priority number"; m_ColumnMap["rpn"] = "Risk priority number";
m_ColumnMap["force"] = "normal force"; m_ColumnMap["force"] = "normal force";
m_ColumnMap["temp"] = "Temperature"; m_ColumnMap["temp"] = "Temperature";
m_ColumnMap["humidity"] = "Relative humidity"; m_ColumnMap["humidity"] = "Relative humidity";
m_ColumnMap["velocity"] = "Relative velocity"; m_ColumnMap["velocity"] = "Relative velocity";
} }
public void LoadData2(string strFilePath) bool IsNumberColumn(string strColumn)
{
return (strColumn == m_ColumnMap["rpn"] ||
strColumn == m_ColumnMap["force"] ||
strColumn == m_ColumnMap["temp"] ||
strColumn == m_ColumnMap["humidity"] ||
strColumn == m_ColumnMap["velocity"]);
}
public void LoadData(string strFilePath)
{ {
using (ExcelPackage package = new ExcelPackage()) using (ExcelPackage package = new ExcelPackage())
{ {
@@ -50,7 +72,7 @@ namespace friction
for (int iCol = Sheet.Dimension.Start.Column; iCol <= Sheet.Dimension.End.Column; iCol++) for (int iCol = Sheet.Dimension.Start.Column; iCol <= Sheet.Dimension.End.Column; iCol++)
{ {
string strCol = (string)Sheet.Cells[Sheet.Dimension.Start.Row, iCol].Value; string strCol = (string)Sheet.Cells[Sheet.Dimension.Start.Row, iCol].Value;
m_Data.Columns.Add(new DataColumn(strCol)); m_Data.Columns.Add(new DataColumn(strCol, IsNumberColumn(strCol) ? typeof(float) : typeof(string)));
} }
// read data // read data
@@ -61,10 +83,11 @@ namespace friction
for (int iCol = Sheet.Dimension.Start.Column; iCol <= Sheet.Dimension.End.Column; iCol++) for (int iCol = Sheet.Dimension.Start.Column; iCol <= Sheet.Dimension.End.Column; iCol++)
{ {
var value = Sheet.Cells[iRow, iCol].Value; var value = Sheet.Cells[iRow, iCol].Value;
if (m_Data.Columns[iCol-1].DataType == typeof(float))
if (value is double)
{ {
float fData = (float)(double)value; float fData = 0;
if(value != null)
fData = (float)(double)value;
newRow[iCol - 1] = fData; newRow[iCol - 1] = fData;
} }
else else
@@ -72,7 +95,7 @@ namespace friction
string strData = ""; string strData = "";
if (value != null) if (value != null)
{ {
strData = (string)value; strData = value.ToString();
strData = strData.Trim(); strData = strData.Trim();
} }
@@ -82,13 +105,17 @@ namespace friction
m_Data.Rows.Add(newRow); m_Data.Rows.Add(newRow);
} }
m_strFilePath = strFilePath;
int iSeperate = strFilePath.LastIndexOf('\\');
m_strFileName = strFilePath.Substring(iSeperate+1);
} }
m_Material1 = (from r in m_Data.AsEnumerable() m_MaterialSpring = (from r in m_Data.AsEnumerable()
select r[m_ColumnMap["spring"]]).Distinct().Cast<string>().ToList(); select r[m_ColumnMap["spring"]]).Distinct().Cast<string>().ToList();
m_Material2 = (from r in m_Data.AsEnumerable() m_MaterialTable = (from r in m_Data.AsEnumerable()
select r[m_ColumnMap["table"]]).Distinct().Cast<string>().ToList(); select r[m_ColumnMap["table"]]).Distinct().Cast<string>().ToList();
m_ColumnsNames = (from c in m_Data.Columns.Cast<DataColumn>() m_ColumnsNames = (from c in m_Data.Columns.Cast<DataColumn>()
@@ -111,21 +138,68 @@ namespace friction
m_ActiveColumns.Add(m_ColumnsNames[i]); m_ActiveColumns.Add(m_ColumnsNames[i]);
} }
} }
//GetCalc("ABS", "ABS");
} }
#region calculation
public CalcResult GetCalc(string strSpring, string strTable)
{
CalcResult result = new CalcResult();
string strQuery = string.Format("[{0}]='{1}' and [{2}]='{3}'", m_ColumnMap["spring"], strSpring, m_ColumnMap["table"], strTable);
DataRow[] rows = m_Data.Select(strQuery);
result.m_iCnt = rows.Length;
result.m_fAvgRPN = rows.Average(r => (float)r[m_ColumnMap["rpn"]]);
result.m_fStdRPN = rows.Average(r => (float)Math.Pow((float)r[m_ColumnMap["rpn"]] - result.m_fAvgRPN, 2));
result.m_fStdRPN = (float)Math.Sqrt(result.m_fStdRPN);
var aa = rows
.GroupBy(r => r[m_ColumnMap["force"]])
.Select(t => t.Average(k => (float)k[m_ColumnMap["rpn"]]));
//foreach( var a in aa )
//{
// float fForce = (float)a.Key;
// float fAvg = a.Average(r => (float)r[m_ColumnMap["rpn"]]);
//}
//.Min(r => (float)r[m_ColumnMap["rpn"]]);
//aa.Min()
//float fMin = rows.GroupBy(r => r[m_ColumnMap["force"]])..Min(r => r[m_ColumnMap["rpn"]]);
return result;
}
#endregion
#region get
public DataTable GetData() public DataTable GetData()
{ {
return m_Data; return m_Data;
} }
public string GetFilePath()
{
return m_strFilePath;
}
public string GetFileName()
{
return m_strFileName;
}
public List<string> GetMaterialSpring() public List<string> GetMaterialSpring()
{ {
return m_Material1; return m_MaterialSpring;
} }
public List<string> GetMaterialTable() public List<string> GetMaterialTable()
{ {
return m_Material2; return m_MaterialTable;
} }
public List<string> GetColumns() public List<string> GetColumns()
@@ -142,5 +216,6 @@ namespace friction
{ {
return m_NonactiveColumns; return m_NonactiveColumns;
} }
#endregion
} }
} }

View File

@@ -17,6 +17,9 @@ namespace friction
DataHandler m_DataHandler = new DataHandler(); DataHandler m_DataHandler = new DataHandler();
PanelMaterial m_MaterialPanel = null; PanelMaterial m_MaterialPanel = null;
PanelResult m_ResultPanel = null; PanelResult m_ResultPanel = null;
PanelAnalysis m_AnalysisPanel = null;
PanelRadarGraph m_RadarGraphPanel = null;
PanelTrendGraph m_TrendGraphPanel = null;
public MainForm() public MainForm()
{ {
@@ -25,6 +28,9 @@ namespace friction
dockPanel.Theme = new VS2015DarkTheme(); dockPanel.Theme = new VS2015DarkTheme();
m_MaterialPanel = new PanelMaterial(this); m_MaterialPanel = new PanelMaterial(this);
m_ResultPanel = new PanelResult(this); m_ResultPanel = new PanelResult(this);
m_AnalysisPanel = new PanelAnalysis(this);
m_RadarGraphPanel = new PanelRadarGraph(this);
m_TrendGraphPanel = new PanelTrendGraph(this);
} }
private void OpenPanel(DockContent panel) private void OpenPanel(DockContent panel)
@@ -51,7 +57,7 @@ namespace friction
if (result == DialogResult.OK) if (result == DialogResult.OK)
{ {
m_DBFileName = ofd.FileName; m_DBFileName = ofd.FileName;
m_DataHandler.LoadData2(m_DBFileName); m_DataHandler.LoadData(m_DBFileName);
m_MaterialPanel.UpdateData(m_DataHandler); m_MaterialPanel.UpdateData(m_DataHandler);
OpenPanel(m_MaterialPanel); OpenPanel(m_MaterialPanel);
@@ -75,23 +81,24 @@ namespace friction
private void toolStripButtonAnalysis_Click(object sender, EventArgs e) private void toolStripButtonAnalysis_Click(object sender, EventArgs e)
{ {
OpenPanel(m_AnalysisPanel);
} }
private void toolStripButtonRadarGraph_Click(object sender, EventArgs e) private void toolStripButtonRadarGraph_Click(object sender, EventArgs e)
{ {
OpenPanel(m_RadarGraphPanel);
} }
private void toolStripButtonTrendGraph_Click(object sender, EventArgs e) private void toolStripButtonTrendGraph_Click(object sender, EventArgs e)
{ {
OpenPanel(m_TrendGraphPanel);
} }
#region Events from panels #region Events from panels
public void OnApplyData() public void OnApplyData()
{ {
m_AnalysisPanel.UpdateData(m_DataHandler);
OpenPanel(m_AnalysisPanel);
} }
public void OnColumnChecked(string strColumn, bool bChecked) public void OnColumnChecked(string strColumn, bool bChecked)

69
PanelAnalysis.Designer.cs generated Normal file
View File

@@ -0,0 +1,69 @@
namespace friction
{
partial class PanelAnalysis
{
/// <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.dgvAnalysis = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).BeginInit();
this.SuspendLayout();
//
// dgvAnalysis
//
this.dgvAnalysis.AllowUserToAddRows = false;
this.dgvAnalysis.AllowUserToDeleteRows = false;
this.dgvAnalysis.AllowUserToOrderColumns = true;
this.dgvAnalysis.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvAnalysis.Location = new System.Drawing.Point(12, 12);
this.dgvAnalysis.Name = "dgvAnalysis";
this.dgvAnalysis.ReadOnly = true;
this.dgvAnalysis.RowTemplate.Height = 23;
this.dgvAnalysis.Size = new System.Drawing.Size(599, 442);
this.dgvAnalysis.TabIndex = 0;
//
// PanelAnalysis
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(623, 466);
this.ControlBox = false;
this.Controls.Add(this.dgvAnalysis);
this.HideOnClose = true;
this.Name = "PanelAnalysis";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Analysis Table";
this.Text = "Analysis Table";
((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvAnalysis;
}
}

37
PanelAnalysis.cs Normal file
View File

@@ -0,0 +1,37 @@
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;
using WeifenLuo.WinFormsUI.Docking;
namespace friction
{
public partial class PanelAnalysis : DockContent
{
MainForm m_Owner = null;
public PanelAnalysis(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
}
public void UpdateData(DataHandler data)
{
dgvAnalysis.Columns.Add("chTable", "Table");
dgvAnalysis.Columns.Add("chNoTest", "No. of Tests");
dgvAnalysis.Columns.Add("chAvg", "Average RPN");
dgvAnalysis.Columns.Add("chSTD", "stdev RPN");
dgvAnalysis.Columns.Add("chForce", "Normal Force");
dgvAnalysis.Columns.Add("chTemp", "Temperature");
dgvAnalysis.Columns.Add("chHumi", "Rel. Humidity");
dgvAnalysis.Columns.Add("chVel", "Velocity");
}
}
}

120
PanelAnalysis.resx Normal file
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

@@ -31,7 +31,7 @@
this.cbMaterialTable = new System.Windows.Forms.ComboBox(); this.cbMaterialTable = new System.Windows.Forms.ComboBox();
this.cbMaterialSpring = new System.Windows.Forms.ComboBox(); this.cbMaterialSpring = new System.Windows.Forms.ComboBox();
this.btApply = new System.Windows.Forms.Button(); this.btApply = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.lbFileName = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.SuspendLayout(); this.SuspendLayout();
@@ -64,14 +64,14 @@
this.btApply.UseVisualStyleBackColor = true; this.btApply.UseVisualStyleBackColor = true;
this.btApply.Click += new System.EventHandler(this.btApply_Click); this.btApply.Click += new System.EventHandler(this.btApply_Click);
// //
// label1 // lbFileName
// //
this.label1.AutoSize = true; this.lbFileName.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Malgun Gothic", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); this.lbFileName.Font = new System.Drawing.Font("Malgun Gothic", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.label1.Location = new System.Drawing.Point(12, 9); this.lbFileName.Location = new System.Drawing.Point(7, 9);
this.label1.Name = "label1"; this.lbFileName.Name = "lbFileName";
this.label1.Size = new System.Drawing.Size(0, 25); this.lbFileName.Size = new System.Drawing.Size(0, 25);
this.label1.TabIndex = 4; this.lbFileName.TabIndex = 4;
// //
// label2 // label2
// //
@@ -99,7 +99,7 @@
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.lbFileName);
this.Controls.Add(this.btApply); this.Controls.Add(this.btApply);
this.Controls.Add(this.cbMaterialSpring); this.Controls.Add(this.cbMaterialSpring);
this.Controls.Add(this.cbMaterialTable); this.Controls.Add(this.cbMaterialTable);
@@ -118,7 +118,7 @@
private System.Windows.Forms.ComboBox cbMaterialTable; private System.Windows.Forms.ComboBox cbMaterialTable;
private System.Windows.Forms.ComboBox cbMaterialSpring; private System.Windows.Forms.ComboBox cbMaterialSpring;
private System.Windows.Forms.Button btApply; private System.Windows.Forms.Button btApply;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label lbFileName;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
} }

View File

@@ -29,7 +29,6 @@ namespace friction
var MaterialTable = data.GetMaterialTable(); var MaterialTable = data.GetMaterialTable();
cbMaterialSpring.Items.Clear(); cbMaterialSpring.Items.Clear();
cbMaterialSpring.Items.Add("All");
foreach (var x in MaterialSpring) foreach (var x in MaterialSpring)
cbMaterialSpring.Items.Add(x); cbMaterialSpring.Items.Add(x);
cbMaterialSpring.SelectedIndex = 0; cbMaterialSpring.SelectedIndex = 0;
@@ -39,6 +38,8 @@ namespace friction
foreach (var x in MaterialTable) foreach (var x in MaterialTable)
cbMaterialTable.Items.Add(x); cbMaterialTable.Items.Add(x);
cbMaterialTable.SelectedIndex = 0; cbMaterialTable.SelectedIndex = 0;
lbFileName.Text = data.GetFileName();
} }
private void btApply_Click(object sender, EventArgs e) private void btApply_Click(object sender, EventArgs e)

50
PanelRadarGraph.Designer.cs generated Normal file
View File

@@ -0,0 +1,50 @@
namespace friction
{
partial class PanelRadarGraph
{
/// <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.SuspendLayout();
//
// PanelRadarGraph
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.ControlBox = false;
this.HideOnClose = true;
this.Name = "PanelRadarGraph";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Radar Graph";
this.Text = "Radar Graph";
this.ResumeLayout(false);
}
#endregion
}
}

25
PanelRadarGraph.cs Normal file
View File

@@ -0,0 +1,25 @@
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;
using WeifenLuo.WinFormsUI.Docking;
namespace friction
{
public partial class PanelRadarGraph : DockContent
{
MainForm m_Owner = null;
public PanelRadarGraph(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
}
}
}

120
PanelRadarGraph.resx Normal file
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

@@ -39,6 +39,8 @@
// //
// dgvData // dgvData
// //
this.dgvData.AllowUserToAddRows = false;
this.dgvData.AllowUserToDeleteRows = false;
this.dgvData.AllowUserToOrderColumns = true; this.dgvData.AllowUserToOrderColumns = true;
this.dgvData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.dgvData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
@@ -46,6 +48,7 @@
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Location = new System.Drawing.Point(3, 3); this.dgvData.Location = new System.Drawing.Point(3, 3);
this.dgvData.Name = "dgvData"; this.dgvData.Name = "dgvData";
this.dgvData.ReadOnly = true;
this.dgvData.RowTemplate.Height = 23; this.dgvData.RowTemplate.Height = 23;
this.dgvData.Size = new System.Drawing.Size(713, 724); this.dgvData.Size = new System.Drawing.Size(713, 724);
this.dgvData.TabIndex = 0; this.dgvData.TabIndex = 0;

View File

@@ -22,9 +22,9 @@ namespace friction
m_Owner = owner; m_Owner = owner;
} }
public void UpdateData(DataHandler dataHandler) public void UpdateData(DataHandler data)
{ {
dgvData.DataSource = dataHandler.GetData(); dgvData.DataSource = data.GetData();
Dictionary<string, bool> CacheChecked = new Dictionary<string, bool>(); Dictionary<string, bool> CacheChecked = new Dictionary<string, bool>();
@@ -39,7 +39,7 @@ namespace friction
lvColumn.Groups[1].Items.Clear(); lvColumn.Groups[1].Items.Clear();
lvColumn.Items.Clear(); lvColumn.Items.Clear();
List<List<string>> Columns = new List<List<string>>() { dataHandler.GetActiveColumns(), dataHandler.GetNonactiveColumns() }; List<List<string>> Columns = new List<List<string>>() { data.GetActiveColumns(), data.GetNonactiveColumns() };
for(int iGroup=0; iGroup<Columns.Count; iGroup++) for(int iGroup=0; iGroup<Columns.Count; iGroup++)
{ {
foreach(string col in Columns[iGroup]) foreach(string col in Columns[iGroup])

50
PanelTrendGraph.Designer.cs generated Normal file
View File

@@ -0,0 +1,50 @@
namespace friction
{
partial class PanelTrendGraph
{
/// <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.SuspendLayout();
//
// PanelTrendGraph
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.ControlBox = false;
this.HideOnClose = true;
this.Name = "PanelTrendGraph";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Trend Graph";
this.Text = "Trend Graph";
this.ResumeLayout(false);
}
#endregion
}
}

25
PanelTrendGraph.cs Normal file
View File

@@ -0,0 +1,25 @@
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;
using WeifenLuo.WinFormsUI.Docking;
namespace friction
{
public partial class PanelTrendGraph : DockContent
{
MainForm m_Owner = null;
public PanelTrendGraph(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
}
}
}

120
PanelTrendGraph.resx Normal file
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

@@ -57,6 +57,24 @@
<Compile Include="MainForm.Designer.cs"> <Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="PanelAnalysis.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PanelAnalysis.Designer.cs">
<DependentUpon>PanelAnalysis.cs</DependentUpon>
</Compile>
<Compile Include="PanelRadarGraph.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PanelRadarGraph.Designer.cs">
<DependentUpon>PanelRadarGraph.cs</DependentUpon>
</Compile>
<Compile Include="PanelTrendGraph.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PanelTrendGraph.Designer.cs">
<DependentUpon>PanelTrendGraph.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PanelResult.cs"> <Compile Include="PanelResult.cs">
@@ -74,6 +92,15 @@
<EmbeddedResource Include="MainForm.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="PanelAnalysis.resx">
<DependentUpon>PanelAnalysis.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PanelRadarGraph.resx">
<DependentUpon>PanelRadarGraph.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PanelTrendGraph.resx">
<DependentUpon>PanelTrendGraph.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>