Skip to content

Commit

Permalink
Merge pull request #4 from FSLART/dev
Browse files Browse the repository at this point in the history
Pre Release do volante T14
  • Loading branch information
Imeguras authored Sep 13, 2023
2 parents 60b0b5b + feedafb commit 8ef2e7a
Show file tree
Hide file tree
Showing 34 changed files with 1,890 additions and 208 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/buildQmake_wf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: buildQmake_wf.yml
on:
workflow_call:
inputs:
qmakeflags:
required: false
type: string
binaryfilename:
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: qt6-base-dev qt5-qmake qtbase5-dev libqt6serialport6 libqt6serialport6-dev libqt5serialport5 libqt5serialport5-dev nlohmann-json3-dev socat gengetopt
version: 1.0
- name: Build with qmake
run: /usr/bin/qmake VolanteAlphaQT.pro ${{ inputs.qmakeflags }} && make
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ inputs.binaryfilename }}
path: ${{ github.workspace }}/bin/${{ inputs.binaryfilename }}
if-no-files-found: error
9 changes: 9 additions & 0 deletions .github/workflows/deploy_wf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: deploy_wf
on:
push:
branches: [ master, workflow-stuff ]
jobs:
deploy-production:
uses:
./.github/workflows/deploymentProduction_wf.yml
secrets: inherit
11 changes: 11 additions & 0 deletions .github/workflows/deploymentProduction_wf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#A workflow to deploy the application to a banana pi Zero M2
name: deploymentProduction_wf
on: workflow_call
jobs:
build-qt-desktop:
uses: ./.github/workflows/buildQmake_wf.yml
with:
qmakeflags: "CONFIG+=release_armv7Cortex"
binaryfilename: VolanteAlphaQT


38 changes: 38 additions & 0 deletions .github/workflows/testQTarmv7_wf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: testQTarmv7_wf
on:
workflow_call:
inputs:
suite:
required: false
type: string
jobs:
build-qt-tests-armv7:
uses: ./.github/workflows/buildQmake_wf.yml
with:
qmakeflags: "CONFIG+=\"test release_armv7Cortex\""
binaryfilename: VolanteAlphaQT_testes
test-qt-armv7:
needs: [build-qt-desktop]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch artifacts from build-qt-desktop
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
path: bin
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: completed
name: VolanteAlphaQT_testes
# open ssh connection to the server
- name: Setup permissions
run: chmod u+x $GITHUB_WORKSPACE/bin/VolanteAlphaQT_testes
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: qt6-base-dev qt5-qmake qtbase5-dev libqt6serialport6 libqt6serialport6-dev libqt5serialport5 libqt5serialport5-dev nlohmann-json3-dev socat gengetopt
version: 1.0
- name: Run tests
run: cd $GITHUB_WORKSPACE/bin && ./VolanteAlphaQT_testes -platform offscreen


38 changes: 38 additions & 0 deletions .github/workflows/testQTdesktop_wf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: testQTdesktop_wf
on:
workflow_call:
inputs:
suite:
required: false
type: string
jobs:
build-qt-desktop:
uses: ./.github/workflows/buildQmake_wf.yml
with:
qmakeflags: "CONFIG+=test"
binaryfilename: VolanteAlphaQT_testes
test-qt-desktop:
needs: [build-qt-desktop]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch artifacts from build-qt-desktop
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
path: bin
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: completed
name: VolanteAlphaQT_testes
# open ssh connection to the server
- name: Setup permissions
run: chmod u+x $GITHUB_WORKSPACE/bin/VolanteAlphaQT_testes
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: qt6-base-dev qt5-qmake qtbase5-dev libqt6serialport6 libqt6serialport6-dev libqt5serialport5 libqt5serialport5-dev nlohmann-json3-dev socat gengetopt
version: 1.0
- name: Run tests
run: cd $GITHUB_WORKSPACE/bin && ./VolanteAlphaQT_testes -platform offscreen


10 changes: 10 additions & 0 deletions .github/workflows/test_wf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: test_wf
on:
push:
branches: [ master, workflow-stuff ]
jobs:
test-qt-desktop:
uses:
./.github/workflows/testQTdesktop_wf.yml
secrets: inherit

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ CMakeLists.txt.user*
*.dll
*.exe

**args.c
**args.h

bin
build
*.code-workspace
*.code-workspace
serialLog**.txt
**.log
.vscode
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Volante Alpha
# Volante Alpha -> [![main_wf](https://github.com/FSLART/volante_alpha_qt/actions/workflows/main_wf.yml/badge.svg?branch=master)](https://github.com/FSLART/volante_alpha_qt/actions/workflows/main_wf.yml)

[![test_wf](https://github.com/FSLART/volante_alpha_qt/actions/workflows/test_wf.yml/badge.svg?branch=master)](https://github.com/FSLART/volante_alpha_qt/actions/workflows/test_wf.yml) [![deploy_wf](https://github.com/FSLART/volante_alpha_qt/actions/workflows/deploy_wf.yml/badge.svg?branch=master)](https://github.com/FSLART/volante_alpha_qt/actions/workflows/deploy_wf.yml)

Bem vindo!

Este repo tem o propósito de uma implementação do software que será usado tanto para o volante do T14 para fazer alguns testes, como no futuro para modelos mais recentes. A sua implementação atualmente encontra-se em QT 6.0 com base nas bibliotecas nativas em C++. Para compilar o projeto necessitarás de qMake(uma implementação inspirada no software Cmake e make) existindo cerca de 4 ambientes, estes sendo: **Profile, Debug, Release e Testing**

## v1.0.0

Apesar de não ter havido versionamento pois o desenvolvimento foi apressado e houveram prioridades este release é exclusivamente para as variáveis do T-14 e não deve ser usado para outros veiculos pois terão variaveis de controlo diferente às usadas.

# Ambientes

Deverás usar o software qtcreator já que ajuda a executar o qmake e o make com todo o make eyecandy para poderes fazer debugging e dar set up automatico de alguns ambientes listados acima. Três dos quatro ambientes são criados automaticamente pelo qtcreator, mas um deles (Testing) terá de ser criado manualmente no qtcreator, pois não vem por defeito.
Expand Down Expand Up @@ -43,7 +49,7 @@ test{

Se mudares a linha e tua responsabilidade mudares as alterações de volta antes de fazeres um commit. O .pro nao deve ser ignorado pois causa a que toda a gente tenha de manualmente criar o ficheiro. Ignorar isto pode causar problemas futuros.

---------
---

# Dependencias

Expand All @@ -59,6 +65,8 @@ Para o BSON irás precisar de uma biblioteca json, especificamente:
https://github.com/nlohmann/json
Poderás usar a seguinte package com o pacman ``nlohmann-json``. Foi usada a versão `nlohmann-json-3.11.2-1-any` para o desenvolvimento

Para testes terás de instalar gengetopt e socat.

# Manutenção do README

Se notares que o .readme está bastante desatualizado e pertences à equipa deves chatear uma pessoa apropriada. A partida no futuro existerá um manual tanto para utilizadores como para developers.
Expand Down
106 changes: 85 additions & 21 deletions VolanteAlphaQT.pro
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
######################################################################
# Automatically generated by qmake (3.1) Wed Feb 8 13:19:20 2023
######################################################################
defines += __LART_T14__

QT += core gui widgets serialport
QT += core gui widgets serialport

TEMPLATE = app
TARGET = VolanteAlphaQT
Expand All @@ -21,38 +22,101 @@ RCC_DIR = build
# Please consult the documentation of the deprecated API in order to know
# how to port your code away from it.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

# Input
HEADERS += src/contarotacoes.h \
src/mainwindow.h \
src/store.h

HEADERS += \
#Constants Macros Aux stuff
src/references/bson_var.h \
#UI and other non operational stuff
src/flabel.h \
src/contarotacoes.h \
src/contamudancas.h \
src/mainwindow.h \
#Biz Logic
src/store.h

SOURCES += src/contarotacoes.cpp \
src/main.cpp \
src/mainwindow.cpp \
src/store.cpp
SOURCES += \
#Constants Macros Aux stuff
#UI and other non operational stuff
src/flabel.cpp \
src/contarotacoes.cpp \
src/contamudancas.cpp \
src/main.cpp \
src/mainwindow.cpp \
#Biz Logic
src/store.cpp

FORMS += src/mainwindow.ui

TRANSLATIONS += src/VolanteAlphaQT_1_en_US.ts

test{
message(A configurar a build de testes...)

message(A configurar a build de testes...)

TARGET = VolanteAlphaQT_testes
TARGET = VolanteAlphaQT_testes
# run command before compiling
#go to
system(gengetopt --input=./test/args.ggo --output-dir=./test -F args)

QT += testlib
SOURCES -= src/main.cpp

HEADERS += \
test/tst_contarotacoes.h \
test/tst_serialport.h
QT += testlib
SOURCES -= src/main.cpp
SOURCES += test/main.cpp

HEADERS += \
test/args.h \
test/aux.h \
test/tst_contarotacoes.h \
test/tst_contamudancas.h \
test/tst_serialport.h \
test/tst_flabels.h

SOURCES += \
test/tst_contarotacoes.cpp \
test/tst_serialport.cpp


SOURCES += \
test/args.c \
test/aux.cpp \
test/tst_flabels.cpp \
test/tst_contarotacoes.cpp \
test/tst_contamudancas.cpp \
test/tst_serialport.cpp
}
release_armv7Cortex{
QT =
CONFIG -= debug ltcg
defines += __LART_DEPLOY__

CROSS_COMPILER_NAME = "arm-linux-gnueabihf"
#DEFINES += CROSS_COMPILER_NAME=\"$$CROSS_COMPILER_NAME"

QMAKE_CC = $$CROSS_COMPILER_NAME-gcc
QMAKE_CXX = $$CROSS_COMPILER_NAME-g++

QMAKE_LINK = $$CROSS_COMPILER_NAME-ld.gold
QMAKE_LINK_SHLIB = $$CROSS_COMPILER_NAME-ld.gold
QMAKE_LIBS_EGL = -lEGL -lGLESv2
QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2
QMAKE_INCDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/include
QMAKE_LIBDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBS += -I$$[QT_SYSROOT]/usr/include/nlohmann
QMAKE_LIBS_BCM_HOST = -lbcm_host

QT_ARMV7_COMPILER_VERSION = $$system($$QMAKE_CXX -dumpversion)
DEFINES += QT_ARMV7_COMPILER_VERSION=\"$$QT_ARMV7_COMPILER_VERSION\"
QT_ARMV7_SO_LOCATION = /usr/lib/gcc/$$CROSS_COMPILER_NAME/$$QT_ARMV7_COMPILER_VERSION/qt
DEFINES += QT_ARMV7_SO_LOCATION=$$QT_ARMV7_SO_LOCATION
# TODO: This is strange... check if theres something more adequate
QMAKE_CXXFLAGS *= -I/usr/include/nlohmann -I$$QT_ARMV7_SO_LOCATION
QMAKE_CXXFLAGS *= -mfloat-abi=hard -mfpu=neon -mthumb -mthumb-interwork -mcpu=cortex-a7 -mtune=cortex-a7 -mabi=aapcs-linux -mhard-float -mno-unaligned-access -fPIC
QMAKE_LFLAGS_RELEASE *= -shared -mfloat-abi=hard -mfpu=neon -mthumb -mthumb-interwork -mcpu=cortex-a7 -mtune=cortex-a7 -mabi=aapcs-linux -mhard-float -mno-unaligned-access -O2 -flto=4 -fno-fat-lto-objects -fuse-linker-plugin -fuse-ld=bfd
QMAKE_LFLAGS_RELEASE -= -Wl,-O1


# spaggeti code...
message($$QMAKE_LIBS)
QMAKE_LIBS -= -lpthread
QMAKE_LIBS += -L$$QT_ARMV7_SO_LOCATION/libpthread.so.0 -L$$QT_ARMV7_SO_LOCATION/libQt5Widgets.so -L$$QT_ARMV7_SO_LOCATION/libQt5Gui.so -L$$QT_ARMV7_SO_LOCATION/libQt5SerialPort.so -L$$QT_ARMV7_SO_LOCATION/libQt5Core.so


}
Loading

0 comments on commit 8ef2e7a

Please sign in to comment.