Initial commit
This commit is contained in:
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
/XMLParser/bin/*
|
||||||
|
/XMLParser/obj/*
|
||||||
|
/XMLParserTest/bin/Debug/*
|
||||||
|
/XMLParserTest/obj/Debug/*
|
||||||
|
/XMLParserTest/obj/*
|
||||||
26
.vscode/launch.json
vendored
Normal file
26
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||||
|
// Use hover for the description of the existing attributes
|
||||||
|
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||||
|
"name": ".NET Core Launch (console)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"preLaunchTask": "build",
|
||||||
|
// If you have changed target frameworks, make sure to update the program path.
|
||||||
|
"program": "${workspaceFolder}/XMLParserTest/bin/Debug/net5.0/XMLParserTest.dll",
|
||||||
|
"args": [],
|
||||||
|
"cwd": "${workspaceFolder}/XMLParserTest",
|
||||||
|
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||||
|
"console": "internalConsole",
|
||||||
|
"stopAtEntry": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": ".NET Core Attach",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "attach"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
42
.vscode/tasks.json
vendored
Normal file
42
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "build",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"${workspaceFolder}/XMLParserTest/XMLParserTest.csproj",
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/consoleloggerparameters:NoSummary"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "publish",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"publish",
|
||||||
|
"${workspaceFolder}/XMLParserTest/XMLParserTest.csproj",
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/consoleloggerparameters:NoSummary"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "watch",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"watch",
|
||||||
|
"run",
|
||||||
|
"${workspaceFolder}/XMLParserTest/XMLParserTest.csproj",
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/consoleloggerparameters:NoSummary"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
48
XMLParser.sln
Normal file
48
XMLParser.sln
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.6.30114.105
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLParser", "XMLParser\XMLParser.csproj", "{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLParserTest", "XMLParserTest\XMLParserTest.csproj", "{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{55DEEE0A-8AED-403B-B2C7-F8EEAA45ED1F}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{089D18AE-F5F0-4371-BC0A-AEF00FBBFB55}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
20
XMLParser/AbwassertechnischeAnlage.cs
Normal file
20
XMLParser/AbwassertechnischeAnlage.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
internal class AbwassertechnischeAnlage
|
||||||
|
{
|
||||||
|
string objektbezeichnung;
|
||||||
|
EObjektArt objektArt;
|
||||||
|
string entwaesserungsart;
|
||||||
|
Kante kante;
|
||||||
|
Knoten knoten;
|
||||||
|
Geometrie geometrie;
|
||||||
|
|
||||||
|
|
||||||
|
public string Objektbezeichnung { get => objektbezeichnung; set => objektbezeichnung = value; }
|
||||||
|
public EObjektArt ObjektArt { get => objektArt; set => objektArt = value; }
|
||||||
|
public string Entwaesserungsart { get => entwaesserungsart; set => entwaesserungsart = value; }
|
||||||
|
public Kante Kante { get => kante; set => kante = value; }
|
||||||
|
public Geometrie Geometrie { get => geometrie; set => geometrie = value; }
|
||||||
|
internal Knoten Knoten { get => knoten; set => knoten = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
19
XMLParser/Anschlussdaten.cs
Normal file
19
XMLParser/Anschlussdaten.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class Anschlussdaten
|
||||||
|
{
|
||||||
|
string objektbezeichnung;
|
||||||
|
EKantenTyp kantentyp;
|
||||||
|
decimal entfernung;
|
||||||
|
string anschlussArt;
|
||||||
|
string fixierung;
|
||||||
|
string kommentar;
|
||||||
|
|
||||||
|
public string Objektbezeichnung { get => objektbezeichnung; set => objektbezeichnung = value; }
|
||||||
|
public EKantenTyp Kantentyp { get => kantentyp; set => kantentyp = value; }
|
||||||
|
public decimal Entfernung { get => entfernung; set => entfernung = value; }
|
||||||
|
public string AnschlussArt { get => anschlussArt; set => anschlussArt = value; }
|
||||||
|
public string Fixierung { get => fixierung; set => fixierung = value; }
|
||||||
|
public string Kommentar { get => kommentar; set => kommentar = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
9
XMLParser/Anschlusspunkt.cs
Normal file
9
XMLParser/Anschlusspunkt.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
internal class Anschlusspunkt
|
||||||
|
{
|
||||||
|
string punktkennung;
|
||||||
|
|
||||||
|
public string Punktkennung { get => punktkennung; set => punktkennung = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
52
XMLParser/Enums.cs
Normal file
52
XMLParser/Enums.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public enum EAnlagetyp
|
||||||
|
{
|
||||||
|
Haltung = 1,
|
||||||
|
Anschlussleitung = 2,
|
||||||
|
Schacht = 3,
|
||||||
|
Bauwerk = 4
|
||||||
|
}
|
||||||
|
public enum EInspektionverfahren
|
||||||
|
{
|
||||||
|
TVUntersuchung,
|
||||||
|
Begehung,
|
||||||
|
VomSchacht,
|
||||||
|
Other
|
||||||
|
}
|
||||||
|
public enum EWetter
|
||||||
|
{
|
||||||
|
KEINNIEDERSCHLAG = 1,
|
||||||
|
REGEN = 2,
|
||||||
|
SCHNEE = 3
|
||||||
|
}
|
||||||
|
public enum ERohrleitungstyp
|
||||||
|
{
|
||||||
|
HALTUNG,
|
||||||
|
LEITUNG
|
||||||
|
}
|
||||||
|
public enum EObjektArt
|
||||||
|
{
|
||||||
|
KANTE = 1,
|
||||||
|
KNOTEN = 2
|
||||||
|
}
|
||||||
|
public enum EKnotenTyp
|
||||||
|
{
|
||||||
|
SCHACHT = 0,
|
||||||
|
ANSCHLUSSPUNKT = 1,
|
||||||
|
BAUWERK = 2
|
||||||
|
}
|
||||||
|
public enum EKantenTyp
|
||||||
|
{
|
||||||
|
HALTUNG,
|
||||||
|
LEITUNG,
|
||||||
|
RINNE,
|
||||||
|
GERINNE
|
||||||
|
}
|
||||||
|
}
|
||||||
24
XMLParser/Geometrie.cs
Normal file
24
XMLParser/Geometrie.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class Geometrie
|
||||||
|
{
|
||||||
|
Geometriedaten geometriedaten;
|
||||||
|
PolyKanteAttribute rap1;
|
||||||
|
PolyKanteAttribute rap2;
|
||||||
|
|
||||||
|
public Geometriedaten Geometriedaten
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return geometriedaten;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
geometriedaten = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public PolyKanteAttribute Rap1 { get => rap1; set => rap1 = value; }
|
||||||
|
public PolyKanteAttribute Rap2 { get => rap2; set => rap2 = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
21
XMLParser/Geometriedaten.cs
Normal file
21
XMLParser/Geometriedaten.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class Geometriedaten
|
||||||
|
{
|
||||||
|
List<PolyKante> kanten;
|
||||||
|
|
||||||
|
public List<PolyKante> Kanten
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return kanten;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
kanten = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
83
XMLParser/InspizierteAbwassertechnischeAnlage.cs
Normal file
83
XMLParser/InspizierteAbwassertechnischeAnlage.cs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public sealed class InspizierteAbwassertechnischeAnlage
|
||||||
|
{
|
||||||
|
string objektbezeichnung;
|
||||||
|
Lage lage;
|
||||||
|
Kante kante;
|
||||||
|
Geometrie geometrie;
|
||||||
|
EAnlagetyp anlagentyp;
|
||||||
|
OptischeInspektion optischeInspektion;
|
||||||
|
|
||||||
|
public string Objektbezeichnung
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return objektbezeichnung;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
objektbezeichnung = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Kante Kante
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return kante;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
kante = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Geometrie Geometrie
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return geometrie;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
geometrie = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public EAnlagetyp Anlagentyp
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return anlagentyp;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
anlagentyp = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public OptischeInspektion OptischeInspektion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return optischeInspektion;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
optischeInspektion = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Lage Lage
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return lage;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
lage = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return objektbezeichnung;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
XMLParser/Kante.cs
Normal file
21
XMLParser/Kante.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class Kante
|
||||||
|
{
|
||||||
|
decimal sohlhoeheZulauf;
|
||||||
|
decimal sohlhoeheAblauf;
|
||||||
|
string knotenZulauf;
|
||||||
|
string knotenAblauf;
|
||||||
|
int knotenAblaufTyp;
|
||||||
|
int knotenZulaufTyp;
|
||||||
|
bool isFiktiveLeitung = true;
|
||||||
|
|
||||||
|
public decimal SohlhoeheZulauf { get => sohlhoeheZulauf; set => sohlhoeheZulauf = value; }
|
||||||
|
public decimal SohlhoeheAblauf { get => sohlhoeheAblauf; set => sohlhoeheAblauf = value; }
|
||||||
|
public string KnotenZulauf { get => knotenZulauf; set => knotenZulauf = value; }
|
||||||
|
public string KnotenAblauf { get => knotenAblauf; set => knotenAblauf = value; }
|
||||||
|
public int KnotenAblaufTyp { get => knotenAblaufTyp; set => knotenAblaufTyp = value; }
|
||||||
|
public int KnotenZulaufTyp { get => knotenZulaufTyp; set => knotenZulaufTyp = value; }
|
||||||
|
public bool IsFiktiveLeitung { get => isFiktiveLeitung; set => isFiktiveLeitung = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
11
XMLParser/Knoten.cs
Normal file
11
XMLParser/Knoten.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
internal class Knoten
|
||||||
|
{
|
||||||
|
EKnotenTyp knotenTyp;
|
||||||
|
Anschlusspunkt anschlusspunkt;
|
||||||
|
|
||||||
|
public EKnotenTyp KnotenTyp { get => knotenTyp; set => knotenTyp = value; }
|
||||||
|
internal Anschlusspunkt Anschlusspunkt { get => anschlusspunkt; set => anschlusspunkt = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
36
XMLParser/Lage.cs
Normal file
36
XMLParser/Lage.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class Lage
|
||||||
|
{
|
||||||
|
string strassename;
|
||||||
|
string ortname;
|
||||||
|
|
||||||
|
public string Strassename
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return strassename;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
strassename = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string Ortname
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ortname;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ortname = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Lage(string strassename, string ortname)
|
||||||
|
{
|
||||||
|
this.strassename = strassename;
|
||||||
|
this.ortname = ortname;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
52
XMLParser/OptischeInspektion.cs
Normal file
52
XMLParser/OptischeInspektion.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class OptischeInspektion
|
||||||
|
{
|
||||||
|
DateTime inspektionstime;
|
||||||
|
Rohrleitung rohrleitung;
|
||||||
|
|
||||||
|
public DateTime Inspektionstime
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
inspektionstime = value;
|
||||||
|
}
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return inspektionstime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string Inspektionsdatum
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return inspektionstime.ToShortDateString();
|
||||||
|
}
|
||||||
|
/*set
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
//inspektionsdatum = value;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
public string Inspektionszeit
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return inspektionstime.ToShortTimeString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Rohrleitung Rohrleitung
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return rohrleitung;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
rohrleitung = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
XMLParser/PolyKante.cs
Normal file
25
XMLParser/PolyKante.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class PolyKante
|
||||||
|
{
|
||||||
|
PolyKanteAttribute start;
|
||||||
|
PolyKanteAttribute ende;
|
||||||
|
|
||||||
|
public PolyKanteAttribute Start { get => start; set => start = value; }
|
||||||
|
public PolyKanteAttribute Ende { get => ende; set => ende = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PolyKanteAttribute
|
||||||
|
{
|
||||||
|
decimal rechtswert;
|
||||||
|
decimal hochwert;
|
||||||
|
decimal punkthoehe;
|
||||||
|
string punktattributAbwasser;
|
||||||
|
|
||||||
|
public decimal Rechtswert { get => rechtswert; set => rechtswert = value; }
|
||||||
|
public decimal Hochwert { get => hochwert; set => hochwert = value; }
|
||||||
|
public decimal Punkthoehe { get => punkthoehe; set => punkthoehe = value; }
|
||||||
|
public string PunktattributAbwasser { get => punktattributAbwasser; set => punktattributAbwasser = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
46
XMLParser/RGrunddaten.cs
Normal file
46
XMLParser/RGrunddaten.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class RGrunddaten
|
||||||
|
{
|
||||||
|
string knotenZulauf;
|
||||||
|
EKnotenTyp knotenZulaufTyp;
|
||||||
|
string knotenAblauf;
|
||||||
|
EKnotenTyp knotenAblaufTyp;
|
||||||
|
int profilhoehe;
|
||||||
|
int profilbreite;
|
||||||
|
int profilart;
|
||||||
|
string material;
|
||||||
|
string kanalart;
|
||||||
|
Anschlussdaten anschlussddaten = null;
|
||||||
|
int herkunftProfilmasse;
|
||||||
|
int herkunftMaterial;
|
||||||
|
decimal regeleinzelrohrlaenge;
|
||||||
|
int artAuskleidung;
|
||||||
|
string innenschutz;
|
||||||
|
|
||||||
|
public string KnotenZulauf { get => knotenZulauf; set => knotenZulauf = value; }
|
||||||
|
public EKnotenTyp KnotenZulaufTyp { get => knotenZulaufTyp; set => knotenZulaufTyp = value; }
|
||||||
|
public string KnotenAblauf { get => knotenAblauf; set => knotenAblauf = value; }
|
||||||
|
public EKnotenTyp KnotenAblaufTyp { get => knotenAblaufTyp; set => knotenAblaufTyp = value; }
|
||||||
|
public int Profilhoehe { get => profilhoehe; set => profilhoehe = value; }
|
||||||
|
public int Profilbreite { get => profilbreite; set => profilbreite = value; }
|
||||||
|
public int Profilart { get => profilart; set => profilart = value; }
|
||||||
|
public string Material { get => material; set => material = value; }
|
||||||
|
public string Kanalart { get => kanalart; set => kanalart = value; }
|
||||||
|
public Anschlussdaten Anschlussddaten { get => anschlussddaten; set => anschlussddaten = value; }
|
||||||
|
public int HerkunftProfilmasse { get => herkunftProfilmasse; set => herkunftProfilmasse = value; }
|
||||||
|
public int HerkunftMaterial { get => herkunftMaterial; set => herkunftMaterial = value; }
|
||||||
|
public decimal Regeleinzelrohrlaenge { get => regeleinzelrohrlaenge; set => regeleinzelrohrlaenge = value; }
|
||||||
|
public int ArtAuskleidung { get => artAuskleidung; set => artAuskleidung = value; }
|
||||||
|
|
||||||
|
public bool HasGrundleitung
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return anschlussddaten != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Innenschutz { get => innenschutz; set => innenschutz = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
45
XMLParser/RZustand.cs
Normal file
45
XMLParser/RZustand.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public struct Quantifizierung
|
||||||
|
{
|
||||||
|
public decimal Numerisch;
|
||||||
|
public string Text;
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (Text != null)
|
||||||
|
return Text;
|
||||||
|
if (Numerisch == 0)
|
||||||
|
return "";
|
||||||
|
return Numerisch.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class RZustand
|
||||||
|
{
|
||||||
|
decimal station;
|
||||||
|
string inspektionskode;
|
||||||
|
string charakterisierung1;
|
||||||
|
string charakterisierung2;
|
||||||
|
bool verbindung;
|
||||||
|
Quantifizierung quantifizierung1;
|
||||||
|
Quantifizierung quantifizierung2;
|
||||||
|
string streckenschaden;
|
||||||
|
int streckenschadennr;
|
||||||
|
int positionVon;
|
||||||
|
int positionBis;
|
||||||
|
string kommentar;
|
||||||
|
|
||||||
|
public decimal Station { get => station; set => station = value; }
|
||||||
|
public string Inspektionskode { get => inspektionskode; set => inspektionskode = value; }
|
||||||
|
public string Charakterisierung1 { get => charakterisierung1; set => charakterisierung1 = value; }
|
||||||
|
public string Charakterisierung2 { get => charakterisierung2; set => charakterisierung2 = value; }
|
||||||
|
public bool Verbindung { get => verbindung; set => verbindung = value; }
|
||||||
|
public Quantifizierung Quantifizierung1 { get => quantifizierung1; set => quantifizierung1 = value; }
|
||||||
|
public Quantifizierung Quantifizierung2 { get => quantifizierung2; set => quantifizierung2 = value; }
|
||||||
|
public string Streckenschaden { get => streckenschaden; set => streckenschaden = value; }
|
||||||
|
public int Streckenschadennr { get => streckenschadennr; set => streckenschadennr = value; }
|
||||||
|
public int PositionVon { get => positionVon; set => positionVon = value; }
|
||||||
|
public int PositionBis { get => positionBis; set => positionBis = value; }
|
||||||
|
public string Kommentar { get => kommentar; set => kommentar = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
76
XMLParser/Rohrleitung.cs
Normal file
76
XMLParser/Rohrleitung.cs
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public class Rohrleitung
|
||||||
|
{
|
||||||
|
ERohrleitungstyp rohrleitungstyp;
|
||||||
|
decimal inspektionslaenge;
|
||||||
|
string inspektionsrichtung;
|
||||||
|
RGrunddaten grunddaten = null;
|
||||||
|
List<RZustand> zustaende = null;
|
||||||
|
|
||||||
|
public ERohrleitungstyp Rohrleitungstyp
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return rohrleitungstyp;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
rohrleitungstyp = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public decimal Inspektionslaenge
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return inspektionslaenge;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
inspektionslaenge = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string Inspektionsrichtung
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch(inspektionsrichtung)
|
||||||
|
{
|
||||||
|
case "U": return "Gegen Fliessrichtung";
|
||||||
|
case "O": return "In Fliessrichtung";
|
||||||
|
default: return "Fliessrichtungangabe nicht bekannt(" + inspektionsrichtung + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
inspektionsrichtung = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public List<RZustand> Zustaende
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return zustaende;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
zustaende = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RGrunddaten Grunddaten
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return grunddaten;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
grunddaten = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
146
XMLParser/XMLParser.cs
Normal file
146
XMLParser/XMLParser.cs
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
|
namespace XMLParser
|
||||||
|
{
|
||||||
|
public static class XMLParser
|
||||||
|
{
|
||||||
|
public static void LoadFile(string xmldatei) {
|
||||||
|
List<AbwassertechnischeAnlage> Stammdaten = new List<AbwassertechnischeAnlage>();
|
||||||
|
List<InspizierteAbwassertechnischeAnlage> Inspektionsdaten = new List<InspizierteAbwassertechnischeAnlage>();
|
||||||
|
|
||||||
|
XmlDocument doc = new XmlDocument();
|
||||||
|
doc.Load(xmldatei);
|
||||||
|
XmlNode rootChild = doc.LastChild;
|
||||||
|
|
||||||
|
XmlNamespaceManager manager = new XmlNamespaceManager(doc.NameTable);
|
||||||
|
manager.AddNamespace("e", "http://www.ofd-hannover.la/Identifikation");
|
||||||
|
XmlNode root = rootChild.SelectSingleNode("//e:Datenkollektive", manager);
|
||||||
|
|
||||||
|
Stammdaten = LoadStammdatenCollectiv(manager, root);
|
||||||
|
Inspektionsdaten = LoadInspektionsdatenCollectiv(manager,root);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<InspizierteAbwassertechnischeAnlage> LoadInspektionsdatenCollectiv(XmlNamespaceManager manager, XmlNode root)
|
||||||
|
{
|
||||||
|
List<InspizierteAbwassertechnischeAnlage> result = new List<InspizierteAbwassertechnischeAnlage>();
|
||||||
|
XmlNode zstdk = root.SelectSingleNode("//e:Zustandsdatenkollektiv", manager);
|
||||||
|
XmlNodeList Inspektionsdaten = zstdk.SelectNodes("//e:InspizierteAbwassertechnischeAnlage", manager);
|
||||||
|
|
||||||
|
foreach(XmlNode node in Inspektionsdaten) {
|
||||||
|
result.Add(ParseInspektion(node));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static InspizierteAbwassertechnischeAnlage ParseInspektion(XmlNode node)
|
||||||
|
{
|
||||||
|
XmlNode intOptischeInspektion = null;
|
||||||
|
//XmlNode intRohrleitung = null;
|
||||||
|
|
||||||
|
//XmlNode intRGrunddaten = null;
|
||||||
|
//XmlNode intInspektionsdaten = null;
|
||||||
|
XmlNode intKanten = null;
|
||||||
|
XmlNode intGeometrie = null;
|
||||||
|
|
||||||
|
InspizierteAbwassertechnischeAnlage result = new InspizierteAbwassertechnischeAnlage();
|
||||||
|
foreach (XmlNode d in node.ChildNodes)
|
||||||
|
{
|
||||||
|
switch (d.Name)
|
||||||
|
{
|
||||||
|
case "Objektbezeichnung":
|
||||||
|
result.Objektbezeichnung = d.InnerText;
|
||||||
|
// if (d.InnerText.Equals("44903796")) Debugger.Break();
|
||||||
|
break;
|
||||||
|
case "Anlagentyp":
|
||||||
|
result.Anlagentyp = (EAnlagetyp)Convert.ToInt32(d.InnerText); //anlagentyp = Convert.ToInt32(d.InnerText);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "Kante":
|
||||||
|
intKanten = d;
|
||||||
|
//Debugger.Break();
|
||||||
|
break;
|
||||||
|
case "Geometrie":
|
||||||
|
intGeometrie = d;
|
||||||
|
break;
|
||||||
|
case "Lage":
|
||||||
|
//throw new NotImplementedException();
|
||||||
|
if (!d.HasChildNodes) break;
|
||||||
|
string strassename ="";
|
||||||
|
string ortname = "";
|
||||||
|
foreach (XmlNode _temp in d.ChildNodes)
|
||||||
|
{
|
||||||
|
switch (_temp.Name)
|
||||||
|
{
|
||||||
|
case "Strassenname": strassename = _temp.InnerText; break;
|
||||||
|
case "Ortsteilname": ortname = _temp.InnerText; break;
|
||||||
|
case "LageOberflaeche": break;
|
||||||
|
default: break;
|
||||||
|
//default: throw new NotImplementedException(_temp.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.Lage = new Lage(strassename, ortname);
|
||||||
|
break;
|
||||||
|
case "OptischeInspektion":
|
||||||
|
intOptischeInspektion = d;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<AbwassertechnischeAnlage> LoadStammdatenCollectiv(XmlNamespaceManager manager,XmlNode root)
|
||||||
|
{
|
||||||
|
List<AbwassertechnischeAnlage> result = new List<AbwassertechnischeAnlage>();
|
||||||
|
XmlNode zstdk = root.SelectSingleNode("//e:Stammdatenkollektiv", manager);
|
||||||
|
XmlNodeList Stammdaten = zstdk.SelectNodes("//e:AbwassertechnischeAnlage", manager);
|
||||||
|
|
||||||
|
foreach(XmlNode node in Stammdaten)
|
||||||
|
{
|
||||||
|
result.Add(ParseStammdaten(node));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static AbwassertechnischeAnlage ParseStammdaten(XmlNode node)
|
||||||
|
{
|
||||||
|
AbwassertechnischeAnlage result = new AbwassertechnischeAnlage();
|
||||||
|
foreach(XmlNode aktuell in node.ChildNodes)
|
||||||
|
{
|
||||||
|
switch(aktuell.Name)
|
||||||
|
{
|
||||||
|
case "Objektbezeichnung":result.Objektbezeichnung = aktuell.InnerText;break;
|
||||||
|
case "Objektart":result.ObjektArt = (EObjektArt)Convert.ToInt32(aktuell.InnerText); break;
|
||||||
|
case "Entwaesserungsart":result.Entwaesserungsart = aktuell.InnerText;break;
|
||||||
|
case "Knoten":result.Knoten = parseStammdatenKnoten(aktuell); break;
|
||||||
|
case "Lage":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Knoten parseStammdatenKnoten(XmlNode aktuell)
|
||||||
|
{
|
||||||
|
Knoten result = new Knoten();
|
||||||
|
foreach(XmlNode s in aktuell.ChildNodes)
|
||||||
|
{
|
||||||
|
switch(s.Name)
|
||||||
|
{
|
||||||
|
case "KnotenTyp": result.KnotenTyp = (EKnotenTyp)Convert.ToInt32(s.InnerText);break;
|
||||||
|
case "Anschlusspunkt": result.Anschlusspunkt = new Anschlusspunkt() { Punktkennung = s.InnerText }; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
XMLParser/XMLParser.csproj
Normal file
7
XMLParser/XMLParser.csproj
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
14
XMLParserTest/UnitTest1.cs
Normal file
14
XMLParserTest/UnitTest1.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
|
namespace XMLParserTest
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class UnitTest1
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMethod1()
|
||||||
|
{
|
||||||
|
XMLParser.XMLParser.LoadFile("input.xml");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
XMLParserTest/XMLParserTest.csproj
Normal file
20
XMLParserTest/XMLParserTest.csproj
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
||||||
|
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
|
||||||
|
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="1.3.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\XMLParser\XMLParser.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user