server#

An entry point to the backend of AirTrafficSim.

Attributes:

appFlask()

A flask server object.

socketioSocketIO()

A SocketIO object for communication.

airtrafficsim.server.server.test_connect()#

Debug function to test whether the client is connected.

airtrafficsim.server.server.test_disconnect()#

Debug function to inform the client is disconnected.

airtrafficsim.server.server.get_replay_dir()#

Get the list of directories in data/replay

airtrafficsim.server.server.get_replay_czml(replayCategory, replayFile)#

Generate a CZML file to client for replaying data.

Parameters:
replayCategorystring

The category to replay (historic / simulation)

replayFilestring

Name of the replay file directory

Returns:
{}

JSON dictionary of the CZML data file

airtrafficsim.server.server.get_graph_header(mode, replayCategory, replayFile)#

Get the list of parameters name of a file suitable for plotting graph.

Parameters:
modestring

AirTrafficSim mode (replay / simulation)

replayCategorystring

The category to replay (historic / simulation)

replayFilestring

Name of the replay file directory

Returns:
string[]

List of graph headers

airtrafficsim.server.server.get_graph_data(mode, replayCategory, replayFile, simulationFile, graph)#

Get the data for the selected parameters to plot a graph.

Parameters:
modestring

AirTrafficSim mode (replay / simulation)

replayCategorystring

The category to replay (historic / simulation)

replayFilestring

Name of the replay file directory

Returns:
{}

JSON file for graph data for Plotly.js

airtrafficsim.server.server.get_simulation_file()#

Get the list of files in airtrafficsim/env/

Returns:
string[]

List of simulation environment file names

airtrafficsim.server.server.run_simulation(file)#

Start the simulation given file name.

Parameters:
filestring

Environment file name

airtrafficsim.server.server.get_Nav(lat1, long1, lat2, long2)#

Get the navigation waypoint data given

Parameters:
lat1float

Latitude (South)

long1float

Longitude (West)

lat2float

Latitude (North)

long2float

Longitude (East)

Returns:
{}

JSON CZML file of navigation waypoint data

airtrafficsim.server.server.get_era5_wind(lat1, long1, lat2, long2, file, time)#

Get the ERA5 wind data image to client

Parameters:
lat1float

Latitude (South)

long1float

Longitude (West)

lat2float

Latitude (North)

long2float

Longitude (East)

Returns:
{}

JSON CZML file of ERA5 wind data image

airtrafficsim.server.server.get_era5_rain(lat1, long1, lat2, long2, file, time)#

Get the ERA5 rain data image to client

Parameters:
lat1float

Latitude (South)

long1float

Longitude (West)

lat2float

Latitude (North)

long2float

Longitude (East)

Returns:
{}

JSON CZML file of ERA5 rain data image

airtrafficsim.server.server.get_radar_img(lat1, long1, lat2, long2, file, time)#

Get the radar data image to client

Parameters:
lat1float

Latitude (South)

long1float

Longitude (West)

lat2float

Latitude (North)

long2float

Longitude (East)

timestring

Time in ISO format

filestring

File name of the radar image

Returns:
{}

JSON CZML file of radar data image

airtrafficsim.server.server.serve_client()#

Serve client folder to user

airtrafficsim.server.server.run_server(port=6111, host='127.0.0.1')#

Start the backend server.