iLand
bitescript.h
Go to the documentation of this file.
1/********************************************************************************************
2** iLand - an individual based forest landscape and disturbance model
3** http://iland-model.org
4** Copyright (C) 2009- Werner Rammer, Rupert Seidl
5**
6** This program is free software: you can redistribute it and/or modify
7** it under the terms of the GNU General Public License as published by
8** the Free Software Foundation, either version 3 of the License, or
9** (at your option) any later version.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU General Public License
17** along with this program. If not, see <http://www.gnu.org/licenses/>.
18********************************************************************************************/
19#ifndef BITESCRIPT_H
20#define BITESCRIPT_H
21#include <QJSValue>
22#include <QObject>
23namespace BITE {
24
25class BiteEngine;
26class BiteAgent;
27
28class BiteScript: public QObject
29{
30 Q_OBJECT
31 Q_PROPERTY(QStringList agents READ agents)
32
33public:
34 BiteScript(QObject *parent=nullptr);
35 void setup(BiteEngine *biteengine);
36
37 QStringList agents();
38
39 // static members
40 static QString JStoString(QJSValue value);
41
42public slots:
43 BiteAgent *agent(QString agent_name);
44
45 void log(QString msg);
46 void log(QJSValue obj);
47
48 void run(int year);
49
50private:
51
52 BiteEngine *mEngine;
53};
54
55
56} // end name space
57#endif // BITESCRIPT_H
Definition: biteagent.h:71
Definition: biteengine.h:30
Definition: bitescript.h:29
QStringList agents()
BiteScript(QObject *parent=nullptr)
Definition: bitescript.cpp:38
void log(QString msg)
Definition: bitescript.cpp:119
BiteAgent * agent(QString agent_name)
Definition: bitescript.cpp:111
static QString JStoString(QJSValue value)
Definition: bitescript.cpp:100
void setup(BiteEngine *biteengine)
Definition: bitescript.cpp:43
void run(int year)
Definition: bitescript.cpp:131
QStringList agents
Definition: bitescript.h:31
Definition: biteagent.cpp:32