iLand
Public Member Functions | Static Public Member Functions | List of all members

The FMSTP class encapsulates a stand treatment program, which is defined in Javascript. More...

#include <fmstp.h>

Public Member Functions

 FMSTP ()
 
 ~FMSTP ()
 
const QString & name () const
 
Activityactivity (const QString &name) const
 returns the (first) Activity with the name 'name', or 0 if the activity could not be found. More...
 
int activityIndex (Activity *act)
 
void setup (QJSValue &js_value, const QString name=QString())
 read the options from a javascript structure / object More...
 
QVector< ActivityFlagsdefaultFlags ()
 defaultFlags() is used to initalized the flags for indiv. forest stands More...
 
Eventsevents ()
 
QJSValue * JSoptions ()
 
int rotationLengthOfType (const int type)
 rotation length (years) More...
 
int rotationLengthType (const int length) const
 
ActSalvagesalvageActivity () const
 
bool executeRepeatingActivities (FMStand *stand)
 run repeating activities More...
 
void evaluateDynamicExpressions (FMStand *stand)
 evaluate bound expressions for all activities of the STP for the given stand More...
 
void dumpInfo ()
 

Static Public Member Functions

static void setVerbose (bool verbose)
 if verbose is true, detailed debug information is provided. More...
 
static bool verbose ()
 returns true in debug mode More...
 
static QJSValue valueFromJs (const QJSValue &js_value, const QString &key, const QString default_value=QString(), const QString &errorMessage=QString())
 get a property of 'js_value' with the name 'key'. More...
 
static bool boolValueFromJs (const QJSValue &js_value, const QString &key, const bool default_bool_value, const QString &errorMessage=QString())
 
static bool checkObjectProperties (const QJSValue &js_value, const QStringList &allowed_properties, const QString &errorMessage=QString())
 
static QJSValue evaluateJS (QJSValue value)
 

Detailed Description

The FMSTP class encapsulates a stand treatment program, which is defined in Javascript.

Constructor & Destructor Documentation

◆ FMSTP()

ABE::FMSTP::FMSTP ( )

◆ ~FMSTP()

ABE::FMSTP::~FMSTP ( )

Member Function Documentation

◆ activity()

Activity * ABE::FMSTP::activity ( const QString &  name) const

returns the (first) Activity with the name 'name', or 0 if the activity could not be found.

◆ activityIndex()

int ABE::FMSTP::activityIndex ( Activity act)
inline

◆ boolValueFromJs()

bool ABE::FMSTP::boolValueFromJs ( const QJSValue &  js_value,
const QString &  key,
const bool  default_bool_value,
const QString &  errorMessage = QString() 
)
static

◆ checkObjectProperties()

bool ABE::FMSTP::checkObjectProperties ( const QJSValue &  js_value,
const QStringList &  allowed_properties,
const QString &  errorMessage = QString() 
)
static

◆ defaultFlags()

QVector< ActivityFlags > ABE::FMSTP::defaultFlags ( )
inline

defaultFlags() is used to initalized the flags for indiv. forest stands

◆ dumpInfo()

void ABE::FMSTP::dumpInfo ( )

◆ evaluateDynamicExpressions()

void ABE::FMSTP::evaluateDynamicExpressions ( FMStand stand)

evaluate bound expressions for all activities of the STP for the given stand

◆ evaluateJS()

QJSValue ABE::FMSTP::evaluateJS ( QJSValue  value)
static

◆ events()

Events & ABE::FMSTP::events ( )
inline

◆ executeRepeatingActivities()

bool ABE::FMSTP::executeRepeatingActivities ( FMStand stand)

run repeating activities

◆ JSoptions()

QJSValue * ABE::FMSTP::JSoptions ( )
inline

◆ name()

const QString & ABE::FMSTP::name ( ) const
inline

◆ rotationLengthOfType()

int ABE::FMSTP::rotationLengthOfType ( const int  type)
inline

rotation length (years)

◆ rotationLengthType()

int ABE::FMSTP::rotationLengthType ( const int  length) const
inline

◆ salvageActivity()

ActSalvage * ABE::FMSTP::salvageActivity ( ) const
inline

◆ setup()

void ABE::FMSTP::setup ( QJSValue &  js_value,
const QString  name = QString() 
)

read the options from a javascript structure / object

◆ setVerbose()

static void ABE::FMSTP::setVerbose ( bool  verbose)
inlinestatic

if verbose is true, detailed debug information is provided.

◆ valueFromJs()

QJSValue ABE::FMSTP::valueFromJs ( const QJSValue &  js_value,
const QString &  key,
const QString  default_value = QString(),
const QString &  errorMessage = QString() 
)
static

get a property of 'js_value' with the name 'key'.

If 'errorMessage' is given, an error is thrown when the key does not exist. If key is not present and a 'default_value' is given, it is returned. Otherwise, an "undefined" JS value is returned.

◆ verbose()

static bool ABE::FMSTP::verbose ( )
inlinestatic

returns true in debug mode


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