#include <iostream>
#include <string>
#include "anyoption.h"
#include <QApplication>
#include "Sandbox.h"
#include "MainWindow.h"
#include "ThreadManager.h"
#include "../doc/referenceManual/mainPage.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 39 of file main.cpp.
48 cout <<
"*******************************************************************" << endl;
49 cout <<
"*** !! Welcome to FFSM - The Forest Sector Simulator !! ***" << endl;
50 cout <<
"*** For info & doc: http://www.ffsm-project.org/doc ***" << endl;
51 cout <<
"*** Full compiled on: " << __DATE__ <<
" - " << __TIME__ <<
" ***" << endl;
52 cout <<
"*******************************************************************" << endl<<endl;
65 QString currentDir = dir.currentPath();
71 QString inputFileName =
"";
72 QString scenarioName =
"";
84 opt->
addUsage(
"*** FFSM - Forest Sector Simulator ***" );
87 opt->
addUsage(
" -h --help Prints this help " );
88 opt->
addUsage(
" -c --console Run in console mode (no gui, default: false) " );
89 opt->
addUsage(
" -i --input_file [input_file_name] Input file (relative path, default: 'data/ffsmInput.ods') " );
90 opt->
addUsage(
" -s --scenario [scenario_name] Scenario name (default: the first defined in the input file) " );
93 opt->
addUsage(
" - input_file and scenario options have no effect in GUI mode;" );
94 opt->
addUsage(
" - the working directory is the base path relative to the input file." );
96 opt->
addUsage(
"Read installed documentation or browse it at http://www.ffsm-project.org/doc." );
101 opt->
setFlag(
"console",
'c' );
115 if( opt->
getValue(
'i' ) != NULL || opt->
getValue(
"input_file" ) != NULL ){
116 QString tempdata(opt->
getValue(
'i' ));
117 inputFileName = currentDir +
"/" + tempdata;
120 inputFileName = currentDir +
"/data/ffsmInput.ods";
124 scenarioName = opt->
getValue(
's' );
132 QApplication app(argc, argv);
void setFlag(const char *opt_string)
Thread manager. Responsable to manage the main thread and "speak" with the GUI.
bool getFlag(const char *_option)
void processCommandArgs()
char * getValue(const char *_option)
void addUsage(const char *line)
void runFromConsole(QString inputFileName_h, QString scenarioName_h)
Re-draw the map making it to fit (with the right proportions) to the widget.
void setOption(const char *opt_string)
void basicTest()
Simple tests that doesn't require anything else (are encapsulated) and so they can be run at the begi...