INSTINCT Code Coverage Report


Directory: src/
File: Navigation/Atmosphere/WaterVapor/WaterVapor.cpp
Date: 2025-02-07 16:54:41
Exec Total Coverage
Lines: 4 26 15.4%
Functions: 1 3 33.3%
Branches: 1 14 7.1%

Line Branch Exec Source
1 /// This file is part of INSTINCT, the INS Toolkit for Integrated
2 /// Navigation Concepts and Training by the Institute of Navigation of
3 /// the University of Stuttgart, Germany.
4 ///
5 /// This Source Code Form is subject to the terms of the Mozilla Public
6 /// License, v. 2.0. If a copy of the MPL was not distributed with this
7 /// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9 #include "WaterVapor.hpp"
10
11 #include "internal/gui/widgets/EnumCombo.hpp"
12 #include "util/Logger.hpp"
13 #include "util/Assert.h"
14
15 #include "Models/StandardAtmosphere.hpp"
16
17 namespace NAV
18 {
19
20 const char* to_string(WaterVaporModel waterVaporModel)
21 {
22 switch (waterVaporModel)
23 {
24 case WaterVaporModel::None:
25 return "None";
26 case WaterVaporModel::ISA:
27 return "ISA";
28 case WaterVaporModel::GPT2:
29 return "GPT2";
30 case WaterVaporModel::GPT3:
31 return "GPT3";
32 case WaterVaporModel::COUNT:
33 break;
34 }
35 return "";
36 }
37
38 bool ComboWaterVaporModel(const char* label, WaterVaporModel& waterVaporModel)
39 {
40 return gui::widgets::EnumCombo(label, waterVaporModel);
41 }
42
43 21942 double calcWaterVaporPartialPressure(double temp, double humidity_rel, WaterVaporModel waterVaporModel)
44 {
45
1/4
✓ Branch 0 taken 21942 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
21942 switch (waterVaporModel)
46 {
47 21942 case WaterVaporModel::ISA:
48 21942 return calcWaterVaporPartialPressureStAtm(temp, humidity_rel);
49 case WaterVaporModel::GPT2:
50 case WaterVaporModel::GPT3:
51 INS_ASSERT_USER_ERROR(waterVaporModel != WaterVaporModel::GPT2, "GPT2 Model needs to be called separately because of parameter lookup.");
52 INS_ASSERT_USER_ERROR(waterVaporModel != WaterVaporModel::GPT3, "GPT3 Model needs to be called separately because of parameter lookup.");
53 break;
54 case WaterVaporModel::None:
55 case WaterVaporModel::COUNT:
56 break;
57 }
58
59 return 0.0;
60 }
61
62 } // namespace NAV
63