리포트 수정
그래프 범위 수정 그래프 활성화될 때 table 선택
This commit is contained in:
16
MainForm.cs
16
MainForm.cs
@@ -535,5 +535,21 @@ namespace friction
|
||||
Theme.Apply(menuStrip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void OnRadarGraphActivated()
|
||||
{
|
||||
if (m_DataHandler.GetCurTable() != "All")
|
||||
OnApplyData(this, m_DataHandler.GetCurSpring(), "All");
|
||||
}
|
||||
|
||||
public void OnTrendGraphActivated()
|
||||
{
|
||||
if (m_DataHandler.GetCurTable() == "All")
|
||||
{
|
||||
List<string> tableList = m_DataHandler.GetTableList();
|
||||
if(tableList.Count > 0)
|
||||
OnApplyData(this, m_DataHandler.GetCurSpring(), tableList[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
PanelRadarGraph.Designer.cs
generated
1
PanelRadarGraph.Designer.cs
generated
@@ -262,6 +262,7 @@
|
||||
this.TabText = "Radar Graph";
|
||||
this.Text = "Radar Graph";
|
||||
this.VisibleChanged += new System.EventHandler(this.PanelRadarGraph_VisibleChanged);
|
||||
this.Enter += new System.EventHandler(this.PanelRadarGraph_Enter);
|
||||
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
|
||||
@@ -214,5 +214,10 @@ namespace friction
|
||||
m_CurSpring = "";
|
||||
UpdateGraph();
|
||||
}
|
||||
|
||||
private void PanelRadarGraph_Enter(object sender, EventArgs e)
|
||||
{
|
||||
m_Owner.OnRadarGraphActivated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
PanelTrendGraph.Designer.cs
generated
1
PanelTrendGraph.Designer.cs
generated
@@ -180,6 +180,7 @@
|
||||
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
|
||||
this.TabText = "Trend Graph";
|
||||
this.Text = "Trend Graph";
|
||||
this.Enter += new System.EventHandler(this.PanelTrendGraph_Enter);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.panelGraph.ResumeLayout(false);
|
||||
|
||||
@@ -152,9 +152,8 @@ namespace friction
|
||||
string strTable = m_DataHandler.GetCurTable();
|
||||
|
||||
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
|
||||
if (Chart.Count <= 0)
|
||||
return;
|
||||
|
||||
trendChart.Series.Clear();
|
||||
trendChart.AxisX[0].Title = "Humidity";
|
||||
|
||||
ChartValues<ScatterPoint>[] Points = {
|
||||
@@ -176,6 +175,9 @@ namespace friction
|
||||
Values.Add(new TrendLine.POINT { X = pnt.HUMIDITY, Y = pnt.RPN });
|
||||
}
|
||||
|
||||
if (Chart.Count <= 0)
|
||||
return;
|
||||
|
||||
Values.Sort((a, b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
|
||||
TrendLine trendline = new TrendLine(Values);
|
||||
ChartValues<ScatterPoint> TrendPoints = new ChartValues<ScatterPoint>();
|
||||
@@ -224,8 +226,12 @@ namespace friction
|
||||
};
|
||||
|
||||
|
||||
trendChart.AxisX[0].MinValue = Chart.Min(r => r.HUMIDITY - 1);
|
||||
trendChart.AxisX[0].MaxValue = Chart.Max(r => r.HUMIDITY - 1);
|
||||
float fMin = Chart.Min(r => r.HUMIDITY);
|
||||
float fMax = Chart.Max(r => r.HUMIDITY);
|
||||
float fMargin = (fMax - fMin) * 0.05f;
|
||||
|
||||
trendChart.AxisX[0].MinValue = (fMin-fMargin);
|
||||
trendChart.AxisX[0].MaxValue = (fMax+fMargin);
|
||||
|
||||
m_CurSpring = strSpring;
|
||||
m_CurTable = strTable;
|
||||
@@ -237,9 +243,7 @@ namespace friction
|
||||
string strTable = m_DataHandler.GetCurTable();
|
||||
|
||||
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
|
||||
if (Chart.Count <= 0)
|
||||
return;
|
||||
|
||||
trendChart.Series.Clear();
|
||||
trendChart.AxisX[0].Title = "Temperature";
|
||||
|
||||
ChartValues<ScatterPoint>[] Points = {
|
||||
@@ -257,6 +261,9 @@ namespace friction
|
||||
Values.Add(new TrendLine.POINT { X = pnt.TEMPERATURE, Y = pnt.RPN });
|
||||
}
|
||||
|
||||
if (Chart.Count <= 0)
|
||||
return;
|
||||
|
||||
Values.Sort((a, b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
|
||||
TrendLine trendline = new TrendLine(Values);
|
||||
ChartValues<ScatterPoint> TrendPoints = new ChartValues<ScatterPoint>();
|
||||
@@ -290,8 +297,12 @@ namespace friction
|
||||
};
|
||||
|
||||
|
||||
trendChart.AxisX[0].MinValue = Chart.Min(r => r.HUMIDITY - 1);
|
||||
trendChart.AxisX[0].MaxValue = Chart.Max(r => r.HUMIDITY - 1);
|
||||
float fMin = Chart.Min(r => r.TEMPERATURE);
|
||||
float fMax = Chart.Max(r => r.TEMPERATURE);
|
||||
float fMargin = (fMax - fMin) * 0.05f;
|
||||
|
||||
trendChart.AxisX[0].MinValue = (fMin - fMargin);
|
||||
trendChart.AxisX[0].MaxValue = (fMax + fMargin);
|
||||
}
|
||||
|
||||
private void UpdateGraphForce()
|
||||
@@ -300,9 +311,7 @@ namespace friction
|
||||
string strTable = m_DataHandler.GetCurTable();
|
||||
|
||||
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
|
||||
if (Chart.Count <= 0)
|
||||
return;
|
||||
|
||||
trendChart.Series.Clear();
|
||||
trendChart.AxisX[0].Title = "Force";
|
||||
|
||||
var Points = new ChartValues<ScatterPoint>();
|
||||
@@ -314,6 +323,9 @@ namespace friction
|
||||
Values.Add(new TrendLine.POINT { X = pnt.FORCE, Y = pnt.RPN });
|
||||
}
|
||||
|
||||
if (Chart.Count <= 0)
|
||||
return;
|
||||
|
||||
Values.Sort((a, b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
|
||||
TrendLine trendline = new TrendLine(Values);
|
||||
ChartValues<ScatterPoint> TrendPoints = new ChartValues<ScatterPoint>();
|
||||
@@ -340,8 +352,12 @@ namespace friction
|
||||
};
|
||||
|
||||
|
||||
trendChart.AxisX[0].MinValue = Chart.Min(r => r.HUMIDITY - 1);
|
||||
trendChart.AxisX[0].MaxValue = Chart.Max(r => r.HUMIDITY - 1);
|
||||
float fMin = Chart.Min(r => r.FORCE);
|
||||
float fMax = Chart.Max(r => r.FORCE);
|
||||
float fMargin = (fMax - fMin) * 0.05f;
|
||||
|
||||
trendChart.AxisX[0].MinValue = (fMin - fMargin);
|
||||
trendChart.AxisX[0].MaxValue = (fMax + fMargin);
|
||||
}
|
||||
|
||||
private void UpdateGraphVelocity()
|
||||
@@ -350,9 +366,7 @@ namespace friction
|
||||
string strTable = m_DataHandler.GetCurTable();
|
||||
|
||||
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
|
||||
if (Chart.Count <= 0)
|
||||
return;
|
||||
|
||||
trendChart.Series.Clear();
|
||||
trendChart.AxisX[0].Title = "Velocity";
|
||||
|
||||
var Points = new ChartValues<ScatterPoint>();
|
||||
@@ -364,6 +378,9 @@ namespace friction
|
||||
Values.Add(new TrendLine.POINT { X = pnt.VELOCITY, Y = pnt.RPN });
|
||||
}
|
||||
|
||||
if (Chart.Count <= 0)
|
||||
return;
|
||||
|
||||
Values.Sort((a, b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
|
||||
TrendLine trendline = new TrendLine(Values);
|
||||
ChartValues<ScatterPoint> TrendPoints = new ChartValues<ScatterPoint>();
|
||||
@@ -390,8 +407,12 @@ namespace friction
|
||||
};
|
||||
|
||||
|
||||
trendChart.AxisX[0].MinValue = Chart.Min(r => r.HUMIDITY - 1);
|
||||
trendChart.AxisX[0].MaxValue = Chart.Max(r => r.HUMIDITY - 1);
|
||||
float fMin = Chart.Min(r => r.VELOCITY);
|
||||
float fMax = Chart.Max(r => r.VELOCITY);
|
||||
float fMargin = (fMax - fMin) * 0.05f;
|
||||
|
||||
trendChart.AxisX[0].MinValue = (fMin - fMargin);
|
||||
trendChart.AxisX[0].MaxValue = (fMax + fMargin);
|
||||
}
|
||||
|
||||
public void UpdateGraph(GRAPH_TYPE Type=GRAPH_TYPE.NONE)
|
||||
@@ -445,22 +466,26 @@ namespace friction
|
||||
|
||||
private void rbHumidity_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateGraph(GRAPH_TYPE.HUMIDITY);
|
||||
if(sender == rbHumidity && rbHumidity.Checked == true)
|
||||
UpdateGraph(GRAPH_TYPE.HUMIDITY);
|
||||
}
|
||||
|
||||
private void rbTemp_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateGraph(GRAPH_TYPE.TEMPERATURE);
|
||||
if (sender == rbTemp && rbTemp.Checked == true)
|
||||
UpdateGraph(GRAPH_TYPE.TEMPERATURE);
|
||||
}
|
||||
|
||||
private void rbForce_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateGraph(GRAPH_TYPE.FORCE);
|
||||
if (sender == rbForce && rbForce.Checked == true)
|
||||
UpdateGraph(GRAPH_TYPE.FORCE);
|
||||
}
|
||||
|
||||
private void rbVelocity_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateGraph(GRAPH_TYPE.VELOCITY);
|
||||
if (sender == rbVelocity && rbVelocity.Checked == true)
|
||||
UpdateGraph(GRAPH_TYPE.VELOCITY);
|
||||
}
|
||||
|
||||
public void CopyChart(GRAPH_TYPE Type)
|
||||
@@ -499,5 +524,9 @@ namespace friction
|
||||
}));
|
||||
}
|
||||
|
||||
private void PanelTrendGraph_Enter(object sender, EventArgs e)
|
||||
{
|
||||
m_Owner.OnTrendGraphActivated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
Report.cs
17
Report.cs
@@ -221,9 +221,12 @@ namespace friction
|
||||
|
||||
if (TrendChartByHumidity != null)
|
||||
{
|
||||
iRow += 27;
|
||||
|
||||
Sheet.Cells[71, 2].Value = MaterialSpring + " vs " + MaterialTable;
|
||||
Sheet.Cells[71, 2].Style.Font.Bold = true;
|
||||
Sheet.Cells[iRow, 2].Value = MaterialSpring + " vs " + MaterialTable;
|
||||
Sheet.Cells[iRow, 2].Style.Font.Bold = true;
|
||||
|
||||
iRow += 13;
|
||||
|
||||
dY += 20;
|
||||
var picTrendChartHumidity = Sheet.Drawings.AddPicture("Trend Chart by Humidity", TrendChartByHumidity);
|
||||
@@ -233,7 +236,7 @@ namespace friction
|
||||
iHeight = iHeight * 390 / iWidth;
|
||||
iWidth = 390;
|
||||
picTrendChartHumidity.SetSize(iWidth, iHeight);
|
||||
Sheet.Cells[84, 2].Value = "by Humidity";
|
||||
Sheet.Cells[iRow, 2].Value = "by Humidity";
|
||||
|
||||
|
||||
dX += 400;
|
||||
@@ -244,9 +247,9 @@ namespace friction
|
||||
iHeight = iHeight * 390 / iWidth;
|
||||
iWidth = 390;
|
||||
picTrendChartTemperature.SetSize(iWidth, iHeight);
|
||||
Sheet.Cells[84, 8].Value = "by Temperature";
|
||||
|
||||
Sheet.Cells[iRow, 8].Value = "by Temperature";
|
||||
|
||||
iRow += 14;
|
||||
dX -= 400;
|
||||
dY += iHeight + 10;
|
||||
var picTrendChartForce = Sheet.Drawings.AddPicture("Trend Chart by Force", TrendChartByForce);
|
||||
@@ -256,7 +259,7 @@ namespace friction
|
||||
iHeight = iHeight * 390 / iWidth;
|
||||
iWidth = 390;
|
||||
picTrendChartForce.SetSize(iWidth, iHeight);
|
||||
Sheet.Cells[97, 2].Value = "by Force";
|
||||
Sheet.Cells[iRow, 2].Value = "by Force";
|
||||
|
||||
|
||||
dX += 400;
|
||||
@@ -267,7 +270,7 @@ namespace friction
|
||||
iHeight = iHeight * 390 / iWidth;
|
||||
iWidth = 390;
|
||||
picTrendChartVelocity.SetSize(iWidth, iHeight);
|
||||
Sheet.Cells[97, 8].Value = "by Velocity";
|
||||
Sheet.Cells[iRow, 8].Value = "by Velocity";
|
||||
}
|
||||
|
||||
package.SaveAs(new FileInfo(FilePath));
|
||||
|
||||
Reference in New Issue
Block a user