BirdyF / rw_tcx

Dart package to read or write TCX files
Other
7 stars 3 forks source link

Please add cadence support for the TrackPoint #3

Closed MrCsabaToth closed 5 months ago

MrCsabaToth commented 3 years ago

It is commented as Not handled yet so unsurprisingly I don't see it in wTCX.dart. How hard is to add it? I'll dig into the xsds.

MrCsabaToth commented 3 years ago

It looks like to me that Cadence is not even an extension to the Trackpoint element but a simple member.

    <xsd:complexType name="Trackpoint_t">
            <xsd:sequence>
                    <xsd:element name="Time" type="xsd:dateTime"/>
                    <xsd:element name="Position" type="Position_t" minOccurs="0"/>
                    <xsd:element name="AltitudeMeters" type="xsd:double" minOccurs="0"/>
                    <xsd:element name="DistanceMeters" type="xsd:double" minOccurs="0"/>
                    <xsd:element name="HeartRateBpm" type="HeartRateInBeatsPerMinute_t" minOccurs="0"/>
                    <xsd:element name="Cadence" type="CadenceValue_t" minOccurs="0"/>
                    <xsd:element name="SensorState" type="SensorState_t" minOccurs="0"/>
                    <xsd:element name="Extensions" type="Extensions_t" minOccurs="0">
                            <xsd:annotation>
                                    <xsd:documentation>You can extend Training Center by adding your own elements from another schema here.</xsd:documentation>
                            </xsd:annotation>
                    </xsd:element>
            </xsd:sequence>
    </xsd:complexType>

The only thing is that it must be an integer and it's an unsigned byte, so cannot be negative or larger than 254.

    <xsd:simpleType name="CadenceValue_t">
            <xsd:restriction base="xsd:unsignedByte">
                    <xsd:maxInclusive value="254"/>
            </xsd:restriction>
    </xsd:simpleType>