Merge remote-tracking branch 'origin/fix_databindings'

# Conflicts:
#	SanSystem/UCInliner.cs
This commit is contained in:
Husky
2018-07-11 19:24:43 +02:00
20 changed files with 927 additions and 21 deletions

View File

@@ -38,8 +38,21 @@
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Chart.Base, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.Chart.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Chart.Windows, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.Chart.Windows.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Shared.Base, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.Shared.Base.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Design" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -127,6 +140,9 @@
<EmbeddedResource Include="UCSchachtanbindung.resx">
<DependentUpon>UCSchachtanbindung.cs</DependentUpon>
</EmbeddedResource>
<None Include="documents\JUME\liner_einbau.docx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="Properties\DataSources\KlassenBIB.Strasse.datasource" />
<None Include="Properties\Settings.settings">
@@ -143,6 +159,10 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BerichtGen\BerichtGen.csproj">
<Project>{3022da07-fd06-4aea-9fc8-00d318e95a82}</Project>
<Name>BerichtGen</Name>
</ProjectReference>
<ProjectReference Include="..\Database\Database.csproj">
<Project>{b0227727-6cf9-4e2e-9afe-5dd76deaa9db}</Project>
<Name>Database</Name>

View File

@@ -30,6 +30,10 @@
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.btn_create_graph = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.ftpProgress = new System.Windows.Forms.ProgressBar();
this.btn_transfer_ftp = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.dt_eingebaut = new System.Windows.Forms.DateTimePicker();
this.cb_fertig = new System.Windows.Forms.CheckBox();
@@ -67,8 +71,7 @@
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.btn_transfer_ftp = new System.Windows.Forms.Button();
this.ftpProgress = new System.Windows.Forms.ProgressBar();
this.btn_create_protokol = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox3.SuspendLayout();
@@ -90,6 +93,9 @@
//
// tabPage2
//
this.tabPage2.Controls.Add(this.btn_create_protokol);
this.tabPage2.Controls.Add(this.btn_create_graph);
this.tabPage2.Controls.Add(this.button1);
this.tabPage2.Controls.Add(this.ftpProgress);
this.tabPage2.Controls.Add(this.btn_transfer_ftp);
this.tabPage2.Controls.Add(this.label1);
@@ -113,6 +119,43 @@
this.tabPage2.Text = "Vorraussetzungen";
this.tabPage2.UseVisualStyleBackColor = true;
//
// btn_create_graph
//
this.btn_create_graph.Location = new System.Drawing.Point(443, 487);
this.btn_create_graph.Name = "btn_create_graph";
this.btn_create_graph.Size = new System.Drawing.Size(138, 67);
this.btn_create_graph.TabIndex = 32;
this.btn_create_graph.Text = "UVGraphic erzeugen";
this.btn_create_graph.UseVisualStyleBackColor = true;
this.btn_create_graph.Click += new System.EventHandler(this.btn_create_graph_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(829, 197);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(199, 66);
this.button1.TabIndex = 30;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// ftpProgress
//
this.ftpProgress.Location = new System.Drawing.Point(782, 487);
this.ftpProgress.Name = "ftpProgress";
this.ftpProgress.Size = new System.Drawing.Size(280, 37);
this.ftpProgress.TabIndex = 29;
//
// btn_transfer_ftp
//
this.btn_transfer_ftp.Location = new System.Drawing.Point(820, 317);
this.btn_transfer_ftp.Name = "btn_transfer_ftp";
this.btn_transfer_ftp.Size = new System.Drawing.Size(224, 126);
this.btn_transfer_ftp.TabIndex = 28;
this.btn_transfer_ftp.Text = "button1";
this.btn_transfer_ftp.UseVisualStyleBackColor = true;
this.btn_transfer_ftp.Click += new System.EventHandler(this.btn_transfer_ftp_Click);
//
// label1
//
this.label1.AutoSize = true;
@@ -515,22 +558,15 @@
this.label9.TabIndex = 0;
this.label9.Text = "Harz";
//
// btn_transfer_ftp
// btn_create_protokol
//
this.btn_transfer_ftp.Location = new System.Drawing.Point(820, 317);
this.btn_transfer_ftp.Name = "btn_transfer_ftp";
this.btn_transfer_ftp.Size = new System.Drawing.Size(224, 126);
this.btn_transfer_ftp.TabIndex = 28;
this.btn_transfer_ftp.Text = "button1";
this.btn_transfer_ftp.UseVisualStyleBackColor = true;
this.btn_transfer_ftp.Click += new System.EventHandler(this.btn_transfer_ftp_Click);
//
// ftpProgress
//
this.ftpProgress.Location = new System.Drawing.Point(782, 487);
this.ftpProgress.Name = "ftpProgress";
this.ftpProgress.Size = new System.Drawing.Size(280, 37);
this.ftpProgress.TabIndex = 29;
this.btn_create_protokol.Location = new System.Drawing.Point(626, 484);
this.btn_create_protokol.Name = "btn_create_protokol";
this.btn_create_protokol.Size = new System.Drawing.Size(107, 69);
this.btn_create_protokol.TabIndex = 33;
this.btn_create_protokol.Text = "Protokoll erzeugen";
this.btn_create_protokol.UseVisualStyleBackColor = true;
this.btn_create_protokol.Click += new System.EventHandler(this.btn_create_protokol_Click);
//
// UCInliner
//
@@ -598,5 +634,8 @@
private System.Windows.Forms.DateTimePicker dt_eingebaut;
private System.Windows.Forms.Button btn_transfer_ftp;
private System.Windows.Forms.ProgressBar ftpProgress;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btn_create_graph;
private System.Windows.Forms.Button btn_create_protokol;
}
}

View File

@@ -12,6 +12,8 @@ using System.Diagnostics;
using System.IO;
using SanShared;
using FluentFTP;
using System.Collections;
using Syncfusion.Windows.Forms.Chart;
namespace SanSystem
{
@@ -196,5 +198,124 @@ namespace SanSystem
}
}
}
private void button1_Click(object sender, EventArgs e)
{
Hashtable grunddaten = new Hashtable()
{
{"KL_Wetter","Trocken" }
};
List<BilderObject> bilderO = new List<BilderObject>();
bilderO.Add(new BilderObject()
{
ImgID = 1,
Kommentar = "TestBild",
Path = @"C:\Users\Damian\Desktop\SanVerwaltung\SanSystem\bin\Debug\projekte\18-850\SW01-SW02\Schachtanbindung\4d0a1627-bd51-48d6-a27e-a4c6691b02d2.jpg"
});
BerichtGen.Options options = new BerichtGen.Options("", "", "", grunddaten,bilderO);
options.ShowDialog();
}
private static ChartControl getGraph(string csvFile)
{
Size size = new Size(600, 400);
ChartControl chartControl = new ChartControl();
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);
if (!File.Exists(csvFile)) return null;
string[] input = File.ReadAllLines(csvFile);
int counter = 0;
foreach (string pars in input)
{
string[] parts = pars.Split(',');
if (parts[0].Equals("Group1") || parts[1].Equals("(END)")) continue;
double temperatur = double.Parse(parts[1].Replace('.', ','));
double druck = double.Parse(parts[2].Replace('.', ','));
temperaturChart.Points.Add(counter, temperatur);
druckChart.Points.Add(counter, druck);
counter++;
}
temperaturChart.YAxis = axis;
druckChart.YAxis = axis0;
axis.Title = "°C";
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.Skins = Skins.Metro;
axis1.OpposedPosition = true;
axis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
axis0.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
axis1.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
return chartControl;
}
private void btn_create_graph_Click(object sender, EventArgs e)
{
Stopwatch watch = new Stopwatch();
string myPath = Path.Combine(destinationPath, "Trend");
IEnumerable<string> files = Directory.EnumerateFiles(myPath, "*.csv", SearchOption.AllDirectories);
ChartControl chart = getGraph(files.Last());
if (chart == null) MessageBox.Show("Konnte CSV nicht finden!");
else
chart.SaveImage(Path.Combine(destinationPath, "linerGraph.jpg"));
watch.Stop();
MessageBox.Show((watch.ElapsedTicks) + " s");
}
private void btn_create_protokol_Click(object sender, EventArgs e)
{
Hashtable hashtable = inliner.MakeProtokoll(destinationPath);
BerichtGen.Options options = new BerichtGen.Options("JUME", "liner_einbau.docx", "./", hashtable, new List<BilderObject>());
options.ShowDialog();
}
}
}

Binary file not shown.

View File

@@ -9,6 +9,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SanShared;
using System.Collections;
namespace SanSystem
{
@@ -46,14 +47,21 @@ namespace SanSystem
tabControl1.TabPages.Add(tab);
}
}
if (Environment.MachineName.Equals("MEVES-LT"))
{
this.Width = 1512;
this.Height = 907;
}
}
private void frmObjektEdit_Load(object sender, EventArgs e)
{
txt_laenge_schacht.DataBindings.Add(new Binding("Text", inspektionsobjekt, "Schachtlaenge"));
txt_objekt_name.DataBindings.Add(new Binding("Text", inspektionsobjekt, "Objektbezeichnung"));
txt_punkt_von.DataBindings.Add(new Binding("Text", inspektionsobjekt, "VonPunkt"));
txt_punkt_bis.DataBindings.Add(new Binding("Text", inspektionsobjekt, "BisPunkt"));
txt_strasse.DataBindings.Add(new Binding("Text", inspektionsobjekt, "StrasseName"));
@@ -63,7 +71,7 @@ namespace SanSystem
txt_dn.DataBindings.Add(new Binding("Text", inspektionsobjekt, "Kanalrohrweite"));
txt_pro_nr.DataBindings.Add(new Binding("Text", inspektionsobjekt, "ProjektNummer"));
dt_haltunggemessen_datum.DataBindings.Add(new Binding("Value", inspektionsobjekt, "HaltungGemessen"));
}
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
@@ -87,6 +95,24 @@ namespace SanSystem
private void btn_close_Click(object sender, EventArgs e)
{
int width = this.Width;
int height = this.Height;
txt_laenge_schacht.DataBindings.Clear();
txt_objekt_name.DataBindings.Clear();
txt_punkt_von.DataBindings.Clear();
txt_punkt_bis.DataBindings.Clear();
txt_strasse.DataBindings.Clear();
txt_hausnummer.DataBindings.Clear();
cb_material.DataBindings.Clear();
txt_haltungslaenge.DataBindings.Clear();
txt_dn.DataBindings.Clear();
txt_pro_nr.DataBindings.Clear();
dt_haltunggemessen_datum.DataBindings.Clear();
//MessageBox.Show(string.Format("width: {0} height: {1}", width, height));
this.Close();
}