Training Load

by mechgt

Downloads: 12,931 (48) • Reviews: 18

Version:

2.0.7

Updated:

Aug 26, 2015

Bug: Crashes if activated to soon after start of ST

Bug: Crashes if activated to soon after start of ST

Postby TomasR » Mon Aug 10, 2009 8:23 am

If I select the Training load view first of after starting ST the plugin crashes, exception is thrown saying that the collection size have changed, cannot complete the stepping through the collection (or something alike).
In Swedish below.
Code: Select all
System.InvalidOperationException: Mängden har ändrats. Det går inte att köra uppräkningsåtgärden.
   vid System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   vid System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   vid System.Collections.Generic.List`1.Enumerator.MoveNext()
   vid ZoneFiveSoftware.Common.Data.ValueRangeSeries`1.<GetEnumerator>d__0.MoveNext()
   vid ZoneFiveSoftware.Common.Data.Fitness.ActivityInfo.get_NonMovingTimes()
   vid ZoneFiveSoftware.Common.Data.Fitness.ActivityInfo.CalculateSmoothedHeartRateTrack()
   vid ZoneFiveSoftware.Common.Data.Fitness.ActivityInfo.CalculateHeartRateZoneInfo(IZoneCategory category)
   vid ZoneFiveSoftware.Common.Data.Fitness.ActivityInfo.HeartRateZoneInfo(IZoneCategory category)
   vid TrainingLoad.UI.View.ViewTrainingLoadPageControl.GetTrimpList(IActivity activity)
   vid TrainingLoad.UI.View.ViewTrainingLoadPageControl.CalculateTss(SortedList`2& dateTSS, SortedList`2& barsTSS, Int32& maxTrimps)
   vid TrainingLoad.UI.View.ViewTrainingLoadPageControl.RefreshPage()
   vid TrainingLoad.UI.View.ViewTrainingLoadPage.ShowPage(String bookmark)
   vid ZoneFiveSoftware.SportTracks.UI.ViewNavigationManager.ShowCurrentView()
   vid....
...
TomasR
Donated!
Donated!
 
Posts: 265
Joined: Mon Dec 12, 2005 1:31 pm
Location: Stockholm, Sweden

Postby mechgt » Mon Aug 10, 2009 9:52 am

Is this repeatable for you? I opened ST just now, and started TL as fast as it would let me. It wouldn't allow me to select that view until the logbook finished loading, but I picked it as quickly as I possibly could. I'll take a look at it none the less.
Enhance SportTracks with Training Load, Fit Plan and more plugins at mechgt.com. Garmin FR310XT & iBike iPro
mechgt
Donated!
Donated!
 
Posts: 1188
Joined: Wed Sep 26, 2007 2:13 pm
Location: Atlanta, GA, USA

Postby TomasR » Mon Aug 10, 2009 10:51 am

Yes, repeatable.

ST do some background calculations after it is started, perhaps something this plugin do interfere with that? Perhaps some data the plugin go through is not ready?

I get this when starting ST via debugger:
Start calculating info for 713 activities.
Calculating info for 713 activities in 8,16 seconds.

If I select Training Load view within this time it seems it crashes.
TomasR
Donated!
Donated!
 
Posts: 265
Joined: Mon Dec 12, 2005 1:31 pm
Location: Stockholm, Sweden

Postby texmurphy » Mon Aug 10, 2009 11:01 am

I don't get this error (WinXP) but a check of the ST system log will sometimes show a note from omb saying:
7/13/2009 2:16 PM [OldManBikings_Plugins] ERROR Calculating info for 1367 activities in 14.796875 seconds. <some error code like Can't get focus>


You may want to test without omb's plugins, but work fine for me.
texmurphy
Donated!
Donated!
 
Posts: 2076
Joined: Wed Jul 05, 2006 7:38 pm
Location: Maryland, USA

Postby TomasR » Mon Aug 10, 2009 3:44 pm

The plugins I have installed are
Activity Year
Apply Routes
Dobrou
Elevation Correction
Filtered Statistics
Garmin Fitness
GDAL Plugin
High Score
Hitta.se/Eniro MapProvider
Training Load
Unique Routes
+the standard ST2 plugins.

There is no change if I disable all these and leave only Training Load and the standard plugins active.

Still crashes.

I have no errors in the system log other than old ones I have caused while testing my own plugins.

This on a pretty fast Vista 32 bit machine with an AMD Athlon X2 6000+ @3 GHz.


The error should be easy to handle. Trap it, set the plugin to wait a bit for ST to get ready (background thread doing the calcs) and the retry running the code.
or better, if error can be detected before it occurs.
TomasR
Donated!
Donated!
 
Posts: 265
Joined: Mon Dec 12, 2005 1:31 pm
Location: Stockholm, Sweden

Postby mechgt » Wed Aug 12, 2009 12:32 pm

See if this fixes the crash, and let me know what it does:

Training Load 1.2.6

Basically I think I just made the error disappear, but couldn't replicate the problem, so I don't know what was happening. If you open it the same manner (quickly?) is the chart now blank, or does it appear to have all of your data?

Note, there are no new features included here so no real point in installing this unless you see this particular problem.
Enhance SportTracks with Training Load, Fit Plan and more plugins at mechgt.com. Garmin FR310XT & iBike iPro
mechgt
Donated!
Donated!
 
Posts: 1188
Joined: Wed Sep 26, 2007 2:13 pm
Location: Atlanta, GA, USA

Postby TomasR » Wed Aug 12, 2009 1:39 pm

Believe you fixed it. No blank graph, a blank page and a busy-arrow for some time and then the graph appears.

Good work!

Of course, you may improve it still, for example by doing the calcs in the background so you don't lock up the interface. That is, on the main thread initialize the calc-thread and draw whatever is available. When the calc-thread is finished, send an event up to main thread and do a redraw.

Or something alike. Not so important, the plugin works good enough as it is I believe. But always fun to improve the code and especially work with threads :)
TomasR
Donated!
Donated!
 
Posts: 265
Joined: Mon Dec 12, 2005 1:31 pm
Location: Stockholm, Sweden

Postby mechgt » Wed Aug 12, 2009 2:15 pm

Monshi wrote:Believe you fixed it. No blank graph, a blank page and a busy-arrow for some time and then the graph appears.

Good work!

Of course, you may improve it still, for example by doing the calcs in the background so you don't lock up the interface. That is, on the main thread initialize the calc-thread and draw whatever is available. When the calc-thread is finished, send an event up to main thread and do a redraw.

Or something alike. Not so important, the plugin works good enough as it is I believe. But always fun to improve the code and especially work with threads :)


I'm going to bet that you've got at least 1 activity excluded from your charts then. If it errors while calculating an activity, this fix basically just skips that activity.

I've thought about doing the calcs in a separate thread, and might get around to that sometime in the future. Haven't worked with separate threads before, might be something new to learn.
Enhance SportTracks with Training Load, Fit Plan and more plugins at mechgt.com. Garmin FR310XT & iBike iPro
mechgt
Donated!
Donated!
 
Posts: 1188
Joined: Wed Sep 26, 2007 2:13 pm
Location: Atlanta, GA, USA

Postby TomasR » Wed Aug 12, 2009 3:04 pm

I have the first and I have the last activity at least. The rest, no chance I am checking that.

I slow down my comp to crawl (speed step CPU to 1 GHz, slow as an old P3?). Still, first and last activity are still there. Have even added pulse data to the absolutely first activity in the logbook (2005-11-12)

The list you access, is it sorted on date? Seems not as if it was, if you just discard whatever when there is an error, the first or last activity, at least, should be gone.


Working with threads in C# is quite easy. Fire of a BackgroundWorker or do it manually. Since what you do is a one-time calc a BackgroundWorker could be the answer for you. But either way, not so hard at all.
TomasR
Donated!
Donated!
 
Posts: 265
Joined: Mon Dec 12, 2005 1:31 pm
Location: Stockholm, Sweden


Return to Training Load

Who is online

Users browsing this forum: No registered users and 2 guests

cron