The current XML antenna pattern import is unintuitive and prone to crashes because it requires non-standard data formats. It currently expects:
- Linear Gain (non-negative) instead of the industry-standard dBi.
- Radians instead of Degrees.
- Absolute angles (assuming symmetry) instead of the full -π to π range.
The Problem
- Crashes: Because the code expects linear gain, users providing dBi values (which are often negative) trigger division-by-zero errors or floating-point exceptions during the normalization process in
XmlAntenna::loadAntennaDescription.
- Usability: Users must manually convert their antenna data from standard datasheets (dBi/degrees) to the internal format (linear/radians), which is tedious and error-prone.
- Flexibility: The assumption of symmetry prevents the modeling of asymmetrical antenna patterns.
Proposed Solution
- Update XML Schema: Allow optional attributes on
<azimuth> and <elevation> tags to specify units (e.g., unit="deg", format="dBi").
- Internal Conversion: Update
XmlAntenna::loadAntennaDescription to handle these conversions internally if the attributes are present, maintaining backward compatibility if they are missing.
- Support Asymmetry: Remove the
std::abs() call in XmlAntenna::getGain to allow for full-range (-π to π) asymmetrical pattern definitions.
This would significantly improve the user experience and prevent common import crashes.
The current XML antenna pattern import is unintuitive and prone to crashes because it requires non-standard data formats. It currently expects:
The Problem
XmlAntenna::loadAntennaDescription.Proposed Solution
<azimuth>and<elevation>tags to specify units (e.g.,unit="deg",format="dBi").XmlAntenna::loadAntennaDescriptionto handle these conversions internally if the attributes are present, maintaining backward compatibility if they are missing.std::abs()call inXmlAntenna::getGainto allow for full-range (-π to π) asymmetrical pattern definitions.This would significantly improve the user experience and prevent common import crashes.