multigp_toolkit.rhcoordinator
=============================

.. py:module:: multigp_toolkit.rhcoordinator

.. autoapi-nested-parse::

   System Event, Data, and User Interface Coordination



Attributes
----------

.. autoapisummary::

   multigp_toolkit.rhcoordinator.logger
   multigp_toolkit.rhcoordinator.T


Classes
-------

.. autoapisummary::

   multigp_toolkit.rhcoordinator.RaceSyncCoordinator


Module Contents
---------------

.. py:data:: logger

   Module logger


.. py:data:: T

   Generic for typing


.. py:class:: RaceSyncCoordinator(rhapi)

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


   .. py:attribute:: _system_verification

      Instance of the system verification module



   .. py:attribute:: _rhapi
      :type:  RHAPI.RHAPI

      Instance of RHAPI



   .. py:attribute:: _multigp

      Instance of the MultiGP API manager



   .. py:attribute:: _ui

      Instance of the toolkit user interface manager



   .. py:attribute:: _importer

      Instance of the RaceSync importer



   .. py:attribute:: _exporter

      Instance of the RaceSync exporter



   .. py:method:: startup(_args = None)

      Callback to setup specific features of the plugin on startup

      :param _args: Args passed to the callback function, defaults to None



   .. py:method:: register_aux_plugin_attrs()

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



   .. py:method:: 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

      :param _args: Args passed to the callback function, defaults to None



   .. py:method:: 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.

      :param args: Callback args



   .. py:method:: verify_creds()

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



   .. py:method:: setup_plugin()

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



   .. py:method:: _generate_event_checks()

      Lazy loaded checks before importing new event

      :yield: Object to be evaluated



   .. py:method:: _download_race_data(selected_race)

      Dowloads data for a specific race

      :param selected_race: The id of the MultiGP race to download from
      :return: The dowloaded data



   .. py:method:: _verification_checks(race_data)

      Runs system verification checks based on the imported data

      :param race_data: The data for the race
      :return: Status of checks passing



   .. py:method:: _import_event(selected_race, race_data)

      Imports all races from an event into the RotorHazard system

      :param selected_race: The selected MultiGP event imported from
      :param race_data: The race data for the MultiGP event



   .. py:method:: setup_event(_args = None)

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

      :param _args: Args passed from the event call, defaults to None



   .. py:method:: assign_zippyq_round(args)

      Assignes a zippyq round as a heat attribute

      :param args: Callback args, defaults to None



   .. py:method:: _race_pilots_checks(heat_id, gq_active)

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

      :param heat_id: ID of the heat
      :param gq_active: Whether a Global Qualifier is active or not
      :return: The status of all the checks passing



   .. py:method:: _race_zippyq_checks(heat_info)

      ZippyQ race checks

      :param heat_info: The heat information to check
      :return: The status of all the checks passing



   .. py:method:: _race_code_integrity_check()

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

      :return: The status of the check



   .. py:method:: generate_race_conditionals(heat_info)

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

      :param heat_info: The heat to verify
      :yield: Status of checks



   .. py:method:: verify_race(args)

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

      :param args: Callback args



   .. py:method:: generate_class_conditionals(raceclass)

      Generates the conditiaonl checks for a race class

      :param raceclass: The raceclass to verify meets the RaceSync requirements
      :yield: The staus of each check



   .. py:method:: verify_class(args)

      Verify a raceclass meets the requirements for RaceSync

      :param args: Input args from the callback



   .. py:method:: verify_classes(_args = None)

      Verifies all raceclasses in the database meet the RaceSync requirements

      :param _args: Input args from the callback, defaults to None



   .. py:method:: _generate_gp_format_conditionals(raceformat)

      Generates the status of each of the format checks

      :param format: The race format to check
      :yield: The status of each check



   .. py:method:: verify_format(args)

      Verifies the format to be Global Qualifier compatible

      :param args: Input args for the callback



   .. py:method:: verify_gq_lap(args)

      Verifies the source for the lap when GQ are active

      :param args: Input args for the callback



