Screen Input Output - ilabs-kdc/bluesky GitHub Wiki

The simulation consists basically of two parts that run simultaneously (when using QtGL for the graphics, which is the default). These are the simulation part, which does all the (traffic) calculations, and the graphics part. Since these processes are separated, data needs to be send between these processes. This is done in the python file simulation/screenio.py. There are two types of sending data:

  • Events: Send data once, e.g. the command line, zoom, ... etc. This is done using a function in screenio.py which can optionally do some processing and then sending it:
def function_name(self, data):
    ...
    bs.net.send_event(b'EVENT_NAME', data)
  • Stream: Send data with a time interval, e.g. traffic data. There are four types of stream data: SIMINFO, TRAILS, ACDATA and ROUTEDATA. The stream data is send using a function in screenio.py:
def function_name(self, arguments):
    ...
    bs.net.send_stream(b'STREAM_NAME', data)

In ui/qtgl/guiclient.py the data is received and processed for the graphics part.