Limb Range Analyzer
Cross-platform application for human limb range analysis.
MainWindow Class Reference

Represents the main class for user interface components. More...

#include <mainwindow.hpp>

Inheritance diagram for MainWindow:

Public Member Functions

 MainWindow (QWidget *parent=nullptr)
 Parametric default class constructor. More...
 
 ~MainWindow ()
 Default class destructor. More...
 
void resizeEvent (QResizeEvent *event)
 Overrided function responding to window size changes. More...
 
void MainWindow_InitializeUIProperties ()
 Initially called function for UI content settings. More...
 
void MainWindow_InitializeUIStrings ()
 This function updates user interface strings. More...
 
void MainWindow_ClientResizeTable ()
 Serves as a client table item ratio updater. More...
 
void MainWindow_HistoryResizeTable ()
 Manages history table visual updating. More...
 
void MainWindow_ClientDrawTable ()
 Manages client table filling. More...
 
QString MainWindow_ClientCheck (QStringList newEntry)
 Provides user defined client entry check. More...
 
void MainWindow_Create3DScene ()
 Initialization function for 3D vizualization content. More...
 
void MainWindow_Set3DScene (bool blueCoinOnly, bool clearResults)
 Manages body and BlueCoin device repositioning within 3D scene. More...
 
void MainWindow_Reset3DScene ()
 Restores initial position setting of 3D scene. More...
 
void MainWindow_ReportResults ()
 Manages measurement results reporting. More...
 
void MainWindow_ClearResults ()
 Manages measurement results clearing. More...
 

Protected Attributes

QTranslator * mTranslator
 This QTranslator pointer holds reference to application translation object.
 

Private Slots

void MainWindow_DevicesStartScanning ()
 Slot describing Bluetooth devices analysis beginning. More...
 
void MainWindow_DevicesUpdateStatus ()
 Slot used for Bluetooth discovery progress visualization. More...
 
void MainWindow_DevicesDoneScanning ()
 Slot defined for Bluetooth devices discovery finish. More...
 
void MainWindow_DevicesSelectionChanged ()
 Slot responding to Bluetooth devices selection change. More...
 
void MainWindow_DevicesConnect ()
 This slot is used for Bluetooth connection triggering. More...
 
void MainWindow_DeviceSwitchBodyPart ()
 Slot updates BodyPart selection status. More...
 
void MainWindow_DeviceFilterExercises ()
 Slot function is responding to exercise selection changes. More...
 
void MainWindow_DeviceMeasure ()
 Slot defined for measurement beginning or stopping. More...
 
void MainWindow_DeviceNoConnectionReport (const QString &error)
 Slot function that serves for no connection reporting. More...
 
void MainWindow_DeviceConnectedReport ()
 Slot that informs about Bluetooth device connection. More...
 
void MainWindow_DeviceIncompatibleReport ()
 Slot defined for device incompatibility reporting. More...
 
void MainWindow_DeviceUnreachableReport ()
 This slot informs users about device unreachability. More...
 
void MainWindow_DeviceBeyondLimitReport ()
 Slot function defined for connection limit reaching information. More...
 
void MainWindow_MeasurementZoomIn ()
 Slot bound to one of 3D scene buttons for zooming in. More...
 
void MainWindow_MeasurementZoomOut ()
 Slot manages 3D scene zooming out. More...
 
void MainWindow_MeasurementRotateLeft ()
 Slot is used for 3D scene clockwise rotation. More...
 
void MainWindow_MeasurementRotateRight ()
 Slot manages 3D scene counter-clockwise rotation. More...
 
void MainWindow_MeasurementSaveRecord ()
 Slot is bound to saving process of client measurement record. More...
 
void MainWindow_MeasurementDisplayHistory ()
 Slot enables measurement history page for selected exercise and client. More...
 
void MainWindow_ClientAdd ()
 Slot is responsible for new client adding. More...
 
void MainWindow_ClientRemove ()
 Slot manages client removal. More...
 
void MainWindow_ClientSelect ()
 Slot has a purpose of client selection. More...
 
void MainWindow_HistoryRecalculateBars ()
 Slot manages range visualization on history page. More...
 
void MainWindow_AboutActivateAbout ()
 Slot is defined for primary About page activation. More...
 
void MainWindow_AboutActivateHowto ()
 Slot is used for About page description section activation. More...
 
void MainWindow_SettingsUpdate ()
 This slot updates application settings through user choices. More...
 
void MainWindow_SwitchTranslation (Language language)
 Slot manages retranslation of UI according to selected language. More...
 
void MainWindow_EnableHomePage ()
 Slot displays Home Page of Limb Range Analyzer. More...
 
void MainWindow_EnableDevicesPage ()
 Slot serves for displaying the Devices Page. More...
 
void MainWindow_EnableMeasurementPage ()
 Slot shows the Measurement Page of LRA. More...
 
void MainWindow_EnableClientsPage ()
 Slot function that enables Clients Page. More...
 
void MainWindow_EnableAboutPage ()
 This slot makes the About Page visible. More...
 
void MainWindow_EnableSettingsPage ()
 Slot manages the visibility of Settings Page. More...
 
void MainWindow_CleanAndQuit ()
 Slot function for stopping and cleaning procedure. More...
 

Private Attributes

Ui::MainWindow * mUserInterface
 MainWindow (namespace Ui) member variable depicting user interface content.
 
Qt3DExtras::Qt3DWindow * mGraphicsView
 Qt3DWindow (namespace Qt3DExtras) member variable that holds graphics view used for 3D measurement content.
 
Qt3DCore::QEntity * mGraphicsRootEntity
 QEntity (namespace Qt3DCore) member variable that represents the graphics root entity.
 
QWidget * mGraphicsContainer
 QWidget member variable that serves as a container of graphics content.
 
QPropertyAnimation * mAnimation
 QPropertyAnimation variable used for window resizing.
 
Qt3DCore::QTransform * mUpperLeftArmTransform
 Qt3DCore::QTransform member variable kept for upper left arm transformations.
 
Qt3DCore::QTransform * mUpperRightArmTransform
 Qt3DCore::QTransform member variable kept for upper right arm transformations.
 
Qt3DCore::QTransform * mLowerLeftArmTransform
 Qt3DCore::QTransform member variable kept for lower left arm transformations.
 
Qt3DCore::QTransform * mLowerRightArmTransform
 Qt3DCore::QTransform member variable kept for lower right arm transformations.
 
Qt3DCore::QTransform * mLeftThighTransform
 Qt3DCore::QTransform member variable kept for upper left leg transformations.
 
Qt3DCore::QTransform * mRightThighTransform
 Qt3DCore::QTransform member variable kept for upper right leg transformations.
 
Qt3DCore::QTransform * mLeftCalfTransform
 Qt3DCore::QTransform member variable kept for lower left leg transformations.
 
Qt3DCore::QTransform * mRightCalfTransform
 Qt3DCore::QTransform member variable kept for lower right leg transformations.
 
Qt3DCore::QTransform * mPrimaryBlueCoinTransform
 Qt3DCore::QTransform member variable maintained for primary BlueCoin device transformations.
 
Qt3DCore::QTransform * mSecondaryBlueCoinTransform
 Qt3DCore::QTransform member variable maintained for secondary BlueCoin device transformations.
 
Qt3DCore::QTransform * mMinRangeTransform
 Qt3DCore::QTransform member variable used for minimum reached range orb transformations.
 
Qt3DCore::QTransform * mMaxRangeTransform
 Qt3DCore::QTransform member variable used for maximum reached range orb transformations.
 
QList< Qt3DCore::QTransform * > mMovementOrbsTransform
 QList<Qt3DCore::QTransform> member variable used for auxiliary small orbs transformations.
 
Qt3DExtras::QPhongMaterial * mRangeMaterial
 Qt3DExtras::QPhongMaterial member variable used for keeping the movement orbs color information.
 
BluetoothmBluetooth
 Bluetooth is a member object that manages Bluetooth connection and data retrieval.
 
SensorModulemSensorModule
 SensorModule is a member that serves as a filtration tool while processing BlueCoin measured values.
 
XmlParser mXmlParser
 XmlParser depicts a member that introduces XML loading and saving possibilities.
 
Hasher mHasher
 Hasher member object serves for unique hash calculation based on Client data.
 
QSharedPointer< SettingsmSettings
 QSharedPointer<Settings> is a member object used across application for keeping application settings data.
 
QList< QSharedPointer< Client > > mClientList
 QList<QSharedPointer<Client>> represents a list of pointers to Client data used across application.
 
QList< QSharedPointer< Session > > mSessionList
 QList<QSharedPointer<Session>> represents a list of pointers to Session data used across application.
 
QList< QSharedPointer< Exercise > > mExerciseList
 QList<QSharedPointer<Exercise>> represents a list of pointers to Exercise data used across application.
 
QSharedPointer< ClientmClient
 QSharedPointer<Client> holds a pointer member attribute of a single Client.
 
QStringList mExerciseNameList
 QStringList member variable serves for keeping exercise names in a list.
 
QList< QPair< ProcessingSelection, ExerciseType > > mExerciseTypeList
 QList<QPair<ProcessingSelection, ExerciseType>> member variable represents a list of exercise types used for filtering.
 
QList< qint32 > mExerciseIndexList
 QList<qint32> member variable is used for keeping exercise index values.
 
qint32 mSelectedExercise
 qint32 numerical member variable that holds the index of selected exercise.
 
qint32 mDeviceSelectionLine
 qint32 numerical member variable that holds the index of selected device.
 
qint32 mClientSelectionLine
 qint32 numerical member variable that holds the index of selected client.
 
qint32 mMovementCounter
 qint32 numerical member that holds current step of measurement used while positioning movement orbs.
 
bool mMeasurementRunning
 bool member that holds information whether a measurement is in progress.
 
bool mEditingEnabled
 bool member that holds information whether a new Client is currently being added.
 
BodyPart mBodyPart
 BodyPart serves for recognition of human body part.
 

Detailed Description

Represents the main class for user interface components.

MainWindow is QMainWindow derived class that implements member functions and variables. Those serve according to user interaction through user interface objects and use aggregated class instances for Bluetooth connection, measurement filtering and client-related services (among others).

See also
Bluetooth, SensorModule, Client, XmlParser

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QWidget *  parent = nullptr)

Parametric default class constructor.

Manages initial instance creation and user interface preparation.

Parameters
parent- depicts parental QWidget parameter.
See also
~MainWindow()

◆ ~MainWindow()

MainWindow::~MainWindow ( )

Default class destructor.

Provides memory cleaning according to previous long-term heap allocation needs.

Member Function Documentation

◆ MainWindow_AboutActivateAbout

void MainWindow::MainWindow_AboutActivateAbout ( )
privateslot

Slot is defined for primary About page activation.

Slot function toggles the primary part of About page while needed user interface content goes visible with this action.

◆ MainWindow_AboutActivateHowto

void MainWindow::MainWindow_AboutActivateHowto ( )
privateslot

Slot is used for About page description section activation.

Slot manages the visibility of required UI parts that contain application informations and hints.

◆ MainWindow_CleanAndQuit

void MainWindow::MainWindow_CleanAndQuit ( )
privateslot

Slot function for stopping and cleaning procedure.

The content of this slot involves Bluetooth measurement stopping and disconnection, if not previously handled manually, before it closes the main application window and frees allocated memory.

◆ MainWindow_ClearResults()

void MainWindow::MainWindow_ClearResults ( )

Manages measurement results clearing.

MainWindow_ClearResults is triggered when limb range analysis measurement is stopped, thus user interface numerical text output goes empty again.

◆ MainWindow_ClientAdd

void MainWindow::MainWindow_ClientAdd ( )
privateslot

Slot is responsible for new client adding.

This slot manages QTableWidget row contents capturing along with Client creation and further XML saving (if user input is correct). This slot also uses Hasher class instance for unique user ID creation.

See also
Client, XmlParser, Hasher

◆ MainWindow_ClientCheck()

QString MainWindow::MainWindow_ClientCheck ( QStringList  newEntry)

Provides user defined client entry check.

MainWindow_ClientCheck uses provided client table row data and manages first name, last name and e-mail address checking. Note that the return value includes either "OK" string or respective error message, that would be shown to user.

Parameters
newEntry- new table row entry for checking.
Returns
QString - checked evaluation string
See also
Client

◆ MainWindow_ClientDrawTable()

void MainWindow::MainWindow_ClientDrawTable ( )

Manages client table filling.

This function uses received Client list data to spread it across client table QTableWidget accordingly.

See also
Client

◆ MainWindow_ClientRemove

void MainWindow::MainWindow_ClientRemove ( )
privateslot

Slot manages client removal.

When an appropriate QPushButton is pressed, this slot verifies that user surely wishes to remove currently selected client. If that is the case, selected client is removed both from the data model and patient records XML file.

See also
Client, XmlParser

◆ MainWindow_ClientResizeTable()

void MainWindow::MainWindow_ClientResizeTable ( )

Serves as a client table item ratio updater.

Due to possible window resizing, width of each column has to be updated, which is handled in this function.

◆ MainWindow_ClientSelect

void MainWindow::MainWindow_ClientSelect ( )
privateslot

Slot has a purpose of client selection.

Slot function is responsible for client selection from user interface QTableWidget while exactly one line has to be selected, user is otherwise informed through QMessageBox . Such line is also marked by a different background color. Note that this selection is needed for measurement records saving and history displaying functionality.

See also
Client

◆ MainWindow_Create3DScene()

void MainWindow::MainWindow_Create3DScene ( )

Initialization function for 3D vizualization content.

Function is responsible for graphics content memory allocation and member variables definition due to graphics scene needs. A body model is defined along with coloring and lights system, movable camera and item positioning. Execution of this function enables further body parts movement while measuring exercises.

◆ MainWindow_DeviceBeyondLimitReport

void MainWindow::MainWindow_DeviceBeyondLimitReport ( )
privateslot

Slot function defined for connection limit reaching information.

This slot uses QMessageBox to inform users about impossibility to connect more devices - up to two BlueCoin devices can be connected.

See also
Bluetooth

◆ MainWindow_DeviceConnectedReport

void MainWindow::MainWindow_DeviceConnectedReport ( )
privateslot

Slot that informs about Bluetooth device connection.

Function (slot) informs about a successful connection request that marks the selected device with different color and enables measurement page.

See also
Bluetooth

◆ MainWindow_DeviceFilterExercises

void MainWindow::MainWindow_DeviceFilterExercises ( )
privateslot

Slot function is responding to exercise selection changes.

Depending on the selected BodyPart , an exercise is selected from list of all exercises, which is then added to the QComboBox of possible measurement selections. Note that it depends on the number of actively connected devices. Necessary UI components are also updated.

See also
BodyPart

◆ MainWindow_DeviceIncompatibleReport

void MainWindow::MainWindow_DeviceIncompatibleReport ( )
privateslot

Slot defined for device incompatibility reporting.

This slot informs the application user that selected device cannot be connected to due to incompatibility (meaning that the device is not BlueCoin, which is mandatory). Such device also gets painted by a different background color in the user interface device list widget.

See also
Bluetooth

◆ MainWindow_DeviceMeasure

void MainWindow::MainWindow_DeviceMeasure ( )
privateslot

Slot defined for measurement beginning or stopping.

This slot checks whether an active measurement is being processed, if not, then a new measurement of selected exercise is started, which allows further visualization and range analysis reporting. Running exercise processing gets stopped by this slot function and the scene would be reset.

◆ MainWindow_DeviceNoConnectionReport

void MainWindow::MainWindow_DeviceNoConnectionReport ( const QString &  error)
privateslot

Slot function that serves for no connection reporting.

Slot function uses QMessageBox to show information dialog describing the connection error.

Parameters
error- text string of captured error
See also
Bluetooth

◆ MainWindow_DevicesConnect

void MainWindow::MainWindow_DevicesConnect ( )
privateslot

This slot is used for Bluetooth connection triggering.

This slot manages checking whether a device is selected and then processes its connection or disconnection (depending on its connection state) through Bluetooth member functions Bluetooth_Connect resp. Bluetooth_Disconnect .

See also
Bluetooth

◆ MainWindow_DevicesDoneScanning

void MainWindow::MainWindow_DevicesDoneScanning ( )
privateslot

Slot defined for Bluetooth devices discovery finish.

This slot function manages user interface changes due to device discovery finish. Devices are enlisted in QListWidget and actively connected devices are depicted by a different color.

See also
Bluetooth

◆ MainWindow_DevicesSelectionChanged

void MainWindow::MainWindow_DevicesSelectionChanged ( )
privateslot

Slot responding to Bluetooth devices selection change.

This function modifies connection button text according to selected device connection status. Connected devices can be disconnected, while disconnected ones will offer a possibility for connection.

See also
Bluetooth

◆ MainWindow_DevicesStartScanning

void MainWindow::MainWindow_DevicesStartScanning ( )
privateslot

Slot describing Bluetooth devices analysis beginning.

This slot manages necessary UI changes and triggers Bluetooth module device discovery function Bluetooth_StartScanning .

See also
Bluetooth

◆ MainWindow_DevicesUpdateStatus

void MainWindow::MainWindow_DevicesUpdateStatus ( )
privateslot

Slot used for Bluetooth discovery progress visualization.

Slot function serves for UI QProgressBar updating while scanning for Bluetooth devices.

See also
Bluetooth

◆ MainWindow_DeviceSwitchBodyPart

void MainWindow::MainWindow_DeviceSwitchBodyPart ( )
privateslot

Slot updates BodyPart selection status.

According to selected BodyPart contained in QComboBox on the measurement page, a member variable mBodyPart gets updated. Exercises filtering is then processed via MainWindow_DeviceFilterExercises . Any measurement results are also cleared.

See also
BodyPart, MainWindow_DeviceFilterExercises

◆ MainWindow_DeviceUnreachableReport

void MainWindow::MainWindow_DeviceUnreachableReport ( )
privateslot

This slot informs users about device unreachability.

A QMessageBox is used along with a different background color of selected device in order to inform users about chosen device unreachability.

See also
Bluetooth

◆ MainWindow_EnableAboutPage

void MainWindow::MainWindow_EnableAboutPage ( )
privateslot

This slot makes the About Page visible.

Selection of a QAction from the main menu results in visibility of About Page.

◆ MainWindow_EnableClientsPage

void MainWindow::MainWindow_EnableClientsPage ( )
privateslot

Slot function that enables Clients Page.

The function depicting this slot enables the visibility of Clients Page content. This option is likewise selectable from the application main menu.

◆ MainWindow_EnableDevicesPage

void MainWindow::MainWindow_EnableDevicesPage ( )
privateslot

Slot serves for displaying the Devices Page.

Slot uses QAction selected from the application main menu and displays Devices Page with its related content.

◆ MainWindow_EnableHomePage

void MainWindow::MainWindow_EnableHomePage ( )
privateslot

Slot displays Home Page of Limb Range Analyzer.

This slot enables Home Page right after the application is started.

◆ MainWindow_EnableMeasurementPage

void MainWindow::MainWindow_EnableMeasurementPage ( )
privateslot

Slot shows the Measurement Page of LRA.

This slot activates the visibility of Measurement Page, which contains 3D visualisation elements and numerical output text fields (along with other active UI items).

◆ MainWindow_EnableSettingsPage

void MainWindow::MainWindow_EnableSettingsPage ( )
privateslot

Slot manages the visibility of Settings Page.

Slot enables QWidget that holds the necessary check boxes and dropdown menus of application settings.

◆ MainWindow_HistoryRecalculateBars

void MainWindow::MainWindow_HistoryRecalculateBars ( )
privateslot

Slot manages range visualization on history page.

This slot function updates the QProgressBar elements on history page according to selected QTableWidget row. This enhances user experience while observing historical records for selected exercise.

See also
Client

◆ MainWindow_HistoryResizeTable()

void MainWindow::MainWindow_HistoryResizeTable ( )

Manages history table visual updating.

According to possible main window size changes, column width of measurement history table has to be updated. MainWindow_HistoryResizeTable manages this necessary operation.

◆ MainWindow_InitializeUIProperties()

void MainWindow::MainWindow_InitializeUIProperties ( )

Initially called function for UI content settings.

Function manages initial user interface content properties such as item visibility, shortcuts setting and exercise related attributes.

See also
MainWindow_InitializeUIStrings

◆ MainWindow_InitializeUIStrings()

void MainWindow::MainWindow_InitializeUIStrings ( )

This function updates user interface strings.

Responds to initial UI creation and language selection changes that require fixed content retranslation.

◆ MainWindow_MeasurementDisplayHistory

void MainWindow::MainWindow_MeasurementDisplayHistory ( )
privateslot

Slot enables measurement history page for selected exercise and client.

Function (slot) collects selected client's measurement data for chosen exercise, then a new UI page is shown along with a QTableWidget area containing date, MIN, MAX and RANGE values of selected exercise captured in the past. Note that a client has to be previously selected and historical records of selected exercise must exist as well.

See also
Client

◆ MainWindow_MeasurementRotateLeft

void MainWindow::MainWindow_MeasurementRotateLeft ( )
privateslot

Slot is used for 3D scene clockwise rotation.

When a specific QPushButton is pressed, the scene rotates left.

◆ MainWindow_MeasurementRotateRight

void MainWindow::MainWindow_MeasurementRotateRight ( )
privateslot

Slot manages 3D scene counter-clockwise rotation.

Pressing a button in application UI results in 3D measurement scene rotation, namely rightwards.

◆ MainWindow_MeasurementSaveRecord

void MainWindow::MainWindow_MeasurementSaveRecord ( )
privateslot

Slot is bound to saving process of client measurement record.

This slot triggers capture of currently measured exercise results and checks whether a client is selected. If that is true, then a new exercise gets recorded for this client. This slot also manages XML data saving of client changes. Note that exercise measurement data must be ready before model updating is processed.

See also
Client, XmlParser

◆ MainWindow_MeasurementZoomIn

void MainWindow::MainWindow_MeasurementZoomIn ( )
privateslot

Slot bound to one of 3D scene buttons for zooming in.

Slot manages 3D measurement vizualization widget zooming, namely zooming in.

◆ MainWindow_MeasurementZoomOut

void MainWindow::MainWindow_MeasurementZoomOut ( )
privateslot

Slot manages 3D scene zooming out.

This slot manages selected camera attributes in order to allow zooming out.

◆ MainWindow_ReportResults()

void MainWindow::MainWindow_ReportResults ( )

Manages measurement results reporting.

This function responds to SensorModule signal emitting that marks new results availability. Those values, namely MIN, MAX and RANGE, along with ROLL, PITCH and YAW angles are processed visually in 3D scene and with according numerical value output. Note that it depends on currently selected exercise.

◆ MainWindow_Reset3DScene()

void MainWindow::MainWindow_Reset3DScene ( )

Restores initial position setting of 3D scene.

MainWindow_Reset3DScene uses values initially introduced in MainWindow_Create3DScene. Resetting is processed when measurement processing gets turned off.

See also
MainWindow_Create3DScene

◆ MainWindow_Set3DScene()

void MainWindow::MainWindow_Set3DScene ( bool  blueCoinOnly,
bool  clearResults 
)

Manages body and BlueCoin device repositioning within 3D scene.

This function is used for exercise scene preparation. While blueCoinOnly parameter is TRUE , only BlueCoin graphics object is moved or rotated. Its FALSE value provides body parts movement while mSelectedExercise is evaluated. In case that clearResults is TRUE , lines containing the MIN, MAX and RANGE values are emptied.

Parameters
blueCoinOnly- defines whether only BlueCoin is to be repositioned.
clearResults- defines whether previous results are to be cleared.

◆ MainWindow_SettingsUpdate

void MainWindow::MainWindow_SettingsUpdate ( )
privateslot

This slot updates application settings through user choices.

This slot function collects user defined preferences (including selected Language) and manages saving to XML file.

See also
Settings

◆ MainWindow_SwitchTranslation

void MainWindow::MainWindow_SwitchTranslation ( Language  language)
privateslot

Slot manages retranslation of UI according to selected language.

Selected Language is applied through mTranslator object along with needed execution of MainWindow_InitializeUIStrings member function.

Parameters
language- depicts selected language option
See also
Language

◆ resizeEvent()

void MainWindow::resizeEvent ( QResizeEvent *  event)

Overrided function responding to window size changes.

This function provides necessary user interface content size changes triggered by main window resizing.

Parameters
event- event of window size changes with event parameters.

The documentation for this class was generated from the following files: