|
FERS 0.1.0
The Flexible Extensible Radar Simulator
|
Classes | |
| struct | AssetLoaders |
| Container for functions that load external file-backed assets. More... | |
| struct | ParserContext |
| Encapsulates the state required during the XML parsing process. More... | |
| struct | ReferenceLookup |
| Holds maps to resolve string names to internal SimId references during XML parsing. More... | |
| bool serial::xml_parser_utils::addIncludeFilesToMainDocument | ( | const XmlDocument & | mainDoc, |
| const fs::path & | currentDir | ||
| ) |
Definition at line 1362 of file xml_parser_utils.cpp.
References collectIncludeElements(), max, mergeXmlDocuments(), and removeIncludeElements().
Referenced by serial::parseSimulation().
Here is the call graph for this function:
Here is the caller graph for this function:| bool serial::xml_parser_utils::addIncludeFilesToMainDocument | ( | const XmlDocument & | mainDoc, |
| const std::filesystem::path & | currentDir | ||
| ) |
Resolves and merges all <include> files directly into the provided main document.
| mainDoc | The primary XML document that will be mutated. |
| currentDir | The base directory used to resolve include paths. |
| SimId serial::xml_parser_utils::assign_id_from_attribute | ( | const std::string & | owner, |
| ObjectType | type | ||
| ) |
Generates a unique SimId based on the requested object type.
| owner | The name/description of the object requesting the ID (used for logging). |
| type | The category/type of the object. |
Definition at line 349 of file xml_parser_utils.cpp.
References SimIdGenerator::generateId(), SimIdGenerator::instance(), LOG, max, and logging::TRACE.
Referenced by parseAntenna(), parsePlatform(), parseReceiverWithMode(), parseTarget(), parseTiming(), parseTransmitterWithMode(), and parseWaveform().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::collectIncludeElements | ( | const XmlDocument & | doc, |
| const fs::path & | currentDir, | ||
| std::vector< fs::path > & | includePaths | ||
| ) |
Definition at line 1332 of file xml_parser_utils.cpp.
References collectIncludeElements(), logging::ERROR, LOG, and max.
Referenced by addIncludeFilesToMainDocument(), and collectIncludeElements().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::collectIncludeElements | ( | const XmlDocument & | doc, |
| const std::filesystem::path & | currentDir, | ||
| std::vector< std::filesystem::path > & | includePaths | ||
| ) |
Recursively finds all <include> tags in a document and resolves their absolute paths.
| doc | The XML document to search. |
| currentDir | The base directory for resolving relative paths. |
| includePaths | A vector populated with the absolute paths of included files. |
| AssetLoaders serial::xml_parser_utils::createDefaultAssetLoaders | ( | ) |
Creates an AssetLoaders struct populated with standard file-I/O implementations.
Provides the default hooks to load actual HDF5, XML, and binary waveform files from the filesystem into the simulation environment.
AssetLoaders instance with standard file handlers attached. Definition at line 1504 of file xml_parser_utils.cpp.
References radar::createFileTarget(), serial::xml_parser_utils::AssetLoaders::loadWaveform, serial::loadWaveformFromFile(), and max.
Referenced by serial::parseSimulation(), and serial::parseSimulationFromString().
Here is the call graph for this function:
Here is the caller graph for this function:| bool serial::xml_parser_utils::get_attribute_bool | ( | const XmlElement & | element, |
| const std::string & | attributeName, | ||
| bool | defaultVal | ||
| ) |
Extracts a boolean value from a named attribute.
| element | The XML element containing the attribute. |
| attributeName | The name of the attribute. |
| defaultVal | The value to return if the attribute is missing or invalid. |
Definition at line 327 of file xml_parser_utils.cpp.
References logging::DEBUG, XmlElement::getOptionalAttribute(), LOG, max, and logging::WARNING.
Referenced by parseReceiverWithMode(), and parseTiming().
Here is the call graph for this function:
Here is the caller graph for this function:| RealType serial::xml_parser_utils::get_child_real_type | ( | const XmlElement & | element, |
| const std::string & | elementName | ||
| ) |
Extracts a floating-point (RealType) value from a named child element.
| element | The parent XML element. |
| elementName | The name of the child element to extract text from. |
| XmlException | if the child element is missing or empty. |
Definition at line 317 of file xml_parser_utils.cpp.
References max.
Referenced by parseAntenna(), parseFixedRotation(), parseMotionPath(), parseOptionalNumericParameters(), parseParameters(), parseReceiverWithMode(), parseRotationPath(), parseTarget(), parseTiming(), parseTransmitterWithMode(), parseWaveform(), setOptionalRealParameter(), and setOptionalUnsignedParameter().
Here is the caller graph for this function:| void serial::xml_parser_utils::parseAntenna | ( | const XmlElement & | antenna, |
| ParserContext & | ctx | ||
| ) |
Parses an <antenna> block and adds it to the World.
| antenna | The <antenna> XML element. |
| ctx | The current parser context. |
Definition at line 792 of file xml_parser_utils.cpp.
References Antenna, assign_id_from_attribute(), logging::DEBUG, logging::FATAL, get_child_real_type(), XmlElement::getSafeAttribute(), LOG, max, and logging::WARNING.
Referenced by processParsedDocument().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseCoordinateSystemParameter | ( | const XmlElement & | parameters, |
| params::Parameters & | params_out, | ||
| const bool | origin_set | ||
| ) |
Definition at line 569 of file xml_parser_utils.cpp.
References XmlElement::childElement(), params::ECEF, params::ENU, XmlElement::getSafeAttribute(), logging::INFO, LOG, max, parseUtmCoordinateSystem(), and logging::WARNING.
Referenced by parseParameters().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseFixedRotation | ( | const XmlElement & | rotation, |
| radar::Platform * | platform, | ||
| params::RotationAngleUnit | unit | ||
| ) |
Parses a <fixedrotation> block and attaches it to a Platform.
| rotation | The <fixedrotation> XML element. |
| platform | The platform to modify. |
Definition at line 985 of file xml_parser_utils.cpp.
References serial::rotation_warning_utils::Angle, logging::DEBUG, serial::rotation_angle_utils::external_rotation_rate_to_internal(), serial::rotation_angle_utils::external_rotation_to_internal(), logging::FATAL, get_child_real_type(), LOG, max, serial::rotation_warning_utils::maybe_warn_about_rotation_value(), serial::rotation_warning_utils::Rate, and math::RotationPath::setConstantRate().
Referenced by parsePlatform().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseMonostatic | ( | const XmlElement & | monostatic, |
| radar::Platform * | platform, | ||
| ParserContext & | ctx, | ||
| const ReferenceLookup & | refs | ||
| ) |
Parses a <monostatic> block, creating a linked transmitter and receiver pair.
| monostatic | The <monostatic> XML element. |
| platform | The platform this radar belongs to. |
| ctx | The current parser context. |
| refs | Lookup tables for resolving references. |
Definition at line 1187 of file xml_parser_utils.cpp.
References XmlElement::getSafeAttribute(), max, parseReceiverWithMode(), and parseTransmitterWithMode().
Referenced by parsePlatformElements().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseMotionPath | ( | const XmlElement & | motionPath, |
| radar::Platform * | platform | ||
| ) |
Parses a <motionpath> block and attaches it to a Platform.
| motionPath | The <motionpath> XML element. |
| platform | The platform to modify. |
Definition at line 857 of file xml_parser_utils.cpp.
References math::Path::addCoord(), logging::DEBUG, logging::ERROR, math::Path::finalize(), get_child_real_type(), XmlElement::getOptionalAttribute(), math::Path::INTERP_CUBIC, math::Path::INTERP_LINEAR, math::Path::INTERP_STATIC, LOG, max, math::Path::setInterp(), and logging::TRACE.
Referenced by parsePlatform().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseOptionalNumericParameters | ( | const XmlElement & | parameters, |
| params::Parameters & | params_out | ||
| ) |
Definition at line 449 of file xml_parser_utils.cpp.
References XmlElement::childElement(), logging::DEBUG, params::Parameters::DEFAULT_C, get_child_real_type(), logging::INFO, XmlElement::isValid(), LOG, max, parseUnsignedParameter(), setOptionalRealParameter(), setOptionalUnsignedParameter(), and params::validateOversampleRatio().
Referenced by parseParameters().
Here is the call graph for this function:
Here is the caller graph for this function:| bool serial::xml_parser_utils::parseOriginParameter | ( | const XmlElement & | parameters, |
| params::Parameters & | params_out | ||
| ) |
Definition at line 510 of file xml_parser_utils.cpp.
References XmlElement::childElement(), logging::DEBUG, XmlElement::getOptionalAttribute(), XmlElement::getSafeAttribute(), logging::INFO, LOG, max, and logging::WARNING.
Referenced by parseParameters().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseParameters | ( | const XmlElement & | parameters, |
| params::Parameters & | params_out | ||
| ) |
Parses the <parameters> block into the isolated context parameters.
| parameters | The <parameters> XML element. |
| params_out | The Parameters struct to mutate with parsed values. |
Definition at line 612 of file xml_parser_utils.cpp.
References logging::DEBUG, get_child_real_type(), logging::INFO, LOG, max, parseCoordinateSystemParameter(), parseOptionalNumericParameters(), parseOriginParameter(), and parseRotationAngleUnit().
Referenced by processParsedDocument().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parsePlatform | ( | const XmlElement & | platform, |
| ParserContext & | ctx, | ||
| const std::function< void(const XmlElement &, std::string_view)> & | register_name, | ||
| const ReferenceLookup & | refs | ||
| ) |
Parses a complete <platform> block, including its motion paths and sub-elements.
| platform | The <platform> XML element. |
| ctx | The current parser context. |
| register_name | Callback used to ensure unique naming. |
| refs | Lookup tables for resolving references. |
Definition at line 1295 of file xml_parser_utils.cpp.
References assign_id_from_attribute(), logging::ERROR, XmlElement::getSafeAttribute(), LOG, max, parseFixedRotation(), parseMotionPath(), parsePlatformElements(), parseRotationPath(), and Platform.
Referenced by processParsedDocument().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parsePlatformElements | ( | const XmlElement & | platform, |
| ParserContext & | ctx, | ||
| radar::Platform * | plat, | ||
| const std::function< void(const XmlElement &, std::string_view)> & | register_name, | ||
| const ReferenceLookup & | refs | ||
| ) |
Iterates and parses all children elements (radars, targets) of a platform.
| platform | The <platform> XML element. |
| ctx | The current parser context. |
| plat | The Platform object to attach parsed elements to. |
| register_name | Callback used to ensure unique naming globally across parsed objects. |
| refs | Lookup tables for resolving references. |
Definition at line 1259 of file xml_parser_utils.cpp.
References max, parseMonostatic(), parseReceiver(), parseTarget(), and parseTransmitter().
Referenced by parsePlatform().
Here is the call graph for this function:
Here is the caller graph for this function:| radar::Receiver * serial::xml_parser_utils::parseReceiver | ( | const XmlElement & | receiver, |
| radar::Platform * | platform, | ||
| ParserContext & | ctx, | ||
| const ReferenceLookup & | refs | ||
| ) |
Parses a <receiver> block, resolves its dependencies, and adds it to the World.
| receiver | The <receiver> XML element. |
| platform | The platform this receiver belongs to. |
| ctx | The current parser context. |
| refs | Lookup tables for resolving antenna and timing references. |
Definition at line 1179 of file xml_parser_utils.cpp.
References XmlElement::getSafeAttribute(), max, parseReceiverWithMode(), and receiver.
Referenced by parsePlatformElements().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Parses a receiver after its operation mode has already been determined.
Definition at line 1092 of file xml_parser_utils.cpp.
References assign_id_from_attribute(), logging::DEBUG, radar::Receiver::FLAG_NODIRECT, radar::Receiver::FLAG_NOPROPLOSS, get_attribute_bool(), get_child_real_type(), XmlElement::getSafeAttribute(), LOG, max, parseSchedule(), radar::PULSED_MODE, Receiver, receiver, resolve_reference_id(), and logging::WARNING.
Referenced by parseMonostatic(), and parseReceiver().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseRotationAngleUnit | ( | const XmlElement & | parameters, |
| params::Parameters & | params_out | ||
| ) |
Definition at line 488 of file xml_parser_utils.cpp.
References XmlElement::childElement(), XmlElement::getText(), max, and params::rotationAngleUnitFromToken().
Referenced by parseParameters().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseRotationPath | ( | const XmlElement & | rotation, |
| radar::Platform * | platform, | ||
| params::RotationAngleUnit | unit | ||
| ) |
Parses a <rotationpath> block and attaches it to a Platform.
| rotation | The <rotationpath> XML element. |
| platform | The platform to modify. |
Definition at line 918 of file xml_parser_utils.cpp.
References math::RotationPath::addCoord(), serial::rotation_warning_utils::Angle, logging::ERROR, serial::rotation_angle_utils::external_rotation_to_internal(), math::RotationPath::finalize(), get_child_real_type(), XmlElement::getSafeAttribute(), math::RotationPath::INTERP_CUBIC, math::RotationPath::INTERP_LINEAR, math::RotationPath::INTERP_STATIC, LOG, max, serial::rotation_warning_utils::maybe_warn_about_rotation_value(), math::RotationPath::setInterp(), and logging::TRACE.
Referenced by parsePlatform().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< radar::SchedulePeriod > serial::xml_parser_utils::parseSchedule | ( | const XmlElement & | parent, |
| const std::string & | parentName, | ||
| bool | isPulsed, | ||
| RealType | pri = 0.0 |
||
| ) |
Parses a schedule (active periods) for a transmitter or receiver.
| parent | The parent XML element that might contain a <schedule> block. |
| parentName | Name of the parent for error logging. |
| isPulsed | True if the owning object operates in pulsed mode (used for PRI validation). |
| pri | The pulse repetition interval, if applicable. |
SchedulePeriod objects. Definition at line 372 of file xml_parser_utils.cpp.
References XmlElement::getSafeAttribute(), LOG, max, radar::processRawSchedule(), and logging::WARNING.
Referenced by parseReceiverWithMode(), and parseTransmitterWithMode().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseTarget | ( | const XmlElement & | target, |
| radar::Platform * | platform, | ||
| ParserContext & | ctx | ||
| ) |
Parses a <target> block and adds it to the World.
| target | The <target> XML element. |
| platform | The platform this target belongs to. |
| ctx | The current parser context. |
Definition at line 1207 of file xml_parser_utils.cpp.
References assign_id_from_attribute(), radar::createIsoTarget(), logging::DEBUG, get_child_real_type(), XmlElement::getSafeAttribute(), LOG, max, and Target.
Referenced by parsePlatformElements().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseTiming | ( | const XmlElement & | timing, |
| ParserContext & | ctx | ||
| ) |
Parses a <timing> block and adds the prototype timing to the World.
| timing | The <timing> XML element. |
| ctx | The current parser context. |
Definition at line 735 of file xml_parser_utils.cpp.
References assign_id_from_attribute(), logging::DEBUG, get_attribute_bool(), get_child_real_type(), XmlElement::getSafeAttribute(), LOG, max, Timing, and logging::WARNING.
Referenced by processParsedDocument().
Here is the call graph for this function:
Here is the caller graph for this function:| radar::Transmitter * serial::xml_parser_utils::parseTransmitter | ( | const XmlElement & | transmitter, |
| radar::Platform * | platform, | ||
| ParserContext & | ctx, | ||
| const ReferenceLookup & | refs | ||
| ) |
Parses a <transmitter> block, resolves its dependencies, and adds it to the World.
| transmitter | The <transmitter> XML element. |
| platform | The platform this transmitter belongs to. |
| ctx | The current parser context. |
| refs | Lookup tables for resolving waveform, antenna, and timing references. |
Definition at line 1078 of file xml_parser_utils.cpp.
References XmlElement::getSafeAttribute(), max, parseTransmitterWithMode(), and transmitter.
Referenced by parsePlatformElements().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Parses a transmitter after its operation mode has already been determined.
Definition at line 1021 of file xml_parser_utils.cpp.
References assign_id_from_attribute(), get_child_real_type(), XmlElement::getSafeAttribute(), max, parseSchedule(), radar::PULSED_MODE, resolve_reference_id(), Transmitter, and transmitter.
Referenced by parseMonostatic(), and parseTransmitter().
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned serial::xml_parser_utils::parseUnsignedParameter | ( | const std::string_view | param_name, |
| const RealType | raw_value | ||
| ) |
Definition at line 401 of file xml_parser_utils.cpp.
References max.
Referenced by parseOptionalNumericParameters(), and setOptionalUnsignedParameter().
Here is the caller graph for this function:| void serial::xml_parser_utils::parseUtmCoordinateSystem | ( | const XmlElement & | cs_element, |
| params::Parameters & | params_out | ||
| ) |
Definition at line 541 of file xml_parser_utils.cpp.
References XmlElement::getSafeAttribute(), logging::INFO, LOG, max, and params::UTM.
Referenced by parseCoordinateSystemParameter().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::parseWaveform | ( | const XmlElement & | waveform, |
| ParserContext & | ctx | ||
| ) |
Parses a <waveform> block and adds it to the World.
| waveform | The <waveform> XML element. |
| ctx | The current parser context. |
Definition at line 632 of file xml_parser_utils.cpp.
References assign_id_from_attribute(), XmlElement::childElement(), logging::FATAL, get_child_real_type(), XmlElement::getSafeAttribute(), XmlElement::isValid(), LOG, max, fers_signal::parseFmcwChirpDirection(), and Waveform.
Referenced by processParsedDocument().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::processParsedDocument | ( | const XmlDocument & | doc, |
| ParserContext & | ctx | ||
| ) |
Coordinates the full parsing of a validated XML document tree.
This is the root parsing function that iterates over parameters, waveforms, timings, antennas, and platforms. It populates the World in the proper order and triggers initial event scheduling.
| doc | The parsed XML document tree. |
| ctx | The parser context containing the World, isolated parameters, and asset loaders. |
Definition at line 1402 of file xml_parser_utils.cpp.
References c, logging::DEBUG, XmlElement::getSafeAttribute(), logging::INFO, LOG, max, params::params, parseAntenna(), parseParameters(), parsePlatform(), parseTiming(), parseWaveform(), and logging::WARNING.
Referenced by serial::parseSimulation(), and serial::parseSimulationFromString().
Here is the call graph for this function:
Here is the caller graph for this function:| SimId serial::xml_parser_utils::resolve_reference_id | ( | const XmlElement & | element, |
| const std::string & | attributeName, | ||
| const std::string & | owner, | ||
| const std::unordered_map< std::string, SimId > & | name_map | ||
| ) |
Resolves an XML string reference into an internal SimId.
| element | The XML element containing the string reference attribute. |
| attributeName | The name of the attribute containing the reference string. |
| owner | A description of the object making the reference (used for error messages). |
| name_map | The lookup table mapping string names to SimIds. |
| XmlException | if the reference cannot be resolved or is missing. |
Definition at line 356 of file xml_parser_utils.cpp.
References XmlElement::getSafeAttribute(), and max.
Referenced by parseReceiverWithMode(), and parseTransmitterWithMode().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::setOptionalRealParameter | ( | const XmlElement & | parameters, |
| const std::string & | param_name, | ||
| const RealType | default_value, | ||
| Setter | setter | ||
| ) |
Definition at line 422 of file xml_parser_utils.cpp.
References XmlElement::childElement(), logging::DEBUG, get_child_real_type(), XmlElement::isValid(), LOG, and max.
Referenced by parseOptionalNumericParameters().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::setOptionalUnsignedParameter | ( | const XmlElement & | parameters, |
| const std::string & | param_name, | ||
| const unsigned | default_value, | ||
| Setter | setter | ||
| ) |
Definition at line 436 of file xml_parser_utils.cpp.
References XmlElement::childElement(), logging::DEBUG, get_child_real_type(), XmlElement::isValid(), LOG, max, and parseUnsignedParameter().
Referenced by parseOptionalNumericParameters().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::xml_parser_utils::validateXml | ( | bool | didCombine, |
| const XmlDocument & | mainDoc | ||
| ) |
Validates an XML document against the embedded DTD and XSD schemas.
| didCombine | Flag indicating whether the document contains merged includes (used for formatting log messages). |
| mainDoc | The XML document to validate. |
| XmlException | if validation fails. |
Definition at line 1384 of file xml_parser_utils.cpp.
References logging::DEBUG, logging::FATAL, LOG, and max.
Referenced by serial::parseSimulation(), and serial::parseSimulationFromString().
Here is the caller graph for this function: