mirror of
https://github.com/dyuri/garmin-repafield.git
synced 2025-12-16 19:24:01 +00:00
#8 summary/lap fit fix
This commit is contained in:
parent
9258c4eda0
commit
47e74c8dfe
@ -8,27 +8,17 @@
|
|||||||
dataLabel="@Strings.chartGrade"
|
dataLabel="@Strings.chartGrade"
|
||||||
unitLabel="@Strings.uGrade"
|
unitLabel="@Strings.uGrade"
|
||||||
fillColor="#00FFFF" />
|
fillColor="#00FFFF" />
|
||||||
<fitField id="5"
|
<fitField id="3"
|
||||||
displayInActivitySummary="true"
|
displayInActivitySummary="true"
|
||||||
sortOrder="5"
|
displayInActivityLaps="false"
|
||||||
precision="2"
|
displayInChart="false"
|
||||||
dataLabel="@Strings.fitMinGrade"
|
sortOrder="3"
|
||||||
unitLabel="@Strings.uGrade" />
|
|
||||||
<fitField id="6"
|
|
||||||
displayInActivitySummary="true"
|
|
||||||
sortOrder="6"
|
|
||||||
precision="2"
|
|
||||||
dataLabel="@Strings.fitMaxGrade"
|
|
||||||
unitLabel="@Strings.uGrade" />
|
|
||||||
<fitField id="7"
|
|
||||||
displayInActivitySummary="true"
|
|
||||||
sortOrder="7"
|
|
||||||
precision="2"
|
precision="2"
|
||||||
dataLabel="@Strings.fitAGrade"
|
dataLabel="@Strings.fitAGrade"
|
||||||
unitLabel="@Strings.uGrade" />
|
unitLabel="@Strings.uGrade" />
|
||||||
<fitField id="8"
|
<fitField id="4"
|
||||||
displayInActivityLaps="true"
|
displayInActivityLaps="true"
|
||||||
sortOrder="8"
|
sortOrder="4"
|
||||||
precision="2"
|
precision="2"
|
||||||
dataLabel="@Strings.fitAGrade"
|
dataLabel="@Strings.fitAGrade"
|
||||||
unitLabel="@Strings.uGrade" />
|
unitLabel="@Strings.uGrade" />
|
||||||
@ -41,18 +31,6 @@
|
|||||||
dataLabel="@Strings.chartGAP"
|
dataLabel="@Strings.chartGAP"
|
||||||
unitLabel="@Strings.uGAP"
|
unitLabel="@Strings.uGAP"
|
||||||
fillColor="#AAFF44" />
|
fillColor="#AAFF44" />
|
||||||
<fitField id="3"
|
|
||||||
displayInActivitySummary="true"
|
|
||||||
sortOrder="3"
|
|
||||||
precision="2"
|
|
||||||
dataLabel="@Strings.fitAGAP"
|
|
||||||
unitLabel="@Strings.uGAP" />
|
|
||||||
<fitField id="4"
|
|
||||||
displayInActivityLaps="true"
|
|
||||||
sortOrder="4"
|
|
||||||
precision="2"
|
|
||||||
dataLabel="@Strings.fitAGAP"
|
|
||||||
unitLabel="@Strings.uGAP" />
|
|
||||||
<!-- vertical speed -->
|
<!-- vertical speed -->
|
||||||
<fitField id="2"
|
<fitField id="2"
|
||||||
displayInChart="true"
|
displayInChart="true"
|
||||||
@ -62,27 +40,15 @@
|
|||||||
dataLabel="@Strings.chartVSpeed"
|
dataLabel="@Strings.chartVSpeed"
|
||||||
unitLabel="@Strings.uVSpeed"
|
unitLabel="@Strings.uVSpeed"
|
||||||
fillColor="#FF8888" />
|
fillColor="#FF8888" />
|
||||||
<fitField id="9"
|
<fitField id="5"
|
||||||
displayInActivitySummary="true"
|
displayInActivitySummary="true"
|
||||||
sortOrder="9"
|
sortOrder="5"
|
||||||
precision="2"
|
|
||||||
dataLabel="@Strings.fitMinVSpeed"
|
|
||||||
unitLabel="@Strings.uVSpeed" />
|
|
||||||
<fitField id="10"
|
|
||||||
displayInActivitySummary="true"
|
|
||||||
sortOrder="10"
|
|
||||||
precision="2"
|
|
||||||
dataLabel="@Strings.fitMaxVSpeed"
|
|
||||||
unitLabel="@Strings.uVSpeed" />
|
|
||||||
<fitField id="11"
|
|
||||||
displayInActivitySummary="true"
|
|
||||||
sortOrder="11"
|
|
||||||
precision="2"
|
precision="2"
|
||||||
dataLabel="@Strings.fitAVSpeed"
|
dataLabel="@Strings.fitAVSpeed"
|
||||||
unitLabel="@Strings.uVSpeed" />
|
unitLabel="@Strings.uVSpeed" />
|
||||||
<fitField id="12"
|
<fitField id="6"
|
||||||
displayInActivityLaps="true"
|
displayInActivityLaps="true"
|
||||||
sortOrder="12"
|
sortOrder="6"
|
||||||
precision="2"
|
precision="2"
|
||||||
dataLabel="@Strings.fitAVSpeed"
|
dataLabel="@Strings.fitAVSpeed"
|
||||||
unitLabel="@Strings.uVSpeed" />
|
unitLabel="@Strings.uVSpeed" />
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<property id="appVersion" type="string">2.0.0</property>
|
<property id="appVersion" type="string">2.0.1</property>
|
||||||
<property id="themeColor" type="string">0</property>
|
<property id="themeColor" type="string">0</property>
|
||||||
<property id="themeColor2" type="string">0088FF</property>
|
<property id="themeColor2" type="string">0088FF</property>
|
||||||
<property id="themeColor3" type="string">00AA55</property>
|
<property id="themeColor3" type="string">00AA55</property>
|
||||||
<property id="hrDisplay" type="number">0</property>
|
<property id="hrDisplay" type="number">0</property>
|
||||||
<property id="speedNotPace" type="boolean">false</property>
|
<property id="speedNotPace" type="boolean">false</property>
|
||||||
<property id="showNextPoint" type="boolean">true</property>
|
<property id="showNextPoint" type="boolean">true</property>
|
||||||
<property id="saveToFit" type="boolean">false</property>
|
<property id="saveToFit" type="boolean">true</property>
|
||||||
<property id="tlFieldData" type="number">1</property>
|
<property id="tlFieldData" type="number">1</property>
|
||||||
</properties>
|
</properties>
|
||||||
|
|||||||
@ -59,9 +59,11 @@ class Track extends WatchUi.Drawable {
|
|||||||
var astart = 150;
|
var astart = 150;
|
||||||
var aend = 390;
|
var aend = 390;
|
||||||
var offtrack = _offCourse > 50.0f;
|
var offtrack = _offCourse > 50.0f;
|
||||||
dc.setPenWidth((dc.getWidth() * 0.01).toNumber());
|
dc.setPenWidth((dc.getWidth() * 0.01).toNumber() + 1);
|
||||||
dc.setColor(offtrack ? 0x880000 : 0x555555, Graphics.COLOR_TRANSPARENT);
|
dc.setColor(offtrack ? 0x880000 : 0x555555, Graphics.COLOR_TRANSPARENT);
|
||||||
dc.drawArc(w / 2, h / 2, w / 2 - 2, Graphics.ARC_COUNTER_CLOCKWISE, astart, aend);
|
// the center is between two points, so draw twice
|
||||||
|
dc.drawArc(w / 2 - 1, h / 2, w / 2 - 1, Graphics.ARC_COUNTER_CLOCKWISE, astart, aend);
|
||||||
|
dc.drawArc(w / 2, h / 2, w / 2 - 1, Graphics.ARC_COUNTER_CLOCKWISE, astart, aend);
|
||||||
|
|
||||||
if (trackPercentage <= 0.0f) {
|
if (trackPercentage <= 0.0f) {
|
||||||
return;
|
return;
|
||||||
@ -88,7 +90,8 @@ class Track extends WatchUi.Drawable {
|
|||||||
} else if (acurrent > aend) {
|
} else if (acurrent > aend) {
|
||||||
acurrent = aend;
|
acurrent = aend;
|
||||||
}
|
}
|
||||||
dc.drawArc(w / 2, h / 2, w / 2 - 2, Graphics.ARC_COUNTER_CLOCKWISE, astart, acurrent);
|
dc.drawArc(w / 2 - 1, h / 2, w / 2 - 1, Graphics.ARC_COUNTER_CLOCKWISE, astart, acurrent);
|
||||||
|
dc.drawArc(w / 2, h / 2, w / 2 - 1, Graphics.ARC_COUNTER_CLOCKWISE, astart, acurrent);
|
||||||
|
|
||||||
// next point
|
// next point
|
||||||
if (_toNextPoint > 0.0f) {
|
if (_toNextPoint > 0.0f) {
|
||||||
@ -101,8 +104,15 @@ class Track extends WatchUi.Drawable {
|
|||||||
anext = aend;
|
anext = aend;
|
||||||
}
|
}
|
||||||
dc.setPenWidth((dc.getWidth() * 0.01).toNumber());
|
dc.setPenWidth((dc.getWidth() * 0.01).toNumber());
|
||||||
dc.setColor(offtrack ? 0xAA0000 : 0xAAAAAA, Graphics.COLOR_TRANSPARENT);
|
if (offtrack) {
|
||||||
dc.drawArc(w / 2, h / 2, w / 2 - 2, Graphics.ARC_COUNTER_CLOCKWISE, acurrent, anext);
|
dc.setColor(0xAA0000, Graphics.COLOR_TRANSPARENT);
|
||||||
|
} else if (_toNextPoint > 500) {
|
||||||
|
dc.setColor(0xAAAAAA, Graphics.COLOR_TRANSPARENT);
|
||||||
|
} else {
|
||||||
|
dc.setColor(0xAAFF44, Graphics.COLOR_TRANSPARENT);
|
||||||
|
}
|
||||||
|
dc.drawArc(w / 2, h / 2, w / 2 - 1, Graphics.ARC_COUNTER_CLOCKWISE, acurrent, anext);
|
||||||
|
dc.drawArc(w / 2 - 1, h / 2, w / 2 - 1, Graphics.ARC_COUNTER_CLOCKWISE, acurrent, anext);
|
||||||
|
|
||||||
// next point name
|
// next point name
|
||||||
if (_showNextPoint && _font != null && h > 350) {
|
if (_showNextPoint && _font != null && h > 350) {
|
||||||
@ -112,7 +122,7 @@ class Track extends WatchUi.Drawable {
|
|||||||
} else if (_nextPointName.length() > 20) {
|
} else if (_nextPointName.length() > 20) {
|
||||||
pointText += " | " + _nextPointName.substring(0, 17) + "...";
|
pointText += " | " + _nextPointName.substring(0, 17) + "...";
|
||||||
}
|
}
|
||||||
if (_toNextPoint > 1000) {
|
if (_toNextPoint > 500) {
|
||||||
dc.setColor(0x88FFFF, Graphics.COLOR_TRANSPARENT);
|
dc.setColor(0x88FFFF, Graphics.COLOR_TRANSPARENT);
|
||||||
} else {
|
} else {
|
||||||
dc.setColor(0xAAFF44, Graphics.COLOR_TRANSPARENT);
|
dc.setColor(0xAAFF44, Graphics.COLOR_TRANSPARENT);
|
||||||
|
|||||||
@ -16,18 +16,12 @@ const TLF_GAP = 2;
|
|||||||
const TLF_VSPEED = 3;
|
const TLF_VSPEED = 3;
|
||||||
|
|
||||||
const FIT_GRADE_ID = 0;
|
const FIT_GRADE_ID = 0;
|
||||||
const FIT_GRADE_SUM_MIN_ID = 5;
|
const FIT_GRADE_SUM_AVG_ID = 3;
|
||||||
const FIT_GRADE_SUM_MAX_ID = 6;
|
const FIT_GRADE_LAP_AVG_ID = 4;
|
||||||
const FIT_GRADE_SUM_AVG_ID = 7;
|
|
||||||
const FIT_GRADE_LAP_AVG_ID = 8;
|
|
||||||
const FIT_GAP_ID = 1;
|
const FIT_GAP_ID = 1;
|
||||||
const FIT_GAP_SUM_AVG_ID = 3;
|
|
||||||
const FIT_GAP_LAP_AVG_ID = 4;
|
|
||||||
const FIT_VSPEED_ID = 2;
|
const FIT_VSPEED_ID = 2;
|
||||||
const FIT_VSPEED_SUM_MIN_ID = 9;
|
const FIT_VSPEED_SUM_AVG_ID = 5;
|
||||||
const FIT_VSPEED_SUM_MAX_ID = 10;
|
const FIT_VSPEED_LAP_AVG_ID = 6;
|
||||||
const FIT_VSPEED_SUM_AVG_ID = 11;
|
|
||||||
const FIT_VSPEED_LAP_AVG_ID = 12;
|
|
||||||
|
|
||||||
function displayHr(hr as Number, type as Number, zones as Array<Number>) as String {
|
function displayHr(hr as Number, type as Number, zones as Array<Number>) as String {
|
||||||
if (hr == 0) {
|
if (hr == 0) {
|
||||||
@ -191,7 +185,7 @@ class RepaFieldView extends WatchUi.DataField {
|
|||||||
fitVSpeedSumAvg = null;
|
fitVSpeedSumAvg = null;
|
||||||
fitVSpeedLapAvg = null;
|
fitVSpeedLapAvg = null;
|
||||||
if (Application.Properties.getValue("saveToFit")) {
|
if (Application.Properties.getValue("saveToFit")) {
|
||||||
fitGrade = DataField.createField(
|
fitGrade = createField(
|
||||||
"grade",
|
"grade",
|
||||||
FIT_GRADE_ID,
|
FIT_GRADE_ID,
|
||||||
FitContributor.DATA_TYPE_FLOAT,
|
FitContributor.DATA_TYPE_FLOAT,
|
||||||
@ -200,25 +194,25 @@ class RepaFieldView extends WatchUi.DataField {
|
|||||||
:units=>"%",
|
:units=>"%",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fitGradeSumAvg = DataField.createField(
|
fitGradeSumAvg = createField(
|
||||||
"avg_grade",
|
"avg_grade",
|
||||||
FIT_GRADE_SUM_AVG_ID,
|
FIT_GRADE_SUM_AVG_ID,
|
||||||
FitContributor.DATA_TYPE_FLOAT,
|
FitContributor.DATA_TYPE_FLOAT,
|
||||||
{
|
{
|
||||||
:mesgType=>FitContributor.MESG_TYPE_RECORD,
|
:mesgType=>FitContributor.MESG_TYPE_SESSION,
|
||||||
:units=>"%",
|
:units=>"%",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fitGradeLapAvg = DataField.createField(
|
fitGradeLapAvg = createField(
|
||||||
"avg_grade",
|
"lap_avg_grade",
|
||||||
FIT_GRADE_LAP_AVG_ID,
|
FIT_GRADE_LAP_AVG_ID,
|
||||||
FitContributor.DATA_TYPE_FLOAT,
|
FitContributor.DATA_TYPE_FLOAT,
|
||||||
{
|
{
|
||||||
:mesgType=>FitContributor.MESG_TYPE_RECORD,
|
:mesgType=>FitContributor.MESG_TYPE_LAP,
|
||||||
:units=>"%",
|
:units=>"%",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fitGAP = DataField.createField(
|
fitGAP = createField(
|
||||||
"gap",
|
"gap",
|
||||||
FIT_GAP_ID,
|
FIT_GAP_ID,
|
||||||
FitContributor.DATA_TYPE_FLOAT,
|
FitContributor.DATA_TYPE_FLOAT,
|
||||||
@ -227,7 +221,7 @@ class RepaFieldView extends WatchUi.DataField {
|
|||||||
:units=>isPaceMetric ? "min/km" : "min/mi",
|
:units=>isPaceMetric ? "min/km" : "min/mi",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fitVSpeed = DataField.createField(
|
fitVSpeed = createField(
|
||||||
"vspeed",
|
"vspeed",
|
||||||
FIT_VSPEED_ID,
|
FIT_VSPEED_ID,
|
||||||
FitContributor.DATA_TYPE_FLOAT,
|
FitContributor.DATA_TYPE_FLOAT,
|
||||||
@ -236,21 +230,21 @@ class RepaFieldView extends WatchUi.DataField {
|
|||||||
:units=>isElevationMetric ? "m/min" : "ft/min",
|
:units=>isElevationMetric ? "m/min" : "ft/min",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fitVSpeedSumAvg = DataField.createField(
|
fitVSpeedSumAvg = createField(
|
||||||
"avg_vspeed",
|
"avg_vspeed",
|
||||||
FIT_VSPEED_SUM_AVG_ID,
|
FIT_VSPEED_SUM_AVG_ID,
|
||||||
FitContributor.DATA_TYPE_FLOAT,
|
FitContributor.DATA_TYPE_FLOAT,
|
||||||
{
|
{
|
||||||
:mesgType=>FitContributor.MESG_TYPE_RECORD,
|
:mesgType=>FitContributor.MESG_TYPE_SESSION,
|
||||||
:units=>isElevationMetric ? "m/min" : "ft/min",
|
:units=>isElevationMetric ? "m/min" : "ft/min",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fitVSpeedLapAvg = DataField.createField(
|
fitVSpeedLapAvg = createField(
|
||||||
"avg_vspeed",
|
"lap_avg_vspeed",
|
||||||
FIT_VSPEED_LAP_AVG_ID,
|
FIT_VSPEED_LAP_AVG_ID,
|
||||||
FitContributor.DATA_TYPE_FLOAT,
|
FitContributor.DATA_TYPE_FLOAT,
|
||||||
{
|
{
|
||||||
:mesgType=>FitContributor.MESG_TYPE_RECORD,
|
:mesgType=>FitContributor.MESG_TYPE_LAP,
|
||||||
:units=>isElevationMetric ? "m/min" : "ft/min",
|
:units=>isElevationMetric ? "m/min" : "ft/min",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -537,18 +531,18 @@ class RepaFieldView extends WatchUi.DataField {
|
|||||||
if (fitGrade != null) {
|
if (fitGrade != null) {
|
||||||
fitGrade.setData(cgrade ? cgrade : 0);
|
fitGrade.setData(cgrade ? cgrade : 0);
|
||||||
var gradeSumAvg = grade.totalAvg();
|
var gradeSumAvg = grade.totalAvg();
|
||||||
fitGradeSumAvg.setData(gradeSumAvg ? gradeSumAvg : 0);
|
fitGradeSumAvg.setData(gradeSumAvg ? gradeSumAvg * 100 : 0);
|
||||||
var gradeLapAvg = grade.lapAvg();
|
var gradeLapAvg = grade.lapAvg();
|
||||||
fitGradeLapAvg.setData(gradeLapAvg ? gradeLapAvg : 0);
|
fitGradeLapAvg.setData(gradeLapAvg ? gradeLapAvg * 100 : 0);
|
||||||
}
|
}
|
||||||
if (fitGAP != null) {
|
if (fitGAP != null) {
|
||||||
fitGAP.setData(cgap ? cgap : 0);
|
fitGAP.setData(cgap ? cgap : 0);
|
||||||
}
|
}
|
||||||
if (fitVSpeed != null) {
|
if (fitVSpeed != null) {
|
||||||
fitVSpeed.setData(cvspeed ? cvspeed : 0);
|
fitVSpeed.setData(cvspeed ? cvspeed : 0);
|
||||||
var vsSumAvg = grade.totalAvg();
|
var vsSumAvg = vspeed.totalAvg();
|
||||||
fitVSpeedSumAvg.setData(vsSumAvg ? vsSumAvg : 0);
|
fitVSpeedSumAvg.setData(vsSumAvg ? vsSumAvg : 0);
|
||||||
var vsLapAvg = grade.lapAvg();
|
var vsLapAvg = vspeed.lapAvg();
|
||||||
fitVSpeedLapAvg.setData(vsLapAvg ? vsLapAvg : 0);
|
fitVSpeedLapAvg.setData(vsLapAvg ? vsLapAvg : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user