#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include "graphwidget.h" #include "stub/my-commmodel.h" #include "settingsdialog.h" #include "replaydialog.h" class GraphWidget; class SettingsDialog; class ReplayDialog; namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); SettingsDialog *settingsDialog; ReplayDialog *replayDialog; int getInactiveThreshold(); CommModel * getComm(); void updateSettings(int _refreshRate, int _inactiveThreshold, bool _doPhysics, bool _showSignalStrength, bool _showThroughput, bool _showInactivityTime, bool _showLatency); public slots: /** * Grab relevant data from the list of nodes, and display them in the list of node data. */ void updateList(); private slots: /** * Place a node in the list of node data. * * @param int row The row in the list to place the info * @param node* myNode The node to be placed * @param node* sourceNode The node stuff is coming from * @param QStandardItemModel* model The model to place the node info in, which should be the node data list * @param CommModel* comm The comm model we get our node data from */ void on_playbackButton_released(); void on_settingsButton_released(); void on_playButton_released(); void setNodeInModel(int row, node* myNode, node* sourceNode, QStandardItemModel* model, CommModel* comm); void setNodeInAllModel(int row, node* myNode, QStandardItemModel* model); void togglePlaying(); private: /** User interface of the Main Window */ Ui::MainWindow *ui; /** scene to hold nodes*/ QGraphicsScene *m_scene; /** widget to hold scene*/ GraphWidget *widget; /** CommModel*/ CommModel *comm; /** Node of OCU*/ node *ocu; /** Node of selected Node*/ node *selectedNode; /** Flag that represents the activity of mesh.*/ bool isPlaying; /** Flag which checks if it's first time booting up the mesh */ bool firstTime; /** Timer for refreshing the mesh in certain interval */ QTimer * timer; /** Variable representing the refresh rate */ int refreshRate; /** Variable representing the inactive threshold */ int inactiveThreshold; /** Flag which determines whether physics will be applied to the graphical representation of nodes */ bool doPhysics; /** Flag which determines the visibility of the signal strengths */ bool showSignalStrength; /** Flag which determines the visibility of the throughput */ bool showThroughput; /** Flag which determines the visibility of the inactivity time */ bool showInactivityTime; /** Flag which determines the visibility of the latency */ bool showLatency; }; #endif // MAINWINDOW_H