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

The main program window of Data Visualizer. More...

#include <DataVisualizer.h>

Inheritance diagram for DataVisualizerGUI::DataVisualizer:

Signals

void ChangedDirectory (const QString &value)
 Emits a signal whenever the file directory has been changed.
 
void ChangedDirectory ()
 Emits a signal whenever the file directory has been changed.
 

Public Member Functions

 DataVisualizer (QWidget *parent=0)
 Constructor. More...
 
 ~DataVisualizer ()
 Destructor. More...
 

Static Public Attributes

static const string ApplicationName = "Data Visualizer"
 The display name of the application.
 
static const string OrganizationName = "Quantum Potential Corporation"
 The name of the company that is sponsoring this application's development.
 
static const string StartupTitle = "Welcome to Data Visualizer"
 The message that will be displayed in the title of the startup dialog.
 
static const int DefaultInterval = 200
 Default refresh interval used when no value is specified.
 
static const int MinInterval = 100
 Specifies the lower range of the refresh interval.
 
static const int MaxInterval = 1000
 Specifies the upper range of the refresh interval.
 
static const int MinPlotSize = 300
 Specifies the lower range for plot widths.
 
static const int MaxPlotSize = 1280
 Specifies the upper range for plot widths.
 
static const int ResizeIncrement = 10
 Specifies the pixel width a plot can be expanded or reduced by.
 
static const QString FileDirectory = "File Directory"
 Registry key for the directory being used to read files.
 
static const QString RefereshInterval = "Refresh Interval"
 Registry key for the refresh interval for iterating through plots.
 

Protected Slots

void StoreData ()
 Reads and stores data using the directory provided. More...
 
void RefreshGraphs (int value)
 Redraws all plots with a certain stored data set. More...
 
void SubRefreshGraphs (int value)
 Sub-usage for changing the slider value, the update will occur for the spin box as well.
 
void RefreshGraphs ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void ToggleIteratingPlots ()
 Allows for the change of states between iterating and not iterating through plots. More...
 
void EnlargePlots ()
 Increases the size of the plots and redraw. More...
 
void ShrinkPlots ()
 Decreases the size of the plots and redraw. More...
 
void UserSetDirectory ()
 Prompts the user for a directory that contains simulation data. More...
 
void ChangeInterval (int value)
 Changes the amount of milliseconds of delay there is between the drawing of one graph and that of the next. More...
 
void ChangeViewMode (int mode)
 Changes the type of data and units that are displayed. More...
 

Protected Member Functions

void ConnectWidgets ()
 Manages the connection of signals and slots. More...
 
void SetupUI ()
 Sets up various UI elements for the program to use. More...
 

Protected Attributes

DataVisualizerGUIEX UI_
 The main UI form window for this program. More...
 
StartupUIEX StartupUI_
 Form used for first time setup. More...
 
QDialog * StartupBox_
 Dialog generated to house the startup form. More...
 
DataManagerDataManager_
 Reads and stores data from bulks of snapshot, save points, collision energy, and RPK files. More...
 
QSettings * ProgramSettings_
 Reads and writes the system settings for the program. More...
 
int CurrentPlot_
 Indicates the index of a data set that will be plotted. More...
 
bool PlotsIterating_
 Indicates whether plots are being cycled through (animated). More...
 
QTimer * PlotUpdateTimer_
 Timer used to check when to increment to the next plot. More...
 

Detailed Description

The main program window of Data Visualizer.

Constructor & Destructor Documentation

DataVisualizer::DataVisualizer ( QWidget *  parent = 0)

Constructor.

Initializes all UI forms and their members and objects.

Parameters
parentreference to a widget that will claim ownership of this QMainWindow.
DataVisualizer::~DataVisualizer ( )

Destructor.

Deallocates any objects not belonging and destroyed by the Qt hierarchy.

Member Function Documentation

void DataVisualizer::ChangeInterval ( int  value)
protectedslot

Changes the amount of milliseconds of delay there is between the drawing of one graph and that of the next.

Checks if the value passed is negative. If it is, return is called. Otherwise, the DataVisualizer::PlotUpdateTimer_ is set to value. The refresh interval slider's value in DataVisualizer::UI_ is also set to value to correct its position in the event value was not "passed" by the slider itself. The reflect interval label is changed to reflect the new value. Finally, the value is saved to the registry via DataVisualizer::ProgramSettings_ for future reference.

Parameters
valuenumber of milliseconds the delay will be changed to.
void DataVisualizer::ChangeViewMode ( int  mode)
protectedslot

Changes the type of data and units that are displayed.

Parameters
mode0 is Complex View. 1 is Simple View.
void DataVisualizer::ConnectWidgets ( )
protected

Manages the connection of signals and slots.

Creates the following UI connections:
Start button clicks toggle the "play" or "pause" state for the plots. Value changed on slider causes the plots to be refreshed with that new value.

void DataVisualizer::EnlargePlots ( )
protectedslot

Increases the size of the plots and redraw.

Checks to ensure that the plot width, DataVisualizerUIEX::GetGraphWidth, does not exceed DataVisualizer::MaxPlotSize. If it does not, DataVisualizerUIEX::ChangePlotWidths is called to increase the width by DataVisualizer::ResizeIncrement.

See Also
DataVisualizerUIEX::GetGraphWidth, DataVisualizerUIEX::ChangePlotWidths
void DataVisualizer::RefreshGraphs ( int  value)
protectedslot

Redraws all plots with a certain stored data set.

If the passed value is within the bounds of the data set collection, [0, DataManager::GetMaxSets), the DataVisualizer::CurrentPlot_ data set index will be assigned with the value.

Parameters
valueindex of the stored data set.
void DataVisualizer::RefreshGraphs ( )
protectedslot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Clears and redraws the plots with the current data set, indicated by DataVisualizer::CurrentPlot_. If the DataVisualizer::PlotsIterating_ animation state for the plots is true, the DataVisualizer::CurrentPlot_ data set index will be incremented up by one.

void DataVisualizer::SetupUI ( )
protected

Sets up various UI elements for the program to use.

Enlarge ("+") and shrink("-") buttons for the plots are set to auto repeat. This allows for the actions to continue when the buttons are held down. Keyboard shortcuts are set for each of the buttons as well, along with individual tooltips. The registry is then checked for if it contains a previously set refresh interval and data files directory. If those items are found, they are set to their respective text labels in the program.

void DataVisualizer::ShrinkPlots ( )
protectedslot

Decreases the size of the plots and redraw.

Checks to ensure that the plot width, DataVisualizerUIEX::GetGraphWidth, does not fall under DataVisualizer::MinPlotSize. If it does not, DataVisualizerUIEX::ChangePlotWidths is called to decrease the width by DataVisualizer::ResizeIncrement.

See Also
DataVisualizerUIEX::GetGraphWidth, DataVisualizerUIEX::ChangePlotWidths
void DataVisualizer::StoreData ( )
protectedslot

Reads and stores data using the directory provided.

If there is a directory referenced in the registry, which can be checked using DataVisualizer::ProgramSettings_, the path in DataVisualizer::DataManager_ will be set with that path, using DataManager::SetDirPath. The DataVisualizer::DataManager_ will then call DataManager::StoreData to parse and store the data from that directory. The slider bar range will be set according the number of data sets stored, and the slider position will be set to zero. The plots are then cleared and redrawn with DataVisualizer::RefreshGraphs.

If there was no directory found, return is called.

See Also
DataManager::StoreData, DataManager::SetDirPath, DataVisualizer::RefreshGraphs
void DataVisualizer::ToggleIteratingPlots ( )
protectedslot

Allows for the change of states between iterating and not iterating through plots.

If the animation state, DataVisualizer::PlotsIterating_, is true (active), set it to false (inactive). Likewise, if the state is false, set it to true. The labels are changed to reflect the current animation state: "Stop" for if the state is true ("animation playing"), "Start" for if the state is false ("animation paused").

void DataVisualizer::UserSetDirectory ( )
protectedslot

Prompts the user for a directory that contains simulation data.

If there is a directory referenced in the registry, which can be checked using DataVisualizer::ProgramSettings_, the path is used to open the file dialog at that directory. The prompt awaits for user interaction. If the path specified is invalid ("Cancel" is pressed), return is called. Otherwise, the new directory is written to the registry using DataVisualizer::ProgramSettings_. The text boxes for the simulation directory in DataVisualizer::UI_ and DataVisualizer::StartupUI_ are changed to the new directory's path. Finally, signals are emitted for DataVisualizer::ChangedDirectory methods.

See Also
DataVisualizer::ChangedDirectory

Member Data Documentation

int DataVisualizerGUI::DataVisualizer::CurrentPlot_
protected

Indicates the index of a data set that will be plotted.

DataManager* DataVisualizerGUI::DataVisualizer::DataManager_
protected

Reads and stores data from bulks of snapshot, save points, collision energy, and RPK files.

bool DataVisualizerGUI::DataVisualizer::PlotsIterating_
protected

Indicates whether plots are being cycled through (animated).

QTimer* DataVisualizerGUI::DataVisualizer::PlotUpdateTimer_
protected

Timer used to check when to increment to the next plot.

QSettings* DataVisualizerGUI::DataVisualizer::ProgramSettings_
protected

Reads and writes the system settings for the program.

QDialog* DataVisualizerGUI::DataVisualizer::StartupBox_
protected

Dialog generated to house the startup form.

StartupUIEX DataVisualizerGUI::DataVisualizer::StartupUI_
protected

Form used for first time setup.

DataVisualizerGUIEX DataVisualizerGUI::DataVisualizer::UI_
protected

The main UI form window for this program.


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