Umgestellt aufs neue CSV Parser system.
Unterschiedliche Net Framework versionen behoben
This commit is contained in:
@@ -9,9 +9,10 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CSVParser</RootNamespace>
|
||||
<AssemblyName>CSVParser</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
using SanShared;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SanSystem
|
||||
{
|
||||
static class HelpFunktion
|
||||
{
|
||||
public static List<UVcsvStrukture> ParseCSVFile(string csvFile)
|
||||
{
|
||||
/*
|
||||
Die geschwindigkeit wird im cm pro sekunde angegeben
|
||||
*/
|
||||
List<UVcsvStrukture> result = new List<UVcsvStrukture>();
|
||||
|
||||
if (!File.Exists(csvFile)) return null;
|
||||
string[] input = File.ReadAllLines(csvFile);
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,6 @@
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Global.cs" />
|
||||
<Compile Include="HelpFunktion.cs" />
|
||||
<Compile Include="MassenStatistik.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@@ -274,6 +273,10 @@
|
||||
<Project>{3022da07-fd06-4aea-9fc8-00d318e95a82}</Project>
|
||||
<Name>BerichtGen</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\CSVParser\CSVParser.csproj">
|
||||
<Project>{3f79bd28-9bf6-4902-8977-41e9e71f8488}</Project>
|
||||
<Name>CSVParser</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Database\Database.csproj">
|
||||
<Project>{b0227727-6cf9-4e2e-9afe-5dd76deaa9db}</Project>
|
||||
<Name>Database</Name>
|
||||
|
||||
@@ -14,6 +14,7 @@ using SanShared;
|
||||
using FluentFTP;
|
||||
using System.Collections;
|
||||
using Syncfusion.Windows.Forms.Chart;
|
||||
using CSVParser;
|
||||
|
||||
namespace SanSystem
|
||||
{
|
||||
@@ -285,7 +286,9 @@ namespace SanSystem
|
||||
|
||||
IEnumerable<string> files = Directory.EnumerateFiles(myPath, "*.csv", SearchOption.AllDirectories);
|
||||
|
||||
List<UVcsvStrukture> struktures = HelpFunktion.ParseCSVFile(files.Last());
|
||||
//List<UVcsvStrukture> struktures = HelpFunktion.ParseCSVFile(files.Last());
|
||||
UVRelining uv = new UVRelining(files.Last());
|
||||
List<UVcsvStrukture> struktures = uv.ReadCSVStrukture();
|
||||
|
||||
inliner.AnfangAushaertung = struktures.Select(x => x.Zeitstempel).Min();
|
||||
inliner.EndeAushaertung = struktures.Select(x => x.Zeitstempel).Max();
|
||||
|
||||
Reference in New Issue
Block a user