ITS.ITU.PSeries.P2108 1.0
Part of the NTIA/ITS Propagation Library
Loading...
Searching...
No Matches
Driver.h
Go to the documentation of this file.
1
4#pragma once
5
7#include "P2108.h"
8#include "ReturnCodes.h"
9#include "Structs.h"
10
11#include <fstream> // for std::ofstream
12#include <iomanip> // for std::left, std::setw
13#include <iostream> // for std::cout
14#include <ostream> // for std::endl, std::ostream
15#include <string> // for std::string
16#include <vector> // for std::vector
17
19// Macros
20
22#define PRINT << std::endl << std::left << std::setw(25) <<
24#define SETW13 << std::setw(13) <<
25
27// Library Namespace
28using namespace ITS::ITU::PSeries::P2108;
29
31// Functions
32void Help(std::ostream &os = std::cout);
33DrvrReturnCode ParseArguments(int argc, char **argv, DrvrParams &params);
35
36// Aeronautical Statistical Model
38 ASMParams &asm_params, std::vector<double> &L_ces__db
39);
41 ParseASMInputFile(const std::string &in_file, ASMParams &asm_params);
42DrvrReturnCode ParseASMInputStream(std::istream &stream, ASMParams &asm_params);
43void WriteASMInputs(std::ofstream &fp, const ASMParams &params);
44
45// Height Gain Terminal Correction Model
47 HGTCMParams &hgtcm_params, std::vector<double> &A_h__db
48);
50 ParseHGTCMInputFile(const std::string &in_file, HGTCMParams &hgtcm_params);
52 ParseHGTCMInputStream(std::istream &stream, HGTCMParams &hgtcm_params);
53void WriteHGTCMInputs(std::ofstream &fp, const HGTCMParams &params);
54
55// Terrestrial Statistical Model
57 TSMParams &tsm_params, std::vector<double> &L_ctt__db
58);
60 ParseTSMInputFile(const std::string &in_file, TSMParams &tsm_params);
61DrvrReturnCode ParseTSMInputStream(std::istream &stream, TSMParams &tsm_params);
62void WriteTSMInputs(std::ofstream &fp, const TSMParams &params);
63
64// Reporting
65void PrintClutterTypeLabel(std::ofstream &fp, const ClutterType clutter_type);
66
67// Driver Utils
68std::string GetDatetimeString();
69DrvrReturnCode ParseBoolean(const std::string &str, bool &value);
70DrvrReturnCode ParseDouble(const std::string &str, double &value);
71DrvrReturnCode ParseInteger(const std::string &str, int &value);
72void PrintLabel(std::ostream &os, const std::string &lbl);
73void StringToLower(std::string &str);
74void Version(std::ostream &os = std::cout);
Iterator class for reading comma-delimited input text streams.
DrvrReturnCode ParseASMInputStream(std::istream &stream, ASMParams &asm_params)
Parse input stream (file or string stream) to ASM parameter struct.
Definition AeronauticalStatisticalModel.cpp:47
DrvrReturnCode ValidateInputs(const DrvrParams &params)
Validate that required inputs are present for the mode specified by the user.
Definition Driver.cpp:237
ReturnCode CallHeightGainTerminalCorrectionModel(HGTCMParams &hgtcm_params, std::vector< double > &A_h__db)
Top-level control function for Height Gain Terminal Correction Model.
Definition HeightGainTerminalCorrectionModel.cpp:28
std::string GetDatetimeString()
Get a string containing the current date and time information.
Definition DriverUtils.cpp:30
void WriteTSMInputs(std::ofstream &fp, const TSMParams &params)
Write Terrestrial Statistical Model inputs to the report file.
Definition TerrestrialStatisticalModel.cpp:102
DrvrReturnCode ParseDouble(const std::string &str, double &value)
Parse a double value read from the input parameter file.
Definition DriverUtils.cpp:82
void PrintLabel(std::ostream &os, const std::string &lbl)
Helper function to standardize printing of text labels to file.
Definition DriverUtils.cpp:123
DrvrReturnCode ParseInteger(const std::string &str, int &value)
Parse an integer value read from the input parameter file.
Definition DriverUtils.cpp:100
void WriteHGTCMInputs(std::ofstream &fp, const HGTCMParams &params)
Write Height Gain Terminal Correction Model inputs to the report file.
Definition HeightGainTerminalCorrectionModel.cpp:122
DrvrReturnCode ParseHGTCMInputStream(std::istream &stream, HGTCMParams &hgtcm_params)
Parse input stream (file or string stream) to HGTCM parameter struct.
Definition HeightGainTerminalCorrectionModel.cpp:54
ReturnCode CallAeronauticalStatisticalModel(ASMParams &asm_params, std::vector< double > &L_ces__db)
Top-level control function for Aeronautical Statistical Model operation.
Definition AeronauticalStatisticalModel.cpp:26
void Help(std::ostream &os=std::cout)
Print help instructions to the terminal.
Definition Driver.cpp:211
DrvrReturnCode ParseBoolean(const std::string &str, bool &value)
Parse a boolean value read from the input parameter file.
Definition DriverUtils.cpp:58
DrvrReturnCode ParseTSMInputFile(const std::string &in_file, TSMParams &tsm_params)
Parse Terrestrial Statistical Model input parameter file.
Definition TerrestrialStatisticalModel.cpp:87
DrvrReturnCode ParseHGTCMInputFile(const std::string &in_file, HGTCMParams &hgtcm_params)
Parse Height Gain Terminal Correction Model input parameter file.
Definition HeightGainTerminalCorrectionModel.cpp:107
void Version(std::ostream &os=std::cout)
Print version information to the specified output stream.
Definition DriverUtils.cpp:144
void PrintClutterTypeLabel(std::ofstream &fp, const ClutterType clutter_type)
Print text message corresponding to clutter type enum value.
Definition Reporting.cpp:15
void StringToLower(std::string &str)
Convert a string to lowercase.
Definition DriverUtils.cpp:133
DrvrReturnCode ParseArguments(int argc, char **argv, DrvrParams &params)
Parse the command line arguments.
Definition Driver.cpp:150
ReturnCode CallTerrestrialStatisticalModel(TSMParams &tsm_params, std::vector< double > &L_ctt__db)
Top-level control function for Terrestrial Statistical Model operation.
Definition TerrestrialStatisticalModel.cpp:26
void WriteASMInputs(std::ofstream &fp, const ASMParams &params)
Write Aeronautical Statistical Model inputs to the report file.
Definition AeronauticalStatisticalModel.cpp:102
DrvrReturnCode ParseASMInputFile(const std::string &in_file, ASMParams &asm_params)
Parse Aeronautical Statistical Model input parameter file.
Definition AeronauticalStatisticalModel.cpp:87
DrvrReturnCode ParseTSMInputStream(std::istream &stream, TSMParams &tsm_params)
Parse input stream (file or string stream) to TSM parameter struct.
Definition TerrestrialStatisticalModel.cpp:47
Interface header for this library.
ClutterType
Clutter type enum, based on Table 3 in Section 3.1.
Definition P2108.h:29
ReturnCode
Return Codes defined by this software (0-127)
Definition P2108.h:58
Defines return codes for the driver.
DrvrReturnCode
Return Codes defined by this driver software (128-255)
Definition ReturnCodes.h:12
Contains data structures and type macros used by this software.
Input parameters for the Aeronautical Statistical Model.
Definition Structs.h:65
Parameters provided to the command line driver.
Definition Structs.h:24
Input parameters for the Height Gain Terminal Correction Model.
Definition Structs.h:31
Input parameters for the Terrestrial Statistical Model.
Definition Structs.h:51
Privacy Policy FOIA Accessibility Information Quality