From 5588e4567a19ae50347a193251f418b7bebdeeb8 Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Wed, 13 Apr 2022 09:05:29 +0200 Subject: [PATCH] Datagen moved out --- DataGen/DataGen.csproj | 13 - DataGen/MeasureDataGen.cs | 355 ------------------ .../netstandard2.0/DataGen.AssemblyInfo.cs | 23 ++ .../DataGen.AssemblyInfoInputs.cache | 1 + ....GeneratedMSBuildEditorConfig.editorconfig | 3 + 5 files changed, 27 insertions(+), 368 deletions(-) delete mode 100644 DataGen/DataGen.csproj delete mode 100644 DataGen/MeasureDataGen.cs create mode 100644 obj/Debug/netstandard2.0/DataGen.AssemblyInfo.cs create mode 100644 obj/Debug/netstandard2.0/DataGen.AssemblyInfoInputs.cache create mode 100644 obj/Debug/netstandard2.0/DataGen.GeneratedMSBuildEditorConfig.editorconfig diff --git a/DataGen/DataGen.csproj b/DataGen/DataGen.csproj deleted file mode 100644 index 2d6a842..0000000 --- a/DataGen/DataGen.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - netstandard2.0 - - - diff --git a/DataGen/MeasureDataGen.cs b/DataGen/MeasureDataGen.cs deleted file mode 100644 index e84ded2..0000000 --- a/DataGen/MeasureDataGen.cs +++ /dev/null @@ -1,355 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Linq; -using System.Threading.Tasks; -using DPGetDataContract; -using Models; - -namespace DataGen -{ - public class MeasureDataGen : IDPGetDataContract - { - List messureList = new List(); - public List ReadMessureList { get => messureList;} - - - /* - public void GenerateÜberdruck(DateTime startprüfung, double prüfdruck, bool failure=false) { - List messreihen = new List(); - string prüfdatum = startprüfung.ToShortDateString(); - bool Bestanden = !failure; - - List druckwerte = new List(); - double druck = 0.0; - bool druckerreicht = false; - int messreiheID = 0; - // Anstiegskurve erzeugen - DateTime start = startprüfung; - - #region Befüllphase - while (!druckerreicht) - { - start = start.AddSeconds(4); - if (failure && druck >= 56) - break; - if (!failure &&(druck > (prüfdruck * 1.1))) - druckerreicht = true; - Random zufall = new Random(DateTime.Now.Millisecond); - if(!druckerreicht) - { - druck += Convert.ToDouble((zufall.Next(1000, 10000) / 1000.0)); - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Datum = start, - EintragID = messreiheID, - Pressure = druck.ToString(), - MeasureType = EMeasureType.BEFÜLLPHASE - }); - messreiheID++; - } - Thread.Sleep(100); - } - #endregion - #region Beruhigungsphase - if (!failure) - { - Random druckabfall = new Random(DateTime.Now.Millisecond); - double dp = druckabfall.Next(2, 9) + druckabfall.NextDouble(); - //double startdruck = druckwerte.Last() - dp; - //startdruck += druckabfall.NextDouble(); - double dpt = dp / 90.0; - for (int i = 0; i <= 90; i++) - { - start = start.AddSeconds(2); - druck -= dpt; - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Pressure = druck.ToString(), - MeasureType = EMeasureType.BERUHUNGSZEIT, - Datum = start, - EintragID = messreiheID - }); - messreiheID++; - } - } - else - { - int anzahlschritte = 20; - double druckabfall = druck / anzahlschritte; - for(int i = 0; i <= anzahlschritte; i++) - { - start = start.AddSeconds(2); - druck -= druckabfall; - if (druck < 0) druck = 0; - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Pressure = druck.ToString(), - MeasureType = EMeasureType.BERUHUNGSZEIT, - Datum = start, - EintragID = messreiheID - }); - messreiheID++; - } - } - #endregion - #region Prüfungsphase - if (!failure) - { - for (int i = 0; i < 90; i++) - { - Random Prüfung = new Random(DateTime.Now.Millisecond); - double abfall = Prüfung.NextDouble() / 10; - start = start.AddSeconds(2); - if (abfall <= 0.07 && (i % 2 == 0)) - { - druck -= abfall; - - } - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Datum = start, - EintragID = messreiheID, - MeasureType = EMeasureType.PRÜFUNGSPHASE, - Pressure = druck.ToString() - }); - messreiheID++; - Thread.Sleep(100); - } - } - #endregion - #region EndePrüfung - start = start.AddSeconds(2); - messreiheID++; - messreihen.Add(new MeasureData() - { - Datum = start, - EintragID = messreiheID, - MeasureType = EMeasureType.ENDEPRÜFUNGMARKER, - Pressure = druck.ToString() - }) ; - - start = start.AddSeconds(4); - - messreihen.Add(new MeasureData() - { - Pressure = druckwerte.Last().ToString(), - Datum = start, - MeasureType = EMeasureType.ENDEPRÜFUNGMARKER, - EintragID = messreiheID - }) ; - - while(druck > 10) - { - start = start.AddSeconds(2); - double abbau = druck / 2; - druck -= abbau; - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Datum = start, - Pressure = druck.ToString(), - EintragID = messreiheID, - MeasureType = EMeasureType.LEERPHASE - }); - messreiheID++; - } - messreihen.Add(new MeasureData() - { - Datum = start.AddSeconds(2), - Pressure = "0,0", - EintragID = messreiheID, - MeasureType = EMeasureType.LEERPHASE - }); - messreihen.Add(new MeasureData() - { - Datum = start.AddSeconds(4), - Pressure = "0,0", - EintragID = messreiheID+1, - MeasureType = EMeasureType.ENDEPRÜFUNGMARKER - }); - - #endregion - - messureList = messreihen; - } - */ - /// - /// Generiert unterdruck reihen - /// - /// - /// - /// Länge der Prüfung in Sekunden - /// - public void GenerateUnterdruck(DateTime startprüfung, double prüfdruck, int testduration , bool failure = false) - { - List messreihen = new List(); - string prüfdatum = startprüfung.ToShortDateString(); - bool Bestanden = !failure; - - List druckwerte = new List(); - double druck = 0.0; - bool druckerreicht = false; - int messreiheID = 0; - // Anstiegskurve erzeugen - DateTime start = startprüfung; - - #region Befüllphase - while (!druckerreicht) - { - start = start.AddSeconds(4); - if (failure && druck >= 56) - break; - if (!failure && (druck > ((prüfdruck * -1) * 1.1))) - druckerreicht = true; - Random zufall = new Random(DateTime.Now.Millisecond); - if (!druckerreicht) - { - druck += Convert.ToDouble((zufall.Next(1000, 10000) / 1000.0)); - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Datum = start, - EintragID = messreiheID, - Pressure = (druck * -1).ToString(), - MeasureType = EMeasureType.BEFÜLLPHASE - }); - messreiheID++; - } - Thread.Sleep(100); - } - #endregion - #region Beruhigungsphase - if (!failure) - { - Random druckabfall = new Random(DateTime.Now.Millisecond); - double dp = druckabfall.Next(2, 9) + druckabfall.NextDouble(); - //double startdruck = druckwerte.Last() - dp; - //startdruck += druckabfall.NextDouble(); - double dpt = dp / 90.0; - for (int i = 0; i <= 90; i++) - { - start = start.AddSeconds(2); - druck -= dpt; - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Pressure = (druck * -1).ToString(), - MeasureType = EMeasureType.BERUHUNGSZEIT, - Datum = start, - EintragID = messreiheID - }); - messreiheID++; - } - } - else - { - int anzahlschritte = 20; - double druckabfall = druck / anzahlschritte; - for (int i = 0; i <= anzahlschritte; i++) - { - start = start.AddSeconds(2); - druck -= druckabfall; - if (druck < 0) druck = 0; - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Pressure = druck.ToString(), - MeasureType = EMeasureType.BERUHUNGSZEIT, - Datum = start, - EintragID = messreiheID - }); - messreiheID++; - } - } - #endregion - #region Prüfungsphase - if (!failure) - { - for (int i = 0; i < (testduration / 2); i++) - { - Random Prüfung = new Random(DateTime.Now.Millisecond); - double abfall = Prüfung.NextDouble() / 10; - start = start.AddSeconds(2); - if (abfall <= 0.07 && (i % 2 == 0)) - { - druck -= abfall; - - } - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Datum = start, - EintragID = messreiheID, - MeasureType = EMeasureType.PRÜFUNGSPHASE, - Pressure = (druck * -1).ToString() - }); - messreiheID++; - Thread.Sleep(100); - } - } - #endregion - #region EndePrüfung - start = start.AddSeconds(2); - messreiheID++; - messreihen.Add(new MeasureData() - { - Datum = start, - EintragID = messreiheID, - MeasureType = EMeasureType.ENDE, - Pressure = (druck * -1).ToString() - }); - - start = start.AddSeconds(4); - - messreihen.Add(new MeasureData() - { - Pressure = (druckwerte.Last() * -1).ToString(), - Datum = start, - MeasureType = EMeasureType.ENDE, - EintragID = messreiheID - }); - - while (druck > 10) - { - start = start.AddSeconds(2); - double abbau = druck / 2; - druck -= abbau; - druckwerte.Add(druck); - messreihen.Add(new MeasureData() - { - Datum = start, - Pressure = (druck * -1).ToString(), - EintragID = messreiheID, - MeasureType = EMeasureType.ABLUFT - }); - messreiheID++; - } - messreihen.Add(new MeasureData() - { - Datum = start.AddSeconds(2), - Pressure = "0,0", - EintragID = messreiheID, - MeasureType = EMeasureType.ABLUFT - }); - messreihen.Add(new MeasureData() - { - Datum = start.AddSeconds(4), - Pressure = "0,0", - EintragID = messreiheID + 1, - MeasureType = EMeasureType.ENDE - }); - - #endregion - - messureList = messreihen; - } - - - - } -} diff --git a/obj/Debug/netstandard2.0/DataGen.AssemblyInfo.cs b/obj/Debug/netstandard2.0/DataGen.AssemblyInfo.cs new file mode 100644 index 0000000..5c0ca15 --- /dev/null +++ b/obj/Debug/netstandard2.0/DataGen.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("DataGen")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("DataGen")] +[assembly: System.Reflection.AssemblyTitleAttribute("DataGen")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/obj/Debug/netstandard2.0/DataGen.AssemblyInfoInputs.cache b/obj/Debug/netstandard2.0/DataGen.AssemblyInfoInputs.cache new file mode 100644 index 0000000..5fa4deb --- /dev/null +++ b/obj/Debug/netstandard2.0/DataGen.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +9113d0cf00bae8fabc242e3d8175fb5a59bf4d1d diff --git a/obj/Debug/netstandard2.0/DataGen.GeneratedMSBuildEditorConfig.editorconfig b/obj/Debug/netstandard2.0/DataGen.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..0ba3e29 --- /dev/null +++ b/obj/Debug/netstandard2.0/DataGen.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,3 @@ +is_global = true +build_property.RootNamespace = DataGen +build_property.ProjectDir = C:\Users\KFZ\Desktop\source\Dichtheitsprüfung_\DataGen\