From e972dda9b5391306b6872bac0c250c6fa0f047a4 Mon Sep 17 00:00:00 2001
From: semuadmin <28569967+semuadmin@users.noreply.github.com>
Date: Fri, 13 Dec 2024 08:13:14 +0000
Subject: [PATCH 1/6] add pyubxutils.UBXSimulator
---
.vscode/settings.json | 2 +-
README.md | 2 +-
RELEASE_NOTES.md | 4 ++++
pyproject.toml | 3 ++-
src/pygpsclient/_version.py | 2 +-
src/pygpsclient/stream_handler.py | 2 +-
6 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 1bcd52b2..fffca8b8 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -4,6 +4,6 @@
"editor.formatOnSave": true,
"modulename": "pygpsclient",
"distname": "pygpsclient",
- "moduleversion": "1.5.1",
+ "moduleversion": "1.5.2",
"python.defaultInterpreterPath": "python3",
}
\ No newline at end of file
diff --git a/README.md b/README.md
index 2e2cbced..b9c2f90d 100644
--- a/README.md
+++ b/README.md
@@ -240,7 +240,7 @@ You will need to logout and login for the launcher to take effect.
1. To connect to a GNSS receiver via USB or UART port, select the device from the listbox, set the appropriate serial connection parameters and click
![connect icon](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/usbport-1-24.png?raw=true). The application will endeavour to pre-select a recognised GNSS/GPS device but this is platform and device dependent. Press the ![refresh](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/iconmonstr-refresh-6-16.png?raw=true) button to refresh the list of connected devices at any point. `Rate bps` (baud rate) is typically the only setting that might need adjusting, but tweaking the `timeout` setting may improve performance on certain platforms. The `Msg Mode` parameter defaults to `GET` i.e., periodic or poll response messages *from* a receiver. If you wish to parse streams of command or poll messages being sent *to* a receiver, set the `Msg Mode` to `SET` or `POLL`. An optional serial or socket stream inactivity timeout can also be set (in seconds; 0 = no timeout).
-1. A custom user-defined serial port can also be passed via the json configuration file setting `"userport_s":`, via environment variable `PYGPSCLIENT_USERPORT` or as a command line argument `--userport`. A special userport value of "ubxsimulator" invokes the experimental [`pygnssutils.UBXSimulator`](https://github.com/semuconsulting/pygnssutils/blob/main/src/pygnssutils/ubxsimulator.py) utility to emulate a GNSS NMEA/UBX serial stream.
+1. A custom user-defined serial port can also be passed via the json configuration file setting `"userport_s":`, via environment variable `PYGPSCLIENT_USERPORT` or as a command line argument `--userport`. A special userport value of "ubxsimulator" invokes the experimental [`pyubxutils.UBXSimulator`](https://github.com/semuconsulting/pyubxutils/blob/main/src/pyubxutils/ubxsimulator.py) utility to emulate a GNSS NMEA/UBX serial stream.
1. To connect to a TCP or UDP socket, enter the server URL and port, select the protocol (defaults to TCP) and click
![connect socket icon](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/ethernet-1-24.png?raw=true).
1. To stream from a previously-saved binary datalog file, click
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index f85648df..f192d0d9 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,5 +1,9 @@
# PyGPSClient Release Notes
+### RELEASE 1.5.2
+
+1. Add support for pyubxutils.
+
### RELEASE 1.5.1
1. Add new user-selectable and configurable "Chart" widget:
diff --git a/pyproject.toml b/pyproject.toml
index bf12d36e..4c806f1a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,7 +7,7 @@ name = "pygpsclient"
authors = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }]
maintainers = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }]
description = "GNSS Diagnostic and UBX Configuration GUI Application"
-version = "1.5.1"
+version = "1.5.2"
license = { file = "LICENSE" }
keywords = [
"PyGPSClient",
@@ -53,6 +53,7 @@ dependencies = [
"requests>=2.28.0",
"Pillow>=9.0.0",
"pygnssutils>=1.1.9",
+ "pyubxutils>=1.0.2",
"pyserial>=3.5",
]
diff --git a/src/pygpsclient/_version.py b/src/pygpsclient/_version.py
index ee8102eb..e3b4ebd7 100644
--- a/src/pygpsclient/_version.py
+++ b/src/pygpsclient/_version.py
@@ -8,4 +8,4 @@
:license: BSD 3-Clause
"""
-__version__ = "1.5.1"
+__version__ = "1.5.2"
diff --git a/src/pygpsclient/stream_handler.py b/src/pygpsclient/stream_handler.py
index bd1b9e37..e221be8a 100644
--- a/src/pygpsclient/stream_handler.py
+++ b/src/pygpsclient/stream_handler.py
@@ -35,7 +35,6 @@ class to read and parse incoming data from the receiver. It places
from threading import Event, Thread
from certifi import where as findcacerts
-from pygnssutils import UBXSimulator
from pynmeagps import NMEAMessageError, NMEAParseError
from pyrtcm import RTCMMessageError, RTCMParseError
from pyubx2 import (
@@ -47,6 +46,7 @@ class to read and parse incoming data from the receiver. It places
UBXParseError,
UBXReader,
)
+from pyubxutils import UBXSimulator
from serial import Serial, SerialException, SerialTimeoutException
from pygpsclient.globals import (
From 8cefe8f0356a6882fec11c31cb5b9ff60260312d Mon Sep 17 00:00:00 2001
From: semuadmin <28569967+semuadmin@users.noreply.github.com>
Date: Wed, 1 Jan 2025 16:26:41 +0000
Subject: [PATCH 2/6] use dynamic version in pyproject.toml
---
.vscode/launch.json | 2 +-
.vscode/settings.json | 1 -
.vscode/tasks.json | 22 ++++++++++++----------
RELEASE_NOTES.md | 1 +
pyproject.toml | 5 ++++-
5 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 03eae0d8..38d0eaac 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -6,7 +6,7 @@
"configurations": [
{
"name": "Python: Module",
- "type": "python",
+ "type": "debugpy",
"request": "launch",
"module": "pygpsclient"
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index fffca8b8..1fd93d61 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -4,6 +4,5 @@
"editor.formatOnSave": true,
"modulename": "pygpsclient",
"distname": "pygpsclient",
- "moduleversion": "1.5.2",
"python.defaultInterpreterPath": "python3",
}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 75cd350d..a07e9e44 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -153,10 +153,6 @@
"type": "process",
"command": "sphinx-apidoc",
"args": [
- "--doc-project=${config:modulename}",
- "--doc-author=semuadmin",
- "--doc-version=${config:moduleversion}",
- "--doc-release=${config:moduleversion}",
"--ext-autodoc",
"--ext-viewcode",
"--templatedir=docs",
@@ -205,29 +201,32 @@
},
{
"label": "Install Wheel",
- "type": "process",
+ "type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pip",
"install",
- "${workspaceFolder}/dist/${config:distname}-${config:moduleversion}-py3-none-any.whl",
"--user",
- "--force-reinstall"
+ "--force-reinstall",
+ "*.whl"
],
+ "options": {
+ "cwd": "dist"
+ },
"problemMatcher": []
},
{
"label": "Install Locally",
- "type": "process",
+ "type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pip",
"install",
- "${workspaceFolder}/dist/${config:distname}-${config:moduleversion}-py3-none-any.whl",
"--user",
- "--force-reinstall"
+ "--force-reinstall",
+ "*.whl"
],
"dependsOrder": "sequence",
"dependsOn": [
@@ -240,6 +239,9 @@
"Build",
"Sphinx HTML"
],
+ "options": {
+ "cwd": "dist"
+ },
"problemMatcher": []
}
]
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index f192d0d9..03f96215 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -3,6 +3,7 @@
### RELEASE 1.5.2
1. Add support for pyubxutils.
+1. Minor updates to vscode task configurations.
### RELEASE 1.5.1
diff --git a/pyproject.toml b/pyproject.toml
index 4c806f1a..29defdad 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta:__legacy__"
[project]
name = "pygpsclient"
+dynamic = ["version"]
authors = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }]
maintainers = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }]
description = "GNSS Diagnostic and UBX Configuration GUI Application"
-version = "1.5.2"
license = { file = "LICENSE" }
keywords = [
"PyGPSClient",
@@ -80,6 +80,9 @@ test = [
"sphinx-rtd-theme",
]
+[tool.setuptools.dynamic]
+version = { attr = "pygpsclient._version.__version__" }
+
[tool.black]
target-version = ['py39']
From f3c131f7ec18e014d5d6c5a717c86ecb2440720b Mon Sep 17 00:00:00 2001
From: semuadmin <28569967+semuadmin@users.noreply.github.com>
Date: Tue, 7 Jan 2025 12:59:44 +0000
Subject: [PATCH 3/6] update readme
---
README.md | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index b9c2f90d..cd93c4f9 100644
--- a/README.md
+++ b/README.md
@@ -281,7 +281,7 @@ You will need to logout and login for the launcher to take effect.
|![sysmon widget](https://github.com/semuconsulting/PyGPSClient/blob/master/images/sysmon_widget.png?raw=true)| System Monitor widget showing device cpu, memory and I/O utilisation (*GNSS receiver must be capable of outputting UBX MON-SYS and/or MON-COMMS messages*). Tick checkbox to toggle between actual (cumulative) I/O stats and pending I/O. |
|![scatterplot widget](https://github.com/semuconsulting/PyGPSClient/blob/master/images/scatterplot_widget.png?raw=true)| Scatterplot widget showing variability in position reporting over time. (Optional) Enter fixed reference position. Select Average to center plot on dynamic average position (*displayed at top left*), or Fixed to center on fixed reference position (*if entered*). Check Autorange to set plot range automatically. Set the update interval (e.g. 4 = every 4th navigation solution). Use the range slider or mouse wheel to adjust plot range. Right-click to set fixed reference point to the current mouse cursor position. Double-click to clear the existing data. Settings may be saved to a json configuration file. |
|![rover widget](https://github.com/semuconsulting/PyGPSClient/blob/master/images/rover_widget.png?raw=true) | Rover widget plots the relative 2D position, track and status information for the roving receiver in a fixed or moving base / rover RTK configuration. Can also display relative position of NTRIP mountpoint and receiver in a static RTK configuration. Double-click to clear existing plot. (*GNSS rover receiver must be capable of outputting UBX NAV-RELPOSNED messages.*) |
-|![chart view](https://github.com/semuconsulting/PyGPSClient/blob/master/images/chart_widget.png?raw=true) | Chart widget acts as a multi-channel "oscilloscope", allowing the user to plot a series of named numeric data attributes from any NMEA, UBX, RTCM or SPARTN data source, with configurable y (value) and x (time) axes. By default, the number of channels is set to 4, but this can be manually edited by the user via the json configuration file setting `chartsettings_d["numchn_n"]`. For each channel, user can select: (*optional*) identity of message source e.g. `NAV-PVT`; attribute name e.g. `hAcc`; scaling factor (divisor) e.g. 1000; y axis range e.g. 0 - 5. Wildcards are available for attribute groups - "\*" (average of group values), "+" (maximum of group values), "-" (minimum of group values) e.g. `cno*` will plot the average `cno` value for a group of satellites. Double-click to clear the existing data. Double-right-click to save the current chart data to the clipboard in CSV format. Settings may be saved to a json configuration file. |
+|![chart view](https://github.com/semuconsulting/PyGPSClient/blob/master/images/chart_widget.png?raw=true) | Chart widget acts as a multi-channel "plotter", allowing the user to plot a series of named numeric data attributes from any NMEA, UBX, RTCM or SPARTN data source, with configurable y (value) and x (time) axes. By default, the number of channels is set to 4, but this can be manually edited by the user via the json configuration file setting `chartsettings_d["numchn_n"]`. For each channel, user can select: (*optional*) identity of message source e.g. `NAV-PVT`; attribute name e.g. `hAcc`; scaling factor (divisor) e.g. 1000; y axis range e.g. 0 - 5. Wildcards are available for attribute groups - "\*" (average of group values), "+" (maximum of group values), "-" (minimum of group values) e.g. `cno*` will plot the average `cno` value for a group of satellites. Double-click to clear the existing data. Double-right-click to save the current chart data to the clipboard in CSV format. Settings may be saved to a json configuration file. |
---
## UBX Configuration Facilities
@@ -443,7 +443,7 @@ Below is a illustrative SPARTN DGPS data log, showing:
## Socket Server / NTRIP Caster Facilities
The Socket Server / NTRIP Caster facility is capable of operating in either of two modes;
-1. SOCKET SERVER - an open, unauthenticated TCP socket server available to any socket client including, for example, another instance of PyGPSClient or the [`gnssdump` CLI utility](https://github.com/semuconsulting/pygnssutils#gnssdump). In this mode it will broadcast the host's currently connected GNSS data stream (NMEA, UBX, RTCM3). The default port is 50012.
+1. SOCKET SERVER - an open, unauthenticated TCP socket server available to any socket client including, for example, another instance of PyGPSClient or the [`gnssstreamer` CLI utility](https://github.com/semuconsulting/pygnssutils#gnssstreamer). In this mode it will broadcast the host's currently connected GNSS data stream (NMEA, UBX, RTCM3). The default port is 50012.
2. NTRIP CASTER - a simple implementation of an authenticated NTRIP caster available to any NTRIP client including, for example, u-blox's [legacy u-center NTRIP client](https://www.u-blox.com/en/product/u-center), BKG's [NTRIP Client (BNC)](https://igs.bkg.bund.de/ntrip/download), the PyGPSClient NTRIP Client facility or the [`gnssntripclient` CLI utility](https://github.com/semuconsulting/pygnssutils#gnssntripclient). Login credentials for the NTRIP caster are set via the `"ntripcasteruser_s":` and `"ntripcasterpassword_s":` settings in the *.json confirmation file (they can also be set via PyGPSClient command line arguments `--ntripcasteruser`, `--ntripcasterpassword`, or by setting environment variables `NTRIPCASTER_USER`, `NTRIPCASTER_PASSWORD`). Default settings are as follows: bind address: 0.0.0.0, port: 2101, mountpoint: pygnssutils, user: anon, password: password.
By default, the server/caster binds to the host address '0.0.0.0' (IPv4) or '::' (IPv6) i.e. all available IP addresses on the host machine. This can be overridden via the settings panel or a host environment variable `PYGPSCLIENT_BINDADDRESS`. A label on the settings panel indicates the number of connected clients, and the server/caster status is indicated in the topmost banner: running with no clients: ![transmit icon](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/iconmonstr-noclient-10-24.png?raw=true), running with clients: ![transmit icon](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/iconmonstr-transmit-10-24.png?raw=true).
@@ -564,9 +564,9 @@ Multiple commands can be concatenated on a single line. Illustrative examples ar
---
## Command Line Utilities
-The `pygnssutils` library which underpins many of the functions in `PyGPSClient` also incorporates command line versions of these functions:
+The `pygnssutils` and `pyubxutils` libraries which underpin many of the functions in `PyGPSClient` also incorporate command line versions of these functions:
-1. `gnssdump` CLI utility. This is essentially a configurable input/output wrapper around the [`pyubx2.UBXReader`](https://github.com/semuconsulting/pyubx2#reading) class with flexible message formatting and filtering options for NMEA, UBX and RTCM3 protocols.
+1. `gnssstreamer` CLI utility. This is essentially a configurable input/output wrapper around the [`pyubx2.UBXReader`](https://github.com/semuconsulting/pyubx2#reading) class with flexible message formatting and filtering options for NMEA, UBX and RTCM3 protocols.
1. `gnssserver` CLI utility. This implements a TCP Socket Server for GNSS data streams which is also capable of being run as a simple NTRIP Server.
1. `gnssntripclient` CLI utility. This implements a simple NTRIP Client which receives RTCM3 correction data from an NTRIP Server and (optionally) sends this to a
designated output stream.
@@ -574,8 +574,9 @@ designated output stream.
1. `ubxsave` CLI utility. This saves a complete set of configuration data from any Generation 9+ u-blox device (e.g. NEO-M9N or ZED-F9P) to a file. The file can then be reloaded to any compatible device using the `ubxload` utility.
1. `ubxload` CLI utility. This reads a file containing binary configuration data and loads it into any compatible Generation 9+ u-blox device (e.g. NEO-M9N or ZED-F9P).
1. `ubxsetrate` CLI utility. A simple utility which sets NMEA or UBX message rates on u-blox GNSS receivers.
+1. `ubxbase` CLI utility. This configures an RTK-compatible UBX receiver (e.g. the ZED-F9P) to operate in Base Station mode.
-For further details, refer to the `pygnssutils` homepage at [https://github.com/semuconsulting/pygnssutils](https://github.com/semuconsulting/pygnssutils).
+For further details, refer to the `pygnssutils` homepage at [https://github.com/semuconsulting/pygnssutils](https://github.com/semuconsulting/pygnssutils) or `pyubxutils` homepage at [https://github.com/semuconsulting/pyubxutils](https://github.com/semuconsulting/pyubxutils).
--
## Known Issues
From a30e272704f8796ecdc440fedab2265772e16b68 Mon Sep 17 00:00:00 2001
From: semuadmin <28569967+semuadmin@users.noreply.github.com>
Date: Sun, 26 Jan 2025 11:21:02 +0000
Subject: [PATCH 4/6] persist logpath and trackpath to config Fixes #171
---
RELEASE_NOTES.md | 1 +
pygpsclient.json | 2 ++
src/pygpsclient/file_handler.py | 13 ++++++++-----
src/pygpsclient/settings_frame.py | 27 ++++++++++++++++-----------
4 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 03f96215..1fe9da23 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -2,6 +2,7 @@
### RELEASE 1.5.2
+1. Fix logpath setting in config file - Fixes [#171](https://github.com/semuconsulting/PyGPSClient/issues/171)
1. Add support for pyubxutils.
1. Minor updates to vscode task configurations.
diff --git a/pygpsclient.json b/pygpsclient.json
index c89cd9e2..a9a414b6 100644
--- a/pygpsclient.json
+++ b/pygpsclient.json
@@ -32,7 +32,9 @@
"unusedsat_b": 0,
"logformat_s": "Binary",
"datalog_b": 0,
+ "logpath_s": "",
"recordtrack_b": 0,
+ "trackpath_s": "",
"bpsrate_n": 9600,
"databits_n": 8,
"stopbits_f": 1.0,
diff --git a/src/pygpsclient/file_handler.py b/src/pygpsclient/file_handler.py
index 5fa7f580..5fb2d748 100644
--- a/src/pygpsclient/file_handler.py
+++ b/src/pygpsclient/file_handler.py
@@ -202,16 +202,17 @@ def save_config(self, config: dict, filename: Path = CONFIGFILE) -> str:
except (OSError, json.JSONDecodeError) as err:
return str(err)
- def set_logfile_path(self) -> Path:
+ def set_logfile_path(self, initdir=HOME) -> Path:
"""
Set file path.
+ :param str initdir: initial directory (HOME)
:return: file path
:rtype: str
"""
self._logpath = filedialog.askdirectory(
- title=SAVETITLE, initialdir=HOME, mustexist=True
+ title=SAVETITLE, initialdir=initdir, mustexist=True
)
if self._logpath in ((), ""):
return None # User cancelled
@@ -224,6 +225,7 @@ def open_logfile(self):
# pylint: disable=consider-using-with
+ self._logpath = self.__app.frm_settings.config.get("logpath_s", HOME)
self._lines = 0
_, self._logname = set_filename(self._logpath, "data", "log")
self._logfile = open(self._logname, "a+b")
@@ -236,7 +238,7 @@ def write_logfile(self, raw_data, parsed_data):
"""
if self._logfile is None:
- return
+ self.open_logfile()
settings = self.__app.frm_settings.config
lfm = settings["logformat_s"]
@@ -275,16 +277,17 @@ def close_logfile(self):
except IOError:
pass
- def set_trackfile_path(self) -> Path:
+ def set_trackfile_path(self, initdir=HOME) -> Path:
"""
Set track directory.
+ :param str initdir: initial directory (HOME)
:return: file path
:rtype: str
"""
self._trackpath = filedialog.askdirectory(
- title=SAVETITLE, initialdir=HOME, mustexist=True
+ title=SAVETITLE, initialdir=initdir, mustexist=True
)
if self._trackpath in ((), ""):
return None # User cancelled
diff --git a/src/pygpsclient/settings_frame.py b/src/pygpsclient/settings_frame.py
index 97459640..2b6c5947 100644
--- a/src/pygpsclient/settings_frame.py
+++ b/src/pygpsclient/settings_frame.py
@@ -73,6 +73,7 @@
GNSS_ERR_EVENT,
GNSS_EVENT,
GNSS_TIMEOUT_EVENT,
+ HOME,
ICON_CONN,
ICON_DISCONN,
ICON_EXIT,
@@ -159,7 +160,8 @@ def __init__(self, app, *args, **kwargs):
Frame.__init__(self, self.__master, *args, **kwargs)
self.infilepath = None
- self.outfilepath = None
+ self.logpath = HOME
+ self.trackpath = HOME
self._prot_nmea = IntVar()
self._prot_ubx = IntVar()
self._prot_rtcm3 = IntVar()
@@ -182,7 +184,6 @@ def __init__(self, app, *args, **kwargs):
"defaultport_s", RCVR_CONNECTION
)
self._validsettings = True
- self._trackpath = None
self._img_conn = ImageTk.PhotoImage(Image.open(ICON_CONN))
self._img_serial = ImageTk.PhotoImage(Image.open(ICON_SERIAL))
self._img_socket = ImageTk.PhotoImage(Image.open(ICON_SOCKET))
@@ -560,7 +561,9 @@ def reset(self):
self._show_unusedsat.set(self.__app.saved_config.get("unusedsat_b", 0))
self._logformat.set(self.__app.saved_config.get("logformat_s", FORMAT_BINARY))
self._datalog.set(self.__app.saved_config.get("datalog_b", 0))
+ self.logpath = self.__app.saved_config.get("logpath_s", HOME)
self._record_track.set(self.__app.saved_config.get("recordtrack_b", 0))
+ self.trackpath = self.__app.saved_config.get("trackpath_s", HOME)
self.clients = 0
def _reset_frames(self):
@@ -670,14 +673,14 @@ def _on_data_log(self):
"""
if self._datalog.get() == 1:
- self.outfilepath = self.__app.file_handler.set_logfile_path()
- if self.outfilepath is not None:
- self.__app.set_status("Data logging enabled: " + self.outfilepath)
+ self.logpath = self.__app.file_handler.set_logfile_path(self.logpath)
+ if self.logpath is not None:
+ self.__app.set_status("Data logging enabled: " + self.logpath)
self.__app.file_handler.open_logfile()
else:
+ self.logpath = ""
self._datalog.set(False)
else:
- self.outfilepath = None
self._datalog.set(False)
self.__app.file_handler.close_logfile()
self.__app.set_status("Data logging disabled")
@@ -688,14 +691,14 @@ def _on_record_track(self):
"""
if self._record_track.get() == 1:
- self._trackpath = self.__app.file_handler.set_trackfile_path()
- if self._trackpath is not None:
- self.__app.set_status("Track recording enabled: " + self._trackpath)
+ self.trackpath = self.__app.file_handler.set_trackfile_path(self.trackpath)
+ if self.trackpath is not None:
+ self.__app.set_status("Track recording enabled: " + self.trackpath)
self.__app.file_handler.open_trackfile()
else:
+ self.trackpath = ""
self._record_track.set(False)
else:
- self._trackpath = None
self._record_track.set(False)
self.__app.file_handler.close_trackfile()
self.__app.set_status("Track recording disabled")
@@ -808,9 +811,11 @@ def config(self) -> dict:
"mapzoom_n": self.mapzoom.get(),
"legend_b": self.show_legend.get(),
"unusedsat_b": self._show_unusedsat.get(),
- "logformat_s": self._logformat.get(),
"datalog_b": self._datalog.get(),
+ "logformat_s": self._logformat.get(),
+ "logpath_s": self.logpath,
"recordtrack_b": self._record_track.get(),
+ "trackpath_s": self.trackpath,
# serial port settings from frm_serial
"serialport_s": self.frm_serial.port,
"bpsrate_n": self.frm_serial.bpsrate,
From 139778411237a4e60a595ec50ed6dbae344ffb98 Mon Sep 17 00:00:00 2001
From: semuadmin <28569967+semuadmin@users.noreply.github.com>
Date: Sun, 26 Jan 2025 12:23:03 +0000
Subject: [PATCH 5/6] convert path to str
---
src/pygpsclient/settings_frame.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pygpsclient/settings_frame.py b/src/pygpsclient/settings_frame.py
index 2b6c5947..90bbd61b 100644
--- a/src/pygpsclient/settings_frame.py
+++ b/src/pygpsclient/settings_frame.py
@@ -813,9 +813,9 @@ def config(self) -> dict:
"unusedsat_b": self._show_unusedsat.get(),
"datalog_b": self._datalog.get(),
"logformat_s": self._logformat.get(),
- "logpath_s": self.logpath,
+ "logpath_s": str(self.logpath),
"recordtrack_b": self._record_track.get(),
- "trackpath_s": self.trackpath,
+ "trackpath_s": str(self.trackpath),
# serial port settings from frm_serial
"serialport_s": self.frm_serial.port,
"bpsrate_n": self.frm_serial.bpsrate,
From c4267b0f4d5e6e1e77fc262e16566fd6888fbc40 Mon Sep 17 00:00:00 2001
From: semuadmin <28569967+semuadmin@users.noreply.github.com>
Date: Mon, 10 Feb 2025 08:54:11 +0000
Subject: [PATCH 6/6] black formatting
---
src/pygpsclient/spartn_json_config.py | 2 +-
src/pygpsclient/strings.py | 2 +-
src/pygpsclient/ubx_preset_frame.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/pygpsclient/spartn_json_config.py b/src/pygpsclient/spartn_json_config.py
index 33e58585..944015fd 100644
--- a/src/pygpsclient/spartn_json_config.py
+++ b/src/pygpsclient/spartn_json_config.py
@@ -1,7 +1,7 @@
"""
spartn_json_config.py
-Utility class to load SPARTN decryption configuration from
+Utility class to load SPARTN decryption configuration from
JSON file provided by ThingStream PointPerfect location service.
Requires paid subscription.
diff --git a/src/pygpsclient/strings.py b/src/pygpsclient/strings.py
index 0924605a..0449bb89 100644
--- a/src/pygpsclient/strings.py
+++ b/src/pygpsclient/strings.py
@@ -15,7 +15,7 @@
from pygpsclient.globals import GITHUB_URL, MAPAPI_URL
TITLE = "PyGPSClient"
-COPYRIGHT = "\u00A9 2020 SEMU Consulting\nBSD 3-Clause License"
+COPYRIGHT = "\u00a9 2020 SEMU Consulting\nBSD 3-Clause License"
COPYRIGHTTXT = f"{COPYRIGHT}. All Rights Reserved"
EPILOG = f"{COPYRIGHT} - {GITHUB_URL}"
diff --git a/src/pygpsclient/ubx_preset_frame.py b/src/pygpsclient/ubx_preset_frame.py
index 0969dc60..804ef238 100644
--- a/src/pygpsclient/ubx_preset_frame.py
+++ b/src/pygpsclient/ubx_preset_frame.py
@@ -430,7 +430,7 @@ def _do_set_mon(self, msgrate):
"""
for msgtype in UBX_MSGIDS:
- if msgtype[0:1] == b"\x0A":
+ if msgtype[0:1] == b"\x0a":
self._do_cfgmsg(msgtype, msgrate)
def _do_set_rxm(self, msgrate):