mt-from-sf-to-gh / bugs

0 stars 0 forks source link

kcal divided by 1000 when importing from GPX Files #124

Closed mt-from-sf-to-gh closed 2 years ago

mt-from-sf-to-gh commented 3 years ago

hi, thank you for this great stuff.

I have found a bug when importing .gpx files with calories. Example header: <?xml version='1.0' encoding='UTF-8'?>

Mountainbike-Tour, Start: 19.03.2021 17:03:58 Baba Bafang text/html 3.661326 85.0 1282 Mountainbike-Tour, Start: 19.03.2021 17:03:58 When you import this you will see at tour import 1282 kcal. After saved for the user in the tour list the kcal is only 1 but the column is called kcal also. But when i change the value to 1282000 then the value is correct. It seems that you always divide the kcal value from the by 1000 when assigning to the user. Thank you! Reported by: hugohammer Original Ticket: [mytourbook/bugs/122](https://sourceforge.net/p/mytourbook/bugs/122)
mt-from-sf-to-gh commented 3 years ago

The custom GPX data tag mt:calories represents the value in "small calories". In the Tour Data Editor, the value is represented in "large calories", hence, if your GPX file has a mt:calories value of 1282, then the Tour Data Editor value should be 1.282

If you want the Tour Editor to display a kcal value of 1282, then the GPX file should contain this calorie value: <mt:calories>1282000</mt:calories>

Per Wikipedia: Thus, 1 kilocalorie (kcal) = 1000 calories (cal)

Original comment by: FJBDev

mt-from-sf-to-gh commented 3 years ago

Yes, thats true. Bug is only the column headline. Headline is called kcal but it is cal. It is not a program bug, only a wrong text in the headline or it has to be divided by 1000 before displayed.

Original comment by: hugohammer

mt-from-sf-to-gh commented 3 years ago

Can you show a screenshot of the "column headline" you are talking about ? I looked in the TourBookView and Import View and it shows as kcal and the value is correct as it is in kcal.

Original comment by: FJBDev

mt-from-sf-to-gh commented 3 years ago

GPX File Head:

?xml version='1.0' encoding='UTF-8'?>

Baba Bafang text/html 19489.33 4831 5609 4830764 346.9999 402.3002 1616602520332 1616608129517 10.279235 888.0 888.0 1093243 See Screenshots Original comment by: hugohammer
mt-from-sf-to-gh commented 3 years ago

Actually, can you attach the complete GPX file so I can reproduce the issue ?

Original comment by: FJBDev

mt-from-sf-to-gh commented 3 years ago

Sure, i only removed some trkpoints at start and end. It is not really a problem. Only a cosmetic one. I found it when i first converted my data to import it.

Original comment by: hugohammer

mt-from-sf-to-gh commented 3 years ago

Thanks for the file. I was able to reproduce the issue and it was happening in the Tour Import View. I fixed it for the next version. See a screenshot of the fix attached

Original comment by: FJBDev

mt-from-sf-to-gh commented 3 years ago

Great - thx :-)

Original comment by: hugohammer

mt-from-sf-to-gh commented 3 years ago

Original comment by: FJBDev