A network train simulation GUI. More...
#include <netrainsimmainwindow.h>
Public Slots | |
void | setNodesData (QVector< double > &xData, QVector< double > &yData, QVector< QString > &labels) |
Slot for setting the nodes data. | |
void | setLinksData (QVector< QString > &startNodeIDs, QVector< QString > endNodeIDs) |
Slot for setting the links data. | |
void | updateTrainsPlot (Vector< std::pair< std::string, Vector< std::pair< double, double > > > > trainsStartEndPoints) |
Slot for updating the trains plot. | |
void | closeApplication () |
Slot for closing the application. | |
void | clearForm () |
Slot for clearing the form. | |
void | handleSampleProject () |
Slot for handling loading the sample project files. | |
void | pauseSimulation () |
void | resumeSimulation () |
Signals | |
void | nodesDataChanged (QVector< double > &xData, QVector< double > &yData, QVector< QString > &labels) |
Signal emitted when the nodes data is changed. | |
void | linksDataChanged (QVector< QString > &startNodeID, QVector< QString > endNodeID) |
Signal emitted when the links data is changed. | |
Public Member Functions | |
void | loadDefaults () |
load default settings | |
bool | saveDefaults (QStringList defaults) |
NeTrainSim::save Default values. | |
NeTrainSim (QWidget *parent=nullptr) | |
Constructor. | |
~NeTrainSim () | |
Destructor. | |
void | showNotification (QString text) |
Displays a notification with the given text for 3000 millisecond. | |
void | showWarning (QString text) |
Displays a warning message with the given text. | |
void | loadProjectFiles (QString projectFilename) |
load the Project Files to the simulator GUI | |
Public Attributes | |
QString | defaultBrowsePath |
default Browse Path | |
QString | userBrowsePath |
Protected Member Functions | |
void | closeEvent (QCloseEvent *event) override |
Event handler for the close event of the NeTrainSim window. | |
A network train simulation GUI.
This class represents the main window of the NeTrainSim application, which is used for simulating train networks. It provides functionality for setting up the simulation, managing network nodes and links, visualizing the network, running simulations, and generating reports.
The class emits signals for notifying changes in the nodes and links data, and provides slots for handling events and updating the GUI based on these signals. It also includes several private methods for setting up the application, handling user interactions, and performing internal tasks.
NeTrainSim::NeTrainSim | ( | QWidget * | parent = nullptr | ) |
Constructor.
[in,out] | parent | (Optional) If non-null, the parent. |
NeTrainSim::~NeTrainSim | ( | ) |
Destructor.
|
slot |
Slot for clearing the form.
|
slot |
Slot for closing the application.
|
overrideprotected |
Event handler for the close event of the NeTrainSim window.
event | Pointer to the QCloseEvent object. |
|
slot |
Slot for handling loading the sample project files.
|
signal |
Signal emitted when the links data is changed.
startNodeIDs | The updated start node IDs of the links. |
endNodeIDs | The updated end node IDs of the links. |
void NeTrainSim::loadDefaults | ( | ) |
load default settings
void NeTrainSim::loadProjectFiles | ( | QString | projectFilename | ) |
load the Project Files to the simulator GUI
projectFilename | the file NTS that has the files address |
|
signal |
Signal emitted when the nodes data is changed.
xData | The updated X-coordinate data of the nodes. |
yData | The updated Y-coordinate data of the nodes. |
labels | The updated labels of the nodes. |
|
slot |
|
slot |
bool NeTrainSim::saveDefaults | ( | QStringList | defaults | ) |
NeTrainSim::save Default values.
defaults |
|
slot |
Slot for setting the links data.
startNodeIDs | The start node IDs of the links. |
endNodeIDs | The end node IDs of the links. |
|
slot |
Slot for setting the nodes data.
xData | The X-coordinate data of the nodes. |
yData | The Y-coordinate data of the nodes. |
labels | The labels of the nodes. |
void NeTrainSim::showNotification | ( | QString | text | ) |
Displays a notification with the given text for 3000 millisecond.
text | The text of the notification to be displayed. |
void NeTrainSim::showWarning | ( | QString | text | ) |
Displays a warning message with the given text.
text | The text of the warning message to be displayed. |
|
slot |
Slot for updating the trains plot.
trainsStartEndPoints | The start and end points of trains. |
QString NeTrainSim::defaultBrowsePath |
default Browse Path
QString NeTrainSim::userBrowsePath |