Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CalculationProgressGroup Class Reference

Visible QGroupBox to handle the calculation. More...

#include <calculationprogressgroup.h>

+ Inheritance diagram for CalculationProgressGroup:
+ Collaboration diagram for CalculationProgressGroup:

Public Member Functions

 CalculationProgressGroup (Core *core, QWidget *parent=nullptr)
 CalculationProgressGroup::CalculationProgressGroup. More...
 
 ~CalculationProgressGroup ()
 Destructor without function. More...
 
- Public Member Functions inherited from DisplaySizeDependingGroupBox
 DisplaySizeDependingGroupBox (QWidget *parent, QLayout *mainLayout, int operationModeFlags)
 
void setTitle (QString title)
 
- Public Member Functions inherited from MessageListener
 MessageListener (bool defaultActivation=true)
 
virtual ~MessageListener ()
 
bool isMessageListenerActive () const
 
void activateMessageListener ()
 
void deactivateMessageListener ()
 
- Public Member Functions inherited from CalculationAdapter
 CalculationAdapter (Core *core)
 Constructor, copies a pointer pointing to the core. More...
 
virtual ~CalculationAdapter ()
 Empty virtual destructor. More...
 
virtual void startCalculation (const std::string &algorithmName)
 Function called by the GUI to start the calculation of the tuning curve. More...
 
virtual void cancelCalculation ()
 Function called by the GUI to interrupt or stop the calculation thread. More...
 
std::vector< std::string > getAvailableAlgorithms () const
 Get a list of available tuning algorithms. More...
 

Private Slots

void updateTitle ()
 Function to update the title of the algorithm in use. More...
 
void onStartCalculation ()
 Function called to start the calculation. More...
 
void onCancelCalculation ()
 Function called to cancel the calculation. More...
 
void onResetCalculation ()
 Function called to reset the calculation. More...
 
void startCancelPressed ()
 Slot called when the start and stop button was pressed. More...
 
void showAlgorithmInfo ()
 Show information about the algorithm. More...
 

Private Member Functions

virtual void handleMessage (MessagePtr m) overridefinal
 Message handling. More...
 

Private Attributes

bool mCalculationInProgress
 Flag: calculation is in progress. More...
 
QLabel * mStatusLabel
 Pointer to the status label. More...
 
QProgressBar * mCalculationProgressBar
 Pointer to the progress bar. More...
 
QPushButton * mStartCancelButton
 Pointer to the start and cancel button. More...
 
std::shared_ptr< const
AlgorithmInformation
mAlgorithmSelection
 Pointer to the algorithm selector. More...
 

Additional Inherited Members

- Protected Slots inherited from DisplaySizeDependingGroupBox
virtual void onModeChanged (OperationMode mode)
 
- Protected Attributes inherited from DisplaySizeDependingGroupBox
QGroupBox * mGroupBox = nullptr
 
QWidget * mMainWidgetContainer = nullptr
 

Detailed Description

Visible QGroupBox to handle the calculation.

This group box shows the progress bar , the algorithm selector box, and a button to start and stop the calculation.

Note that on small devices there will be no group box, just a widget! Therefore this class does not inherit QGroupBox, instead it owns a member variable of it.

While the algorithm is running it may emit various messages about its status. Therefore, the CalculationProgressGroup is a MessageListener

Definition at line 52 of file calculationprogressgroup.h.

Constructor & Destructor Documentation

CalculationProgressGroup::CalculationProgressGroup ( Core core,
QWidget *  parent = nullptr 
)

CalculationProgressGroup::CalculationProgressGroup.

The constructor creates the graphics elements shown in the Calculation progress group window. It uses a small progress bar and a small push button which are included here as local classes overriding the Qt standard classes.

Parameters
core: Pointer to the core, needed to initialize the adapter
parent: Pointer to the parent widget

Definition at line 58 of file calculationprogressgroup.cpp.

+ Here is the call graph for this function:

CalculationProgressGroup::~CalculationProgressGroup ( )
inline

Destructor without function.

Definition at line 60 of file calculationprogressgroup.h.

Member Function Documentation

void CalculationProgressGroup::handleMessage ( MessagePtr  m)
finaloverrideprivatevirtual

Message handling.

This function controls the incoming messages about the calculation status of the algorithm and takes action accordingly.

Parameters
m: The incoming message

Implements MessageListener.

Definition at line 155 of file calculationprogressgroup.cpp.

+ Here is the call graph for this function:

void CalculationProgressGroup::onCancelCalculation ( )
privateslot

Function called to cancel the calculation.

The function will also change the displayed text of the start button.

Definition at line 269 of file calculationprogressgroup.cpp.

+ Here is the call graph for this function:

void CalculationProgressGroup::onResetCalculation ( )
privateslot

Function called to reset the calculation.

The function will also change the displayed text of the start button.

Definition at line 291 of file calculationprogressgroup.cpp.

+ Here is the call graph for this function:

void CalculationProgressGroup::onStartCalculation ( )
privateslot

Function called to start the calculation.

The function will also change the displayed text of the start button.

Definition at line 251 of file calculationprogressgroup.cpp.

+ Here is the call graph for this function:

void CalculationProgressGroup::showAlgorithmInfo ( )
privateslot

Show information about the algorithm.

Definition at line 333 of file calculationprogressgroup.cpp.

+ Here is the call graph for this function:

void CalculationProgressGroup::startCancelPressed ( )
privateslot

Slot called when the start and stop button was pressed.

Definition at line 318 of file calculationprogressgroup.cpp.

+ Here is the call graph for this function:

void CalculationProgressGroup::updateTitle ( )
privateslot

Function to update the title of the algorithm in use.

Definition at line 231 of file calculationprogressgroup.cpp.

Member Data Documentation

std::shared_ptr<const AlgorithmInformation> CalculationProgressGroup::mAlgorithmSelection
private

Pointer to the algorithm selector.

Definition at line 81 of file calculationprogressgroup.h.

bool CalculationProgressGroup::mCalculationInProgress
private

Flag: calculation is in progress.

Definition at line 75 of file calculationprogressgroup.h.

QProgressBar* CalculationProgressGroup::mCalculationProgressBar
private

Pointer to the progress bar.

Definition at line 77 of file calculationprogressgroup.h.

QPushButton* CalculationProgressGroup::mStartCancelButton
private

Pointer to the start and cancel button.

Definition at line 78 of file calculationprogressgroup.h.

QLabel* CalculationProgressGroup::mStatusLabel
private

Pointer to the status label.

Definition at line 76 of file calculationprogressgroup.h.


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