|
FERS 1.0.0
The Flexible Extensible Radar Simulator
|
#include <stddef.h>#include <stdint.h>
Include dependency graph for api.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | fers_antenna_pattern_data_t |
| Represents a sampled 2D antenna gain pattern. More... | |
| struct | fers_motion_waypoint_t |
| Represents a single waypoint for a motion path. More... | |
| struct | fers_rotation_waypoint_t |
| Represents a single waypoint for a rotation path. More... | |
| struct | fers_interpolated_point_t |
| Represents a single interpolated point on a motion path. More... | |
| struct | fers_interpolated_rotation_point_t |
| Represents a single interpolated point on a rotation path. More... | |
| struct | fers_interpolated_path_t |
| A container for an array of interpolated motion path points. More... | |
| struct | fers_interpolated_rotation_path_t |
| A container for an array of interpolated rotation path points. More... | |
| struct | fers_visual_link_t |
| Represents a single renderable line segment metadata. More... | |
| struct | fers_visual_link_list_t |
| A container for a list of visual links. More... | |
Typedefs | |
| typedef struct fers_context | fers_context_t |
| typedef void(* | fers_progress_callback_t) (const char *message, int current, int total, void *user_data) |
| A function pointer type for progress reporting callbacks. | |
| typedef void(* | fers_log_callback_t) (fers_log_level_t level, const char *line, void *user_data) |
| A function pointer type for receiving formatted log lines. | |
Enumerations | |
| enum | fers_log_level_t { FERS_LOG_TRACE , FERS_LOG_DEBUG , FERS_LOG_INFO , FERS_LOG_WARNING , FERS_LOG_ERROR , FERS_LOG_FATAL , FERS_LOG_OFF } |
| Log levels for the FERS library. More... | |
| enum | fers_interp_type_t { FERS_INTERP_STATIC , FERS_INTERP_LINEAR , FERS_INTERP_CUBIC } |
| Defines the interpolation methods available for path generation. More... | |
| enum | fers_angle_unit_t { FERS_ANGLE_UNIT_DEG , FERS_ANGLE_UNIT_RAD } |
| Units used for external rotation angles and rates. More... | |
| enum | fers_link_quality_t { FERS_LINK_STRONG , FERS_LINK_WEAK } |
| Quality of the radio link based on SNR. More... | |
| enum | fers_link_type_t { FERS_LINK_MONOSTATIC , FERS_LINK_BISTATIC_TX_TGT , FERS_LINK_BISTATIC_TGT_RX , FERS_LINK_DIRECT_TX_RX } |
| Type of visual link to render. More... | |
Functions | |
| fers_context_t * | fers_context_create () |
| Creates a new FERS simulation context. | |
| void | fers_context_destroy (fers_context_t *context) |
| Destroys a FERS simulation context and releases all associated memory. | |
| int | fers_set_output_directory (fers_context_t *context, const char *out_dir) |
| Sets the output directory for simulation results. | |
| int | fers_configure_logging (fers_log_level_t level, const char *log_file_path) |
| Configures the internal logger. | |
| fers_log_level_t | fers_get_log_level () |
| Returns the current internal logger level. | |
| void | fers_set_log_callback (fers_log_callback_t callback, void *user_data) |
| Registers a callback for formatted log lines. | |
| void | fers_log (fers_log_level_t level, const char *message) |
| Submits a log message to the library's unified logging system. | |
| int | fers_set_thread_count (unsigned num_threads) |
| Sets the number of worker threads for the simulation. | |
| int | fers_load_scenario_from_xml_file (fers_context_t *context, const char *xml_filepath, int validate) |
| Loads a scenario into the context from a FERS XML file. | |
| int | fers_load_scenario_from_xml_string (fers_context_t *context, const char *xml_content, int validate) |
| Loads a scenario into the context from a FERS XML string. | |
| char * | fers_get_scenario_as_json (fers_context_t *context) |
| Serializes the current simulation scenario into a JSON string. | |
| char * | fers_get_scenario_as_xml (fers_context_t *context) |
| Serializes the current simulation scenario into a FERS XML string. | |
| char * | fers_get_last_output_metadata_json (fers_context_t *context) |
| Returns JSON metadata for the most recent simulation output files. | |
| int | fers_update_scenario_from_json (fers_context_t *context, const char *scenario_json) |
| Updates the simulation scenario from a JSON string. | |
| int | fers_update_platform_from_json (fers_context_t *context, uint64_t id, const char *json) |
| Updates a single platform's paths and name from JSON without full context recreation. | |
| int | fers_update_parameters_from_json (fers_context_t *context, const char *json) |
| Updates the global simulation parameters from JSON without full context recreation. | |
| int | fers_update_antenna_from_json (fers_context_t *context, const char *json) |
| Updates a single antenna from JSON without full context recreation. | |
| int | fers_update_waveform_from_json (fers_context_t *context, const char *json) |
| Updates a single waveform from JSON without full context recreation. | |
| int | fers_update_transmitter_from_json (fers_context_t *context, uint64_t id, const char *json) |
| Updates a single transmitter from JSON without full context recreation. | |
| int | fers_update_receiver_from_json (fers_context_t *context, uint64_t id, const char *json) |
| Updates a single receiver from JSON without full context recreation. | |
| int | fers_update_target_from_json (fers_context_t *context, uint64_t id, const char *json) |
| Updates a single target from JSON without full context recreation. | |
| int | fers_update_monostatic_from_json (fers_context_t *context, const char *json) |
| Updates a monostatic radar from JSON without full context recreation. | |
| int | fers_update_timing_from_json (fers_context_t *context, uint64_t id, const char *json) |
| Updates a single timing source from JSON without full context recreation. | |
| char * | fers_get_last_error_message () |
| Retrieves the last error message that occurred on the current thread. | |
| char * | fers_get_last_warning_messages_json () |
| Returns the last deduplicated rotation-unit warning list for the calling thread as JSON. | |
| void | fers_free_string (char *str) |
| Frees a string that was allocated and returned by the libfers API. | |
| int | fers_run_simulation (fers_context_t *context, fers_progress_callback_t callback, void *user_data) |
| Runs the simulation defined in the provided context. | |
| int | fers_generate_kml (const fers_context_t *context, const char *output_kml_filepath) |
| Generates a KML file for visualizing the scenario in the context. | |
| fers_antenna_pattern_data_t * | fers_get_antenna_pattern (const fers_context_t *context, uint64_t antenna_id, size_t az_samples, size_t el_samples, double frequency_hz) |
| Samples the gain pattern of a specified antenna and provides the data. | |
| void | fers_free_antenna_pattern_data (fers_antenna_pattern_data_t *data) |
| Frees the memory allocated for an antenna pattern data structure. | |
| fers_interpolated_path_t * | fers_get_interpolated_motion_path (const fers_motion_waypoint_t *waypoints, size_t waypoint_count, fers_interp_type_t interp_type, size_t num_points) |
| Calculates an interpolated motion path from a set of waypoints. | |
| void | fers_free_interpolated_motion_path (fers_interpolated_path_t *path) |
| Frees the memory allocated for an interpolated motion path. | |
| fers_interpolated_rotation_path_t * | fers_get_interpolated_rotation_path (const fers_rotation_waypoint_t *waypoints, size_t waypoint_count, fers_interp_type_t interp_type, fers_angle_unit_t angle_unit, size_t num_points) |
| Calculates an interpolated rotation path from a set of waypoints. | |
| void | fers_free_interpolated_rotation_path (fers_interpolated_rotation_path_t *path) |
| Frees the memory allocated for an interpolated rotation path. | |
| fers_visual_link_list_t * | fers_calculate_preview_links (const fers_context_t *context, double time) |
| Calculates visual links for a specific simulation time. | |
| void | fers_free_preview_links (fers_visual_link_list_t *list) |
| Frees the memory allocated for a preview link list. | |
| typedef struct fers_context fers_context_t |
| typedef void(* fers_log_callback_t) (fers_log_level_t level, const char *line, void *user_data) |
| typedef void(* fers_progress_callback_t) (const char *message, int current, int total, void *user_data) |
A function pointer type for progress reporting callbacks.
This callback can be implemented by the client to receive progress updates during long-running operations like fers_run_simulation.
| message | A descriptive message about the current operation. |
| current | The current progress step. |
| total | The total number of steps for the operation. |
| user_data | An opaque pointer passed back to the caller, useful for maintaining state (e.g., a class instance or application handle). |
| enum fers_angle_unit_t |
Units used for external rotation angles and rates.
| Enumerator | |
|---|---|
| FERS_ANGLE_UNIT_DEG | |
| FERS_ANGLE_UNIT_RAD | |
Definition at line 456 of file api.h.
| enum fers_interp_type_t |
Defines the interpolation methods available for path generation.
This enum provides a language-agnostic way to specify the desired interpolation algorithm when calling the path generation functions.
| Enumerator | |
|---|---|
| FERS_INTERP_STATIC | |
| FERS_INTERP_LINEAR | |
| FERS_INTERP_CUBIC | |
Definition at line 446 of file api.h.
| enum fers_link_quality_t |
Quality of the radio link based on SNR.
| Enumerator | |
|---|---|
| FERS_LINK_STRONG | |
| FERS_LINK_WEAK | |
Definition at line 583 of file api.h.
| enum fers_link_type_t |
Type of visual link to render.
| Enumerator | |
|---|---|
| FERS_LINK_MONOSTATIC | |
| FERS_LINK_BISTATIC_TX_TGT | |
| FERS_LINK_BISTATIC_TGT_RX | |
| FERS_LINK_DIRECT_TX_RX | |
Definition at line 592 of file api.h.
| enum fers_log_level_t |
Log levels for the FERS library.
| Enumerator | |
|---|---|
| FERS_LOG_TRACE | |
| FERS_LOG_DEBUG | |
| FERS_LOG_INFO | |
| FERS_LOG_WARNING | |
| FERS_LOG_ERROR | |
| FERS_LOG_FATAL | |
| FERS_LOG_OFF | |
Definition at line 85 of file api.h.
| fers_visual_link_list_t * fers_calculate_preview_links | ( | const fers_context_t * | context, |
| double | time | ||
| ) |
Calculates visual links for a specific simulation time.
| context | The simulation context. |
| time | The simulation time in seconds. |
Definition at line 1137 of file api.cpp.
References simulation::BistaticTgtRx, simulation::BistaticTxTgt, simulation::calculatePreviewLinks(), simulation::DirectTxRx, logging::ERROR, FERS_LINK_BISTATIC_TGT_RX, FERS_LINK_BISTATIC_TX_TGT, FERS_LINK_DIRECT_TX_RX, FERS_LINK_MONOSTATIC, FERS_LINK_STRONG, FERS_LINK_WEAK, handle_api_exception(), last_error_message, LOG, simulation::Monostatic, simulation::Strong, and fers_visual_link_t::type.
Here is the call graph for this function:| int fers_configure_logging | ( | fers_log_level_t | level, |
| const char * | log_file_path | ||
| ) |
Configures the internal logger.
| level | The minimum severity level to log. |
| log_file_path | Optional path to a log file. Pass NULL to disable file logging. |
Definition at line 188 of file api.cpp.
References handle_api_exception(), last_error_message, logging::logger, logging::Logger::logToFile(), map_api_log_level(), and logging::Logger::setLevel().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| fers_context_t * fers_context_create | ( | ) |
Creates a new FERS simulation context.
Allocates and initializes a new, empty simulation context in memory. This context serves as the container for a scenario loaded via one of the fers_load_... or fers_update_... functions.
fers_context_destroy() to prevent resource leaks.Definition at line 88 of file api.cpp.
References discard_warning_capture(), handle_api_exception(), and last_error_message.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void fers_context_destroy | ( | fers_context_t * | context | ) |
Destroys a FERS simulation context and releases all associated memory.
This function must be called for every context created by fers_context_create() to ensure proper cleanup of the underlying C++ objects. Accessing the context handle after calling this function results in undefined behavior.
| context | A valid pointer to a fers_context_t handle. If context is NULL, the function performs no action for safety and does not set an error. |
Definition at line 108 of file api.cpp.
Referenced by main().
Here is the caller graph for this function:| void fers_free_antenna_pattern_data | ( | fers_antenna_pattern_data_t * | data | ) |
Frees the memory allocated for an antenna pattern data structure.
| data | A pointer to the fers_antenna_pattern_data_t struct to free. |
Definition at line 1126 of file api.cpp.
References fers_antenna_pattern_data_t::gains.
| void fers_free_interpolated_motion_path | ( | fers_interpolated_path_t * | path | ) |
Frees the memory allocated for an interpolated motion path.
| path | A pointer to the fers_interpolated_path_t struct to free. |
Definition at line 933 of file api.cpp.
References fers_interpolated_path_t::points.
| void fers_free_interpolated_rotation_path | ( | fers_interpolated_rotation_path_t * | path | ) |
Frees the memory allocated for an interpolated rotation path.
| path | A pointer to the fers_interpolated_rotation_path_t struct to free. |
Definition at line 1029 of file api.cpp.
References fers_interpolated_rotation_path_t::points.
| void fers_free_preview_links | ( | fers_visual_link_list_t * | list | ) |
Frees the memory allocated for a preview link list.
| list | The list to free. |
Definition at line 1206 of file api.cpp.
References fers_visual_link_list_t::links.
| void fers_free_string | ( | char * | str | ) |
Frees a string that was allocated and returned by the libfers API.
This function must be used to release memory for any string returned by functions like fers_get_scenario_as_json or fers_get_last_error_message. It exists to ensure that the memory deallocation mechanism (free) matches the allocation mechanism (strdup/malloc) used within the C++ library, preventing potential crashes from mismatched allocators across language boundaries.
| str | A pointer to the string to be freed. If str is NULL, no action is taken. |
Definition at line 752 of file api.cpp.
Referenced by main().
Here is the caller graph for this function:| int fers_generate_kml | ( | const fers_context_t * | context, |
| const char * | output_kml_filepath | ||
| ) |
Generates a KML file for visualizing the scenario in the context.
This utility exists to provide a simple, out-of-the-box method for users to validate and visualize the geographic layout and motion paths of their scenarios in common external tools like Google Earth.
| context | A valid fers_context_t handle containing a loaded scenario. |
| output_kml_filepath | A null-terminated UTF-8 string for the output KML file path. |
fers_get_last_error_message() to retrieve error details. Definition at line 798 of file api.cpp.
References logging::ERROR, serial::KmlGenerator::generateKml(), handle_api_exception(), last_error_message, and LOG.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| fers_antenna_pattern_data_t * fers_get_antenna_pattern | ( | const fers_context_t * | context, |
| uint64_t | antenna_id, | ||
| size_t | az_samples, | ||
| size_t | el_samples, | ||
| double | frequency_hz | ||
| ) |
Samples the gain pattern of a specified antenna and provides the data.
This function calculates the antenna's far-field gain at a specified resolution over the full sphere of directions (azimuth and elevation). The resulting gain values are linear (not in dB) and normalized relative to the pattern's peak gain. This is a stateless utility useful for UI previews and analysis.
| context | A valid fers_context_t handle containing a loaded scenario with the antenna. |
| antenna_id | The unique ID of the antenna asset to sample. |
| az_samples | The desired number of sample points along the azimuth axis. Must be at least 2 to span the full azimuth range. |
| el_samples | The desired number of sample points along the elevation axis. Must be at least 2 to span the full elevation range. |
| frequency_hz | The frequency in Hz to use for gain calculation (affects aperture antennas). |
fers_antenna_pattern_data_t struct containing the results. Returns NULL on failure (e.g., antenna not found). The caller owns the returned struct and must free it with fers_free_antenna_pattern_data. Definition at line 1040 of file api.cpp.
References params::c(), logging::ERROR, antenna::Antenna::getGain(), handle_api_exception(), last_error_message, LOG, and PI.
Here is the call graph for this function:| fers_interpolated_path_t * fers_get_interpolated_motion_path | ( | const fers_motion_waypoint_t * | waypoints, |
| size_t | waypoint_count, | ||
| fers_interp_type_t | interp_type, | ||
| size_t | num_points | ||
| ) |
Calculates an interpolated motion path from a set of waypoints.
This function is a stateless utility that computes the path without needing a full simulation context. It is useful for UI previews.
| waypoints | An array of fers_motion_waypoint_t structs. |
| waypoint_count | The number of waypoints in the array. |
| interp_type | The interpolation algorithm to use. |
| num_points | The desired number of points in the output interpolated path. |
fers_interpolated_path_t struct containing the results. Returns NULL on failure. The caller owns the returned struct and must free it with fers_free_interpolated_motion_path. Definition at line 858 of file api.cpp.
References math::Path::addCoord(), logging::ERROR, FERS_INTERP_CUBIC, math::Path::finalize(), math::Path::getPosition(), math::Path::getVelocity(), handle_api_exception(), last_error_message, LOG, math::Path::setInterp(), fers_motion_waypoint_t::time, to_cpp_interp_type(), fers_motion_waypoint_t::x, math::Vec3::x, fers_motion_waypoint_t::y, math::Vec3::y, fers_motion_waypoint_t::z, and math::Vec3::z.
Here is the call graph for this function:| fers_interpolated_rotation_path_t * fers_get_interpolated_rotation_path | ( | const fers_rotation_waypoint_t * | waypoints, |
| size_t | waypoint_count, | ||
| fers_interp_type_t | interp_type, | ||
| fers_angle_unit_t | angle_unit, | ||
| size_t | num_points | ||
| ) |
Calculates an interpolated rotation path from a set of waypoints.
This function is a stateless utility for UI previews.
| waypoints | An array of fers_rotation_waypoint_t structs. |
| waypoint_count | The number of waypoints in the array. |
| interp_type | The interpolation algorithm to use (STATIC, LINEAR, CUBIC). |
| angle_unit | The unit used by the waypoint angles and desired output angles. |
| num_points | The desired number of points in the output interpolated path. |
fers_interpolated_rotation_path_t struct containing the results. Returns NULL on failure. The caller owns the returned struct and must free it with fers_free_interpolated_rotation_path. Definition at line 942 of file api.cpp.
References math::RotationPath::addCoord(), serial::rotation_warning_utils::Angle, math::SVec3::azimuth, serial::rotation_warning_utils::clear_captured_warnings(), params::Degrees, math::SVec3::elevation, logging::ERROR, serial::rotation_angle_utils::external_rotation_to_internal(), FERS_ANGLE_UNIT_RAD, FERS_INTERP_CUBIC, math::RotationPath::finalize(), math::RotationPath::getPosition(), handle_api_exception(), serial::rotation_angle_utils::internal_azimuth_to_external(), serial::rotation_angle_utils::internal_elevation_to_external(), last_error_message, last_warning_messages, LOG, serial::rotation_warning_utils::maybe_warn_about_rotation_value(), params::Radians, math::RotationPath::setInterp(), fers_rotation_waypoint_t::time, and to_cpp_rot_interp_type().
Here is the call graph for this function:| char * fers_get_last_error_message | ( | ) |
Retrieves the last error message that occurred on the current thread.
Because C++ exceptions cannot safely propagate across the FFI boundary into other languages, this function provides the standard C-style error reporting mechanism. The error state is stored in a thread-local variable to ensure that concurrent API calls from different threads do not overwrite each other's error messages. The error is cleared at the start of each fallible API call.
fers_free_string() to prevent memory leaks.Definition at line 728 of file api.cpp.
References last_error_message.
Referenced by main().
Here is the caller graph for this function:| char * fers_get_last_output_metadata_json | ( | fers_context_t * | context | ) |
Returns JSON metadata for the most recent simulation output files.
The returned JSON describes generated HDF5 file structure and sample ranges. The caller owns the returned string and must free it with fers_free_string. If no simulation has completed yet, the returned JSON contains an empty files array.
| context | A valid fers_context_t handle. |
Definition at line 427 of file api.cpp.
References logging::ERROR, FersContext::getLastOutputMetadataJson(), handle_api_exception(), last_error_message, and LOG.
Here is the call graph for this function:| char * fers_get_last_warning_messages_json | ( | ) |
Returns the last deduplicated rotation-unit warning list for the calling thread as JSON.
The returned value is a JSON array of strings. It is populated by successful XML/JSON load and update calls that detect suspicious rotation values. The caller owns the string and must free it with fers_free_string().
Definition at line 740 of file api.cpp.
References last_warning_messages.
| fers_log_level_t fers_get_log_level | ( | ) |
Returns the current internal logger level.
Definition at line 212 of file api.cpp.
References logging::logger, and map_internal_log_level().
Here is the call graph for this function:| char * fers_get_scenario_as_json | ( | fers_context_t * | context | ) |
Serializes the current simulation scenario into a JSON string.
This function is the primary method for the UI to retrieve the full state of the simulation. JSON is used as the interchange format because it is lightweight, human-readable, and natively supported by web technologies, making it trivial to parse and use in the React/TypeScript frontend.
fers_free_string() to prevent memory leaks.| context | A valid fers_context_t handle. |
Definition at line 370 of file api.cpp.
References logging::ERROR, handle_api_exception(), last_error_message, LOG, and serial::world_to_json().
Here is the call graph for this function:| char * fers_get_scenario_as_xml | ( | fers_context_t * | context | ) |
Serializes the current simulation scenario into a FERS XML string.
This function enables exporting the in-memory state back into the standard FERS XML file format. This is essential for interoperability with legacy tools and for allowing a user to save a scenario that was created or modified in the UI.
fers_free_string() to prevent memory leaks.| context | A valid fers_context_t handle. |
Definition at line 397 of file api.cpp.
References logging::ERROR, handle_api_exception(), last_error_message, LOG, and serial::world_to_xml_string().
Here is the call graph for this function:| int fers_load_scenario_from_xml_file | ( | fers_context_t * | context, |
| const char * | xml_filepath, | ||
| int | validate | ||
| ) |
Loads a scenario into the context from a FERS XML file.
This is the standard method for initializing a simulation context from a file on disk. It is essential for interoperability with the CLI and legacy workflows that rely on the FERS XML format.
| context | A valid fers_context_t handle. |
| xml_filepath | A null-terminated UTF-8 string for the input XML file path. |
| validate | A boolean (0 or 1) indicating whether to validate the XML against the embedded FERS schema. Validation is recommended to ensure scenario correctness. |
fers_get_last_error_message() to retrieve error details. Definition at line 274 of file api.cpp.
References begin_warning_capture(), complete_warning_capture(), discard_warning_capture(), logging::ERROR, handle_api_exception(), logging::INFO, last_error_message, LOG, params::params, serial::parseSimulation(), and params::Parameters::random_seed.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| int fers_load_scenario_from_xml_string | ( | fers_context_t * | context, |
| const char * | xml_content, | ||
| int | validate | ||
| ) |
Loads a scenario into the context from a FERS XML string.
This function provides a way to load a scenario from an in-memory string, avoiding file I/O. It is useful for test harnesses or for UIs that manage scenarios as text content before parsing.
| context | A valid fers_context_t handle. |
| xml_content | A null-terminated UTF-8 string containing the FERS scenario in XML format. |
| validate | A boolean (0 or 1) indicating whether to validate the XML against the embedded FERS schema. |
fers_get_last_error_message() to retrieve error details. Definition at line 325 of file api.cpp.
References begin_warning_capture(), complete_warning_capture(), discard_warning_capture(), logging::ERROR, handle_api_exception(), logging::INFO, last_error_message, LOG, params::params, serial::parseSimulationFromString(), and params::Parameters::random_seed.
Here is the call graph for this function:| void fers_log | ( | fers_log_level_t | level, |
| const char * | message | ||
| ) |
Submits a log message to the library's unified logging system.
This ensures CLI messages match the format (timestamps, alignment) of library messages.
Definition at line 225 of file api.cpp.
References logging::Logger::log(), logging::logger, and map_api_log_level().
Here is the call graph for this function:| int fers_run_simulation | ( | fers_context_t * | context, |
| fers_progress_callback_t | callback, | ||
| void * | user_data | ||
| ) |
Runs the simulation defined in the provided context.
This function is synchronous and will block the calling thread until the simulation is complete. This design keeps the API simple. For use in a responsive UI, it is the responsibility of the caller (e.g., the Tauri backend) to invoke this function on a separate worker thread to avoid freezing the user interface.
| context | A valid fers_context_t handle containing a loaded scenario. |
| callback | A function pointer to a progress callback. Can be NULL. |
| user_data | An opaque pointer passed to the callback function. |
fers_get_last_error_message() to retrieve error details. Definition at line 760 of file api.cpp.
References logging::ERROR, handle_api_exception(), last_error_message, LOG, params::renderThreads(), and core::runEventDrivenSim().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void fers_set_log_callback | ( | fers_log_callback_t | callback, |
| void * | user_data | ||
| ) |
Registers a callback for formatted log lines.
Pass NULL as callback to disable log callbacks.
Definition at line 214 of file api.cpp.
References logging::logger, and logging::Logger::setCallback().
Here is the call graph for this function:| int fers_set_output_directory | ( | fers_context_t * | context, |
| const char * | out_dir | ||
| ) |
Sets the output directory for simulation results.
| context | A valid fers_context_t handle. |
| out_dir | A null-terminated UTF-8 string for the output directory path. |
Definition at line 252 of file api.cpp.
References logging::ERROR, handle_api_exception(), last_error_message, LOG, and FersContext::setOutputDir().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| int fers_set_thread_count | ( | unsigned | num_threads | ) |
Sets the number of worker threads for the simulation.
| num_threads | The number of threads to use. |
Definition at line 233 of file api.cpp.
References handle_api_exception(), last_error_message, and params::setThreads().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| int fers_update_antenna_from_json | ( | fers_context_t * | context, |
| const char * | json | ||
| ) |
Updates a single antenna from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| json | The JSON string for the antenna. |
Definition at line 511 of file api.cpp.
References handle_api_exception(), last_error_message, and serial::update_antenna_from_json().
Here is the call graph for this function:| int fers_update_monostatic_from_json | ( | fers_context_t * | context, |
| const char * | json | ||
| ) |
Updates a monostatic radar from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| json | The JSON string for the monostatic component. |
Definition at line 635 of file api.cpp.
References handle_api_exception(), last_error_message, and serial::update_monostatic_from_json().
Here is the call graph for this function:| int fers_update_parameters_from_json | ( | fers_context_t * | context, |
| const char * | json | ||
| ) |
Updates the global simulation parameters from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| json | The JSON string for the parameters. |
Definition at line 486 of file api.cpp.
References begin_warning_capture(), complete_warning_capture(), discard_warning_capture(), handle_api_exception(), last_error_message, and serial::update_parameters_from_json().
Here is the call graph for this function:| int fers_update_platform_from_json | ( | fers_context_t * | context, |
| uint64_t | id, | ||
| const char * | json | ||
| ) |
Updates a single platform's paths and name from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| id | The unique ID of the platform. |
| json | The JSON string for the platform. |
Definition at line 450 of file api.cpp.
References begin_warning_capture(), complete_warning_capture(), discard_warning_capture(), core::World::findPlatform(), FersContext::getWorld(), handle_api_exception(), last_error_message, and serial::update_platform_paths_from_json().
Here is the call graph for this function:| int fers_update_receiver_from_json | ( | fers_context_t * | context, |
| uint64_t | id, | ||
| const char * | json | ||
| ) |
Updates a single receiver from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| id | The unique ID of the receiver. |
| json | The JSON string for the receiver. |
Definition at line 585 of file api.cpp.
References core::World::findReceiver(), FersContext::getWorld(), handle_api_exception(), last_error_message, and serial::update_receiver_from_json().
Here is the call graph for this function:| int fers_update_scenario_from_json | ( | fers_context_t * | context, |
| const char * | scenario_json | ||
| ) |
Updates the simulation scenario from a JSON string.
This is the primary method for the UI to push its state back to the C++ core. It performs a full replacement of the existing scenario.
| context | A valid fers_context_t handle. |
| scenario_json | A null-terminated UTF-8 string containing the FERS scenario in JSON format. |
fers_get_last_error_message() to retrieve error details. Definition at line 689 of file api.cpp.
References begin_warning_capture(), complete_warning_capture(), discard_warning_capture(), logging::ERROR, handle_api_exception(), serial::json_to_world(), last_error_message, and LOG.
Here is the call graph for this function:| int fers_update_target_from_json | ( | fers_context_t * | context, |
| uint64_t | id, | ||
| const char * | json | ||
| ) |
Updates a single target from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| id | The unique ID of the target. |
| json | The JSON string for the target. |
Definition at line 610 of file api.cpp.
References core::World::findTarget(), FersContext::getWorld(), handle_api_exception(), last_error_message, and serial::update_target_from_json().
Here is the call graph for this function:| int fers_update_timing_from_json | ( | fers_context_t * | context, |
| uint64_t | id, | ||
| const char * | json | ||
| ) |
Updates a single timing source from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| id | The unique ID of the timing source. |
| json | The JSON string for the timing source. |
Definition at line 665 of file api.cpp.
References handle_api_exception(), last_error_message, and serial::update_timing_from_json().
Here is the call graph for this function:| int fers_update_transmitter_from_json | ( | fers_context_t * | context, |
| uint64_t | id, | ||
| const char * | json | ||
| ) |
Updates a single transmitter from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| id | The unique ID of the transmitter. |
| json | The JSON string for the transmitter. |
Definition at line 560 of file api.cpp.
References core::World::findTransmitter(), FersContext::getWorld(), handle_api_exception(), last_error_message, and serial::update_transmitter_from_json().
Here is the call graph for this function:| int fers_update_waveform_from_json | ( | fers_context_t * | context, |
| const char * | json | ||
| ) |
Updates a single waveform from JSON without full context recreation.
| context | A valid fers_context_t handle. |
| json | The JSON string for the waveform. |
Definition at line 537 of file api.cpp.
References handle_api_exception(), last_error_message, and serial::parse_waveform_from_json().
Here is the call graph for this function: