Skip to content

Commit

Permalink
Add elevation threshold in settings
Browse files Browse the repository at this point in the history
Ready for V4.5
  • Loading branch information
patrovite committed Dec 10, 2019
1 parent 4916370 commit bd77e19
Show file tree
Hide file tree
Showing 30 changed files with 1,899 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@ Course Generator is a software which can estimate your time in road running race

![Course Generator Main window](https://imgur.com/4tM7kUR.png)

## Status : Version 4.4.1 (stable)
## Status : Version 4.5 (stable)

## History
I created Course Generator in 2008 for my first 100 km ultra trail. Since then, I added a lot of features and it has been used by a lot of french ultra-runner. Up to the version 3.88 it has been written in C# and now java is used in order to be cross platform (Windows, Mac OS and Linux) and multilingual.
Expand Down
Binary file modified build/course_generator.jar
Binary file not shown.
Binary file modified build/en_cg_doc_4.00.epub
Binary file not shown.
930 changes: 930 additions & 0 deletions build/en_cg_doc_4.00.html

Large diffs are not rendered by default.

Binary file modified build/en_cg_doc_4.00.pdf
Binary file not shown.
Binary file modified build/fr_cg_doc_4.00.epub
Binary file not shown.
916 changes: 916 additions & 0 deletions build/fr_cg_doc_4.00.html

Large diffs are not rendered by default.

Binary file modified build/fr_cg_doc_4.00.pdf
Binary file not shown.
7 changes: 4 additions & 3 deletions build/help/en/en_cg_doc_4.00.html
Expand Up @@ -5,7 +5,7 @@
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Pierre Delore" />
<title>Course Generator - V4.4</title>
<title>Course Generator - V4.5</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand All @@ -19,7 +19,7 @@
</head>
<body>
<header id="title-block-header">
<h1 class="title">Course Generator - V4.4</h1>
<h1 class="title">Course Generator - V4.5</h1>
<p class="author">Pierre Delore</p>
<p class="date">© 2008-2019 Pierre Delore (pierre@TechAndRun.com), CC BY-NC</p>
</header>
Expand Down Expand Up @@ -827,7 +827,8 @@ <h3 id="general-tab"><span class="header-section-number">9.12.1</span> “Genera
<li>“language” : Selects the language used in the interface. “System” uses operating system settings to determine which language to use. If the system language is not managed by <strong>Course Generator</strong> then English is selected.</li>
<li>“Units” : Chooses between “km/m” and “Miles/Feet”.</li>
<li>“Speed format” : Chooses the type of speed to display (speed or pace).</li>
<li>"Threshold for position filter (in %) : Threshold, in%, from which the software asks if we want to apply a filter on GPS points when loading a track.</li>
<li>“Threshold for position filter (in %)” : Threshold, in %, from which the software asks if we want to apply a filter on GPS points when loading a track.</li>
<li>“Threshold for climb calculation (in meter)” : Threshold, in meter, from where you take into account a difference of elevation. Used the by the software to calcultate the ascending and descending climb.</li>
<li>“Check for update at startup” : Allows you to choose if you want to check for a newer version of <strong>Course Generator</strong> available at application startup.</li>
</ul>
<h3 id="display-tab"><span class="header-section-number">9.12.2</span> “Display” tab</h3>
Expand Down
7 changes: 4 additions & 3 deletions build/help/fr/fr_cg_doc_4.00.html
Expand Up @@ -5,7 +5,7 @@
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Pierre Delore" />
<title>Course Generator - V4.4</title>
<title>Course Generator - V4.5</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand All @@ -19,7 +19,7 @@
</head>
<body>
<header id="title-block-header">
<h1 class="title">Course Generator - V4.4</h1>
<h1 class="title">Course Generator - V4.5</h1>
<p class="author">Pierre Delore</p>
<p class="date">© 2008-2019 Pierre Delore (pierre@TechAndRun.com), CC BY-NC</p>
</header>
Expand Down Expand Up @@ -812,7 +812,8 @@ <h3 id="onglet-général"><span class="header-section-number">9.12.1</span> Ongl
<li>“Langues” : Permet de sélectionner la langue utilisée dans l’interface. “Système” utilise les réglages du système d’exploitation pour déterminer la langue à utiliser. Si la langue système n’est pas géré par <strong>Course Generator</strong> alors l’anglais est sélectionné.</li>
<li>“Unité” : Permet de choisir entre “km/m” et “Miles/Pieds”.</li>
<li>“Format vitesse” : Permet de choisir le format de la vitesse (Vitesse ou Allure).</li>
<li>"Seuil pour filtre position (en %) : Seuil, en %, à partir duquel le logiciel demande si on veut appliquer un filtre sur les points GPS lors du chargement d’un parcours.</li>
<li>“Seuil pour filtre position (en %)” : Seuil, en %, à partir duquel le logiciel demande si on veut appliquer un filtre sur les points GPS lors du chargement d’un parcours.</li>
<li>“Seuil pour le calcul du dénivelé (en mètre)” : Seuil, en mètre, à partir duquel on prend en compte une variation d’altitude. Utilisé lors du calcul de dénivelé.</li>
<li>“Contrôle mise à jour au démarrage” : Permet de choisir si on veut contrôler la présence d’une mise à jour de l’application au démarrage.</li>
</ul>
<h3 id="onglet-affichage"><span class="header-section-number">9.12.2</span> Onglet “Affichage”</h3>
Expand Down
Binary file modified doc/en/en_cg_doc_4.00.epub
Binary file not shown.
7 changes: 4 additions & 3 deletions doc/en/en_cg_doc_4.00.html
Expand Up @@ -5,7 +5,7 @@
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Pierre Delore" />
<title>Course Generator - V4.4</title>
<title>Course Generator - V4.5</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand All @@ -19,7 +19,7 @@
</head>
<body>
<header id="title-block-header">
<h1 class="title">Course Generator - V4.4</h1>
<h1 class="title">Course Generator - V4.5</h1>
<p class="author">Pierre Delore</p>
<p class="date">© 2008-2019 Pierre Delore (pierre@TechAndRun.com), CC BY-NC</p>
</header>
Expand Down Expand Up @@ -827,7 +827,8 @@ <h3 id="general-tab"><span class="header-section-number">9.12.1</span> “Genera
<li>“language” : Selects the language used in the interface. “System” uses operating system settings to determine which language to use. If the system language is not managed by <strong>Course Generator</strong> then English is selected.</li>
<li>“Units” : Chooses between “km/m” and “Miles/Feet”.</li>
<li>“Speed format” : Chooses the type of speed to display (speed or pace).</li>
<li>"Threshold for position filter (in %) : Threshold, in%, from which the software asks if we want to apply a filter on GPS points when loading a track.</li>
<li>“Threshold for position filter (in %)” : Threshold, in %, from which the software asks if we want to apply a filter on GPS points when loading a track.</li>
<li>“Threshold for climb calculation (in meter)” : Threshold, in meter, from where you take into account a difference of elevation. Used the by the software to calcultate the ascending and descending climb.</li>
<li>“Check for update at startup” : Allows you to choose if you want to check for a newer version of <strong>Course Generator</strong> available at application startup.</li>
</ul>
<h3 id="display-tab"><span class="header-section-number">9.12.2</span> “Display” tab</h3>
Expand Down
Binary file modified doc/en/en_cg_doc_4.00.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/en/md/00-Title.md
@@ -1,3 +1,3 @@
% Course Generator - V4.4
% Course Generator - V4.5
% Pierre Delore
% © 2008-2019 Pierre Delore (pierre@TechAndRun.com), CC BY-NC
Binary file modified doc/fr/fr_cg_doc_4.00.epub
Binary file not shown.
7 changes: 4 additions & 3 deletions doc/fr/fr_cg_doc_4.00.html
Expand Up @@ -5,7 +5,7 @@
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Pierre Delore" />
<title>Course Generator - V4.4</title>
<title>Course Generator - V4.5</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand All @@ -19,7 +19,7 @@
</head>
<body>
<header id="title-block-header">
<h1 class="title">Course Generator - V4.4</h1>
<h1 class="title">Course Generator - V4.5</h1>
<p class="author">Pierre Delore</p>
<p class="date">© 2008-2019 Pierre Delore (pierre@TechAndRun.com), CC BY-NC</p>
</header>
Expand Down Expand Up @@ -812,7 +812,8 @@ <h3 id="onglet-général"><span class="header-section-number">9.12.1</span> Ongl
<li>“Langues” : Permet de sélectionner la langue utilisée dans l’interface. “Système” utilise les réglages du système d’exploitation pour déterminer la langue à utiliser. Si la langue système n’est pas géré par <strong>Course Generator</strong> alors l’anglais est sélectionné.</li>
<li>“Unité” : Permet de choisir entre “km/m” et “Miles/Pieds”.</li>
<li>“Format vitesse” : Permet de choisir le format de la vitesse (Vitesse ou Allure).</li>
<li>"Seuil pour filtre position (en %) : Seuil, en %, à partir duquel le logiciel demande si on veut appliquer un filtre sur les points GPS lors du chargement d’un parcours.</li>
<li>“Seuil pour filtre position (en %)” : Seuil, en %, à partir duquel le logiciel demande si on veut appliquer un filtre sur les points GPS lors du chargement d’un parcours.</li>
<li>“Seuil pour le calcul du dénivelé (en mètre)” : Seuil, en mètre, à partir duquel on prend en compte une variation d’altitude. Utilisé lors du calcul de dénivelé.</li>
<li>“Contrôle mise à jour au démarrage” : Permet de choisir si on veut contrôler la présence d’une mise à jour de l’application au démarrage.</li>
</ul>
<h3 id="onglet-affichage"><span class="header-section-number">9.12.2</span> Onglet “Affichage”</h3>
Expand Down
Binary file modified doc/fr/fr_cg_doc_4.00.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/fr/md/00-Title.md
@@ -1,3 +1,3 @@
% Course Generator - V4.4
% Course Generator - V4.5
% Pierre Delore
% © 2008-2019 Pierre Delore (pierre@TechAndRun.com), CC BY-NC
1 change: 1 addition & 0 deletions src/course_generator/Bundle.properties
Expand Up @@ -732,6 +732,7 @@ frmSettings.lbStatusbarIconSize.text = Status bar icons size
frmSettings.lbTabIconSize.text = Tab icons size
frmSettings.lbTagIconSize.text = Tag icons size
frmSettings.lbThresholdAsk.Text = Threshold for position filter (in %)
frmSettings.lbThresholdClimb.Text = Threshold for climb calculation (in meter)
frmSettings.lbThunderForestApiKey.text = Thunderforest API Key
frmSettings.lbToolbarIconSize.text = Toolbar icons size
frmSettings.lbUnit.text = Units
Expand Down
1 change: 1 addition & 0 deletions src/course_generator/Bundle_en_US.properties
Expand Up @@ -730,6 +730,7 @@ frmSettings.lbStatusbarIconSize.text = Status bar icons size
frmSettings.lbTabIconSize.text = Tab icons size
frmSettings.lbTagIconSize.text = Tag icons size
frmSettings.lbThresholdAsk.Text = Threshold for position filter (in %)
frmSettings.lbThresholdClimb.Text = Threshold for climb calculation (in meter)
frmSettings.lbThunderForestApiKey.text = Thunderforest API Key
frmSettings.lbToolbarIconSize.text = Toolbar icons size
frmSettings.lbUnit.text = Units
Expand Down
1 change: 1 addition & 0 deletions src/course_generator/Bundle_es_ES.properties
Expand Up @@ -731,6 +731,7 @@ frmSettings.lbStatusbarIconSize.text = Tama
frmSettings.lbTabIconSize.text = Tamaño de los iconos de las pestañas
frmSettings.lbTagIconSize.text = Tamaño de los iconos de las etiquetas
frmSettings.lbThresholdAsk.Text = Límite para el filtro de posición (in %)
frmSettings.lbThresholdClimb.Text = Threshold for climb calculation (in meter)
frmSettings.lbThunderForestApiKey.text = Thunderforest API Key
frmSettings.lbToolbarIconSize.text = Tamaño de los iconos de la barra de herramientas
frmSettings.lbUnit.text = Unidades
Expand Down
1 change: 1 addition & 0 deletions src/course_generator/Bundle_fr_FR.properties
Expand Up @@ -729,6 +729,7 @@ frmSettings.lbStatusbarIconSize.text = Taille icones barre d'
frmSettings.lbTabIconSize.text = Taille icones onglets
frmSettings.lbTagIconSize.text = Taille icones étiquettes
frmSettings.lbThresholdAsk.Text = Seuil pour filtre position (en %)
frmSettings.lbThresholdClimb.Text = Seuil pour le calcul du dénivelé (en mètre)
frmSettings.lbThunderForestApiKey.text = Thunderforest API Key
frmSettings.lbToolbarIconSize.text = Taille icones barre d'outils
frmSettings.lbUnit.text = Unités
Expand Down
1 change: 1 addition & 0 deletions src/course_generator/Bundle_pt_PT.properties
Expand Up @@ -731,6 +731,7 @@ frmSettings.lbStatusbarIconSize.text = Status bar icons size
frmSettings.lbTabIconSize.text = Tab icons size
frmSettings.lbTagIconSize.text = Tag icons size
frmSettings.lbThresholdAsk.Text = Threshold for position filter (in %)
frmSettings.lbThresholdClimb.Text = Threshold for climb calculation (in meter)
frmSettings.lbThunderForestApiKey.text = Thunderforest API Key
frmSettings.lbToolbarIconSize.text = Toolbar icons size
frmSettings.lbUnit.text = Units
Expand Down
2 changes: 1 addition & 1 deletion src/course_generator/TrackData.java
Expand Up @@ -1236,7 +1236,7 @@ public CalcClimbResult CalcClimb(int elevType, int StartLine, int EndLine, CalcC
de = (elev - oldElev);
dt = (time - oldTime);

if (Math.abs(de) > CgConst.MIN_ELEV) {
if (Math.abs(de) > (double)Settings.ClimbThresholdForCalculation) {
if (de > 0) {
r.cp += de;
r.tp += dt;
Expand Down
5 changes: 4 additions & 1 deletion src/course_generator/frmMain.java
Expand Up @@ -168,7 +168,7 @@
public class frmMain extends javax.swing.JFrame {
private static final long serialVersionUID = 6484405417503538528L;

private final static String Version = "4.5.0-Alpha1";
private final static String Version = "4.5.0";

public static boolean inEclipse = false;
public static CgLog log = null;
Expand Down Expand Up @@ -369,6 +369,9 @@ public frmMain(String args[]) {
Track = new TrackData(Settings);
Backup_Track = new TrackData(Settings);

//-- Say to the system that we want to use the default proxy settings (the simpliest solution!)
System.setProperty("java.net.useSystemProxies", "true");

// showProfilMarker=true;

// -- Load configuration
Expand Down
5 changes: 4 additions & 1 deletion src/course_generator/settings/CgSettings.java
Expand Up @@ -77,6 +77,8 @@ public class CgSettings {

/** Threshold where CG ask if a position filter must be apply (m) **/
public int PosFilterAskThreshold = 10;

public int ClimbThresholdForCalculation = CgConst.MIN_ELEV;

public int Unit = CgConst.UNIT_METER; // Unit for the display 0=meter
// 1=Miles/feet
Expand Down Expand Up @@ -298,7 +300,8 @@ public void Save(String path) {
Utils.WriteDoubleToXML(writer, "DISTFAR", DistFar);

Utils.WriteIntToXML(writer, "POSFILTERASKTHRESHOLD", PosFilterAskThreshold);

Utils.WriteIntToXML(writer, "CLIMBTHRESHOLDFORCALCULATION", ClimbThresholdForCalculation);

Utils.WriteStringToXML(writer, "DEFAULTFONTNAME", DefaultFontName);
Utils.WriteIntToXML(writer, "DEFAULTFONTSTYLE", DefaultFontStyle);
Utils.WriteIntToXML(writer, "DEFAULTFONTSIZE", DefaultFontSize);
Expand Down
1 change: 1 addition & 0 deletions src/course_generator/settings/SaxConfigHandler.java
Expand Up @@ -279,6 +279,7 @@ public void endElement(String uri, String localname, String qName) throws SAXExc
else if (qName.equalsIgnoreCase("DISTNEAR")) { Settings.DistNear = ManageDouble(100.0, ERR_READ_DOUBLE); }
else if (qName.equalsIgnoreCase("DISTFAR")) { Settings.DistFar = ManageDouble(1000.0, ERR_READ_DOUBLE); }
else if (qName.equalsIgnoreCase("POSFILTERASKTHRESHOLD")) { Settings.PosFilterAskThreshold = ManageInt(5, ERR_READ_INT); }
else if (qName.equalsIgnoreCase("CLIMBTHRESHOLDFORCALCULATION")) { Settings.ClimbThresholdForCalculation = ManageInt(CgConst.MIN_ELEV, ERR_READ_INT); }
else if (qName.equalsIgnoreCase("DEFAULTFONTNAME")) { Settings.DefaultFontName = ManageString().trim(); }
else if (qName.equalsIgnoreCase("DEFAULTFONTSTYLE")) { Settings.DefaultFontStyle = ManageInt(0, ERR_READ_INT); }
else if (qName.equalsIgnoreCase("DEFAULTFONTSIZE")) { Settings.DefaultFontSize = ManageInt(14, ERR_READ_INT); }
Expand Down
18 changes: 16 additions & 2 deletions src/course_generator/settings/frmSettings.java
Expand Up @@ -155,6 +155,8 @@ public class frmSettings extends javax.swing.JDialog {
private JButton btLoadColorTheme;
private JButton btSaveColorTheme;
private String DataDir;
private JLabel lbThresholdClimb;
private CgSpinner spinThresholdClimb;


/**
Expand Down Expand Up @@ -205,7 +207,8 @@ else if (settings.Unit == CgConst.UNIT_MILES_FEET)

// -- Threshold
spinThresholdAsk.setValue((int) settings.PosFilterAskThreshold);

spinThresholdClimb.setValue((int) settings.ClimbThresholdForCalculation);

// -- Default font
DefaultFont = new Font(settings.DefaultFontName, settings.DefaultFontStyle, settings.DefaultFontSize);

Expand Down Expand Up @@ -302,7 +305,8 @@ else if (settings.Unit == CgConst.UNIT_MILES_FEET)

// -- Threshold
settings.PosFilterAskThreshold = spinThresholdAsk.getValueAsInt();

settings.ClimbThresholdForCalculation = spinThresholdClimb.getValueAsInt();

// -- Default font
settings.DefaultFontName = DefaultFont.getFontName();
settings.DefaultFontStyle = DefaultFont.getStyle();
Expand Down Expand Up @@ -501,6 +505,16 @@ private void initComponents() {
Utils.addComponent(panelGeneral, spinThresholdAsk, 1, line++, 1, 1, 0, 0, 2, 5, 0, 10,
GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);

// -- Minimum Threshold for climb calculation
lbThresholdClimb = new javax.swing.JLabel();
lbThresholdClimb.setText(bundle.getString("frmSettings.lbThresholdClimb.Text"));
Utils.addComponent(panelGeneral, lbThresholdClimb, 0, line, 1, 1, 1, 0, 2, 10, 0, 0,
GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);

spinThresholdClimb = new CgSpinner(CgConst.MIN_ELEV, 1, 100, 1);
Utils.addComponent(panelGeneral, spinThresholdClimb, 1, line++, 1, 1, 0, 0, 2, 5, 0, 10,
GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);

// -- Check for update
lbCheck = new javax.swing.JLabel();
lbCheck.setText(bundle.getString("frmSettings.lbCheck.text"));
Expand Down
2 changes: 1 addition & 1 deletion src/course_generator/utils/CgConst.java
Expand Up @@ -62,7 +62,7 @@ public class CgConst {
public static final double MAX_CLIMB = 50.0;

/** Delta value for the total elevation calculation **/
public static final double MIN_ELEV = 10.0;
public static final int MIN_ELEV = 10;

/** Tickness of the track on the map **/
public static final int TRACK_NORMAL_TICKNESS = 3;
Expand Down
4 changes: 2 additions & 2 deletions tools/CG_Install_Script.nsi
Expand Up @@ -12,8 +12,8 @@
!define DESCRIPTION "Calcul de vos temps parcours / Calculate your track time"
# These three must be integers
!define VERSIONMAJOR 4
!define VERSIONMINOR 4
!define VERSIONBUILD 1
!define VERSIONMINOR 5
!define VERSIONBUILD 0
# These will be displayed by the "Click here for support information" link in "Add/Remove Programs"
# It is possible to use "mailto:" links in here to open the email client
!define HELPURL "https://techandrun.com/course-generator/" # "Support Information" link
Expand Down

0 comments on commit bd77e19

Please sign in to comment.