diff --git a/Config.cs b/Config.cs index d5df059..911f68c 100644 --- a/Config.cs +++ b/Config.cs @@ -31,13 +31,13 @@ namespace friction public static readonly RANGE HUMID_HIGH = new RANGE { m_fLow = 60.0f, m_fHigh = 100.0f }; - public class CheckedMaterial + public class UncheckedMaterial { public List m_Springs = new List(); public List m_Tables = new List(); } - public Dictionary m_CheckedMaterial = new Dictionary(); + public Dictionary m_UncheckedMaterial = new Dictionary(); public string m_strCurMaterial = ""; public bool m_bOnLoad = false; @@ -69,19 +69,19 @@ namespace friction [DllImport("kernel32")] private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); - private CheckedMaterial LoadCheckedMaterial(string section) + private UncheckedMaterial LoadUncheckedMaterial(string section) { - CheckedMaterial cm = new CheckedMaterial(); + UncheckedMaterial cm = new UncheckedMaterial(); StringBuilder temp = new StringBuilder(10240); - int iRes = GetPrivateProfileString(section, "checked-spring", "", temp, 10240, m_strPath); + int iRes = GetPrivateProfileString(section, "unchecked-spring", "", temp, 10240, m_strPath); if(temp.Length > 0) { string[] astrToken = temp.ToString().Split(','); cm.m_Springs = astrToken.ToList(); } - iRes = GetPrivateProfileString(section, "checked-table", "", temp, 10240, m_strPath); + iRes = GetPrivateProfileString(section, "unchecked-table", "", temp, 10240, m_strPath); if (temp.Length > 0) { string[] astrToken = temp.ToString().Split(','); @@ -93,7 +93,7 @@ namespace friction public bool HasPref(string strName) { - foreach(var pair in m_CheckedMaterial) + foreach(var pair in m_UncheckedMaterial) { if (pair.Key == strName) return true; @@ -104,16 +104,16 @@ namespace friction public void InsertPref(string strName) { - m_CheckedMaterial.Add(strName, new CheckedMaterial()); + m_UncheckedMaterial.Add(strName, new UncheckedMaterial()); } public void RemovePref(string strName) { - m_CheckedMaterial.Remove(strName); + m_UncheckedMaterial.Remove(strName); WritePrivateProfileString(strName, null, null, m_strPath); } - private void Load() + public void Load() { StringBuilder temp = new StringBuilder(10240); int iRes = GetPrivateProfileString("Option", "recent", "", temp, 10240, m_strPath); @@ -157,13 +157,13 @@ namespace friction iRes = GetPrivateProfileString("Option", "conf-names", "", temp, 10240, m_strPath); if (temp.Length > 0) { - m_CheckedMaterial.Clear(); + m_UncheckedMaterial.Clear(); string[] astrSections = temp.ToString().Split(','); foreach(string section in astrSections) { - CheckedMaterial cm = LoadCheckedMaterial(section); - m_CheckedMaterial.Add(section, cm); + UncheckedMaterial cm = LoadUncheckedMaterial(section); + m_UncheckedMaterial.Add(section, cm); } } @@ -173,27 +173,28 @@ namespace friction m_strCurMaterial = temp.ToString(); } - if(m_CheckedMaterial.Count == 0) + if(m_UncheckedMaterial.Count == 0) { m_strCurMaterial = "Default"; - m_CheckedMaterial.Add(m_strCurMaterial, new CheckedMaterial()); + m_UncheckedMaterial.Add(m_strCurMaterial, new UncheckedMaterial()); } } - public void Save() + public void Save(bool bSavePref) { WritePrivateProfileString("Option", "recent", OPTION.GetInstance().GetRecentAll(), m_strPath); WritePrivateProfileString("Option", "bound", OPTION.GetInstance().WindowBoundStr(), m_strPath); WritePrivateProfileString("Option", "checked-column", OPTION.GetInstance().CheckedColumnsStr(), m_strPath); WritePrivateProfileString("Option", "unchecked-column", OPTION.GetInstance().UncheckedColumnsStr(), m_strPath); - foreach(var pair in m_CheckedMaterial) - { - WritePrivateProfileString(pair.Key, "checked-spring", string.Join(",", pair.Value.m_Springs.ToArray()), m_strPath); - WritePrivateProfileString(pair.Key, "checked-table", string.Join(",", pair.Value.m_Tables.ToArray()), m_strPath); - } - WritePrivateProfileString("Option", "conf-names", string.Join(",", m_CheckedMaterial.Keys.ToArray()), m_strPath); + + WritePrivateProfileString("Option", "conf-names", string.Join(",", m_UncheckedMaterial.Keys.ToArray()), m_strPath); WritePrivateProfileString("Option", "current-conf", m_strCurMaterial, m_strPath); + if (bSavePref == true) + { + WritePrivateProfileString(m_strCurMaterial, "unchecked-spring", string.Join(",", m_UncheckedMaterial[m_strCurMaterial].m_Springs.ToArray()), m_strPath); + WritePrivateProfileString(m_strCurMaterial, "unchecked-table", string.Join(",", m_UncheckedMaterial[m_strCurMaterial].m_Tables.ToArray()), m_strPath); + } } public void SetSpringChecked(List CheckedItems) @@ -201,12 +202,12 @@ namespace friction if (m_bOnLoad == true) return; - m_CheckedMaterial[m_strCurMaterial].m_Springs = CheckedItems; + m_UncheckedMaterial[m_strCurMaterial].m_Springs = CheckedItems; } public List GetSpringChecked() { - return m_CheckedMaterial[m_strCurMaterial].m_Springs; + return m_UncheckedMaterial[m_strCurMaterial].m_Springs; } public void SetTableChecked(List CheckedItems) @@ -214,11 +215,11 @@ namespace friction if (m_bOnLoad == true) return; - m_CheckedMaterial[m_strCurMaterial].m_Tables = CheckedItems; + m_UncheckedMaterial[m_strCurMaterial].m_Tables = CheckedItems; } - public List GetTableChecked() + public List GetTableUnchecked() { - return m_CheckedMaterial[m_strCurMaterial].m_Tables; + return m_UncheckedMaterial[m_strCurMaterial].m_Tables; } @@ -261,7 +262,7 @@ namespace friction public string GetRecentAll() { - return string.Join("//", m_RecentList); + return string.Join(",", m_RecentList); } public string WindowBoundStr() diff --git a/MainForm.cs b/MainForm.cs index e684b69..5f46529 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -81,6 +81,7 @@ namespace friction public void OnTableCheckChanged(string strItem, bool bChecked) { m_CompatibilityPanel.TableCheckChanged(strItem, bChecked); + m_AnalysisPanel.TableCheckChanged(strItem, bChecked); m_RadarGraphPanel.UpdateGraph(); } @@ -103,6 +104,7 @@ namespace friction } Config.GetInstance().m_bOnLoad = true; + Config.GetInstance().Load(); Cursor.Current = Cursors.WaitCursor; @@ -353,7 +355,10 @@ namespace friction } if (sender != m_MaterialPanel) + { + m_MaterialPanel.SelectSpring(strSpring); m_MaterialPanel.SelectTable(strTable); + } m_AnalysisPanel.UpdateData(m_DataHandler); } @@ -399,13 +404,13 @@ namespace friction Config.OPTION.GetInstance().WindowBound = this.Bounds; Config.OPTION.GetInstance().CheckedColumns = m_ResultPanel.GetCheckedColumns(); Config.OPTION.GetInstance().UncheckedColumns = m_ResultPanel.GetUncheckedColumns(); - Config.GetInstance().Save(); + Config.GetInstance().Save(false); } #region preference void UpdatePreference() { - foreach (string pref in Config.GetInstance().m_CheckedMaterial.Keys) + foreach (string pref in Config.GetInstance().m_UncheckedMaterial.Keys) { ToolStripMenuItem item = new ToolStripMenuItem(pref); ToolStripItem load = item.DropDownItems.Add("Load"); @@ -447,11 +452,11 @@ namespace friction { Config.GetInstance().m_strCurMaterial = strPrefName; - m_MaterialPanel.LoadCheckedMaterial(strPrefName); + m_MaterialPanel.LoadUncheckedMaterial(strPrefName); m_CompatibilityPanel.SetMaterialChecked(strPrefName); SelectPref(strPrefName); - Config.GetInstance().Save(); + Config.GetInstance().Save(false); } private void PreferenceLoadClick(object sender, EventArgs e) @@ -474,10 +479,10 @@ namespace friction strPrefName = strPrefName.Substring("ㆍ".Length); Config.GetInstance().m_strCurMaterial = strPrefName; - m_MaterialPanel.SaveCheckedMaterial(strPrefName); + m_MaterialPanel.SaveUncheckedMaterial(strPrefName); SelectPref(strPrefName); - Config.GetInstance().Save(); + Config.GetInstance().Save(true); } private void PreferenceRemoveClick(object sender, EventArgs e) @@ -494,7 +499,7 @@ namespace friction if (parent == m_CurPref) PreferenceLoadClick(((ToolStripMenuItem)preferenceToolStripMenuItem.DropDownItems[2]).DropDownItems[0], null); - Config.GetInstance().Save(); + Config.GetInstance().Save(true); } private void newToolStripMenuItem_Click(object sender, EventArgs e) @@ -522,7 +527,7 @@ namespace friction ToolStripItem save = item.DropDownItems.Add("Save"); save.Click += PreferenceSaveClick; ToolStripItem remove = item.DropDownItems.Add("Remove"); - save.Click += PreferenceRemoveClick; + remove.Click += PreferenceRemoveClick; preferenceToolStripMenuItem.DropDownItems.Add(item); diff --git a/PanelAnalysis.Designer.cs b/PanelAnalysis.Designer.cs index 6de23f1..5ca9e6b 100644 --- a/PanelAnalysis.Designer.cs +++ b/PanelAnalysis.Designer.cs @@ -41,8 +41,10 @@ this.lbInfo23 = new System.Windows.Forms.Label(); this.lbInfo24 = new System.Windows.Forms.Label(); this.lbSpring = new System.Windows.Forms.Label(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); ((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).BeginInit(); this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); this.SuspendLayout(); // // dgvAnalysis @@ -50,27 +52,23 @@ this.dgvAnalysis.AllowUserToAddRows = false; this.dgvAnalysis.AllowUserToDeleteRows = false; this.dgvAnalysis.AllowUserToOrderColumns = true; - this.dgvAnalysis.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))); this.dgvAnalysis.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dgvAnalysis.Location = new System.Drawing.Point(12, 33); + this.dgvAnalysis.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvAnalysis.Location = new System.Drawing.Point(3, 3); this.dgvAnalysis.Name = "dgvAnalysis"; this.dgvAnalysis.ReadOnly = true; this.dgvAnalysis.RowTemplate.Height = 23; - this.dgvAnalysis.Size = new System.Drawing.Size(856, 546); + this.dgvAnalysis.Size = new System.Drawing.Size(874, 573); this.dgvAnalysis.TabIndex = 0; this.dgvAnalysis.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvAnalysis_CellContentDoubleClick); // // tableLayoutPanel1 // - this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.ColumnCount = 4; - 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, 30F)); - 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, 30F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label2, 2, 0); this.tableLayoutPanel1.Controls.Add(this.lbInfo11, 1, 0); @@ -80,7 +78,8 @@ this.tableLayoutPanel1.Controls.Add(this.lbInfo22, 3, 1); this.tableLayoutPanel1.Controls.Add(this.lbInfo23, 3, 2); this.tableLayoutPanel1.Controls.Add(this.lbInfo24, 3, 3); - this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 585); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 582); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 5; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -88,7 +87,7 @@ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(856, 62); + this.tableLayoutPanel1.Size = new System.Drawing.Size(874, 64); this.tableLayoutPanel1.TabIndex = 1; // // label1 @@ -98,7 +97,7 @@ this.label1.Location = new System.Drawing.Point(3, 0); this.label1.Name = "label1"; this.tableLayoutPanel1.SetRowSpan(this.label1, 5); - this.label1.Size = new System.Drawing.Size(165, 62); + this.label1.Size = new System.Drawing.Size(271, 64); this.label1.TabIndex = 0; this.label1.Text = "For smaller than 10 number of tests (marked red) results should be considered car" + "efully"; @@ -106,10 +105,10 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(430, 0); + this.label2.Location = new System.Drawing.Point(440, 0); this.label2.Name = "label2"; this.tableLayoutPanel1.SetRowSpan(this.label2, 5); - this.label2.Size = new System.Drawing.Size(135, 60); + this.label2.Size = new System.Drawing.Size(242, 36); this.label2.TabIndex = 1; this.label2.Text = "For large standard deviations indicating a possible change of Stick-Slip Risk Cla" + "ss (marked red)"; @@ -121,9 +120,9 @@ this.lbInfo11.Dock = System.Windows.Forms.DockStyle.Fill; 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.Location = new System.Drawing.Point(280, 0); this.lbInfo11.Name = "lbInfo11"; - this.lbInfo11.Size = new System.Drawing.Size(250, 12); + this.lbInfo11.Size = new System.Drawing.Size(154, 12); this.lbInfo11.TabIndex = 2; this.lbInfo11.Text = "No Stick-Slip Risk"; // @@ -134,9 +133,9 @@ this.lbInfo12.Dock = System.Windows.Forms.DockStyle.Fill; 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.Location = new System.Drawing.Point(280, 12); this.lbInfo12.Name = "lbInfo12"; - this.lbInfo12.Size = new System.Drawing.Size(250, 12); + this.lbInfo12.Size = new System.Drawing.Size(154, 12); this.lbInfo12.TabIndex = 2; this.lbInfo12.Text = "Potential S-Slip Risk"; // @@ -147,9 +146,9 @@ this.lbInfo13.Dock = System.Windows.Forms.DockStyle.Fill; 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.Location = new System.Drawing.Point(280, 24); this.lbInfo13.Name = "lbInfo13"; - this.lbInfo13.Size = new System.Drawing.Size(250, 12); + this.lbInfo13.Size = new System.Drawing.Size(154, 12); this.lbInfo13.TabIndex = 2; this.lbInfo13.Text = "High Stick-Slip Risk"; // @@ -160,9 +159,9 @@ this.lbInfo21.Dock = System.Windows.Forms.DockStyle.Fill; 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.Location = new System.Drawing.Point(717, 0); this.lbInfo21.Name = "lbInfo21"; - this.lbInfo21.Size = new System.Drawing.Size(252, 12); + this.lbInfo21.Size = new System.Drawing.Size(154, 12); this.lbInfo21.TabIndex = 2; this.lbInfo21.Text = "No Dependancy"; // @@ -173,9 +172,9 @@ this.lbInfo22.Dock = System.Windows.Forms.DockStyle.Fill; 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.Location = new System.Drawing.Point(717, 12); this.lbInfo22.Name = "lbInfo22"; - this.lbInfo22.Size = new System.Drawing.Size(252, 12); + this.lbInfo22.Size = new System.Drawing.Size(154, 12); this.lbInfo22.TabIndex = 2; this.lbInfo22.Text = "Potential Dependancy"; // @@ -186,9 +185,9 @@ this.lbInfo23.Dock = System.Windows.Forms.DockStyle.Fill; 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.Location = new System.Drawing.Point(717, 24); this.lbInfo23.Name = "lbInfo23"; - this.lbInfo23.Size = new System.Drawing.Size(252, 12); + this.lbInfo23.Size = new System.Drawing.Size(154, 12); this.lbInfo23.TabIndex = 2; this.lbInfo23.Text = "Obvious Dependancy"; // @@ -199,9 +198,9 @@ this.lbInfo24.Dock = System.Windows.Forms.DockStyle.Fill; 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.Location = new System.Drawing.Point(717, 36); this.lbInfo24.Name = "lbInfo24"; - this.lbInfo24.Size = new System.Drawing.Size(252, 12); + this.lbInfo24.Size = new System.Drawing.Size(154, 12); this.lbInfo24.TabIndex = 2; this.lbInfo24.Text = "Not Enough Data"; // @@ -213,15 +212,29 @@ this.lbSpring.Size = new System.Drawing.Size(0, 12); this.lbSpring.TabIndex = 2; // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 1; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel1, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.dgvAnalysis, 0, 0); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 2; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(880, 649); + this.tableLayoutPanel2.TabIndex = 3; + // // PanelAnalysis // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(880, 649); this.ControlBox = false; + this.Controls.Add(this.tableLayoutPanel2); 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) @@ -236,6 +249,7 @@ ((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).EndInit(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -255,5 +269,6 @@ private System.Windows.Forms.Label lbInfo23; private System.Windows.Forms.Label lbInfo24; private System.Windows.Forms.Label lbSpring; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; } } \ No newline at end of file diff --git a/PanelAnalysis.cs b/PanelAnalysis.cs index 19f49af..b45e170 100644 --- a/PanelAnalysis.cs +++ b/PanelAnalysis.cs @@ -85,6 +85,7 @@ namespace friction dgvAnalysis.Columns.Add("chHumi", "Rel. Humidity"); dgvAnalysis.Columns.Add("chVel", "Velocity"); + List uncheckedTables = Config.GetInstance().GetTableUnchecked(); foreach (string strTable in data.GetTableList()) { DataHandler.CalcResult result = data.GetCalc(strSpring, strTable); @@ -128,6 +129,8 @@ namespace friction dgvAnalysis.Rows[iIdx].Cells[6].Style.BackColor = GetDependancyColor(result.m_fDiffByHumid, result.m_iCnt); dgvAnalysis.Rows[iIdx].Cells[7].Style.BackColor = GetDependancyColor(result.m_fDiffByVel, result.m_iCnt); } + + dgvAnalysis.Rows[iIdx].Visible = (uncheckedTables.Contains(strTable) == false); } m_CurSpring = strSpring; @@ -166,6 +169,15 @@ namespace friction return dt; } + public void TableCheckChanged(string strItem, bool bChecked) + { + foreach (DataGridViewRow row in dgvAnalysis.Rows) + { + if((string)row.Cells[0].Value == strItem) + row.Visible = bChecked; + } + } + private void dgvAnalysis_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if(dgvAnalysis.Columns[e.ColumnIndex].HeaderText == "Table") diff --git a/PanelCompatibility.Designer.cs b/PanelCompatibility.Designer.cs index aff23fb..1be0d68 100644 --- a/PanelCompatibility.Designer.cs +++ b/PanelCompatibility.Designer.cs @@ -57,9 +57,13 @@ this.dgvMap.Location = new System.Drawing.Point(3, 32); this.dgvMap.Name = "dgvMap"; this.dgvMap.RowTemplate.Height = 23; + this.dgvMap.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; this.dgvMap.Size = new System.Drawing.Size(817, 576); this.dgvMap.TabIndex = 0; this.dgvMap.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMap_CellClick); + this.dgvMap.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMap_CellDoubleClick); + this.dgvMap.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgvMap_KeyDown); + this.dgvMap.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dgvMap_KeyUp); // // btPivot // diff --git a/PanelCompatibility.cs b/PanelCompatibility.cs index 787a11e..22a5752 100644 --- a/PanelCompatibility.cs +++ b/PanelCompatibility.cs @@ -17,6 +17,11 @@ namespace friction MainForm m_Owner = null; DataHandler m_DataHandler = null; + //float m_Scale = 1.0f; + //float m_OrgFontSize = 10; + //float m_OrgCellWidth = 10; + //float m_OrgCellHeight = 10; + //bool m_bScaling = false; public PanelCompatibility(MainForm owner, DataHandler dataHandler) { @@ -32,12 +37,14 @@ namespace friction dgvMap.CellPainting += DgvMap_CellPainting; dgvMap.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing; dgvMap.ColumnHeadersHeight = HEADER_SIZE; - dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing; + dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing; dgvMap.RowHeadersWidth = HEADER_SIZE; dgvMap.DefaultCellStyle.Format = "N0"; dgvMap.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False; dgvMap.RowHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False; + + dgvMap.MouseWheel += DgvMap_MouseWheel; } public void SpringCheckChanged(string strItem, bool bChecked) @@ -104,15 +111,15 @@ namespace friction return; for (int i = 1; i < dgvMap.Columns.Count; i++) - dgvMap.Columns[i].Visible = false; + dgvMap.Columns[i].Visible = true; for (int i = 1; i < dgvMap.Rows.Count-1; i++) - dgvMap.Rows[i].Visible = false; + dgvMap.Rows[i].Visible = true; - Config.CheckedMaterial cm = Config.GetInstance().m_CheckedMaterial[strPrefName]; + Config.UncheckedMaterial cm = Config.GetInstance().m_UncheckedMaterial[strPrefName]; foreach (string item in cm.m_Springs) - SpringCheckChanged(item, true); + SpringCheckChanged(item, false); foreach (string item in cm.m_Tables) - TableCheckChanged(item, true); + TableCheckChanged(item, false); } public void UpdateData() @@ -125,6 +132,7 @@ namespace friction int iCol = dgvMap.Columns.Add("table", "table"); + dgvMap.Columns[iCol].Width = 10; dgvMap.Columns[iCol].SortMode = DataGridViewColumnSortMode.NotSortable; foreach (var table in Tables) { @@ -168,6 +176,11 @@ namespace friction } } } + + //m_OrgFontSize = dgvMap.Font.Size; + //m_OrgCellWidth = (float)dgvMap.Rows[0].Cells[0].Size.Width; + //m_OrgCellHeight = (float)dgvMap.RowTemplate.Height; + //m_Scale = 1.0f; } foreach (DataGridViewColumn column in dgvMap.Columns) @@ -175,6 +188,8 @@ namespace friction column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader; column.ReadOnly = true; } + dgvMap.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing; + dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing; } public object[] GetData() @@ -215,6 +230,7 @@ namespace friction e.PaintBackground(e.ClipBounds, true); Rectangle rect = view.GetColumnDisplayRectangle(e.ColumnIndex, true); Size titleSize = TextRenderer.MeasureText(e.Value.ToString(), e.CellStyle.Font); + //Size titleSize = e.CellBounds.Size; //if (view.ColumnHeadersHeight < titleSize.Width) // view.ColumnHeadersHeight = titleSize.Width; //if (view.ColumnHeadersHeight > HEADER_SIZE) @@ -341,5 +357,73 @@ namespace friction detailPanel.Visible = true; } } + + private void dgvMap_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex < 0 || e.ColumnIndex < 0) + return; + + if (dgvMap.Rows.Count < e.RowIndex || dgvMap.Columns.Count < e.ColumnIndex) + return; + + DataGridViewCell cell = dgvMap.Rows[e.RowIndex].Cells[e.ColumnIndex]; + if (cell.Value == null || cell.Value.GetType() == typeof(System.DBNull)) + return; + + string strSpring = ""; + string strTable = ""; + if ((string)dgvMap.Rows[0].HeaderCell.Value == "spring") + { + strSpring = (string)dgvMap.Rows[e.RowIndex].HeaderCell.Value; + strTable = dgvMap.Columns[e.ColumnIndex].HeaderText; + } + else + { + strTable = (string)dgvMap.Rows[e.RowIndex].HeaderCell.Value; + strSpring = dgvMap.Columns[e.ColumnIndex].HeaderText; + } + + m_Owner.OnApplyData(this, strSpring, strTable); + } + + public void ZoomGrid(float f) + { + //dgvMap.Scale(new SizeF(f, f)); + //dgvMap.Font = new Font(dgvMap.Font.FontFamily, m_OrgFontSize * f, dgvMap.Font.Style); + //dgvMap.RowTemplate.Height = (int)(m_OrgCellHeight * f); + + //foreach (DataGridViewColumn col in dgvMap.Columns) + // col.Width = (int)(m_OrgCellWidth * f); + //foreach (DataGridViewRow row in dgvMap.Rows) + // row.Height = (int)(m_OrgCellHeight * f); + } + + private void DgvMap_MouseWheel(object sender, MouseEventArgs e) + { + //if (m_bScaling == true) + //{ + // m_Scale += e.Delta / 120.0f * 0.05f; + // Console.WriteLine(string.Format("m_Scale : {0}", m_Scale)); + + // if (m_Scale <= 0.001f) + // m_Scale = 0.001f; + // else if (m_Scale > 5.0f) + // m_Scale = 5.0f; + + // ZoomGrid(m_Scale); + //} + } + + private void dgvMap_KeyDown(object sender, KeyEventArgs e) + { + //if (e.Control == true) + // m_bScaling = true; + } + + private void dgvMap_KeyUp(object sender, KeyEventArgs e) + { + //if (e.Control == true) + // m_bScaling = false; + } } } diff --git a/PanelMaterial.cs b/PanelMaterial.cs index 089ef6d..eb108bc 100644 --- a/PanelMaterial.cs +++ b/PanelMaterial.cs @@ -45,7 +45,10 @@ namespace friction lvSpring.Items.Clear(); foreach (var x in SpringList) - lvSpring.Items.Add(x); + { + ListViewItem item = lvSpring.Items.Add(x); + item.Checked = true; + } lvTable.Items.Clear(); lvTable.Items.Add("All"); @@ -91,6 +94,26 @@ namespace friction m_Owner.OnApplyData(this, m_SelectedSpring.Text, m_SelectedTable.Text); } + public void SelectSpring(string strSpring) + { + if (m_SelectedSpring != null) + { + m_SelectedSpring.Font = lvSpring.Font; + m_SelectedSpring.ForeColor = Theme.Forecolor; + } + + foreach (ListViewItem item in lvSpring.Items) + { + if (item.Text == strSpring) + { + m_SelectedSpring = item; + item.Font = new Font(lvSpring.Font, FontStyle.Bold); + item.ForeColor = Theme.Orange; + break; + } + } + } + private void SelectTable(int iIdx) { if (m_SelectedTable != null) @@ -141,29 +164,29 @@ namespace friction #endregion select #region check - public void LoadCheckedMaterial(string strPrefName) + public void LoadUncheckedMaterial(string strPrefName) { - Config.CheckedMaterial cm = Config.GetInstance().m_CheckedMaterial[strPrefName]; - List CheckedSprings = new List(); - List CheckedTables = new List(); + Config.UncheckedMaterial cm = Config.GetInstance().m_UncheckedMaterial[strPrefName]; + List UncheckedSprings = new List(); + List UncheckedTables = new List(); foreach (string s in cm.m_Springs) - CheckedSprings.Add(s); + UncheckedSprings.Add(s); foreach (string s in cm.m_Tables) - CheckedTables.Add(s); + UncheckedTables.Add(s); foreach (ListViewItem item in lvSpring.Items) { - item.Checked = false; + item.Checked = true; } - foreach (string strSpring in CheckedSprings) + foreach (string strSpring in UncheckedSprings) { foreach (ListViewItem item in lvSpring.Items) { if (item.Text == strSpring) { - item.Checked = true; + item.Checked = false; break; } } @@ -172,37 +195,37 @@ namespace friction foreach (ListViewItem item in lvTable.Items) { - item.Checked = false; + item.Checked = true; } - foreach (string strTable in CheckedTables) + foreach (string strTable in UncheckedTables) { foreach (ListViewItem item in lvTable.Items) { if (item.Text == strTable) { - item.Checked = true; + item.Checked = false; break; } } } } - public void SaveCheckedMaterial(string strPrefName) + public void SaveUncheckedMaterial(string strPrefName) { - Config.CheckedMaterial cm = Config.GetInstance().m_CheckedMaterial[strPrefName]; + Config.UncheckedMaterial cm = Config.GetInstance().m_UncheckedMaterial[strPrefName]; cm.m_Springs.Clear(); foreach (ListViewItem item in lvSpring.Items) { - if (item.Checked == true) + if (item.Checked == false) cm.m_Springs.Add(item.Text); } cm.m_Tables.Clear(); foreach (ListViewItem item in lvTable.Items) { - if (item.Checked == true) + if (item.Checked == false) cm.m_Tables.Add(item.Text); } } @@ -213,16 +236,17 @@ namespace friction if (view == lvTable && e.Item.Text == "All") e.Item.Checked = true; - List CheckedItems = new List(); - foreach(ListViewItem item in view.CheckedItems) + List UncheckedItems = new List(); + foreach (ListViewItem item in view.Items) { - CheckedItems.Add(item.Text); + if(item.Checked == false) + UncheckedItems.Add(item.Text); } if (view == lvTable) - Config.GetInstance().SetTableChecked(CheckedItems); + Config.GetInstance().SetTableChecked(UncheckedItems); else - Config.GetInstance().SetSpringChecked(CheckedItems); + Config.GetInstance().SetSpringChecked(UncheckedItems); view.Sort(); diff --git a/PanelRadarGraph.cs b/PanelRadarGraph.cs index a7b169b..76507e5 100644 --- a/PanelRadarGraph.cs +++ b/PanelRadarGraph.cs @@ -20,7 +20,7 @@ namespace friction DataHandler m_DataHandler = null; string m_CurSpring = ""; - List m_CheckedTable = null; + List m_UncheckedTable = null; bool m_bShowAlert = false; Config.RANGE m_TempRange = Config.TEMP_ALL; @@ -102,8 +102,8 @@ namespace friction public void UpdateGraph() { string strSpring = m_DataHandler.GetCurSpring(); - List checkedTable = Config.GetInstance().GetTableChecked(); - if (strSpring == m_CurSpring && checkedTable == m_CheckedTable) + List uncheckedTable = Config.GetInstance().GetTableUnchecked(); + if (strSpring == m_CurSpring && uncheckedTable == m_UncheckedTable) return; lbSpring.Text = "Material Spring: " + strSpring; @@ -120,7 +120,7 @@ namespace friction foreach(var data in graphData) { - if (checkedTable.Contains(data.m_strTable) == false) + if (uncheckedTable.Contains(data.m_strTable) == true) continue; chart.Series["SeriesMax"].Points.AddXY(data.m_strTable, data.m_fMax); diff --git a/PanelResult.Designer.cs b/PanelResult.Designer.cs index d7870fc..0bafa88 100644 --- a/PanelResult.Designer.cs +++ b/PanelResult.Designer.cs @@ -32,7 +32,9 @@ this.dgvData = new System.Windows.Forms.DataGridView(); this.lvColumn = new System.Windows.Forms.ListView(); this.lvchColumns = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); ((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit(); + this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // dgvData @@ -40,15 +42,13 @@ this.dgvData.AllowUserToAddRows = false; this.dgvData.AllowUserToDeleteRows = false; this.dgvData.AllowUserToOrderColumns = true; - 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.Right))); this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill; this.dgvData.Location = new System.Drawing.Point(3, 3); this.dgvData.Name = "dgvData"; this.dgvData.ReadOnly = true; this.dgvData.RowTemplate.Height = 23; - this.dgvData.Size = new System.Drawing.Size(713, 719); + this.dgvData.Size = new System.Drawing.Size(916, 717); this.dgvData.TabIndex = 0; // // lvColumn @@ -75,14 +75,29 @@ this.lvchColumns.Text = "Columns"; this.lvchColumns.Width = 175; // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Controls.Add(this.dgvData, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 1; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(922, 723); + this.tableLayoutPanel1.TabIndex = 2; + // // PanelResult // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(922, 723); this.ControlBox = false; + this.Controls.Add(this.tableLayoutPanel1); 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) @@ -94,6 +109,7 @@ this.TabText = "Result Table"; this.Text = "Result Table"; ((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit(); + this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); } @@ -103,5 +119,6 @@ private System.Windows.Forms.DataGridView dgvData; private System.Windows.Forms.ListView lvColumn; private System.Windows.Forms.ColumnHeader lvchColumns; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; } } \ No newline at end of file diff --git a/PanelTrendGraph.Designer.cs b/PanelTrendGraph.Designer.cs index f1a63a1..2b9dfd5 100644 --- a/PanelTrendGraph.Designer.cs +++ b/PanelTrendGraph.Designer.cs @@ -35,11 +35,15 @@ this.groupBox1 = new System.Windows.Forms.GroupBox(); this.rbVelocity = new System.Windows.Forms.RadioButton(); this.rbForce = new System.Windows.Forms.RadioButton(); - this.panelGraph = new System.Windows.Forms.Panel(); this.lbPair1 = new System.Windows.Forms.Label(); this.lbPair2 = new System.Windows.Forms.Label(); this.lbPair3 = new System.Windows.Forms.Label(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panelGraph = new System.Windows.Forms.Panel(); this.groupBox1.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); this.panelGraph.SuspendLayout(); this.SuspendLayout(); // @@ -48,7 +52,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(701, 603); + this.trendChart.Size = new System.Drawing.Size(756, 608); this.trendChart.TabIndex = 0; this.trendChart.Text = "trendChart"; this.trendChart.UpdaterTick += new LiveCharts.Events.UpdaterTickHandler(this.trendChart_UpdaterTick); @@ -88,9 +92,9 @@ this.groupBox1.Controls.Add(this.rbForce); this.groupBox1.Controls.Add(this.rbTemp); this.groupBox1.ForeColor = System.Drawing.SystemColors.ControlText; - this.groupBox1.Location = new System.Drawing.Point(8, 3); + this.groupBox1.Location = new System.Drawing.Point(6, 3); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(297, 50); + this.groupBox1.Size = new System.Drawing.Size(300, 50); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "Data"; @@ -121,21 +125,10 @@ this.rbForce.UseVisualStyleBackColor = true; this.rbForce.CheckedChanged += new System.EventHandler(this.rbForce_CheckedChanged); // - // panelGraph - // - this.panelGraph.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))); - this.panelGraph.Controls.Add(this.trendChart); - this.panelGraph.Location = new System.Drawing.Point(34, 59); - this.panelGraph.Name = "panelGraph"; - this.panelGraph.Size = new System.Drawing.Size(701, 603); - this.panelGraph.TabIndex = 3; - // // lbPair1 // this.lbPair1.AutoSize = true; - this.lbPair1.Location = new System.Drawing.Point(327, 28); + this.lbPair1.Location = new System.Drawing.Point(312, 28); this.lbPair1.Name = "lbPair1"; this.lbPair1.Size = new System.Drawing.Size(32, 12); this.lbPair1.TabIndex = 4; @@ -144,7 +137,7 @@ // lbPair2 // this.lbPair2.AutoSize = true; - this.lbPair2.Location = new System.Drawing.Point(365, 28); + this.lbPair2.Location = new System.Drawing.Point(350, 28); this.lbPair2.Name = "lbPair2"; this.lbPair2.Size = new System.Drawing.Size(32, 12); this.lbPair2.TabIndex = 5; @@ -153,23 +146,55 @@ // lbPair3 // this.lbPair3.AutoSize = true; - this.lbPair3.Location = new System.Drawing.Point(403, 28); + this.lbPair3.Location = new System.Drawing.Point(388, 28); this.lbPair3.Name = "lbPair3"; this.lbPair3.Size = new System.Drawing.Size(32, 12); this.lbPair3.TabIndex = 6; this.lbPair3.Text = "label"; // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.panelGraph, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(762, 674); + this.tableLayoutPanel1.TabIndex = 7; + // + // panel1 + // + this.panel1.Controls.Add(this.groupBox1); + this.panel1.Controls.Add(this.lbPair1); + this.panel1.Controls.Add(this.lbPair3); + this.panel1.Controls.Add(this.lbPair2); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(3, 3); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(756, 54); + this.panel1.TabIndex = 8; + // + // panelGraph + // + this.panelGraph.Controls.Add(this.trendChart); + this.panelGraph.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelGraph.Location = new System.Drawing.Point(3, 63); + this.panelGraph.Name = "panelGraph"; + this.panelGraph.Size = new System.Drawing.Size(756, 608); + this.panelGraph.TabIndex = 8; + // // PanelTrendGraph // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(762, 674); this.ControlBox = false; - 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.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) @@ -183,9 +208,11 @@ this.Enter += new System.EventHandler(this.PanelTrendGraph_Enter); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); + this.tableLayoutPanel1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); this.panelGraph.ResumeLayout(false); this.ResumeLayout(false); - this.PerformLayout(); } @@ -197,9 +224,11 @@ private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.RadioButton rbVelocity; private System.Windows.Forms.RadioButton rbForce; - private System.Windows.Forms.Panel panelGraph; private System.Windows.Forms.Label lbPair1; private System.Windows.Forms.Label lbPair2; private System.Windows.Forms.Label lbPair3; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panelGraph; } } \ No newline at end of file diff --git a/Report.cs b/Report.cs index 96b7f34..6b9bbcd 100644 --- a/Report.cs +++ b/Report.cs @@ -137,10 +137,10 @@ namespace friction // compatibility table iRow += 1; - iCol = 2; - foreach (DataColumn column in CompatibilityData.Columns) + iCol = 3; + foreach (string column in CompatibilityColumns) { - Sheet.Cells[iRow, iCol].Value = column.ColumnName; + Sheet.Cells[iRow, iCol].Value = column; iCol++; } iRow++; @@ -152,9 +152,12 @@ namespace friction iNoOfTest = 0; iAvgRPNColumn = 1; - foreach (DataRow row in CompatibilityData.Rows) + for(int j=0; j