-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplified Equipment feature (for feedback) #4466
base: master
Are you sure you want to change the base?
Simplified Equipment feature (for feedback) #4466
Conversation
To make your code compile on Linux (gcc), I had to do 2 modifications:
Also your code uses tabs instead of 4 spaces for indentation Now I will play with the functionality and come back later |
Thank you I'll look to fix that for Linux, seems to work fine on Windows 11 & Visual studio 2022 compiler. Unfortunately I've just upgraded to the latest commit, which includes the SplashScreen PR which is causing GC to crash, I'm using Qt5.15. |
I also get a crash on exit since on your branch (I still have it prior to splashscreen, commit ec59c09):
|
ok, thanks, I'll take a look at this exit crash, probably a side effect as another view has been added. I've identified the start-up splash screen issue I was having: #4471 |
Joachim the exit crash appears to be caused by the following line: #8 0x000055ae3a173d3c in AbstractView::saveState() (this=this@entry=0x55ae3cd5b180) at Gui/AbstractView.cpp:274 which has the line of code: QString view(viewName()); viewName() is a pure virtual function, which all the views must implement and return their textual name, but it would appear that this has cause problems for the compiler, as it's within the QString constructor. I'll change the code to read: QString view = viewName(); Hopefully this will prevent the exit crash. |
ec59c09
to
7f9bf58
Compare
The latest commit (7f9bf58) has the following fixed (from Joachim's comments above):
|
A little glitch made it into src.pro: Gui/PerspectiveDialog is named twice (both for .h and .cpp), leading to linker errors because of duplicate symbols. Also I get warnings because of initialization order (probably not bad but polluting the output):
|
The crash on close is still there, coming with the message
The crash also happens if I use a fixed string in AbstractView::saveState() for view. This points towards use of deleted objects, I will try debugging into this. |
e7d6d89
to
6f52df9
Compare
Joachim, I understand the crash issue, calling virtual functions for derived classes in destructors doesn't appear to be well defined (see link), so the Visual Studio c++ compiler is ok with it, but the Linux (gcc) one isn't, so I'll re-structure that piece of code. https://stackoverflow.com/questions/12092933/calling-virtual-function-from-destructor |
Joachim, would you mind testing the latest commit 56180f9 to hopefully resolve the exit crash |
Unfortunately, now I get another crash on exit (SEGV):
|
I can now replicate the crash on my Windows VS setup and the exit crash should now be fixed in the latest commit. |
Congrats for the job and many thanks. I will use it to see how it suits my standard usage and let you know if I find ideas regarding functionality, in case they are worth and make sense. |
Hi @peret2000, the current implementation only supports a single athlete, as the equipment.xml file is saved to athletes configuration directory, and to calculate the distances from more than one athlete's activities would be more complex. I think if you switch athletes using the tab and then load the new athletes equipment file from the drop down menu, it should work. Remember to save any updates to equipment before switching to the next athlete and then reload the new athletes equipment file. Thank you for the feedback, and I'll have think about the multi athlete problem |
d0ecd34
to
100749a
Compare
7c0b250
to
3a74d15
Compare
This PR adds an equipment maintenance feature to GC, any feedback or guidance on future development would be useful.
Design Aims:
• To be as generic as possible, support multiple equipment & components
• To minimise the number of Metadata items added to GC activities
• Minimise impact to existing GC code.
Description
This PR will create a new unpopulated “EquipmentLink” metadata item in all activities to provide a mechanism to link an activity to an equipment link item defined in the new page. The diagram below tries to illustrate the relationships between the equipment items
Within the equipment pages, various user defined components can be attached to the equipment link with time-spans of use, allowing the calculation of distances covered by individual components. The equipment page contains an equipment List:
Popup Menus
The Equipment List menu allows:
• Distance Recalculation
• Add Equipment Link
• Load/Save Equipment
• Expand/Collapse All
The Equipment List context menu (right click on an equipment item) allows:
• Add Shared
• Add Distance
• Add Time
• Add Banner
• Delete*
• Top**
• Shift Up/Down**
• Bottom**
• Shift Left**
Note:
*: Items with children cannot be deleted, move their children (drag & drop them), or delete their children.
**: These options are available when relevant.
Equipment List –> Shared Equipment
Items which are moved or shared across equipment (wheels, etc) should be created in this section, and then the items dragged to the relevant Equipment link headers. This will cause a reference to be created that will accumulate any distance and added to the shared equipment item.
{} – indicates the number of references to this object
[] – indicates the total mileage of the equipment (from its references)
Shared Distance Equipment Page:
• Description: Equipment description
• nonGCdistance: allows an initial value to be set for activities not recorded within GC
• gcDistance: the distance contribution of all the relevant GC activities
• Total distance: the total of nonGCdistance + gcDistance
• Replacement Distance: Sets the replacement distance warning, set a value of zero to disable warnings.
• Note: Save must be pressed to store any text/date changes
Equipment List –> Equipment Links
Equipment links “connect” to the activities.
All equipment items within an equipment hierarchy will accumulate the equipment links distance, allowing for any time restrictions.
() – indicates the number of “connected” activities
[] – indicates the total mileage of the “connected” activities.
Equipment Link Page:
• Equipment Link: text that matches the Activities EquipmentLink Metadata item.
• Activities: the number of “connected” activities.
• gcDistance: the distance contribution of all the “connected” activities.
Note: Save must be pressed to store any text/date changes
Equipment List - Distance Equipment:
Distance equipment supports the management of items which wear out, chains, cassettes, tyres, running shoes, etc that are not shared. This entry is drawn in red text when the replacement distance is exceeded.
[] – indicates the total mileage of the equipment (allowing for time restrictions).
Distance Equipment Page:
• Description: Equipment description
• nonGCdistance: allows an initial value to be set for activities not recorded within GC
• gcDistance: the distance contribution of all the relevant GC activities
• Total distance: the total of nonGCdistance + gcDistance
• Replacement Distance: Sets the replacement distance warning, set a value of zero to disable warnings.
• Start Date: allows a start date when the equipment was first used to be set
• End Date: allows an end date when the equipment was last used to be set
• Note: Save must be pressed to store any text/date changes
Equipment List - Time equipment:
Time equipment supports reminders for bike service intervals, hydraulic brake fluid changes, etc. This entry is drawn in red text when the replacement is overdue.
< > - indicates the number days remaining.
Time Equipment Page:
• Description: Equipment description
• Start Date: allows an initial date to be set
• Replacement Date: Sets the replacement date warning.
Note: Save must be pressed to store any text/date changes
Equipment List – Equipment References
These are created by dragging a shared distance item (from under shared Equipment banner) and dropping them on any item within an Equipment Link’s hierarchy. They accumulate any distance (allowing for time restrictions) of the equipment link and this is added to the shared distance items total.
[ ] -- indicates the total mileage of the equipment reference (allowing for time restrictions).
Equipment Reference Page
• Description: Equipment description
• Reference Distance: the distance contribution of all the relevant GC activities
• Start Date: allows a start date when the equipment was first used to be set
• End Date: allows an end date when the equipment was last used to be set
Note: Save must be pressed to store any text/date changes
Notes:
• There is no automatic recalculation of distances, this can be initiated from either the Equipment List menu, distances depend on your GC settings. With 2800 activities it takes less than a second to recalculate (using only 1/4 of the machines cores).
• Equipment settings are saved on closing Goldencheetah, they can also be save/loaded should you decide you want to undo a set of recent changes. The settings are store in the athlete’s config directory in equipments.xml, be careful if you want to directly edit this file.
• This PR only defines & calculates distances for the current athletes’ activities.
• Instead of setting your equipment link to a bicycle (or similar) you could set all activities of one type with the same equipment link name (say running), then use the time spans to allocate distance to specific running shoes.
Please experiment with it and let me know your thoughts….