#include <MainWindow.h>
Collaboration diagram for MainWindow:

Public Slots | |
| void | setUnsavedStatus (bool unsavedStatus_h) |
| void | setOutputDirName (string outputDirName_h) |
| void | addLayer (QString layerName_h, QString layerLabel_h) |
| void | switchToLayer (QString layerName_h) |
| void | updatePixel (QString layerName_h, int x_h, int y_h, QColor color_h) |
| void | updateImage (QString layerName_h, const QImage &image_h) |
| void | switchToLayerFromLayerSelector (int layerIndex_h) |
| void | treeViewerItemChangeValue (string itemID, string newValue) |
| Change value to an existing item in the Status Viewer. | |
| void | treeViewerItemRemove (string itemID) |
| void | treeViewerAddItem (string text, string itemID, string parentID) |
| e.g. manager_farmer_manager agents or agent_12345_ownedHa | |
| void | processLogArea (const QString &message_h) |
| void | resetGUIForNewSimulation () |
| Reset the graphical elements for a new simulation. | |
| void | receiveScenarioOptions (const QVector< QString > &scenarios_h) |
Signals | |
| void | currentModelFilenameChanged (QString) |
| void | selectedScenarioName (const QString &scenarioName_h) |
Public Member Functions | |
| MainWindow () | |
| Constructor. | |
| void | setCurrentLogFileName (const QString &fileName) |
| void | setCurrentModelFileName (const QString &fileName) |
| bool | saveLogFile (const QString &logFileName) |
| QString | strippedName (const QString &fullFileName) |
| QString | getModelFileName () |
| void | setModelFileName (const QString curModelFileName_h) |
Protected Member Functions | |
| void | closeEvent (QCloseEvent *event) |
| Manage the event of closing the application. | |
Private Types | |
| enum | { MaxRecentFiles = 5 } |
Private Slots | |
| void | open () |
| bool | save () |
| bool | saveAs () |
| void | startModelMainThread () |
| void | stopModelMainThread () |
| void | pauseOrResumeModelMainThread () |
| void | openRecentFile () |
| void | hideDebugMsgs (bool hide) |
| void | about () |
| void | showDocumentation () |
Private Member Functions | |
| void | createStatusBar () |
| bool | okToContinue () |
| void | readSettings () |
| void | writeSettings () |
| void | updateRecentFileActions () |
Private Attributes | |
| ThreadManager | modelMainThread |
| QLabel * | yearSBLabel |
| Status bar current year label. | |
| QLabel * | mainSBLabel |
| Status bar main label. | |
| bool | unsavedStatus |
| QString | outputDirName |
| QString | curLogFileName |
| QString | curModelFileName |
| QString | curBaseDirectory |
| QStringList | recentFiles |
| QAction * | recentFileActions [MaxRecentFiles] |
| QAction * | separatorAction |
| bool | debugMsgsEnable |
| Allow debug messages to be show in the logArea. | |
| ScenarioSelectionWidget * | scenarioWidget |
| map< string, QTreeWidgetItem * > | svIndex |
| Map containing the ID and the pointers to the status viewer. | |
MainWindow derive from both the generic Qt QMainWindow and from Ui::MainWindow (the latter being the autmatically generated C++ code from QtDesigner).
It implements code and functionality that can not be done in the QtDesigner.
Definition at line 48 of file MainWindow.h.
anonymous enum [private] |
| MainWindow | ( | ) |
Constructor.
It setup the Gui from the QTDesiger autogenerated code and connect various GUI signal/slots
Definition at line 35 of file MainWindow.cpp.
| void setCurrentLogFileName | ( | const QString & | fileName | ) |
Definition at line 188 of file MainWindow.cpp.
Referenced by MainWindow(), and saveLogFile().
Here is the caller graph for this function:

| void setCurrentModelFileName | ( | const QString & | fileName | ) |
| bool saveLogFile | ( | const QString & | logFileName | ) |
| QString strippedName | ( | const QString & | fullFileName | ) |
Definition at line 209 of file MainWindow.cpp.
Referenced by setCurrentModelFileName(), and updateRecentFileActions().
Here is the caller graph for this function:

| QString getModelFileName | ( | ) | [inline] |
Definition at line 59 of file MainWindow.h.
| void setModelFileName | ( | const QString | curModelFileName_h | ) | [inline] |
Definition at line 60 of file MainWindow.h.
| void setUnsavedStatus | ( | bool | unsavedStatus_h | ) | [inline, slot] |
| void setOutputDirName | ( | string | outputDirName_h | ) | [inline, slot] |
| void addLayer | ( | QString | layerName_h, | |
| QString | layerLabel_h | |||
| ) | [slot] |
Perform all the operation needed when adding a new layer:
Definition at line 427 of file MainWindow.cpp.
Referenced by MainWindow().
| void switchToLayer | ( | QString | layerName_h | ) | [slot] |
Perform all the operation needed when switching layer:
Definition at line 444 of file MainWindow.cpp.
| void updatePixel | ( | QString | layerName_h, | |
| int | x_h, | |||
| int | y_h, | |||
| QColor | color_h | |||
| ) | [slot] |
| void updateImage | ( | QString | layerName_h, | |
| const QImage & | image_h | |||
| ) | [slot] |
| void switchToLayerFromLayerSelector | ( | int | layerIndex_h | ) | [slot] |
| void treeViewerItemChangeValue | ( | string | itemID, | |
| string | newValue | |||
| ) | [slot] |
Change value to an existing item in the Status Viewer.
Definition at line 472 of file MainWindow.cpp.
Referenced by MainWindow().
| void treeViewerItemRemove | ( | string | itemID | ) | [slot] |
| void treeViewerAddItem | ( | string | text, | |
| string | itemID, | |||
| string | parentID | |||
| ) | [slot] |
e.g. manager_farmer_manager agents or agent_12345_ownedHa
Definition at line 515 of file MainWindow.cpp.
Referenced by MainWindow().
| void processLogArea | ( | const QString & | message_h | ) | [slot] |
| void resetGUIForNewSimulation | ( | ) | [slot] |
Reset the graphical elements for a new simulation.
Definition at line 594 of file MainWindow.cpp.
Referenced by MainWindow().
| void receiveScenarioOptions | ( | const QVector< QString > & | scenarios_h | ) | [slot] |
| void currentModelFilenameChanged | ( | QString | ) | [signal] |
| void selectedScenarioName | ( | const QString & | scenarioName_h | ) | [signal] |
| void closeEvent | ( | QCloseEvent * | event | ) | [protected] |
| void open | ( | ) | [private, slot] |
| bool save | ( | ) | [private, slot] |
| bool saveAs | ( | ) | [private, slot] |
| void startModelMainThread | ( | ) | [private, slot] |
| void stopModelMainThread | ( | ) | [private, slot] |
| void pauseOrResumeModelMainThread | ( | ) | [private, slot] |
| void openRecentFile | ( | ) | [private, slot] |
| void hideDebugMsgs | ( | bool | hide | ) | [private, slot] |
| void about | ( | ) | [private, slot] |
| void showDocumentation | ( | ) | [private, slot] |
| void createStatusBar | ( | ) | [private] |
Definition at line 152 of file MainWindow.cpp.
Referenced by MainWindow().
Here is the caller graph for this function:

| bool okToContinue | ( | ) | [private] |
Definition at line 238 of file MainWindow.cpp.
Referenced by closeEvent(), open(), and openRecentFile().
Here is the caller graph for this function:

| void readSettings | ( | ) | [private] |
Definition at line 299 of file MainWindow.cpp.
Referenced by MainWindow().
Here is the caller graph for this function:

| void writeSettings | ( | ) | [private] |
Definition at line 373 of file MainWindow.cpp.
Referenced by closeEvent().
Here is the caller graph for this function:

| void updateRecentFileActions | ( | ) | [private] |
Definition at line 214 of file MainWindow.cpp.
Referenced by readSettings(), and setCurrentModelFileName().
Here is the caller graph for this function:

ThreadManager modelMainThread [private] |
Definition at line 102 of file MainWindow.h.
Referenced by closeEvent(), createStatusBar(), MainWindow(), okToContinue(), pauseOrResumeModelMainThread(), setCurrentModelFileName(), startModelMainThread(), and stopModelMainThread().
QLabel* yearSBLabel [private] |
Status bar current year label.
Definition at line 103 of file MainWindow.h.
Referenced by createStatusBar(), and MainWindow().
QLabel* mainSBLabel [private] |
Status bar main label.
Definition at line 104 of file MainWindow.h.
Referenced by createStatusBar(), and MainWindow().
bool unsavedStatus [private] |
Definition at line 105 of file MainWindow.h.
Referenced by MainWindow(), okToContinue(), save(), saveAs(), saveLogFile(), setUnsavedStatus(), and startModelMainThread().
QString outputDirName [private] |
Definition at line 106 of file MainWindow.h.
Referenced by MainWindow(), save(), saveAs(), and setOutputDirName().
QString curLogFileName [private] |
Definition at line 107 of file MainWindow.h.
Referenced by MainWindow(), save(), and setCurrentLogFileName().
QString curModelFileName [private] |
Definition at line 108 of file MainWindow.h.
Referenced by getModelFileName(), MainWindow(), openRecentFile(), setCurrentModelFileName(), and setModelFileName().
QString curBaseDirectory [private] |
Definition at line 109 of file MainWindow.h.
Referenced by MainWindow(), open(), and openRecentFile().
QStringList recentFiles [private] |
Definition at line 110 of file MainWindow.h.
Referenced by readSettings(), setCurrentModelFileName(), updateRecentFileActions(), and writeSettings().
QAction* recentFileActions[MaxRecentFiles] [private] |
Definition at line 112 of file MainWindow.h.
Referenced by MainWindow(), and updateRecentFileActions().
QAction* separatorAction [private] |
Definition at line 113 of file MainWindow.h.
Referenced by MainWindow(), and updateRecentFileActions().
bool debugMsgsEnable [private] |
Allow debug messages to be show in the logArea.
Definition at line 114 of file MainWindow.h.
Referenced by hideDebugMsgs(), MainWindow(), and processLogArea().
ScenarioSelectionWidget* scenarioWidget [private] |
Definition at line 115 of file MainWindow.h.
Referenced by MainWindow(), and receiveScenarioOptions().
map<string, QTreeWidgetItem*> svIndex [private] |
Map containing the ID and the pointers to the status viewer.
Ids are based on the name of the item:
Definition at line 127 of file MainWindow.h.
Referenced by resetGUIForNewSimulation(), treeViewerAddItem(), treeViewerItemChangeValue(), and treeViewerItemRemove().