From 357ef25c5816fcd6ecbc03c8e6ce642378e786e6 Mon Sep 17 00:00:00 2001 From: Mykola Dvornik Date: Fri, 29 Dec 2023 17:42:23 +0100 Subject: [PATCH] Comply with suggested semver scheme Also use unique enough short hash instead of full one. --- _signal_processing/krakenSDR_signal_processor.py | 6 +++--- _ui/_web_interface/variables.py | 4 ++-- _ui/_web_interface/views/system_control_card.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_signal_processing/krakenSDR_signal_processor.py b/_signal_processing/krakenSDR_signal_processor.py index b05063e..87ea278 100755 --- a/_signal_processing/krakenSDR_signal_processor.py +++ b/_signal_processing/krakenSDR_signal_processor.py @@ -51,7 +51,7 @@ from scipy import fft, signal from signal_utils import can_store_file, fm_demod, write_wav from variables import ( - SOFTWARE_GIT_HASH, + SOFTWARE_GIT_SHORT_HASH, SOFTWARE_VERSION, SYSTEM_UNAME, root_path, @@ -305,7 +305,7 @@ def save_processing_status(self) -> None: status["host_os_version"] = SYSTEM_UNAME.release status["host_os_architecture"] = SYSTEM_UNAME.machine status["software_version"] = SOFTWARE_VERSION - status["software_git_hash"] = SOFTWARE_GIT_HASH + status["software_git_short_hash"] = SOFTWARE_GIT_SHORT_HASH status["uptime_ms"] = int(time.monotonic() * 1e3) status["gps_status"] = self.gps_status @@ -324,7 +324,7 @@ def save_processing_status(self) -> None: daq_status["buffer_size_ms"] = ( self.module_receiver.iq_header.cpi_length / self.module_receiver.iq_header.sampling_freq ) * 1e3 - daq_status["dropped_frames"] = self.dropped_frames + daq_status["num_dropped_frames"] = self.dropped_frames status["daq_status"] = daq_status status["daq_ok"] = ( diff --git a/_ui/_web_interface/variables.py b/_ui/_web_interface/variables.py index 847cb8c..f69ad3a 100644 --- a/_ui/_web_interface/variables.py +++ b/_ui/_web_interface/variables.py @@ -26,9 +26,9 @@ try: import git - SOFTWARE_GIT_HASH = git.Repo().head.object.hexsha + SOFTWARE_GIT_SHORT_HASH = git.Repo().head.object.hexsha[:7] except Exception: - SOFTWARE_GIT_HASH = "e5df8c99ef2447145bbfb88cc6ac28cf94f1906e" + SOFTWARE_GIT_SHORT_HASH = "e5df8c9" SOFTWARE_VERSION = "1.7.0" SYSTEM_UNAME = platform.uname() diff --git a/_ui/_web_interface/views/system_control_card.py b/_ui/_web_interface/views/system_control_card.py index d2b4005..7f6c295 100644 --- a/_ui/_web_interface/views/system_control_card.py +++ b/_ui/_web_interface/views/system_control_card.py @@ -5,7 +5,7 @@ from maindash import web_interface # isort: on -from variables import SOFTWARE_GIT_HASH, SOFTWARE_VERSION, option +from variables import SOFTWARE_GIT_SHORT_HASH, SOFTWARE_VERSION, option def get_system_control_card_layout(): @@ -65,7 +65,7 @@ def get_system_control_card_layout(): ], className="field", ), - html.Div(f"Version {SOFTWARE_VERSION} ({SOFTWARE_GIT_HASH})"), + html.Div(f"Version {SOFTWARE_VERSION}+git.{SOFTWARE_GIT_SHORT_HASH}"), ], id="system_control_container", style={"display": "block"} if web_interface.en_system_control else {"display": "none"},