mirror of https://github.com/DJ2LS/FreeDATA.git
commit
66a7b353c8
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
ref: ${{ github.head_ref }}
|
||||
|
||||
- name: Prettify code
|
||||
uses: creyD/prettier_action@v4.3
|
||||
uses: creyD/prettier_action@v4.5
|
||||
with:
|
||||
# This part is also where you can pass other options, for example:
|
||||
prettier_options: --write **/*.{js,md,css,html}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "FreeDATA",
|
||||
"version": "0.17.3-beta",
|
||||
"version": "0.17.4-beta",
|
||||
"description": "FreeDATA Client application for connecting to FreeDATA server",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
"@popperjs/core": "^2.11.8",
|
||||
"bootstrap": "^5.3.5",
|
||||
"bootstrap-icons": "^1.11.3",
|
||||
"bootstrap-vue-next": "^0.29.0",
|
||||
"bootstrap-vue-next": "^0.30.0",
|
||||
"chart.js": "^4.4.3",
|
||||
"chartjs-plugin-annotation": "^3.0.1",
|
||||
"core-js": "^3.8.3",
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
"@eslint/js": "^9.10.0",
|
||||
"@vue/cli-service": "~5.0.8",
|
||||
"eslint": "^9.0.0",
|
||||
"eslint-plugin-vue": "^9.0.0",
|
||||
"eslint-plugin-vue": "^10.2.0",
|
||||
"globals": "^16.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ window.addEventListener(
|
|||
class="bi bi-broadcast"
|
||||
style="font-size: 1.2rem"
|
||||
/>
|
||||
<strong>{{ $t('grid.componments.broadcasts') }}</strong>
|
||||
<strong>{{ $t('grid.components.broadcasts') }}</strong>
|
||||
</div>
|
||||
<div class="card-body overflow-auto">
|
||||
<div class="input-group">
|
||||
|
|
|
|||
|
|
@ -286,6 +286,7 @@ class ARQSessionIRS(arq_session.ARQSession):
|
|||
# CASE: ACK is going lost.
|
||||
self.log(f"Discarding data offset: Offset = {frame['offset']} | Already received: {self.received_bytes}", isWarning=True)
|
||||
self.received_bytes = frame['offset']
|
||||
|
||||
|
||||
#return False
|
||||
|
||||
|
|
@ -301,12 +302,15 @@ class ARQSessionIRS(arq_session.ARQSession):
|
|||
remaining_data_length = self.total_length - self.received_bytes
|
||||
self.log(f"Remaining data: {remaining_data_length}", isWarning=True)
|
||||
# Is this the last data part?
|
||||
if remaining_data_length <= len(frame['data']):
|
||||
# we only want the remaining length, not the entire frame data
|
||||
if remaining_data_length < len(frame['data']):
|
||||
# we only want the remaining length, not the entire frame data
|
||||
data_part = frame['data'][:remaining_data_length]
|
||||
else:
|
||||
# we want the entire frame data
|
||||
data_part = frame['data']
|
||||
|
||||
|
||||
|
||||
|
||||
self.received_data[frame['offset']:] = data_part
|
||||
#self.received_bytes += len(data_part)
|
||||
|
|
@ -372,6 +376,7 @@ class ARQSessionIRS(arq_session.ARQSession):
|
|||
flag_checksum=False)
|
||||
self.transmit_frame(ack, mode=FREEDV_MODE.signalling_ack)
|
||||
self.log("CRC fail at the end of transmission!", isWarning=True)
|
||||
self.log(f"Failed Data [Is real:{len(self.received_data)}/Is calculated:{seld.received_bytes}/Should:{self.total_bytes}]:{self.received_data}",isWarning=True)
|
||||
return self.transmission_failed()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ def normalize_audio(datalist: np.ndarray) -> np.ndarray:
|
|||
return datalist
|
||||
|
||||
# Define the target max value as 95% of the maximum for np.int16
|
||||
target_max_value = int(32767 * 0.95)
|
||||
target_max_value = int(32767 * 0.85)
|
||||
|
||||
# Compute the normalization factor
|
||||
normalization_factor = target_max_value / max_value
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ cmd_port = 9000
|
|||
data_port = 9001
|
||||
|
||||
[MESSAGES]
|
||||
enable_auto_repeat = False
|
||||
enable_auto_repeat = True
|
||||
|
||||
[QSO_LOGGING]
|
||||
enable_adif_udp = False
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Module for saving some constants
|
||||
CONFIG_ENV_VAR = 'FREEDATA_CONFIG'
|
||||
DEFAULT_CONFIG_FILE = 'config.ini'
|
||||
MODEM_VERSION = "0.17.3-beta"
|
||||
MODEM_VERSION = "0.17.4-beta"
|
||||
API_VERSION = 3
|
||||
ARQ_PROTOCOL_VERSION = 1
|
||||
LICENSE = 'GPL3.0'
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ from queue import Queue
|
|||
from event_manager import EventManager
|
||||
from state_manager import StateManager
|
||||
from schedule_manager import ScheduleManager
|
||||
from radio_manager import RadioManager
|
||||
from config import CONFIG
|
||||
from service_manager import SM as ServiceManager
|
||||
from message_system_db_manager import DatabaseManager
|
||||
from message_system_db_attachments import DatabaseManagerAttachments
|
||||
from websocket_manager import wsm as WebsocketManager
|
||||
import audio
|
||||
import constants
|
||||
from fastapi import Request, WebSocket
|
||||
class AppContext:
|
||||
|
|
@ -24,7 +24,7 @@ class AppContext:
|
|||
self.schedule_manager = ScheduleManager(self)
|
||||
self.service_manager = ServiceManager(self)
|
||||
self.websocket_manager = WebsocketManager(self)
|
||||
|
||||
self.radio_manager = RadioManager(self)
|
||||
self.socket_interface_manager = None # Socket interface instance, We start it as we need it
|
||||
self.rf_modem = None # Modem instnace, we start it as we need it
|
||||
self.message_system_db_manager = DatabaseManager(self)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import time
|
|||
from codec2 import FREEDV_MODE
|
||||
from message_system_db_manager import DatabaseManager
|
||||
from message_system_db_station import DatabaseManagerStations
|
||||
from message_system_db_messages import DatabaseManagerMessages
|
||||
|
||||
import maidenhead
|
||||
|
||||
|
|
@ -389,3 +390,19 @@ class FrameHandler():
|
|||
self.emit_event()
|
||||
self.follow_protocol()
|
||||
return True
|
||||
|
||||
|
||||
def check_for_queued_message(self):
|
||||
"""Checks for queued messages to send.
|
||||
|
||||
This method checks if auto-repeat is enabled in the configuration
|
||||
and if the received signal strength is above a certain threshold.
|
||||
If both conditions are met, it sets any messages addressed to the
|
||||
originating station to 'queued' status in the message database.
|
||||
"""
|
||||
|
||||
# only check for queued messages, if we have enabled this and if we have a minimum snr received
|
||||
if self.ctx.config_manager.config["MESSAGES"]["enable_auto_repeat"] and self.details["snr"] >= -2:
|
||||
# set message to queued if beacon received
|
||||
DatabaseManagerMessages(self.ctx).set_message_to_queued_for_callsign(
|
||||
self.details['frame']["origin"])
|
||||
|
|
@ -26,7 +26,4 @@ class BeaconFrameHandler(frame_handler.FrameHandler):
|
|||
self.details['frame']["gridsquare"]
|
||||
)
|
||||
|
||||
# only check for queued messages, if we have enabled this and if we have a minimum snr received
|
||||
if self.config["MESSAGES"]["enable_auto_repeat"] and self.details["snr"] >= -2:
|
||||
# set message to queued if beacon received
|
||||
DatabaseManagerMessages(self.ctx).set_message_to_queued_for_callsign(self.details['frame']["origin"])
|
||||
self.check_for_queued_message()
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class CQFrameHandler(frame_handler.FrameHandler):
|
|||
)
|
||||
|
||||
self.send_ack()
|
||||
self.check_for_queued_message()
|
||||
|
||||
def send_ack(self):
|
||||
factory = data_frame_factory.DataFrameFactory(self.ctx)
|
||||
|
|
@ -50,6 +51,3 @@ class CQFrameHandler(frame_handler.FrameHandler):
|
|||
|
||||
self.transmit(qrv_frame)
|
||||
|
||||
if self.ctx.config_manager.config["MESSAGES"]["enable_auto_repeat"]:
|
||||
# set message to queued if CQ received
|
||||
DatabaseManagerMessages(self.ctx).set_message_to_queued_for_callsign(self.details['frame']["origin"])
|
||||
|
|
|
|||
|
|
@ -37,9 +37,7 @@ class PingFrameHandler(frame_handler.FrameHandler):
|
|||
snr=self.details['snr'],
|
||||
)
|
||||
self.send_ack()
|
||||
|
||||
self.check_for_queued_message()
|
||||
|
||||
def send_ack(self):
|
||||
"""Sends a PING acknowledgement frame.
|
||||
|
||||
|
|
@ -52,18 +50,3 @@ class PingFrameHandler(frame_handler.FrameHandler):
|
|||
self.details['snr']
|
||||
)
|
||||
self.transmit(ping_ack_frame)
|
||||
|
||||
def check_for_queued_message(self):
|
||||
"""Checks for queued messages to send.
|
||||
|
||||
This method checks if auto-repeat is enabled in the configuration
|
||||
and if the received signal strength is above a certain threshold.
|
||||
If both conditions are met, it sets any messages addressed to the
|
||||
originating station to 'queued' status in the message database.
|
||||
"""
|
||||
|
||||
# only check for queued messages, if we have enabled this and if we have a minimum snr received
|
||||
if self.config["MESSAGES"]["enable_auto_repeat"] and self.details["snr"] >= -2:
|
||||
# set message to queued if beacon received
|
||||
DatabaseManagerMessages(self.ctx).set_message_to_queued_for_callsign(
|
||||
self.details['frame']["origin"])
|
||||
|
|
@ -56,7 +56,7 @@ class SM:
|
|||
if self.shutdown_flag.is_set():
|
||||
return
|
||||
|
||||
if cmd in ['start'] and not self.ctx.rf_modem:
|
||||
if cmd in ['start']:
|
||||
self.ctx.config_manager.read()
|
||||
|
||||
self.start_radio_manager()
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ asyncio
|
|||
chardet
|
||||
colorama
|
||||
ordered-set
|
||||
nuitka<=2.7
|
||||
nuitka<=2.7.5
|
||||
pyinstaller
|
||||
websocket-client
|
||||
fastapi[standard]
|
||||
|
|
|
|||
Loading…
Reference in New Issue