|
FERS 1.0.0
The Flexible Extensible Radar Simulator
|
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 | 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) |
| Adds a chunk of data to an HDF5 file. | |
| 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) |
| 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, World *world, const bool validate, std::mt19937 &masterSeeder) |
| std::string | world_to_xml_string (const core::World &world) |
| Serializes the entire simulation world into an XML formatted string. | |
| void serial::addChunkToFile | ( | HighFive::File & | file, |
| const std::vector< ComplexType > & | data, | ||
| RealType | time, | ||
| RealType | fullscale, | ||
| unsigned | count | ||
| ) |
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 76 of file hdf5_handler.cpp.
References LOG, and params::rate().
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 650 of file json_serializer.cpp.
References core::World::add(), core::World::clear(), radar::createFileTarget(), radar::createIsoTarget(), radar::CW_MODE, params::endTime(), core::World::findAntenna(), core::World::findTiming(), core::World::findWaveform(), radar::Receiver::FLAG_NODIRECT, radar::Receiver::FLAG_NOPROPLOSS, core::World::getReceivers(), core::World::getTargets(), logging::INFO, LOG, params::oversampleRatio(), params::params, PI, radar::processRawSchedule(), radar::PULSED_MODE, params::Parameters::random_seed, params::rate(), core::World::scheduleInitialEvents(), params::Parameters::simulation_name, params::startTime(), and logging::WARNING.
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 | ||
| ) |
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 115 of file waveform_factory.cpp.
References logging::FATAL, and LOG.
Referenced by fers_signal::from_json().
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 loads an XML file, merges any included files, validates it against the FERS DTD and XSD schemas, and then populates the simulation World object with the parsed parameters and components.
| filename | The path to the main XML simulation script. |
| world | A pointer to the World object to be populated. |
| validate | A boolean indicating whether to perform XML validation. |
| masterSeeder | A reference to the master random number generator used for seeding components. |
| XmlException | if the XML is malformed, fails validation, or contains invalid data. |
| std::runtime_error | for file I/O errors or other critical issues. |
Definition at line 1106 of file xml_parser.cpp.
References core::World::clear(), XmlDocument::loadFile(), LOG, params::params, and params::Parameters::reset().
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, |
| World * | world, | ||
| const bool | validate, | ||
| std::mt19937 & | masterSeeder | ||
| ) |
Definition at line 1131 of file xml_parser.cpp.
References core::World::clear(), XmlDocument::loadString(), LOG, params::params, and params::Parameters::reset().
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 127 of file hdf5_handler.cpp.
References 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 29 of file hdf5_handler.cpp.
References LOG.
| 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 544 of file json_serializer.cpp.
References radar::Receiver::FLAG_NODIRECT, radar::Receiver::FLAG_NOPROPLOSS, core::World::getAntennas(), core::World::getPlatforms(), core::World::getReceivers(), core::World::getTargets(), core::World::getTimings(), core::World::getTransmitters(), core::World::getWaveforms(), params::params, radar::PULSED_MODE, 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 489 of file xml_serializer.cpp.
References XmlElement::addChild(), XmlDocument::dumpToString(), core::World::getAntennas(), core::World::getPlatforms(), core::World::getTimings(), core::World::getWaveforms(), params::params, 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: