|
SETestKCL
1.0.
|
#include <MainWindow.h>


Public Types | |
| enum | OperationIds { Operation_No = 0, Operation_Yes = 1 } |
| enum | RefreshModeIds { Refresh_Continuous = 0, Refresh_NonContinuous = 1 } |
Public Member Functions | |
| MainWindow () | |
| ~MainWindow () | |
| void | SetCalculator (BinomialCalculator *c) |
| BinomialCalculator * | GetCalculator (void) const |
| unsigned int | GetRefreshMode (void) const |
| void | SetRefreshMode (unsigned int m) |
Protected Member Functions | |
| void | keyPressEvent (QKeyEvent *e) |
| void | UpdateCounter (void) |
| void | UpdateSummary (void) |
| void | WriteSummary (const char *filename) |
This class implements the main window of the program.
It shows the usage help message, detects key stroke and process it, and allows for the count of 'yes' and 'no' during the negotiation.
The method keyPressEvent() implements the callback for any key stroke
Definition at line 36 of file MainWindow.h.
| enum OperationIds |
List of operations captured
| Enumerator | |
|---|---|
| Operation_No | |
| Operation_Yes | |
Definition at line 47 of file MainWindow.h.
| enum RefreshModeIds |
List of refresh modes
| Enumerator | |
|---|---|
| Refresh_Continuous | |
| Refresh_NonContinuous | |
Definition at line 55 of file MainWindow.h.
| MainWindow | ( | ) |
Definition at line 28 of file MainWindow.cpp.
References Refresh_Continuous.
|
inline |
Definition at line 42 of file MainWindow.h.
|
inline |
Get the Binomial calculator object, used to estimate the probability of the observed sequence of yes and no
Definition at line 73 of file MainWindow.h.
|
inline |
Get the refresh mode of the window. if set to MainWindow::Refresh_Continuous, the summary will be refresh at every stroke of 'y', 'n', and 'z', additionally to 's' and 'q' if set to MainWindow::Refresh_NonContinuous, the summary will be refresh only at the stroke of 's' or 'q'
Definition at line 84 of file MainWindow.h.
|
protected |
Callback method for the QKeyEvent (key stroke) This method is a re-implementation of the QDialog::keyPressEvent() method Allows to detect key stroke and process the key accordingly
Definition at line 126 of file MainWindow.cpp.
References Operation_No, Operation_Yes, Refresh_Continuous, UpdateCounter(), and UpdateSummary().
|
inline |
Set the Binomial calculator object, used to estimate the probability of the observed sequence of yes and no
Definition at line 64 of file MainWindow.h.
Referenced by main().
|
inline |
Set the refresh mode of the window. if set to MainWindow::Refresh_Continuous, the summary will be refresh at every stroke of 'y', 'n' and 'z', additionally to 's' and 'q' if set to MainWindow::Refresh_NonContinuous, the summary will be refresh only at the stroke of 's' or 'q'
Definition at line 95 of file MainWindow.h.
|
protected |
Update the labels containing the number of yes and no in the window
Definition at line 167 of file MainWindow.cpp.
References Operation_No, and Operation_Yes.
Referenced by keyPressEvent().
|
protected |
Update the summary of the negotiation.
That includes the calculation of probability of the observed sequence, invoking BinomialCalculator::GetProbabilityMassFunction()
Definition at line 178 of file MainWindow.cpp.
References BinomialCalculator::GetProbabilityMassFunction(), QCustomPlot::graph(), Operation_No, Operation_Yes, QCustomPlot::replot(), QCPGraph::rescaleAxes(), QCPGraph::setData(), BinomialCalculator::SetNumberOfExperiments(), and BinomialCalculator::SetProbabilityOfSuccess().
Referenced by keyPressEvent().
|
inlineprotected |
Writes the summary in a file for future reference
Definition at line 124 of file MainWindow.h.
1.8.5