Skip to content
Mark Liversedge edited this page Apr 10, 2023 · 14 revisions

Getting started

For general guidance on getting the sources, working with dependencies and working with git then you should read Sean's original developers guide. On this page we want to give some clues about the codebase and the more important classes.

Navigating the source tree

You will have noticed there are a few subdirectories, they contain:

  • contrib - to reduce dependencies we sometimes include external project source files here
  • deprecated - old source code that is no longer used gets put into this graveyard folder
  • doc - general documents related to sports science and metrics
  • qwt - we have our own local copy of the QWT library because we patch it to support multiple axes (amongst a couple of other things)
  • src - the main source folder - this is where developers will spend all their time
  • test - we do not have a testing framework, but this folder has some sample ride files and workouts to test functionality manually
  • travis - files for the travis build system
  • util - some scripts that may or may not be helpful (none are required)

Navigating the source folder

The main folder src contains folders grouping source code to specific functionality:

  • ANT - we have our own library for working with ANT devices to avoid licensing issues
  • Charts - code related to charting, including overview, ride plots and so on
  • Cloud - all cloud integration sources are here
  • Core - core structures such as Athlete, Measures, Expression
  • FileIO - file readers including our own implementation for reading FIT files to avoid licensing issues
  • Gui - Dialogs and GUI elements
  • Metrics - All code for calculating metrics like BikeStress (TSS)
  • Planning - Largely empty and reserved for planning functionality
  • Python - Embedding Python (see also Python/SIP)
  • R - Embedding R
  • Resources - Images and related application resources
  • Train - All sources related to indoor training functionality
  • translations - Translation files

Generating Doxygen pages

You can generate doxygen documentation that can be viewed via a browser:

cd doc/doxygen
make
open html/classes.html

Interesting and important class files

As you will see from the index, the GoldenCheetah codebase is rather complex and large. This is typical for a mature and sophisticated desktop application.

Some of the class files you may find helpful

Core Information

  • Athlete - all about the current athlete
  • Context - contextual information about the current Athlete/MainWindow/Tab
  • MainWindow - the application window (see also main.cpp for the application bootstrap)
  • AthleteTab - the tab hosting the athlete

RideFile and Metrics

  • RideCache - the cache of rides and metrics
  • RideFile and RideItem - representing a ridefile and its attributes, metadata etc
  • RideMetric - the base class for all metrics
  • UserMetric - user definable metrics
  • RideMetadata - ride metadata handling and definitions

DataFilters and Analytics

  • DataFilter - runtime execution of data filters (see also DataFilter.l, DataFilter.y for the grammar)
  • PythonEmbed - embedded python (see also Python/sip/goldencheetah.sip for wrapper functions)
  • REmbed - embedded R language (see also RTool.cpp for wrapper functions)

Modelling

  • Estimator - runs in background to generate model estimates & identify peak performances
  • PMCData - generates PMC from supplied data
  • Banister - generates Banister Performance model from supplied data
  • PDModel - base class for all power duration models
  • CP2Model2, CP3Model - Monod and Scherer, Morton Criticial Power Models
  • ExtendedModel - GoldenCheetah Multifactoral Model based upon Margaria Hydraulic Bioenergetic model
  • See also: lmmin.c lmmin.h for contributed Levenberg-Marquardt curve fitting

Charts

  • GcWindow - base class for all charts
  • ChartSpace - base class for user managed dashboards
  • Overview and OverviewItem - base classes for overview items
  • AllPlot and AllPlotWindow - example chart (the performance chart)
  • UserChart and GenericPlot - user definable charts
  • LTMPlot and LTMWindow - the trends chart

Cloud

  • See Using the Cloud Services API
  • CloudService - the base class for all cloud services
  • See also: Strava.cpp Strava.h for an exemplar of integrating cloud services

Configuration and Preferences

  • ConfigDialog - for configuring application settings
  • AthleteConfigDialog - for configuring athlete specific settings (e.g. zones)
  • GSettings - wrapper for saving/loading all settings
  • See also: Settings.h and Secrets.h for definitions of all settings/defaults
  • See also: Context.h for types of settings and configChanged() signal to notify when they changed
Clone this wiki locally