fbpx

Copernico

Custom columns

A custom column is a component of Copérnico that allows you to execute functions on the data. This function is executed only on the computer that is being used. Custom columns allow you to group participant fields, such as first and last name, calculate ages or  add up times from different intervals.

Custom columns is a complicated component for which it is necessary to have knowledge of Javascript to execute the functions. If you are not a developer, don’t worry because we are going to define the custom columns that we consider most relevant and used.

How to create a custom column?

  1. In the “Participants” menu, click on “Manage custom columns”
  2. Click on “Create new column”.

If you know how to program in Javascript, you only have to enter the functions you want your custom column to execute. But if you don’t, we define the most used functions and you can copy it in the text box to paste it in Copérnico.

Sum of kilometres: this column will add up all the km travelled by each participations of each participant. The perfect execution for this function is that the sum is done km by km and for this you must configure the splits of 1 km distance between them. Copy and paste:

function column( athlete, race, event, dataSet, util ) {
const atletasConElMismoChip = dataSet.filter(atleta => atleta.chip[0] == athlete.chip[0]);
const atletasConElMismoChipNoDescalificados = atletasConElMismoChip.filter(atleta => !(['quarantine', 'disqualified'].includes(atleta.status)));
const differentStartTimes = atletasConElMismoChipNoDescalificados.pluck('manualStartTime').unique();
const atletasFiltradosSinStartTimesRepetidos = differentStartTimes.map(manualStartTime => atletasConElMismoChipNoDescalificados.findByProperty('manualStartTime', manualStartTime));
const tiemposDeLosAtletasConElMismoChip = atletasFiltradosSinStartTimesRepetidos.pluck('times').map(timeSet => Object.values(timeSet)).flat().filter(time => time.distance);
const distanciaEntreSplits = 1000;
return tiemposDeLosAtletasConElMismoChip.length * distanciaEntreSplits;
}

Sum of interval times: this column will add up the times, so to get the positions you will have to sort this column and use the ordinal column (#) to take it to the presets you are going to use. “T1” will be your first interval, “Bike” your second interval, y “T2” your third interval. Copy and paste:

function column( athlete, race, event, dataSet, util ) {
return (athlete.rankings["T1"].time + athlete.rankings["Bike"].time + athlete.rankings["T2"].time).toHHMMSS();
}

Difference to first: this column will calculate the difference in time between the first finisher and the participant. Copy and paste:

function column( athlete, race, event, dataSet, util ) {
return athlete.rankings[util.getFullInterval(event)] ? (athlete.rankings[util.getFullInterval(event)].time - util.getTopRankingTime(util.getFullInterval(event), {event: athlete.event})).toHHMMSS() : null
}

 

Difference to first in category: this column will calculate the difference in time between the first finisher in his category and the participant. Copy and paste:

function column( athlete, race, event, dataSet, util ) {
return athlete.rankings[util.getFullInterval(event)] ? (athlete.rankings[util.getFullInterval(event)].time - util.getTopRankingTime(util.getFullInterval(event), {event: athlete.event, category: athlete.category})).toHHMMSS() : null
}

Difference to first by gender: this column will calculate the time difference to first by gender: time difference between the first male, female or mixed finisher and the participant. Copy and paste:

function column( athlete, race, event, dataSet, util ) {
return athlete.rankings[util.getFullInterval(event)] ? (athlete.rankings[util.getFullInterval(event)].time - util.getTopRankingTime(util.getFullInterval(event), {event: athlete.event, gender: athlete.gender})).toHHMMSS() : null
}

Code with athlete status: This column will display the code you need for each of the participants status. Of course if you need other codes you can edit it. Please note that finished athletes don’t have code assigned.

function column( athlete, race, event, dataSet, util ) {
const statusCodes = {
"finished":"",
"retired":"DNF",
"quarantine":"DNF",
"disqualified":"DQ",
"notstarted":"DNS",
}
return statusCodes[athlete.status] ? statusCodes[athlete.status] : null

}

Custom column management

There are several levels in the custom columns:

  • Most used: here we will be adding the columns that we know are the most used by all Copérnico users.
  • Columns activated for the race: these are the columns that you have marked as active for the race you are working on at the moment.
  • My columns: these are the columns that you have created for use in any of your races.
  • Other custom columns of users of my company: here you will be able to see any column created by other users of your company.

like / dislike formulario

Cuéntanos qué no te gusta. Ayúdanos a mejorar.

like form


Artículos relacionados