.Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
SchedulerGUI::ChangeConfirmation Class Reference

Takes in, as input, two InfoStructs and prompts the user to Accept and change, Reject and revert, or Cancel and do nothing about the changes. More...

#include <ChangeConfirmation.h>

Inheritance diagram for SchedulerGUI::ChangeConfirmation:

Public Member Functions

 ChangeConfirmation (InfoStruct oldStruct, InfoStruct newStruct, int *changeAccepted)
 Constructor for the change confirmation GUI. More...
 
 ~ChangeConfirmation ()
 Destructor.
 

Protected Slots

void AcceptChanges ()
 Accepts changes and closes the window. More...
 
void RevertChanges ()
 Rejects changes. More...
 

Protected Member Functions

void ShowInfoStructDifference (InfoStruct structA, InfoStruct structB)
 Checks to see which values in two InfoStructs are different.
 
bool DoubleChanged (double a, double b)
 Returns true if the difference between two double values is larger than a given epsilon value, using a constant epsilon value.
 
QString BeautifyOutput (QString paramName, double paramA, double paramB)
 Returns a string in the format " parameter_name : previous_value -> new value ". More...
 
QString BeautifyOutput (QString paramName, QString paramA, QString paramB)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a string in the format " parameter_name : previous_value -> new value ". More...
 
void ConnectWidgets ()
 Connects widgets in the UI to relevant signals. More...
 

Protected Attributes

int * Accept_
 Set to true if the changes are accepted; false otherwise.
 
Ui::ChangeConfirmationGUI UI_
 Instance of the UI/form. More...
 

Detailed Description

Takes in, as input, two InfoStructs and prompts the user to Accept and change, Reject and revert, or Cancel and do nothing about the changes.

Constructor & Destructor Documentation

ChangeConfirmation::ChangeConfirmation ( InfoStruct  oldStruct,
InfoStruct  newStruct,
int *  changeAccepted 
)

Constructor for the change confirmation GUI.

Tells the user what changes were made between the last save/load and the current parameter set.

Parameters
[in]oldStructInfoStruct from the previous save or load
[in]newStructInfoStruct built from the current parameter set
[out]changeAcceptedSet to true if the user accepts the changes; set to false otherwise

Member Function Documentation

void ChangeConfirmation::AcceptChanges ( )
protectedslot

Accepts changes and closes the window.

Notes that changes should be accepted and exits the confirmation dialog

QString ChangeConfirmation::BeautifyOutput ( QString  paramName,
double  paramA,
double  paramB 
)
protected

Returns a string in the format " parameter_name : previous_value -> new value ".

The string is formatted such that all parameters in the list will have ':' and '->' at the same column.

QString ChangeConfirmation::BeautifyOutput ( QString  paramName,
QString  paramA,
QString  paramB 
)
protected

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a string in the format " parameter_name : previous_value -> new value ".

The string is formatted such that all parameters in the list will have ':' and '->' at the same column. Same process as above, but this uses parameters that are already QStrings.

void ChangeConfirmation::ConnectWidgets ( )
protected

Connects widgets in the UI to relevant signals.

Creates the appropriate connections for various UI elements and their functions.

void ChangeConfirmation::RevertChanges ( )
protectedslot

Rejects changes.

Notes that changes should be rejected (i.e. reverted) and exits the confirmation dialog

Member Data Documentation

Ui::ChangeConfirmationGUI SchedulerGUI::ChangeConfirmation::UI_
protected

Instance of the UI/form.


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