diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6140ff35..6e8ebbc8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,7 +7,8 @@ updates: directory: "/" schedule: interval: "daily" - + target-branch: "develop" + # Maintain dependencies for npm - package-ecosystem: "npm" directory: "/gui" @@ -20,3 +21,4 @@ updates: directory: "/" schedule: interval: "daily" + target-branch: "develop" \ No newline at end of file diff --git a/.github/workflows/build_gui.yml b/.github/workflows/build_gui.yml new file mode 100644 index 00000000..c7fbfd91 --- /dev/null +++ b/.github/workflows/build_gui.yml @@ -0,0 +1,37 @@ +name: build_gui +on: [push] + +jobs: + build_i686_x64_release: + name: Build FreeDATA GUI + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, macos-latest, windows-latest] + include: + - os: ubuntu-20.04 + electron_parameters: "-p always" + + - os: macos-latest + electron_parameters: "-p always" + + - os: windows-latest + electron_parameters: "-p always --x64 --ia32" + + steps: + - name: Checkout code for ${{ matrix.platform.name }} + uses: actions/checkout@v4 + with: + repository: DJ2LS/FreeDATA + - name: Electron Builder + env: # Setting environment variables for the entire job + GH_TOKEN: ${{ secrets.github_token }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + working-directory: gui + run: | + npm i + npm run release \ No newline at end of file diff --git a/.github/workflows/build_multiplatform.yml b/.github/workflows/build_multiplatform.yml deleted file mode 100644 index 66c6c043..00000000 --- a/.github/workflows/build_multiplatform.yml +++ /dev/null @@ -1,412 +0,0 @@ -name: Build_Multiplatform -on: [push] - -jobs: - BUILD_AMD64: - name: Build codec2 for x86/x64 devices - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-latest, macos-12] - platform: [{name: "native"}, {name: "Windows", file: "dll"}] - architecture: [i686-w64-mingw32, x86_64-w64-mingw32] - include: - - - os: ubuntu-20.04 - libcodec2_name: libcodec2.so.1.2 - libcodec2_os_name: libcodec2_ubuntu-2004 - libcodec2_filetype: so - generator: Unix Makefiles - shell: bash - - - os: ubuntu-22.04 - libcodec2_name: libcodec2.so.1.2 - libcodec2_os_name: libcodec2_ubuntu-2204 - libcodec2_filetype: so - generator: Unix Makefiles - shell: bash - - - os: macos-latest - libcodec2_name: libcodec2.1.2.dylib - libcodec2_os_name: libcodec2_macos-latest - libcodec2_filetype: dylib - generator: Unix Makefiles - shell: bash - - - os: macos-12 - libcodec2_name: libcodec2.1.2.dylib - libcodec2_os_name: libcodec2_macos-12 - libcodec2_filetype: dylib - generator: Unix Makefiles - shell: bash - - - steps: - - name: Build codec2 on ${{ matrix.os }} for ${{ matrix.platform.name }} - if: ${{startsWith(matrix.platform.name, 'native') }} - run: | - git clone https://github.com/drowe67/codec2.git - cd codec2 - mkdir build - mkdir tempfiles - cd build - cmake -DCMAKE_BUILD_TYPE=Release ../ - make - mv src/${{ matrix.libcodec2_name }} ../tempfiles/libcodec2_${{ matrix.os }}_${{ matrix.platform.name }}.${{ matrix.libcodec2_filetype }} - - - name: LIST ALL FILES ${{ github.workspace }} - run: ls -R ${{ github.workspace }} - - - uses: actions/upload-artifact@v4 - if: ${{startsWith(matrix.platform.name, 'native') }} - with: - name: libcodec2_${{ matrix.os }}_${{ matrix.platform.name }}.${{ matrix.libcodec2_filetype }} - # path: ${{ github.workspace }}/codec2/tempfiles/libcodec2_${{ matrix.os }}_${{ matrix.platform.name }}.${{ matrix.libcodec2_filetype }} - path: ${{ github.workspace }}/codec2/tempfiles/ - - - - name: Build codec2 ${{ matrix.platform.name }} ${{ matrix.architecture }} - if: ${{startsWith(matrix.os, 'ubuntu-20') && !startsWith(matrix.platform.name, 'native') }} - run: | - sudo apt install build-essential mingw-w64 g++-mingw-w64 make cmake - git clone https://github.com/drowe67/codec2.git - cd codec2 - mkdir tempfiles - mkdir build_w32 - cd build_w32 - echo 'set(CMAKE_SYSTEM_NAME ${{ matrix.platform.name }})' > toolchain-ubuntu-mingw32.cmake - echo 'set(CMAKE_C_COMPILER ${{ matrix.architecture }}-gcc)' >> toolchain-ubuntu-mingw32.cmake - echo 'set(CMAKE_CXX_COMPILER ${{ matrix.architecture }}-g++)' >> toolchain-ubuntu-mingw32.cmake - echo 'set(CMAKE_RC_COMPILER ${{ matrix.architecture }}-windres)' >> toolchain-ubuntu-mingw32.cmake - echo 'set(CMAKE_FIND_ROOT_PATH /usr/${{ matrix.architecture }})' >> toolchain-ubuntu-mingw32.cmake - echo 'set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)' >> toolchain-ubuntu-mingw32.cmake - echo 'set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)' >> toolchain-ubuntu-mingw32.cmake - echo 'set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)' >> toolchain-ubuntu-mingw32.cmake - echo 'set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")' >> toolchain-ubuntu-mingw32.cmake - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=toolchain-ubuntu-mingw32.cmake .. - make - mv src/libcodec2.${{ matrix.platform.file }} ../tempfiles/libcodec2_${{ matrix.platform.name }}_${{ matrix.architecture }}.${{ matrix.platform.file }} - - - uses: actions/upload-artifact@v4 - if: ${{startsWith(matrix.os, 'ubuntu-20') && !startsWith(matrix.platform.name, 'native') }} - with: - name: libcodec2_${{ matrix.os }}_${{ matrix.platform.name }}_${{ matrix.architecture }}.${{ matrix.platform.file }} - path: codec2/tempfiles/* - - BUILD_ARM: - # The host should always be linux - runs-on: ubuntu-latest - name: Build codec2 for ARM devices - - # Run steps on a matrix of 2 arch/distro combinations - strategy: - matrix: - include: - - arch: armv7 - distro: bullseye - libcodec2_os_name: libcodec2_bullseye_armv7.so - - arch: armv7 - distro: ubuntu_latest - libcodec2_os_name: libcodec2_ubuntu_latest_armv7.so - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - uses: uraimo/run-on-arch-action@v2 - name: Build artifact - id: build - with: - arch: ${{ matrix.arch }} - distro: ${{ matrix.distro }} - - # Not required, but speeds up builds - githubToken: ${{ github.token }} - - # Create an artifacts directory - setup: | - mkdir -p "${PWD}/artifacts" - - # Mount the artifacts directory as /artifacts in the container - dockerRunArgs: | - --volume "${PWD}/artifacts:/artifacts" - - # Pass some environment variables to the container - env: | # YAML, but pipe character is necessary - artifact_name: ${{ matrix.libcodec2_os_name }} - - # The shell to run commands with in the container - shell: /bin/sh - - # Install some dependencies in the container. This speeds up builds if - # you are also using githubToken. Any dependencies installed here will - # be part of the container image that gets cached, so subsequent - # builds don't have to re-install them. The image layer is cached - # publicly in your project's package repository, so it is vital that - # no secrets are present in the container state or logs. - install: | - case "${{ matrix.distro }}" in - ubuntu*|jessie|stretch|buster|bullseye) - apt-get update -q -y - apt-get install -q -y git build-essential cmake gcc g++ - cmake --version - ;; - fedora*) - dnf -y update - dnf -y install git which make cmake gcc-c++ gcc - cmake --version - ;; - alpine*) - apk update - apk add git cmake gcc g++ - cmake --version - ;; - esac - - # Produce a binary artifact and place it in the mounted volume - run: | - - git clone https://github.com/drowe67/codec2.git - cd codec2 - git checkout main - mkdir build - cd build - cmake ../ - make - mv ./src/libcodec2.so.1.2 /artifacts/${artifact_name} - - - name: Show recursive PWD/artifacts - # Items placed in /artifacts in the container will be in - # ${PWD}/artifacts on the host. - run: ls -al "${PWD}/artifacts" - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.libcodec2_os_name }} - #path: $GITHUB_WORKSPACE/codec2/artifacts/* - path: artifacts/* - - build_i686_x64_release: - needs: [BUILD_AMD64, BUILD_ARM] - name: Build FreeDATA packages - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04, macos-latest, windows-latest] - include: - - os: ubuntu-20.04 - zip_name: ubuntu_modem - generator: Unix Makefiles - daemon_binary_name: freedata-daemon - modem_binary_name: freedata-modem - electron_parameters: "-p always" - - - os: macos-latest - zip_name: macos_modem - generator: Unix Makefiles - daemon_binary_name: freedata-daemon - modem_binary_name: freedata-modem - electron_parameters: "-p always" - - - os: windows-latest - zip_name: windows_modem - generator: Visual Studio 16 2019 - daemon_binary_name: freedata-daemon.exe - modem_binary_name: freedata-modem.exe - electron_parameters: "-p always --x64 --ia32" - steps: - - name: Checkout code for ${{ matrix.platform.name }} - uses: actions/checkout@v4 - with: - repository: DJ2LS/FreeDATA - - - name: Set up Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Install Node.js, NPM and Yarn - uses: actions/setup-node@v4 - with: - node-version: 18.17 - - - name: Create modem/dist - working-directory: modem - run: | - mkdir -p dist - - - name: Create modem/dist/modem - working-directory: modem - run: | - mkdir -p dist/modem - - ##- name: Download libcodec2 artifact Modem DIST - ## uses: actions/download-artifact@v4 - ## with: - ## path: modem/dist/codec2 - - - name: create modem/lib/codec2 - working-directory: modem/lib/ - run: | - mkdir codec2 - - - name: Download libcodec2 artifact Modem LIB - uses: actions/download-artifact@v4 - with: - path: modem/lib/codec2 - - - - name: Install Linux dependencies - # if: matrix.os == 'ubuntu-20.04' - if: ${{startsWith(matrix.os, 'ubuntu')}} - run: | - sudo apt install -y portaudio19-dev libhamlib-dev libhamlib-utils build-essential cmake python3-libhamlib2 patchelf - - - name: Install MacOS pyAudio - if: ${{startsWith(matrix.os, 'macos')}} - run: | - brew install portaudio - python -m pip install --upgrade pip - pip3 install pyaudio - - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Add MacOS certs - if: ${{startsWith(matrix.os, 'macos')}} - run: chmod +x add-osx-cert.sh && ./add-osx-cert.sh - env: - CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }} - CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} - - - name: Build binaries macOS - if: ${{startsWith(matrix.os, 'macos')}} - working-directory: modem - run: | - # now build modem binaries - pyinstaller -y freedata.spec - # and to some final cleanup - # cp -r -f dist/modem/* dist/ - # rm -r dist/modem - - - name: Build binaries Linux and Windows - if: ${{!startsWith(matrix.os, 'macos')}} - working-directory: modem - run: | - # pyinstaller freedata.spec - # python3 -m nuitka --enable-plugin=numpy --assume-yes-for-downloads --onefile daemon.py -o ${{ matrix.daemon_binary_name }} - # python3 -m nuitka --enable-plugin=numpy --assume-yes-for-downloads --onefile main.py -o ${{ matrix.modem_binary_name }} - python3 -m nuitka --enable-plugin=numpy --assume-yes-for-downloads --standalone daemon.py - python3 -m nuitka --enable-plugin=numpy --assume-yes-for-downloads --standalone main.py - - - name: Copy binaries - Linux - if: ${{startsWith(matrix.os, 'ubuntu')}} - working-directory: modem - run: | - cp -r -f daemon.dist/* dist/modem - cp -r -f main.dist/* dist/modem - - - name: Copy binaries - Windows - if: ${{startsWith(matrix.os, 'windows')}} - working-directory: modem - # These are powershell aliases, not UNIX commands. - run: | - cp -r -Force daemon.dist/* dist/modem - cp -r -Force main.dist/* dist/modem - - - name: Rename modem binaries - # we don't need renaming for pyinstaller builds as output name is defined - if: ${{!startsWith(matrix.os, 'macos')}} - working-directory: modem - run: | - mv dist/modem/daemon* dist/modem/${{ matrix.daemon_binary_name }} - mv dist/modem/main* dist/modem/${{ matrix.modem_binary_name }} - - - uses: actions/download-artifact@v4 - with: - path: modem/dist/modem - - - - name: LIST ALL FILES - run: ls -R - - - name: Download Portaudio binaries Linux macOS - if: ${{!startsWith(matrix.os, 'windows')}} - working-directory: modem - run: | - if ! test -d "dist/modem/_sounddevice_data"; then - git clone https://github.com/spatialaudio/portaudio-binaries dist/modem/_sounddevice_data/portaudio-binaries - fi - - - name: Download Portaudio binaries Windows - if: ${{startsWith(matrix.os, 'windows')}} - working-directory: modem - run: | - if(Test-Path -Path "dist/modem/_sounddevice_data"){ - echo "sounddevice folder already exists" - } else { - git clone https://github.com/spatialaudio/portaudio-binaries dist/modem/_sounddevice_data/portaudio-binaries - } - - - name: LIST ALL FILES - run: ls -R - - - name: cleanup on macos before code signing - if: ${{startsWith(matrix.os, 'macos')}} - run: | - ls -l - # find . -type d -name .git -exec rm -r {} \; - find . -type d -o -name ".git" -delete - - - name: Electron Builder - env: # Setting environment variables for the entire job - GH_TOKEN: ${{ secrets.github_token }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - working-directory: gui - run: | - npm i - npm run release - - - name: Compress Modem - uses: thedoctor0/zip-release@master - with: - type: 'zip' - filename: '${{ matrix.zip_name }}.zip' - # directory: ./modem/dist/modem - directory: ./modem/dist/modem - path: . - # exclusions: '*.git* /*node_modules/* .editorconfig' - - - name: Release Modem - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/v') - with: - draft: true - files: ./modem/dist/modem/${{ matrix.zip_name }}.zip - #files: ./modem/dist/${{ matrix.zip_name }}.zip - - - name: LIST ALL FILES - run: ls -R - - #- name: Upload Modem artifacts - # uses: actions/upload-artifact@v4 - # if: ${{!startsWith(github.ref, 'refs/tags/v')}} - # with: - # name: ${{ matrix.zip_name }}.zip - # # path: ./modem/dist/modem/${{ matrix.zip_name }}.zip - # path: ./modem/dist/modem/${{ matrix.zip_name }}.zip# - - #- name: Upload App bundle artifacts - # uses: actions/upload-artifact@v4 - # if: ${{!startsWith(github.ref, 'refs/tags/v')}} - # with: - # name: app_bundle_${{ matrix.os }}.zip - # # path: ./modem/dist/modem/${{ matrix.zip_name }}.zip - # path: ./gui/dist/* diff --git a/.github/workflows/build_server.yml b/.github/workflows/build_server.yml new file mode 100644 index 00000000..bb692f3d --- /dev/null +++ b/.github/workflows/build_server.yml @@ -0,0 +1,133 @@ +name: build_server +on: [push] + +jobs: + build_i686_x64_release: + name: Build FreeDATA packages + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, macos-latest, windows-latest] + include: + - os: ubuntu-20.04 + zip_name: freedata-server_ubuntu + generator: Unix Makefiles + modem_binary_name: freedata-server + + - os: macos-latest + zip_name: freedata-server_macos + generator: Unix Makefiles + modem_binary_name: freedata-server + + - os: windows-latest + zip_name: freedata-server_windows + generator: Visual Studio 16 2019 + modem_binary_name: freedata-server.exe + + steps: + - name: Checkout code for ${{ matrix.platform.name }} + uses: actions/checkout@v4 + with: + repository: DJ2LS/FreeDATA + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Create modem/dist + working-directory: modem + run: | + mkdir -p dist + + - name: Create modem/dist/modem + working-directory: modem + run: | + mkdir -p dist/modem + + - name: Install Linux dependencies + # if: matrix.os == 'ubuntu-20.04' + if: ${{startsWith(matrix.os, 'ubuntu')}} + run: | + sudo apt install -y portaudio19-dev libhamlib-dev libhamlib-utils build-essential cmake python3-libhamlib2 patchelf + + - name: Install MacOS pyAudio + if: ${{startsWith(matrix.os, 'macos')}} + run: | + brew install portaudio + python -m pip install --upgrade pip + pip3 install pyaudio + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Add MacOS certs + if: ${{startsWith(matrix.os, 'macos')}} + run: chmod +x add-osx-cert.sh && ./add-osx-cert.sh + env: + CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }} + CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} + + - name: Build binaries + working-directory: modem + run: | + python3 -m nuitka --remove-output --assume-yes-for-downloads --follow-imports --include-data-dir=lib=lib --include-data-files=lib/codec2/*=lib/codec2/ --include-data-files=config.ini.example=config.ini --standalone server.py --output-filename=freedata-server + + #- name: Download Portaudio binaries Linux macOS + # if: ${{!startsWith(matrix.os, 'windows')}} + # working-directory: modem + # run: | + # if ! test -d "server.dist/modem/_sounddevice_data"; then + # git clone https://github.com/spatialaudio/portaudio-binaries dist/modem/_sounddevice_data/portaudio-binaries + # fi + + #- name: Download Portaudio binaries Windows + # if: ${{startsWith(matrix.os, 'windows')}} + # working-directory: modem + # run: | + # if(Test-Path -Path "server.dist/modem/_sounddevice_data"){ + # echo "sounddevice folder already exists" + # } else { + # git clone https://github.com/spatialaudio/portaudio-binaries dist/modem/_sounddevice_data/portaudio-binaries + # } + + - name: LIST ALL FILES + run: ls -R + + - name: cleanup on macos before code signing + if: ${{startsWith(matrix.os, 'macos')}} + run: | + ls -l + # find . -type d -name .git -exec rm -r {} \; + find . -type d -o -name ".git" -delete + + - name: Compress Modem + uses: thedoctor0/zip-release@master + with: + type: 'zip' + filename: '${{ matrix.zip_name }}.zip' + directory: ./modem/server.dist + path: . + # exclusions: '*.git* /*node_modules/* .editorconfig' + + - name: LIST ALL FILES + run: ls -R + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: '${{ matrix.zip_name }}' + path: ./modem/server.dist/${{ matrix.zip_name }}.zip + + - name: Release Modem + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + draft: true + files: ./modem/server.dist/${{ matrix.zip_name }}.zip + + - name: LIST ALL FILES + run: ls -R diff --git a/.github/workflows/gui_tests.yml b/.github/workflows/gui_tests.yml new file mode 100644 index 00000000..44bb7710 --- /dev/null +++ b/.github/workflows/gui_tests.yml @@ -0,0 +1,38 @@ +name: GUI tests + +on: [push] + +jobs: + build: + # The CMake configure and build commands are platform-agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + strategy: + # By default, GitHub will maximize the number of jobs run in parallel + # depending on the available runners on GitHub-hosted virtual machines. + # max-parallel: 8 + fail-fast: false + matrix: + include: + - node-version: "16" + - node-version: "18" + - node-version: "20" + + steps: + - uses: actions/checkout@v4 + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + working-directory: gui + run: | + npm i + + - name: GUI Test + working-directory: gui + run: | + npm run test \ No newline at end of file diff --git a/.github/workflows/ctest.yml b/.github/workflows/modem_tests.yml similarity index 60% rename from .github/workflows/ctest.yml rename to .github/workflows/modem_tests.yml index 3cd53abc..23e9b2f0 100644 --- a/.github/workflows/ctest.yml +++ b/.github/workflows/modem_tests.yml @@ -1,4 +1,4 @@ -name: CTest +name: Modem tests on: [push] @@ -16,12 +16,12 @@ jobs: fail-fast: false matrix: include: - - python-version: "3.7" + #- python-version: "3.7" EOL - python-version: "3.8" - python-version: "3.9" - python-version: "3.10" - python-version: "3.11" - #- python-version: "3.12-dev" + #- python-version: "3.12" NOT YET SUPPORTED BY NUITKA! steps: - uses: actions/checkout@v4 @@ -32,25 +32,18 @@ jobs: python-version: ${{ matrix.python-version }} - - name: Install packages + - name: Install system packages shell: bash run: | - sudo apt-get update - sudo apt-get install octave octave-common octave-signal sox portaudio19-dev python3-pyaudio - pip3 install psutil crcengine ujson pyserial numpy structlog sounddevice pyaudio requests websocket-client - pip3 install pytest pytest-rerunfailures + sudo apt-get update || true + sudo apt-get install octave octave-common octave-signal sox portaudio19-dev - - name: Build codec2 + - name: Install python packages shell: bash run: | - git clone https://github.com/drowe67/codec2.git - cd codec2 - mkdir -p build_linux && cd build_linux && cmake .. && make + pip3 install -r requirements.txt - - name: run ctests + - name: run config tests shell: bash - working-directory: ${{github.workspace}} run: | - mkdir build && cd build - cmake -DCODEC2_BUILD_DIR=$GITHUB_WORKSPACE/codec2/build_linux .. - ctest --output-on-failure + python -m unittest discover tests \ No newline at end of file diff --git a/.gitignore b/.gitignore index ce0407d4..1dd7a4ff 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,7 @@ coverage.xml #Ignore gui build items /gui/dist /gui/release -/gui/dist-electron \ No newline at end of file +/gui/dist-electron + +#Ignore GUI config +/gui/config/config.json \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index e6d53db2..00000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,218 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project (FreeDATA) -include(CTest) -enable_testing() - -# Find codec2 -if(CODEC2_BUILD_DIR) - find_package(codec2 REQUIRED - PATHS ${CODEC2_BUILD_DIR} - NO_DEFAULT_PATH - CONFIGS codec2.cmake - ) - if(codec2_FOUND) - message(STATUS "Codec2 library found in build tree.") - endif() -else() - find_package(codec2 REQUIRED) -endif() - -# test variables -set(FRAMESPERBURST 3) -set(BURSTS 1) -set(TESTFRAMES 3) - -add_test(NAME audio_buffer - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_audiobuffer.py") - set_tests_properties(audio_buffer PROPERTIES PASS_REGULAR_EXPRESSION "errors: 0") - -add_test(NAME resampler - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_resample_48_8.py") - set_tests_properties(resampler PROPERTIES PASS_REGULAR_EXPRESSION "PASS") - -add_test(NAME modem_state_machine - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_modem_states.py") - set_tests_properties(modem_state_machine PROPERTIES PASS_REGULAR_EXPRESSION "errors: 0") - -add_test(NAME modem_irs_iss - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_modem.py") - set_tests_properties(modem_irs_iss PROPERTIES PASS_REGULAR_EXPRESSION "errors: 0") - -# disabled this test as its actually broken since we introduced session IDs -#add_test(NAME chat_text -# COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; -# export PYTHONPATH=../modem; -# cd ${CMAKE_CURRENT_SOURCE_DIR}/test; -# python3 test_chat_text.py") -# set_tests_properties(chat_text PROPERTIES PASS_REGULAR_EXPRESSION "errors: 0") - -add_test(NAME datac13_frames - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_datac13.py") - set_tests_properties(datac13_frames PROPERTIES PASS_REGULAR_EXPRESSION "errors: 0") - -# disabled this test as its actually broken since we introduced dataclasses -#add_test(NAME datac13_frames_negative -# COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; -# export PYTHONPATH=../modem; -# cd ${CMAKE_CURRENT_SOURCE_DIR}/test; -# python3 test_datac13_negative.py") -# set_tests_properties(datac13_frames_negative PROPERTIES PASS_REGULAR_EXPRESSION "errors: 0") - -add_test(NAME helper_routines - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_helpers.py") - set_tests_properties(helper_routines PROPERTIES PASS_REGULAR_EXPRESSION "errors: 0") - -add_test(NAME py_highsnr_stdio_P_P_multi - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - export BURSTS=${BURSTS}; - export FRAMESPERBURST=${FRAMESPERBURST}; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_highsnr_stdio_P_P_multi.py") - set_tests_properties(py_highsnr_stdio_P_P_multi PROPERTIES PASS_REGULAR_EXPRESSION "DATAC13: ${BURSTS}/${FRAMESPERBURST} DATAC1: ${BURSTS}/${FRAMESPERBURST} DATAC3: ${BURSTS}/${FRAMESPERBURST}") - -add_test(NAME py_highsnr_stdio_P_P_datacx - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - export BURSTS=${BURSTS}; - export FRAMESPERBURST=${FRAMESPERBURST}; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_highsnr_stdio_P_P_datacx.py") - set_tests_properties(py_highsnr_stdio_P_P_datacx PROPERTIES PASS_REGULAR_EXPRESSION "RECEIVED BURSTS: ${BURSTS} RECEIVED FRAMES: ${FRAMESPERBURST}") - -add_test(NAME py_highsnr_stdio_P_C_datacx - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - export BURSTS=${BURSTS}; - export FRAMESPERBURST=${FRAMESPERBURST}; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_highsnr_stdio_P_C_datacx.py") - set_tests_properties(py_highsnr_stdio_P_C_datacx PROPERTIES PASS_REGULAR_EXPRESSION "HELLO WORLD") - -add_test(NAME py_highsnr_stdio_C_P_datacx - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - export PYTHONPATH=../modem; - export BURSTS=${BURSTS}; - export FRAMESPERBURST=${FRAMESPERBURST}; - export TESTFRAMES=${TESTFRAMES}; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_highsnr_stdio_C_P_datacx.py") - set_tests_properties(py_highsnr_stdio_C_P_datacx PROPERTIES PASS_REGULAR_EXPRESSION "RECEIVED BURSTS: ${BURSTS} RECEIVED FRAMES: ${FRAMESPERBURST}") - -add_test(NAME highsnr_stdio_P_C_single - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 util_tx.py --mode datac13 --delay 500 --framesperburst ${FRAMESPERBURST} --bursts ${BURSTS} | - sox -t .s16 -r 48000 -c 1 - -t .s16 -r 8000 -c 1 - | - freedv_data_raw_rx datac13 - - --framesperburst ${FRAMESPERBURST} | hexdump -C") - set_tests_properties(highsnr_stdio_P_C_single PROPERTIES PASS_REGULAR_EXPRESSION "HELLO WORLD") - -add_test(NAME highsnr_stdio_C_P_single - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - freedv_data_raw_tx datac13 --testframes ${TESTFRAMES} --bursts ${BURSTS} --framesperburst ${FRAMESPERBURST} /dev/zero - | - sox -t .s16 -r 8000 -c 1 - -t .s16 -r 48000 -c 1 - | - python3 util_rx.py --mode datac13 --framesperburst ${FRAMESPERBURST} --bursts ${BURSTS}") - set_tests_properties(highsnr_stdio_C_P_single PROPERTIES PASS_REGULAR_EXPRESSION "RECEIVED BURSTS: ${BURSTS} RECEIVED FRAMES: ${FRAMESPERBURST}") - -add_test(NAME highsnr_stdio_P_P_single - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 util_tx.py --mode datac13 --delay 500 --framesperburst ${FRAMESPERBURST} --bursts ${BURSTS} | - python3 util_rx.py --debug --mode datac13 --framesperburst ${FRAMESPERBURST} --bursts ${BURSTS}") - set_tests_properties(highsnr_stdio_P_P_single PROPERTIES PASS_REGULAR_EXPRESSION "RECEIVED BURSTS: ${BURSTS} RECEIVED FRAMES: ${FRAMESPERBURST}") - -add_test(NAME highsnr_stdio_P_P_multi - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 util_multimode_tx.py --delay 500 --framesperburst ${FRAMESPERBURST} --bursts ${BURSTS} | - python3 util_multimode_rx.py --framesperburst ${FRAMESPERBURST} --bursts ${BURSTS} --timeout 60") - set_tests_properties(highsnr_stdio_P_P_multi PROPERTIES PASS_REGULAR_EXPRESSION "DATAC13: ${BURSTS}/${FRAMESPERBURST} DATAC1: ${BURSTS}/${FRAMESPERBURST} DATAC3: ${BURSTS}/${FRAMESPERBURST}") - -# These tests can't run on GitHub actions as we don't have a virtual sound card -if(NOT DEFINED ENV{GITHUB_RUN_ID}) - -# uses aplay/arecord then pipe to Python -add_test(NAME highsnr_virtual1_P_P_single_alsa - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - ./test_virtual1.sh") - set_tests_properties(highsnr_virtual1_P_P_single_alsa PROPERTIES PASS_REGULAR_EXPRESSION "RECEIVED BURSTS: 5 RECEIVED FRAMES: 10 RX_ERRORS: 0") - -# let Python do audio I/O -add_test(NAME highsnr_virtual2_P_P_single - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - ./test_virtual2.sh") - set_tests_properties(highsnr_virtual2_P_P_single PROPERTIES PASS_REGULAR_EXPRESSION "RECEIVED BURSTS: 3 RECEIVED FRAMES: 6 RX_ERRORS: 0") - -# Multimode test with Python I/O -add_test(NAME highsnr_virtual3_P_P_multi - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - ./test_virtual_mm.sh") - set_tests_properties(highsnr_virtual3_P_P_multi PROPERTIES PASS_REGULAR_EXPRESSION "DATAC13: 2/4 DATAC1: 2/4 DATAC3: 2/4") - -# let Python do audio I/O via pyaudio callback mode -add_test(NAME highsnr_virtual4_P_P_single_callback - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - ./test_virtual3a.sh") - set_tests_properties(highsnr_virtual4_P_P_single_callback PROPERTIES PASS_REGULAR_EXPRESSION "RECEIVED BURSTS: 3 RECEIVED FRAMES: 6 RX_ERRORS: 0") - -# let Python do audio I/O via pyaudio callback mode with code outside of callback -add_test(NAME highsnr_virtual4_P_P_single_callback_outside - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - ./test_virtual3b.sh") - set_tests_properties(highsnr_virtual4_P_P_single_callback_outside PROPERTIES PASS_REGULAR_EXPRESSION "RECEIVED BURSTS: 3 RECEIVED FRAMES: 6 RX_ERRORS: 0") - -# let Python do audio I/O via pyaudio callback mode with code outside of callback -add_test(NAME highsnr_virtual5_P_P_multi_callback - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - ./test_virtual4a.sh") - set_tests_properties(highsnr_virtual5_P_P_multi_callback PROPERTIES PASS_REGULAR_EXPRESSION "DATAC13: 2/4 DATAC1: 2/4 DATAC3: 2/4") - -# let Python do audio I/O via pyaudio callback mode with code outside of callback -add_test(NAME highsnr_virtual5_P_P_multi_callback_outside - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - ./test_virtual4b.sh") - set_tests_properties(highsnr_virtual5_P_P_multi_callback_outside PROPERTIES PASS_REGULAR_EXPRESSION "DATAC13: 2/4 DATAC1: 2/4 DATAC3: 2/4") - -endif() - diff --git a/documentation/FreeDATA-protocols.md b/documentation/FreeDATA-protocols.md new file mode 100644 index 00000000..68bf5ded --- /dev/null +++ b/documentation/FreeDATA-protocols.md @@ -0,0 +1,141 @@ +# FreeDATA - Protocols + +## ARQ Sessions +An ARQ Session represents a reliable data transmission session from a sending station (A) to a receiving station (B). It uses automatic repeat request on top of different codec2 modes according to the transmission channel conditions. + +So lets say A wants to send some data to B. A typical scenario would be like this: + +``` +ISS->(1)IRS: OPEN_REQ(session id, origin, dest) +IRS->(1)ISS: OPEN_ACK (session id, proto version, speed level, frames, snr) + +ISS->(1)IRS: INFO(id, total_bytes, total_crc) +IRS->(1)ISS: INFO_ACK(id, total_crc) + +ISS->(1)IRS:BURST (ID, offset, payload),(ID, offset, payload),(ID, offset, payload) +IRS->(1)ISS:BURST_ACK (ID, next_offset, speed level, frames, snr) + +ISS-->(1)IRS:Lost BURST (total or part) +IRS->(1)ISS:BURST_NACK (ID, next_offset, speed level, frames, snr) + +ISS->(1)IRS:BURST (ID, offset, payload),(ID, offset, payload),(ID, offset, payload) +IRS->(1)ISS:DATA ACK NACK (ID, next_offset, speed level, frames, snr) +``` + + +### Frame details + + +#### SESSION_OPEN_REQ + +ISS sends this first + +DATAC13 Mode (12 bytes) + +|field|bytes| +|-|-| +|session id|1| +|origin|6| +|destination_crc|3| + + +#### SESSION_OPEN_ACK + +Sent by the IRS in response to a SESSION_OPEN_REQ + +DATAC13 Mode (12 bytes) + +|field|bytes| +|-|-| +|session id|1| +|origin|6| +|destination_crc|3| +|protocol version|1| +|snr|1| + + +#### SESSION_INFO + +ISS sends this in response to a SESSION_OPEN_ACK + +DATAC13 Mode (12 bytes) + +|field|bytes| +|-|-| +|session id|1| +|total bytes|4| +|total crc|4| +|snr|1| + + +#### SESSION_INFO_ACK + +IRS sends this in response to a SESSION_INFO + +DATAC13 Mode (12 bytes) + +|field|bytes| +|-|-| +|session id|1| +|total crc|4| +|snr|1| +|speed level|1| +|frames per burst|1| + + +#### Data Burst + +ISS sends this to send data to IRS + +Mode according to handshake speed level + +Frames per burst according to handshake + +##### Modulation +Each burst is composed of frames_per_burst frames: + +|preamble|f1|f2|f3|...|postamble| + +##### Each data frame + +|field|bytes| +|-|-| +|session id|1| +|offset|4| +|payload|(the remaining payload length)| + + +#### DATA_BURST_ACK + +Sent by the IRS following successful decoding of burst. + +|field|bytes| +|-|-| +|session id|1| +|next offset|4| +|next speed level|1| +|next frames per burst|1| +|snr|1| + + +#### DATA_BURST_NACK + +Sent by the IRS following unsuccessful decoding of burst or timeout. + +|field|bytes| +|-|-| +|session id|1| +|next offset|4| +|next speed level|1| +|next frames per burst|1| +|snr|1| + +#### DATA ACK NACK + +Sent by the IRS after receiving data with a state information. + +| field |bytes| +|------------|-| +| session id |1| +| state |1| +| snr |1| \ No newline at end of file diff --git a/gui/config/example.json b/gui/config/example.json new file mode 100644 index 00000000..9d9384cd --- /dev/null +++ b/gui/config/example.json @@ -0,0 +1,10 @@ +{ + "local": { + "host": "127.0.0.1", + "port": "5000", + "spectrum": "waterfall", + "wf_theme": 2, + "update_channel": "alpha", + "enable_sys_notification": false + } +} \ No newline at end of file diff --git a/gui/electron-builder.json5 b/gui/electron-builder.json5 index 2a93a984..5bcf15e6 100644 --- a/gui/electron-builder.json5 +++ b/gui/electron-builder.json5 @@ -19,13 +19,13 @@ "files": [ "dist", "dist-electron", - "../modem/dist/modem/", + "../modem/server.dist/", ], "extraResources": [ { - "from": "../modem/dist/modem/", + "from": "../modem/server.dist/", "to": "modem", "filter": [ "**/*", diff --git a/gui/electron/main/index.ts b/gui/electron/main/index.ts index aed34745..cf4e9636 100644 --- a/gui/electron/main/index.ts +++ b/gui/electron/main/index.ts @@ -20,6 +20,7 @@ process.env.DIST = join(process.env.DIST_ELECTRON, "../dist"); process.env.VITE_PUBLIC = process.env.VITE_DEV_SERVER_URL ? join(process.env.DIST_ELECTRON, "../public") : process.env.DIST; +process.env.FDUpdateAvail = "0"; // Disable GPU Acceleration for Windows 7 if (release().startsWith("6.1")) app.disableHardwareAcceleration(); @@ -55,8 +56,7 @@ async function createWindow() { autoHideMenuBar: true, webPreferences: { preload, - backgroundThrottle: false, - + backgroundThrottling: false, // Warning: Enable nodeIntegration and disable contextIsolation is not secure in production // Consider using contextBridge.exposeInMainWorld // Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation @@ -100,20 +100,20 @@ async function createWindow() { app.whenReady().then(() => { createWindow(); -console.log(platform()) + console.log(platform()); //Generate daemon binary path var daemonPath = ""; switch (platform().toLowerCase()) { case "darwin": - daemonPath = join(process.resourcesPath, "modem", "freedata-daemon"); + daemonPath = join(process.resourcesPath, "modem", "freedata-server"); case "linux": - daemonPath = join(process.resourcesPath, "modem", "freedata-daemon"); + daemonPath = join(process.resourcesPath, "modem", "freedata-server"); break; case "win32": - daemonPath = join(process.resourcesPath, "modem", "freedata-daemon.exe"); - break; + daemonPath = join(process.resourcesPath, "modem", "freedata-server.exe"); + break; case "win64": - daemonPath = join(process.resourcesPath, "modem", "freedata-daemon.exe"); + daemonPath = join(process.resourcesPath, "modem", "freedata-server.exe"); break; default: console.log("Unhandled OS Platform: ", platform()); @@ -122,24 +122,22 @@ console.log(platform()) //Start daemon binary if it exists if (existsSync(daemonPath)) { - console.log("Starting freedata-daemon binary"); + console.log("Starting freedata-server binary"); console.log("daemonPath:", daemonPath); console.log("CWD:", join(daemonPath, "..")); -/* - var daemonProcess = spawn("freedata-daemon", [], { + /* + var daemonProcess = spawn("freedata-server", [], { cwd: join(process.env.DIST, "modem"), shell: true }); */ -/* + /* daemonProcess = spawn(daemonPath, [], { shell: true }); console.log(daemonProcess) */ - daemonProcess = spawn(daemonPath, [], { - }); - + daemonProcess = spawn(daemonPath, [], {}); // return process messages daemonProcess.on("error", (err) => { @@ -154,7 +152,7 @@ daemonProcess = spawn(daemonPath, [], { }); daemonProcess.stderr.on("data", (data) => { // daemonProcessLog.info(`${data}`); - console.log(data) + console.log(data); }); daemonProcess.on("close", (code) => { // daemonProcessLog.warn(`daemonProcess exited with code ${code}`); @@ -170,7 +168,7 @@ daemonProcess = spawn(daemonPath, [], { app.on("window-all-closed", () => { win = null; - if (process.platform !== "darwin") app.quit(close_sub_processes()); + if (process.platform !== "darwin") app.quit(); }); app.on("second-instance", () => { @@ -215,6 +213,7 @@ ipcMain.on("request-restart-and-install-update", (event, data) => { // LISTENER FOR UPDATER EVENTS autoUpdater.on("update-available", (info) => { + process.env.FDUpdateAvail = "1"; console.log("update available"); let arg = { @@ -234,6 +233,7 @@ autoUpdater.on("update-not-available", (info) => { }); autoUpdater.on("update-downloaded", (info) => { + process.env.FDUpdateAvail = "1"; console.log("update downloaded"); let arg = { status: "update-downloaded", @@ -288,19 +288,19 @@ function close_sub_processes() { console.log("closing modem and daemon"); try { - if (platform() == "win32" || platform() == "win64") { + if (platform() == "win32") { spawn("Taskkill", ["/IM", "freedata-modem.exe", "/F"]); - spawn("Taskkill", ["/IM", "freedata-daemon.exe", "/F"]); + spawn("Taskkill", ["/IM", "freedata-server.exe", "/F"]); } if (platform() == "linux") { spawn("pkill", ["-9", "freedata-modem"]); - spawn("pkill", ["-9", "freedata-daemon"]); + spawn("pkill", ["-9", "freedata-server"]); } if (platform() == "darwin") { spawn("pkill", ["-9", "freedata-modem"]); - spawn("pkill", ["-9", "freedata-daemon"]); + spawn("pkill", ["-9", "freedata-server"]); } } catch (e) { console.log(e); diff --git a/gui/electron/preload/index.ts b/gui/electron/preload/index.ts index adb7b8c5..69e18a1e 100644 --- a/gui/electron/preload/index.ts +++ b/gui/electron/preload/index.ts @@ -113,17 +113,6 @@ window.onmessage = (ev) => { setTimeout(removeLoading, 4999); -window.addEventListener("DOMContentLoaded", () => { - // we are using this area for implementing the electron runUpdater - // we need access to DOM for displaying updater results in GUI - // close app, update and restart - document - .getElementById("update_and_install") - .addEventListener("click", () => { - ipcRenderer.send("request-restart-and-install-update"); - }); -}); - // IPC ACTION FOR AUTO UPDATER ipcRenderer.on("action-updater", (event, arg) => { if (arg.status == "download-progress") { diff --git a/gui/package.json b/gui/package.json index c78bf27a..85f605b7 100644 --- a/gui/package.json +++ b/gui/package.json @@ -7,6 +7,7 @@ "scripts": { "start": "vite", "dev": "vite", + "test": "vitest --run", "check": "vue-tsc --noEmit", "build": "vue-tsc --noEmit && vite build && electron-builder -p never", "release": "vue-tsc --noEmit && vite build && electron-builder -p onTag", @@ -31,55 +32,59 @@ }, "homepage": "https://freedata.app", "dependencies": { - "@electron/asar": "^3.2.7", - "@electron/notarize": "^2.1.0", - "@electron/universal": "^2.0.0", - "@popperjs/core": "^2.11.8", - "@vueuse/electron": "^10.4.1", - "blob-util": "^2.0.2", - "bootstrap": "^5.3.1", - "bootstrap-icons": "^1.10.5", - "bootswatch": "^5.3.1", - "browser-image-compression": "^2.0.2", - "chart.js": "^4.3.3", - "chartjs-plugin-annotation": "^3.0.1", - "electron-log": "^5.0.0", - "electron-updater": "^6.1.6", - "emoji-picker-element": "^1.18.3", - "emoji-picker-element-data": "^1.4.0", - "file-saver": "^2.0.5", - "mime": "^3.0.0", - "pinia": "^2.1.6", - "pouchdb": "^8.0.1", - "pouchdb-browser": "^8.0.1", - "pouchdb-find": "^8.0.1", - "pouchdb-upsert": "^2.2.0", - "qth-locator": "^2.1.0", - "sass": "^1.66.1", - "socket.io": "^4.7.2", - "uuid": "^9.0.0", - "vue": "^3.3.4", - "vue-chartjs": "^5.2.0", - "vuemoji-picker": "^0.2.0" + "@electron/asar": "3.2.7", + "@electron/notarize": "2.2.0", + "@electron/universal": "2.0.0", + "@popperjs/core": "2.11.8", + "@vueuse/electron": "10.7.1", + "blob-util": "2.0.2", + "bootstrap": "5.3.2", + "bootstrap-icons": "1.11.2", + "bootswatch": "5.3.2", + "browser-image-compression": "2.0.2", + "chart.js": "4.4.1", + "chartjs-plugin-annotation": "3.0.1", + "electron-log": "5.0.3", + "electron-updater": "6.1.7", + "emoji-picker-element": "1.20.1", + "emoji-picker-element-data": "1.6.0", + "file-saver": "2.0.5", + "gridstack": "10.0.1", + "mime": "4.0.1", + "nconf": "^0.12.1", + "pinia": "2.1.7", + "pouchdb": "8.0.1", + "pouchdb-browser": "8.0.1", + "pouchdb-find": "8.0.1", + "pouchdb-upsert": "2.2.0", + "qth-locator": "2.1.0", + "sass": "1.66.1", + "socket.io": "4.7.2", + "uuid": "9.0.1", + "vue": "3.3.12", + "vue-chartjs": "5.3.0", + "vuemoji-picker": "0.2.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^6.7.4", - "@vitejs/plugin-vue": "^4.4.0", - "electron": "^27.0.0", - "electron-builder": "^24.6.3", - "eslint": "^8.50.0", - "eslint-config-prettier": "^9.0.0", - "eslint-config-standard-with-typescript": "^40.0.0", - "eslint-plugin-import": "^2.28.1", - "eslint-plugin-n": "^16.1.0", - "eslint-plugin-prettier": "^5.0.0", - "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-vue": "^9.17.0", - "typescript": "^5.2.2", - "vite": "^5.0.2", - "vite-plugin-electron": "^0.15.4", - "vite-plugin-electron-renderer": "^0.14.5", - "vue": "^3.3.4", - "vue-tsc": "^1.4.2" + "@types/nconf": "^0.10.6", + "@typescript-eslint/eslint-plugin": "6.17.0", + "@vitejs/plugin-vue": "4.5.2", + "electron": "28.1.3", + "electron-builder": "24.9.1", + "eslint": "8.56.0", + "eslint-config-prettier": "9.1.0", + "eslint-config-standard-with-typescript": "43.0.0", + "eslint-plugin-import": "2.29.1", + "eslint-plugin-n": "16.1.0", + "eslint-plugin-prettier": "5.0.1", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-vue": "9.20.1", + "typescript": "5.3.3", + "vite": "5.0.10", + "vite-plugin-electron": "0.28.0", + "vite-plugin-electron-renderer": "0.14.5", + "vitest": "1.0.2", + "vue": "3.3.12", + "vue-tsc": "1.8.27" } } diff --git a/gui/src/assets/waterfall/spectrum.js b/gui/src/assets/waterfall/spectrum.js index df217091..fb93bd61 100644 --- a/gui/src/assets/waterfall/spectrum.js +++ b/gui/src/assets/waterfall/spectrum.js @@ -274,14 +274,16 @@ Spectrum.prototype.updateSpectrumRatio = function () { }; Spectrum.prototype.resize = function () { - var width = this.canvas.clientWidth; - var height = this.canvas.clientHeight; + var width = this.parent.clientWidth; + var height =this.parent.clientHeight; // little helper for setting height of clientHeight is not working as expected if (height == 0){ var height = 250 } - + if (width == 0){ + width=500; + } if (this.canvas.width != width || this.canvas.height != height) { this.canvas.width = width; @@ -445,8 +447,8 @@ Spectrum.prototype.onKeypress = function (e) { export function Spectrum(id, options) { - console.log("waterfall init....") - console.log(document.getElementById(id)) + // console.log("waterfall init....") + //console.log(document.getElementById(id)) // Handle options this.centerHz = options && options.centerHz ? options.centerHz : 1500; @@ -473,7 +475,7 @@ export function Spectrum(id, options) { // Create main canvas and adjust dimensions to match actual this.canvas = document.getElementById(id); - + this.parent = this.canvas.parentElement; this.canvas.height = this.canvas.clientHeight; this.canvas.width = this.canvas.clientWidth; diff --git a/gui/src/components/chat.vue b/gui/src/components/chat.vue index d625d309..7f0f145a 100644 --- a/gui/src/components/chat.vue +++ b/gui/src/components/chat.vue @@ -33,7 +33,7 @@ import chat_new_message from "./chat_new_message.vue";
diff --git a/gui/src/components/chat_messages_sent.vue b/gui/src/components/chat_messages_sent.vue index 32ef66a2..2dceebce 100644 --- a/gui/src/components/chat_messages_sent.vue +++ b/gui/src/components/chat_messages_sent.vue @@ -57,6 +57,7 @@ >