pygpsclient package

Submodules

pygpsclient.about_dialog module

about_dialog.py

About Dialog Box class for PyGPSClient application.

Created on 20 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.about_dialog.AboutDialog(app, **kwargs)[source]

Bases: object

About dialog box class

__init__(app, **kwargs)[source]

Initialise Toplevel dialog

Parameters:

app (Frame) – reference to main tkinter application

pygpsclient.app module

app.py

PyGPSClient - Main tkinter application class.

  • Loads configuration from json file (if available)

  • Instantiates all frames, widgets, and protocol handlers.

  • Starts and stops threaded dialog and protocol handler processes.

  • Maintains current serial and RTK connection status.

  • Reacts to various message events, processes navigation data placed on input message queue by serial, socket or file stream reader and assigns to appropriate NMEA, UBX or RTCM protocol handler.

  • Maintains central dictionary of current key navigation data as gnss_status, for use by user-selectable widgets.

Global logging configuration is defined in __main__.py. To enable module logging, this and other subsidiary modules can use:

`self.logger = logging.getLogger(__name__)`

To override individual module loglevel, use e.g.

`self.logger.setLevel(INFO)`

Created on 12 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.app.App(master, *args, **kwargs)[source]

Bases: Frame

Main PyGPSClient GUI Application Class.

__init__(master, *args, **kwargs)[source]

Set up main application and add frames.

Parameters:
  • master (tkinter.Tk) – reference to Tk root

  • args – optional args

  • kwargs – optional kwargs

widget_toggle(name: str)[source]

Toggle widget visibility and enable or disable any UBX messages required by widget.

Parameters:

name (str) – widget name

widget_enable_messages(name: str)[source]

Enable any NMEA, UBX or RTCM messages required by widget.

Parameters:

name (str) – widget name

widget_reset()[source]

Reset widgets to default layout.

reset_gnssstatus()[source]

Reset gnss_status dict e.g. after reconnecting.

set_connection(message, color='green')[source]

Sets connection description in status bar.

Parameters:
  • message (str) – message to be displayed in connection label

  • color (str) – rgb color string

set_status(message, color='green')[source]

Sets text of status bar.

Parameters:
  • message (str) – message to be displayed in status label

  • color (str) – rgb color string

set_event(evt: str)[source]

Generate event

Parameters:

evt (str) – event type string

load_config()[source]

Load configuration file menu option.

save_config()[source]

Save configuration file menu option.

Configuration is held in two places: - app.config - widget visibility and CLI parameters - frm_settings.config - current frame and protocol handler config

update_widgets()[source]

Update widget configuration (widget_state).

If no widgets are set as “visible” in the config file, enable the status widget anyway to display a warning to this effect.

update_NTRIP_handler()[source]

Initial configuration of NTRIP handler (pygnssutils.GNSSNTRIPClient).

update_SPARTN_handler()[source]

Initial configuration of SPARTN handler (pygnssutils.GNSSMQTTClient).

start_dialog(dlg: str)[source]

Start a threaded dialog task if the dialog is not already open.

Parameters:

dlg (str) – name of dialog

stop_dialog(dlg: str)[source]

Register dialog as closed.

Parameters:

dlg (str) – name of dialog

dialog(dlg: str) Toplevel[source]

Get reference to dialog instance.

Parameters:

dlg (str) – name of dialog

Returns:

dialog instance

Return type:

Toplevel

start_sockserver_thread()[source]

Start socket server thread.

stop_sockserver_thread()[source]

Stop socket server thread.

update_clients(clients: int)[source]

Update number of connected clients in settings panel.

Parameters:

clients (int) – no of connected clients

on_exit(*args, **kwargs)[source]

Kill any running processes and quit application.

on_gnss_read(event)[source]

EVENT TRIGGERED Action on <<gnss_read>> event - data available on GNSS queue.

Parameters:

event (event) – read event

on_gnss_eof(event)[source]

EVENT TRIGGERED Action on <<sgnss_eof>> event - end of file.

Parameters:

event (event) – <<gnss_eof>> event

on_gnss_timeout(event)[source]

EVENT TRIGGERED Action on <<sgnss_timeout>> event - stream inactivity timeout.

Parameters:

event (event) – <<gnss_timeout>> event

on_stream_error(event)[source]

EVENT TRIGGERED Action on “<<gnss_error>>” event - connection streaming error.

Parameters:

event (event) – <<gnss_error>> event

on_ntrip_read(event)[source]

EVENT TRIGGERED Action on <<ntrip_read>> event - data available on NTRIP queue.

Parameters:

event (event) – read event

on_spartn_read(event)[source]

EVENT TRIGGERED Action on <<spartn_read>> event - data available on SPARTN queue.

Parameters:

event (event) – read event

update_ntrip_status(status: bool, msgt: tuple = None)[source]

Update NTRIP configuration dialog connection status.

Parameters:
  • status (bool) – connected to NTRIP server yes/no

  • msgt (tuple) – tuple of (message, color)

get_coordinates() dict[source]

Get current coordinates and fix data.

Returns:

dict of coords and fix data

Return type:

dict

process_data(raw_data: bytes, parsed_data: object, marker: str = '')[source]

Update the various GUI widgets, GPX track and log file.

Parameters:
  • raw_data (bytes) – raw message data

  • data (object parsed) – NMEAMessage, UBXMessage or RTCMMessage

  • marker (str) – string prepended to console entries e.g. “NTRIP>>”

poll_version(protocol: str = 'UBX')[source]

Poll hardware information message for device hardware & firmware version.

Parameters:

protocol (str) – protocol (UBX)

property widget_config: dict

Getter for widget configuration.

Returns:

configuration

Return type:

dict

property widgets: dict

Getter for widget state.

Returns:

widget state

Return type:

dict

property dialogs: dict

Getter for dialog state.

Returns:

dialog state

Return type:

dict

property appmaster: Tk

Getter for application master (Tk).

Returns:

reference to master Tk instance

Return type:

Tk

property conn_status: int

Getter for connection status.

Returns:

connection status e.g. 1 = CONNECTED

Return type:

int

property rtk_conn_status: int

Getter for SPARTN connection status.

Returns:

connection status

Return type:

int

svin_countdown(dur: int, valid: bool, active: bool)[source]

Countdown survey-in duration for NTRIP caster mode.

Parameters:
  • dur (int) – elapsed time

  • valid (bool) – valid flag

  • active (bool) – active flag

pygpsclient.banner_frame module

banner_frame.py

Banner frame class for PyGPSClient application.

This handles the top banner which prominently displays the current coordinates and status.

Created on 13 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.banner_frame.BannerFrame(app, *args, **kwargs)[source]

Bases: Frame

Banner frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

update_conn_status(status: int)[source]

Update connection status icon

Parameters:

status (int) – connection status as integer (0,1,2)

update_rtk_status(rtk: int = 0)[source]

Update RTK status icon.

Parameters:

rtk (int) – rtk transmit status (none = 0, ntrip = 1, spartn = 2/4)

update_transmit_status(transmit: int = 1)[source]

Update socket server status icon. - -1 = not transmitting - 0 transmitting, no clients - 1 transmitting with clients

Parameters:

transmit (int) – socket server transmit status

update_frame()[source]

Sets text of banner from GNSSStatus object.

get_size()[source]

Get current frame size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.chart_frame module

chart_frame.py

Chart frame class for PyGPSClient application.

This emulates a 4-channel “oscilloscope”, allowing the user to plot up to 4 named data attributes over time. X-axis and Y-axis scale and ranges are all configurable.

Plot limited only by the number of data points that can be comfortably held in memory.

Created on 24 Nov 2024

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

pygpsclient.chart_frame.gen_yrange() tuple[source]

Generate scale and max/min Y ranges for spinboxes.

Returns:

Y range

Return type:

tuple

class pygpsclient.chart_frame.ChartviewFrame(app, *args, **kwargs)[source]

Bases: Frame

CHartview frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset chart frame.

init_frame()[source]

Initialise spectrum chart.

update_data(parsed_data: object)[source]

Update chart data from parsed message.

Parameters:

parsed_data (object) – parsed message

flag_outofrange(chn: int, val: float)[source]

Flag if scaled value is over or under range.

Parameters:
  • chn (int) – channel number

  • val (float) – value

update_frame()[source]

Plot selected chart data.

get_size()[source]

Get current canvas size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.confirm_box module

confirm_box.py

Confirm action dialog class. Provides better consistency across different OS platforms than using messagebox.askyesno()

Created on 17 Apr 2021

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.confirm_box.ConfirmBox(parent, title, prompt)[source]

Bases: Toplevel

Confirm action dialog class. Provides better consistency across different OS platforms than using messagebox.askyesno()

Returns True if OK, False if Cancel

__init__(parent, title, prompt)[source]

Constructor

Parameters:
  • parent – parent dialog

  • title (string) – title

  • prompt (string) – prompt to be displayed

show()[source]

Show dialog

Returns:

True (OK) or False (Cancel)

Return type:

bool

pygpsclient.console_frame module

console_frame.py

Console frame class for PyGPSClient application.

This handles a scrollable text box into which the serial data is printed.

* Remember that tcl indices look like floats but they’re not! * (“1.0:, “2.0”) signifies “from the first character in line 1 (inclusive) to the first character in line 2 (exclusive)” i.e. the first line

Created on 12 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.console_frame.ConsoleFrame(app, *args, **kwargs)[source]

Bases: Frame

Console frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

update_console(consoledata: list)[source]

Print the latest data stream to the console in raw (NMEA) or parsed (key,value pair) format.

‘maxlines’ defines the maximum number of scrollable lines that are retained in the text box on a FIFO basis.

Parameters:

consoledata (list) – list of tuples (raw, parsed, marker) accumulated since last console update

property numlines: int

Get number of lines in console.

Returns:

nmber of lines

Type:

int

get_size()[source]

Get current object size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.dialog_state module

dialog_state.py

Global constants, strings and dictionaries used to maintain the state of the various threaded dialogs.

Created on 16 Aug 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

pygpsclient.dynamic_config_frame module

dynamic_config_frame.py

UBX and NMEA configuration widget for user-selected configuration commands.

When a configuration (SET) command is selected from the listbox, a POLL request is sent to the device to retrieve the current configuration, which is then used to populate a series of dynamically generated Entry widgets. The user can then amend the values as required and send the updated configuration to the device. NB: this mechanism is dependent on receiving timely POLL responses.

Created on 17 Aug 2022

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.dynamic_config_frame.Dynamic_Config_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

Dynamic configuration command panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset panel to initial settings

update_status(msg: object)[source]

UBXHandler or NMEAHandler module has received expected command response and forwarded it to this module, entry widgets are pre-populated with current configuration values and confirmation status is updated.

Parameters:

msg (object) – UBXMessage or NMEAMessage response

pygpsclient.file_handler module

file_handler.py

Filehandler class for PyGPSClient application.

This handles all the file i/o, including: - binary gnss log file - json configuration file save, load and validation - datalog export - gpx file export - SPARTN key and crt files

Created on 16 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.file_handler.FileHandler(app)[source]

Bases: object

File handler class.

__init__(app)[source]

Constructor.

Parameters:

app (Frame) – reference to main tkinter application

open_file(mode: str, exts: tuple = ('all files', '*.*')) str[source]

Generic routine to open specified file type.

Parameters:
  • mode (str) – type of file e.g. “config”, “gpxtrack” etc.

  • exts (tuple) – tuple of file types (“description”, “ext”)

Returns:

fully qualified path to file, or None if user cancelled

Return type:

str

load_config(filename: Path = '/Users/steve/pygpsclient.json') tuple[source]

Load configuration file. If filename is not provided, defaults to $HOME/pygpsclient.json, otherwise user is prompted for path.

Parameters:

filename (Path) – fully qualified filename, or None for prompt

Returns:

filename, saved settings as dictionary and any error message

Return type:

tuple

validate_config(config: dict) str[source]

Validate configuration file using type designators.

Parameters:

config (dict) – unvalidated config dict

Returns:

error message (”” = valid)

Return type:

str

save_config(config: dict, filename: Path = '/Users/steve/pygpsclient.json') str[source]

Save configuration file. If filename is not provided, defaults to $HOME/pygpsclient.json, otherwise user is prompted for filename.

Parameters:
  • config (dict) – configuration settings as dictionary

  • filename (Path) – fully qualified path to config file, or None for prompt

Returns:

return code “” = success, err str = failure

Return type:

str

set_logfile_path(initdir=PosixPath('/Users/steve')) Path[source]

Set file path.

Parameters:

initdir (str) – initial directory (HOME)

Returns:

file path

Return type:

str

open_logfile()[source]

Open logfile.

write_logfile(raw_data, parsed_data)[source]

Append data to log file. Data will be converted to bytes.

Parameters:

data – data to be logged

close_logfile()[source]

Close the logfile.

set_trackfile_path(initdir=PosixPath('/Users/steve')) Path[source]

Set track directory.

Parameters:

initdir (str) – initial directory (HOME)

Returns:

file path

Return type:

str

open_trackfile()[source]

Open track file and create GPX track header tags.

add_trackpoint(lat: float, lon: float, **kwargs)[source]

Creates GPX track point from provided parameters.

Parameters:
  • lat (float) – latitude

  • lon (float) – longitude

  • kwargs – optional gpx tags as series of key value pairs

close_trackfile()[source]

Create GPX track trailer tags and close track file.

update_gpx_track()[source]

Update GPX track with latest valid position readings.

pygpsclient.globals module

globals.py

PyGPSClient Globals

Collection of global constants

Created on 14 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.globals.Point(lat, lon)

Bases: tuple

lat

Alias for field number 0

lon

Alias for field number 1

class pygpsclient.globals.Area(lat1, lon1, lat2, lon2)

Bases: tuple

lat1

Alias for field number 0

lat2

Alias for field number 2

lon1

Alias for field number 1

lon2

Alias for field number 3

pygpsclient.globals.PointXY

alias of Point

pygpsclient.globals.AreaXY

alias of Area

pygpsclient.globals.create_circle(self, x, y, r, **kwargs)[source]

Helper method to simplify drawing circles on canvas

Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • r (int) – radius

pygpsclient.gnss_status module

gnss_status.py

GNSS Status class.

Container for the latest readings from the GNSS receiver.

Created on 07 Apr 2022

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.gnss_status.GNSSStatus[source]

Bases: object

GNSS Status class. Container for the latest readings from the GNSS receiver.

__init__()[source]

Constructor.

pygpsclient.gpx_dialog module

gpx_dialog.py

This is the pop-up dialog for the GPX Viewer function.

Created on 10 Jan 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.gpx_dialog.GPXViewerDialog(app, *args, **kwargs)[source]

Bases: Toplevel

GPXViewerDialog class.

__init__(app, *args, **kwargs)[source]

Constructor.

on_exit(*args, **kwargs)[source]

Handle Exit button press.

get_size()[source]

Get current frame size.

Returns:

window size (width, height)

Return type:

tuple

property metadata: dict

Getter for metadata.

property track: str

Getter for track.

property mapimage: PhotoImage

Getter for image of map.

pygpsclient.graphview_frame module

graphview_frame.py

Graphview frame class for PyGPSClient application.

This handles a frame containing a graph of current satellite reception.

Created on 14 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.graphview_frame.GraphviewFrame(app, *args, **kwargs)[source]

Bases: Frame

Graphview frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

init_frame()[source]

Initialise graph view

update_frame()[source]

Plot satellites’ signal-to-noise ratio (cno). Automatically adjust y axis according to number of satellites in view.

get_size()[source]

Get current canvas size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.hardware_info_frame module

hardware_info_frame.py

Hardware Information Dialog for NMEA and UBX Configuration panels.

Created on 22 Dec 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.hardware_info_frame.Hardware_Info_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

Hardware & firmware information panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset panel to initial settings

update_status(msg: object)[source]

Update pending confirmation status.

Parameters:

msg (object) – UBX or NMEA config message

pygpsclient.helpers module

helpers.py

PyGPSClient Helpers.

Collection of helper methods.

Created on 17 Apr 2021

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

pygpsclient.helpers.cel2cart(elevation: float, azimuth: float) tuple[source]

Convert celestial coordinates (degrees) to Cartesian coordinates.

Parameters:
  • elevation (float) – elevation

  • azimuth (float) – azimuth

Returns:

cartesian x,y coordinates

Return type:

tuple

pygpsclient.helpers.m2ft(meters: float) float[source]

Convert meters to feet.

Parameters:

meters (float) – meters

Returns:

feet

Return type:

float

pygpsclient.helpers.ft2m(feet: float) float[source]

Convert feet to meters.

Parameters:

feet (float) – feet

Returns:

elevation in meters

Return type:

float

pygpsclient.helpers.ms2kmph(ms: float) float[source]

Convert meters per second to kilometers per hour.

Parameters:

ms (float) – m/s

Returns:

speed in kmph

Return type:

float

pygpsclient.helpers.ms2mph(ms: float) float[source]

Convert meters per second to miles per hour.

Parameters:

ms (float) – m/s

Returns:

speed in mph

Return type:

float

pygpsclient.helpers.ms2knots(ms: float) float[source]

Convert meters per second to knots.

Parameters:

ms (float) – m/s

Returns:

speed in knots

Return type:

float

pygpsclient.helpers.kmph2ms(kmph: float) float[source]

Convert kilometers per hour to meters per second.

Parameters:

kmph (float) – kmph

Returns:

speed in m/s

Return type:

float

pygpsclient.helpers.knots2ms(knots: float) float[source]

Convert knots to meters per second.

Parameters:

knots (float) – knots

Returns:

speed in m/s

Return type:

float

pygpsclient.helpers.pos2iso6709(lat: float, lon: float, alt: float, crs: str = 'WGS_84') str[source]

convert decimal degrees and alt to iso6709 format.

Parameters:
  • lat (float) – latitude

  • lon (float) – longitude

  • alt (float) – altitude

  • crs (float) – coordinate reference system (default = WGS_84)

Returns:

position in iso6709 format

Return type:

str

pygpsclient.helpers.rgb2str(r: int, g: int, b: int) str[source]

Convert R,G,B values to RGB color string.

Parameters:
  • r (int) – red value (0-255)

  • g (int) – green value (0-255)

  • b (int) – blue value (0-255)

Returns:

RGB color string e.g. “#032a4e”

Return type:

str

pygpsclient.helpers.str2rgb(col: str) tuple[source]

Convert RGB color string to R,G,B values.

Parameters:

col (str) – RGB color string e.g. “#032a4e”

Returns:

tuple of (r,g,b) as integers

Return type:

tuple

pygpsclient.helpers.hsv2rgb(h: float, s: float, v: float) str[source]

Convert HSV values (in range 0-1) to RGB color string.

Parameters:
  • h (float) – hue (0-1)

  • s (float) – saturation (0-1)

  • v (float) – value (0-1)

Returns:

RGB color string e.g. “#032a4e”

Return type:

str

pygpsclient.helpers.col2contrast(col: str) str[source]

Find best contrasting color against background using perceived luminance (human eye favors green color).

Parameters:

col (str) – RGB color string e.g. “#032a4e”

Returns:

“black’ or “white”

Return type:

str

pygpsclient.helpers.snr2col(snr: int) str[source]

Convert satellite signal-to-noise ratio to a color high = green, low = red.

Parameters:

snr (int) – signal to noise ratio as integer

Returns:

RGB color string e.g. “#032a4e”

Return type:

str

pygpsclient.helpers.svid2gnssid(svid) int[source]

Derive gnssId from svid numbering range.

Parameters:

svid (int) – space vehicle ID

Returns:

gnssId as integer

Return type:

int

pygpsclient.helpers.get_mp_info(srt: list) dict[source]

Get mountpoint information from sourcetable entry.

Parameters:

srt (list) – sourcetable entry as list

Returns:

dictionary of mountpoint info

Return type:

dict or None if not available

pygpsclient.helpers.get_mp_distance(lat: float, lon: float, mp: list) float[source]

Get distance to mountpoint from current location (if known).

The sourcetable mountpoint entry is a list where index [0] is the name and indices [8] & [9] are the lat/lon. Not all sourcetable entries provide this information.

Parameters:
  • lat (float) – current latitude

  • lon (float) – current longitude

  • mp (list) – sourcetable mountpoint entry

Returns:

distance to mountpoint in km, or None if n/a

Return type:

float or None

pygpsclient.helpers.check_latest(name: str) str[source]

Check for latest version of module on PyPi.

Parameters:

name (str) – name of module to check

Returns:

latest version e.g. “1.3.5”

Return type:

str

pygpsclient.helpers.fix2desc(msgid: str, fix: object) str[source]

Get integer fix value for given message fix status.

Parameters:
  • msgid (str) – UBX or NMEA message identity

  • fix (object) – value representing fix type

Returns:

descriptive fix status e.g. “3D”

Return type:

str

pygpsclient.helpers.corrage2int(code: int) int[source]

Convert NAV-PVT lastCorrectionAge value to age in seconds.

Parameters:

code (int) – diff age code from NAV-PVT

Returns:

string indicating diff age in seconds

Return type:

int

pygpsclient.helpers.validURL(url: str) bool[source]

Validate URL.

Parameters:

url (str) – URL to check

Returns:

valid True/False

Return type:

bool

pygpsclient.helpers.valid_entry(entry: Entry, valmode: int, low=-2e+20, high=2e+20) bool[source]

Validates tkinter entry field and highlights it if in error.

Parameters:
  • entry (Entry) – tkinter entry widget

  • valmode (int) – int representing validation type - can be OR’d

  • low (object) – optional min value

  • high (object) – optional max value

Returns:

True/False

Return type:

bool

pygpsclient.helpers.stringvar2val(val: str, att: str) object[source]

Convert StringVar entry to appropriate attribute value type.

Parameters:
  • val (str) – StringVar value

  • att (str) – attribute type e.g. ‘U004’

Returns:

converted value

Return type:

object (int, float or bytes)

pygpsclient.helpers.set_filename(path: str, mode: str, ext: str) tuple[source]

Return timestamped file name and fully qualified file path.

Parameters:
  • path – the file path as str

  • mode – the type of file being created (‘data’, ‘track’) as str

  • ext – the file extension (‘log’, ‘gpx’) as str

Returns:

fully qualified filename and path

Return type:

tuple of (filename, filepath)

pygpsclient.helpers.date2wnotow(dat: datetime) tuple[source]

Get GPS Week number (Wno) and Time of Week (Tow) for given datetime.

GPS Epoch 0 = 6th Jan 1980

Parameters:

dat (datetime) – calendar date

Returns:

tuple of (Wno, Tow)

Return type:

tuple

pygpsclient.helpers.wnotow2date(wno: int, tow: int) datetime[source]

Get datetime from GPS Week number (Wno) and Time of Week (Tow).

GPS Epoch 0 = 6th Jan 1980

Parameters:
  • wno (int) – week number

  • tow (int) – time of week

Returns:

datetime

Return type:

datetime

pygpsclient.helpers.bitsval(bitfield: bytes, position: int, length: int) int[source]

Get unisgned integer value of masked bits in bitfield.

Parameters:
  • bitfield (bytes) – bytes

  • position (int) – position in bitfield, from leftmost bit

  • length (int) – length of masked bits

Returns:

value

Return type:

int

pygpsclient.helpers.parse_rxmspartnkey(msg: UBXMessage) list[source]

Extract dates and keys from RXM-SPARTNKEY message.

Parameters:

msg (UBXMessage) – RXM-SPARTNKEY message

Returns:

list of (key, valid from date) tuples

Return type:

list

pygpsclient.helpers.bytes2unit(valb: int) tuple[source]

Format bytes as KB, MB, GB etc such that value < 100.

Parameters:

valb (int) – bytes

Returns:

tuple of (value, units)

pygpsclient.helpers.secs2unit(secs: int) tuple[source]

Format seconds as secs, mins, hours or days such that value is > 100.

Parameters:

secs (int) – seconds

Returns:

tuple of (value, units)

Return type:

tuple

pygpsclient.helpers.fontwidth(fnt: Font, txt: str = 'W') int[source]

Get font width.

:param Font fnt:font :param txt: reference text (“W”) :return: font width in pixels :rtype: int

pygpsclient.helpers.fontheight(fnt: Font) int[source]

Get font height.

Parameters:

fnt (Font) – font

Returns:

font height in pixels

Return type:

int

pygpsclient.helpers.scale_font(width: int, basesize: int, txtwidth: int, maxsize: int = 0, fnt: Font = None) tuple[source]

Scale font size to widget width.

Parameters:
  • width (int) – widget width

  • bassiz (int) – base font size

  • txtwidth (int) – reference text width

  • maxsiz (int) – max font size

  • fnt (Font) – default font

Returns:

tuple of scaled font, font height

Return type:

tuple

pygpsclient.helpers.setubxrate(app: object, mid: str, rate: int = 1, prot: str = 'UBX') UBXMessage[source]

Set rate on specified UBX message on default port(s).

Uses either CFG-MSG or CFG-VALSET command, depending on device ROM version.

The port(s) this applies to are defined in the ‘defaultport_s’ configuration setting as a comma-separated string e.g. “USB,UART1”.

Rate is relative to navigation solution e.g. a rate of ‘4’ means ‘every 4th navigation solution’ (higher = less frequent).

Parameters:
  • application (object) – reference to calling application

  • mid (str) – message identity e.g. “MON-SPAN”

  • rate (int) – message rate (0 = off)

  • prot (str) – message protocol (“UBX”, “NMEA_ID”, “PUBX_ID”, “RTCM_3X_TYPE”)

Returns:

UBX set rate command

Return type:

UBXMessage

Raises:

ValueError if unknown message identity

pygpsclient.helpers.val2sphp(val: float, scale: float) tuple[source]

Convert a float value into separate standard and high precisions components, multiplied by a scaling factor to render them as integers.

As required by e.g. UBX CFG-TMODE command.

Parameters:
  • val (float) – value as float

  • scale (float) – scaling factor e.g. 1e-7

Returns:

tuple of (standard precision, high precision)

Return type:

tuple

pygpsclient.helpers.config_nmea(state: int, port_type: str = 'USB') UBXMessage[source]

Enable or disable NMEA messages at port level and use minimum UBX instead (NAV-PRT, NAV_SAT, NAV_DOP).

Parameters:
  • state (int) – 1 = disable NMEA, 0 = enable NMEA

  • port_type (str) – port that rcvr is connected on

pygpsclient.helpers.ned2vector(n: float, e: float, d: float) tuple[source]

Convert N,E,D relative position to 2D heading and distance.

Parameters:
  • n (float) – north coordinate

  • e (float) – east coordinate

  • d (float) – down coordinate

Returns:

tuple of distance, heading

Return type:

tuple

pygpsclient.helpers.isot2dt(tim: str) datetime[source]

Format datetime from ISO time element.

Parameters:

tim (str) – iso time from trackpoint

Returns:

datetime

Return type:

datetime

pygpsclient.helpers.publicip() str[source]

Get public IP address from ipinfo REST API.

Returns:

Public IP address as string, or “N/A’ if not available.

pygpsclient.helpers.lanip() str[source]

Get LAN IP address via socket connection info.

Returns:

LAN IP address as string, or “N/A’ if not available.

pygpsclient.helpers.get_point_at_vector(start: Point, dist: float, bearing: float, radius: float = 6378137.0) Point[source]

Get new point at vector from start position.

Parameters:
  • start (Point) – starting position

  • dist (float) – vector distance

  • bearing (float) – vector bearing (true)

  • radius (float) – optional radius of sphere, defaults to mean radius of earth

Returns:

new position as lat/lon

Return type:

Point

pygpsclient.helpers.in_bounds(bounds: Area, point: Point) bool[source]

Check if given point is within canvas bounding box.

Parameters:
  • bounds (Area) – bounding box

  • point (Point) – point

Returns:

true/false

Return type:

bool

pygpsclient.helpers.reorder_range(valuerange: tuple, default) tuple[source]

Reorder range so default is first value (e.g. for spinbox objects).

Parameters:
  • valuerange (tuple) – range

  • default (object) – starting value

Returns:

range starting with default

Return type:

tuple

pygpsclient.helpers.ll2xy(width: int, height: int, bounds: Area, position: Point) tuple[source]

Convert lat/lon to canvas x/y.

Parameters:
  • width (int) – canvas width

  • height (int) – canvas height

  • bounds (Area) – lat/lon bounds of canvas

  • coordinate (Point) – lat/lon

Returns:

x,y canvas coordinates

Return type:

tuple

pygpsclient.helpers.xy2ll(width: int, height: int, bounds: Area, xy: tuple) Point[source]

Convert canvas x/y to lat/lon.

Parameters:
  • width (int) – canvas width

  • height (int) – canvas height

  • bounds (Area) – lat/lon bounds of canvas

  • xy (tuple) – canvas x/y coordinate

Returns:

lat/lon

Return type:

Point

pygpsclient.helpers.data2xy(width: int, height: int, bounds: Area, xdata: float, ydata: float, xoffset: float = 0, yoffset: float = 0) tuple[source]

Convert datapoint x,y to canvas x,y. Y is vertical axis.

Parameters:
  • width (int) – canvas width

  • height (int) – canvas height

  • bounds (AreaXY) – x,y bounds of data

  • xdata (float) – datapoint x

  • ydata (float) – datapoint y

  • xoffset (float) – canvas x offset

  • yoffset (float) – canvas y offset

Returns:

x,y canvas coordinates

Return type:

tuple

pygpsclient.helpers.xy2data(width: int, height: int, bounds: Area, x: int, y: int, xoffset: int = 0, yoffset: int = 0) tuple[source]

Convert canvas x,y to datapoint x,y. Y is vertical axis.

Parameters:
  • width (int) – canvas width

  • height (int) – canvas height

  • bounds (AreaXY) – x,y bounds of data

  • x (int) – canvas x coordinate

  • y (int) – canvas y coordinate

  • xoffset (float) – canvas x offset

  • yoffset (float) – canvas y offset

Returns:

xdata, ydata

Return type:

tuple

pygpsclient.helpers.points2area(points: tuple) Area[source]

Convert 4 points to Area.

Points in order (minlat, minlon, maxlat, maxlon)

Parameters:

points (tuple) – tuple of points

Raises:

TypeError – if less than 4 points provided

Returns:

area

:rtype Area

pygpsclient.helpers.limittrack(track: list, limit: int = 500) list[source]

Limit number of points in track.

Parameters:
  • track (list) – list of Points

  • limit (int) – max points

Returns:

limited list of Points

pygpsclient.helpers.get_grid(num: int = 10, start: int = 0, stop: int = 1, endpoint: bool = True) tuple[source]

Generate linear grid steps for graphing widgets.

Parameters:
  • num (int) – number of increments (10)

  • start (int) – start point (0)

  • stop (int) – end point (1)

  • endpoint (bool) – include endpoint (True)

Returns:

linear grid increments

Return type:

tuple

pygpsclient.helpers.time2str(tim: float, sformat: str = '%H:%M:%S') str[source]

Convert time float to formatted string.

Parameters:
  • tim (float) – time as float (seconds since 1970-01-01-00:00:00)

  • sformat (str) – string format (“%H:%M:%S”)

Returns:

formated time string

Return type:

str

pygpsclient.helpers.ubx2preset(msgs: tuple, desc: str = '') str[source]

Convert one or more UBXMessages to format suitable for adding to user-defined preset list ubxpresets_l in PyGPSClient *.json configuration files.

The format is: “<description>, <talker>, <msgID>, <payload as hexadecimal string>, <msgmode>”

e.g. “Set NMEA High Precision Mode, CFG, CFG-VALSET, 000100000600931001, 1”

Parameters:
  • msgs (tuple) – UBXMessage or tuple of UBXmessages

  • desc (str) – preset description

Returns:

preset string

Return type:

str

pygpsclient.helpers.nmea2preset(msgs: tuple, desc: str = '') str[source]

Convert one or more NMEAMessages to format suitable for adding to user-defined preset list nmeapresets_l in PyGPSClient *.json configuration files.

The format is: “<description>; <talker>; <msgID>; <payload as comma separated list>; <msgmode>”

e.g. “Configure Signals; P; QTMCFGSIGNAL; W,7,3,F,3F,7,1; 1”

Parameters:
  • msgs (tuple) – NMEAmessage or tuple of NMEAmessages

  • desc (str) – preset description

Returns:

preset string

Return type:

str

pygpsclient.importmap_dialog module

importmap_dialog.py

This is the pop-up dialog for the custom map import function.

Created on 14 Sep 2024

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.importmap_dialog.ImportMapDialog(app, *args, **kwargs)[source]

Bases: Toplevel

ImportMapDialog class.

__init__(app, *args, **kwargs)[source]

Constructor.

on_exit(*args, **kwargs)[source]

Handle Exit button press.

get_size()[source]

Get current frame size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.map_frame module

map_frame.py

Mapview frame class for PyGPSClient application.

This handles a frame containing a location map which can be either:

  • one or more fixed offline maps based on user-provided georeferenced images e.g. geoTIFF (defaults to Mercator world image).

  • dynamic online map or satellite image accessed via a MapQuest API.

NOTE: The free MapQuest API key is subject to a limit of 15,000 transactions / month, or roughly 500 / day, so the map updates are only run periodically (once a minute). This utility is NOT intended to be used for real time navigation.

Created on 13 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.map_frame.MapviewFrame(app, *args, **kwargs)[source]

Bases: Frame

Map frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

init_frame()[source]

Initialise map.

on_maptype(var, index, mode)[source]

Set maptype event binding.

on_refresh(event)[source]

Trigger refresh of web map.

Parameters:

event – event

on_zoom(event)[source]

Trigger zoom in or out.

Left click (event.num = 1) increments zoom by 1. Right click (event.num = 2/3) increments zoom to maximum extent.

Parameters:

event – event

on_mark(event)[source]

Mouse click shows position in custom view.

Parameters:

event – right click event

update_frame()[source]

Draw map and mark current known position and horizontal accuracy (where available).

reset_map_refresh()[source]

Reset map refresh counter to zero

get_size()[source]

Get current canvas size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.mapquest module

mapquest.py

MapQuest API Constants and Methods.

MapQuest polygon compression and decompression routines adapted from the original javascript examples:

https://developer.mapquest.com/documentation/api/static-map/ https://developer.mapquest.com/documentation/common/encode-decode/

Created on 04 May 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

pygpsclient.mapquest.compress_track(track: tuple, precision: int = 6, limit: int = 500) str[source]

Convert track to compressed Mapquest format.

Parameters:
  • track (tuple) – tuple of Points

  • precision (int) – no decimal places precision (6)

  • limit (int) – max no of points (500)

Returns:

compressed track

Return type:

str

pygpsclient.mapquest.format_mapquest_request(mqapikey: str, maptype: str, width: int, height: int, zoom: int, locations: tuple, bbox: Area = None, hacc: float = 0)[source]

Formats URL for web map download.

Parameters:
  • mqapikey (str) – MapQuest API key

  • maptype (str) – “map” or “sat”

  • width (int) – width of canvas

  • height (int) – height of canvas

  • zoom (int) – zoom factor

  • locations (tuple) – tuple of Points

  • bbox (Area) – bounding box (will override zoom)

  • hacc (float) – horizontal accuracy

Returns:

formatted MapQuest URL

Return type:

str

pygpsclient.mapquest.mapq_encode(num: int) str[source]

Encode number representing character.

Parameters:

num (int) – number to encode

Returns:

encoded number as string

Return type:

str

pygpsclient.mapquest.mapq_decompress(encoded: str, precision: int = 6) list[source]

Decompress polygon for MapQuest API.

Parameters:
  • encoded (str) – polygon encoded as string

  • precision (int) – no decimal places precision (6)

Returns:

polygon as list of point tuples (lat,lon)

Return type:

list

pygpsclient.mapquest.mapq_compress(points: list, precision: int = 6) str[source]

Compress polygon for MapQuest API.

Parameters:
  • points (list) – polygon as list of point tuples (lat, lon)

  • precision (int) – no decimal places precision (6)

Returns:

polygon encoded as string

Return type:

string

pygpsclient.menu_bar module

menu_bar.py

Menubar class for PyGPSClient application.

This handles the menu bar.

Created on 12 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.menu_bar.MenuBar(app, *args, **kwargs)[source]

Bases: Menu

Menu bar class.

__init__(app, *args, **kwargs)[source]

Constructor

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Menu parent class

  • kwargs – optional kwargs to pass to Menu parent class

pygpsclient.nmea_config_dialog module

nmea_config_dialog.py

NMEA configuration container dialog

This is the pop-up dialog containing the various proprietary NMEA configuration command frames.

Supply initial settings via config keyword argument.

Created on 22 Mar 2025

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.nmea_config_dialog.NMEAConfigDialog(app, *args, **kwargs)[source]

Bases: Toplevel

, NMEAConfigDialog class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to parent class (not currently used)

  • kwargs – optional kwargs to pass to parent class (not currently used)

set_pending(msgid: int, ubxfrm: int)[source]

Set pending confirmation flag for NMEA configuration frame to signify that it’s waiting for a confirmation message.

Parameters:
  • msgid (int) – NMEA message identity

  • ubxfrm (int) – integer representing UBX configuration frame (0-6)

update_pending(msg: NMEAMessage)[source]

Receives polled confirmation message from the nmea_handler and updates whichever NMEA config frame is waiting for this confirmation.

Parameters:

msg (NMEAMessage) – NMEA config message

set_status(message: str, color: str = '')[source]

Set status message.

Parameters:
  • message (str) – message to be displayed

  • color (str) – rgb color of text (blue)

on_exit(*args, **kwargs)[source]

Handle Exit button press.

get_size()[source]

Get current frame size.

Returns:

window size (width, height)

Return type:

tuple

property container

Getter for container frame.

Returns:

reference to container frame

Return type:

tkinter.Frame

send_command(msg: NMEAMessage)[source]

Send command to receiver.

pygpsclient.nmea_handler module

nmea_handler.py

NMEA Protocol handler - handles all incoming standard and proprietary NMEA sentences.

Parses individual NMEA sentences (using pynmeagps library) and adds selected attribute values to the app.gnss_status data dictionary. This dictionary is then used to periodically update the various user-selectable widgets.

Created on 30 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.nmea_handler.NMEAHandler(app)[source]

Bases: object

NMEA handler class.

__init__(app)[source]

Constructor.

Parameters:

app (Frame) – reference to main tkinter application

process_data(raw_data: bytes, parsed_data: object)[source]

Process relevant NMEA message types

Parameters:
  • raw_data (bytes) – raw_data

  • parsed_data (NMEAMessage) – parsed data

pygpsclient.nmea_preset_frame module

nmea_preset_frame.py

NMEA Configuration frame for preset and user-defined commands

Created on 22 Mar 2025

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.nmea_preset_frame.NMEA_PRESET_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

NMEA Preset and User-defined configuration command panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset panel - Load user-defined presets if there are any.

update_status(msg: NMEAMessage)[source]

Update pending confirmation status.

Parameters:

msg (NMEAMessage) – NMEA config message

pygpsclient.ntrip_client_dialog module

nmea_client_dialog.py

NTRIP client container dialog

This is the pop-up dialog containing the various NTRIP client configuration functions.

NB: The initial configuration for the NTRIP client (pygnssutils.GNSSNTRIPClient) is set in app.update_NTRIP_handler(). Once started, the persisted state for the NTRIP client is held in the threaded NTRIP handler itself, NOT in this frame.

Created on 2 Apr 2022

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ntrip_client_dialog.NTRIPConfigDialog(app, *args, **kwargs)[source]

Bases: Toplevel

, NTRIPConfigDialog class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to parent class (not currently used)

  • kwargs – optional kwargs to pass to parent class (not currently used)

set_controls(connected: bool, msgt: tuple = None)[source]

Set App RTK connection status and enable or disable controls depending on connection status.

Parameters:
  • status (bool) – connection status (True/False)

  • msgt (tuple) – tuple of (message, color)

set_status(message: str, color: str = '')[source]

Set status message.

Parameters:
  • message (str) – message to be displayed

  • color (str) – rgb color of text

on_exit(*args, **kwargs)[source]

Handle Exit button press.

get_size()[source]

Get current frame size.

Returns:

window size (width, height)

Return type:

tuple

update_sourcetable(stable: list)[source]

Update sourcetable listbox for this NTRIP server.

Parameters:

stable (list) – sourcetable

set_mp_dist(dist: float, name: str = '', info: str = '')[source]

Set mountpoint distance label.

Parameters:

dist (float) – distance to mountpoint km

pygpsclient.rover_frame module

rover_frame.py

Rover frame class for PyGPS Application.

This plots the relative 2D position of the rover in a fixed or moving base RTK configuration.

Created on 22 Aug 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.rover_frame.RoverFrame(app, *args, **kwargs)[source]

Bases: Frame

Rover view frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – Optional args to pass to Frame parent class

  • kwargs – Optional kwargs to pass to Frame parent class

init_frame()[source]

Initialize plot.

update_frame()[source]

Collect relative position data and update the plot.

get_point(hdg: float, dis: float, cx: int, cy: int) tuple[source]

Get point on chart.

Parameters:
  • hdg (float) – heading in degrees

  • dis (float) – length in cm

  • cx (int) – width / 2

  • cy (int) – height / 2

Returns:

x.y plot coordinates

Return type:

tuple

store_track(hdg: float, dis: float, mx: int = 100, dp: int = 5)[source]

Append historical track of relative position. Remove every nth point if track is full.

Parameters:
  • hdg (float) – heading in degrees

  • dis (float) – length in cm

  • mx (int) – maximum points in track

  • dp (int) – decimal places tolerance

enable_messages(status: int)[source]

Enable/disable UBX NAV-RELPOSNED message on default port(s).

Parameters:

status (int) – 0 = off, 1 = on

get_size() tuple[source]

Get current canvas size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.rtcm3_handler module

rtcm3_handler.py

RTCM Protocol handler - handles all incoming RTCM messages.

Parses individual RTCM3 sentences (using pyrtcm library).

Created on 10 Apr 2022

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.rtcm3_handler.RTCM3Handler(app)[source]

Bases: object

RTCM3 handler class.

__init__(app)[source]

Constructor.

Parameters:

app (Frame) – reference to main tkinter application

process_data(raw_data: bytes, parsed_data: object)[source]

Process relevant RTCM message types

Parameters:
  • raw_data (bytes) – raw_data

  • parsed_data (RTCMMessage) – parsed data

pygpsclient.scatter_frame module

scatter_frame.py

Scatterplot frame class for PyGPSClient Application.

This generates a scatterplot of positions, centered on either the cumulative average position or a fixed reference position.

The fixed reference position can be stored in the json configuration file as scatterlat_f/scatterlon_f.

Created 23 March 2023

Completely rewritten by semuadmin 5 Nov 2024 to use bounding box rather than polar coordinations, and allow right-click fixed reference selection.

author:

Nathan Michaels, semuadmin

copyright:

2024 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.scatter_frame.ScatterViewFrame(app, *args, **kwargs)[source]

Bases: Frame

Scatterplot view frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – Optional args to pass to Frame parent class

  • kwargs – Optional kwargs to pass to Frame parent class

get_range_label() tuple[source]

Set range value and units according to magnitude.

Returns:

range, units

Return type:

tuple

update_frame()[source]

Collect scatterplot data and update the plot.

get_size() tuple[source]

Get current canvas size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.serialconfig_frame module

serialconfig_frame.py

Generic serial port configuration Frame subclass for use in tkinter applications which require a serial port configuration facility.

Supply initial settings via saved-config keyword argument.

Exposes the serial port settings as properties.

Application icons from https://iconmonstr.com/license/.

Created on 24 Dec 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.serialconfig_frame.SerialConfigFrame(app, container, *args, **kwargs)[source]

Bases: Frame

Serial port configuration frame class.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • container (tkinter.Frame) – reference to container frame

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs for value ranges, or to pass to Frame parent class

reset()[source]

Reset settings to defaults (first value in range).

set_status(status: int = 0)[source]

Set connection status, which determines whether controls are enabled or not: 0=DISCONNECTED, 1=CONNECTED, 2=CONNECTED_FILE, 3=NOPORTS.

Parameters:

status (int) – status (0,1,2,3)

property status: int

Getter for status flag: 0=DISCONNECTED, 1=CONNECTED, 2=CONNECTED_FILE, 3=NOPORTS.

Returns:

status flag (0,1,2,3)

Return type:

int

property port: str

Getter for port.

Returns:

selected port

Return type:

str

property port_desc: str

Getter for port description.

Returns:

selected port description

Return type:

str

property bpsrate: int

Getter for bps rate (commonly but incorrectly referred to as baud rate).

Returns:

selected baudrate

Return type:

int

property databits: int

Getter for databits.

Returns:

selected databits

Return type:

int

property stopbits: float

Getter for stopbits.

Returns:

selected stopbits

Return type:

float

property parity: str

Getter for parity.

Returns:

selected parity

Return type:

str

property rtscts: bool

Getter for rts/cts.

Returns:

selected rts/cts

Return type:

bool

property xonxoff: bool

Getter for xon/xoff.

Returns:

selected xon/xoff

Return type:

bool

property timeout: float

Getter for timeout.

Returns:

selected timeout

Return type:

float (or None)

property msgmode: int

Return message parsing mode Default is GET i.e. input from receiver.

Returns:

message mode 0 = POLL 1 = SET, 2 = POLL, 3 = SETPOLL

Return type:

int

property userport: str

Return user-defined port

Returns:

user-defined serial port

Return type:

str

property inactivity_timeout: int

Return inactivity timeout

Returns:

timeout in seconds

Return type:

int

pygpsclient.serverconfig_frame module

serverconfig_frame.py

Socket Server / NTRIP caster configuration panel Frame class. Supports two modes of operation - Socket Server and NTRIP Caster.

If running in NTRIP Caster mode, two base station modes are available - Survey-In and Fixed. The panel provides methods to configure RTK-compatible receiver (e.g. ZED-F9P) to operate in either of these base station modes.

Supply initial settings via saved-config keyword argument.

Application icons from https://iconmonstr.com/license/.

Created on 23 Jul 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.serverconfig_frame.ServerConfigFrame(app, container, *args, **kwargs)[source]

Bases: Frame

Server configuration frame class.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs for value ranges, or to pass to Frame parent class

reset()[source]

Reset settings to defaults.

set_status(status: int)[source]

Set connection status, which determines whether controls are enabled or not: 0=DISCONNECTED, 1=CONNECTED

Parameters:

status (int) – status (0,1)

property clients: int

Getter for number of socket clients.

svin_countdown(ela: int, valid: bool, active: bool)[source]

Display countdown of remaining survey-in duration.

Parameters:
  • ela (int) – elapsed time

  • valid (bool) – SVIN validity status

  • active (bool) – SVIN active status

property socketserving: bool

Getter for socket serve flag.

Returns:

server running True/False

Return type:

bool

pygpsclient.settings_frame module

settings_frame.py

Settings frame class for PyGPSClient application.

  • Holds all the latest settings in self.config

  • Sets initial (saved) configuration of the following frames:

  • frm_settings (SettingsFrame class) for general application settings.

  • frm_serial (SerialConfigFrame class) for serial port settings.

  • frm_socketclient (SocketConfigFrame class) for socket client settings.

  • frm_socketserver (ServerConfigFrame class) for socket server settings.

Created on 12 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.settings_frame.SettingsFrame(app, *args, **kwargs)[source]

Bases: Frame

Settings frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

on_expand()[source]

Automatically expand container canvas when sub-frames are resized.

reset()[source]

Reset settings to defaults.

enable_controls(status: int)[source]

Public method to enable or disable controls depending on connection status.

Parameters:

status (int) – connection status as integer (0=Disconnected, 1=Connected to serial, 2=Connected to file, 3=No serial ports available)

get_size() tuple[source]

Get current frame size.

Returns:

(width, height)

Return type:

tuple

property config: dict

Getter for current configuration settings from all frames and protocol handlers. Use the output from this function to save configuration settings to a *.json config file.

Returns:

settings as dictionary

Return type:

dict

pygpsclient.skyview_frame module

skyview_frame.py

Satview frame class for PyGPSClient application.

This handles a frame containing a 2D plot of satellite visibility.

Created on 13 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.skyview_frame.SkyviewFrame(app, *args, **kwargs)[source]

Bases: Frame

Skyview frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

init_frame()[source]

Initialise satellite view

update_frame()[source]

Plot satellites’ elevation and azimuth position.

get_size()[source]

Get current canvas size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.socketconfig_frame module

socketconfig_frame.py

Generic socket configuration Frame subclass for use in tkinter applications which require a socket configuration facility.

Supply initial settings via saved-config keyword argument.

Application icons from https://iconmonstr.com/license/.

Created on 27 Apr 2022

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.socketconfig_frame.SocketConfigFrame(app, container, *args, **kwargs)[source]

Bases: Frame

Socket configuration frame class.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • container (tkinter.Frame) – reference to container frame

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs for value ranges, or to pass to Frame parent class

reset()[source]

Reset settings to defaults (first value in range).

valid_settings() bool[source]

Validate settings.

Returns:

valid True/False

Return type:

bool

set_status(status: int = 0)[source]

Set connection status, which determines whether controls are enabled or not: 0=DISCONNECTED, 1=CONNECTED

Parameters:

status (int) – status (0,1)

pygpsclient.spartn_dialog module

spartn_dialog.py

SPARTN configuration dialog

This is the pop-up dialog containing the various SPARTN configuration functions.

Created on 26 Jan 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.spartn_dialog.SPARTNConfigDialog(app, *args, **kwargs)[source]

Bases: Toplevel

, SPARTNConfigDialog class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to parent class (not currently used)

  • kwargs – optional kwargs to pass to parent class (not currently used)

set_status(message: str, color: str = '')[source]

Set status message. :param str message: message to be displayed :param str color: rgb color of text

on_exit(*args, **kwargs)[source]

Handle Exit button press.

set_pending(msgid: int, spartnfrm: int)[source]

Set pending confirmation flag for UBX configuration frame to signify that it’s waiting for a confirmation message.

Parameters:
  • msgid (int) – UBX message identity

  • spartnfrm (int) – integer representing SPARTN configuration frame

update_pending(msg: UBXMessage)[source]

Update pending confirmation status. :param UBXMessage msg: UBX config message

set_controls(status: bool, msgt: tuple = None)[source]

Set controls in IP or L-Band clients.

Parameters:
  • status (bool) – connected to SPARTN server yes/no

  • msgt (tuple) – tuple of (message, color)

disconnect_ip(msg: str = '')[source]

Disconnect from IP (MQTT) client.

Parameters:

msg (str) – optional disconnection message

disconnect_lband(msg: str = '')[source]

Disconnect from L-Band client.

Parameters:

msg (str) – optional disconnection message

property container

Getter for container.

property server: str

Getter for server.

Returns:

server

Return type:

str

property clientid: str

Getter for Client ID from IP configuration dialog.

Returns:

client ID

Return type:

str

pygpsclient.spartn_gnss_frame module

spartn_gnss_frame.py

SPARTN GNSS Receiver configuration dialog.

This handles the configuration of the GNSS receiver to receive and decrypt incoming SPARTN RTK messages.

FYI CFG_NAVSPG_CONSTR_DGNSSTO governs how quickly rcvr drops out of RTK mode after loss of correction signal - default is 60 seconds but this may need to be increased if the correction source is intermittent.

Created on 26 Jan 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.spartn_gnss_frame.SPARTNGNSSDialog(app, container, *args, **kwargs)[source]

Bases: Frame

, SPARTNConfigDialog class.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame

  • args – optional args to pass to parent class (not currently used)

  • kwargs – optional kwargs to pass to parent class (not currently used)

update_status(msg: UBXMessage)[source]

Update pending confirmation status. :param UBXMessage msg: UBX config message

pygpsclient.spartn_json_config module

spartn_json_config.py

Utility class to load SPARTN decryption configuration from JSON file provided by ThingStream PointPerfect location service. Requires paid subscription.

JSON file normally named “device-{Client ID}-ucenter-config.json”

Created on 12 Feb 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.spartn_json_config.SpartnJsonConfig(filename)[source]

Bases: object

SpartnJsonConfig class.

__init__(filename)[source]

Constructor.

Parameters:

filename (str) – Fully qualified path to JSON file

property clientid: str

Getter for ClientID.

Returns:

clientID

Return type:

str

property server: str

Getter for Server URI.

Returns:

Server UIR

Return type:

str

property topics: list

Getter for topics.

Returns:

list of topics

Return type:

list

property key: str

Getter for Key.

Returns:

Key

Return type:

str

property cert: str

Getter for Certificate.

Returns:

Certificate

Return type:

str

property rootca: str

Getter for RootCA.

Returns:

RootCA

Return type:

str

property current_key: tuple

Getter for current key.

Returns:

tuple of (key, start date, end date)

Return type:

tuple

property next_key: tuple

Getter for next key.

Returns:

tuple of (key, start date, end date)

Return type:

tuple

pygpsclient.spartn_lband_frame module

spartn_lband_frame.py

SPARTN L-Band Correction receiver configuration dialog.

This handles the configuration of the L-Band receiver (e.g. u-blox D9S) for the selected region.

Supply initial settings via config keyword argument.

Created on 26 Jan 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.spartn_lband_frame.SpartnLbandDialog(app, container, *args, **kwargs)[source]

Bases: Frame

, SPARTNConfigDialog class.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame

  • args – optional args to pass to parent class (not currently used)

  • kwargs – optional kwargs to pass to parent class (not currently used)

set_controls(status: int)[source]

Enable or disable widgets depending on connection status.

Parameters:

status (int) – connection status (0 = disconnected, 1 = connected)

on_connect()[source]

Connect to Correction receiver.

on_disconnect(msg: str = '')[source]

Disconnect from L-Band Correction receiver.

Parameters:

msg (str) – optional disconnection message

on_error(event)[source]

EVENT TRIGGERED Action on <<spartn_error>> event - disconnect.

Parameters:

event (event) – read event

update_status(msg: UBXMessage)[source]

Update pending confirmation status. :param UBXMessage msg: UBX config message

property settings: dict

Getter for settings.

Returns:

dictionary of settings

Return type:

dict

pygpsclient.spartn_mqtt_frame module

spartn_mqtt_frame.py

SPARTN configuration dialog

This is the pop-up dialog containing the various SPARTN configuration functions.

NB: The initial configuration for the SPARTN MQTT client (pygnssutils.GNSSMQTTClient) is set in app.update_SPARTN_handler(). Once started, the persisted state for the SPARTN MQTT client is held in the threaded SPARTN handler itself, NOT in this frame.

Created on 26 Jan 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.spartn_mqtt_frame.SPARTNMQTTDialog(app, container, *args, **kwargs)[source]

Bases: Frame

, SPARTNConfigDialog class.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame

  • args – optional args to pass to parent class (not currently used)

  • kwargs – optional kwargs to pass to parent class (not currently used)

set_controls(status: int)[source]

Enable or disable MQTT Correction widgets depending on connection status.

Parameters:

status (int) – connection status (0 = disconnected, 1 = connected)

on_connect()[source]

Connect to MQTT client.

on_disconnect(msg: str = '')[source]

Disconnect from MQTT client.

Parameters:

msg (str) – optional disconnection message

update_status(msg: UBXMessage)[source]

Update pending confirmation status. :param UBXMessage msg: UBX config message

property clientid: str

Getter for Client ID.

Returns:

client ID

Return type:

str

pygpsclient.spectrum_frame module

spectrum_frame.py

Spectrum Analysis frame class for PyGPSClient application.

This handles a frame containing a spectrum analysis chart from a MON-SPAN message.

Created on 23 Dec 2022

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.spectrum_frame.SpectrumviewFrame(app, *args, **kwargs)[source]

Bases: Frame

Spectrumview frame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

init_frame()[source]

Initialise spectrum chart.

reset()[source]

Reset spectrumview frame.

enable_messages(status: bool)[source]

Enable/disable UBX MON-SPAN message.

Parameters:

status (bool) – 0 = off, 1 = on

update_pending(msg: UBXMessage)[source]

Receives polled confirmation message from the ubx_handler and updates spectrumview canvas.

Parameters:

msg (UBXMessage) – UBX config message

update_frame()[source]

Plot MON-SPAN spectrum analysis.

spectrum_data is list of tuples (spec, spn, res, ctr, pga), one item per RF block.

get_size()[source]

Get current canvas size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.status_frame module

status_frane.py

Status Bar frame class for PyGPSClient application.

This handles the status bar notifications at the foot of the window.

Created on 12 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.status_frame.StatusFrame(app, *args, **kwargs)[source]

Bases: Frame

Status bar frame class.

__init__(app, *args, **kwargs)[source]

Constructor

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

set_connection(connection: str, color: str = '')[source]

Sets connection description in status bar.

Parameters:
  • connection (str) – description of connection

  • color (str) – rgb color string (default=blue)

set_status(message, color: str = '')[source]

Sets message in status bar.

Parameters:
  • message (str) – message to be displayed in status bar

  • color (str) – rgb color string (default=blue)

clear_status()[source]

Clears status bar.

get_size()[source]

Get current frame size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.stream_handler module

stream_handler.py

StreamHandler class for PyGPSClient application.

This handles all the serial stream i/o. It uses the pyubx2.UBXReader class to read and parse incoming data from the receiver. It places this data on an input message queue and generates a <<read-event>> which triggers the main App class to process the data.

It also reads any command and poll messages placed on an output message queue and sends these to the receiver.

The StreamHandler class is used by two PyGPSClient ‘caller’ objects:

  • SettingsFrame - i/o with the main GNSS receiver.

  • SpartnLbandDialog - i/o with a SPARTN L-Band receiver, when the

SPARTN Client is active.

The caller object can implement a ‘set_status()’ method to display any status messages output by StreamHandler.

Created on 16 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.stream_handler.StreamHandler(app)[source]

Bases: object

Stream handler class.

__init__(app)[source]

Constructor.

Parameters:

app (Frame) – reference to main tkinter application

start_read_thread(caller: object, settings: dict)[source]

Start the stream read thread.

Parameters:
  • owner (caller) – calling object

  • settings (dict) – settings dictionary

stop_read_thread()[source]

Stop serial reader thread.

pygpsclient.strings module

strings.py

ENGLISH language string literals for PyGPSClient application

Created on 12 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

pygpsclient.sysmon_frame module

sysmon_frame.py

System Monitor frame for PyGPSClient application.

Shows cpu, memory, i/o status, core temperature and warning/error counts for u-blox devices which support the MON-SYS and/or MON-COMMS UBX message types.

Created on 30 Apr 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.sysmon_frame.SysmonFrame(app, *args, **kwargs)[source]

Bases: Frame

SysmonFrame class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

init_chart()[source]

Initialise sysmon chart.

enable_messages(status: int)[source]

Enable/disable UBX MON-SYS & MON-COMMS messages on default port(s).

NB: CPU Load value only valid if rate = 1

Parameters:

status (int) – 0 = off, 1 = on

update_pending(msg: UBXMessage)[source]

Receives polled confirmation message from the ubx_handler and updates sysmon status.

Parameters:

msg (UBXMessage) – UBX config message

update_frame()[source]

Plot MON-SPAN spectrum analysis.

If no updates received after a given number of trys, assume receiver doesn’t support MON-SYS or MON-COMMS.

sysmon_data is a list of sys monitor parms. comms-data is a tuple of tx and rx values

get_size()[source]

Get current canvas size.

Returns:

window size (width, height)

Return type:

tuple

pygpsclient.ubx_cfgval_frame module

ubx_cfgval_frame.py

UBX Configuration frame for CFG-VAL commands.

Created on 22 Dec 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ubx_cfgval_frame.UBX_CFGVAL_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

UBX CFG-VAL configuration command panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset panel with sorted list of unique UBX Config Database key categories.

update_status(msg: UBXMessage)[source]

Update pending confirmation status.

Parameters:

msg (UBXMessage) – UBX config message

pygpsclient.ubx_config_dialog module

ubx_config_dialog.py

UBX configuration container dialog

This is the pop-up dialog containing the various UBX configuration command frames.

Supply initial settings via config keyword argument.

NB: Individual UBX configuration commands do not have uniquely identifiable synchronous or asynchronous responses (e.g. unique txn ID). The way we keep tabs on confirmation status is to maintain a list of all commands sent and the responses they’re expecting. When we receive a response, we check against the list of awaited responses of the same type and flag the first one we find as ‘confirmed’.

Created on 19 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ubx_config_dialog.UBXConfigDialog(app, *args, **kwargs)[source]

Bases: Toplevel

, UBXConfigDialog class.

__init__(app, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • args – optional args to pass to parent class (not currently used)

  • kwargs – optional kwargs to pass to parent class (not currently used)

set_pending(msgid: int, ubxfrm: int)[source]

Set pending confirmation flag for UBX configuration frame to signify that it’s waiting for a confirmation message.

Parameters:
  • msgid (int) – UBX message identity

  • ubxfrm (int) – integer representing UBX configuration frame (0-6)

update_pending(msg: UBXMessage)[source]

Receives polled confirmation message from the ubx_handler and updates whichever UBX config frame is waiting for this confirmation.

Parameters:

msg (UBXMessage) – UBX config message

set_status(message: str, color: str = '')[source]

Set status message.

Parameters:
  • message (str) – message to be displayed

  • color (str) – rgb color of text (blue)

on_exit(*args, **kwargs)[source]

Handle Exit button press.

get_size()[source]

Get current frame size.

Returns:

window size (width, height)

Return type:

tuple

property container

Getter for container frame.

Returns:

reference to container frame

Return type:

tkinter.Frame

property recordmode: bool

Getter for recording status.

Returns:

recording yes/no

Return type:

bool

send_command(msg: UBXMessage)[source]

Send command to receiver.

record_command(msg: UBXMessage)[source]

Record command to memory if in ‘record’ mode.

pygpsclient.ubx_handler module

ubx_handler.py

UBX Protocol handler - handles all incoming UBX messages

Parses individual UBX messages (using pyubx2 library) and adds selected attribute values to the app.gnss_status data dictionary. This dictionary is then used to periodically update the various user-selectable widget panels.

Created on 30 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ubx_handler.UBXHandler(app)[source]

Bases: object

UBXHandler class

__init__(app)[source]

Constructor.

Parameters:

app (Frame) – reference to main tkinter application

process_data(raw_data: bytes, parsed_data: object)[source]

Process relevant UBX message types

Parameters:
  • raw_data (bytes) – raw data

  • parsed_data (UBXMessage) – parsed data

pygpsclient.ubx_msgrate_frame module

ubx_msgrate_frame.py

UBX Configuration frame for CFG-MSG commands

Created on 22 Dec 2020

Created on 22 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ubx_msgrate_frame.UBX_MSGRATE_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

UBX Message Rate configuration command panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset settings to defaults.

update_status(msg: UBXMessage)[source]

Update pending confirmation status.

Parameters:

msg (UBXMessage) – UBX config message

pygpsclient.ubx_port_frame module

ubx_port_frame.py

UBX Configuration frame for CFG-PRT commands

Created on 22 Dec 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ubx_port_frame.UBX_PORT_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

UBX Port and Protocol configuration command panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset panel to initial settings

update_status(msg: UBXMessage)[source]

Update pending confirmation status.

Parameters:

msg (UBXMessage) – UBX config message

pygpsclient.ubx_preset_frame module

ubx_preset_frame.py

UBX Configuration frame for preset and user-defined commands

Created on 22 Dec 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ubx_preset_frame.UBX_PRESET_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

UBX Preset and User-defined configuration command panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset panel - Load user-defined presets if there are any.

update_status(msg: UBXMessage)[source]

Update pending confirmation status.

Parameters:

msg (UBXMessage) – UBX config message

pygpsclient.ubx_recorder_frame module

ubx_recorder_frame.py

UBX Player/Recorder widget for CFG commands entered by user via UBX Configuration panel.

Records commands to memory array and allows user to load or save this array to or from a file.

Facilitates copying configuration from one device to another.

Created on 9 Jan 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ubx_recorder_frame.UBX_Recorder_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

UBX Configuration command recorder panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset panel to initial settings

update_record(msg: UBXMessage)[source]

Add UBX CFG SET command to in-memory recording.

Parameters:

msg (UBXMessage) – message to record

pygpsclient.ubx_solrate_frame module

ubx_solrate_frame.py

UBX Configuration frame for CFG-RATE commands.

Created on 19 Feb 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

class pygpsclient.ubx_solrate_frame.UBX_RATE_Frame(app, container, *args, **kwargs)[source]

Bases: Frame

UBX Navigation Solution Rate configuration command panel.

__init__(app, container, *args, **kwargs)[source]

Constructor.

Parameters:
  • app (Frame) – reference to main tkinter application

  • container (Frame) – reference to container frame (config-dialog)

  • args – optional args to pass to Frame parent class

  • kwargs – optional kwargs to pass to Frame parent class

reset()[source]

Reset panel to initial settings.

update_status(msg: UBXMessage)[source]

Update pending confirmation status.

Parameters:

msg (UBXMessage) – UBX config message

pygpsclient.widget_state module

widget_state.py

Global constants, strings and dictionaries used to maintain the state of the various user-selectable widgets in the main container frame.

To add a new widget to PyGPSClient: 1. Create a new frame class widgetname_frame.py. The frame class should implement init_frame() and update_frame() functions. 2. If the widget requires certain UBX messages to be enabled, implement an enable_messages(status) function. 3. Add an entry to the foot of the widget_state dictionary. 4. If the widget requires data not already in the app.gnss_status data dictionary, add the requisite data items to the GNSSStatus class definition and update ubx_handler to populate them.

Created on 30 Apr 2023

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause

Module contents

Created on 27 Sep 2020

author:

semuadmin

copyright:

2020 SEMU Consulting

license:

BSD 3-Clause