6#ifndef NETRAINSIMMAINWINDOW_H
7#define NETRAINSIMMAINWINDOW_H
14#include "../NeTrainSim/util/map.h"
54 void nodesDataChanged(QVector<double>& xData, QVector<double>& yData, QVector<QString>& labels);
77 void setNodesData(QVector<double>& xData, QVector<double>& yData, QVector<QString>& labels);
88 void setLinksData(QVector<QString>& startNodeIDs, QVector<QString> endNodeIDs);
147 void setValue(
const int recNo,
const QString paramName, QVariant ¶mValue,
const int reportPage);
157 void setDSInfo(DataSetInfo &dsInfo);
167 void handleError(std::string error);
178 void handleSimulationFinished(
Vector<std::pair<string, string> > summaryData, std::string trajectoryFile);
186 void updateCombo_visualizeTrains();
196 void trainPointSelected(QPointF selectedPoint);
206 void trainPointDeleted(QPointF selectedPoint);
287 QThread* thread =
nullptr;
291 QVector<QCPItemText*> labelsVector;
299 QVector<double> nodesXData;
302 QVector<double> nodesYData;
305 QVector<QString> nodesLabelData;
308 QVector<QString> linksStartNodeIDs;
311 QVector<QString> linksEndNodeIDs;
314 std::shared_ptr<AboutWindow> aboutWindow =
nullptr;
316 std::shared_ptr<settingsWindow> theSettingsWindow =
nullptr;
328 QString nodesFilename;
331 QString linksFilename;
334 QString trainsFilename;
337 QString projectFileName;
344 QtRPT * report =
nullptr;
347 QPrinter *printer =
nullptr;
351 void showDetailedReport(QString trajectoryFilename);
353 void drawLineGraph(
CustomPlot &plot,
const QVector<double> &xData,
354 const QVector<double> &yData, QString xLabel,
355 QString yLabel, QString graphName,
int plotIndex);
359 void saveProjectFile(
bool saveAs =
false);
367 void setupGenerals();
414 void setupNodesTable();
420 void setupLinksTable();
426 void setupLocomotivesTable();
432 void setupCarsTable();
438 void setupConfigurationsTable();
444 void setupTrainsTable();
453 Vector<std::tuple<int, double, double, std::string,
454 double,
double>> getNodesDataFromNodesTable();
464 std::tuple<QVector<double>, QVector<double>, QVector<QString>>
465 getNodesPlottableData(
Vector<std::tuple<
int,
double,
466 double, std::string,
double,
double>>& nodeRecords);
479 void updateNodesPlot(
CustomPlot& plot, QVector<double> xData,
480 QVector<double> yData, QVector<QString> labels,
481 bool showLabels =
false);
491 Vector<std::tuple<int, int, int, double, int,
492 double, double, int, double, bool,
493 std::string, std::string,
494 double>> getLinkesDataFromLinksFile(QString fileName);
503 Vector<std::tuple<int, int, int, double, int, double, double,
504 int, double, bool,std::string, std::string,
505 double>> getLinkesDataFromLinksTable();
515 std::tuple<QVector<QString>, QVector<QString>>
516 getLinksPlottableData(
Vector<std::tuple<
int,
int,
int,
518 double,
int,
double,
bool,
519 std::string, std::string,
520 double>> linksRecords);
531 void updateLinksPlot(
CustomPlot& plot, QVector<QString> startNodeIDs, QVector<QString> endNodeIDs);
540 QString browseFiles(QLineEdit* theLineEdit,
const QString& theFileName);
550 Vector<std::tuple<int, double, double, std::string, double,
551 double>> getNodesDataFromNodesFile(QString fileName);
559 void browseFolder(QLineEdit* theLineEdit,
const QString& theHelpMessage);
572 double, double,
int>>,
573 Vector<std::tuple<int, int, double, double,
576 bool>> getTrainsDataFromTables();
591 QCPItemText* findLabelByPosition(
CustomPlot* plot,
const QPointF& targetPosition);
This file contains the declaration of the AboutWindow class.
Definition configurationmanager.h:9
The CustomPlot class is a subclass of QCustomPlot, providing additional functionality and customizati...
Definition customplot.h:18
A map.
Definition map.h:26
A network train simulation GUI.
Definition netrainsimmainwindow.h:40
void linksDataChanged(QVector< QString > &startNodeID, QVector< QString > endNodeID)
Signal emitted when the links data is changed.
void resumeSimulation()
Definition netrainsimmainwindow.cpp:2437
void handleSampleProject()
Slot for handling loading the sample project files.
Definition netrainsimmainwindow.cpp:2314
void closeEvent(QCloseEvent *event) override
Event handler for the close event of the NeTrainSim window.
Definition netrainsimmainwindow.cpp:2248
void showNotification(QString text)
Displays a notification with the given text for 3000 millisecond.
Definition netrainsimmainwindow.cpp:1713
void setNodesData(QVector< double > &xData, QVector< double > &yData, QVector< QString > &labels)
Slot for setting the nodes data.
Definition netrainsimmainwindow.cpp:1681
void clearForm()
Slot for clearing the form.
Definition netrainsimmainwindow.cpp:2267
void showWarning(QString text)
Displays a warning message with the given text.
Definition netrainsimmainwindow.cpp:1718
void setLinksData(QVector< QString > &startNodeIDs, QVector< QString > endNodeIDs)
Slot for setting the links data.
Definition netrainsimmainwindow.cpp:1703
QString defaultBrowsePath
default Browse Path
Definition netrainsimmainwindow.h:214
void closeApplication()
Slot for closing the application.
Definition netrainsimmainwindow.cpp:2262
void nodesDataChanged(QVector< double > &xData, QVector< double > &yData, QVector< QString > &labels)
Signal emitted when the nodes data is changed.
void loadProjectFiles(QString projectFilename)
load the Project Files to the simulator GUI
Definition netrainsimmainwindow.cpp:2320
void loadDefaults()
load default settings
Definition netrainsimmainwindow.cpp:201
void pauseSimulation()
Definition netrainsimmainwindow.cpp:2433
~NeTrainSim()
Destructor.
Definition netrainsimmainwindow.cpp:2395
void updateTrainsPlot(Vector< std::pair< std::string, Vector< std::pair< double, double > > > > trainsStartEndPoints)
Slot for updating the trains plot.
Definition netrainsimmainwindow.cpp:2006
QString userBrowsePath
Definition netrainsimmainwindow.h:216
bool saveDefaults(QStringList defaults)
NeTrainSim::save Default values.
Definition netrainsimmainwindow.cpp:230
The SimulationWorker class performs simulation work in a separate thread.
Definition simulationworker.h:27
A vector.
Definition vector.h:24
Definition aboutwindow.h:15
This file contains the declaration of the SimulationWorker class.