txformat_simple demonstrates some simple TX format scripts

txformat_simple.py

txformat_simple.append_info(standard)

appends information to tx

txformat_simple.destroy(standard)

destroys standard format

txformat_simple.format_number_right_digits(value, right_digits)

Formats the provided value with the correct number of right digits E.g. if value is 1.258999 and right_digits is 3, it returns “1.259”

Parameters:
  • value (float) – the number to format
  • right_digits (int) – print how many digits after the decimal point?
Returns:

the formatted value

Return type:

str

txformat_simple.log_read_meas(meas_index_or_label, number_readings)

Reads the log looking for the most recent readings of the specified measurement.

Parameters:
  • meas_index_or_label (int or string) – either the index or the label of the meas. 1 or ‘Sense1’
  • number_readings (int) – how many readings to format
Returns:

Reading’s from the Log

Return type:

Log

txformat_simple.prefix_id_1(standard)

prefixes station id

txformat_simple.prefix_id_2(standard)

prefixes station name

txformat_simple.tx_format_a1(standard)

Implements the transmission format A1. Data looks like so: Format A1: 10/16/2018,07:28:40 BATT: 12.54, 12.98 TEMP: missing MINO: missing end.

The transmission starts with a fixed header and includes date and time. Two most recent readings from every active measurement are formatted. Each measurements tarts with the label. If readings are missing, it is noted. There is a footer indicating end of message.

Parameters:standard (str) – this parameter is ignored
Returns:transmission data
Return type:str