-a
This commit is contained in:
@@ -14,104 +14,7 @@ namespace DataGen
|
|||||||
public List<MeasureData> ReadMessureList { get => messureList;}
|
public List<MeasureData> ReadMessureList { get => messureList;}
|
||||||
|
|
||||||
|
|
||||||
public void GenerateUnterdruck(DateTime startprüfung, double prüfdruck, bool failure=false) {
|
/*
|
||||||
|
|
||||||
int messreiheID = -1;
|
|
||||||
List<MeasureData> messreihen = new List<MeasureData>();
|
|
||||||
List<double> druckwerte = new List<double>();
|
|
||||||
double druck = 0.0;
|
|
||||||
bool druckerreicht = false;
|
|
||||||
DateTime start = startprüfung;
|
|
||||||
|
|
||||||
prüfdruck = ((prüfdruck - (new Random(DateTime.Now.Millisecond).NextDouble() * 115.8)));
|
|
||||||
#region Anstiegskurve
|
|
||||||
while (!druckerreicht)
|
|
||||||
{
|
|
||||||
start = start.AddSeconds(2);
|
|
||||||
messreiheID++;
|
|
||||||
if (druck <= prüfdruck)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Random zufall = new Random(DateTime.Now.Millisecond);
|
|
||||||
druck -= Convert.ToDouble((zufall.Next(1000, 10000) / 1000.0));
|
|
||||||
druckwerte.Add(druck);
|
|
||||||
messreihen.Add(new MeasureData()
|
|
||||||
{
|
|
||||||
Datum = start,
|
|
||||||
Pressure = druck.ToString(),
|
|
||||||
EintragID = messreiheID,
|
|
||||||
MeasureType = EMeasureType.LEERPHASE
|
|
||||||
});
|
|
||||||
|
|
||||||
Thread.Sleep(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
messreihen.Add(new MeasureData()
|
|
||||||
{
|
|
||||||
Datum = start,
|
|
||||||
Pressure = druck.ToString(),
|
|
||||||
EintragID = messreiheID,
|
|
||||||
MeasureType = EMeasureType.BEFÜLLPHASE
|
|
||||||
});
|
|
||||||
start = start.AddMinutes(2);
|
|
||||||
messreiheID++;
|
|
||||||
messreihen.Add(new MeasureData()
|
|
||||||
{
|
|
||||||
Datum = start,
|
|
||||||
Pressure = druck.ToString(),
|
|
||||||
EintragID = messreiheID,
|
|
||||||
MeasureType = EMeasureType.PRÜFUNGSPHASE
|
|
||||||
});
|
|
||||||
start = start.AddMinutes(15);
|
|
||||||
start = start.AddSeconds(3);
|
|
||||||
messreiheID++;
|
|
||||||
messreihen.Add(new MeasureData()
|
|
||||||
{
|
|
||||||
Datum = start,
|
|
||||||
Pressure = druck.ToString(),
|
|
||||||
EintragID = messreiheID,
|
|
||||||
MeasureType = EMeasureType.PRÜFUNGSPHASE
|
|
||||||
});
|
|
||||||
start = start.AddSeconds(2);
|
|
||||||
messreiheID++;
|
|
||||||
messreihen.Add(new MeasureData()
|
|
||||||
{
|
|
||||||
Datum = start,
|
|
||||||
Pressure = druck.ToString(),
|
|
||||||
EintragID = messreiheID,
|
|
||||||
MeasureType = EMeasureType.BEFÜLLPHASE
|
|
||||||
});
|
|
||||||
start = start.AddSeconds(2);
|
|
||||||
messreiheID++;
|
|
||||||
messreihen.Add(new MeasureData()
|
|
||||||
{
|
|
||||||
Datum = start,
|
|
||||||
Pressure = druck.ToString(),
|
|
||||||
EintragID = messreiheID,
|
|
||||||
MeasureType = EMeasureType.LEERPHASE
|
|
||||||
});
|
|
||||||
start = start.AddSeconds(2);
|
|
||||||
messreiheID++;
|
|
||||||
messreihen.Add(new MeasureData()
|
|
||||||
{
|
|
||||||
Datum = start,
|
|
||||||
Pressure = "0,000",
|
|
||||||
EintragID = messreiheID,
|
|
||||||
MeasureType = EMeasureType.LEERPHASE
|
|
||||||
}) ;
|
|
||||||
start = start.AddSeconds(1);
|
|
||||||
messreiheID++;
|
|
||||||
messreihen.Add(new MeasureData()
|
|
||||||
{
|
|
||||||
Datum = start,
|
|
||||||
Pressure = "0,000",
|
|
||||||
EintragID = messreiheID,
|
|
||||||
MeasureType = EMeasureType.LEERPHASE
|
|
||||||
});
|
|
||||||
messureList = messreihen;
|
|
||||||
}
|
|
||||||
public void GenerateÜberdruck(DateTime startprüfung, double prüfdruck, bool failure=false) {
|
public void GenerateÜberdruck(DateTime startprüfung, double prüfdruck, bool failure=false) {
|
||||||
List<MeasureData> messreihen = new List<MeasureData>();
|
List<MeasureData> messreihen = new List<MeasureData>();
|
||||||
string prüfdatum = startprüfung.ToShortDateString();
|
string prüfdatum = startprüfung.ToShortDateString();
|
||||||
@@ -274,8 +177,179 @@ namespace DataGen
|
|||||||
|
|
||||||
messureList = messreihen;
|
messureList = messreihen;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
/// <summary>
|
||||||
|
/// Generiert unterdruck reihen
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="startprüfung"></param>
|
||||||
|
/// <param name="prüfdruck"></param>
|
||||||
|
/// <param name="testduration">Länge der Prüfung in Sekunden</param>
|
||||||
|
/// <param name="failure"></param>
|
||||||
|
public void GenerateUnterdruck(DateTime startprüfung, double prüfdruck, int testduration , bool failure = false)
|
||||||
|
{
|
||||||
|
List<MeasureData> messreihen = new List<MeasureData>();
|
||||||
|
string prüfdatum = startprüfung.ToShortDateString();
|
||||||
|
bool Bestanden = !failure;
|
||||||
|
|
||||||
|
List<double> druckwerte = new List<double>();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Models {
|
namespace Models {
|
||||||
|
[Serializable]
|
||||||
public class Auftraggeber {
|
public class Auftraggeber {
|
||||||
public int Id {get;set;}
|
public int Id {get;set;}
|
||||||
public string Name {get;set;}
|
public string Name {get;set;}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Models {
|
namespace Models {
|
||||||
|
[Serializable]
|
||||||
public class Bauvorhaben {
|
public class Bauvorhaben {
|
||||||
public Auftraggeber Auftraggeber { get; set; }
|
public Auftraggeber Auftraggeber { get; set; }
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
public enum EMeasureType {
|
public enum EMeasureType {
|
||||||
LEERPHASE = 0, // 004
|
BEFÜLLPHASE = 0, // 000
|
||||||
BEFÜLLPHASE = 1, // 000
|
BERUHUNGSZEIT = 1, // 001
|
||||||
BERUHUNGSZEIT = 2, // 001
|
PRÜFUNGSPHASE = 2, // 002
|
||||||
PRÜFUNGSPHASE = 3, // 002
|
ENDE = 3, // 003
|
||||||
ENDEPRÜFUNGMARKER = 4 // 003
|
ABLUFT = 4,
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
|
[Serializable]
|
||||||
public class Inspektionsobjekt
|
public class Inspektionsobjekt
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
|
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
|
[Serializable]
|
||||||
public class MeasureData {
|
public class MeasureData {
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public int EintragID {get;set;}
|
public int EintragID {get;set;}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Models {
|
namespace Models {
|
||||||
|
[Serializable]
|
||||||
public class PressureTest {
|
public class PressureTest {
|
||||||
|
|
||||||
bool bestanden;
|
bool bestanden;
|
||||||
|
|||||||
@@ -5,6 +5,12 @@
|
|||||||
<ProjectReference Include="..\Models\Models.csproj" />
|
<ProjectReference Include="..\Models\Models.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="vorlage.txt">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -78,16 +78,16 @@ namespace ProtokollWriter {
|
|||||||
hashtable["AUFTRAGGEBER_NAME"] = inspObjekt.Bauvorhaben.Auftraggeber.Name;
|
hashtable["AUFTRAGGEBER_NAME"] = inspObjekt.Bauvorhaben.Auftraggeber.Name;
|
||||||
hashtable["AUFTRAGGEBER_STRASSE"] = inspObjekt.Bauvorhaben.Auftraggeber.Strasse;
|
hashtable["AUFTRAGGEBER_STRASSE"] = inspObjekt.Bauvorhaben.Auftraggeber.Strasse;
|
||||||
hashtable["AUFTRAGGEBER_ORT"] = inspObjekt.Bauvorhaben.Auftraggeber.Ort;
|
hashtable["AUFTRAGGEBER_ORT"] = inspObjekt.Bauvorhaben.Auftraggeber.Ort;
|
||||||
hashtable["AUFTRAGGEBER_TEL"] = inspObjekt.Bauvorhaben.Auftraggeber.Tel;
|
hashtable["AUFTRAGGEBER_TEL"] = inspObjekt.Bauvorhaben.Auftraggeber.Tel != null ? inspObjekt.Bauvorhaben.Auftraggeber.Tel: "";
|
||||||
hashtable["VONSCHACHT"] = inspObjekt.ObereSchacht;
|
hashtable["VONSCHACHT"] = inspObjekt.ObereSchacht != null? inspObjekt.ObereSchacht: "";
|
||||||
hashtable["BISSCHACHT"] = inspObjekt.UntereSchacht;
|
hashtable["BISSCHACHT"] = inspObjekt.UntereSchacht != null? inspObjekt.UntereSchacht: "";
|
||||||
hashtable["PROJEKTNR"] = "000";//Projektnummer;
|
hashtable["PROJEKTNR"] = "000";//Projektnummer;
|
||||||
hashtable["HALTUNGNR"] = inspObjekt.Objektname != null ? inspObjekt.Objektname : inspObjekt.ObereSchacht;
|
hashtable["HALTUNGNR"] = inspObjekt.Objektname != null ? inspObjekt.Objektname : inspObjekt.ObereSchacht;
|
||||||
hashtable["MESSDATEI"] = inspObjekt.Objektname != null ? inspObjekt.Objektname : inspObjekt.ObereSchacht;
|
hashtable["MESSDATEI"] = inspObjekt.Objektname != null ? inspObjekt.Objektname : inspObjekt.ObereSchacht;
|
||||||
hashtable["BAUVORHABEN_STRASSE"] = inspObjekt.Bauvorhaben.Strasse;
|
hashtable["BAUVORHABEN_STRASSE"] = inspObjekt.Bauvorhaben.Strasse;
|
||||||
hashtable["BAUVORHABEN_ORT"] = inspObjekt.Bauvorhaben.Ort;
|
hashtable["BAUVORHABEN_ORT"] = inspObjekt.Bauvorhaben.Ort;
|
||||||
hashtable["BAUVORHABEN_STANDORT"] = inspObjekt.Bauvorhaben.Strasse;
|
hashtable["BAUVORHABEN_STANDORT"] = inspObjekt.Bauvorhaben.Strasse;
|
||||||
hashtable["BEMERKUNG"] = inspObjekt.Bemerkung;
|
hashtable["BEMERKUNG"] = inspObjekt.Bemerkung != null? inspObjekt.Bemerkung : "";
|
||||||
hashtable["PRUEFRESULTAT"] = "Cool";//inspObjekt.PressureTests[prüfungsnummer].Bestanden ? "Prüfung Bestanden" : "Prüfung N I C H T Bestanden";
|
hashtable["PRUEFRESULTAT"] = "Cool";//inspObjekt.PressureTests[prüfungsnummer].Bestanden ? "Prüfung Bestanden" : "Prüfung N I C H T Bestanden";
|
||||||
}
|
}
|
||||||
void WriteFile() {
|
void WriteFile() {
|
||||||
@@ -99,7 +99,7 @@ namespace ProtokollWriter {
|
|||||||
int ende = zeile.IndexOf("}");
|
int ende = zeile.IndexOf("}");
|
||||||
string cmd = zeile.Substring(start+1,(ende-start) -1);
|
string cmd = zeile.Substring(start+1,(ende-start) -1);
|
||||||
|
|
||||||
if(hashtable.ContainsKey(cmd)) {
|
if(cmd != null && hashtable.ContainsKey(cmd)) {
|
||||||
string rep = "{"+cmd+"}";
|
string rep = "{"+cmd+"}";
|
||||||
string n = zeile.Replace(rep,hashtable[cmd].ToString());
|
string n = zeile.Replace(rep,hashtable[cmd].ToString());
|
||||||
zeile = n;
|
zeile = n;
|
||||||
@@ -107,9 +107,9 @@ namespace ProtokollWriter {
|
|||||||
if(cmd.StartsWith("@")) {
|
if(cmd.StartsWith("@")) {
|
||||||
string n = "";
|
string n = "";
|
||||||
|
|
||||||
//foreach(MeasureData data in inspObjekt.PressureTests[prüfungsnummer].Measuredatas) {
|
foreach(MeasureData data in inspObjekt.pressureTests[prüfungsnummer].Measuredatas) {
|
||||||
// n = string.Format("{0}{1} = {2};{3};{4};{5}\r\n",n,data.EintragID,data.EintragID+2,data.Datum,data.Pressure,data.MeasureType);
|
n = string.Format("{0}{1} = {2};{3};{4};{5}\r\n",n,data.EintragID,data.EintragID+2,data.Datum,data.Pressure,(int)data.MeasureType);
|
||||||
//}
|
}
|
||||||
zeile = n;
|
zeile = n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user