added placeholder for dataclasses

This commit is contained in:
DJ2LS 2023-04-26 18:23:49 +02:00
parent afeea49ba6
commit e14b16f3cf
12 changed files with 65 additions and 2 deletions

View file

@ -22,6 +22,7 @@ import modem
import numpy as np
import sock
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
import structlog
import stats
import ujson as json
@ -30,6 +31,7 @@ from exceptions import NoCallsign
from queues import DATA_QUEUE_RECEIVED, DATA_QUEUE_TRANSMIT, RX_BUFFER
from static import FRAME_TYPE as FR_TYPE
TESTMODE = False

View file

@ -13,6 +13,8 @@ import time
import ujson as json
import structlog
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
log = structlog.get_logger("explorer")

View file

@ -8,6 +8,7 @@ import time
from datetime import datetime,timezone
import crcengine
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
import structlog
import numpy as np
import threading

View file

@ -29,6 +29,7 @@ import helpers
import log_handler
import modem
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
import structlog
import explorer
import json
@ -394,7 +395,7 @@ if __name__ == "__main__":
log.error("[DMN] logger init error", exception=err)
log.info(
"[TNC] Starting FreeDATA", author="DJ2LS", version=static.VERSION
"[TNC] Starting FreeDATA", author="DJ2LS", version=TNC.version
)
# start data handler

View file

@ -23,6 +23,7 @@ import numpy as np
import sock
import sounddevice as sd
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
from static import FRAME_TYPE
import structlog
import ujson as json

View file

@ -3,6 +3,7 @@ Hold queues used by more than one module to eliminate cyclic imports.
"""
import queue
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
DATA_QUEUE_TRANSMIT = queue.Queue()
DATA_QUEUE_RECEIVED = queue.Queue()

View file

@ -10,6 +10,7 @@ import time
import structlog
import threading
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
# set global hamlib version
hamlib_version = 0

View file

@ -7,6 +7,8 @@ simple TNC self tests
# pylint: disable=import-outside-toplevel, attribute-defined-outside-init
import sys
import structlog
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
log = structlog.get_logger("selftest")

View file

@ -27,6 +27,7 @@ import time
import wave
import helpers
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
import structlog
from random import randrange
import ujson as json

View file

@ -8,11 +8,15 @@ Here we are saving application wide variables and stats, which have to be access
Not nice, suggestions are appreciated :-)
"""
from dataclasses import dataclass, field
from typing import List
import subprocess
from enum import Enum
CHANNEL_BUSY_SLOT = [False] * 5
VERSION = "0.9.0-alpha-exp.5"
ENABLE_EXPLORER = False
ENABLE_STATS = False
@ -173,3 +177,48 @@ class FRAME_TYPE(Enum):
FEC = 251
IDENT = 254
TEST_FRAME = 255
# TODO: Move settings above to dataclasses
@dataclass
class ARQ:
pass
@dataclass
class Audio:
pass
@dataclass
class Beacon:
pass
@dataclass
class Channel:
pass
@dataclass
class Daemon:
pass
@dataclass
class Hamlib:
pass
@dataclass
class Modem:
pass
@dataclass
class Station:
pass
@dataclass
class TCI:
pass
@dataclass
class TNC:
version = "0.9.0-alpha-exp.5"

View file

@ -13,6 +13,7 @@ import time
import ujson as json
import structlog
import static
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
log = structlog.get_logger("stats")

View file

@ -7,6 +7,7 @@ import websocket
import numpy as np
import time
from queues import AUDIO_TRANSMIT_QUEUE, AUDIO_RECEIVED_QUEUE
from static import ARQ, Audio, Beacon, Channel, Daemon, Hamlib, Modem, Station, TCI, TNC
class TCI:
def __init__(self, hostname='127.0.0.1', port=50001):