Table tile question

130 views
Skip to first unread message

ckli...@gmail.com

unread,
Oct 17, 2021, 3:02:37 AM10/17/21
to golden-cheetah-users
Hello,

I tried to make a table tile i an overview chart for activities.
Target is to generate a table of all activities with some metrics.
I tried 

values { 

    c(metricstrings(date),

      metricstrings(Distance),

      metricstrings(Duration),

      metricstrings(Workout_code),

      metricstrings(Equipment));

But unfortunately both the Workout_Code and the Equipment column are empty, while the other columns are displayed correctly. I also tried asstring(). 
The picture in the October Release announcement shows a PMC table containing also the Workout Code. What did i do wrong? 

Best regards,

Christian

  

Gerrie Delport

unread,
Oct 18, 2021, 9:40:26 AM10/18/21
to golden-cheetah-users
Hi Christian.

I think your workout Code should be with A capital W and C "Workout_Code"

Ale Martinez

unread,
Oct 18, 2021, 12:30:53 PM10/18/21
to golden-cheetah-users
Currently metrics/metricstrings/etc. functions work on metrics only, not metadata fields like Workout_Code and Equipment. 

Mark Liversedge

unread,
Oct 18, 2021, 12:45:49 PM10/18/21
to golden-cheetah-users
On Monday, 18 October 2021 at 17:30:53 UTC+1 Ale Martinez wrote:
Currently metrics/metricstrings/etc. functions work on metrics only, not metadata fields like Workout_Code and Equipment. 

Here is an example from trends view that plots a table of pmc data and workout code for those days that contain an activity, note how the workouts (sparse) and pmc data (daily) are matched and folded together.

Also, of course Metadata is already a string.

{
# column names, if using metrics then best
# to use metricname() to get correct name for locale
# otherwise it won't translate to other languages
names {
c("Date", "Daily", "Chronic", "Acute", "Stress", "Workout");
}

# column units, if using metrics then best
# to use metricunit() function to get correct string
# for locale and metric/imperial
units {
c("", "TSS", "Load","Load","Balance", "Code");
}

# values to display as doubles or strings
# if using metrics always best to use asstring()
# to convert correctly with dp, metric/imperial
# or specific formats eg. rowing pace xx/500m
values {
# get metadata
ridedates <- metrics(date);
pmcdates <- pmc(BikeStress,date);
index <- match(ridedates, pmcdates);

meta <- rep("", length(pmcdates));
meta[index] <- metadata("Workout Code");

c(datestring(pmc(BikeStress,date)),
round(pmc(BikeStress,stress)),
round(pmc(BikeStress,lts)),
round(pmc(BikeStress,sts)),
round(pmc(BikeStress,sb)), meta);

}

heat {
c(normalize(0,0,pmc(BikeStress,lts)),
normalize(0,300,pmc(BikeStress,stress)),
normalize(0,100,pmc(BikeStress,lts)),
normalize(0,100,pmc(BikeStress,sts)),
normalize(-30,30,pmc(BikeStress,sb)),
normalize(0,0,pmc(BikeStress,lts)));
}


f {
ridedates <- metrics(date);
pmcdates <- pmc(BikeStress,date);
index <- match(ridedates, pmcdates);

returning <- rep("", length(pmcdates));
returning[index] <- filename();

returning;

}

}

Reply all
Reply to author
Forward
0 new messages