sim.frame module

Module frame contains MainFrame class which is the window to show on the screen. MainFrame is a subclass of wx.Frame.

Note

User simulation does not need to use this module.

  • Created by: CH Foh (2021)

class sim.frame.MainFrame(*args: Any, **kwargs: Any)

Bases: wx.

This is the class for the main simulation window. It is a subclass of wx.Frame. It provides various methods for the simulation engine to update the UI.

Methods

__call__(*args, **kwargs)

Call self as a function.

update_mapscale(zoom)

The simulation engine should use this method to adjust the map zoom scale.

update_mapshift(x, y)

The simulation engine should use this method to adjust the offset of map view.

update_mapsize(size_x, size_y)

The simulation engine should use this method to update the map size.

update_status_bar()

The simulation engine should use this method to trigger an update of the status bar.

update_title()

The simulation engine should use this method to trigger an update of the window frame title.

__init__(simworld)

This is the constructor.

update_title()

The simulation engine should use this method to trigger an update of the window frame title.

This method will access the following World property:

  • World.sim.name: to retrieve the scenario name

  • World.sim.progress: to retrieve the simulation progress

update_mapsize(size_x, size_y)

The simulation engine should use this method to update the map size.

update_mapshift(x, y)

The simulation engine should use this method to adjust the offset of map view.

update_mapscale(zoom)

The simulation engine should use this method to adjust the map zoom scale.

update_status_bar()

The simulation engine should use this method to trigger an update of the status bar. This should be called when the status of the simulation has changed.

This method will access the following World properties:

  • World.sim.progress: to retrieve the simulation progress

  • World.sim.speed: to retrieve the animation speed