43 const QString &
name()
const {
return mName; }
49 void setup(QJSValue &js_value,
const QString
name=QString());
56 int rotationLengthOfType(
const int type) {
if (type>0 && type<4)
return mRotationLength[type-1];
return 0;}
57 int rotationLengthType(
const int length)
const {
for (
int i=0;i<3;++i)
if (mRotationLength[i]==length)
return i+1;
return -1; }
72 static QJSValue
valueFromJs(
const QJSValue &js_value,
const QString &key,
const QString default_value=QString(),
const QString &errorMessage=QString());
73 static bool boolValueFromJs(
const QJSValue &js_value,
const QString &key,
const bool default_bool_value,
const QString &errorMessage=QString());
75 static bool checkObjectProperties(
const QJSValue &js_value,
const QStringList &allowed_properties,
const QString &errorMessage=QString());
80 void internalSetup(
const QJSValue &js_value,
int level=0);
82 void setupActivity(
const QJSValue &js_value,
const QString &
name);
86 bool mHasRepeatingActivities;
87 QVector<Activity*> mActivities;
88 QVector<ActivityFlags> mActivityStand;
89 QStringList mActivityNames;
94 int mRotationLength[3];
The ActSalvage class handles salvage logging after disturbances.
Definition: actsalvage.h:33
Activity is the base class for management activities.
Definition: activity.h:162
Definition: activity.h:64
The FMSTP class encapsulates a stand treatment program, which is defined in Javascript.
Definition: fmstp.h:39
int activityIndex(Activity *act)
Definition: fmstp.h:46
const QString & name() const
Definition: fmstp.h:43
static bool checkObjectProperties(const QJSValue &js_value, const QStringList &allowed_properties, const QString &errorMessage=QString())
Definition: fmstp.cpp:247
bool executeRepeatingActivities(FMStand *stand)
run repeating activities
Definition: fmstp.cpp:101
static QJSValue evaluateJS(QJSValue value)
Definition: fmstp.cpp:261
void dumpInfo()
Definition: fmstp.cpp:176
Events & events()
Definition: fmstp.h:52
Activity * activity(const QString &name) const
returns the (first) Activity with the name 'name', or 0 if the activity could not be found.
Definition: fmstp.cpp:55
FMSTP()
Definition: fmstp.cpp:41
int rotationLengthType(const int length) const
Definition: fmstp.h:57
static bool verbose()
returns true in debug mode
Definition: fmstp.h:69
int rotationLengthOfType(const int type)
rotation length (years)
Definition: fmstp.h:56
~FMSTP()
Definition: fmstp.cpp:50
void evaluateDynamicExpressions(FMStand *stand)
evaluate bound expressions for all activities of the STP for the given stand
Definition: fmstp.cpp:123
static bool boolValueFromJs(const QJSValue &js_value, const QString &key, const bool default_bool_value, const QString &errorMessage=QString())
Definition: fmstp.cpp:235
static void setVerbose(bool verbose)
if verbose is true, detailed debug information is provided.
Definition: fmstp.h:68
ActSalvage * salvageActivity() const
Definition: fmstp.h:58
QVector< ActivityFlags > defaultFlags()
defaultFlags() is used to initalized the flags for indiv. forest stands
Definition: fmstp.h:51
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'.
Definition: fmstp.cpp:222
void setup(QJSValue &js_value, const QString name=QString())
read the options from a javascript structure / object
Definition: fmstp.cpp:68
QJSValue * JSoptions()
Definition: fmstp.h:53
FMStand encapsulates a forest stand for the forest management engine.
Definition: fmstand.h:49
An expression engine for mathematical expressions provided as strings.
Definition: expression.h:29