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

Binary file not shown.

Binary file not shown.

Binary file not shown.

127
BerichtGen/Bericht.cs Normal file
View File

@@ -0,0 +1,127 @@
using SanShared;
using Syncfusion.DocIO.DLS;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BerichtGen
{
public class Bericht
{
private List<Image> _listImages;
/// <summary>
/// Erstellt
/// </summary>
/// <param name="vorlage">Die zuverwendete Vorlagenname</param>
/// <param name="documentname">Die name zum Speichern der Datei</param>
/// <param name="savepath">Pfad zum Speichern</param>
/// <param name="daten">Inhalt vom Dokument </param>
/// <param name="erzeugeDoc">Ein doc datei soll erzeugt werden</param>
/// <param name="erzeugePDF">Ein Pdf datei soll erzeugt werden</param>
public void Erzeuge(string firma, string vorlage, string savepath, Hashtable daten,List<BilderObject> bilderObjects, bool erzeugeDOC = false , bool erzeugePDF = true)
{
_listImages = new List<Image>();
foreach(BilderObject current in bilderObjects)
{
Image image = Image.FromFile(current.Path);
_listImages.Add(ResizeImage(image, CalculateImageSizeForDocument(image.Height, image.Width)));
image.Dispose();
}
WordDocument wordDocument = new WordDocument("./documents/JUME/liner_einbau.docx");
string[] fieldnames = null;
string[] fieldvalues = null;
if(fieldnames == null || fieldvalues == null)
{
fieldnames = new string[daten.Count];
fieldvalues = new string[daten.Count];
}
uint counter = 0;
foreach(DictionaryEntry hashtable in daten)
{
fieldnames[counter] = hashtable.Key.ToString();
if (hashtable.Value == null)
{
fieldvalues[counter] = "";
}
else
{
fieldvalues[counter] = hashtable.Value.ToString();
}
counter++;
}
//wordDocument.MailMerge.Execute(fieldnames, fieldvalues);
wordDocument.MailMerge.MergeImageField += new MergeImageFieldEventHandler(MailMerge_MergeImageField);
//string[] fieldNames = new string[] { "UVImage" };
//string[] fieldValues = new string[] { "test.png" };
wordDocument.MailMerge.Execute(fieldnames, fieldvalues);
wordDocument.Save("test.docx", Syncfusion.DocIO.FormatType.Docx);
wordDocument.Close();
//wordDocument.MailMerge.ExecuteGroup()
}
private readonly double _cmPixel = 0.393700787;
private readonly int _dpi = 120;
private readonly double _imgWidthCmMax = 8.0;
private Size CalculateImageSizeForDocument(int height, int width)
{
double num = (double)height / (double)width;
double num2 = this._imgWidthCmMax * num;
int h = (int)(num2 * _cmPixel * (double)_dpi);
int w = (int)(_imgWidthCmMax * _cmPixel * (double)_dpi);
return new Size(w, h);
}
private Image ResizeImage(Image image, Size size)
{
int width = image.Width;
int height = image.Height;
float num = (float)size.Width / (float)width;
float num2 = (float)size.Height / (float)height;
float num3 = (num2 < num) ? num2 : num;
int width2 = (int)((float)width * num3);
int height2 = (int)((float)height * num3);
Bitmap bitmap = new Bitmap(width2, height2);
try
{
bitmap.SetResolution(120f, 120f);
Graphics graphics = Graphics.FromImage(bitmap);
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
graphics.DrawImage(image, 0, 0, width2, height2);
graphics.Dispose();
}
catch(Exception ex)
{
}
finally
{
System.GC.Collect();
}
return bitmap;
}
private void MailMerge_MergeImageField(object sender, MergeImageFieldEventArgs args)
{
if(args.FieldName == "UVImage")
{
string source = args.FieldValue.ToString();
args.Image = Image.FromFile(source);
}
}
}
}

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3022DA07-FD06-4AEA-9FC8-00D318E95A82}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BerichtGen</RootNamespace>
<AssemblyName>BerichtGen</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Syncfusion.Compression.Base, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.Compression.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Core">
<HintPath>..\3rdPackage\Syncfusion.Core.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.DocIO.Base, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.DocIO.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.DocToPDFConverter.Base, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.DocToPDFConverter.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.OfficeChart.Base, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.OfficeChart.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Pdf.Base, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.Pdf.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.PdfViewer.Windows, Version=16.1460.0.37, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\Syncfusion.PdfViewer.Windows.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bericht.cs" />
<Compile Include="Options.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Options.Designer.cs">
<DependentUpon>Options.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Options.resx">
<DependentUpon>Options.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SanShared\SanShared.csproj">
<Project>{C949087E-20E1-4A17-B021-FAEAD363C1D8}</Project>
<Name>SanShared</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

133
BerichtGen/Options.Designer.cs generated Normal file
View File

@@ -0,0 +1,133 @@
namespace BerichtGen
{
partial class Options
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btn_start = new System.Windows.Forms.Button();
this.cb_doc = new System.Windows.Forms.CheckBox();
this.cb_pdf = new System.Windows.Forms.CheckBox();
this.rb_yes = new System.Windows.Forms.RadioButton();
this.rb_no = new System.Windows.Forms.RadioButton();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btn_start
//
this.btn_start.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_start.Location = new System.Drawing.Point(374, 12);
this.btn_start.Name = "btn_start";
this.btn_start.Size = new System.Drawing.Size(75, 67);
this.btn_start.TabIndex = 0;
this.btn_start.Text = "button1";
this.btn_start.UseVisualStyleBackColor = true;
this.btn_start.Click += new System.EventHandler(this.btn_start_Click);
//
// cb_doc
//
this.cb_doc.AutoSize = true;
this.cb_doc.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cb_doc.Location = new System.Drawing.Point(6, 12);
this.cb_doc.Name = "cb_doc";
this.cb_doc.Size = new System.Drawing.Size(173, 24);
this.cb_doc.TabIndex = 1;
this.cb_doc.Text = "DOC datei erzeugen";
this.cb_doc.UseVisualStyleBackColor = true;
//
// cb_pdf
//
this.cb_pdf.AutoSize = true;
this.cb_pdf.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cb_pdf.Location = new System.Drawing.Point(6, 35);
this.cb_pdf.Name = "cb_pdf";
this.cb_pdf.Size = new System.Drawing.Size(131, 24);
this.cb_pdf.TabIndex = 2;
this.cb_pdf.Text = "PDF erzeugen";
this.cb_pdf.UseVisualStyleBackColor = true;
//
// rb_yes
//
this.rb_yes.AutoSize = true;
this.rb_yes.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rb_yes.Location = new System.Drawing.Point(221, 62);
this.rb_yes.Name = "rb_yes";
this.rb_yes.Size = new System.Drawing.Size(39, 24);
this.rb_yes.TabIndex = 3;
this.rb_yes.TabStop = true;
this.rb_yes.Text = "ja";
this.rb_yes.UseVisualStyleBackColor = true;
//
// rb_no
//
this.rb_no.AutoSize = true;
this.rb_no.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rb_no.Location = new System.Drawing.Point(266, 62);
this.rb_no.Name = "rb_no";
this.rb_no.Size = new System.Drawing.Size(57, 24);
this.rb_no.TabIndex = 4;
this.rb_no.TabStop = true;
this.rb_no.Text = "nein";
this.rb_no.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(2, 62);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(202, 20);
this.label1.TabIndex = 5;
this.label1.Text = "Nach dem erzeugen öffnen";
//
// Options
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(477, 113);
this.Controls.Add(this.label1);
this.Controls.Add(this.rb_no);
this.Controls.Add(this.rb_yes);
this.Controls.Add(this.cb_pdf);
this.Controls.Add(this.cb_doc);
this.Controls.Add(this.btn_start);
this.Name = "Options";
this.Text = "Options";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btn_start;
private System.Windows.Forms.CheckBox cb_doc;
private System.Windows.Forms.CheckBox cb_pdf;
private System.Windows.Forms.RadioButton rb_yes;
private System.Windows.Forms.RadioButton rb_no;
private System.Windows.Forms.Label label1;
}
}

58
BerichtGen/Options.cs Normal file
View File

@@ -0,0 +1,58 @@
using SanShared;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BerichtGen
{
public partial class Options : Form
{
Thread generateProtokollThread;
Hashtable grundDaten;
string firma;
string vorlage;
string speicherpfad;
List<BilderObject> bilderObjects;
public Options(string firma, string vorlage, string speicherpfad, Hashtable grunddaten, List<BilderObject> bilderObjects)
{
InitializeComponent();
this.firma = firma;
this.vorlage = vorlage;
this.speicherpfad = speicherpfad;
this.grundDaten = grunddaten;
this.bilderObjects = bilderObjects;
}
void Gen()
{
Bericht bericht = new Bericht();
bericht.Erzeuge(firma,vorlage, speicherpfad, grundDaten,bilderObjects);
}
private void btn_start_Click(object sender, EventArgs e)
{
generateProtokollThread = new Thread(Gen);
generateProtokollThread.IsBackground = true;
generateProtokollThread.Start();
while (generateProtokollThread.IsAlive) ;
if(rb_yes.Checked)
{
}
this.Close();
}
}
}

120
BerichtGen/Options.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("BerichtGen")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BerichtGen")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("3022da07-fd06-4aea-9fc8-00d318e95a82")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,4 +1,6 @@
using System;
using SanShared;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@@ -8,7 +10,7 @@ using System.Threading.Tasks;
namespace KlassenBIB
{
public sealed class InlinerSanierung : Sanieren
public sealed class InlinerSanierung : Sanieren, IMakeProtokol
{
double kalibrierUnterdruck = -0.5;
double kalibierWalzenAbstand = 0.9;
@@ -41,6 +43,94 @@ namespace KlassenBIB
return mypath;
}
public Hashtable MakeProtokoll(string destinationPath)
{
Hashtable grunddaten = new Hashtable()
{
{"AG_Vorname","" },
{"KLP_Nummer","" },
{"KLP_Datum","" },
{"AG_Ort","" },
{"AG_Strasse","" },
{"AG_Ansprechpartner","" },
{"BM_Ort","" },
{"BM_Strasse","" },
{"BM_Schacht_von","" },
{"BM_Schacht_bis","" },
{"BM_Haltungsmat","" },
{"BM_Haltung_DN","" },
{"BM_Haltunglaenge","" },
{ "KL_Wetter","" },
{ "Temp_Aussen","" },
{ "KL_Temp_Kanal","" },
{ "KL_Gen_true","" },
{ "KL_Gen_false","" },
{ "KL_WH_true","" },
{ "KL_WH_false", "" },
{ "KL_STVO_true","" },
{ "KL_STVO_false","" },
{ "KL_HD_true","" },
{ "KL_mech_true","" },
{ "KL_rob_true","" },
{ "KL_HD_date","" },
{ "KL_Besatzung", "" },
{"liner_laenge","" },
{"Charge_Liner","" },
{"Charge_Harz","" },
{"harz_bedarf_m","" },
{"gesamt_harz","" },
{"temperatur_harz","" },
{"datum_kalibrierung","" },
{"walzen_abstand","" },
{"vakuum","" },
{"time_start","" },
{"time_ende","" },
{"UVImage","" }
};
grunddaten["AG_Vorname"] = "";
grunddaten["KLP_Nummer"] = "";
grunddaten["KLP_Datum"] = DateTime.Now.ToShortDateString();
grunddaten["AG_Ort"] = "";
grunddaten["AG_Strasse"] = "";
grunddaten["AG_Ansprechpartner"] = "";
grunddaten["BM_Ort"] = Inspektionsobjekt.OrtName;
grunddaten["BM_Strasse"] = Inspektionsobjekt.StrasseName;
grunddaten["BM_Schacht_von"] = Inspektionsobjekt.VonPunkt;
grunddaten["BM_Schacht_bis"] = Inspektionsobjekt.BisPunkt ;
grunddaten["BM_Haltungsmat"] = Inspektionsobjekt.RohrMaterial;
grunddaten["BM_Haltung_DN"] = Inspektionsobjekt.Kanalrohrweite;
grunddaten["BM_Haltunglaenge"] = Inspektionsobjekt.Haltungslaenge;
grunddaten["KL_Wetter"] = this.Wetter;
grunddaten["Temp_Aussen"] = this.TempAusen;
grunddaten["KL_Temp_Kanal"] = this.TempKanal;
grunddaten["KL_Gen_true"] = this.GenehmigungVorhanden ? "X" : "" ;
grunddaten["KL_Gen_false"] = this.GenehmigungVorhanden ? "": "X";
grunddaten["KL_WH_true"] = this.WasserhaltungEingerichtet ? "X" : "";
grunddaten["KL_WH_false"] = this.WasserhaltungEingerichtet ? " ":"X" ;
grunddaten["KL_STVO_true"] = this.STVOAbsicherung ? "X" : "";
grunddaten["KL_STVO_false"] = this.STVOAbsicherung ? "":"X";
grunddaten["KL_HD_true"] = "";
grunddaten["KL_mech_true"] = "";
grunddaten["KL_rob_true"] = "";
grunddaten["KL_HD_date"] = "";
grunddaten["KL_Besatzung"] = "";
grunddaten["liner_laenge"] = "";
grunddaten["Charge_Liner"] = this.LinerChargenummer;
grunddaten["Charge_Harz"] = this.HarzChargenummer;
grunddaten["harz_bedarf_m"] = "";
grunddaten["gesamt_harz"] = "";
grunddaten["temperatur_harz"] = this.HarzKalibrierTemperatur;
grunddaten["datum_kalibrierung"] = this.DatumKalibrierung.ToShortDateString();
grunddaten["walzen_abstand"] = this.KalibierWalzenAbstand;
grunddaten["vakuum"] = this.KalibrierUnterdruck;
grunddaten["time_start"] = "";
grunddaten["time_ende"] = "";
grunddaten["UVImage"] = Path.Combine(destinationPath, "linerGraph.jpg");
return grunddaten;
}
public InlinerSanierung()
{
//datumKalibrierung = new DateTime();

View File

@@ -55,5 +55,11 @@
<Compile Include="SavedBilder.cs" />
<Compile Include="SchachtAnbindung.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SanShared\SanShared.csproj">
<Project>{C949087E-20E1-4A17-B021-FAEAD363C1D8}</Project>
<Name>SanShared</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

15
SanShared/BilderObject.cs Normal file
View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SanShared
{
public class BilderObject
{
public string Kommentar { get; set; }
public string Path { get; set; }
public int ImgID { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SanShared
{
public interface IMakeProtokol
{
Hashtable MakeProtokoll(string destinationPath);
}
}

View File

@@ -40,8 +40,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BilderObject.cs" />
<Compile Include="Exceptions\LangNotFoundException.cs" />
<Compile Include="ILanguage.cs" />
<Compile Include="IMakeProtokol.cs" />
<Compile Include="ITemperature.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

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
{
@@ -47,13 +48,20 @@ namespace SanSystem
}
}
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"));
@@ -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();
}

View File

@@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SanShared", "SanShared\SanS
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Language", "Language\Language.csproj", "{BE364E88-92DA-4A6C-97E7-DDD7D887B3D4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BerichtGen", "BerichtGen\BerichtGen.csproj", "{3022DA07-FD06-4AEA-9FC8-00D318E95A82}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -65,6 +67,10 @@ Global
{BE364E88-92DA-4A6C-97E7-DDD7D887B3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE364E88-92DA-4A6C-97E7-DDD7D887B3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE364E88-92DA-4A6C-97E7-DDD7D887B3D4}.Release|Any CPU.Build.0 = Release|Any CPU
{3022DA07-FD06-4AEA-9FC8-00D318E95A82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3022DA07-FD06-4AEA-9FC8-00D318E95A82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3022DA07-FD06-4AEA-9FC8-00D318E95A82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3022DA07-FD06-4AEA-9FC8-00D318E95A82}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE