Skip to content

Commit

Permalink
TourChart Pauses Improvement: Added a tour pauses slideout to know th…
Browse files Browse the repository at this point in the history
…e start and end times of a given pause (#394)
  • Loading branch information
FJBDev committed Sep 14, 2021
1 parent 75fcb33 commit 4a509d9
Show file tree
Hide file tree
Showing 66 changed files with 2,268 additions and 855 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ public class Messages extends NLS {
public static String Graph_Label_RunDyn_StepLength;
public static String Graph_Label_RunDyn_VerticalRatio;
public static String Graph_Label_RunDyn_VerticalOscillation;
public static String Graph_Label_StartTime;
public static String Graph_Label_EndTime;
public static String Graph_Label_Swim_Strokes;
public static String Graph_Label_Swim_Swolf;
public static String Graph_Label_Training_Effect_Aerob;
Expand Down
4 changes: 2 additions & 2 deletions bundles/net.tourbook.common/src/net/tourbook/common/UI.java
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ public static float convertBodyWeightToMetric(final float weight) {
private static int convertHorizontalDLUsToPixels(final FontMetrics fontMetrics, final int dlus) {

// round to the nearest pixel
return (int) ((fontMetrics.getAverageCharacterWidth() * dlus + HORIZONTAL_DIALOG_UNIT_PER_CHAR / 2)
return (int) ((fontMetrics.getAverageCharacterWidth() * dlus + HORIZONTAL_DIALOG_UNIT_PER_CHAR / 2.0)
/ HORIZONTAL_DIALOG_UNIT_PER_CHAR);
}

Expand Down Expand Up @@ -2027,7 +2027,7 @@ public static float scrambleNumbers(final float number) {

public static int scrambleNumbers(final int number) {

return (int) (RANDOM_GENERATOR.nextFloat() * number);
return RANDOM_GENERATOR.nextInt() * number;
}

public static long scrambleNumbers(final long number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Graph_Label_Cadence_Unit_RpmSpm = rpm/spm
Graph_Label_Cadence_Unit_Spm = spm
Graph_Label_Distance = Distance
Graph_Label_ElevationGain = Elevation Gain
Graph_Label_EndTime = End Time
Graph_Label_Gears = Gear Ratio
Graph_Label_Geo_Compare_Unit = Geo \u2206
Graph_Label_Gradient = Gradient
Expand All @@ -145,6 +146,7 @@ Graph_Label_RunDyn_StepLength = Step Length
Graph_Label_RunDyn_VerticalOscillation = Vertical Oscillation
Graph_Label_RunDyn_VerticalRatio = Vertical Ratio
Graph_Label_Speed = Speed
Graph_Label_StartTime = Start Time
Graph_Label_Swim_Strokes = Strokes
Graph_Label_Swim_Swolf = Swolf
Graph_Label_Temperature = Temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Graph_Label_Cadence_Unit_RpmSpm = rpm/ppm
Graph_Label_Cadence_Unit_Spm = ppm
Graph_Label_Distance = Distance
Graph_Label_ElevationGain = D\u00E9nivel\u00E9 positif
Graph_Label_EndTime = Heure de fin
Graph_Label_Gears = Braquet
Graph_Label_Geo_Compare_Unit = Geo \u2206
Graph_Label_Gradient = Pente
Expand All @@ -143,6 +144,7 @@ Graph_Label_RunDyn_StepLength = Amplitude des foul\u00E9es
Graph_Label_RunDyn_VerticalOscillation = Oscillation Verticale
Graph_Label_RunDyn_VerticalRatio = Ratio Vertical
Graph_Label_Speed = Vitesse
Graph_Label_StartTime = Heure de d\u00E9but
Graph_Label_Swim_Strokes = Mouvements
Graph_Label_Swim_Swolf = Swolf
Graph_Label_Temperature = Temp\u00E9rature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import net.tourbook.importdata.RawDataManager;
import net.tourbook.importdata.TourTypeWrapper;
import net.tourbook.tour.TourLogManager;
import net.tourbook.ui.tourChart.ChartLabel;
import net.tourbook.ui.tourChart.ChartLabelMarker;

import org.eclipse.jface.preference.IPreferenceStore;

Expand Down Expand Up @@ -630,7 +630,7 @@ public void onSetup_Lap_10_Initialize() {

final List<TourMarker> tourMarkers = _allTourMarker;

_current_TourMarker = new TourMarker(_tourData, ChartLabel.MARKER_TYPE_DEVICE);
_current_TourMarker = new TourMarker(_tourData, ChartLabelMarker.MARKER_TYPE_DEVICE);

tourMarkers.add(_current_TourMarker);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

public class MesgListener_DeviceInfo extends AbstractMesgListener implements DeviceInfoMesgListener {

private static final String _10S = " %10s"; //$NON-NLS-1$
private static final String FORMAT_STRING_10 = " %10s"; //$NON-NLS-1$
private static final String FORMAT_FLOAT_10_3 = "%10.3f"; //$NON-NLS-1$
private static final String LOG_SEPARATOR = "\t"; //$NON-NLS-1$

Expand Down Expand Up @@ -160,33 +160,33 @@ public void onMesg(final DeviceInfoMesg mesg) {
+ "%s" + LOG_SEPARATOR // date time //$NON-NLS-1$

+ " prod:" + LOG_SEPARATOR //$NON-NLS-1$
+ _10S + LOG_SEPARATOR // manufacturer
+ _10S + LOG_SEPARATOR // product
+ _10S + LOG_SEPARATOR // prduct name
+ _10S + LOG_SEPARATOR // garmin product
+ _10S + LOG_SEPARATOR // descriptor
+ FORMAT_STRING_10 + LOG_SEPARATOR // manufacturer
+ FORMAT_STRING_10 + LOG_SEPARATOR // product
+ FORMAT_STRING_10 + LOG_SEPARATOR // prduct name
+ FORMAT_STRING_10 + LOG_SEPARATOR // garmin product
+ FORMAT_STRING_10 + LOG_SEPARATOR // descriptor

+ " ser:" + LOG_SEPARATOR //$NON-NLS-1$
+ _10S + LOG_SEPARATOR // serial no
+ _10S + LOG_SEPARATOR // device index
+ _10S + LOG_SEPARATOR // hardware version
+ _10S + LOG_SEPARATOR // software version
+ FORMAT_STRING_10 + LOG_SEPARATOR // serial no
+ FORMAT_STRING_10 + LOG_SEPARATOR // device index
+ FORMAT_STRING_10 + LOG_SEPARATOR // hardware version
+ FORMAT_STRING_10 + LOG_SEPARATOR // software version

+ " bat:" + LOG_SEPARATOR //$NON-NLS-1$
+ _10S + LOG_SEPARATOR // battery status
+ _10S + LOG_SEPARATOR // battery voltage
+ _10S + LOG_SEPARATOR // cummulated operating time
+ FORMAT_STRING_10 + LOG_SEPARATOR // battery status
+ FORMAT_STRING_10 + LOG_SEPARATOR // battery voltage
+ FORMAT_STRING_10 + LOG_SEPARATOR // cummulated operating time

+ " ant:" + LOG_SEPARATOR //$NON-NLS-1$
+ _10S + LOG_SEPARATOR // source type
+ _10S + LOG_SEPARATOR // ant network
+ _10S + LOG_SEPARATOR // ant device type
+ _10S + LOG_SEPARATOR // ant device nummer
+ _10S + LOG_SEPARATOR // ant plus
+ _10S + LOG_SEPARATOR // ant transmision type
+ FORMAT_STRING_10 + LOG_SEPARATOR // source type
+ FORMAT_STRING_10 + LOG_SEPARATOR // ant network
+ FORMAT_STRING_10 + LOG_SEPARATOR // ant device type
+ FORMAT_STRING_10 + LOG_SEPARATOR // ant device nummer
+ FORMAT_STRING_10 + LOG_SEPARATOR // ant plus
+ FORMAT_STRING_10 + LOG_SEPARATOR // ant transmision type

+ " src:" //$NON-NLS-1$
+ _10S + LOG_SEPARATOR // sensorPosition
+ FORMAT_STRING_10 + LOG_SEPARATOR // sensorPosition

,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public void run() {
Messages.Garmin_Transfer_ErrorReceivingData,
new Status(Status.ERROR,
Activator.PLUGIN_ID,
Messages.Garmin_Transfer_CommuicationError,
Messages.Garmin_Transfer_CommunicationError,
ex));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Messages extends NLS {
public static String GarminTCX_SAXHandler_FileIsEmpty;
public static String GarminTCX_SAXHandler_InvalidDate_2007_04_01;

public static String Garmin_Transfer_CommuicationError;
public static String Garmin_Transfer_CommunicationError;
public static String Garmin_Transfer_DataFrom;
public static String Garmin_Transfer_DataTransferError;
public static String Garmin_Transfer_ErrorReceivingData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
GarminTCX_SAXHandler_FileIsEmpty = [TCX] %s - is empty
GarminTCX_SAXHandler_InvalidDate_2007_04_01 = [TCX] %s - starts with the date 2007-04-01 which is probably wrong. The date is adjusted to the first occurrence of a different date which is: %s

Garmin_Transfer_CommuicationError = A communication error occurred.
Garmin_Transfer_CommunicationError = A communication error occurred.
Garmin_Transfer_DataFrom = Transfer data from:
Garmin_Transfer_DataTransferError = Data Transfer Error
Garmin_Transfer_ErrorReceivingData = An error occurred while receiving data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GarminTCX_SAXHandler_FileIsEmpty = \
GarminTCX_SAXHandler_InvalidDate_2007_04_01 = [TCX] %s - za\u010D\u00EDn\u00E1 datem 2007-04-01, kter\u00FD je pravd\u011Bpodobn\u011B \u0161patn\u011B. Datum bude upraven na jin\u00E9 datum, \
kter\u00E9 je: %s

Garmin_Transfer_CommuicationError = Do\u0161lo k chyb\u011B komunikace.
Garmin_Transfer_CommunicationError = Do\u0161lo k chyb\u011B komunikace.
Garmin_Transfer_DataFrom = P\u0159enos dat z:
Garmin_Transfer_DataTransferError = Chyba p\u0159enosu dat
Garmin_Transfer_ErrorReceivingData = Nastala chyba p\u0159i p\u0159enosu dat.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
GarminTCX_SAXHandler_FileIsEmpty = [TCX] %s - ist leer
GarminTCX_SAXHandler_InvalidDate_2007_04_01 = [TCX] %s - startet mit dem Datum 2007-04-01, das Datum wird aber eingestellt auf: %s

Garmin_Transfer_CommuicationError = Ein Fehler bei der Daten\u00FCbertragung ist aufgetreten.
Garmin_Transfer_CommunicationError = Ein Fehler bei der Daten\u00FCbertragung ist aufgetreten.
Garmin_Transfer_DataFrom = \u00DCbertrage Daten von:
Garmin_Transfer_DataTransferError = Fehler bei Daten\u00FCbertragung
Garmin_Transfer_ErrorReceivingData = Es ist ein Fehler w\u00E4hrend der Daten\u00FCbertragung aufgetreten.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

GarminTCX_SAXHandler_InvalidDate_2007_04_01 = [TCX] %s - comienza con la fecha 2007-04-01 que es probablemente erroneo. La fecha es ajustada a la primera: %s

Garmin_Transfer_CommuicationError = Ha ocurrido un error de comunicaci\u00F3n.
Garmin_Transfer_CommunicationError = Ha ocurrido un error de comunicaci\u00F3n.
Garmin_Transfer_DataFrom = Transferir datos de:
Garmin_Transfer_DataTransferError = Error de Transferencia de Datos
Garmin_Transfer_ErrorReceivingData = Ha ocurrido un error recibiendo los datos.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

GarminTCX_SAXHandler_InvalidDate_2007_04_01 = [TCX] %s - commence avec la date 2007-04-01 ce qui est probablement erron\u00E9e. La date est ajust\u00E9e au %s

Garmin_Transfer_CommuicationError = Une erreur de communication s'est produite.
Garmin_Transfer_CommunicationError = Une erreur de communication s'est produite.
Garmin_Transfer_DataFrom = Transfert de donn\u00E9es \u00E0 partir de:
Garmin_Transfer_DataTransferError = Erreur de transfert de donn\u00E9es
Garmin_Transfer_ErrorReceivingData = Une erreur s'est produite lors de la r\u00E9ception de donn\u00E9es.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
GarminTCX_SAXHandler_InvalidDate_2007_04_01 = [TCX] %s - inizia con la data 2007-04-01 che \u00E8 probabilmente sbagliata. La data \u00E8 stata modificata alla prima occorrenza di una data \
differente, che \u00E8 la seguente: %s

Garmin_Transfer_CommuicationError = Si \u00E8 verificato un errore di comunicazione
Garmin_Transfer_CommunicationError = Si \u00E8 verificato un errore di comunicazione
Garmin_Transfer_DataFrom = Trasferimento dati da:
Garmin_Transfer_DataTransferError = Errore nel trasferimento dati
Garmin_Transfer_ErrorReceivingData = Si \u00E8 verificato un errore durante il trasferimento dei dati
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

GarminTCX_SAXHandler_InvalidDate_2007_04_01 = [TCX] %s - start met de datum 2007-04-01 wat niet correct lijkt. De datum werd op gezet: %s

Garmin_Transfer_CommuicationError = Er is een fout bij de datatransmissie opgetreden.
Garmin_Transfer_CommunicationError = Er is een fout bij de datatransmissie opgetreden.
Garmin_Transfer_DataFrom = Gegevensoverdracht van:
Garmin_Transfer_DataTransferError = Fout bij gegevensoverdracht
Garmin_Transfer_ErrorReceivingData = Er is een fout bij de gegevensoverdracht opgetreden.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import net.tourbook.importdata.SerialParameters;
import net.tourbook.importdata.TourbookDevice;
import net.tourbook.ui.UI;
import net.tourbook.ui.tourChart.ChartLabel;
import net.tourbook.ui.tourChart.ChartLabelMarker;

public class CRPDataReader extends TourbookDevice {

Expand Down Expand Up @@ -137,7 +137,7 @@ public void processDeviceData(final String importFilePath,
if (line.equals("***")) { //$NON-NLS-1$
break;
}
allTrackPoints.add(line.toString());
allTrackPoints.add(line);
}

// skip line
Expand Down Expand Up @@ -336,7 +336,7 @@ public void processDeviceData(final String importFilePath,
timeData.marker = 1;

// create a new marker
final TourMarker tourMarker = new TourMarker(tourData, ChartLabel.MARKER_TYPE_DEVICE);
final TourMarker tourMarker = new TourMarker(tourData, ChartLabelMarker.MARKER_TYPE_DEVICE);
tourMarker.setLabel(comment);
tourMarker.setTime(tourTime, Long.MIN_VALUE);
tourMarker.setDistance(timeData.distance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import net.tourbook.importdata.SerialParameters;
import net.tourbook.importdata.TourbookDevice;
import net.tourbook.ui.UI;
import net.tourbook.ui.tourChart.ChartLabel;
import net.tourbook.ui.tourChart.ChartLabelMarker;

public class HAC4LinuxDeviceReader extends TourbookDevice {

Expand Down Expand Up @@ -96,61 +96,61 @@ public boolean checkStartSequence(final int byteIndex, final int newByte) {
/*
* Files start with HAC4Linux-Tour-File created by HAC4Linux (c) by Rick-Rainer Ludwig
*/
if (byteIndex == 0 & newByte == 'H') {
if (byteIndex == 0 && newByte == 'H') {
return true;
}
if (byteIndex == 1 & newByte == 'A') {
if (byteIndex == 1 && newByte == 'A') {
return true;
}
if (byteIndex == 2 & newByte == 'C') {
if (byteIndex == 2 && newByte == 'C') {
return true;
}
if (byteIndex == 3 & newByte == '4') {
if (byteIndex == 3 && newByte == '4') {
return true;
}
if (byteIndex == 4 & newByte == 'L') {
if (byteIndex == 4 && newByte == 'L') {
return true;
}
if (byteIndex == 5 & newByte == 'i') {
if (byteIndex == 5 && newByte == 'i') {
return true;
}
if (byteIndex == 6 & newByte == 'n') {
if (byteIndex == 6 && newByte == 'n') {
return true;
}
if (byteIndex == 7 & newByte == 'u') {
if (byteIndex == 7 && newByte == 'u') {
return true;
}
if (byteIndex == 8 & newByte == 'x') {
if (byteIndex == 8 && newByte == 'x') {
return true;
}
if (byteIndex == 9 & newByte == '-') {
if (byteIndex == 9 && newByte == '-') {
return true;
}
if (byteIndex == 10 & newByte == 'T') {
if (byteIndex == 10 && newByte == 'T') {
return true;
}
if (byteIndex == 11 & newByte == 'o') {
if (byteIndex == 11 && newByte == 'o') {
return true;
}
if (byteIndex == 12 & newByte == 'u') {
if (byteIndex == 12 && newByte == 'u') {
return true;
}
if (byteIndex == 13 & newByte == 'r') {
if (byteIndex == 13 && newByte == 'r') {
return true;
}
if (byteIndex == 14 & newByte == '-') {
if (byteIndex == 14 && newByte == '-') {
return true;
}
if (byteIndex == 15 & newByte == 'F') {
if (byteIndex == 15 && newByte == 'F') {
return true;
}
if (byteIndex == 16 & newByte == 'i') {
if (byteIndex == 16 && newByte == 'i') {
return true;
}
if (byteIndex == 17 & newByte == 'l') {
if (byteIndex == 17 && newByte == 'l') {
return true;
}
if (byteIndex == 18 & newByte == 'e') {
if (byteIndex == 18 && newByte == 'e') {
return true;
}

Expand Down Expand Up @@ -570,7 +570,7 @@ public void processDeviceData(final String importFilePath,
if (fields.length < 4) {
break;
}
final TourMarker tourMarker = new TourMarker(tourData, ChartLabel.MARKER_TYPE_DEVICE);
final TourMarker tourMarker = new TourMarker(tourData, ChartLabelMarker.MARKER_TYPE_DEVICE);
final int markerIndex = Integer.parseInt(fields[1]);
tourMarker.setSerieIndex(markerIndex);
tourMarker.setLabel(fields[0].substring(1, fields[0].length()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import net.tourbook.data.TourMarker;
import net.tourbook.importdata.ImportState_File;
import net.tourbook.importdata.ImportState_Process;
import net.tourbook.ui.tourChart.ChartLabel;
import net.tourbook.ui.tourChart.ChartLabelMarker;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osgi.util.NLS;
Expand Down Expand Up @@ -666,11 +666,11 @@ private void createTourData_30_CreateMarkers(final TourData tourData) {
}

if (markerText == null) {
// set lap number as label when label is not definded in the polar data
// set lap number as label when label is not defined in the polar data
markerText = Integer.toString(lapCounter);
}

final TourMarker tourMarker = new TourMarker(tourData, ChartLabel.MARKER_TYPE_DEVICE);
final TourMarker tourMarker = new TourMarker(tourData, ChartLabelMarker.MARKER_TYPE_DEVICE);
tourMarker.setLabel(markerText);
tourMarker.setSerieIndex(serieIndex);
tourMarker.setTime(lapRelativeTime, tourData.getTourStartTimeMS() + (lapRelativeTime * 1000));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import net.tourbook.importdata.ImportState_Process;
import net.tourbook.importdata.RawDataManager;
import net.tourbook.importdata.TourTypeWrapper;
import net.tourbook.ui.tourChart.ChartLabel;
import net.tourbook.ui.tourChart.ChartLabelMarker;

import org.eclipse.osgi.util.NLS;
import org.xml.sax.Attributes;
Expand Down Expand Up @@ -586,7 +586,7 @@ private void finalizeTour_20_CreateMarkers(final TourData tourData) {
serieIndex = timeSerie.length - 1;
}

final TourMarker tourMarker = new TourMarker(tourData, ChartLabel.MARKER_TYPE_DEVICE);
final TourMarker tourMarker = new TourMarker(tourData, ChartLabelMarker.MARKER_TYPE_DEVICE);

tourMarker.setLabel(Integer.toString(lapCounter));
tourMarker.setSerieIndex(serieIndex);
Expand Down

0 comments on commit 4a509d9

Please sign in to comment.