Boxing Timer  1.0
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
BoxingTimer Class Reference

Boxing timer class. More...

#include <boxingtimer.h>

Inheritance diagram for BoxingTimer:

Public Types

enum  Status : short {
  Status::Default = 0, Status::Start, Status::Rest, Status::Pause,
  Status::Reset, Status::Stop
}
 Define the status of the timer Some statuses are not saved, they are used to activate something. More...
 

Public Slots

void applyStatus ()
 Apply status and exec relative functions. More...
 
void updateRemainingMilliseconds ()
 Switch milliseconds from round to rest and back. More...
 

Signals

void remainingTimeToStringChanged ()
 
void roundsToStringChanged ()
 
void statusChanged ()
 
void presetChanged ()
 
void activeChanged ()
 

Public Member Functions

Q_INVOKABLE void restore ()
 Start or restore the timer. More...
 
Q_INVOKABLE void loadPreset (const QString &preset)
 Load the preset to change settings of timer. More...
 
 BoxingTimer ()
 Default constructor. More...
 
const QString roundsToString ()
 Convert round and total rounds for view. More...
 
const QString remainingTimeToString ()
 Convert remaining milliseconds in human readable time. More...
 
Status getStatus ()
 
void setStatus (const Status &status)
 
const QString getPreset ()
 

Protected Member Functions

void stop ()
 Override of stop function to emit statusChanged() signal. More...
 
void start (const int &milliseconds)
 Override of start function to emit statusChanged() signal. More...
 

Detailed Description

Boxing timer class.

Author
Claudio Maradonna claud.nosp@m.io@u.nosp@m.nitoo.nosp@m..pw

Inherit QTimer class and add some properties to handle rest and rounds for training

Member Enumeration Documentation

◆ Status

enum BoxingTimer::Status : short
strong

Define the status of the timer Some statuses are not saved, they are used to activate something.

Enumerator
Default 
Start 
Rest 
Pause 
Reset 
Stop 

Constructor & Destructor Documentation

◆ BoxingTimer()

BoxingTimer::BoxingTimer ( )
explicit

Default constructor.

Author
Claudio Maradonna claud.nosp@m.io@u.nosp@m.nitoo.nosp@m..pw

mRound set to 0 with a very coarse timer. Load default settings.

Member Function Documentation

◆ activeChanged

void BoxingTimer::activeChanged ( )
signal

◆ applyStatus

void BoxingTimer::applyStatus ( )
slot

Apply status and exec relative functions.

◆ getPreset()

const QString BoxingTimer::getPreset ( )
Returns
the loaded preset for timer

◆ getStatus()

Status BoxingTimer::getStatus ( )
inline
Returns
actual status - enum value

◆ loadPreset()

void BoxingTimer::loadPreset ( const QString &  preset)

Load the preset to change settings of timer.

Parameters
preseta const QString

◆ presetChanged

void BoxingTimer::presetChanged ( )
signal

◆ remainingTimeToString()

const QString BoxingTimer::remainingTimeToString ( )

Convert remaining milliseconds in human readable time.

Author
Claudio Maradonna claud.nosp@m.io@u.nosp@m.nitoo.nosp@m..pw
Returns
the remaining time as const QString of remaining milliseconds

◆ remainingTimeToStringChanged

void BoxingTimer::remainingTimeToStringChanged ( )
signal

◆ restore()

void BoxingTimer::restore ( )

Start or restore the timer.

Author
Claudio Maradonna claud.nosp@m.io@u.nosp@m.nitoo.nosp@m..pw

◆ roundsToString()

const QString BoxingTimer::roundsToString ( )

Convert round and total rounds for view.

Author
Claudio Maradonna claud.nosp@m.io@u.nosp@m.nitoo.nosp@m..pw
Returns
the number as const QString of actual round and total rounds for QML

◆ roundsToStringChanged

void BoxingTimer::roundsToStringChanged ( )
signal

◆ setStatus()

void BoxingTimer::setStatus ( const Status status)
Parameters
statusconst Status
Returns
Setter for status

◆ start()

void BoxingTimer::start ( const int &  milliseconds)
protected

Override of start function to emit statusChanged() signal.

◆ statusChanged

void BoxingTimer::statusChanged ( )
signal

◆ stop()

void BoxingTimer::stop ( )
protected

Override of stop function to emit statusChanged() signal.

◆ updateRemainingMilliseconds

void BoxingTimer::updateRemainingMilliseconds ( )
slot

Switch milliseconds from round to rest and back.


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