Table Of Contents

Previous topic

blitz.communications

Next topic

client_states

This Page

boards

BoardManager

class blitz.communications.boards.BoardManager(database)[source]

A BoardManager registers expansion boards and handles parsing of raw messages and insertion into the database

get_board_descriptions(boards)[source]

Gets the descriptions of the boards given in a list

Parameters:boards – a list of board ID strings
Returns:A list of tuples. each tuple containing (ID, DESCRIPTION)
parse_message(message, session_id=None, board_id=None)[source]

Gets a variable dictionary from a board and save to database :param message: The raw message to parse :param session_id: The session ID of the message (ignore if getting cached variables) :param board_id: The id of the board to parse the message :returns: a list of variables added to the cache or data store

parse_session_message(message_tuple)[source]

Passes the received message to the board manager message parser with the appropriate session id

register_board(board_id, board)[source]

Register a board against the given ID, throwing an error if the board is already registered

BaseExpansionBoard

class blitz.communications.boards.BaseExpansionBoard(description='Base Expansion Board')[source]

A class that all client side expansion boards MUST inherit. In addition, boards which are derived from BaseExpansionBoard must call the constructor of this class in their derived class using “super”

This provides basic functionality such as parsing of raw logger messages

get_flag(flag_number)[source]

Returns the flag defined at the given bit number. This method SHOULD NOT be overridden by derived classes

get_number(start_bit, length)[source]

Get a number from the payload, breaking out bits between ‘start_bit’ and ‘length’. Note that the bits are 0 indexed - e.g. the first bit is bit #0, the second is #1, etc. This method SHOULD NOT be overridden by derived classes

get_raw_payload()[source]

Get the raw payload (an unsigned, big endian, 32 bit number) This method SHOULD NOT be overridden by derived classes

get_variables()[source]

Queries the split up binary data generated by self.parse_message and creates a dictionary of “variable”: “value” pairs. This method MUST be overridden by derived classes

parse_message(raw_message)[source]

Takes a raw binary message received from an expansion board and breaks it up into parts as described in section 4 of TS0002.

This method SHOULD NOT be overridden in derived classes. Derived classes should implement the get_variables function

register_board(manager)[source]

Registers this board (by ID) with the board manager. This method SHOULD NOT be overridden by derived classes

send_command(command)[source]

Sends a command using the preferred method of the board. Can be overridden in inherited classes to provide behaviour other than the default RS232 transmission

BlitzBasicExpansionBoard

class blitz.communications.boards.BlitzBasicExpansionBoard(description='Blitz Basic Expansion Board')[source]

A basic expansion board with three 10bit ADCs

register_signals()[source]

Connect to the board loading signal