Skip to content

Commit

Permalink
update driver inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
cheroy-ntia committed Dec 5, 2024
1 parent c433954 commit cbf03b1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/include/Driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion app/include/Structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
7 changes: 6 additions & 1 deletion app/src/LFMFModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Polarization>(i_pol);
} else {
std::cerr << "Unknown parameter: " << key << std::endl;
rtn = DRVRERR__PARSE;
Expand Down
7 changes: 6 additions & 1 deletion include/ITS.Propagation.LFMF/LFMF.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ complex<double> 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
Expand Down
8 changes: 6 additions & 2 deletions src/ValidateInputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cbf03b1

Please sign in to comment.