CSV Importer erweitert.
HAUSREV6.0 Implementiert
This commit is contained in:
@@ -10,6 +10,6 @@ namespace Shared.Contracts
|
|||||||
{
|
{
|
||||||
public interface IImport
|
public interface IImport
|
||||||
{
|
{
|
||||||
List<Schacht> LoadSchaechte(string filename, EEntwaeserung entwaeserung);
|
List<Schacht> LoadSchaechte(string filename, string vermesser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace StammGenerator.ViewModel
|
|||||||
|
|
||||||
private async void importFile()
|
private async void importFile()
|
||||||
{
|
{
|
||||||
var schaechte = importer.LoadSchaechte(FileName, EEntwaeserung.Mischwasser);
|
var schaechte = importer.LoadSchaechte(FileName, "Marwede");
|
||||||
if (schaechte != null)
|
if (schaechte != null)
|
||||||
{
|
{
|
||||||
await schachtDataService.InsertSchachtBulk(schaechte);
|
await schachtDataService.InsertSchachtBulk(schaechte);
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
|||||||
{
|
{
|
||||||
public async Task<bool> Export(string projektname,EKodierungssystem kodierungssystem, List<Kanal> haltungen, List<Schacht> schaechte, IWWLog log)
|
public async Task<bool> Export(string projektname,EKodierungssystem kodierungssystem, List<Kanal> haltungen, List<Schacht> schaechte, IWWLog log)
|
||||||
{
|
{
|
||||||
KANDIS_HALTUNG60 haltung = new KANDIS_HALTUNG60(projektname, haltungen,log);
|
KANDIS_HALTUNG60 haltung = new KANDIS_HALTUNG60(projektname, haltungen, log);
|
||||||
KANDIS_SCHACHT60 schacht = new KANDIS_SCHACHT60(projektname, schaechte,log);
|
KANDIS_SCHACHT60 schacht = new KANDIS_SCHACHT60(projektname, schaechte, log);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,12 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
|||||||
{
|
{
|
||||||
public static Dictionary<string, int> LineSize = new Dictionary<string, int>()
|
public static Dictionary<string, int> LineSize = new Dictionary<string, int>()
|
||||||
{
|
{
|
||||||
{ "KANSCH4.0",557 },
|
{ "KANSCH4.0", 557 },
|
||||||
{ "KANSCH6.0",2041 },
|
{ "KANSCH6.0", 2041 },
|
||||||
{ "KANHAL4.0",530 },
|
{ "KANHAL4.0", 530 },
|
||||||
{ "KANHAL6.0",2167 }
|
{ "KANHAL6.0", 2167 },
|
||||||
|
{ "HAUSREV4.0", 355 },
|
||||||
|
{ "HAUSREV6.0", 1708 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +30,8 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
|||||||
public enum kType
|
public enum kType
|
||||||
{
|
{
|
||||||
HALTUNG,
|
HALTUNG,
|
||||||
SCHACHT
|
SCHACHT,
|
||||||
|
REVSCHACHT
|
||||||
}
|
}
|
||||||
|
|
||||||
private StreamWriter sw;
|
private StreamWriter sw;
|
||||||
@@ -63,6 +66,15 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kType.REVSCHACHT:
|
||||||
|
{
|
||||||
|
switch(exportType)
|
||||||
|
{
|
||||||
|
case EExportType.KANDIS4: version = "HAUSREV4.0"; break;
|
||||||
|
case EExportType.KANDIS6: version = "HAUSREV6.0"; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ExporterHelper.LineSize.ContainsKey(version))
|
if (!ExporterHelper.LineSize.ContainsKey(version))
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using SewerStammGen.Shared.Contracts;
|
||||||
|
using SewerStammGen.Shared.Domain;
|
||||||
|
using SewerStammGen.Shared.Enum;
|
||||||
|
|
||||||
|
namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
||||||
|
{
|
||||||
|
internal class KANDIS_HAUSREV60 : KANDIS_Exporter
|
||||||
|
{
|
||||||
|
public KANDIS_HAUSREV60(string filename, List<Schacht> schaechte, IWWLog log) : base(filename + ".rev", EExportType.KANDIS6, kType.REVSCHACHT, log)
|
||||||
|
{
|
||||||
|
foreach(Schacht schacht in schaechte)
|
||||||
|
{
|
||||||
|
WriteContent(new Tuple<uint, uint>(3, 17), schacht.Objektbezeichnung);
|
||||||
|
WriteContent(new Tuple<uint, uint>(19, 28), "ABW"); // Revisionschachtart
|
||||||
|
WriteContent(new Tuple<uint, uint>(30, 39), "K"); // Kanalart
|
||||||
|
WriteContent(new Tuple<uint, uint>(41, 50), "S"); // Entwässerungskennzeichen
|
||||||
|
WriteContent(new Tuple<uint, uint>(52, 61), "IB");
|
||||||
|
WriteContent(new Tuple<uint, uint>(191, 198), schacht.DeckelHoehe.ToString()); // Deckelhöhe
|
||||||
|
WriteContent(new Tuple<uint, uint>(200, 209), "1"); // Status Deckelhöhe
|
||||||
|
WriteContent(new Tuple<uint, uint>(211,218), schacht.SohlHoehe.ToString());
|
||||||
|
WriteContent(new Tuple<uint, uint>(220, 229), "1"); // Status Sohlhöhe
|
||||||
|
// Schachtmittelpunktkoordinaten
|
||||||
|
WriteContent(new Tuple<uint, uint>(293,307), schacht.SohlRechtsWert.ToString());
|
||||||
|
WriteContent(new Tuple<uint, uint>(309, 323), schacht.SohlHochWert.ToString());
|
||||||
|
WriteContent(new Tuple<uint, uint>(325, 334), "1"); // Status Schachtmittelkoordinaten
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,8 +20,8 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
|||||||
WriteContent(new Tuple<uint, uint>(210, 217), schacht.SohlHoehe.ToString());
|
WriteContent(new Tuple<uint, uint>(210, 217), schacht.SohlHoehe.ToString());
|
||||||
WriteContent(new Tuple<uint, uint>(219, 228), "1"); // Status Sohlhöhe
|
WriteContent(new Tuple<uint, uint>(219, 228), "1"); // Status Sohlhöhe
|
||||||
// Schachtmittelpunktkoordinaten
|
// Schachtmittelpunktkoordinaten
|
||||||
WriteContent(new Tuple<uint, uint>(284, 298), schacht.DeckelRechtsWert.ToString());
|
WriteContent(new Tuple<uint, uint>(284, 298), schacht.SohlRechtsWert.ToString());
|
||||||
WriteContent(new Tuple<uint, uint>(300, 314), schacht.DeckelHochWert.ToString());
|
WriteContent(new Tuple<uint, uint>(300, 314), schacht.SohlHochWert.ToString());
|
||||||
WriteContent(new Tuple<uint, uint>(316, 325), "1"); // Status der Schachtmittelpunktkoordinaten
|
WriteContent(new Tuple<uint, uint>(316, 325), "1"); // Status der Schachtmittelpunktkoordinaten
|
||||||
// Deckelkoordinaten
|
// Deckelkoordinaten
|
||||||
WriteContent(new Tuple<uint, uint>(370, 384), schacht.DeckelRechtsWert.ToString());
|
WriteContent(new Tuple<uint, uint>(370, 384), schacht.DeckelRechtsWert.ToString());
|
||||||
|
|||||||
@@ -36,10 +36,20 @@ namespace WWTech_KanalSchnittstelle.Importer
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Schacht> LoadSchaechte(string filename, EEntwaeserung entwaeserung)
|
public List<Schacht> LoadSchaechte(string filename, string vermesser)
|
||||||
{
|
{
|
||||||
List<Schacht> result = new List<Schacht>();
|
List<Schacht> result = new List<Schacht>();
|
||||||
|
|
||||||
|
Dictionary<string, EEntwaeserung> entwaesserungKennung = new Dictionary<string, EEntwaeserung>()
|
||||||
|
{
|
||||||
|
{ "1100", EEntwaeserung.Schmutzwasser },
|
||||||
|
{ "1200", EEntwaeserung.Mischwasser },
|
||||||
|
{ "1300", EEntwaeserung.Regenwasser },
|
||||||
|
{ "3110", EEntwaeserung.Schmutzwasser },
|
||||||
|
{ "3210", EEntwaeserung.Mischwasser },
|
||||||
|
{ "3310", EEntwaeserung.Regenwasser }
|
||||||
|
};
|
||||||
|
|
||||||
if(!File.Exists(filename))
|
if(!File.Exists(filename))
|
||||||
{
|
{
|
||||||
throw new FileNotFoundException(filename);
|
throw new FileNotFoundException(filename);
|
||||||
@@ -80,10 +90,17 @@ namespace WWTech_KanalSchnittstelle.Importer
|
|||||||
schacht.SohlHoehe = parseKoordinate(parsed[3]);
|
schacht.SohlHoehe = parseKoordinate(parsed[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parsed.Length >= 4)
|
||||||
|
{
|
||||||
|
schacht.Entwaesserung = entwaesserungKennung[parsed[4]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
schacht.Entwaesserung = EEntwaeserung.Schmutzwasser;
|
||||||
|
}
|
||||||
schacht.Projekt = projekt;
|
schacht.Projekt = projekt;
|
||||||
schacht.Entwaesserung = entwaeserung;
|
|
||||||
schacht.Vermesser = "Marwede";
|
schacht.Vermesser = vermesser;
|
||||||
schacht.AufnahmeDatum = DateTime.Now.ToShortDateString();
|
schacht.AufnahmeDatum = DateTime.Now.ToShortDateString();
|
||||||
|
|
||||||
if (neueSchacht)
|
if (neueSchacht)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace WWTech_KanalSchnittstelle.Exporter.XML.Tests
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
XML2006 xmloutput = new XML2006();
|
XML2006 xmloutput = new XML2006();
|
||||||
xmloutput.Export("test.xml", EKodierungssystem.EN13508_2_2011, haltungen, schaechte);
|
xmloutput.Export("test.xml", EKodierungssystem.EN13508_2_2011, haltungen, schaechte,null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ namespace WWTech_KanalSchnittstelle.Importer.Tests
|
|||||||
public void LoadSchaechteTest()
|
public void LoadSchaechteTest()
|
||||||
{
|
{
|
||||||
CSVImporter importer = new CSVImporter(1);
|
CSVImporter importer = new CSVImporter(1);
|
||||||
//var s = importer.LoadSchaechte(@"C:\Users\damia\source\repos\Stammdatengenerator\Beispieldaten\Koordinatendatei.csv", SewerStammGen.Shared.Domain.EEntwaeserung.Regenwasser);
|
var s = importer.LoadSchaechte(@"C:\Users\damia\source\repos\Stammdatengenerator\Beispieldaten\Projekt\7200-19_190423_Koord_SW.csv","Marwede");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user