Commit Graph

5576 Commits

Author SHA1 Message Date
Alejandro Martinez
7f361ff48d Show field name in Calendar Text when field type is not text
Fixes #1524
2015-08-19 21:28:15 -03:00
Mark Liversedge
5a932ee435 Add brace balancing in Filter Editor
.. for finding partner parenthesis
.. for showing unbalance parenthesis
2015-08-19 22:23:30 +01:00
Mark Liversedge
4cd007ddf2 Fix Syntax Highlighting
.. distinct from parser now, so not susceptible
   to parsing / syntax errors in formula.

.. still need to do brace matching.
2015-08-19 21:02:08 +01:00
Mark Liversedge
5cca6cd259 Deprecate parser syntax highlighting
.. but do continue to highlight bad symbols etc
   with a red wavy line.

.. still need to;
   a) syntax highlight in the formula edit (just symbols
      and literals, not parsing content)

   b) add an error navigator to click on errors and have the
      text highlighted that incurred that error.
2015-08-19 12:50:38 +01:00
Mark Liversedge
3f0e751a1f Merge pull request #1518 from amtriathlon/master
Fixed comparison operator precedence
2015-08-18 20:15:40 +01:00
Alejandro Martinez
135bb3e1a5 Fixed comparison operator precedence
Adding a comparison expression cexpr and separate productions
for each operator allows to define precedence rules to remove
all shift-reduce conflicts, except one due to the -probably
harmless- (expr) and (lexpr) ambiguity.
2015-08-17 22:05:49 -03:00
Mark Liversedge
a9d6fcab75 Fix DataFilter regression
.. the daterange() commit broke almost every builtin
   function ! (it converted them to integers due to
   and if/else logic error.

.. also tidied parser to separate literals and symbols
   whilst making builtin functions expr elements to
   look more closely at precedence
2015-08-17 22:00:15 +01:00
Mark Liversedge
063f986b5f Merge pull request #1517 from amtriathlon/master
Fixed POW precedence and dangling else ambiguity
2015-08-17 21:41:21 +01:00
Alejandro Martinez
c254161099 Fixed POW precedence and dangling else ambiguity
Now 2*2^3+1 gives 17 instead of 65
expr1 ? expr2 ? expr3 : expr 4 : expr 5 is disambiguated to expr1 ? (expr2 ? expr3 : expr 4) : expr 5
Lowers shift/reduce conflitcs to 21
2015-08-17 17:30:11 -03:00
Mark Liversedge
ff55ce3046 expr needs '(' ')' too
.. thought it could be resolved within the lexpr
   definition but it is used to control arithmetic
   operations as well as logical ones.
2015-08-17 18:54:22 +01:00
Mark Liversedge
e89d9efcab Fixup Logical Expressions and Precedence
.. TSS > 100 ? 0 : 1 now works properly and the
   related precedence for logical expression
   are in order now.

.. still have 34 shift/reduce warnings !
2015-08-17 16:50:57 +01:00
Mark Liversedge
a460e6c40e Fixup unary '-'
.. so date-9 is not treated as "date" "-9" but
   instead as "date" "-" "9"
2015-08-17 15:21:24 +01:00
Mark Liversedge
8852ad513a Fixup Operator Precedence
.. but still have yacc warnings

.. unary '-' is still a problem.
2015-08-17 14:04:32 +01:00
Mark Liversedge
cc628d6ce6 Syntax highlighting from parser
.. oopsie on binary expression.

NOTE: it may be better to highlight tokens rather than
      via the parser as errors make it impossible to
      highlight the "intention" of the user
2015-08-16 22:24:49 +01:00
Mark Liversedge
54c225b0fa Slightly larger filter box on MainWindow
.. but only when in focus.
2015-08-16 20:29:50 +01:00
Mark Liversedge
0e9d0c06f7 Formula sum, mean, max, min, count functions
Particularly useful when working with a vector
but can be used with other things.

e.g. max(xPower, BikeScore)

Or, for getting a ride's TSS expressed as a percentage
of the average TSS for the currently selected daterange.

e.g. TSS / mean(TSS[daterange(start):daterange(stop)])
2015-08-16 19:49:16 +01:00
Mark Liversedge
73dfbb0dd8 Formula Editor error highlighting
.. using red wiggly line

.. still need to find a way of providing the
   parsing errors messages and navigating to
   the part they are complaining about.
2015-08-16 18:32:32 +01:00
Mark Liversedge
35448bdc6a Formula Vectors
You can create a vector using the notation:

   expr [ from : to ]

   Where 'expr' will be evaluated for every activity
   between the dates from and to.

   e.g. TSS[today - 90 : today]

   will evaluate to TSS for the last 90 days

   e.g. Activities [ date:date ] > 1

   Will find all days with more than one workout.

.. when using a vector in any arithmetic expression it
   will be evaluated to a sum; this will be fixed shortly
   to enable the use of sum/mean/max/min functions.

.. If needed we can add vector operations but this will
   likely confuse many users (hell, they confuse developers)
   so we will need a good reason to add them !

Lastly, I have also added daterange(from) and daterange(to)
literals to get access to the currently selected daterange
when working in the trends view.
2015-08-16 17:23:46 +01:00
Mark Liversedge
17543e061f Merge pull request #1515 from amtriathlon/master
Minor fixes
2015-08-16 15:50:16 +01:00
Alejandro Martinez
94586ae438 Added a reference for Daniels/Gilbert VDOT formula 2015-08-16 11:10:08 -03:00
Alejandro Martinez
d8b92afaca Fixed Energy Expenditure chart for imperial units 2015-08-16 11:09:18 -03:00
Mark Liversedge
84053c8dca Formula Editor Improvements 1 of 2
.. update the editor to do some basic syntax
   highlighting; literals in red, comments in
   blue and so on.

.. next commit will focus on highlighting errors
   with a wavy line and some form of error list.
2015-08-15 23:47:04 +01:00
Mark Liversedge
ecce7ad19f Merge pull request #1514 from amtriathlon/master
More example charts SWOLF and Energy Expenditure
2015-08-15 23:37:50 +01:00
Alejandro Martinez
b88983bd81 More example charts SWOLF and Energy Expenditure 2015-08-15 19:35:22 -03:00
Mark Liversedge
738277561d Merge pull request #1513 from amtriathlon/master
Minor changes for DataFilter to compile on MinGW
2015-08-15 15:51:21 +01:00
Alejandro Martinez
5649575b2d Minor changes for DataFilter to compile on MinGW 2015-08-15 11:46:32 -03:00
Alejandro Martinez
b607d5bbf7 Added sample charts using formulas for VDOT and sTSS 2015-08-15 11:45:24 -03:00
Mark Liversedge
7728b3fabf DataFilter Functions and "math"
.. updated the datafilter to handle general functions
   and parse them without needing them declared in the lexer

.. makes it much easier to add new functions in the future

.. did this to add core math functions;
   *  sin, cos, tan, asin, acos, atan,
   *  sinh, cosh, tanh, asinh, acosh, atanh
   *  exp, log, log10, ceil, floor, round
   *  fabs, isinf, isnan

.. we can add more later; erf/gamma spring to mind !
2015-08-15 14:17:53 +01:00
Mark Liversedge
2e2e9c39e7 Formula const()
.. for pi and e, we can add more later
   i.e. const(pi) and const(e) return high
   precision values for both
2015-08-15 10:33:09 +01:00
Mark Liversedge
b5ce92a045 Formula config() function and test charts
.. added config(cv) .. config(pmax) etc

.. also added some test charts including one that
   just displays configuration
2015-08-14 22:10:29 +01:00
Mark Liversedge
b7dabef8ea Bests need curve filtering applied
.. but only if needed !
2015-08-14 12:40:48 +01:00
Mark Liversedge
1d90ec32da LTM Filter for a curve
.. allow the data selected for a curve to filter
   as well. So you can e.g. plot duration riding vs
   duration biking on the same plot.
2015-08-14 11:23:53 +01:00
Mark Liversedge
9693b85b1f Library LTM Chart subtitle
.. changes when using a preset.
2015-08-14 08:24:32 +01:00
Mark Liversedge
075f97c713 Formula Running Total
.. so can accumulate e.g. time and distance
2015-08-14 08:13:53 +01:00
Mark Liversedge
3156c1e111 Add DataFilter functions to autocomplete list
.. so you get best(), tiz(), lts() et al
   popup in the autocompleter.
2015-08-13 23:09:48 +01:00
grauser
7b401ce19e AnalysisSidebar: Rename Route
fix #1430
2015-08-13 22:25:54 +02:00
Mark Liversedge
dde01c0bfe Fix SEGV LTM Edit
.. when using Moving Average trend.
2015-08-13 17:38:07 +01:00
Mark Liversedge
4d63727cc2 Formula Aggregation Type
.. is it Peak, Average, Max, Total to control how
   values are aggregated.
2015-08-13 17:07:51 +01:00
Mark Liversedge
21058d5480 Merge pull request #1512 from amtriathlon/VDOTCalculator
VDOT and T-Pace Calculator
2015-08-13 16:31:45 +01:00
Alejandro Martinez
148cab11a5 VDOT and T-Pace Calculator
An alternative tool to estimate threshold pace for running
2015-08-13 12:29:27 -03:00
Mark Liversedge
d3411420cc Formula Editor Completer
.. edit formulas on LTM tool with autocompletion
   but not when in comments.
2015-08-13 13:53:18 +01:00
Mark Liversedge
480c9d0d04 LTM Plot Formula Part 2 of 2
.. added to LTMPlot and DataFilter methods

.. very rough and ready, but works.

.. can refine and enhance now basics are in place.
2015-08-13 12:35:17 +01:00
Mark Liversedge
def8c989f1 LTM Plot Formula Part 1 of 2
.. added to settings and chart configuration
2015-08-13 11:33:17 +01:00
Mark Liversedge
270da50d3f DataFilter Comments with '#'
.. just one line comments to help explain when
   writing more complex types of expressions
2015-08-13 10:16:52 +01:00
Mark Liversedge
6f37b208b3 DataFilter Conditional Expression
.. uses the C/C++ notation:

   expr ? expr2 : expr3

   Where expr is the condition e.g. X>2
   and expr2 is what to evaluate to if expr is true
   and expr3 is what to evaluate to if expr is false

   e.g.

   (Workout_Code = "1L3") ? 1 : 0

   Will evaluate as 1 for all workouts where the
   workout code is 1L3 and 0 for all other workouts.
2015-08-13 09:24:26 +01:00
Mark Liversedge
6c2cb6d73b Enhanced DataFilter Completion
.. now will repeat completion beyond the very
   first word on the line

.. needs to be enhanced to work when not at the
   end of the text (i.e. cursor move)
2015-08-13 07:38:22 +01:00
Mark Liversedge
8b65975ff5 Fix exit SEGV on SearchBox
.. resize event was checking menu icon, which was never
   going to change due to a resize event.

.. it crashed during window exit since it dereferenced objects
   that had been deleted.
2015-08-12 23:16:58 +01:00
Mark Liversedge
477e2ff613 Fix QCompleter Crash
.. still only works for first typing and will fix
   that, but no longer crashes on change mode from
   named search.
2015-08-12 17:35:38 +01:00
Mark Liversedge
5a0499c22c Disable Searchbox completer
.. for now, it crashes occasionally due to cross-thread
   issues, and doesn't work across the text anyway.
   will make it permanently associated by not active
   when in search mode.
2015-08-12 13:34:57 +01:00
Mark Liversedge
122283fe65 MainWindow search box animation
.. expand when active since we're gonna get funky
   with it in v4.0
2015-08-12 13:31:43 +01:00