diff options
| author | mrwastl <mrwastl@users.sourceforge.net> | 2011-05-12 00:54:19 +0200 |
|---|---|---|
| committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-05-12 00:54:19 +0200 |
| commit | 9f56ff279316b1d82d5639e47d587a37dbd6b0c8 (patch) | |
| tree | 2cf3213ec048bde596606e530dd255016d1d39c4 /glcdskin/variable.c | |
| parent | b6ca1969785782cf4d6e58f78563804e6812b3e6 (diff) | |
| download | graphlcd-base-9f56ff279316b1d82d5639e47d587a37dbd6b0c8.tar.gz graphlcd-base-9f56ff279316b1d82d5639e47d587a37dbd6b0c8.tar.bz2 | |
variable values that represent functions are now evaluated at run time
Diffstat (limited to 'glcdskin/variable.c')
| -rw-r--r-- | glcdskin/variable.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/glcdskin/variable.c b/glcdskin/variable.c index b07773a..3bd6e29 100644 --- a/glcdskin/variable.c +++ b/glcdskin/variable.c @@ -11,6 +11,7 @@ cSkinVariable::cSkinVariable(cSkin * Parent) : mSkin(Parent), mValue(0), mCondition(NULL), + mFunction(NULL), mDummyDisplay(mSkin), mDummyObject(&mDummyDisplay) { @@ -20,14 +21,16 @@ bool cSkinVariable::ParseValue(const std::string & Text) { if (isalpha(Text[0]) || Text[0] == '#') { - cSkinFunction * func = new cSkinFunction(&mDummyObject); - if (func->Parse(Text)) + delete mFunction; + mFunction = new cSkinFunction(&mDummyObject); + if (mFunction->Parse(Text)) { - mValue = func->Evaluate(); - delete func; + //mValue = func->Evaluate(); + //delete func; return true; } - delete func; + delete mFunction; + mFunction = NULL; } else if (Text[0] == '\'') { |
