Druckverlaufgrafik getrennt.

Wird kein Exception geworfen, wenn bild nicht vorhanden ist in Schachtanbindung
This commit is contained in:
Husky
2019-03-11 21:19:46 +01:00
parent fd96f439a8
commit 3b45cc592a
6 changed files with 43 additions and 42 deletions

View File

@@ -149,7 +149,8 @@ namespace BerichtGen
private void MailMerge_MergeImageField(object sender, MergeImageFieldEventArgs args)
{
if(args.FieldName == "UVImage")
if(args.FieldName == "UVImageTemp" || args.FieldName == "UVImageDruck")
{
string source = args.FieldValue.ToString();
if (!File.Exists(source)) return;

View File

@@ -101,7 +101,8 @@ namespace KlassenBIB
{"vakuum","" },
{"time_start","" },
{"time_ende","" },
{"UVImage","" },
{"UVImageTemp","" },
{"UVImageDruck","" },
{"liner_type","" },
{"rueckhol_speed","" },
{"harz_type","" }
@@ -145,7 +146,8 @@ namespace KlassenBIB
grunddaten["vakuum"] = this.KalibrierUnterdruck;
grunddaten["time_start"] = this.AnfangAushaertung;
grunddaten["time_ende"] = this.EndeAushaertung;
grunddaten["UVImage"] = Path.Combine(destinationPath, "linerGraph.jpg");
grunddaten["UVImageTemp"] = Path.Combine(destinationPath, "linerGraph_temp.jpg");
grunddaten["UVImageDruck"] = Path.Combine(destinationPath, "linerGraph_druck.jpg");
grunddaten["rueckhol_speed"] = rueckholgeschwindigkeit;
grunddaten["liner_type"] = LinerTyp;
grunddaten["harz_type"] = HarzTyp;

View File

@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;LAPTOP</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\SanSystem.xml</DocumentationFile>

View File

@@ -210,7 +210,7 @@ namespace SanSystem
}
private static ChartControl getGraph(List<UVcsvStrukture> input)
private static ChartControl getGraph(List<UVcsvStrukture> input,string type)
{
Size size = new Size(600, 400);
@@ -218,67 +218,60 @@ namespace SanSystem
chartControl.Size = size;
ChartAxis axis = chartControl.PrimaryYAxis;
ChartAxis axis0 = new ChartAxis(ChartOrientation.Vertical);
ChartAxis axis1 = new ChartAxis(ChartOrientation.Vertical);
ChartAxisLayout layout1 = new ChartAxisLayout();
ChartAxisLayout layout2 = new ChartAxisLayout();
chartControl.Axes.Add(axis0);
//chartControl.Axes.Add(axis1);
layout1.Spacing = 12;
layout2.Spacing = 12;
layout1.Axes.Add(axis);
layout2.Axes.Add(axis0);
//layout2.Axes.Add(axis1);
chartControl.ChartArea.YLayouts.Add(layout1);
chartControl.ChartArea.YLayouts.Add(layout2);
ChartSeries temperaturChart = new ChartSeries("Temperatur", ChartSeriesType.Line);
ChartSeries druckChart = new ChartSeries("Druck", ChartSeriesType.Line);
ChartSeries mychart = new ChartSeries(type, ChartSeriesType.Line);
int counter = 0;
foreach (UVcsvStrukture pars in input)
{
temperaturChart.Points.Add(counter, pars.Temperatur);
druckChart.Points.Add(counter, pars.Druck);
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++;
}
temperaturChart.YAxis = axis;
druckChart.YAxis = axis0;
mychart.YAxis = axis;
axis.Title = "°C";
switch(type)
{
case "Temperatur":
axis.Title = "°C";
break;
case "Druck":
axis.Title = "[bar]";
break;
}
axis.TitleFont = new Font("Segeo UI", 14F);
axis0.Title = "[bar]";
axis0.TitleFont = new Font("Segeo UI", 14F);
chartControl.LegendsPlacement = ChartPlacement.Outside;
chartControl.LegendPosition = ChartDock.Bottom;
chartControl.LegendAlignment = ChartAlignment.Center;
chartControl.Title.Visible = false;
/*ChartAxis chartAxis = new ChartAxis();
chartAxis.Orientation = ChartOrientation.Horizontal;
chartAxis.Range = new MinMaxInfo(0, 6, 1);
chartAxis.DrawGrid = false;
chartAxis.LineType.Width = 1F;
chartAxis.LineType.ForeColor = Color.Black;
chartControl.Axes.Add(chartAxis);
*/
chartControl.Series.Add(temperaturChart);
chartControl.Series.Add(druckChart);
chartControl.Series.Add(mychart);
chartControl.Skins = Skins.Metro;
//axis1.OpposedPosition = true;
axis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
axis0.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
//axis1.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
return chartControl;
}
@@ -296,10 +289,14 @@ namespace SanSystem
inliner.AnfangAushaertung = struktures.Select(x => x.Zeitstempel).Min();
inliner.EndeAushaertung = struktures.Select(x => x.Zeitstempel).Max();
ChartControl chart = getGraph(struktures);
if (chart == null) return false;
ChartControl tempChart = getGraph(struktures,"Temperatur");
if (tempChart == null) return false;
else
chart.SaveImage(Path.Combine(destinationPath, "linerGraph.jpg"));
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;
}

View File

@@ -124,6 +124,7 @@ namespace SanSystem
if (!File.Exists(pfad))
{
MessageBox.Show("Bilddatei mit den Pfad " + pfad + " nicht gefunden");
return;
}
pt_box.Load(pfad);
pt_box.SizeMode = PictureBoxSizeMode.StretchImage;