Subversion Repositories public iLand

Rev

Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
671 werner 1
/********************************************************************************************
2
**    iLand - an individual based forest landscape and disturbance model
3
**    http://iland.boku.ac.at
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
 
641 werner 20
#ifndef FIREPLUGIN_H
21
#define FIREPLUGIN_H
22
 
23
#include <QObject>
646 werner 24
#include "firemodule.h"
641 werner 25
 
26
#include "plugin_interface.h"
646 werner 27
class FirePlugin: public QObject,
28
        public DisturbanceInterface,
29
        public WaterInterface,
30
        public SetupResourceUnitInterface
641 werner 31
{
32
    Q_OBJECT
780 werner 33
    #if QT_VERSION >= 0x050000
34
    Q_PLUGIN_METADATA(IID "at.ac.boku.iland.fireplugin" FILE  "fireplugin.json")
35
    #endif
646 werner 36
    Q_INTERFACES(DisturbanceInterface WaterInterface SetupResourceUnitInterface)
641 werner 37
 
780 werner 38
 
641 werner 39
public:
40
    FirePlugin();
645 werner 41
    // general interface details
641 werner 42
    QString name(); ///< a unique name of the plugin
43
    QString version(); ///< a version identification
44
    QString description(); ///< some additional description. This info is shown in the GUI and is printed to the log file.
45
 
646 werner 46
    // setup
47
    /// setup after the main iLand model frame is created
665 werner 48
    void setup();
646 werner 49
    /// setup resource unit specific parameters
50
    void setupResourceUnit(const ResourceUnit *ru) { mFire.setup(ru);}
674 werner 51
    /// setup additional javascript related features
793 werner 52
    void setupScripting(QJSEngine *engine);
646 werner 53
 
674 werner 54
 
649 werner 55
    // calculations
56
    void yearBegin() { mFire.yearBegin(); }
57
    void run() { mFire.run(); }
645 werner 58
    // access to water data
646 werner 59
    void calculateWater(const ResourceUnit *resource_unit, const WaterCycleData *water_data) {mFire.calculateDroughtIndex(resource_unit, water_data); }
645 werner 60
 
652 werner 61
    // special functions for direct access (testing)
62
    FireModule *fireModule() { return &mFire; }
646 werner 63
private:
64
    FireModule mFire;
641 werner 65
};
66
 
67
#endif // FIREPLUGIN_H