Skip to content
Permalink
Browse files

Add support for Device symbol on filters but disable set/unset/isset (#…

…3233)

Currently Device does not work on filters and set/unset/isset fail silently,
with this change Device can be used in filters as standard metadata and
the attempt to use in set/unset/isset reports an appropriate error.
We could enable these operations in the future but they require special casing.
  • Loading branch information
amtriathlon committed Nov 29, 2019
1 parent 2b291f2 commit cc633a7802f7e041e02ca9bad5026779b79c80de
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/Core/DataFilter.cpp
@@ -1303,6 +1303,7 @@ void Leaf::validateFilter(Context *context, DataFilterRuntime *df, Leaf *leaf)
!symbol.compare("Today", Qt::CaseInsensitive) ||
!symbol.compare("Current", Qt::CaseInsensitive) ||
!symbol.compare("RECINTSECS", Qt::CaseInsensitive) ||
!symbol.compare("Device", Qt::CaseInsensitive) ||
!symbol.compare("NA", Qt::CaseInsensitive) ||
df->dataSeriesSymbols.contains(symbol) ||
symbol == "isSwim" || symbol == "isRun" || isCoggan(symbol)) {
@@ -2659,6 +2660,10 @@ Result Leaf::eval(DataFilterRuntime *df, Leaf *leaf, float x, RideItem *m, RideF
if (m->ride(false)) lhsdouble = m->ride(false)->recIntSecs();
lhsisNumber = true;

} else if (!symbol.compare("Device", Qt::CaseInsensitive)) {

if (m->ride(false)) lhsstring = m->ride(false)->deviceType();

} else if (!symbol.compare("Current", Qt::CaseInsensitive)) {

if (m->context->currentRideItem())

0 comments on commit cc633a7

Please sign in to comment.
You can’t perform that action at this time.