Deck Type
decktype
Classes:
-
ButtonBlock
–Defines a button on a deck, its capabilities, its representation.
-
ButtonType
–Defines a button on a deck, its capabilities, its representation.
-
DeckType
–Description of a deck capabilities, including its representation for web decks
-
DeckTypeBase
–Description of a deck capabilities, including its representation for web decks
ButtonBlock
ButtonBlock(config: dict)
Defines a button on a deck, its capabilities, its representation.
For web decks, adds position and sizes information.
ButtonType
ButtonType(config: dict, button_block: ButtonBlock)
Defines a button on a deck, its capabilities, its representation.
For web decks, adds position and sizes information.
Methods:
-
desc
–Returns a flattened description of the button
-
display_size
–Parses info from resources.decks.*.yaml
-
get_offset
–Parses info from resources.decks.*.yaml
desc
desc() -> dict
Returns a flattened description of the button
Ready to be used by web deck
Returns:
-
dict
(dict
) –ButtonDeck description, simply flattened for web decks
display_size
display_size() -> Tuple[int, int] | None
Parses info from resources.decks.*.yaml
get_offset
get_offset(return_offset: bool = False) -> Tuple[int, int] | None
Parses info from resources.decks.*.yaml
DeckType
DeckType(filename: str)
Description of a deck capabilities, including its representation for web decks
Reads and parse deck template file
Methods:
-
desc
–Returns a flattened description of the deck
-
get_empty_button_config
–Returns a dummy working button config for "empty" hardware representation
-
init
–Parses a deck definition file and build a list of what's available.
-
is_virtual_deck
–Validate consistency between virtual deck parameters.
-
parse_deck_button_block
–Parses a deck button definition block
-
special_displays
–Returns name of all special displays (i.e. not "keys")
desc
desc() -> dict
Returns a flattened description of the deck
Ready to be used by web deck
Returns:
-
dict
–[dict]: Deck description (DeckType), simply flattened for web decks
get_empty_button_config
get_empty_button_config(key)
Returns a dummy working button config for "empty" hardware representation
init
init()
Parses a deck definition file and build a list of what's available.
Mainly a list of buttons, what can be done with each (action), and what the
button can provide as a feedback.
is_virtual_deck
is_virtual_deck() -> bool
Validate consistency between virtual deck parameters.
Virtual decks need to provide additional information (like layout).
We check for consistency between layout (used by user interface to create deck)
and information for Cockpitdecks.
Returns:
-
bool
(bool
) –Virtual deck definition is consistent or not
parse_deck_button_block
parse_deck_button_block(button_block) -> Dict[str | int, ButtonType]
Parses a deck button definition block
A ButtonType block defines either a single deck button (no repeat attribute)
or a collection of similar buttons if there is a repeat attribute.
special_displays
special_displays()
Returns name of all special displays (i.e. not "keys")
DeckTypeBase
DeckTypeBase(config: dict)
Description of a deck capabilities, including its representation for web decks
Reads and parse deck template file
Methods:
-
desc
–Returns a flattened description of the deck
-
get_empty_button_config
–Returns a dummy working button config for "empty" hardware representation
-
init
–Parses a deck definition file and build a list of what's available.
-
is_virtual_deck
–Validate consistency between virtual deck parameters.
-
parse_deck_button_block
–Parses a deck button definition block
-
special_displays
–Returns name of all special displays (i.e. not "keys")
desc
desc() -> dict
Returns a flattened description of the deck
Ready to be used by web deck
Returns:
-
dict
–[dict]: Deck description (DeckType), simply flattened for web decks
get_empty_button_config
get_empty_button_config(key)
Returns a dummy working button config for "empty" hardware representation
init
init()
Parses a deck definition file and build a list of what's available.
Mainly a list of buttons, what can be done with each (action), and what the
button can provide as a feedback.
is_virtual_deck
is_virtual_deck() -> bool
Validate consistency between virtual deck parameters.
Virtual decks need to provide additional information (like layout).
We check for consistency between layout (used by user interface to create deck)
and information for Cockpitdecks.
Returns:
-
bool
(bool
) –Virtual deck definition is consistent or not
parse_deck_button_block
parse_deck_button_block(button_block) -> Dict[str | int, ButtonType]
Parses a deck button definition block
A ButtonType block defines either a single deck button (no repeat attribute)
or a collection of similar buttons if there is a repeat attribute.
special_displays
special_displays()
Returns name of all special displays (i.e. not "keys")