Copy Data

by old_man_biking

Downloads: 883 (4) • Reviews: 1

Version:

3.0.5966

Updated:

May 2, 2016

Data structure of .fitlogex

Data structure of .fitlogex

Postby Tisztul_A_Visztula » Tue Feb 26, 2013 3:30 pm

Hi OMB,

Was it a deliberate decision to change the "place" of dist="..." vs .fitlog?

In .fitlog it is between ele="..." and HR="..." while in .fitlogex it is after power="...".

If it is not against your policy, I'd appreciate if you moved it to the same place creating the same data order in "<pt ..../>" rows. I would like to switch all my data exports from fitlog to fitlogex as a format and I'd like to minimize the changes I will have to make in my software. Unfortunately I relied on the data order when I wrote my software like a rookie programmer. Actually I am really a hobbyist in programming. :-)
Cheers,
Zoltan
Tisztul_A_Visztula
 
Posts: 524
Joined: Thu Jul 15, 2010 8:38 am
Location: Hungary

Re: Data structure of .fitlogex

Postby Tisztul_A_Visztula » Tue Feb 26, 2013 3:39 pm

Oops, I have checked another activity and it seems that the order is not always the same not even in .fitlogex itself (NB: also ele="..." is moved), which may exacerbate the situation for me. Maybe it is because the second activity has cadence? Or due to the lack of GPS data? I bet on the second, but anyway let me beg for the same data order as in the traditional fitlog.

1. activity

fitlog <pt tm="4" lat="47.6347198486328" lon="19.0287208557129" ele="149.600006103516" dist="8.06" hr="97" power="214.3596" />
fitlogex <pt tm="4" lat="47.6347198" lon="19.0287209" ele="149.600" hr="97.000" power="214.360" dist="8.060" />

2. activity (w/o GPS data)

fitlog <pt tm="11" ele="349.2307" dist="0.1388889" hr="117" cadence="105" power="231" />
fitlogex <pt tm="11" hr="117.000" cadence="105.000" power="231.000" ele="349.231" dist="0.139" />

To be on the positive it was a very good decision to drop some digits in lat, lon and ele.
Cheers,
Zoltan
Tisztul_A_Visztula
 
Posts: 524
Joined: Thu Jul 15, 2010 8:38 am
Location: Hungary

Re: Data structure of .fitlogex

Postby old_man_biking » Tue Feb 26, 2013 11:23 pm

Programming is - like business - all about contracts.
An interface specification is in fact a contract that tells the interface provider what s/he has to provide and the interface user what s/he can expect.
So, as an interface user you can only count on what you have as a written contract. Everything else is guesswork.

In XML programming, the interface specs are called "XML schema". A schema defines the structure of XML files that comply with this schema, are "valid".
Btw, schemas can be, but don't have to be provided.
Back to your case: there is no schema definition for .fitlogEx files 8)

Besides the world of contracts there are "golden rules" in programming.
Some of the golden rules in XML programming are:
* never rely on the order of attributes; the XML spec is pretty clear: "Note that the order of attribute specifications in a start-tag or empty-element tag is not significant.", see http://www.w3.org/TR/REC-xml/#sec-starttags
* XML is all about openness and extendability, so never write code that can be confused when new elements are ADDED to xml files; interpret what's there, ignore what you don't handle

A helpful hand:
All serious programming languages should provide libraries for XML parsing. There are two major concepts for xml parsing out there: SAX and DOM.
In your case, DOM is appropriate.
It allows you to write code like 'String elevation = ptElement.Attributes["ele"]' or 'XmlElement categoryElement = activityElement["Category"]'.

Cheers,
OMB

PS: answering this question reduces the amount of time that I can spend on the open issues that you emailed me :lol:
old_man_biking
Donated!
Donated!
 
Posts: 6512
Joined: Mon May 28, 2007 8:07 am
Location: Munich, Germany

Re: Data structure of .fitlogex

Postby texmurphy » Wed Feb 27, 2013 9:31 am

old_man_biking wrote:...answering this question reduces the amount of time that I can spend on the open issues that you emailed me :lol:

Are you getting any free time to ride your bike?
texmurphy
Donated!
Donated!
 
Posts: 2125
Joined: Wed Jul 05, 2006 7:38 pm
Location: Maryland, USA

Re: Data structure of .fitlogex

Postby old_man_biking » Wed Feb 27, 2013 10:50 am

Well, if I'd satisfy all wishes of some customers: no. I wouldn't even have time to eat :cry:
Which otherwise would compensate some adverse effects of riding less :lol:
old_man_biking
Donated!
Donated!
 
Posts: 6512
Joined: Mon May 28, 2007 8:07 am
Location: Munich, Germany


Return to Copy Data

Who is online

Users browsing this forum: No registered users and 1 guest

cron