Calculated Fields

by camel

Downloads: 23,682 (9) • Reviews: 4

Version:

1.2.9.4

Updated:

Apr 11, 2011

Calculated Fields plugin: Formulas pool

Postby ebakke » Mon Nov 08, 2010 11:37 am

Peter,

Have the same problem as ricicarra, that some fields are empty after the calculation. Before current version I received the same error message.
I use {MAXPEAKTIME(Power,1200)}, which somehow return empty field for approx. 20 out of my 107 workouts this year.

Funny thing is that, after changing the number to below 4 digits (999), it works.

Can share one of the fitlog files if needed.
The workouts are all longer then 20 minutes.

thanks,
Erik
ebakke
 
Posts: 11
Joined: Thu Jan 29, 2009 3:47 am

Postby PissedOffCil » Mon Nov 08, 2010 12:08 pm

ebakke wrote:Peter,

Have the same problem as ricicarra, that some fields are empty after the calculation. Before current version I received the same error message.
I use {MAXPEAKTIME(Power,1200)}, which somehow return empty field for approx. 20 out of my 107 workouts this year.

Funny thing is that, after changing the number to below 4 digits (999), it works.

Can share one of the fitlog files if needed.
The workouts are all longer then 20 minutes.

thanks,
Erik


I won't find a peak if you have no continuous (no pauses) segments of 20 minutes.
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Mon Nov 08, 2010 2:30 pm

ebakke wrote:Peter,

Have the same problem as ricicarra, that some fields are empty after the calculation. Before current version I received the same error message.
I use {MAXPEAKTIME(Power,1200)}, which somehow return empty field for approx. 20 out of my 107 workouts this year.

Funny thing is that, after changing the number to below 4 digits (999), it works.

Can share one of the fitlog files if needed.
The workouts are all longer then 20 minutes.

thanks,
Erik


As POC has said, I'm sure that this is a problem of not continous peak.

For example if you have activity with
30 minutes running
1 second pause because your speed was below threshold of stopped speed
another 30minutes of running

Than plugin will not find peak for 40 minutes. Because there is no 40 minutes continuous running in your activity.

And I consider it as a cheating ;)

And that's a reason why it helped to set it to smaller value 999. Because you have 999 continuous time in your activity.

Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby Ruskie » Mon Nov 08, 2010 3:36 pm

OMG camel, lost sight for a week or so and the pool has grown to a lake!!!
You really need to stop coding a start writing a manual!!! :P
Ruskie
 
Posts: 120
Joined: Sun Mar 08, 2009 11:24 am

Postby camel » Mon Nov 08, 2010 3:44 pm

Ruskie wrote:OMG camel, lost sight for a week or so and the pool has grown to a lake!!!
You really need to stop coding a start writing a manual!!! :P


Most of things from plugin are described here:
http://code.google.com/p/calculatedfields/w/list

DataTrack feature is missing and Virtual fields with Nested expressions too, as far I know. But these things are advanced concept that standard user probably don't miss at all.

And FAQ probably too...

I will write them, but it's an painful process...

Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby Ruskie » Mon Nov 08, 2010 4:01 pm

I know, that's what I asked.. bwahahahahahah!!! ;)
Ruskie
 
Posts: 120
Joined: Sun Mar 08, 2009 11:24 am

Postby PissedOffCil » Mon Nov 08, 2010 6:25 pm

With the latest version, my "general" decoupling factor doesn't work anymore

I think it has to do with virtual expressions.
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Tue Nov 09, 2010 1:39 am

PissedOffCil wrote:With the latest version, my "general" decoupling factor doesn't work anymore

I think it has to do with virtual expressions.


Just to be sure. I have tried it. And if you have those splits with notes on activity, all is working correctly. But I see an problem with virtual fields if their value cannot be calculated, than it's not very nicely handled by parser.

And exception is thrown, although only nothing may be calculated.

Am I correct or do you see something different?
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby camel » Tue Nov 09, 2010 2:16 am

camel wrote:
PissedOffCil wrote:With the latest version, my "general" decoupling factor doesn't work anymore

I think it has to do with virtual expressions.


Just to be sure. I have tried it. And if you have those splits with notes on activity, all is working correctly. But I see an problem with virtual fields if their value cannot be calculated, than it's not very nicely handled by parser.

And exception is thrown, although only nothing may be calculated.

Am I correct or do you see something different?


Hi I have added this build that may fix this problem 1.2.8.8:

http://calculatedfields.googlecode.com/files/CalculatedFields_1_2_8_8.st3plugin

ChangeLog:
Fixed error when virtual field condition is not fulfilled
Fixed error when virtual field expression returns empty string
Added possibility of writing whole programs as expressions

For POC:
As you have tried with your build I have added same possibility of writing whole programs as expressions. Code of build is not yet submitted, I don't have access to internet with notebook now.

Example:
@@DIRECT@@string test = "test123";return test;




This build is not yet published in standard way. So if you want to try it you need to download it manually.

Please tell if if all is working correctly I have tried it, but you know...

Thanks
Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby klemmi86 » Tue Nov 09, 2010 4:31 am

camel wrote:
Scorpion79 wrote:
camel wrote:
And my calculations from daniels formula looks like this:
(0.8 + 0.1894393 * Math.Exp(-0.012778 * ({DISTANCE}/{TIME}*60)) + 0.2989558 * Math.Exp(-0.1932605 * ({DISTANCE}/{TIME}*60)))


Hello,

I tried the VDOT-Formula from Scorpion79 with my data. I've found out, that die calculated VDOTs are higher than Daniel wrote in his tables.
For my example: a 10.000m run in 00:52:20 got a VDOT of 42. Daniel would give that run a VDOT of 39.5. So I tried to change the Expression:

1st:
I added a virtual calculated Field named "TODEC" with the expression:
(Convert.ToDecimal({TIME}))/86400
and die condition:
{DISTANCE}!=0
http://dl.dropbox.com/u/10352327/VDOT2.PNG
2nd:
I added a custom field named VDOT
http://dl.dropbox.com/u/10352327/VDOT3.PNG
3rd:
I did a new calculation for the field "VDOT" with the expression:
(-4.60 + 0.182258 * ({DISTANCE}/{TODEC}/1440) + 0.000104 * Math.Pow({DISTANCE}/{TODEC}/1440, 2)) / (0.8 + 0.1894393 * Math.Exp(-0.012778 * {TODEC}*1440) + 0.2989558 * Math.Exp(-0.1932605 * {TODEC}*1440))
and the condition:
{DISTANCE}!=0
http://dl.dropbox.com/u/10352327/VDOT4.PNG

now, I got VDOTs like in Daniel's "Running Formula"
klemmi86
 
Posts: 3
Joined: Tue Nov 09, 2010 4:17 am

Postby camel » Tue Nov 09, 2010 4:48 am

klemmi86 wrote:
camel wrote:
Scorpion79 wrote:
camel wrote:
And my calculations from daniels formula looks like this:
(0.8 + 0.1894393 * Math.Exp(-0.012778 * ({DISTANCE}/{TIME}*60)) + 0.2989558 * Math.Exp(-0.1932605 * ({DISTANCE}/{TIME}*60)))


Hello,

I tried the VDOT-Formula from Scorpion79 with my data. I've found out, that die calculated VDOTs are higher than Daniel wrote in his tables.
For my example: a 10.000m run in 00:52:20 got a VDOT of 42. Daniel would give that run a VDOT of 39.5. So I tried to change the Expression:

1st:
I added a virtual calculated Field named "TODEC" with the expression:
(Convert.ToDecimal({TIME}))/86400
and die condition:
{DISTANCE}!=0
http://dl.dropbox.com/u/10352327/VDOT2.PNG
2nd:
I added a custom field named VDOT
http://dl.dropbox.com/u/10352327/VDOT3.PNG
3rd:
I did a new calculation for the field "VDOT" with the expression:
(-4.60 + 0.182258 * ({DISTANCE}/{TODEC}/1440) + 0.000104 * Math.Pow({DISTANCE}/{TODEC}/1440, 2)) / (0.8 + 0.1894393 * Math.Exp(-0.012778 * {TODEC}*1440) + 0.2989558 * Math.Exp(-0.1932605 * {TODEC}*1440))
and the condition:
{DISTANCE}!=0
http://dl.dropbox.com/u/10352327/VDOT4.PNG

now, I got VDOTs like in Daniel's "Running Formula"


Impressing work thanks.

Just an one note, you could probably change your TODEC virtual field to nested expression. It will be faster to calculate.

Simply take TODEC definition as virtual field and write it in same way into nested expression. And use it in the same way.

Yes I know that I'm missing documentation for this :)

Simple explanation why:
Nested expressions are in fact macros. So they are only aliases that are expanded in main expressions.

Virtual expressions are calculated alone without main expression. So for virtual expression and standard expressions, plugin will make two compilations. For nested expression and standard expression only one compilation is needed.

I'm just starting writing of tutorial about it. Not very important of course for you, it will be only slightly faster.

Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby HENNES » Tue Nov 09, 2010 5:09 am

klemmi86 wrote:now, I got VDOTs like in Daniel's "Running Formula"


Willkommen in Forum! 8)




camel wrote:I'm just starting writing of tutorial about it.


Dont bother, I will not understand a word :lol: :lol: :lol: :lol:
rgds hennes
- kickbiking with FR 305 and STs 3

runner´s map ... EURE Karte für Laufveranstaltungen - zum MITMACHEN!!!
http://www.runnersmap.info
...mehr als DREI TAUSEND Laufveranstaltungen!
HENNES
Donated!
Donated!
 
Posts: 1158
Joined: Thu Feb 07, 2008 1:55 am
Location: Duesseldorf, Germany

Postby camel » Tue Nov 09, 2010 6:56 am

PissedOffCil wrote:With the latest version, my "general" decoupling factor doesn't work anymore

I think it has to do with virtual expressions.


Version 1.2.8.9 is released just update if you want

ChangeLog:
Added stopped time.
And fixes of virtual expressions are there too of course

Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby PissedOffCil » Tue Nov 09, 2010 7:51 am

camel wrote:
PissedOffCil wrote:With the latest version, my "general" decoupling factor doesn't work anymore

I think it has to do with virtual expressions.


Just to be sure. I have tried it. And if you have those splits with notes on activity, all is working correctly. But I see an problem with virtual fields if their value cannot be calculated, than it's not very nicely handled by parser.

And exception is thrown, although only nothing may be calculated.

Am I correct or do you see something different?


I'm not sure. I get a parsing error wth regards to "{" on lines that use virt. expr. I didn't try on a specific activity
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby klemmi86 » Tue Nov 09, 2010 8:51 am

camel wrote:
klemmi86 wrote:
camel wrote:
Scorpion79 wrote:
camel wrote:

Just an one note, you could probably change your TODEC virtual field to nested expression. It will be faster to calculate.

...

Virtual expressions are calculated alone without main expression. So for virtual expression and standard expressions, plugin will make two compilations. For nested expression and standard expression only one compilation is needed.

I'm just starting writing of tutorial about it. Not very important of course for you, it will be only slightly faster.

Peter


Hi Peter,

I tried to use the nested fields, but in fact of using a decimal-string there is no possibility to use the operator "/". At least, the Debugger told me..

http://dl.dropbox.com/u/10352327/vdot5.PNG

Do you have any idea to get this fixed?

Daniel
klemmi86
 
Posts: 3
Joined: Tue Nov 09, 2010 4:17 am

Postby PissedOffCil » Tue Nov 09, 2010 9:08 am

klemmi86 wrote:Hi Peter,

I tried to use the nested fields, but in fact of using a decimal-string there is no possibility to use the operator "/". At least, the Debugger told me..

http://dl.dropbox.com/u/10352327/vdot5.PNG

Do you have any idea to get this fixed?

Daniel


Instead of
Convert.ToDecimal(4798)/86400/1440
use
4798.0/86400.0/1440.0

Adding ".0" makes it a double just like adding f makes it a float
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby klemmi86 » Tue Nov 09, 2010 10:31 am

PissedOffCil wrote:
klemmi86 wrote:Instead of
Convert.ToDecimal(4798)/86400/1440
use
4798.0/86400.0/1440.0

Adding ".0" makes it a double just like adding f makes it a float


That would be OK, but the 4798 came from Convert.ToDecimal({TIME}).
If I wouldn't convert {TIME} to decimal, CF would just give out: "hh:mm:ss", wouldn't it? It is a bit tricky for me. I never "programmed" more than "hello world"... :?
klemmi86
 
Posts: 3
Joined: Tue Nov 09, 2010 4:17 am

Postby GaryS » Tue Nov 09, 2010 10:38 am

camel wrote:
Version 1.2.8.9 is released just update if you want

ChangeLog:
Added stopped time.
And fixes of virtual expressions are there too of course

Peter


Is there any possibility of adding a field for 'watch pauses', the time after one presses stop on the watch (or has 'autopause' enabled) and before one presses start again?

I find 'stopped time' unreliable on trails due to lost sat signal, tunnels, switchbacks, etc. that have nothing to do with me actually stopping running.

I often use watch pauses to stop time while waiting for running partners, or stopping for water. While I can show the stop in ST, and manually add up the time, it would be great if the plugin could calculate that for me.
GaryS
Donated!
Donated!
 
Posts: 77
Joined: Thu Jan 21, 2010 6:25 pm

Postby PissedOffCil » Tue Nov 09, 2010 12:40 pm

klemmi86 wrote:That would be OK, but the 4798 came from Convert.ToDecimal({TIME}).
If I wouldn't convert {TIME} to decimal, CF would just give out: "hh:mm:ss", wouldn't it? It is a bit tricky for me. I never "programmed" more than "hello world"... :?


Use "((double){TIME})" instead then.
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Tue Nov 09, 2010 4:32 pm

GaryS wrote:
camel wrote:
Version 1.2.8.9 is released just update if you want

ChangeLog:
Added stopped time.
And fixes of virtual expressions are there too of course

Peter


Is there any possibility of adding a field for 'watch pauses', the time after one presses stop on the watch (or has 'autopause' enabled) and before one presses start again?

I find 'stopped time' unreliable on trails due to lost sat signal, tunnels, switchbacks, etc. that have nothing to do with me actually stopping running.

I often use watch pauses to stop time while waiting for running partners, or stopping for water. While I can show the stop in ST, and manually add up the time, it would be great if the plugin could calculate that for me.


I think that this information is supported in API so I can add it probably in next version.

Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby camel » Tue Nov 09, 2010 4:34 pm

PissedOffCil wrote:
camel wrote:
PissedOffCil wrote:With the latest version, my "general" decoupling factor doesn't work anymore

I think it has to do with virtual expressions.


Just to be sure. I have tried it. And if you have those splits with notes on activity, all is working correctly. But I see an problem with virtual fields if their value cannot be calculated, than it's not very nicely handled by parser.

And exception is thrown, although only nothing may be calculated.

Am I correct or do you see something different?


I'm not sure. I get a parsing error wth regards to "{" on lines that use virt. expr. I didn't try on a specific activity


Could you send me please formulas to email. Because I have tried to construct your generic formulas for decoupling when testing this fix. And it was working nicely.

Or have you solved it?

THanks
Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby PissedOffCil » Tue Nov 09, 2010 4:47 pm

I didn't try with yesterday's build
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Tue Nov 09, 2010 4:54 pm

PissedOffCil wrote:I didn't try with yesterday's build


Thanks, give me please now when you will try it. I have introduced a bunch of errors sadly with one build with adding of DataTrack feature.

So I hope that plugin is now relative stable.

Sorry for this to users. But on the other side I have added some features, that will enable to write some more crazy formulas. ;)

Nice day
Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby PissedOffCil » Tue Nov 09, 2010 9:09 pm

Everything seems fine
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby gringojack » Wed Nov 10, 2010 3:24 am

Hi

I believe that's what you mean, Hennes, so here we go! :lol:

I used the VO² max formula "as is" of calculated fields plugin, and it returns a VO² max of 7 (something between 1 and 7 depending on the days) which is extra low (normal for me seems to be in the fourties)
Is there any correction to bring to this formula or a certain way to utilize it?

Image
Salut les Copains!
GPS GARMIN Edge 1030
Mountain biking on:
GIANT Trance 27.5 2/V.A.E Hybrid electric
CycleOps PowerTap
My toy #1: SportTrack3!
gringojack
Donated!
Donated!
 
Posts: 542
Joined: Wed Feb 11, 2009 3:44 am
Location: France

PreviousNext

Return to Calculated Fields

Who is online

Users browsing this forum: No registered users and 1 guest

cron