20#ifndef BARKBEETLESCRIPT_H
21#define BARKBEETLESCRIPT_H
40 QJSValue
onClick()
const {
return mOnClick; }
41 void setOnClick(QJSValue handler) { mOnClick = handler; }
50 void test(QString value);
52 void init(QJSValue fun);
53 void run(QJSValue fun);
63 void runBB(
int iteration);
65 bool gridToFile(QString type, QString filename);
68 QJSValue
grid(QString type);
The BarkBeetleModule class is the main class of the bark beetle module.
Definition: barkbeetlemodule.h:135
BarkBeetleScript is the scripting shell for the bark beetle module.
Definition: barkbeetlescript.h:31
bool gridToFile(QString type, QString filename)
Definition: barkbeetlescript.cpp:128
double pixelValue(int ix, int iy)
Definition: barkbeetlescript.cpp:76
void reloadSettings()
reload the BB-Module settings from the XML-File
Definition: barkbeetlescript.cpp:102
void setEnabled(bool do_set_enable)
Definition: barkbeetlescript.cpp:274
void clear()
reset the barkbeetle module (clear damage and spread data - makes only sense if in simulation mode)
Definition: barkbeetlescript.cpp:120
void run(QJSValue fun)
Definition: barkbeetlescript.cpp:61
bool setInfested(int x, int y)
initiate damage sets pixel at (x/y) (grid indices) as infested, return true if pixel was a potential ...
Definition: barkbeetlescript.cpp:205
void test(QString value)
Definition: barkbeetlescript.cpp:40
int setInfestedFromMap(MapGridWrapper *grid, int key, double probability, int agerange)
set all pixels on stand 'key' on the map 'grid' (with probability 'probability') as infested
Definition: barkbeetlescript.cpp:219
BarkBeetleScript(QObject *parent=0)
Definition: barkbeetlescript.cpp:35
void setPixelValue(int ix, int iy, double val)
Definition: barkbeetlescript.cpp:85
void init(QJSValue fun)
Definition: barkbeetlescript.cpp:45
QJSValue onClick
Definition: barkbeetlescript.h:33
void runBB(int iteration)
run a full cycle of the bark beetle module
Definition: barkbeetlescript.cpp:113
bool enabled
Definition: barkbeetlescript.h:35
int damagedArea(int threshold, QString fileName)
number of damaged pixels with a patchsize>'threshold'; save to grid to "fileName" (if not empty)
Definition: barkbeetlescript.cpp:162
void setOnClick(QJSValue handler)
Definition: barkbeetlescript.h:41
bool simulate
Definition: barkbeetlescript.h:34
QJSValue grid(QString type)
get a JS representation of the grid given by 'type'
Definition: barkbeetlescript.cpp:150
void setSimulate(bool do_simulate)
Definition: barkbeetlescript.cpp:264
int clearInfestedPixels(QJSValue standmap, int stand_id, double fraction)
clear the 'infested' flags on the stand 'stand_id' (on the given 'standmap').
Definition: barkbeetlescript.cpp:180
QJSValue onClick() const
Definition: barkbeetlescript.h:40
double generations(int ix, int iy)
access the number of bark beetle generation at position ix/iy (indices on the 10m grid)
Definition: barkbeetlescript.cpp:92
void setBBModule(BarkBeetleModule *module)
Definition: barkbeetlescript.h:39
void newYear()
start a new "year" (not synced with iLand clock)
Definition: barkbeetlescript.cpp:107
Definition: scriptglobal.h:31