Subversion Repositories public iLand

Rev

Rev 1182 | Rev 1218 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1182 Rev 1217
1
Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/ilandc/main.cpp':
1
Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/ilandc/main.cpp':
2
/********************************************************************************************
2
/********************************************************************************************
3
**    iLand - an individual based forest landscape and disturbance model
3
**    iLand - an individual based forest landscape and disturbance model
4
**    http://iland.boku.ac.at
4
**    http://iland.boku.ac.at
5
**    Copyright (C) 2009-  Werner Rammer, Rupert Seidl
5
**    Copyright (C) 2009-  Werner Rammer, Rupert Seidl
6
**
6
**
7
**    This program is free software: you can redistribute it and/or modify
7
**    This program is free software: you can redistribute it and/or modify
8
**    it under the terms of the GNU General Public License as published by
8
**    it under the terms of the GNU General Public License as published by
9
**    the Free Software Foundation, either version 3 of the License, or
9
**    the Free Software Foundation, either version 3 of the License, or
10
**    (at your option) any later version.
10
**    (at your option) any later version.
11
**
11
**
12
**    This program is distributed in the hope that it will be useful,
12
**    This program is distributed in the hope that it will be useful,
13
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
**    GNU General Public License for more details.
15
**    GNU General Public License for more details.
16
**
16
**
17
**    You should have received a copy of the GNU General Public License
17
**    You should have received a copy of the GNU General Public License
18
**    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
**    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
********************************************************************************************/
19
********************************************************************************************/
20
20
21
#include <QCoreApplication>
21
#include <QCoreApplication>
22
#include <stdio.h>
22
#include <stdio.h>
23
#include <QDebug>
23
#include <QDebug>
24
#include <QDateTime>
24
#include <QDateTime>
25
#include <QStringList>
25
#include <QStringList>
26
#include "version.h"
26
#include "version.h"
27
#include "exception.h"
27
#include "exception.h"
28
#include <stdexcept>
28
#include <stdexcept>
29
#include <QTimer>
29
#include <QTimer>
30
#include <QString>
30
#include <QString>
31
31
32
#include "consoleshell.h"
32
#include "consoleshell.h"
33
int main(int argc, char *argv[])
33
int main(int argc, char *argv[])
34
{
34
{
35
    QCoreApplication a(argc, argv);
35
    QCoreApplication a(argc, argv);
36
36
37
    printf("iLand console (%s - #%s)\n", currentVersion(), svnRevision());
37
    printf("iLand console (%s - #%s)\n", currentVersion(), svnRevision());
38
    printf("This is the console version of iLand, the individual based\nlandscape and disturbance forest model.\n");
38
    printf("This is the console version of iLand, the individual based\nlandscape and disturbance forest model.\n");
39
    printf("More at: http://iland.boku.ac.at \n");
39
    printf("More at: http://iland.boku.ac.at \n");
40
    printf("(c) Werner Rammer, Rupert Seidl, 2009-2015 \n");
40
    printf("(c) Werner Rammer, Rupert Seidl, 2009-2015 \n");
41
    printf("compiled: %s\n", compiler().toLocal8Bit().data());
41
    printf("compiled: %s\n", compiler().toLocal8Bit().data());
42
    printf("****************************************\n\n");
42
    printf("****************************************\n\n");
43
    if (a.arguments().count()<3) {
43
    if (a.arguments().count()<3) {
44
        printf("Usage: \n");
44
        printf("Usage: \n");
45
        printf("ilandc.exe <xml-project-file> <years> <...other options>\n");
45
        printf("ilandc.exe <xml-project-file> <years> <...other options>\n");
46
        printf("Options:\n");
46
        printf("Options:\n");
47
        printf("you specify a number key=value pairs, and *after* loading of the project\n");
47
        printf("you specify a number key=value pairs, and *after* loading of the project\n");
48
        printf("the 'key' settings are set to 'value'. E.g.: ilandc project.xml 100 output.stand.enabled=false output.stand.landscape=false\n");
48
        printf("the 'key' settings are set to 'value'. E.g.: ilandc project.xml 100 output.stand.enabled=false output.stand.landscape=false\n");
49
        printf("See also http://iland.boku.ac.at/iLand+console\n.");
49
        printf("See also http://iland.boku.ac.at/iLand+console\n.");
50
        return 0;
50
        return 0;
51
    }
51
    }
52
    ConsoleShell iland_shell;
52
    ConsoleShell iland_shell;
53
53
54
    QTimer::singleShot(0, &iland_shell, SLOT(run()));
54
    QTimer::singleShot(0, &iland_shell, SLOT(run()));
55
    //a.installEventFilter(&iland_shell);
55
    //a.installEventFilter(&iland_shell);
56
    return a.exec();
56
    return a.exec();
57
}
57
}
58
 
58