Schnittstelle um logging erweitert
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.Shared.Enum;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
@@ -11,10 +12,10 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
||||
{
|
||||
public class KANDIS60 : IExport
|
||||
{
|
||||
public async Task<bool> Export(string projektname,EKodierungssystem kodierungssystem, List<Kanal> haltungen, List<Schacht> schaechte)
|
||||
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);
|
||||
KANDIS_SCHACHT60 schacht = new KANDIS_SCHACHT60(projektname, schaechte);
|
||||
KANDIS_HALTUNG60 haltung = new KANDIS_HALTUNG60(projektname, haltungen,log);
|
||||
KANDIS_SCHACHT60 schacht = new KANDIS_SCHACHT60(projektname, schaechte,log);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SewerStammGen.Shared.Enum;
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Enum;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -32,11 +33,13 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
||||
|
||||
private StreamWriter sw;
|
||||
char[] zeile;
|
||||
protected IWWLog Logger;
|
||||
|
||||
protected string Zeile => new string(zeile);
|
||||
|
||||
public KANDIS_Exporter(string filename, EExportType exportType, kType kType)
|
||||
public KANDIS_Exporter(string filename, EExportType exportType, kType kType, IWWLog Logger)
|
||||
{
|
||||
this.Logger = Logger;
|
||||
string version = string.Empty;
|
||||
switch (kType)
|
||||
{
|
||||
@@ -104,9 +107,11 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
||||
uint length = (ende+1) - start;
|
||||
if(content.Length > length)
|
||||
{
|
||||
content = content.Substring(0, (int)length);
|
||||
//Debugger.Break();
|
||||
//throw new Exception("Inhalt des Feldes ist zu lang");
|
||||
string newcontent = content.Substring(0,(int)length);
|
||||
Logger.Log(string.Format("Inhalt {0} des Feldes war zu lang. Feld wird auf {1} stellen gekürzt." +
|
||||
"Neue Inhalt lautet: {2}",content,length,newcontent));
|
||||
content = newcontent;
|
||||
|
||||
}
|
||||
|
||||
int counter = 0;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.Shared.Enum;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -10,7 +11,7 @@ namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
||||
{
|
||||
internal class KANDIS_HALTUNG60 : KANDIS_Exporter
|
||||
{
|
||||
public KANDIS_HALTUNG60(string filename, List<Kanal> kanaele) : base(filename+".hal", EExportType.KANDIS6, kType.HALTUNG)
|
||||
public KANDIS_HALTUNG60(string filename, List<Kanal> kanaele, IWWLog log) : base(filename+".hal", EExportType.KANDIS6, kType.HALTUNG,log)
|
||||
{
|
||||
foreach(Kanal haltung in kanaele)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.Shared.Enum;
|
||||
|
||||
namespace WWTech_KanalSchnittstelle.Exporter.Kandis
|
||||
{
|
||||
internal class KANDIS_SCHACHT60 : KANDIS_Exporter
|
||||
{
|
||||
public KANDIS_SCHACHT60(string filename,List<Schacht> schaechte) : base(filename+".sch", EExportType.KANDIS6, kType.SCHACHT)
|
||||
public KANDIS_SCHACHT60(string filename,List<Schacht> schaechte, IWWLog log) : base(filename+".sch", EExportType.KANDIS6, kType.SCHACHT,log)
|
||||
{
|
||||
|
||||
foreach(Schacht schacht in schaechte)
|
||||
|
||||
Reference in New Issue
Block a user