Es können jetzt von xml 2006 importiert werden
This commit is contained in:
97
SchnittstelleImporter/Import.cs
Normal file
97
SchnittstelleImporter/Import.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using KlassenBIB;
|
||||
using SchnittstelleImporter.XML2006;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SchnittstelleImporter
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class Import : IImportedObjekte
|
||||
{
|
||||
string xmlFile;
|
||||
string projektnummer;
|
||||
/// <summary>
|
||||
/// Angabe zur XML datei
|
||||
/// </summary>
|
||||
public string XMLFile
|
||||
{
|
||||
get
|
||||
{
|
||||
return xmlFile;
|
||||
}
|
||||
set
|
||||
{
|
||||
xmlFile = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Angabe zur Projektnummer
|
||||
/// </summary>
|
||||
public string Projektnummer
|
||||
{
|
||||
get
|
||||
{
|
||||
return projektnummer;
|
||||
}
|
||||
set
|
||||
{
|
||||
projektnummer = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<Inspektionsobjekt> GetInspektionsobjekte()
|
||||
{
|
||||
List<Inspektionsobjekt> result = new List<Inspektionsobjekt>();
|
||||
List<InspizierteAbwassertechnischeAnlage> anlagen = XMLParser.GetList(XMLFile);
|
||||
foreach(InspizierteAbwassertechnischeAnlage src in anlagen)
|
||||
{
|
||||
Inspektionsobjekt inspektionsobjekt = new Inspektionsobjekt();
|
||||
InspektionskuerzelnCollection inspektionskuerzelns = new InspektionskuerzelnCollection();
|
||||
|
||||
inspektionsobjekt.Projektnummer = projektnummer;
|
||||
inspektionsobjekt.Objektbezeichnung = src.Objektbezeichnung;
|
||||
inspektionsobjekt.OrtName = src.Lage.Ortname!= null? src.Lage.Ortname : "";
|
||||
inspektionsobjekt.StrasseName = src.Lage.Strassename != null ? src.Lage.Strassename : "noname";
|
||||
inspektionsobjekt.RohrMaterial = src.OptischeInspektion.Rohrleitung.Grunddaten.Material != null ? src.OptischeInspektion.Rohrleitung.Grunddaten.Material : "Unbekannt";
|
||||
inspektionsobjekt.Kanalrohrweite = src.OptischeInspektion.Rohrleitung.Grunddaten.Profilhoehe != 0 ? (uint)src.OptischeInspektion.Rohrleitung.Grunddaten.Profilhoehe : (uint)src.OptischeInspektion.Rohrleitung.Grunddaten.Profilbreite;
|
||||
inspektionsobjekt.Haltungslaenge = Convert.ToDouble(src.OptischeInspektion.Rohrleitung.Inspektionslaenge);
|
||||
inspektionsobjekt.VonPunkt = src.OptischeInspektion.Rohrleitung.Grunddaten.KnotenZulauf;
|
||||
inspektionsobjekt.BisPunkt = src.OptischeInspektion.Rohrleitung.Grunddaten.KnotenAblauf;
|
||||
inspektionsobjekt.Bemerkung = src.OptischeInspektion.Rohrleitung.Inspektionsrichtung;
|
||||
|
||||
|
||||
foreach(RZustand zustand in src.OptischeInspektion.Rohrleitung.Zustaende)
|
||||
{
|
||||
Inspektionskuerzeln inspektionskuerzeln = new Inspektionskuerzeln();
|
||||
inspektionskuerzeln.Station = zustand.Station;
|
||||
inspektionskuerzeln.Hauptkode = zustand.Inspektionskode;
|
||||
inspektionskuerzeln.Charakterisierung1 = zustand.Charakterisierung1;
|
||||
inspektionskuerzeln.Charakterisierung2 = zustand.Charakterisierung2;
|
||||
inspektionskuerzeln.ImVerbindung = zustand.Verbindung;
|
||||
|
||||
Quantifizierung quant1 = zustand.Quantifizierung1;
|
||||
Quantifizierung quant2 = zustand.Quantifizierung2;
|
||||
|
||||
inspektionskuerzeln.Quantifizierung1 = Convert.ToUInt32(quant1.Numerisch);
|
||||
inspektionskuerzeln.Quantifizierung2 = Convert.ToUInt32(quant2.Numerisch);
|
||||
|
||||
inspektionskuerzelns.Add(inspektionskuerzeln);
|
||||
}
|
||||
|
||||
inspektionsobjekt.Schadenskuerzeln = inspektionskuerzelns;
|
||||
result.Add(inspektionsobjekt);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,17 +41,23 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Import.cs" />
|
||||
<Compile Include="XML2006\Enums.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="XML2006\Anschlussdaten.cs" />
|
||||
<Compile Include="XML2006\Functions.cs" />
|
||||
<Compile Include="XML2006\InspizierteAbwassertechnischeAnlage.cs" />
|
||||
<Compile Include="XML2006\Lage.cs" />
|
||||
<Compile Include="XML2006\OptischeInspektion.cs" />
|
||||
<Compile Include="XML2006\RGrunddaten.cs" />
|
||||
<Compile Include="XML2006\Rohrleitung.cs" />
|
||||
<Compile Include="XML2006\RZustand.cs" />
|
||||
<Compile Include="XML2006\XMLParser.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\KlassenBIB\KlassenBIB.csproj">
|
||||
<Project>{c82bd650-466b-403f-bed9-2b1660771f54}</Project>
|
||||
<Name>KlassenBIB</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -14,12 +14,29 @@ namespace SchnittstelleImporter.XML2006
|
||||
string anschlussArt;
|
||||
string fixierung;
|
||||
string kommentar;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Objektbezeichnung { get => objektbezeichnung; set => objektbezeichnung = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public EKantenTyp Kantentyp { get => kantentyp; set => kantentyp = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal Entfernung { get => entfernung; set => entfernung = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string AnschlussArt { get => anschlussArt; set => anschlussArt = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Fixierung { get => fixierung; set => fixierung = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Kommentar { get => kommentar; set => kommentar = value; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchnittstelleImporter.XML2006
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum EAnlagetyp
|
||||
{
|
||||
Haltung = 1,
|
||||
@@ -13,35 +16,53 @@ namespace SchnittstelleImporter.XML2006
|
||||
Schacht = 3,
|
||||
Bauwerk = 4
|
||||
}
|
||||
public enum EInspektionverfahren
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
enum EInspektionverfahren
|
||||
{
|
||||
TVUntersuchung,
|
||||
Begehung,
|
||||
VomSchacht,
|
||||
Other
|
||||
}
|
||||
public enum EWetter
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
enum EWetter
|
||||
{
|
||||
KEINNIEDERSCHLAG = 1,
|
||||
REGEN = 2,
|
||||
SCHNEE = 3
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum ERohrleitungstyp
|
||||
{
|
||||
HALTUNG,
|
||||
LEITUNG
|
||||
}
|
||||
public enum EObjektArt
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
enum EObjektArt
|
||||
{
|
||||
KANTE = 1,
|
||||
KNOTEN = 2
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum EKnotenTyp
|
||||
{
|
||||
SCHACHT = 0,
|
||||
ANSCHLUSSPUNKT = 1,
|
||||
BAUWERK = 2
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum EKantenTyp
|
||||
{
|
||||
HALTUNG,
|
||||
|
||||
@@ -12,7 +12,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
Lage lage;
|
||||
EAnlagetyp anlagentyp;
|
||||
OptischeInspektion optischeInspektion;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Objektbezeichnung
|
||||
{
|
||||
get
|
||||
@@ -24,6 +26,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
objektbezeichnung = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public EAnlagetyp Anlagentyp
|
||||
{
|
||||
get
|
||||
@@ -35,6 +40,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
anlagentyp = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public OptischeInspektion OptischeInspektion
|
||||
{
|
||||
get
|
||||
@@ -46,6 +54,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
optischeInspektion = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Lage Lage
|
||||
{
|
||||
get
|
||||
@@ -57,6 +68,10 @@ namespace SchnittstelleImporter.XML2006
|
||||
lage = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return objektbezeichnung;
|
||||
|
||||
@@ -10,7 +10,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
{
|
||||
string strassename;
|
||||
string ortname;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Strassename
|
||||
{
|
||||
get
|
||||
@@ -22,6 +24,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
strassename = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Ortname
|
||||
{
|
||||
get
|
||||
@@ -33,6 +38,11 @@ namespace SchnittstelleImporter.XML2006
|
||||
ortname = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="strassename"></param>
|
||||
/// <param name="ortname"></param>
|
||||
public Lage(string strassename, string ortname)
|
||||
{
|
||||
this.strassename = strassename;
|
||||
|
||||
@@ -10,7 +10,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
{
|
||||
DateTime inspektionstime;
|
||||
Rohrleitung rohrleitung;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public DateTime Inspektionstime
|
||||
{
|
||||
set
|
||||
@@ -22,6 +24,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
return inspektionstime;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Inspektionsdatum
|
||||
{
|
||||
get
|
||||
@@ -34,6 +39,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
//inspektionsdatum = value;
|
||||
}*/
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Inspektionszeit
|
||||
{
|
||||
get
|
||||
@@ -41,6 +49,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
return inspektionstime.ToShortTimeString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Rohrleitung Rohrleitung
|
||||
{
|
||||
get
|
||||
|
||||
@@ -23,22 +23,65 @@ namespace SchnittstelleImporter.XML2006
|
||||
decimal regeleinzelrohrlaenge;
|
||||
int artAuskleidung;
|
||||
string innenschutz;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string KnotenZulauf { get => knotenZulauf; set => knotenZulauf = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public EKnotenTyp KnotenZulaufTyp { get => knotenZulaufTyp; set => knotenZulaufTyp = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string KnotenAblauf { get => knotenAblauf; set => knotenAblauf = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public EKnotenTyp KnotenAblaufTyp { get => knotenAblaufTyp; set => knotenAblaufTyp = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int Profilhoehe { get => profilhoehe; set => profilhoehe = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int Profilbreite { get => profilbreite; set => profilbreite = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int Profilart { get => profilart; set => profilart = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Material { get => material; set => material = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Kanalart { get => kanalart; set => kanalart = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Anschlussdaten Anschlussddaten { get => anschlussddaten; set => anschlussddaten = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int HerkunftProfilmasse { get => herkunftProfilmasse; set => herkunftProfilmasse = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int HerkunftMaterial { get => herkunftMaterial; set => herkunftMaterial = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal Regeleinzelrohrlaenge { get => regeleinzelrohrlaenge; set => regeleinzelrohrlaenge = value; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int ArtAuskleidung { get => artAuskleidung; set => artAuskleidung = value; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool HasGrundleitung
|
||||
{
|
||||
get
|
||||
@@ -46,7 +89,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
return anschlussddaten != null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Innenschutz { get => innenschutz; set => innenschutz = value; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchnittstelleImporter.XML2006
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class Rohrleitung
|
||||
{
|
||||
ERohrleitungstyp rohrleitungstyp;
|
||||
@@ -13,7 +16,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
string inspektionsrichtung;
|
||||
RGrunddaten grunddaten = null;
|
||||
List<RZustand> zustaende = null;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ERohrleitungstyp Rohrleitungstyp
|
||||
{
|
||||
get
|
||||
@@ -25,7 +30,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
rohrleitungstyp = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal Inspektionslaenge
|
||||
{
|
||||
get
|
||||
@@ -37,6 +44,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
inspektionslaenge = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Inspektionsrichtung
|
||||
{
|
||||
get
|
||||
@@ -54,6 +64,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
inspektionsrichtung = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<RZustand> Zustaende
|
||||
{
|
||||
get
|
||||
@@ -65,6 +78,9 @@ namespace SchnittstelleImporter.XML2006
|
||||
zustaende = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public RGrunddaten Grunddaten
|
||||
{
|
||||
get
|
||||
|
||||
@@ -8,9 +8,17 @@ using System.Xml;
|
||||
|
||||
namespace SchnittstelleImporter.XML2006
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class XMLParser
|
||||
{
|
||||
public static Dictionary<InspizierteAbwassertechnischeAnlage, string> anlageInFile = new Dictionary<InspizierteAbwassertechnischeAnlage, string>();
|
||||
/// <summary>
|
||||
/// Gibt eine Liste an anlagen zurück von einer XML Datei.
|
||||
/// </summary>
|
||||
/// <param name="xmldatei"></param>
|
||||
/// <returns></returns>
|
||||
public static List<InspizierteAbwassertechnischeAnlage> GetList(string xmldatei)
|
||||
{
|
||||
List<InspizierteAbwassertechnischeAnlage> result = new List<InspizierteAbwassertechnischeAnlage>();
|
||||
@@ -28,6 +36,7 @@ namespace SchnittstelleImporter.XML2006
|
||||
foreach (XmlNode node in inspizierteDaten)
|
||||
{
|
||||
InspizierteAbwassertechnischeAnlage anlage = GetAnlage(node);
|
||||
if (anlage == null) continue;
|
||||
result.Add(anlage);
|
||||
anlageInFile.Add(anlage, xmldatei);
|
||||
}
|
||||
@@ -112,7 +121,8 @@ namespace SchnittstelleImporter.XML2006
|
||||
optischeInspektion.Inspektionstime = dt;
|
||||
|
||||
if (intRohrleitung == null)
|
||||
throw new NotImplementedException("Schaechte sind noch nicht implementiert");
|
||||
return null;
|
||||
//throw new NotImplementedException("Schaechte sind noch nicht implementiert");
|
||||
|
||||
Rohrleitung rohr = new Rohrleitung();
|
||||
foreach (XmlNode d in intRohrleitung)
|
||||
@@ -256,6 +266,8 @@ namespace SchnittstelleImporter.XML2006
|
||||
case "Fotodatei": break;
|
||||
case "FotoSpeichermedium": break;
|
||||
case "Fotonummer": break;
|
||||
case "Timecode": break;
|
||||
case "GrundAbbruch": break;
|
||||
default: throw new NotImplementedException(d.Name);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user