diff --git a/DataHandler.cs b/DataHandler.cs index 9e5e4eb..cddce3d 100644 --- a/DataHandler.cs +++ b/DataHandler.cs @@ -267,7 +267,7 @@ namespace friction { // 각 그룹의 평균들의 표준편차 var AvgOfGroup = rows - .GroupBy(r => r[Config.COLUMN_NAME.FORCE]) + .GroupBy(r => r[strColumn]) .Select(t => t.Average(k => (float)k[Config.COLUMN_NAME.RPN])); var Avg = AvgOfGroup.Average(); var Squares = AvgOfGroup.Select(r => (r - Avg) * (r - Avg)); @@ -289,10 +289,10 @@ namespace friction result.m_fStdRPN = rows.Average(r => (float)Math.Pow((float)r[Config.COLUMN_NAME.RPN] - result.m_fAvgRPN, 2)); result.m_fStdRPN = (float)Math.Sqrt(result.m_fStdRPN); - result.m_fDiffByForce = CalcDependency(rows, "force"); - result.m_fDiffByTemp = CalcDependency(rows, "temp"); - result.m_fDiffByHumid = CalcDependency(rows, "humidity"); - result.m_fDiffByVel = CalcDependency(rows, "velocity"); + result.m_fDiffByForce = CalcDependency(rows, Config.COLUMN_NAME.FORCE); + result.m_fDiffByTemp = CalcDependency(rows, Config.COLUMN_NAME.TEMP); + result.m_fDiffByHumid = CalcDependency(rows, Config.COLUMN_NAME.HUMIDITY); + result.m_fDiffByVel = CalcDependency(rows, Config.COLUMN_NAME.VELOCITY); } else { diff --git a/ExcelHelper.cs b/ExcelHelper.cs index 1bd3f9d..e2667d1 100644 --- a/ExcelHelper.cs +++ b/ExcelHelper.cs @@ -33,7 +33,15 @@ namespace friction //double columnWidthInTwips = (double)(pixels * (1440f / 96f)); return Convert.ToInt32(pixels); + } + public static int Column2Pixel(ExcelWorksheet ws, int iColumn) + { + double dX = 0; + for (int i = 1; i < iColumn; i++) + dX += ColumnWidth2Pixel(ws, ws.Column(i).Width); + + return (int)dX; } public static double Pixel2ColumnWidth(ExcelWorksheet ws, int pixels) @@ -55,6 +63,14 @@ namespace friction return Convert.ToDouble(excelColumnWidth); } + public static int Pixel2NextColumn(ExcelWorksheet ws, int iCol, int iPixels) + { + while (iPixels > 0) + iPixels -= ColumnWidth2Pixel(ws, ws.Column(iCol++).Width); + + return iCol; + } + public static int RowHeight2Pixel(double excelRowHeight) { //convert height to pixel @@ -63,6 +79,15 @@ namespace friction return Convert.ToInt32(pixels); } + public static int Row2Pixel(ExcelWorksheet ws, int iRow) + { + int iY = 0; + for (int i = 1; i < iRow; i++) + iY += RowHeight2Pixel(ws.Row(i).Height); + + return iY; + } + public static double Pixel2RowHeight(int pixels) { //convert height to pixel @@ -71,6 +96,15 @@ namespace friction return excelRowHeight; } + public static int Pixel2NextRow(ExcelWorksheet ws, int iRow, int iPixels) + { + double dPixels = iPixels; + while(dPixels > 0) + dPixels -= RowHeight2Pixel(ws.Row(iRow++).Height); + + return iRow; + } + public static int MTU2Pixel(int mtus) { //convert MTU to pixel diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index e72fc35..c249d01 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -82,8 +82,8 @@ this.toolStripButtonAnalysis, this.toolStripButtonMap, this.toolStripSeparator2, - this.toolStripButtonRadarGraph, - this.toolStripButtonTrendGraph}); + this.toolStripButtonTrendGraph, + this.toolStripButtonRadarGraph}); this.toolStripMain.Location = new System.Drawing.Point(0, 28); this.toolStripMain.Name = "toolStripMain"; this.toolStripMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; @@ -281,8 +281,8 @@ // graphToolStripMenuItem // this.graphToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.radarGraphToolStripMenuItem, - this.trendGraphToolStripMenuItem}); + this.trendGraphToolStripMenuItem, + this.radarGraphToolStripMenuItem}); this.graphToolStripMenuItem.Name = "graphToolStripMenuItem"; this.graphToolStripMenuItem.Size = new System.Drawing.Size(63, 24); this.graphToolStripMenuItem.Text = "Graph"; @@ -296,7 +296,6 @@ // // trendGraphToolStripMenuItem // - this.trendGraphToolStripMenuItem.Enabled = false; this.trendGraphToolStripMenuItem.Name = "trendGraphToolStripMenuItem"; this.trendGraphToolStripMenuItem.Size = new System.Drawing.Size(164, 24); this.trendGraphToolStripMenuItem.Text = "Trend Graph"; @@ -329,14 +328,14 @@ // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 24); + this.newToolStripMenuItem.Size = new System.Drawing.Size(108, 24); this.newToolStripMenuItem.Text = "New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(105, 6); // // aToolStripMenuItem // diff --git a/MainForm.cs b/MainForm.cs index 5f46529..38a044b 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -120,12 +120,12 @@ namespace friction m_AnalysisPanel.UpdateData(m_DataHandler); OpenPanel(m_AnalysisPanel); - m_RadarGraphPanel.UpdateGraph(); - OpenPanel(m_RadarGraphPanel); - m_TrendGraphPanel.UpdateGraph(); OpenPanel(m_TrendGraphPanel); + m_RadarGraphPanel.UpdateGraph(); + OpenPanel(m_RadarGraphPanel); + m_CompatibilityPanel.UpdateData(); OpenPanel(m_CompatibilityPanel); diff --git a/MainForm.resx b/MainForm.resx index 0b8d900..14deed7 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -167,34 +167,34 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPYxhcwH/7dgXv3ZsdoFwMAJIDqYFyMYHvzs0N - vru2/IdyMQBIDqQGykUFKYuPvY9ZvP9r/Pyjv0FsbDh68b5fyXP2fQOxodoQwHfi7v+kYKg2BGjff+N/ + vru2/IdyMQBIDqQGykUFKYuPvY9evP9r/Pyjv0FsbDhq8d5fyb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ORDQCFCVQK + AUABhmwzVBgOQE6HGVB57tR/qDACIBvgNXHXFagwBPz/z7jkwZsfu199/r/1xaf/q5++xzTAu3/HOZgB + IOwzYVciVIqhfNP5tsNvv/6H4bV3Xn2BSiGAz8TdRcgGQPE1MJ6w+3/55otwA6adfrAWqg0BQnqPcYKc + jmYAHHtP2PU/ffnJ/+svvv5ef+IWH1QbKvCZsFsOnyFuvTtuJs3ZbwJVjh3Yz9/PAfHOrrO+/eu/g/HE + 3WeA/AKQHFTZoAEMDABbpj40S+1sRQAAAABJRU5ErkJggg== diff --git a/PanelAnalysis.Designer.cs b/PanelAnalysis.Designer.cs index 5ca9e6b..ce3f80a 100644 --- a/PanelAnalysis.Designer.cs +++ b/PanelAnalysis.Designer.cs @@ -54,11 +54,11 @@ this.dgvAnalysis.AllowUserToOrderColumns = true; this.dgvAnalysis.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvAnalysis.Dock = System.Windows.Forms.DockStyle.Fill; - this.dgvAnalysis.Location = new System.Drawing.Point(3, 3); + this.dgvAnalysis.Location = new System.Drawing.Point(3, 19); this.dgvAnalysis.Name = "dgvAnalysis"; this.dgvAnalysis.ReadOnly = true; this.dgvAnalysis.RowTemplate.Height = 23; - this.dgvAnalysis.Size = new System.Drawing.Size(874, 573); + this.dgvAnalysis.Size = new System.Drawing.Size(874, 557); this.dgvAnalysis.TabIndex = 0; this.dgvAnalysis.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvAnalysis_CellContentDoubleClick); // @@ -207,21 +207,24 @@ // lbSpring // this.lbSpring.AutoSize = true; - this.lbSpring.Location = new System.Drawing.Point(12, 9); + this.lbSpring.Location = new System.Drawing.Point(3, 0); this.lbSpring.Name = "lbSpring"; - this.lbSpring.Size = new System.Drawing.Size(0, 12); + this.lbSpring.Padding = new System.Windows.Forms.Padding(2, 4, 0, 0); + this.lbSpring.Size = new System.Drawing.Size(2, 16); 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.Controls.Add(this.tableLayoutPanel1, 0, 2); + this.tableLayoutPanel2.Controls.Add(this.lbSpring, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.dgvAnalysis, 0, 1); 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.RowCount = 3; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); 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); @@ -234,7 +237,6 @@ this.ClientSize = new System.Drawing.Size(880, 649); this.ControlBox = false; this.Controls.Add(this.tableLayoutPanel2); - this.Controls.Add(this.lbSpring); 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) @@ -250,8 +252,8 @@ this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); this.ResumeLayout(false); - this.PerformLayout(); } diff --git a/PanelMaterial.Designer.cs b/PanelMaterial.Designer.cs index 8d15cd2..fb19b02 100644 --- a/PanelMaterial.Designer.cs +++ b/PanelMaterial.Designer.cs @@ -33,11 +33,20 @@ this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.lvTable = new friction.NoDoubleClickAutoCheckListview(); - this.lvchTable = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.lvSpring = new friction.NoDoubleClickAutoCheckListview(); this.lvchSpring = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.lvTable = new friction.NoDoubleClickAutoCheckListview(); + this.lvchTable = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); this.SuspendLayout(); // // lbFileName @@ -53,7 +62,7 @@ // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(3, 43); + this.label2.Location = new System.Drawing.Point(3, 8); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(90, 12); this.label2.TabIndex = 5; @@ -63,7 +72,7 @@ // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(3, 389); + this.label3.Location = new System.Drawing.Point(3, 8); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(86, 12); this.label3.TabIndex = 6; @@ -74,44 +83,49 @@ this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Controls.Add(this.lbFileName, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.lvTable, 0, 4); - this.tableLayoutPanel1.Controls.Add(this.lvSpring, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.label3, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.splitContainer1, 0, 1); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 5; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - 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.Absolute, 20F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(298, 727); this.tableLayoutPanel1.TabIndex = 9; // - // lvTable + // splitContainer1 // - this.lvTable.CheckBoxes = true; - this.lvTable.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.lvchTable}); - this.lvTable.Dock = System.Windows.Forms.DockStyle.Fill; - this.lvTable.FullRowSelect = true; - this.lvTable.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - this.lvTable.Location = new System.Drawing.Point(3, 404); - this.lvTable.Name = "lvTable"; - this.lvTable.Size = new System.Drawing.Size(292, 320); - this.lvTable.TabIndex = 8; - this.lvTable.UseCompatibleStateImageBehavior = false; - this.lvTable.View = System.Windows.Forms.View.Details; - this.lvTable.SizeChanged += new System.EventHandler(this.lvTable_SizeChanged); - this.lvTable.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvTable_KeyDown); - this.lvTable.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvTable_MouseDoubleClick); + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(3, 28); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; // - // lvchTable + // splitContainer1.Panel1 // - this.lvchTable.Text = "Table"; - this.lvchTable.Width = 305; + this.splitContainer1.Panel1.Controls.Add(this.tableLayoutPanel2); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.tableLayoutPanel3); + this.splitContainer1.Size = new System.Drawing.Size(292, 696); + this.splitContainer1.SplitterDistance = 348; + this.splitContainer1.TabIndex = 5; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 1; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel2.Controls.Add(this.label2, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.lvSpring, 0, 1); + 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.Absolute, 20F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(292, 348); + this.tableLayoutPanel2.TabIndex = 0; // // lvSpring // @@ -121,9 +135,9 @@ this.lvSpring.Dock = System.Windows.Forms.DockStyle.Fill; this.lvSpring.FullRowSelect = true; this.lvSpring.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - this.lvSpring.Location = new System.Drawing.Point(3, 58); + this.lvSpring.Location = new System.Drawing.Point(3, 23); this.lvSpring.Name = "lvSpring"; - this.lvSpring.Size = new System.Drawing.Size(292, 320); + this.lvSpring.Size = new System.Drawing.Size(286, 322); this.lvSpring.TabIndex = 7; this.lvSpring.UseCompatibleStateImageBehavior = false; this.lvSpring.View = System.Windows.Forms.View.Details; @@ -136,6 +150,45 @@ this.lvchSpring.Text = "Material Spring"; this.lvchSpring.Width = 308; // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 1; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel3.Controls.Add(this.label3, 0, 0); + this.tableLayoutPanel3.Controls.Add(this.lvTable, 0, 1); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 2; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(292, 344); + this.tableLayoutPanel3.TabIndex = 0; + // + // lvTable + // + this.lvTable.CheckBoxes = true; + this.lvTable.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.lvchTable}); + this.lvTable.Dock = System.Windows.Forms.DockStyle.Fill; + this.lvTable.FullRowSelect = true; + this.lvTable.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.lvTable.Location = new System.Drawing.Point(3, 23); + this.lvTable.Name = "lvTable"; + this.lvTable.Size = new System.Drawing.Size(286, 318); + this.lvTable.TabIndex = 8; + this.lvTable.UseCompatibleStateImageBehavior = false; + this.lvTable.View = System.Windows.Forms.View.Details; + this.lvTable.SizeChanged += new System.EventHandler(this.lvTable_SizeChanged); + this.lvTable.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvTable_KeyDown); + this.lvTable.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvTable_MouseDoubleClick); + // + // lvchTable + // + this.lvchTable.Text = "Table"; + this.lvchTable.Width = 305; + // // PanelMaterial // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -155,6 +208,14 @@ this.Text = "Material Pair"; this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel3.PerformLayout(); this.ResumeLayout(false); } @@ -168,5 +229,8 @@ private System.Windows.Forms.ColumnHeader lvchSpring; private System.Windows.Forms.ColumnHeader lvchTable; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; } } \ No newline at end of file diff --git a/PanelResult.Designer.cs b/PanelResult.Designer.cs index 0bafa88..948c7a0 100644 --- a/PanelResult.Designer.cs +++ b/PanelResult.Designer.cs @@ -48,7 +48,7 @@ this.dgvData.Name = "dgvData"; this.dgvData.ReadOnly = true; this.dgvData.RowTemplate.Height = 23; - this.dgvData.Size = new System.Drawing.Size(916, 717); + this.dgvData.Size = new System.Drawing.Size(716, 717); this.dgvData.TabIndex = 0; // // lvColumn @@ -60,10 +60,10 @@ this.lvchColumns}); this.lvColumn.FullRowSelect = true; this.lvColumn.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.lvColumn.Location = new System.Drawing.Point(722, 3); + this.lvColumn.Location = new System.Drawing.Point(725, 3); this.lvColumn.MultiSelect = false; this.lvColumn.Name = "lvColumn"; - this.lvColumn.Size = new System.Drawing.Size(199, 718); + this.lvColumn.Size = new System.Drawing.Size(194, 717); this.lvColumn.TabIndex = 1; this.lvColumn.UseCompatibleStateImageBehavior = false; this.lvColumn.View = System.Windows.Forms.View.Details; @@ -77,16 +77,16 @@ // // tableLayoutPanel1 // - this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnCount = 2; 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.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 200F)); this.tableLayoutPanel1.Controls.Add(this.dgvData, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.lvColumn, 1, 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; // @@ -97,7 +97,6 @@ this.ClientSize = new System.Drawing.Size(922, 723); this.ControlBox = false; this.Controls.Add(this.tableLayoutPanel1); - this.Controls.Add(this.lvColumn); 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) diff --git a/PanelTrendGraph.cs b/PanelTrendGraph.cs index 630c057..c40bb89 100644 --- a/PanelTrendGraph.cs +++ b/PanelTrendGraph.cs @@ -518,8 +518,8 @@ namespace friction this.Invoke(new Action(() => { - Bitmap bm = new Bitmap(Width, Height); - panelGraph.DrawToBitmap(bm, new Rectangle(panelGraph.Left, panelGraph.Top, panelGraph.Width, panelGraph.Height)); + Bitmap bm = new Bitmap(panelGraph.Width, panelGraph.Height); + panelGraph.DrawToBitmap(bm, new Rectangle(0, 0, panelGraph.Width, panelGraph.Height)); m_Owner.OnChartUpdate(bm, m_GraphType); })); } diff --git a/Report.cs b/Report.cs index 6b9bbcd..ee8d49e 100644 --- a/Report.cs +++ b/Report.cs @@ -196,7 +196,7 @@ namespace friction Sheet.Cells[iTableRowStart, iTableColStart, iTableRowStart, iCol - 1].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin); Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iTableColStart].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin); Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iCol - 1].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thick); - Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iCol - 1].AutoFitColumns(); + //Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iCol - 1].AutoFitColumns(); iRow += 2; iCol = 2; @@ -205,10 +205,8 @@ namespace friction // radar graph double dX=0; double dY=0; - for (int i = 1; i < iCol; i++) - dX += ExcelHelper.ColumnWidth2Pixel(Sheet, Sheet.Column(i).Width); - for (int i = 1; i < iRow; i++) - dY += ExcelHelper.RowHeight2Pixel(Sheet.Row(i).Height); + dX = ExcelHelper.Column2Pixel(Sheet, iCol); + dY = ExcelHelper.Row2Pixel(Sheet, iRow); int iWidth = RadarChart.Width; int iHeight = RadarChart.Height; @@ -219,61 +217,74 @@ namespace friction var picRadarChart = Sheet.Drawings.AddPicture("Radar Chart", RadarChart); picRadarChart.SetPosition((int)dY, (int)dX); picRadarChart.SetSize(iWidth, iHeight); - dY += iHeight + 60; + dY += iHeight; + iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight); if (TrendChartByHumidity != null) { - iRow += 29; + const int iPictureWidth = 400; - Sheet.Cells[iRow, 2].Value = MaterialSpring + " vs " + MaterialTable; - Sheet.Cells[iRow, 2].Style.Font.Bold = true; + iRow += 3; + iCol = 2; - iRow += 14; + Sheet.Cells[iRow, iCol].Value = MaterialSpring + " vs " + MaterialTable; + Sheet.Cells[iRow, iCol].Style.Font.Bold = true; + iRow += 1; + dY = ExcelHelper.Row2Pixel(Sheet, iRow); - dY += 20; var picTrendChartHumidity = Sheet.Drawings.AddPicture("Trend Chart by Humidity", TrendChartByHumidity); picTrendChartHumidity.SetPosition((int)dY, (int)dX); iWidth = TrendChartByHumidity.Width; iHeight = TrendChartByHumidity.Height; - iHeight = iHeight * 390 / iWidth; - iWidth = 390; + iHeight = iHeight * iPictureWidth / iWidth; + iWidth = iPictureWidth; picTrendChartHumidity.SetSize(iWidth, iHeight); - Sheet.Cells[iRow, 2].Value = "by Humidity"; + int iPrevRow = iRow; + iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight); + Sheet.Cells[iRow, iCol].Value = "by Humidity"; - dX += 400; + iRow = iPrevRow; + iCol = ExcelHelper.Pixel2NextColumn(Sheet, iCol, iWidth); + dX = ExcelHelper.Column2Pixel(Sheet, iCol); var picTrendChartTemperature = Sheet.Drawings.AddPicture("Trend Chart by Temperature", TrendChartByTemperature); picTrendChartTemperature.SetPosition((int)dY, (int)dX); iWidth = TrendChartByTemperature.Width; iHeight = TrendChartByTemperature.Height; - iHeight = iHeight * 390 / iWidth; - iWidth = 390; + iHeight = iHeight * iPictureWidth / iWidth; + iWidth = iPictureWidth; picTrendChartTemperature.SetSize(iWidth, iHeight); - Sheet.Cells[iRow, 8].Value = "by Temperature"; + iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight); + Sheet.Cells[iRow, iCol].Value = "by Temperature"; - iRow += 15; - dX -= 400; - dY += iHeight + 10; + iRow += 2; + iCol = 2; + dX = ExcelHelper.Column2Pixel(Sheet, iCol); + dY = ExcelHelper.Row2Pixel(Sheet, iRow); var picTrendChartForce = Sheet.Drawings.AddPicture("Trend Chart by Force", TrendChartByForce); picTrendChartForce.SetPosition((int)dY, (int)dX); iWidth = TrendChartByForce.Width; iHeight = TrendChartByForce.Height; - iHeight = iHeight * 390 / iWidth; - iWidth = 390; + iHeight = iHeight * iPictureWidth / iWidth; + iWidth = iPictureWidth; picTrendChartForce.SetSize(iWidth, iHeight); + iPrevRow = iRow; + iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight); Sheet.Cells[iRow, 2].Value = "by Force"; - - dX += 400; + iRow = iPrevRow; + iCol = ExcelHelper.Pixel2NextColumn(Sheet, iCol, iWidth); + dX = ExcelHelper.Column2Pixel(Sheet, iCol); var picTrendChartVelocity = Sheet.Drawings.AddPicture("Trend Chart by Velocity", TrendChartByVelocity); picTrendChartVelocity.SetPosition((int)dY, (int)dX); iWidth = TrendChartByVelocity.Width; iHeight = TrendChartByVelocity.Height; - iHeight = iHeight * 390 / iWidth; - iWidth = 390; + iHeight = iHeight * iPictureWidth / iWidth; + iWidth = iPictureWidth; picTrendChartVelocity.SetSize(iWidth, iHeight); - Sheet.Cells[iRow, 8].Value = "by Velocity"; + iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight); + Sheet.Cells[iRow, iCol].Value = "by Velocity"; } package.SaveAs(new FileInfo(FilePath));