Skip to content
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

Batch Processing addition of metric & metadata operations #4399

Merged

Conversation

paulj49457
Copy link
Contributor

The metric & metadata fields can be set from the search/filter windows, but this PR adds metric & metadata operations to the BatchProcessingDialog with a simple UI:

Batch processing

The BatchProcessingDialog now supports:

Metadata field update
Set Metric Override
Clear Metric Override

The Metadata fields and Metric fields have been separated, as the latter override the existing GC calculated metrics, whilst the metadata fields are overwritten, so two different behaviours.

@amtriathlon
Copy link
Member

amtriathlon commented May 20, 2024

Hi Paul, I think the Metadata option can be handy for users not too comfortable with formulas, I can think of examples s.t. setting Equipment for a set of activities, etc. Perhaps I would have looked to FormField for the UI, but the text editor with a hint is simpler and likely good enough.
OTOH I cannot think a single example where overriding a metric to the same fixed value for a subset of activities can be useful, I would prefer to remove the Metrics options before merge.
Thank you for your contribution.

@paulj49457
Copy link
Contributor Author

Hi Ale, Thank you for the feedback, I'll remove the Metric option from this PR.

@paulj49457
Copy link
Contributor Author

@amtriathlon before I finalise the changes can you confirm the following is correct? I've been testing the metadata batch processing and noticed that some metadata names are the same as metric names, and are currently removed from metadata options list as follows, leaving only the metadata options at the end of this message.

The following metadata fields have been removed from the metadata options list as they are very destructive for batch processing:
metadata: Start Time
metadata: Start Date
metadata: Data

I also notice that the following names are in both Metric & Metadata names, and have been removed from the metadata options list:

metric - Metadata: Duration
metric - Metadata: Time Moving
metric - Metadata: Distance
metric - Metadata: Work
metric - Metadata: Elevation Gain
metric - Metadata: Average Speed
metric - Metadata: Average Power
metric - Metadata: Average Heart Rate
metric - Metadata: Average Cadence
metric - Metadata: Aerobic TISS
metric - Metadata: Anaerobic TISS
metric - Metadata: TSS
metric - Metadata: GOVSS
metric - Metadata: SwimScore
metric - Metadata: xPower
metric - Metadata: Daniels Points
metric - Metadata: Daniels EqP

Also the following names are similar in both Metric & Metadata names and have been removed from the metadata options list:
metadata: BikeScoreÔäó -- metric:BikeScore™
metadata: CP -- metric: Critical Power
metadata: Recording Interval ??

The Metadata fields that can still be changed by batch processing:
Metadata : Sport
Metadata : Notes
Metadata : Device
Metadata : Device Info
Metadata : Calendar Text
Metadata : Interval Notes
Metadata : Interval Goal
Metadata : < Plus any user defined Metadata Items, providing they do not match any metric names >

@amtriathlon
Copy link
Member

amtriathlon commented May 22, 2024

To define a metadata field with the same name as a metric is the way to enable metric overrides, there are some in default config (https://github.com/GoldenCheetah/GoldenCheetah/blob/master/src/Resources/xml/metadata.xml) but users can add/remove them according to their needs, here we should skip them checking the name doesn't match a metric name.
Also technical fields s.t. Start Date, Data, Recording Interval and Calendar Text should be excluded.

@paulj49457
Copy link
Contributor Author

@amtriathlon Thank you the explanation, I have applied your guidance in the latest commit which is ready for review/merge

@amtriathlon
Copy link
Member

Hi Paul, we have a class to go back and forth between external and internal names of fields and to check if they correspond to metrics: https://github.com/GoldenCheetah/GoldenCheetah/blob/master/src/Metrics/SpecialFields.h

@paulj49457
Copy link
Contributor Author

paulj49457 commented May 23, 2024

@amtriathlon I wasn't aware of it, so I have updated the PR to use the SpecialFields class in the latest commit.

@amtriathlon
Copy link
Member

@amtriathlon I wasn't aware of it, so I have updated the PR to use the SpecialFields class in the latest commit.

You need to use it for translations too, I mean, the combobox should show displayName instead of internalName since they can be different when using other language than english, but internalName for the update.
I pushed a fix for SpecialFields so you can use isUser/isSpecial to filter fields which cannot be updated: 9647975

@paulj49457
Copy link
Contributor Author

paulj49457 commented May 24, 2024

@amtriathlon I have updated the PR to use the isUser function and the display name <-> internal name conversions using the SpecialField

@amtriathlon amtriathlon merged commit 2ac2cd6 into GoldenCheetah:master May 24, 2024
1 check passed
@amtriathlon amtriathlon modified the milestone: 3.7 May 24, 2024
@amtriathlon amtriathlon added this to the 3.7 milestone May 24, 2024
@amtriathlon
Copy link
Member

Thank you!

@paulj49457 paulj49457 deleted the Batch_Processing_Additions branch May 24, 2024 16:56
amtriathlon added a commit that referenced this pull request May 26, 2024
2ac2cd6 Batch Processing addition metadata update (#4399)
9647975 Fix isSpecial(internalName) in SpecialFields
e41e6b6 Fit: Add FIELD_87 for record (cycle_length16) fix #4489
c088aaf Fixes the background colour of the group by sub menu (#4492)
06a6dbe Fix copy paste error preventing macOS build
5e3db39 Add delete button to manage filters (#4493)
77df5b3 Train View: Improved the selection of workouts (#4400)
cfb8c2f Manage Perspectives - perspectives list cosmetics
f1bb83f Update Images default chart
562ef17 Update Spanish translation (#4487)
57c11e0 Remove Ctrl+A shortcut for Add Cloud Account
cf2e8d8 Enable translation of Save Changes in SaveExitDialog
1b49890 Update German Translation
f97770f GC CSV Export - rcad instead of cad for runs
7a11a6a Initializing AllPlot::isPanning to false (#4482)
76dedfb Fix Average Speed aggregation
6299374 Images chart update on image drop and import
fdb6d17 Python Web Chart - Don't accept drops
68ad048 Update Images Python chart in default layout
2d8bdd7 FitRideFile - Decode GAP extra field in m/s
5073ba8 Add Images chart to default layout
c693ed6 FitRideFile - Extra fields 136, 143 and 144
4f5a0eb CP Chart - show/hide interval settings based on model and
fitting selection (#4382)
0b144cc Train View: Coloring by powerzones in ErgFilePlot (#4479)
02835e3 Added support for old Daum devices before 2001 (#4303)
71c72d6 Changed the standard colors for compare-mode (#4478)
118eafe FitRideFile : A devApp can replace another with same local id
1241c0a Use elapsed time for session (instead of timestamp) fix #4474
a1a76fb WorkoutWizard - Don't save and close on Cancel
64c7ce3 Improved search/filter box drop down menu icon (#4470)
[publish binaries]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants