iLand
fireplugin.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
20#ifndef FIREPLUGIN_H
21#define FIREPLUGIN_H
22
23#include <QObject>
24#include "firemodule.h"
25
26#include "plugin_interface.h"
27class FirePlugin: public QObject,
29 public WaterInterface,
31{
32 Q_OBJECT
33 #if QT_VERSION >= 0x050000
34 Q_PLUGIN_METADATA(IID "at.ac.boku.iland.fireplugin" FILE "fireplugin.json")
35 #endif
37
38
39public:
40 FirePlugin();
41 // general interface details
42 QString name();
43 QString version();
44 QString description();
45
46 // setup
48 void setup();
50 void setupResourceUnit(const ResourceUnit *ru) { mFire.setup(ru);}
52 void setupScripting(QJSEngine *engine);
53
54
55 // calculations
56 void yearBegin() { mFire.yearBegin(); }
57 void run() { mFire.run(); }
58 // access to water data
59 void calculateWater(const ResourceUnit *resource_unit, const WaterCycleData *water_data) {mFire.calculateDroughtIndex(resource_unit, water_data); }
60
61 // special functions for direct access (testing)
62 FireModule *fireModule() { return &mFire; }
63private:
64 FireModule mFire;
65};
66
67#endif // FIREPLUGIN_H
Definition: plugin_interface.h:35
FireModule is the main class of the fire sub module.
Definition: firemodule.h:141
void yearBegin()
called yearly from the plugin to perform some cleanup.
Definition: firemodule.cpp:209
void setup()
the setup function sets up the grids and parameters used for the fire module.
Definition: firemodule.cpp:138
void calculateDroughtIndex(const ResourceUnit *resource_unit, const WaterCycleData *water_data)
called from the plugin to perform calculations (drought indices) during the water cycle routine.
Definition: firemodule.cpp:236
void run()
main function that is executed yearly (called by the plugin) performs the major processes (ignition,...
Definition: firemodule.cpp:219
Definition: fireplugin.h:31
QString description()
some additional description. This info is shown in the GUI and is printed to the log file.
Definition: fireplugin.cpp:44
void run()
main function that once a year (after growth)
Definition: fireplugin.h:57
FireModule * fireModule()
Definition: fireplugin.h:62
void setupResourceUnit(const ResourceUnit *ru)
setup resource unit specific parameters
Definition: fireplugin.h:50
QString name()
a unique name of the plugin
Definition: fireplugin.cpp:34
void setup()
setup after the main iLand model frame is created
Definition: fireplugin.cpp:61
void yearBegin()
function executes at the beginning of a year (e.g., cleanup)
Definition: fireplugin.h:56
void setupScripting(QJSEngine *engine)
setup additional javascript related features
Definition: fireplugin.cpp:75
void calculateWater(const ResourceUnit *resource_unit, const WaterCycleData *water_data)
Definition: fireplugin.h:59
FirePlugin()
Definition: fireplugin.cpp:52
QString version()
a version identification
Definition: fireplugin.cpp:39
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
Definition: plugin_interface.h:52
WaterCycleData is a data transfer container for water-related details.
Definition: watercycle.h:191
Definition: plugin_interface.h:67