레이더 그래프에 5가지 상태창 추가

피봇 기능 추가
This commit is contained in:
2017-08-08 00:48:27 +09:00
parent 879b3abda4
commit 9be9aa439a
15 changed files with 766 additions and 153 deletions

View File

@@ -11,8 +11,24 @@ namespace friction
{
public static class Config
{
public struct RANGE
{
public float m_fLow;
public float m_fHigh;
}
static string m_strPath = "";
public static readonly RANGE TEMP_ALL = new RANGE { m_fLow = -100.0f, m_fHigh = 100.0f };
public static readonly RANGE TEMP_LOW = new RANGE { m_fLow = -100.0f, m_fHigh = 0.0f };
public static readonly RANGE TEMP_NORMAL = new RANGE { m_fLow = 15.0f, m_fHigh = 25.0f };
public static readonly RANGE TEMP_HIGH = new RANGE { m_fLow = 40.0f, m_fHigh = 90.0f };
public static readonly RANGE HUMID_ALL = new RANGE { m_fLow = -100.0f, m_fHigh = 100.0f };
public static readonly RANGE HUMID_LOW = new RANGE { m_fLow = 0.0f, m_fHigh = 60.0f };
public static readonly RANGE HUMID_HIGH = new RANGE { m_fLow = 60.0f, m_fHigh = 100.0f };
static Config()
{
@@ -87,13 +103,13 @@ namespace friction
public struct COLUMN_NAME
{
public static string SPRING = "Material spring";
public static string TABLE = "material 2 table";
public static string RPN = "Risk priority number";
public static string SPRING = "SurfaceMtSpring";
public static string TABLE = "SurfaceMtCarriage";
public static string RPN = "RPN";
public static string FORCE = "normal force";
public static string TEMP = "Temperature";
public static string HUMIDITY = "Relative humidity";
public static string VELOCITY = "Relative velocity";
public static string TEMP = "temperature";
public static string HUMIDITY = "humidity";
public static string VELOCITY = "velocity";
}
@@ -176,9 +192,9 @@ namespace friction
public static RISK GetRisk(float fAvg)
{
if (fAvg <= 3)
if (fAvg <= 4)
return RISK.NO;
else if (fAvg <= 5)
else if (fAvg <= 6)
return RISK.POTENTIAL;
else
return RISK.HIGH;

View File

@@ -185,15 +185,16 @@ namespace friction
return m_strCurTable;
}
public List<RADAR_CHART> GetAvgAll(string strSpring)
public List<RADAR_CHART> GetAvgAll(string strSpring, Config.RANGE TempCond, Config.RANGE HumidCond)
{
string strQuery = string.Format("[{0}]='{1}'", Config.COLUMN_NAME.SPRING, strSpring);
string strQuery = string.Format("[{0}]='{1}' and [{2}]>={3} and [{2}]<={4} and [{5}]>={6} and [{5}]<={7}",
Config.COLUMN_NAME.SPRING, strSpring,
Config.COLUMN_NAME.TEMP, TempCond.m_fLow, TempCond.m_fHigh,
Config.COLUMN_NAME.HUMIDITY, HumidCond.m_fLow, HumidCond.m_fHigh);
DataRow[] rows = m_Data.Select(strQuery);
var group = rows
.GroupBy(r => r[Config.COLUMN_NAME.TABLE]);
var group = rows.GroupBy(r => r[Config.COLUMN_NAME.TABLE]);
List<RADAR_CHART> result = rows
.GroupBy(r => r[Config.COLUMN_NAME.TABLE])
.Select(t => new RADAR_CHART
@@ -211,10 +212,12 @@ namespace friction
public List<TREND_CHART> GetTrendChart(string strSpring, string strTable)
{
List<TREND_CHART> result = new List<TREND_CHART>();
if (m_Data.Rows.Count == 0)
return result;
string strQuery = string.Format("[{0}]='{1}' and [{2}]='{3}'", Config.COLUMN_NAME.SPRING, strSpring, Config.COLUMN_NAME.TABLE, strTable);
DataRow[] rows = m_Data.Select(strQuery);
List<TREND_CHART> result = new List<TREND_CHART>();
foreach(DataRow r in rows)
{
result.Add(new TREND_CHART

View File

@@ -90,9 +90,6 @@ namespace friction
m_DataHandler.LoadData(m_DBFileName);
toolStripButtonTrendGraph.Enabled = false;
toolStripButtonRadarGraph.Enabled = true;
m_MaterialPanel.UpdateData(m_DataHandler);
OpenPanel(m_MaterialPanel);
@@ -103,7 +100,14 @@ namespace friction
m_AnalysisPanel.UpdateData(m_DataHandler);
OpenPanel(m_AnalysisPanel);
m_RadarGraphPanel.UpdateGraph();
OpenPanel(m_RadarGraphPanel);
m_TrendGraphPanel.UpdateGraph();
OpenPanel(m_TrendGraphPanel);
m_CompatibilityPanel.UpdateData(m_DataHandler);
OpenPanel(m_CompatibilityPanel);
toolStripStatusLabel.Text = m_DBFileName;
@@ -160,12 +164,18 @@ namespace friction
private void radarGraphToolStripMenuItem_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() != "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), "All");
OpenPanel(m_RadarGraphPanel);
m_RadarGraphPanel.UpdateGraph();
}
private void trendGraphToolStripMenuItem_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() == "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetTableList()[0]);
OpenPanel(m_TrendGraphPanel);
m_TrendGraphPanel.UpdateGraph();
}
@@ -189,12 +199,18 @@ namespace friction
m_Report.MaterialSpring = m_DataHandler.GetCurSpring();
m_Report.MaterialTable = m_DataHandler.GetCurTable();
m_Report.AnalysisData = m_AnalysisPanel.GetData();
m_Report.CompatibilityData = m_CompatibilityPanel.GetData();
object[] CompData = m_CompatibilityPanel.GetData();
m_Report.CompatibilityData = (DataTable)CompData[0];
m_Report.CompatibilityColumns = (List<string>)CompData[1];
m_Report.CompatibilityRows = (List<string>)CompData[2];
m_Report.RadarChart = m_RadarGraphPanel.CopyChart();
if(m_DataHandler.GetCurTable() != "" && m_DataHandler.GetCurTable() != "All")
{
if (m_DataHandler.GetCurTable() == "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetTableList()[0]);
OpenPanel(m_TrendGraphPanel);
m_TrendGraphPanel.CopyChart(PanelTrendGraph.GRAPH_TYPE.HUMIDITY);
}
@@ -272,12 +288,18 @@ namespace friction
private void toolStripButtonRadarGraph_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() != "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), "All");
OpenPanel(m_RadarGraphPanel);
m_RadarGraphPanel.UpdateGraph();
}
private void toolStripButtonTrendGraph_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() == "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetTableList()[0]);
OpenPanel(m_TrendGraphPanel);
m_TrendGraphPanel.UpdateGraph();
}
@@ -292,9 +314,6 @@ namespace friction
if (strTable == "All")
{
trendGraphToolStripMenuItem.Enabled = toolStripButtonTrendGraph.Enabled = false;
radarGraphToolStripMenuItem.Enabled = toolStripButtonRadarGraph.Enabled = true;
if (m_RadarGraphPanel != null)
m_RadarGraphPanel.UpdateGraph();
if (m_TrendGraphPanel != null)
@@ -302,9 +321,6 @@ namespace friction
}
else
{
trendGraphToolStripMenuItem.Enabled = toolStripButtonTrendGraph.Enabled = true;
radarGraphToolStripMenuItem.Enabled = toolStripButtonRadarGraph.Enabled = false;
if (m_TrendGraphPanel != null)
m_TrendGraphPanel.UpdateGraph();
}

View File

@@ -119,7 +119,8 @@
this.lbInfo11.AutoSize = true;
this.lbInfo11.BackColor = System.Drawing.Color.LimeGreen;
this.lbInfo11.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo11.ForeColor = System.Drawing.Color.Silver;
this.lbInfo11.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo11.ForeColor = System.Drawing.Color.Black;
this.lbInfo11.Location = new System.Drawing.Point(174, 0);
this.lbInfo11.Name = "lbInfo11";
this.lbInfo11.Size = new System.Drawing.Size(250, 12);
@@ -131,7 +132,8 @@
this.lbInfo12.AutoSize = true;
this.lbInfo12.BackColor = System.Drawing.Color.Gold;
this.lbInfo12.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo12.ForeColor = System.Drawing.Color.Silver;
this.lbInfo12.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo12.ForeColor = System.Drawing.Color.Black;
this.lbInfo12.Location = new System.Drawing.Point(174, 12);
this.lbInfo12.Name = "lbInfo12";
this.lbInfo12.Size = new System.Drawing.Size(250, 12);
@@ -143,7 +145,8 @@
this.lbInfo13.AutoSize = true;
this.lbInfo13.BackColor = System.Drawing.Color.OrangeRed;
this.lbInfo13.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo13.ForeColor = System.Drawing.Color.Silver;
this.lbInfo13.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo13.ForeColor = System.Drawing.Color.Black;
this.lbInfo13.Location = new System.Drawing.Point(174, 24);
this.lbInfo13.Name = "lbInfo13";
this.lbInfo13.Size = new System.Drawing.Size(250, 12);
@@ -155,7 +158,8 @@
this.lbInfo21.AutoSize = true;
this.lbInfo21.BackColor = System.Drawing.Color.LimeGreen;
this.lbInfo21.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo21.ForeColor = System.Drawing.Color.Silver;
this.lbInfo21.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo21.ForeColor = System.Drawing.Color.Black;
this.lbInfo21.Location = new System.Drawing.Point(601, 0);
this.lbInfo21.Name = "lbInfo21";
this.lbInfo21.Size = new System.Drawing.Size(252, 12);
@@ -167,7 +171,8 @@
this.lbInfo22.AutoSize = true;
this.lbInfo22.BackColor = System.Drawing.Color.Gold;
this.lbInfo22.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo22.ForeColor = System.Drawing.Color.Silver;
this.lbInfo22.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo22.ForeColor = System.Drawing.Color.Black;
this.lbInfo22.Location = new System.Drawing.Point(601, 12);
this.lbInfo22.Name = "lbInfo22";
this.lbInfo22.Size = new System.Drawing.Size(252, 12);
@@ -179,7 +184,8 @@
this.lbInfo23.AutoSize = true;
this.lbInfo23.BackColor = System.Drawing.Color.OrangeRed;
this.lbInfo23.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo23.ForeColor = System.Drawing.Color.Silver;
this.lbInfo23.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo23.ForeColor = System.Drawing.Color.Black;
this.lbInfo23.Location = new System.Drawing.Point(601, 24);
this.lbInfo23.Name = "lbInfo23";
this.lbInfo23.Size = new System.Drawing.Size(252, 12);
@@ -191,7 +197,8 @@
this.lbInfo24.AutoSize = true;
this.lbInfo24.BackColor = System.Drawing.Color.DarkGray;
this.lbInfo24.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo24.ForeColor = System.Drawing.Color.Silver;
this.lbInfo24.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo24.ForeColor = System.Drawing.Color.Black;
this.lbInfo24.Location = new System.Drawing.Point(601, 36);
this.lbInfo24.Name = "lbInfo24";
this.lbInfo24.Size = new System.Drawing.Size(252, 12);
@@ -215,12 +222,17 @@
this.Controls.Add(this.lbSpring);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.dgvAnalysis);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelAnalysis";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Analysis Table";
this.Text = "Analysis Table";
this.Resize += new System.EventHandler(this.PanelAnalysis_Resize);
((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();

View File

@@ -174,5 +174,10 @@ namespace friction
m_Owner.OnApplyData(this, m_CurSpring, strTable);
}
}
private void PanelAnalysis_Resize(object sender, EventArgs e)
{
Console.WriteLine("Panel size : {0}", this.Bounds);
}
}
}

View File

@@ -30,7 +30,20 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelCompatibility));
this.dgvMap = new System.Windows.Forms.DataGridView();
this.btPivot = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dgvMap)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// dgvMap
@@ -39,24 +52,173 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvMap.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvMap.Location = new System.Drawing.Point(12, 12);
this.dgvMap.Location = new System.Drawing.Point(12, 65);
this.dgvMap.Name = "dgvMap";
this.dgvMap.RowTemplate.Height = 23;
this.dgvMap.Size = new System.Drawing.Size(799, 647);
this.dgvMap.Size = new System.Drawing.Size(799, 498);
this.dgvMap.TabIndex = 0;
//
// btPivot
//
this.btPivot.Location = new System.Drawing.Point(12, 12);
this.btPivot.Name = "btPivot";
this.btPivot.Size = new System.Drawing.Size(75, 23);
this.btPivot.TabIndex = 1;
this.btPivot.Text = "Pivot";
this.btPivot.UseVisualStyleBackColor = true;
this.btPivot.Click += new System.EventHandler(this.btPivot_Click);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 5;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.Controls.Add(this.label10, 4, 1);
this.tableLayoutPanel1.Controls.Add(this.label9, 3, 1);
this.tableLayoutPanel1.Controls.Add(this.label8, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.label7, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.label5, 4, 0);
this.tableLayoutPanel1.Controls.Add(this.label4, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.label3, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.label2, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label6, 0, 1);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 569);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(799, 99);
this.tableLayoutPanel1.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(153, 49);
this.label1.TabIndex = 10;
this.label1.Text = "Normal Temp\r\nLow Humid";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(162, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(153, 49);
this.label2.TabIndex = 11;
this.label2.Text = "Normal Temp\r\nHigh Humid";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(321, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(153, 49);
this.label3.TabIndex = 12;
this.label3.Text = "High Temp\r\nLow Humid";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Location = new System.Drawing.Point(480, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(153, 49);
this.label4.TabIndex = 13;
this.label4.Text = "High Temp\r\nHigh Humid";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Location = new System.Drawing.Point(639, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(157, 49);
this.label5.TabIndex = 14;
this.label5.Text = "Low Temp";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
this.label6.Location = new System.Drawing.Point(3, 49);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(153, 50);
this.label6.TabIndex = 15;
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
this.label7.Location = new System.Drawing.Point(162, 49);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(153, 50);
this.label7.TabIndex = 16;
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Dock = System.Windows.Forms.DockStyle.Fill;
this.label8.Location = new System.Drawing.Point(321, 49);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(153, 50);
this.label8.TabIndex = 17;
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
this.label9.Location = new System.Drawing.Point(480, 49);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(153, 50);
this.label9.TabIndex = 18;
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Dock = System.Windows.Forms.DockStyle.Fill;
this.label10.Location = new System.Drawing.Point(639, 49);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(157, 50);
this.label10.TabIndex = 19;
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// PanelCompatibility
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(823, 671);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.btPivot);
this.Controls.Add(this.dgvMap);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelCompatibility";
this.Text = "Material Compatibility Map";
((System.ComponentModel.ISupportInitialize)(this.dgvMap)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
@@ -64,5 +226,17 @@
#endregion
private System.Windows.Forms.DataGridView dgvMap;
private System.Windows.Forms.Button btPivot;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label6;
}
}

View File

@@ -13,6 +13,8 @@ namespace friction
{
public partial class PanelCompatibility : DockContent
{
const int HEADER_SIZE = 100;
MainForm m_Owner = null;
public PanelCompatibility(MainForm owner)
@@ -26,9 +28,20 @@ namespace friction
dgvMap.CellPainting += DgvMap_CellPainting;
dgvMap.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
dgvMap.ColumnHeadersHeight = 100;
dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
dgvMap.DefaultCellStyle.Format = "N2";
dgvMap.ColumnHeadersHeight = HEADER_SIZE;
dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dgvMap.RowHeadersWidth = HEADER_SIZE;
dgvMap.DefaultCellStyle.Format = "N0";
dgvMap.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
dgvMap.RowHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
dgvMap.CellToolTipTextNeeded += DgvMap_CellToolTipTextNeeded;
}
private void DgvMap_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e)
{
e.ToolTipText = "tooltip";
}
public void UpdateData(DataHandler data)
@@ -40,26 +53,36 @@ namespace friction
dgvMap.Columns.Clear();
int iCol = dgvMap.Columns.Add("table", "table");
dgvMap.Columns[iCol].SortMode = DataGridViewColumnSortMode.NotSortable;
foreach (var table in Tables)
{
int iCol = dgvMap.Columns.Add(table, table);
dgvMap.Columns[iCol].Width = 29;
string strHeaderText = table;
//if (strHeaderText.Length > 10)
// strHeaderText = strHeaderText.Substring(0, 7) + "...";
iCol = dgvMap.Columns.Add(table, strHeaderText);
dgvMap.Columns[iCol].Width = 10;
dgvMap.Columns[iCol].SortMode = DataGridViewColumnSortMode.NotSortable;
dgvMap.Columns[iCol].HeaderCell.ToolTipText = table;
}
int iRow = dgvMap.Rows.Add();
dgvMap.Rows[iRow].HeaderCell.Value = "spring";
foreach (var spring in Springs)
{
int iRow = dgvMap.Rows.Add();
iRow = dgvMap.Rows.Add();
dgvMap.Rows[iRow].HeaderCell.Value = spring;
dgvMap.Rows[iRow].HeaderCell.ToolTipText = spring;
var Averages = data.GetAvgAll(spring);
var Averages = data.GetAvgAll(spring, Config.TEMP_ALL, Config.HUMID_ALL);
foreach(var avg in Averages)
{
if(avg.m_fAvg > 0)
if(avg.m_fMax > 0)
{
var cell = dgvMap.Rows[iRow].Cells[avg.m_strTable];
cell.Value = avg.m_fAvg;
Config.ANALYSIS.RISK Risk = Config.ANALYSIS.GetRisk(avg.m_fAvg);
cell.Value = avg.m_fMax;
Config.ANALYSIS.RISK Risk = Config.ANALYSIS.GetRisk(avg.m_fMax);
switch(Risk)
{
case Config.ANALYSIS.RISK.NO:
@@ -75,28 +98,40 @@ namespace friction
}
}
}
foreach (DataGridViewColumn column in dgvMap.Columns)
{
column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
column.ReadOnly = true;
}
}
public DataTable GetData()
public object[] GetData()
{
List<string> ColumnHeaders = new List<string>();
List<string> RowHeaders = new List<string>();
var dt = new DataTable();
dt.Columns.Add(" ");
foreach (DataGridViewColumn column in dgvMap.Columns)
{
if (column.Visible)
dt.Columns.Add(column.HeaderText);
ColumnHeaders.Add(column.HeaderText);
}
object[] cellValues = new object[dgvMap.Columns.Count+1];
object[] cellValues = new object[dgvMap.Columns.Count];
foreach (DataGridViewRow row in dgvMap.Rows)
{
cellValues[0] = row.HeaderCell.Value;
for (int i = 0; i < row.Cells.Count; i++)
cellValues[i+1] = row.Cells[i].Value;
cellValues[i] = row.Cells[i].Value;
dt.Rows.Add(cellValues);
RowHeaders.Add((string)row.HeaderCell.Value);
}
return dt;
return new object[]{ dt, ColumnHeaders, RowHeaders };
}
private void DgvMap_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
@@ -113,6 +148,8 @@ namespace friction
Size titleSize = TextRenderer.MeasureText(e.Value.ToString(), e.CellStyle.Font);
if (view.ColumnHeadersHeight < titleSize.Width)
view.ColumnHeadersHeight = titleSize.Width;
if (view.ColumnHeadersHeight > HEADER_SIZE)
view.ColumnHeadersHeight = HEADER_SIZE;
e.Graphics.TranslateTransform(0, titleSize.Width);
e.Graphics.RotateTransform(-90.0F);
e.Graphics.DrawString(e.Value.ToString(), this.Font, brush,
@@ -122,5 +159,59 @@ namespace friction
e.Handled = true;
}
}
void Pivot()
{
object[] viewData = GetData();
DataTable data = (DataTable)viewData[0];
List<string> ColumnHeaders = (List<string>)viewData[1];
List<string> RowHeaders = (List<string>)viewData[2];
dgvMap.Rows.Clear();
dgvMap.Columns.Clear();
int iColSize = ColumnHeaders.Count;
int iRowSize = RowHeaders.Count - 1;
for (int i = 0; i < iRowSize; i++)
dgvMap.Columns.Add(RowHeaders[i], RowHeaders[i]);
for (int iCol = 0; iCol < iColSize; iCol++)
{
int iRowIdx = dgvMap.Rows.Add();
dgvMap.Rows[iRowIdx].HeaderCell.Value = ColumnHeaders[iCol];
for (int iRow = 0; iRow < iRowSize; iRow++)
{
DataGridViewCell cell = dgvMap.Rows[iRowIdx].Cells[iRow];
cell.Value = data.Rows[iRow][iCol];
float fValue = 0;
if (cell.Value.GetType() != typeof(System.DBNull))
{
float.TryParse((string)cell.Value, out fValue);
Config.ANALYSIS.RISK Risk = Config.ANALYSIS.GetRisk(fValue);
switch (Risk)
{
case Config.ANALYSIS.RISK.NO:
cell.Style.BackColor = Theme.Green;
break;
case Config.ANALYSIS.RISK.POTENTIAL:
cell.Style.BackColor = Theme.Yellow;
break;
case Config.ANALYSIS.RISK.HIGH:
cell.Style.BackColor = Theme.Red;
break;
}
}
}
}
for (int i = 0; i < iRowSize; i++)
dgvMap.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
}
private void btPivot_Click(object sender, EventArgs e)
{
Pivot();
}
}
}

View File

@@ -32,9 +32,9 @@
this.lbFileName = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.lvSpring = new System.Windows.Forms.ListView();
this.lvSpring = new NoDoubleClickAutoCheckListview();
this.lvchSpring = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lvTable = new System.Windows.Forms.ListView();
this.lvTable = new NoDoubleClickAutoCheckListview();
this.lvchTable = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1.SuspendLayout();
@@ -71,6 +71,7 @@
//
// lvSpring
//
this.lvSpring.CheckBoxes = true;
this.lvSpring.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.lvchSpring});
this.lvSpring.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -92,6 +93,7 @@
//
// lvTable
//
this.lvTable.CheckBoxes = true;
this.lvTable.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.lvchTable});
this.lvTable.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -139,6 +141,10 @@
this.ClientSize = new System.Drawing.Size(298, 727);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelMaterial";
@@ -155,8 +161,8 @@
private System.Windows.Forms.Label lbFileName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ListView lvSpring;
private System.Windows.Forms.ListView lvTable;
private NoDoubleClickAutoCheckListview lvSpring;
private NoDoubleClickAutoCheckListview lvTable;
private System.Windows.Forms.ColumnHeader lvchSpring;
private System.Windows.Forms.ColumnHeader lvchTable;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;

View File

@@ -28,6 +28,11 @@ namespace friction
Theme.Apply(this);
Theme.Apply(lvSpring);
Theme.Apply(lvTable);
lvSpring.ListViewItemSorter = new ListViewItemCheckboxComparer();
lvSpring.ItemChecked += Listview_ItemChecked;
lvTable.ListViewItemSorter = new ListViewItemCheckboxComparer();
lvTable.ItemChecked += Listview_ItemChecked;
}
public void UpdateData(DataHandler data)
@@ -129,5 +134,68 @@ namespace friction
if (lvTable.SelectedIndices.Count == 1)
SelectTable(lvTable.SelectedIndices[0]);
}
private void Listview_ItemChecked(object sender, ItemCheckedEventArgs e)
{
ListView view = (ListView)sender;
if (view == lvTable && e.Item.Text == "All")
e.Item.Checked = true;
view.Sort();
}
private class ListViewItemCheckboxComparer : IComparer<ListViewItem>, System.Collections.IComparer
{
public int Compare(ListViewItem x, ListViewItem y)
{
if (x.Text == "All")
return -1;
else if (y.Text == "All")
return 1;
else if (x.Checked != y.Checked)
return -(x.Checked ? 1 : 0).CompareTo(y.Checked ? 1 : 0);
else
return x.Text.CompareTo(y.Text);
}
public int Compare(object x, object y)
{
return Compare(x as ListViewItem, y as ListViewItem);
}
}
}
public class NoDoubleClickAutoCheckListview : ListView
{
private bool checkFromDoubleClick = false;
protected override void OnItemCheck(ItemCheckEventArgs ice)
{
if (this.checkFromDoubleClick)
{
ice.NewValue = ice.CurrentValue;
this.checkFromDoubleClick = false;
}
else
base.OnItemCheck(ice);
}
protected override void OnMouseDown(MouseEventArgs e)
{
// Is this a double-click?
if ((e.Button == MouseButtons.Left) && (e.Clicks > 1))
{
this.checkFromDoubleClick = true;
}
base.OnMouseDown(e);
}
protected override void OnKeyDown(KeyEventArgs e)
{
this.checkFromDoubleClick = false;
base.OnKeyDown(e);
}
}
}

View File

@@ -28,18 +28,28 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series13 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series14 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series15 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series16 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series17 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series18 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelRadarGraph));
this.chart = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.lbSpring = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.rbAll = new System.Windows.Forms.RadioButton();
this.rbNormalLow = new System.Windows.Forms.RadioButton();
this.rbNormalHigh = new System.Windows.Forms.RadioButton();
this.rbHighLow = new System.Windows.Forms.RadioButton();
this.rbHighHigh = new System.Windows.Forms.RadioButton();
this.rbLowTemp = new System.Windows.Forms.RadioButton();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// chart
@@ -47,63 +57,63 @@
this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
chartArea3.Area3DStyle.Enable3D = true;
chartArea3.AxisX.MajorGrid.Enabled = false;
chartArea3.AxisX.MajorTickMark.LineWidth = 0;
chartArea3.AxisX2.MajorGrid.Enabled = false;
chartArea3.BackImageTransparentColor = System.Drawing.Color.Black;
chartArea3.Name = "ChartArea1";
this.chart.ChartAreas.Add(chartArea3);
legend3.Name = "Legend1";
this.chart.Legends.Add(legend3);
this.chart.Location = new System.Drawing.Point(12, 27);
chartArea1.Area3DStyle.Enable3D = true;
chartArea1.AxisX.MajorGrid.Enabled = false;
chartArea1.AxisX.MajorTickMark.LineWidth = 0;
chartArea1.AxisX2.MajorGrid.Enabled = false;
chartArea1.BackImageTransparentColor = System.Drawing.Color.Black;
chartArea1.Name = "ChartArea1";
this.chart.ChartAreas.Add(chartArea1);
legend1.Name = "Legend1";
this.chart.Legends.Add(legend1);
this.chart.Location = new System.Drawing.Point(12, 90);
this.chart.Name = "chart";
series13.ChartArea = "ChartArea1";
series13.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series13.IsVisibleInLegend = false;
series13.Legend = "Legend1";
series13.LegendText = "High Risk";
series13.MarkerSize = 0;
series13.Name = "SeriesHigh";
series14.ChartArea = "ChartArea1";
series14.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series14.IsVisibleInLegend = false;
series14.Legend = "Legend1";
series14.LegendText = "Potential Risk";
series14.MarkerSize = 0;
series14.Name = "SeriesPotential";
series15.ChartArea = "ChartArea1";
series15.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series15.IsVisibleInLegend = false;
series15.Legend = "Legend1";
series15.LegendText = "No Risk";
series15.MarkerSize = 0;
series15.Name = "SeriesNo";
series16.ChartArea = "ChartArea1";
series16.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series16.Legend = "Legend1";
series16.LegendText = "Max";
series16.MarkerSize = 0;
series16.Name = "SeriesMax";
series17.ChartArea = "ChartArea1";
series17.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series17.Legend = "Legend1";
series17.LegendText = "Average";
series17.MarkerSize = 0;
series17.Name = "SeriesAvg";
series18.ChartArea = "ChartArea1";
series18.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series18.Legend = "Legend1";
series18.LegendText = "Min";
series18.MarkerSize = 0;
series18.Name = "SeriesMin";
this.chart.Series.Add(series13);
this.chart.Series.Add(series14);
this.chart.Series.Add(series15);
this.chart.Series.Add(series16);
this.chart.Series.Add(series17);
this.chart.Series.Add(series18);
this.chart.Size = new System.Drawing.Size(791, 620);
series1.ChartArea = "ChartArea1";
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series1.IsVisibleInLegend = false;
series1.Legend = "Legend1";
series1.LegendText = "High Risk";
series1.MarkerSize = 0;
series1.Name = "SeriesHigh";
series2.ChartArea = "ChartArea1";
series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series2.IsVisibleInLegend = false;
series2.Legend = "Legend1";
series2.LegendText = "Potential Risk";
series2.MarkerSize = 0;
series2.Name = "SeriesPotential";
series3.ChartArea = "ChartArea1";
series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series3.IsVisibleInLegend = false;
series3.Legend = "Legend1";
series3.LegendText = "No Risk";
series3.MarkerSize = 0;
series3.Name = "SeriesNo";
series4.ChartArea = "ChartArea1";
series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series4.Legend = "Legend1";
series4.LegendText = "Max";
series4.MarkerSize = 0;
series4.Name = "SeriesMax";
series5.ChartArea = "ChartArea1";
series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series5.Legend = "Legend1";
series5.LegendText = "Average";
series5.MarkerSize = 0;
series5.Name = "SeriesAvg";
series6.ChartArea = "ChartArea1";
series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series6.Legend = "Legend1";
series6.LegendText = "Min";
series6.MarkerSize = 0;
series6.Name = "SeriesMin";
this.chart.Series.Add(series1);
this.chart.Series.Add(series2);
this.chart.Series.Add(series3);
this.chart.Series.Add(series4);
this.chart.Series.Add(series5);
this.chart.Series.Add(series6);
this.chart.Size = new System.Drawing.Size(791, 557);
this.chart.TabIndex = 0;
this.chart.Text = "chart";
this.chart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.chart_MouseClick);
@@ -111,19 +121,124 @@
// lbSpring
//
this.lbSpring.AutoSize = true;
this.lbSpring.Location = new System.Drawing.Point(12, 12);
this.lbSpring.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbSpring.Location = new System.Drawing.Point(11, 8);
this.lbSpring.Name = "lbSpring";
this.lbSpring.Size = new System.Drawing.Size(0, 12);
this.lbSpring.TabIndex = 1;
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.lbSpring);
this.panel1.Location = new System.Drawing.Point(12, -1);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(791, 25);
this.panel1.TabIndex = 2;
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.rbLowTemp);
this.groupBox1.Controls.Add(this.rbHighHigh);
this.groupBox1.Controls.Add(this.rbHighLow);
this.groupBox1.Controls.Add(this.rbNormalHigh);
this.groupBox1.Controls.Add(this.rbNormalLow);
this.groupBox1.Controls.Add(this.rbAll);
this.groupBox1.Location = new System.Drawing.Point(12, 30);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(623, 54);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
//
// rbAll
//
this.rbAll.Appearance = System.Windows.Forms.Appearance.Button;
this.rbAll.Location = new System.Drawing.Point(6, 13);
this.rbAll.Name = "rbAll";
this.rbAll.Size = new System.Drawing.Size(96, 34);
this.rbAll.TabIndex = 0;
this.rbAll.TabStop = true;
this.rbAll.Text = "All";
this.rbAll.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.rbAll.UseVisualStyleBackColor = true;
this.rbAll.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbNormalLow
//
this.rbNormalLow.Appearance = System.Windows.Forms.Appearance.Button;
this.rbNormalLow.Location = new System.Drawing.Point(108, 13);
this.rbNormalLow.Name = "rbNormalLow";
this.rbNormalLow.Size = new System.Drawing.Size(96, 34);
this.rbNormalLow.TabIndex = 0;
this.rbNormalLow.TabStop = true;
this.rbNormalLow.Text = "Normal Temp\r\nLow Humid";
this.rbNormalLow.UseVisualStyleBackColor = true;
this.rbNormalLow.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbNormalHigh
//
this.rbNormalHigh.Appearance = System.Windows.Forms.Appearance.Button;
this.rbNormalHigh.Location = new System.Drawing.Point(210, 13);
this.rbNormalHigh.Name = "rbNormalHigh";
this.rbNormalHigh.Size = new System.Drawing.Size(96, 34);
this.rbNormalHigh.TabIndex = 0;
this.rbNormalHigh.TabStop = true;
this.rbNormalHigh.Text = "Normal Temp\r\nHigh Humid";
this.rbNormalHigh.UseVisualStyleBackColor = true;
this.rbNormalHigh.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbHighLow
//
this.rbHighLow.Appearance = System.Windows.Forms.Appearance.Button;
this.rbHighLow.Location = new System.Drawing.Point(312, 13);
this.rbHighLow.Name = "rbHighLow";
this.rbHighLow.Size = new System.Drawing.Size(96, 34);
this.rbHighLow.TabIndex = 0;
this.rbHighLow.TabStop = true;
this.rbHighLow.Text = "High Temp\r\nLow Humid";
this.rbHighLow.UseVisualStyleBackColor = true;
this.rbHighLow.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbHighHigh
//
this.rbHighHigh.Appearance = System.Windows.Forms.Appearance.Button;
this.rbHighHigh.Location = new System.Drawing.Point(414, 13);
this.rbHighHigh.Name = "rbHighHigh";
this.rbHighHigh.Size = new System.Drawing.Size(96, 34);
this.rbHighHigh.TabIndex = 0;
this.rbHighHigh.TabStop = true;
this.rbHighHigh.Text = "High Temp\r\nHigh Humid";
this.rbHighHigh.UseVisualStyleBackColor = true;
this.rbHighHigh.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbLowTemp
//
this.rbLowTemp.Appearance = System.Windows.Forms.Appearance.Button;
this.rbLowTemp.Location = new System.Drawing.Point(516, 13);
this.rbLowTemp.Name = "rbLowTemp";
this.rbLowTemp.Size = new System.Drawing.Size(96, 34);
this.rbLowTemp.TabIndex = 0;
this.rbLowTemp.TabStop = true;
this.rbLowTemp.Text = "Low Temp";
this.rbLowTemp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.rbLowTemp.UseVisualStyleBackColor = true;
this.rbLowTemp.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// PanelRadarGraph
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(815, 659);
this.ControlBox = false;
this.Controls.Add(this.lbSpring);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.chart);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelRadarGraph";
@@ -132,8 +247,10 @@
this.Text = "Radar Graph";
this.VisibleChanged += new System.EventHandler(this.PanelRadarGraph_VisibleChanged);
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -141,5 +258,13 @@
private System.Windows.Forms.DataVisualization.Charting.Chart chart;
private System.Windows.Forms.Label lbSpring;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton rbLowTemp;
private System.Windows.Forms.RadioButton rbHighHigh;
private System.Windows.Forms.RadioButton rbHighLow;
private System.Windows.Forms.RadioButton rbNormalHigh;
private System.Windows.Forms.RadioButton rbNormalLow;
private System.Windows.Forms.RadioButton rbAll;
}
}

View File

@@ -22,6 +22,9 @@ namespace friction
string m_CurSpring = "";
bool m_bShowAlert = false;
Config.RANGE m_TempRange = Config.TEMP_ALL;
Config.RANGE m_HumidRange = Config.HUMID_ALL;
public PanelRadarGraph(MainForm owner, DataHandler data)
{
InitializeComponent();
@@ -30,6 +33,12 @@ namespace friction
m_DataHandler = data;
Theme.Apply(this);
Theme.Apply(rbAll);
Theme.Apply(rbNormalLow);
Theme.Apply(rbNormalHigh);
Theme.Apply(rbHighLow);
Theme.Apply(rbHighHigh);
Theme.Apply(rbLowTemp);
chart.ChartAreas[0].AxisY.Maximum = 10;
@@ -38,27 +47,27 @@ namespace friction
//chart.Series["SeriesPotential"].Color = Color.FromArgb(255, 180, 180, 180);
//chart.Series["SeriesNo"].Color = Color.FromArgb(255, 140, 140, 140);
chart.Series["SeriesHigh"].Color = Theme.Red;
chart.Series["SeriesHigh"].Color = Color.FromArgb(255, 255, 185, 185);
chart.Series["SeriesHigh"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesPotential"].Color = Theme.Yellow;
chart.Series["SeriesPotential"].Color = Color.FromArgb(255, 255, 255, 151);
chart.Series["SeriesPotential"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesNo"].Color = Theme.Green;
chart.Series["SeriesNo"].Color = Color.FromArgb(255, 175, 255, 211);
chart.Series["SeriesNo"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesMax"].Color = Theme.Red;
chart.Series["SeriesMax"].Color = Color.FromArgb(255, 192, 0, 0);
chart.Series["SeriesMax"]["RadarDrawingStyle"] = "Line";
chart.Series["SeriesMax"].BorderWidth = 3;
chart.Series["SeriesMax"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesAvg"].Color = Theme.Yellow;
chart.Series["SeriesAvg"].Color = Color.FromArgb(255, 229, 150, 9);
chart.Series["SeriesAvg"]["RadarDrawingStyle"] = "Line";
chart.Series["SeriesAvg"].BorderWidth = 3;
chart.Series["SeriesAvg"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesMin"].Color = Theme.Green;
chart.Series["SeriesMin"].Color = Color.FromArgb(255, 79, 98, 40);
chart.Series["SeriesMin"]["RadarDrawingStyle"] = "Line";
chart.Series["SeriesMin"].BorderWidth = 3;
chart.Series["SeriesMin"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
@@ -75,8 +84,13 @@ namespace friction
chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = Color.FromArgb(150, 0, 0, 0);
chart.ChartAreas[0].AxisY.MinorTickMark.Enabled = false;
chart.ChartAreas[0].AxisX.LabelAutoFitStyle = LabelAutoFitStyles.DecreaseFont;
chart.ChartAreas[0].AxisX.IsLabelAutoFit = true;
foreach (var series in chart.Series)
series["AreaDrawingStyle"] = "Polygon";
panel1.BackColor = Color.Gray;
}
public void Reset()
@@ -87,17 +101,17 @@ namespace friction
public void UpdateGraph()
{
string strSpring = m_DataHandler.GetCurSpring();
if (m_CurSpring == strSpring)
return;
//if (m_CurSpring == strSpring)
// return;
lbSpring.Text = "Material Spring: " + strSpring;
lbSpring.BackColor = Color.Transparent;
lbSpring.ForeColor = Theme.Orange;
lbSpring.BackColor = Color.Gray;
lbSpring.ForeColor = Color.Black;
foreach (var series in chart.Series)
series.Points.Clear();
List<DataHandler.RADAR_CHART> graphData = m_DataHandler.GetAvgAll(strSpring);
List<DataHandler.RADAR_CHART> graphData = m_DataHandler.GetAvgAll(strSpring, m_TempRange, m_HumidRange);
List<string> xValues = new List<string>();
List<float> yValues = new List<float>();
@@ -151,5 +165,41 @@ namespace friction
m_bShowAlert = false;
}
}
private void rbAll_CheckedChanged(object sender, EventArgs e)
{
if(rbAll.Checked == true)
{
m_TempRange = Config.TEMP_ALL;
m_HumidRange = Config.HUMID_ALL;
}
else if (rbNormalLow.Checked == true)
{
m_TempRange = Config.TEMP_NORMAL;
m_HumidRange = Config.HUMID_LOW;
}
else if (rbNormalHigh.Checked == true)
{
m_TempRange = Config.TEMP_NORMAL;
m_HumidRange = Config.HUMID_HIGH;
}
else if (rbHighLow.Checked == true)
{
m_TempRange = Config.TEMP_HIGH;
m_HumidRange = Config.HUMID_LOW;
}
else if (rbHighHigh.Checked == true)
{
m_TempRange = Config.TEMP_HIGH;
m_HumidRange = Config.HUMID_HIGH;
}
else if (rbLowTemp.Checked == true)
{
m_TempRange = Config.TEMP_LOW;
m_HumidRange = Config.HUMID_ALL;
}
UpdateGraph();
}
}
}

View File

@@ -48,7 +48,7 @@
this.dgvData.Name = "dgvData";
this.dgvData.ReadOnly = true;
this.dgvData.RowTemplate.Height = 23;
this.dgvData.Size = new System.Drawing.Size(713, 724);
this.dgvData.Size = new System.Drawing.Size(713, 719);
this.dgvData.TabIndex = 0;
//
// lvColumn
@@ -63,7 +63,7 @@
this.lvColumn.Location = new System.Drawing.Point(722, 3);
this.lvColumn.MultiSelect = false;
this.lvColumn.Name = "lvColumn";
this.lvColumn.Size = new System.Drawing.Size(199, 724);
this.lvColumn.Size = new System.Drawing.Size(199, 718);
this.lvColumn.TabIndex = 1;
this.lvColumn.UseCompatibleStateImageBehavior = false;
this.lvColumn.View = System.Windows.Forms.View.Details;
@@ -83,6 +83,10 @@
this.ControlBox = false;
this.Controls.Add(this.lvColumn);
this.Controls.Add(this.dgvData);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelResult";

View File

@@ -36,7 +36,9 @@
this.rbVelocity = new System.Windows.Forms.RadioButton();
this.rbForce = new System.Windows.Forms.RadioButton();
this.panelGraph = new System.Windows.Forms.Panel();
this.lbPair = new System.Windows.Forms.Label();
this.lbPair1 = new System.Windows.Forms.Label();
this.lbPair2 = new System.Windows.Forms.Label();
this.lbPair3 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.panelGraph.SuspendLayout();
this.SuspendLayout();
@@ -46,7 +48,7 @@
this.trendChart.Dock = System.Windows.Forms.DockStyle.Fill;
this.trendChart.Location = new System.Drawing.Point(0, 0);
this.trendChart.Name = "trendChart";
this.trendChart.Size = new System.Drawing.Size(742, 603);
this.trendChart.Size = new System.Drawing.Size(701, 603);
this.trendChart.TabIndex = 0;
this.trendChart.Text = "trendChart";
this.trendChart.UpdaterTick += new LiveCharts.Events.UpdaterTickHandler(this.trendChart_UpdaterTick);
@@ -125,18 +127,37 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panelGraph.Controls.Add(this.trendChart);
this.panelGraph.Location = new System.Drawing.Point(8, 59);
this.panelGraph.Location = new System.Drawing.Point(34, 59);
this.panelGraph.Name = "panelGraph";
this.panelGraph.Size = new System.Drawing.Size(742, 603);
this.panelGraph.Size = new System.Drawing.Size(701, 603);
this.panelGraph.TabIndex = 3;
//
// lbPair
// lbPair1
//
this.lbPair.AutoSize = true;
this.lbPair.Location = new System.Drawing.Point(327, 28);
this.lbPair.Name = "lbPair";
this.lbPair.Size = new System.Drawing.Size(0, 12);
this.lbPair.TabIndex = 4;
this.lbPair1.AutoSize = true;
this.lbPair1.Location = new System.Drawing.Point(327, 28);
this.lbPair1.Name = "lbPair1";
this.lbPair1.Size = new System.Drawing.Size(32, 12);
this.lbPair1.TabIndex = 4;
this.lbPair1.Text = "label";
//
// lbPair2
//
this.lbPair2.AutoSize = true;
this.lbPair2.Location = new System.Drawing.Point(365, 28);
this.lbPair2.Name = "lbPair2";
this.lbPair2.Size = new System.Drawing.Size(32, 12);
this.lbPair2.TabIndex = 5;
this.lbPair2.Text = "label";
//
// lbPair3
//
this.lbPair3.AutoSize = true;
this.lbPair3.Location = new System.Drawing.Point(403, 28);
this.lbPair3.Name = "lbPair3";
this.lbPair3.Size = new System.Drawing.Size(32, 12);
this.lbPair3.TabIndex = 6;
this.lbPair3.Text = "label";
//
// PanelTrendGraph
//
@@ -144,9 +165,15 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(762, 674);
this.ControlBox = false;
this.Controls.Add(this.lbPair);
this.Controls.Add(this.lbPair3);
this.Controls.Add(this.lbPair2);
this.Controls.Add(this.lbPair1);
this.Controls.Add(this.panelGraph);
this.Controls.Add(this.groupBox1);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelTrendGraph";
@@ -170,6 +197,8 @@
private System.Windows.Forms.RadioButton rbVelocity;
private System.Windows.Forms.RadioButton rbForce;
private System.Windows.Forms.Panel panelGraph;
private System.Windows.Forms.Label lbPair;
private System.Windows.Forms.Label lbPair1;
private System.Windows.Forms.Label lbPair2;
private System.Windows.Forms.Label lbPair3;
}
}

View File

@@ -53,7 +53,13 @@ namespace friction
Theme.Apply(groupBox1);
Theme.Apply(rbHumidity);
Theme.Apply(rbTemp);
lbPair.ForeColor = Theme.Orange;
lbPair1.ForeColor = Theme.Orange;
lbPair2.ForeColor = Theme.White;
lbPair3.ForeColor = Theme.Orange;
lbPair1.Text = "";
lbPair2.Text = "";
lbPair3.Text = "";
@@ -191,21 +197,21 @@ namespace friction
Title = "Low Temp",
Values = Points[0],
Fill = brushes[0],
LabelPoint = p => string.Format("{0:n2}, {1}", p.X, p.Y),
LabelPoint = p => string.Format("{0:n2}%, RPN {1}", p.X, p.Y),
},
new ScatterSeries
{
Title = "Mid Temp",
Values = Points[1],
Fill = brushes[1],
LabelPoint = p => string.Format("{0:n2}, {1}", p.X, p.Y),
LabelPoint = p => string.Format("{0:n2}%, RPN {1}", p.X, p.Y),
},
new ScatterSeries
{
Title = "High Temp",
Values = Points[2],
Fill = brushes[2],
LabelPoint = p => string.Format("{0:n2}, {1}", p.X, p.Y),
LabelPoint = p => string.Format("{0:n2}%, RPN {1}", p.X, p.Y),
},
new LineSeries
{
@@ -265,14 +271,14 @@ namespace friction
Title = "Low Humidity",
Values = Points[0],
Foreground = System.Windows.Media.Brushes.SkyBlue,
LabelPoint = p => string.Format("{0:n2}, {1}", p.X, p.Y),
LabelPoint = p => string.Format("{0:n2}℃, RPN {1}", p.X, p.Y),
},
new ScatterSeries
{
Title = "High Humidity",
Values = Points[1],
Foreground = System.Windows.Media.Brushes.DarkBlue,
LabelPoint = p => string.Format("{0:n2}, {1}", p.X, p.Y),
LabelPoint = p => string.Format("{0:n2}℃, RPN {1}", p.X, p.Y),
},
new LineSeries
{
@@ -429,7 +435,12 @@ namespace friction
m_CurTable = strTable;
m_GraphType = Type;
lbPair.Text = string.Format("{0} vs {1}", strSpring, strTable);
lbPair1.Text = strSpring;
lbPair2.Text = " vs ";
lbPair3.Text = strTable;
lbPair2.Left = lbPair1.Right;
lbPair3.Left = lbPair2.Right;
}
private void rbHumidity_CheckedChanged(object sender, EventArgs e)
@@ -487,5 +498,6 @@ namespace friction
m_Owner.OnChartUpdate(bm, m_GraphType);
}));
}
}
}

View File

@@ -17,6 +17,8 @@ namespace friction
public string MaterialTable { set; get; }
public DataTable AnalysisData { set; get; }
public DataTable CompatibilityData { set; get; }
public List<string> CompatibilityColumns { set; get; }
public List<string> CompatibilityRows { set; get; }
public Bitmap RadarChart { set; get; }
public Bitmap TrendChartByHumidity { set; get; }
public Bitmap TrendChartByTemperature { set; get; }