multigp_toolkit.rhcoordinator#

System Event, Data, and User Interface Coordination

Attributes#

logger

Module logger

T

Generic for typing

Classes#

RaceSyncCoordinator

The bridge between the user interface, system events, and dataflow

Module Contents#

multigp_toolkit.rhcoordinator.logger#

Module logger

multigp_toolkit.rhcoordinator.T#

Generic for typing

class multigp_toolkit.rhcoordinator.RaceSyncCoordinator(rhapi)#

The bridge between the user interface, system events, and dataflow

Parameters:

rhapi (RHAPI.RHAPI)

_system_verification#

Instance of the system verification module

_rhapi: RHAPI.RHAPI#

Instance of RHAPI

_multigp#

Instance of the MultiGP API manager

_ui#

Instance of the toolkit user interface manager

_importer#

Instance of the RaceSync importer

_exporter#

Instance of the RaceSync exporter

startup(_args=None)#

Callback to setup specific features of the plugin on startup

Parameters:

_args (Union[dict, None]) – Args passed to the callback function, defaults to None

register_aux_plugin_attrs()#

Registers attributes used by other plugins. These attributes are only visible if the associated plugin is installed

reset_event_metadata(_args=None)#

Callback to reset all parameters used by the toolkit. Typically called when the current event in the system has been deleted or archived

Parameters:

_args (Union[dict, None]) – Args passed to the callback function, defaults to None

set_frequency_profile(args=None)#

Callback for setting the frequency profille for the server based on the active heat. Allows for switching the profile for different heats.

Parameters:

args (Union[dict, None]) – Callback args

verify_creds()#

Verify the chaper api key. Sets up the remaining features of the plugin if the chapter’s data is found.

Return type:

None

setup_plugin()#

Setup additional system events and setup the UI panels to match the system state.

Return type:

None

_generate_event_checks()#

Lazy loaded checks before importing new event

Yield:

Object to be evaluated

Return type:

collections.abc.Generator[Any, None, None]

_download_race_data(selected_race)#

Dowloads data for a specific race

Parameters:

selected_race (str) – The id of the MultiGP race to download from

Returns:

The dowloaded data

Return type:

dict

_verification_checks(race_data)#

Runs system verification checks based on the imported data

Parameters:

race_data (dict) – The data for the race

Returns:

Status of checks passing

Return type:

bool

_import_event(selected_race, race_data)#

Imports all races from an event into the RotorHazard system

Parameters:
  • selected_race (int) – The selected MultiGP event imported from

  • race_data (dict) – The race data for the MultiGP event

Return type:

None

setup_event(_args=None)#

Sets up the event from the race selected in the RHUI.

Parameters:

_args (Union[dict, None]) – Args passed from the event call, defaults to None

Return type:

None

assign_zippyq_round(args)#

Assignes a zippyq round as a heat attribute

Parameters:

args (dict) – Callback args, defaults to None

Return type:

None

_race_pilots_checks(heat_id, gq_active)#

Checks to verify pilot data is correct for RaceSync and Global Qualifier rules

Parameters:
  • heat_id (int) – ID of the heat

  • gq_active (bool) – Whether a Global Qualifier is active or not

Returns:

The status of all the checks passing

Return type:

bool

_race_zippyq_checks(heat_info)#

ZippyQ race checks

Parameters:

heat_info (Database.Heat) – The heat information to check

Returns:

The status of all the checks passing

Return type:

bool

_race_code_integrity_check()#

Checks to make sure the system is unmodified when running a Global Qualifier

Returns:

The status of the check

Return type:

bool

generate_race_conditionals(heat_info)#

Generate the conditions to run a race with a MultiGP event imported

Parameters:

heat_info (Database.Heat) – The heat to verify

Yield:

Status of checks

Return type:

collections.abc.Generator[bool, None, None]

verify_race(args)#

Check to make sure all parameters are met to run a race

Parameters:

args (Union[dict, None]) – Callback args

Return type:

None

generate_class_conditionals(raceclass)#

Generates the conditiaonl checks for a race class

Parameters:

raceclass (Database.RaceClass) – The raceclass to verify meets the RaceSync requirements

Yield:

The staus of each check

Return type:

collections.abc.Generator[bool, None, None]

verify_class(args)#

Verify a raceclass meets the requirements for RaceSync

Parameters:

args (dict) – Input args from the callback

Return type:

None

verify_classes(_args=None)#

Verifies all raceclasses in the database meet the RaceSync requirements

Parameters:

_args (Union[dict, None]) – Input args from the callback, defaults to None

Return type:

None

_generate_gp_format_conditionals(raceformat)#

Generates the status of each of the format checks

Parameters:
  • format – The race format to check

  • raceformat (Database.RaceFormat)

Yield:

The status of each check

Return type:

collections.abc.Generator[bool, None, None]

verify_format(args)#

Verifies the format to be Global Qualifier compatible

Parameters:

args (dict) – Input args for the callback

Return type:

None

verify_gq_lap(args)#

Verifies the source for the lap when GQ are active

Parameters:

args (dict) – Input args for the callback

Return type:

None