Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 69c0ce96 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

add check for size of aux demand map

parent 8110490d
No related tags found
No related merge requests found
...@@ -145,11 +145,11 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper ...@@ -145,11 +145,11 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper
retVal.Gears = gears.Select((gear, i) => { retVal.Gears = gears.Select((gear, i) => {
TransmissionLossMap lossMap; TransmissionLossMap lossMap;
if (gear.LossMap != null) if (gear.LossMap != null) {
lossMap = TransmissionLossMap.Create(gear.LossMap, gear.Ratio, string.Format("Gear {0}", i + 1)); lossMap = TransmissionLossMap.Create(gear.LossMap, gear.Ratio, string.Format("Gear {0}", i + 1));
else if (useEfficiencyFallback) } else if (useEfficiencyFallback) {
lossMap = TransmissionLossMap.Create(gear.Efficiency, gear.Ratio, string.Format("Gear {0}", i + 1)); lossMap = TransmissionLossMap.Create(gear.Efficiency, gear.Ratio, string.Format("Gear {0}", i + 1));
else { } else {
throw new InvalidFileFormatException("Gear {0} LossMap or Efficiency missing.", i + 1); throw new InvalidFileFormatException("Gear {0} LossMap or Efficiency missing.", i + 1);
} }
var gearFullLoad = gear.FullLoadCurve != null var gearFullLoad = gear.FullLoadCurve != null
...@@ -185,6 +185,10 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper ...@@ -185,6 +185,10 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper
if (a.DemandMap == null) { if (a.DemandMap == null) {
throw new VectoSimulationException("Demand Map for auxiliary {0} {1} required", a.ID, a.Technology); throw new VectoSimulationException("Demand Map for auxiliary {0} {1} required", a.ID, a.Technology);
} }
if (a.DemandMap.Columns.Count != 3 || a.DemandMap.Rows.Count < 4) {
throw new VectoSimulationException(
"Demand Map for auxiliary {0} {1} has to contain exactly 3 columns and at least 4 rows", a.ID, a.Technology);
}
return new VectoRunData.AuxData { return new VectoRunData.AuxData {
ID = a.ID, ID = a.ID,
Technology = a.Technology, Technology = a.Technology,
......
...@@ -43,6 +43,7 @@ using System.Runtime.InteropServices; ...@@ -43,6 +43,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: Guid("b843f4c2-660b-4a3e-a336-c1f9c20aa993")] [assembly: Guid("b843f4c2-660b-4a3e-a336-c1f9c20aa993")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VectoAPI")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VectoAPI")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VectoEngineeringAPI")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VECTO")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VECTO")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VectoCoreTest")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VectoCoreTest")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VectoAPITest")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VectoAPITest")]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment