From 3f01f52870e56711a1a69ec282fe30a729ca8ebf Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <quaritsch@ivt.tugraz.at>
Date: Wed, 8 Feb 2023 16:08:14 +0100
Subject: [PATCH] battery form: save/load new input parameter

---
 VECTO/GUI/BatteryForm.vb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/VECTO/GUI/BatteryForm.vb b/VECTO/GUI/BatteryForm.vb
index d9165edf34..d7e065ff66 100644
--- a/VECTO/GUI/BatteryForm.vb
+++ b/VECTO/GUI/BatteryForm.vb
@@ -195,6 +195,9 @@ Public Class BatteryForm
             tbMaxCurrentMap.Text = GetRelativePath(battery.MaxCurrentMap.Source, basePath)
             tbSoCCurve.Text = GetRelativePath(battery.VoltageCurve.Source, basePath)
             tbRiCurve.Text = GetRelativePath(battery.InternalResistanceCurve.Source, basePath)
+            tbTestingTempB.Text = battery.TestingTemperature.AsDegCelsius.ToGUIFormat()
+            cbJunctionBoxIncl.Checked = battery.JunctionboxIncluded
+            cbConnectorsIncluded.Checked = battery.ConnectorsSubsystemsIncluded
 
             tbSuperCapCapacity.Text = String.Empty
             tbSuperCapMaxV.Text = string.Empty
@@ -219,6 +222,7 @@ Public Class BatteryForm
             tbSuperCapMaxV.Text = superCap.MaxVoltage.ToGUIFormat()
             tbSuperCapMinV.Text= superCap.MinVoltage.ToGUIFormat()
             tbSuperCapRi.Text= superCap.InternalResistance.ToGUIFormat()
+            tbTestingTempC.Text = superCap.TestingTemperature.AsDegCelsius.ToGUIFormat()
 
             tbSuperCapMaxCurrentCharge.Text = superCap.MaxCurrentCharge.ToGuiFormat()
             tbSuperCapMaxCurrentDischarge.Text = superCap.MaxCurrentDischarge.ToGuiFormat()
@@ -302,6 +306,7 @@ Public Class BatteryForm
 
         superCap.MaxChgCurrent = tbSuperCapMaxCurrentCharge.Text.ToDouble(0)
         superCap.MaxDischgCurrent = tbSuperCapMaxCurrentDischarge.Text.ToDouble(0)
+        superCap.TestingTemperature = tbTestingTempC.Text.ToDouble(20).DegCelsiusToKelvin()
         Return superCap
     End Function
 
@@ -321,6 +326,9 @@ Public Class BatteryForm
         battery.BatMaxSoc = tbSoCMax.Text.ToDouble(0)
 
         battery.PathMaxCurrentCurve = tbMaxCurrentMap.Text
+        battery.JunctionboxIncluded = cbJunctionBoxIncl.Checked
+        battery.ConnectorsSubsystemsIncluded = cbConnectorsIncluded.Checked
+        battery.TestingTemperature = tbTestingTempB.Text.ToDouble(20).DegCelsiusToKelvin()
         Return battery
     End Function
     Private Sub tbCapacity_Leave(sender As Object, e As System.EventArgs) Handles tbCapacity.Leave
-- 
GitLab