Source code reference
The routes module builds the router for the provided endpoint and adds any endpoints only available for BluebirdATC, including loading which is implementation dependent.
load(category, scenario_name, runner_store)
async
End any existing run, then create a new Runner and load a given simulator scenario.
Source code in bluebird_api/routes.py
ActionInput
Bases: BaseModel
An action to be sent to the simulator.
Source code in bluebird_api/models.py
This module provides the interfaces used in all endpoints to obtain data from the runner and simulator that is being requested.
This module provides the FastAPI dependency for the runner, used to access the simulator instance, RunnerDep. To use this dependency, create an endpoint as would be done normally. As one of the arguments to the function, include the RunnerDep type alias as shown in the example below and it will be available to interact with.
from ..runner import RunnerDep @core_router.get("/wind_field", tags=["State"]) async def wind_field(runner: RunnerDep) -> WindField | None: return runner.sim.manager.environment.wind_field
If during resolution of the runner, for example trying to find the runner, the runner is not available, a HTTP error 404 (Not found) will be returned before even running the function above.
Runner
dataclass
Bases: Generic[TSimulator]
Source code in bluebird_api/runner.py
log_simrate()
Creates an entry in the file logs with the current tick frequency and evolve period of the runner.
See documentation for the event_logger.log_sim_event for more information.
Source code in bluebird_api/runner.py
runner(request)
async
Function taking the runner information from the store, and making it available for the endpoint that uses it. See module documentation for more details on usage, and an example.
Source code in bluebird_api/runner.py
This module contains all the routers for the different features available in BluebirdATC. Note that, unlike in compiled programming languages where disabled features are not included in the machine code, not including certain routers just means that the endpoint is not available but the logic will continue to be available in BluebirdATC, and therefore logged.
All the following routers are independent on the implementation of the storage of the runners and get this through the fastapi dependency. See the respective documentation in ../runnerabc.py.
Note the endpoint for loading a run, that the HMI and most clients expect, is not included here as they are dependent on the implementation of the store, which is dependent on the use case. An example of this endpoint, and any other endpoints not included within the groups defined here are available in ../routes.py