diff --git a/app/include/Driver.h b/app/include/Driver.h index 6f57db9..a2f0dc5 100644 --- a/app/include/Driver.h +++ b/app/include/Driver.h @@ -18,10 +18,10 @@ #include "CommaSeparatedIterator.h" #include "DriverConfig.h" #include "ReturnCodes.h" -#include "Structs.h" -#include "ITS.Propagation.LFMF/LFMF.h" +#include "ITS.Propagation.LFMF/LFMF.h" +#include "Structs.h" ///////////////////////////// // Macros diff --git a/app/include/Structs.h b/app/include/Structs.h index 48c4c06..d47a000 100644 --- a/app/include/Structs.h +++ b/app/include/Structs.h @@ -23,7 +23,8 @@ struct LFMFParams { double d__km; ///< Path distance, in km double epsilon; ///< Relative permittivity double sigma; ///< Conductivity - int pol; ///< Polarization: 0 = Horizontal, 1 = Vertical + ITS::Propagation::LFMF::Polarization + pol; ///< Polarization: 0 = Horizontal, 1 = Vertical }; /** Key names for LFMF Model input file parameters */ diff --git a/app/src/LFMFModel.cpp b/app/src/LFMFModel.cpp index aa6a926..5acb775 100644 --- a/app/src/LFMFModel.cpp +++ b/app/src/LFMFModel.cpp @@ -86,9 +86,14 @@ DrvrReturnCode ParseLFMFInputStream(std::istream &stream, LFMFParams &lfmf_param if (rtn == DRVRERR__PARSE) rtn = DRVRERR__PARSE_SIGMA; } else if (key.compare(LFMFInputKeys::pol) == 0) { - rtn = ParseInteger(value, lfmf_params.pol); + int i_pol; + rtn = ParseInteger( + value, i_pol + ); if (rtn == DRVRERR__PARSE) rtn = DRVRERR__PARSE_POLARIZATION; + else + lfmf_params.pol = static_cast(i_pol); } else { std::cerr << "Unknown parameter: " << key << std::endl; rtn = DRVRERR__PARSE; diff --git a/include/ITS.Propagation.LFMF/LFMF.h b/include/ITS.Propagation.LFMF/LFMF.h index 1dfd9e8..975e857 100644 --- a/include/ITS.Propagation.LFMF/LFMF.h +++ b/include/ITS.Propagation.LFMF/LFMF.h @@ -138,7 +138,12 @@ complex WiRoot( AiryFunctionScaling scaling ); ReturnCode ValidateInput(double h_tx__meter, double h_rx__meter, double f__mhz, double P_tx__watt, - double N_s, double d__km, double epsilon, double sigma, int pol); + double N_s, + double d__km, + double epsilon, + double sigma, + Polarization pol +); bool AlmostEqualRelative(double A, double B, double maxRelDiff = DBL_EPSILON); } // namespace LFMF diff --git a/src/ValidateInputs.cpp b/src/ValidateInputs.cpp index befc082..578b384 100644 --- a/src/ValidateInputs.cpp +++ b/src/ValidateInputs.cpp @@ -28,8 +28,12 @@ namespace LFMF { * *****************************************************************************/ ReturnCode ValidateInput(double h_tx__meter, double h_rx__meter, double f__mhz, double P_tx__watt, - double N_s, double d__km, double epsilon, double sigma, int pol) -{ + double N_s, + double d__km, + double epsilon, + double sigma, + Polarization pol +) { if (h_tx__meter < 0 || h_tx__meter > 50) return ERROR__TX_TERMINAL_HEIGHT;