diff --git a/CSVParser/BlueLight.cs b/CSVParser/BlueLight.cs new file mode 100644 index 0000000..a30abf7 --- /dev/null +++ b/CSVParser/BlueLight.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SanShared; + +namespace CSVParser +{ + public class BlueLight : CSVParser + { + public BlueLight(string csvFile) : base(csvFile) + { + } + + public override List ReadCSVStrukture() + { + return null; + } + } +} diff --git a/CSVParser/CSVParser.cs b/CSVParser/CSVParser.cs new file mode 100644 index 0000000..2810e9d --- /dev/null +++ b/CSVParser/CSVParser.cs @@ -0,0 +1,28 @@ +using SanShared; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSVParser +{ + public abstract class CSVParser : IReadCSVData + { + private string csvFile; + public CSVParser(string csvFile) + { + this.csvFile = csvFile; + } + public virtual string[] Input + { + get + { + if (!File.Exists(csvFile)) return null; + return File.ReadAllLines(csvFile); + } + } + public abstract List ReadCSVStrukture(); + } +} diff --git a/CSVParser/CSVParser.csproj b/CSVParser/CSVParser.csproj new file mode 100644 index 0000000..3461f5b --- /dev/null +++ b/CSVParser/CSVParser.csproj @@ -0,0 +1,56 @@ + + + + + Debug + AnyCPU + {3F79BD28-9BF6-4902-8977-41E9E71F8488} + Library + Properties + CSVParser + CSVParser + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + {C949087E-20E1-4A17-B021-FAEAD363C1D8} + SanShared + + + + \ No newline at end of file diff --git a/CSVParser/Properties/AssemblyInfo.cs b/CSVParser/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8a77248 --- /dev/null +++ b/CSVParser/Properties/AssemblyInfo.cs @@ -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("CSVParser")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CSVParser")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[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("3f79bd28-9bf6-4902-8977-41e9e71f8488")] + +// 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")] diff --git a/CSVParser/UVRelining.cs b/CSVParser/UVRelining.cs new file mode 100644 index 0000000..9a570a1 --- /dev/null +++ b/CSVParser/UVRelining.cs @@ -0,0 +1,56 @@ +using SanShared; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSVParser +{ + public class UVRelining : CSVParser + { + public UVRelining(string csvFile) : base(csvFile) + { + } + /// + /// + /// + /// + /// + public override List ReadCSVStrukture() + { + /* + * Die Geschwindigkeit wird in cm / sekunde angegeben + */ + List result = new List(); + + DateTime zeit; + double temperatur; + double druck; + int geschwindigkeit; + foreach (string pars in Input) + { + UVcsvStrukture uVcsvStrukture = new UVcsvStrukture(); + string[] parts = pars.Split(','); + if ( + parts[0].Equals("Group1") || + parts[1].Equals("(END)") || + parts[1].Equals("(START)") + ) continue; + DateTime.TryParse(parts[0], out zeit); + double.TryParse(parts[1].Replace('.', ','), out temperatur); + double.TryParse(parts[2].Replace('.', ','), out druck); + int.TryParse(parts[3], out geschwindigkeit); + + + uVcsvStrukture.Zeitstempel = zeit; + uVcsvStrukture.Druck = druck; + uVcsvStrukture.Temperatur = temperatur; + uVcsvStrukture.Geschwindigkeit = geschwindigkeit; + result.Add(uVcsvStrukture); + } + return result; + } + } +} diff --git a/SanShared/IReadCSVData.cs b/SanShared/IReadCSVData.cs new file mode 100644 index 0000000..9ab14e4 --- /dev/null +++ b/SanShared/IReadCSVData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SanShared +{ + /// + /// + /// + public interface IReadCSVData + { + /// + /// + /// + /// + List ReadCSVStrukture(); + /// + /// + /// + string[] Input { get; } + } +} diff --git a/SanShared/SanShared.csproj b/SanShared/SanShared.csproj index d7dc0b8..a33d425 100644 --- a/SanShared/SanShared.csproj +++ b/SanShared/SanShared.csproj @@ -48,6 +48,7 @@ + diff --git a/SanShared/UVcsvStrukture.cs b/SanShared/UVcsvStrukture.cs index 5b65081..3bb150d 100644 --- a/SanShared/UVcsvStrukture.cs +++ b/SanShared/UVcsvStrukture.cs @@ -30,6 +30,6 @@ namespace SanShared /// /// Geschwindigkeit vom Eintrag /// - public double Geschwindigkeit { get => geschwindigkeit; set => geschwindigkeit = value; } + public int Geschwindigkeit { get => geschwindigkeit; set => geschwindigkeit = value; } } } diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj index eafa6a1..c865a03 100644 --- a/SanSystem/SanSystem.csproj +++ b/SanSystem/SanSystem.csproj @@ -300,4 +300,12 @@ + + + + + + + + \ No newline at end of file diff --git a/SanVerwaltung.sln b/SanVerwaltung.sln index 5cfbb31..474446c 100644 --- a/SanVerwaltung.sln +++ b/SanVerwaltung.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2026 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.156 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SanSystem", "SanSystem\SanSystem.csproj", "{C6546A88-8830-4EF2-B99C-B9183171F6EF}" EndProject @@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BerichtGen", "BerichtGen\Be EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchnittstelleImporterTests", "SchnittstelleImporterTests\SchnittstelleImporterTests.csproj", "{9264791A-9D57-4133-BE47-75721057DBBB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSVParser", "CSVParser\CSVParser.csproj", "{3F79BD28-9BF6-4902-8977-41E9E71F8488}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -77,6 +79,10 @@ Global {9264791A-9D57-4133-BE47-75721057DBBB}.Debug|Any CPU.Build.0 = Debug|Any CPU {9264791A-9D57-4133-BE47-75721057DBBB}.Release|Any CPU.ActiveCfg = Release|Any CPU {9264791A-9D57-4133-BE47-75721057DBBB}.Release|Any CPU.Build.0 = Release|Any CPU + {3F79BD28-9BF6-4902-8977-41E9E71F8488}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F79BD28-9BF6-4902-8977-41E9E71F8488}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F79BD28-9BF6-4902-8977-41E9E71F8488}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F79BD28-9BF6-4902-8977-41E9E71F8488}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE