Skip to content

Latest commit

 

History

History
168 lines (121 loc) · 4.97 KB

CONTRIBUTING.md

File metadata and controls

168 lines (121 loc) · 4.97 KB

Developer notes

Here are the developer notes for this project.

Building

You need Qt 5 to build this project, including QtQuick.

Open the .pro file in Qt Creator. Build it.

Another option is to do:

qmake .
make

Install dependencies on Ubuntu

sudo apt-get install -y libqt5sql5-mysql qt5-default libqt5opengl5-dev libqt5serialport5-dev libqt5websockets5-dev libqt5quickcontrols2-5 liblo-tools qtdeclarative5-dev mysql-client clang-8

Developer setup with VirtualBox on Windows

Download VirtualBox and Xubuntu

Install Ubuntu (or Xubuntu) on VirtualBox machine

  • 4 Gb of RAM
  • Extensible hard drive (20 Gb)

Start a terminal and install the packages

sudo apt-get install
build-essential
docker.io
git
liblo-tools
libmysqlclient-dev
libqt5opengl5-dev
libqt5quickcontrols2-5
libqt5serialport5-dev
libqt5sql5-mysql
libqt5websockets5-dev
mysql-client
qml-module-qt-labs-platform
qml-module-qt-labs-settings
qml-module-qt-websockets
qml-module-qtquick-controls2
qml-module-qtquick-dialogs
qml-module-qtquick-extras
qml-module-qtquick-localstorage
qml-module-qttest
qt5-default
qtcreator
qtdeclarative5-dev
qttools5-dev-tools

and then git clone

Don't forget to setup your git config user.name and user.email:

git config --global user.name "Your Name"
git config --global user.email "your@email.com"

Then, you should start the mpop_service within the Docker Compose setup. You can then start mpop_kiosk from Qt Creator, and mpop_dataviz.

To launch mpop_dataviz, there should be a directory created at the same level as your mpop folder. It contains the built version of the project for your architecture. In that folder, you should be able to find mpop_dataviz/mpop_dataviz - that is the executable for the kiosk. cd into that directory and call it:

./mpop_dataviz/mpop_dataviz

Developer setup on Windows

  • Make sure you've installed Docker Desktop as an administrator.
  • You might need to share your C: drive in your Docker Desktop preferences.
  • Start Powershell as an administrator
  • Run docker-compose down --volumes to erase your previous database, if any.
  • Run docker-compose up --build to build your Docker images and run the service and database.
  • Run the mpop_kiosk from Qt Creator. It should connect to the service.

Deployment on Windows

To use the mpop_dataviz program in production on Windows, you should run the window-deploy-qt-app.ps1 script. It copies the required DLL files in the current directory.

Right-click on the scripts/window-deploy-qt-app.ps1 Powershell script and choose to run it with Powershell.

You can also do this:

Launch the PowerShell application.

Run this command:

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

And then this:

.\scripts\window-deploy-qt-app.ps1

A dialog will prompt you for the location of your Qt installation. C:\Qt is typical.

Next It will ask you for the executable file path. Choose \build_Folder\mpop_dataviz\debug\mpop_dataviz.exe

It will generate Stand-alone executable file to run mpop_dataviz.exe

Coding style

We follow the Qt style guide for C++ and QML.

Layout of the kiosk

The layout of the kiosk - in QML - looks like something like this:

  • Screensaver (visible in all three kiosk modes)
  • SectionProfile (visible in both entry and central kiosk)
    • PageLanguage
    • PageAge
    • PageGender
    • PageEthnicity
    • PageEnjoyYourVisit (visible only in entry kiosk)
  • Section Questions (visible only in the central kiosk)
    • Page Single Question
      • Dataviz Choose Single Question Mode
      • Dataviz Single Question By Age
      • Dataviz Single Question By Gender
      • Dataviz Single Question By Ethnicity
    • Page Multiple Questions
      • ataviz for Multiple Questions
    • Page Dataviz All Questions
  • Section Final (visible only in the exit kiosk)
    • Page Final Three Questions
    • Page Dataviz Final Three Questions
    • Page Thank You

System tests

In test_mpop_kiosk, we check that some JSON-RPC methods return the expected results.

It requires the Docker Compose services to be running, so that you have an MPOP Service that is available.

You can change the service host name and port number by passing command-line arguments to the test suite in Qt Creator. For example: 10.10.10.10 3334 will configure the test suite to communicate with the MPOP Service on that host IP and port number. You can pass only the first argument, so that you keep using the default port number, like this: 10.10.10.10. You can set the command-line arguments to the test suite by clicking on "Project" and then "Run". Then, populate the "Command line arguments" text field.