|
FERS 1.0.0
The Flexible Extensible Radar Simulator
|
Namespaces | |
| namespace | kml_generator_utils |
| namespace | rotation_angle_utils |
| namespace | rotation_warning_utils |
| namespace | xml_parser_utils |
| namespace | xml_serializer_utils |
Classes | |
| class | KmlGenerator |
| Generates KML files from FERS simulation scenarios for geographical visualization. More... | |
| class | Response |
| Manages radar signal responses from a transmitter. More... | |
Functions | |
| std::vector< std::vector< RealType > > | readPattern (const std::string &name, const std::string &datasetName) |
| Reads a 2D pattern dataset from an HDF5 file. | |
| void | writeOutputFileMetadataAttributes (HighFive::File &file, const core::OutputFileMetadata &metadata) |
| Writes additive FERS output metadata attributes to an open HDF5 file. | |
| void | readPulseData (const std::string &name, std::vector< ComplexType > &data) |
| Reads pulse data from an HDF5 file. | |
| void | addChunkToFile (HighFive::File &file, const std::vector< ComplexType > &data, RealType time, RealType fullscale, unsigned count, const core::PulseChunkMetadata *metadata=nullptr) |
| Adds a chunk of data to an HDF5 file. | |
| std::unique_ptr< antenna::Antenna > | parse_antenna_from_json (const nlohmann::json &j) |
| Parses an Antenna from JSON. | |
| std::unique_ptr< fers_signal::RadarSignal > | parse_waveform_from_json (const nlohmann::json &j) |
| Parses a Waveform from JSON. | |
| std::unique_ptr< timing::PrototypeTiming > | parse_timing_from_json (const nlohmann::json &j, SimId id) |
| Parses a timing prototype from JSON. | |
| void | update_parameters_from_json (const nlohmann::json &j, std::mt19937 &masterSeeder) |
| Updates global simulation parameters from JSON. | |
| void | update_antenna_from_json (const nlohmann::json &j, antenna::Antenna *ant, core::World &world) |
| Updates an antenna from JSON without full context recreation. | |
| void | update_platform_paths_from_json (const nlohmann::json &j, radar::Platform *plat) |
| Updates a platform's motion and rotation paths from JSON. | |
| void | update_transmitter_from_json (const nlohmann::json &j, radar::Transmitter *tx, core::World &world, std::mt19937 &masterSeeder) |
| Updates a transmitter from JSON without full context recreation. | |
| void | update_receiver_from_json (const nlohmann::json &j, radar::Receiver *rx, core::World &world, std::mt19937 &masterSeeder) |
| Updates a receiver from JSON without full context recreation. | |
| void | update_monostatic_from_json (const nlohmann::json &j, radar::Transmitter *tx, radar::Receiver *rx, core::World &world, std::mt19937 &masterSeeder) |
| Updates a monostatic radar from JSON without full context recreation. | |
| void | update_target_from_json (const nlohmann::json &j, radar::Target *tgt, core::World &world, std::mt19937 &masterSeeder) |
| Updates a target from JSON without full context recreation. | |
| void | update_timing_from_json (const nlohmann::json &j, core::World &world, SimId id) |
| Updates a timing source from JSON without full context recreation. | |
| nlohmann::json | world_to_json (const core::World &world) |
| Serializes the entire simulation world into a nlohmann::json object. | |
| void | json_to_world (const nlohmann::json &j, core::World &world, std::mt19937 &masterSeeder) |
| Deserializes a nlohmann::json object and reconstructs the simulation world. | |
| std::unique_ptr< RadarSignal > | loadWaveformFromFile (const std::string &name, const std::string &filename, RealType power, RealType carrierFreq, const SimId id=0) |
| Loads a radar waveform from a file and returns a RadarSignal object. | |
| void | parseSimulation (const std::string &filename, core::World *world, bool validate, std::mt19937 &masterSeeder) |
| Parses a simulation configuration from an XML file. | |
| void | parseSimulationFromString (const std::string &xmlContent, core::World *world, bool validate, std::mt19937 &masterSeeder) |
| Parses a simulation configuration directly from an XML string in memory. | |
| std::string | world_to_xml_string (const core::World &world) |
| Serializes the entire simulation world into an XML formatted string. | |
Variables | |
| std::mutex | hdf5_global_mutex |
| Global mutex to protect all HDF5 C-library calls, which are not thread-safe. | |
| void serial::addChunkToFile | ( | HighFive::File & | file, |
| const std::vector< ComplexType > & | data, | ||
| RealType | time, | ||
| RealType | fullscale, | ||
| unsigned | count, | ||
| const core::PulseChunkMetadata * | metadata = nullptr |
||
| ) |
Adds a chunk of data to an HDF5 file.
| file | The HDF5 file where the chunk is written. |
| data | A vector of complex data to be written. |
| time | The time attribute associated with the chunk. |
| fullscale | The fullscale attribute for the chunk. |
| count | The sequential count number for chunk naming. |
| std::runtime_error | If there is an error writing data or setting attributes. |
Definition at line 92 of file hdf5_handler.cpp.
References core::PulseChunkMetadata::chunk_index, hdf5_global_mutex, LOG, params::rate(), core::PulseChunkMetadata::sample_count, core::PulseChunkMetadata::sample_end_exclusive, and core::PulseChunkMetadata::sample_start.
Referenced by processing::runPulsedFinalizer().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::json_to_world | ( | const nlohmann::json & | j, |
| core::World & | world, | ||
| std::mt19937 & | masterSeeder | ||
| ) |
Deserializes a nlohmann::json object and reconstructs the simulation world.
This function is the counterpart to world_to_json. It performs a full state replacement by clearing the existing world and rebuilding it from the provided JSON. This "replace" strategy simplifies state management, guaranteeing that the C++ core is always perfectly synchronized with the state provided by the UI without requiring complex diffing or patching logic. It also handles re-seeding the master random number generator to ensure that loading a state also restores its deterministic behavior.
| j | The json object to deserialize. |
| world | The world object to populate. |
| masterSeeder | A reference to the master random number generator, which will be re-seeded. |
Definition at line 1574 of file json_serializer.cpp.
References core::World::clear(), radar::CW_MODE, params::endTime(), core::World::getReceivers(), params::oversampleRatio(), params::rate(), core::World::scheduleInitialEvents(), and params::startTime().
Referenced by fers_update_scenario_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| std::unique_ptr< fers_signal::RadarSignal > serial::loadWaveformFromFile | ( | const std::string & | name, |
| const std::string & | filename, | ||
| RealType | power, | ||
| RealType | carrierFreq, | ||
| const SimId | id = 0 |
||
| ) |
Loads a radar waveform from a file and returns a RadarSignal object.
| name | The name of the radar signal. |
| filename | The path to the file containing the waveform data. |
| power | The power of the radar signal in the waveform. |
| carrierFreq | The carrier frequency of the radar signal. |
| std::runtime_error | If the file cannot be opened or the file format is unrecognized. |
Definition at line 155 of file waveform_factory.cpp.
References logging::FATAL, and LOG.
Referenced by serial::xml_parser_utils::createDefaultAssetLoaders(), and fers_signal::from_json().
Here is the caller graph for this function:| std::unique_ptr< antenna::Antenna > serial::parse_antenna_from_json | ( | const nlohmann::json & | j | ) |
Parses an Antenna from JSON.
Definition at line 1113 of file json_serializer.cpp.
References antenna::from_json().
Referenced by update_antenna_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| std::unique_ptr< timing::PrototypeTiming > serial::parse_timing_from_json | ( | const nlohmann::json & | j, |
| const SimId | id | ||
| ) |
Parses a timing prototype from JSON.
Definition at line 1127 of file json_serializer.cpp.
Referenced by update_timing_from_json().
Here is the caller graph for this function:| std::unique_ptr< fers_signal::RadarSignal > serial::parse_waveform_from_json | ( | const nlohmann::json & | j | ) |
Parses a Waveform from JSON.
Definition at line 1120 of file json_serializer.cpp.
References fers_signal::from_json().
Referenced by fers_update_waveform_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::parseSimulation | ( | const std::string & | filename, |
| core::World * | world, | ||
| bool | validate, | ||
| std::mt19937 & | masterSeeder | ||
| ) |
Parses a simulation configuration from an XML file.
This function acts as the primary facade for the simulator's XML loading pipeline. It performs the following steps:
World and global parameters (params::params).<include> files into the main document.params::params with the parsed context parameters.| filename | The filesystem path to the main XML simulation script. |
| world | A pointer to the World object to be populated with parsed components. |
| validate | A boolean indicating whether to perform strict XML schema validation. |
| masterSeeder | A reference to the master random number generator used for assigning independent seeds to components. |
| XmlException | if the XML is malformed, fails schema validation, or contains invalid scenario logic. |
| std::runtime_error | for file I/O errors or other critical setup issues. |
Definition at line 25 of file xml_parser.cpp.
References serial::xml_parser_utils::addIncludeFilesToMainDocument(), serial::xml_parser_utils::ParserContext::base_dir, core::World::clear(), serial::xml_parser_utils::createDefaultAssetLoaders(), logging::DEBUG, serial::xml_parser_utils::ParserContext::loaders, XmlDocument::loadFile(), LOG, serial::xml_parser_utils::ParserContext::master_seeder, serial::xml_parser_utils::ParserContext::parameters, params::params, serial::xml_parser_utils::processParsedDocument(), params::Parameters::reset(), serial::xml_parser_utils::validateXml(), and serial::xml_parser_utils::ParserContext::world.
Referenced by fers_load_scenario_from_xml_file().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::parseSimulationFromString | ( | const std::string & | xmlContent, |
| core::World * | world, | ||
| bool | validate, | ||
| std::mt19937 & | masterSeeder | ||
| ) |
Parses a simulation configuration directly from an XML string in memory.
Similar to parseSimulation, but operates on a raw string instead of a file. Because it does not load from the filesystem, <include> tags are ignored, and any relative paths for file-backed assets (like waveforms or antennas) will be resolved against the current working directory (.).
| xmlContent | The raw XML string containing the scenario definition. |
| world | A pointer to the World object to be populated with parsed components. |
| validate | A boolean indicating whether to perform strict XML schema validation. |
| masterSeeder | A reference to the master random number generator used for assigning independent seeds to components. |
| XmlException | if the XML string is malformed, fails schema validation, or contains invalid scenario logic. |
Definition at line 61 of file xml_parser.cpp.
References serial::xml_parser_utils::ParserContext::base_dir, core::World::clear(), serial::xml_parser_utils::createDefaultAssetLoaders(), logging::DEBUG, serial::xml_parser_utils::ParserContext::loaders, XmlDocument::loadString(), LOG, serial::xml_parser_utils::ParserContext::master_seeder, serial::xml_parser_utils::ParserContext::parameters, params::params, serial::xml_parser_utils::processParsedDocument(), params::Parameters::reset(), serial::xml_parser_utils::validateXml(), and serial::xml_parser_utils::ParserContext::world.
Referenced by fers_load_scenario_from_xml_string().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< std::vector< RealType > > serial::readPattern | ( | const std::string & | name, |
| const std::string & | datasetName | ||
| ) |
Reads a 2D pattern dataset from an HDF5 file.
| name | The name of the HDF5 file. |
| datasetName | The name of the dataset to be read. |
| std::runtime_error | If there is an error handling the file or if the dataset dimensions are invalid. |
Definition at line 153 of file hdf5_handler.cpp.
References hdf5_global_mutex, and LOG.
| void serial::readPulseData | ( | const std::string & | name, |
| std::vector< ComplexType > & | data | ||
| ) |
Reads pulse data from an HDF5 file.
| name | The name of the HDF5 file. |
| data | A reference to a vector where the complex data will be stored. |
| std::runtime_error | If the file does not exist or the datasets "I" and "Q" have mismatched sizes. |
Definition at line 43 of file hdf5_handler.cpp.
References hdf5_global_mutex, and LOG.
| void serial::update_antenna_from_json | ( | const nlohmann::json & | j, |
| antenna::Antenna * | ant, | ||
| core::World & | world | ||
| ) |
Updates an antenna from JSON without full context recreation.
Definition at line 1141 of file json_serializer.cpp.
References parse_antenna_from_json(), core::World::replace(), antenna::Antenna::setEfficiencyFactor(), and antenna::Antenna::setName().
Referenced by fers_update_antenna_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::update_monostatic_from_json | ( | const nlohmann::json & | j, |
| radar::Transmitter * | tx, | ||
| radar::Receiver * | rx, | ||
| core::World & | world, | ||
| std::mt19937 & | masterSeeder | ||
| ) |
Updates a monostatic radar from JSON without full context recreation.
Definition at line 1418 of file json_serializer.cpp.
References radar::Receiver::clearFlag(), core::World::findAntenna(), core::World::findTiming(), radar::Receiver::FLAG_NODIRECT, radar::Receiver::FLAG_NOPROPLOSS, radar::Receiver::getMode(), radar::Transmitter::getMode(), radar::Object::getName(), radar::Transmitter::getPrf(), radar::Radar::getTiming(), radar::processRawSchedule(), radar::PULSED_MODE, radar::Radar::setAntenna(), radar::Receiver::setFlag(), radar::Receiver::setMode(), radar::Object::setName(), radar::Receiver::setNoiseTemperature(), radar::Receiver::setSchedule(), radar::Transmitter::setSchedule(), radar::Radar::setTiming(), radar::Receiver::setWindowProperties(), and update_transmitter_from_json().
Referenced by fers_update_monostatic_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::update_parameters_from_json | ( | const nlohmann::json & | j, |
| std::mt19937 & | masterSeeder | ||
| ) |
Updates global simulation parameters from JSON.
Definition at line 1134 of file json_serializer.cpp.
Referenced by fers_update_parameters_from_json().
Here is the caller graph for this function:| void serial::update_platform_paths_from_json | ( | const nlohmann::json & | j, |
| radar::Platform * | plat | ||
| ) |
Updates a platform's motion and rotation paths from JSON.
Definition at line 1218 of file json_serializer.cpp.
References serial::rotation_warning_utils::Angle, serial::rotation_angle_utils::external_rotation_rate_to_internal(), serial::rotation_angle_utils::external_rotation_to_internal(), radar::Platform::getName(), serial::rotation_warning_utils::maybe_warn_about_rotation_value(), serial::rotation_warning_utils::Rate, params::rotationAngleUnit(), radar::Platform::setMotionPath(), and radar::Platform::setRotationPath().
Referenced by fers_update_platform_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::update_receiver_from_json | ( | const nlohmann::json & | j, |
| radar::Receiver * | rx, | ||
| core::World & | world, | ||
| std::mt19937 & | |||
| ) |
Updates a receiver from JSON without full context recreation.
Definition at line 1347 of file json_serializer.cpp.
References radar::Receiver::clearFlag(), radar::CW_MODE, core::World::findAntenna(), core::World::findTiming(), radar::Receiver::FLAG_NODIRECT, radar::Receiver::FLAG_NOPROPLOSS, radar::Receiver::getMode(), radar::Object::getName(), radar::Radar::getTiming(), radar::Receiver::getWindowPrf(), radar::processRawSchedule(), radar::PULSED_MODE, radar::Radar::setAntenna(), radar::Receiver::setFlag(), radar::Receiver::setMode(), radar::Object::setName(), radar::Receiver::setNoiseTemperature(), radar::Receiver::setSchedule(), radar::Radar::setTiming(), and radar::Receiver::setWindowProperties().
Referenced by fers_update_receiver_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::update_target_from_json | ( | const nlohmann::json & | j, |
| radar::Target * | existing_tgt, | ||
| core::World & | world, | ||
| std::mt19937 & | |||
| ) |
Updates a target from JSON without full context recreation.
Definition at line 1478 of file json_serializer.cpp.
References radar::createFileTarget(), radar::createIsoTarget(), radar::Target::getId(), radar::Object::getName(), radar::Object::getPlatform(), radar::Target::getSeed(), and core::World::replace().
Referenced by fers_update_target_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::update_timing_from_json | ( | const nlohmann::json & | j, |
| core::World & | world, | ||
| const SimId | id | ||
| ) |
Updates a timing source from JSON without full context recreation.
Definition at line 1523 of file json_serializer.cpp.
References core::World::findTiming(), parse_timing_from_json(), and core::World::replace().
Referenced by fers_update_timing_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::update_transmitter_from_json | ( | const nlohmann::json & | j, |
| radar::Transmitter * | tx, | ||
| core::World & | world, | ||
| std::mt19937 & | |||
| ) |
Updates a transmitter from JSON without full context recreation.
Definition at line 1287 of file json_serializer.cpp.
References radar::CW_MODE, core::World::findAntenna(), core::World::findTiming(), core::World::findWaveform(), radar::Transmitter::getMode(), radar::Object::getName(), radar::Transmitter::getPrf(), radar::Radar::getTiming(), radar::processRawSchedule(), radar::PULSED_MODE, radar::Radar::setAntenna(), radar::Transmitter::setMode(), radar::Object::setName(), radar::Transmitter::setPrf(), radar::Transmitter::setSchedule(), radar::Radar::setTiming(), and radar::Transmitter::setWave().
Referenced by fers_update_transmitter_from_json(), and update_monostatic_from_json().
Here is the call graph for this function:
Here is the caller graph for this function:| nlohmann::json serial::world_to_json | ( | const core::World & | world | ) |
Serializes the entire simulation world into a nlohmann::json object.
This function traverses the core::World object model and constructs a JSON representation. It is designed to produce a format that is convenient for the frontend to consume. This involves translating internal data formats (e.g., angles in radians) to a more UI-friendly format (e.g., compass degrees) and restructuring complex object relationships (like monostatic radars) into simpler representations.
| world | The world object to serialize. |
Definition at line 1540 of file json_serializer.cpp.
References core::World::getAntennas(), core::World::getPlatforms(), core::World::getTimings(), core::World::getWaveforms(), params::params, and params::Parameters::simulation_name.
Referenced by fers_get_scenario_as_json().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string serial::world_to_xml_string | ( | const core::World & | world | ) |
Serializes the entire simulation world into an XML formatted string.
This function serves as the reverse of the XML parser. It is essential for allowing users to modify a scenario in a UI and then export their changes back into a valid FERS XML file that can be used by the CLI or shared. It iterates through the in-memory core::World object and reconstructs the corresponding XML structure.
| world | The world object to serialize. |
Definition at line 26 of file xml_serializer.cpp.
References XmlElement::addChild(), XmlDocument::dumpToString(), core::World::getAntennas(), core::World::getPlatforms(), core::World::getTimings(), core::World::getWaveforms(), params::params, serial::xml_serializer_utils::serializeAntenna(), serial::xml_serializer_utils::serializeParameters(), serial::xml_serializer_utils::serializePlatform(), serial::xml_serializer_utils::serializeTiming(), serial::xml_serializer_utils::serializeWaveform(), XmlElement::setAttribute(), and XmlDocument::setRootElement().
Referenced by fers_get_scenario_as_xml().
Here is the call graph for this function:
Here is the caller graph for this function:| void serial::writeOutputFileMetadataAttributes | ( | HighFive::File & | file, |
| const core::OutputFileMetadata & | metadata | ||
| ) |
Writes additive FERS output metadata attributes to an open HDF5 file.
The caller must hold hdf5_global_mutex.
Definition at line 31 of file hdf5_handler.cpp.
References core::OutputFileMetadata::mode, core::outputFileMetadataToJsonString(), core::OutputFileMetadata::receiver_id, core::OutputFileMetadata::receiver_name, core::OutputFileMetadata::sample_end_exclusive, core::OutputFileMetadata::sample_start, and core::OutputFileMetadata::total_samples.
Referenced by processing::pipeline::exportCwToHdf5(), and processing::runPulsedFinalizer().
Here is the call graph for this function:
Here is the caller graph for this function:| std::mutex serial::hdf5_global_mutex |
Global mutex to protect all HDF5 C-library calls, which are not thread-safe.
Definition at line 29 of file hdf5_handler.cpp.
Referenced by addChunkToFile(), processing::pipeline::exportCwToHdf5(), readPattern(), readPulseData(), and processing::runPulsedFinalizer().