From 9a5684f942868bbeadf524b23e7dc54cbc2e846b Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Thu, 3 Nov 2016 13:51:52 +0100
Subject: [PATCH] read & write whtc engineering from/to json files

---
 VECTO/OutputData/JSONFileWriter.vb                        | 1 +
 .../VectoCore/InputData/FileIO/JSON/JSONEngineData.cs     | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/VECTO/OutputData/JSONFileWriter.vb b/VECTO/OutputData/JSONFileWriter.vb
index 1c14097503..cb48367bb7 100644
--- a/VECTO/OutputData/JSONFileWriter.vb
+++ b/VECTO/OutputData/JSONFileWriter.vb
@@ -51,6 +51,7 @@ Public Class JSONFileWriter
 		body.Add("WHTC-Urban", eng.WHTCUrban)
 		body.Add("WHTC-Rural", eng.WHTCRural)
 		body.Add("WHTC-Motorway", eng.WHTCMotorway)
+		body.Add("WHTC-Engineering", eng.WHTCEngineering)
 		body.Add("ColdHotBalancingFactor", eng.ColdHotBalancingFactor)
 
 		WriteFile(header, body, filename)
diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs
index a5262b4ca3..07e3a0f824 100644
--- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs
+++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs
@@ -99,7 +99,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
 
 		public virtual double WHTCEngineering
 		{
-			get { return 1; }
+			get
+			{
+				if (Body["WHTC-Engineering"] == null) {
+					return 1;
+				}
+				return Body.GetEx<double>("WHTC-Engineering");
+			}
 		}
 
 		public virtual double WHTCMotorway
-- 
GitLab