Syncfusion geupdated

Refactoring durchgeführt
This commit is contained in:
Husky
2019-07-14 11:23:24 +02:00
parent 63cc7cbdf0
commit 7ec76a5edc
11 changed files with 195 additions and 151 deletions

View File

@@ -13,8 +13,8 @@ using System.IO;
using SanShared;
using FluentFTP;
using System.Collections;
using Syncfusion.Windows.Forms.Chart;
using CSVParser;
using BerichtGen;
namespace SanSystem
{
@@ -213,71 +213,7 @@ namespace SanSystem
}
private static ChartControl getGraph(List<UVcsvStrukture> input,string type)
{
Size size = new Size(600, 400);
ChartControl chartControl = new ChartControl();
chartControl.Size = size;
ChartAxis axis = chartControl.PrimaryYAxis;
ChartAxisLayout layout1 = new ChartAxisLayout();
layout1.Spacing = 12;
layout1.Axes.Add(axis);
chartControl.ChartArea.YLayouts.Add(layout1);
ChartSeries mychart = new ChartSeries(type, ChartSeriesType.Line);
int counter = 0;
foreach (UVcsvStrukture pars in input)
{
if (type.Equals("Temperatur"))
mychart.Points.Add(counter, pars.Temperatur);
else if (type.Equals("Druck"))
mychart.Points.Add(counter, pars.Druck);
else
throw new Exception("Kein gültiger Aufruf");
counter++;
}
mychart.YAxis = axis;
switch(type)
{
case "Temperatur":
axis.Title = "°C";
break;
case "Druck":
axis.Title = "[bar]";
break;
}
axis.TitleFont = new Font("Segeo UI", 14F);
chartControl.LegendsPlacement = ChartPlacement.Outside;
chartControl.LegendPosition = ChartDock.Bottom;
chartControl.LegendAlignment = ChartAlignment.Center;
chartControl.Title.Visible = false;
chartControl.Series.Add(mychart);
chartControl.Skins = Skins.Metro;
axis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
return chartControl;
}
private bool AccessCSV()
@@ -295,15 +231,8 @@ namespace SanSystem
inliner.AnfangAushaertung = struktures.Select(x => x.Zeitstempel).Min();
inliner.EndeAushaertung = struktures.Select(x => x.Zeitstempel).Max();
ChartControl tempChart = getGraph(struktures,"Temperatur");
if (tempChart == null) return false;
else
tempChart.SaveImage(Path.Combine(destinationPath, "linerGraph_temp.jpg"));
ChartControl druckChart = getGraph(struktures, "Druck");
if (druckChart == null) return false;
else
druckChart.SaveImage(Path.Combine(destinationPath, "linerGraph_druck.jpg"));
return true;
return makeGraphic.GetGraphics(struktures, destinationPath);
}
private void btn_create_protokol_Click(object sender, EventArgs e)