iLand
Public Slots | Public Member Functions | Properties | List of all members
BarkBeetleScript Class Reference

BarkBeetleScript is the scripting shell for the bark beetle module. More...

#include <barkbeetlescript.h>

Inheritance diagram for BarkBeetleScript:

Public Slots

void test (QString value)
 
void init (QJSValue fun)
 
void run (QJSValue fun)
 
double pixelValue (int ix, int iy)
 
void setPixelValue (int ix, int iy, double val)
 
double generations (int ix, int iy)
 access the number of bark beetle generation at position ix/iy (indices on the 10m grid) More...
 
void reloadSettings ()
 reload the BB-Module settings from the XML-File More...
 
void newYear ()
 start a new "year" (not synced with iLand clock) More...
 
void runBB (int iteration)
 run a full cycle of the bark beetle module More...
 
void clear ()
 reset the barkbeetle module (clear damage and spread data - makes only sense if in simulation mode) More...
 
bool gridToFile (QString type, QString filename)
 
QJSValue grid (QString type)
 get a JS representation of the grid given by 'type' More...
 
int damagedArea (int threshold, QString fileName)
 number of damaged pixels with a patchsize>'threshold'; save to grid to "fileName" (if not empty) More...
 
int clearInfestedPixels (QJSValue standmap, int stand_id, double fraction)
 clear the 'infested' flags on the stand 'stand_id' (on the given 'standmap'). More...
 
bool setInfested (int x, int y)
 initiate damage sets pixel at (x/y) (grid indices) as infested, return true if pixel was a potential host pixel More...
 
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 More...
 

Public Member Functions

 BarkBeetleScript (QObject *parent=0)
 
void setBBModule (BarkBeetleModule *module)
 
QJSValue onClick () const
 
void setOnClick (QJSValue handler)
 
bool simulate ()
 
void setSimulate (bool do_simulate)
 
bool enabled ()
 
void setEnabled (bool do_set_enable)
 

Properties

QJSValue onClick
 
bool simulate
 
bool enabled
 

Detailed Description

BarkBeetleScript is the scripting shell for the bark beetle module.

Constructor & Destructor Documentation

◆ BarkBeetleScript()

BarkBeetleScript::BarkBeetleScript ( QObject *  parent = 0)
explicit

Member Function Documentation

◆ clear

void BarkBeetleScript::clear ( )
slot

reset the barkbeetle module (clear damage and spread data - makes only sense if in simulation mode)

◆ clearInfestedPixels

int BarkBeetleScript::clearInfestedPixels ( QJSValue  standmap,
int  stand_id,
double  fraction 
)
slot

clear the 'infested' flags on the stand 'stand_id' (on the given 'standmap').

this does not remove trees!

◆ damagedArea

int BarkBeetleScript::damagedArea ( int  threshold,
QString  fileName 
)
slot

number of damaged pixels with a patchsize>'threshold'; save to grid to "fileName" (if not empty)

◆ enabled()

bool BarkBeetleScript::enabled ( )

◆ generations

double BarkBeetleScript::generations ( int  ix,
int  iy 
)
slot

access the number of bark beetle generation at position ix/iy (indices on the 10m grid)

◆ grid

QJSValue BarkBeetleScript::grid ( QString  type)
slot

get a JS representation of the grid given by 'type'

◆ gridToFile

bool BarkBeetleScript::gridToFile ( QString  type,
QString  filename 
)
slot

◆ init

void BarkBeetleScript::init ( QJSValue  fun)
slot

◆ newYear

void BarkBeetleScript::newYear ( )
slot

start a new "year" (not synced with iLand clock)

◆ onClick()

QJSValue BarkBeetleScript::onClick ( ) const
inline

◆ pixelValue

double BarkBeetleScript::pixelValue ( int  ix,
int  iy 
)
slot

◆ reloadSettings

void BarkBeetleScript::reloadSettings ( )
slot

reload the BB-Module settings from the XML-File

◆ run

void BarkBeetleScript::run ( QJSValue  fun)
slot

◆ runBB

void BarkBeetleScript::runBB ( int  iteration)
slot

run a full cycle of the bark beetle module

◆ setBBModule()

void BarkBeetleScript::setBBModule ( BarkBeetleModule module)
inline

◆ setEnabled()

void BarkBeetleScript::setEnabled ( bool  do_set_enable)

◆ setInfested

bool BarkBeetleScript::setInfested ( int  x,
int  y 
)
slot

initiate damage sets pixel at (x/y) (grid indices) as infested, return true if pixel was a potential host pixel

◆ setInfestedFromMap

int BarkBeetleScript::setInfestedFromMap ( MapGridWrapper grid,
int  key,
double  probability,
int  agerange 
)
slot

set all pixels on stand 'key' on the map 'grid' (with probability 'probability') as infested

◆ setOnClick()

void BarkBeetleScript::setOnClick ( QJSValue  handler)
inline

◆ setPixelValue

void BarkBeetleScript::setPixelValue ( int  ix,
int  iy,
double  val 
)
slot

◆ setSimulate()

void BarkBeetleScript::setSimulate ( bool  do_simulate)

◆ simulate()

bool BarkBeetleScript::simulate ( )

◆ test

void BarkBeetleScript::test ( QString  value)
slot

Property Documentation

◆ enabled

bool BarkBeetleScript::enabled
readwrite

◆ onClick

QJSValue BarkBeetleScript::onClick
readwrite

◆ simulate

bool BarkBeetleScript::simulate
readwrite

The documentation for this class was generated from the following files: