INSTINCT Code Coverage Report


Directory: src/
File: Navigation/Atmosphere/Pressure/Pressure.cpp
Date: 2025-02-07 16:54:41
Exec Total Coverage
Lines: 4 28 14.3%
Functions: 1 3 33.3%
Branches: 1 16 6.2%

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 "Pressure.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(PressureModel pressureModel)
21 {
22 switch (pressureModel)
23 {
24 case PressureModel::None:
25 return "None";
26 case PressureModel::ConstNN:
27 return "Const p0";
28 case PressureModel::ISA:
29 return "ISA";
30 case PressureModel::GPT2:
31 return "GPT2";
32 case PressureModel::GPT3:
33 return "GPT3";
34 case PressureModel::COUNT:
35 break;
36 }
37 return "";
38 }
39
40 bool ComboPressureModel(const char* label, PressureModel& pressureModel)
41 {
42 return gui::widgets::EnumCombo(label, pressureModel);
43 }
44
45 21942 double calcTotalPressure(double altitudeMSL, PressureModel pressureModel)
46 {
47
1/5
✗ Branch 0 not taken.
✓ Branch 1 taken 21942 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
21942 switch (pressureModel)
48 {
49 case PressureModel::ConstNN:
50 return calcTotalPressureStAtm(0);
51 21942 case PressureModel::ISA:
52 21942 return calcTotalPressureStAtm(altitudeMSL);
53 case PressureModel::GPT2:
54 case PressureModel::GPT3:
55 LOG_CRITICAL("GPT2/GPT3 Model needs to be called separately because of parameter lookup.");
56 break;
57 case PressureModel::None:
58 case PressureModel::COUNT:
59 break;
60 }
61
62 return 0.0;
63 }
64
65 } // namespace NAV
66