1616 * http://www.thisisant.com/resources/fit
1717 */
1818
19- if (!defined ('DEFINITION_MESSAGE ' )) define ('DEFINITION_MESSAGE ' , 1 );
20- if (!defined ('DATA_MESSAGE ' )) define ('DATA_MESSAGE ' , 0 );
19+ if (!defined ('DEFINITION_MESSAGE ' )) {
20+ define ('DEFINITION_MESSAGE ' , 1 );
21+ }
22+ if (!defined ('DATA_MESSAGE ' )) {
23+ define ('DATA_MESSAGE ' , 0 );
24+ }
2125
2226class phpFITFileAnalysis
2327{
@@ -987,7 +991,6 @@ private function readDataRecords()
987991 // Check if it's an invalid value for the type
988992 $ tmp_value = unpack ($ this ->types [$ field_defn ['base_type ' ]], substr ($ this ->file_contents , $ this ->file_pointer , $ field_defn ['size ' ]))['tmp ' ];
989993 if ($ tmp_value !== $ this ->invalid_values [$ field_defn ['base_type ' ]]) {
990-
991994 // If it's a Record data message, store all the pieces in the temporary array as the timestamp may not be first...
992995 if ($ this ->defn_mesgs [$ local_mesg_type ]['global_mesg_num ' ] === 20 ) {
993996 $ tmp_record_array [$ this ->data_mesg_info [$ this ->defn_mesgs [$ local_mesg_type ]['global_mesg_num ' ]]['field_defns ' ][$ field_defn ['field_definition_number ' ]]['field_name ' ]] = $ tmp_value / $ this ->data_mesg_info [$ this ->defn_mesgs [$ local_mesg_type ]['global_mesg_num ' ]]['field_defns ' ][$ field_defn ['field_definition_number ' ]]['scale ' ] - $ this ->data_mesg_info [$ this ->defn_mesgs [$ local_mesg_type ]['global_mesg_num ' ]]['field_defns ' ][$ field_defn ['field_definition_number ' ]]['offset ' ];
@@ -1390,7 +1393,6 @@ private function setUnits($options)
13901393 foreach ($ messages as $ message ) {
13911394 switch ($ units ) {
13921395 case 'statute ' :
1393-
13941396 // convert from celsius to fahrenheit
13951397 foreach ($ c_fields as $ field ) {
13961398 if (isset ($ this ->data_mesgs [$ message ][$ field ])) {
@@ -1470,7 +1472,6 @@ private function setUnits($options)
14701472 // Do nothing - leave values as read from file.
14711473 break ;
14721474 case 'metric ' :
1473-
14741475 // convert from meters to kilometers
14751476 foreach ($ m_fields as $ field ) {
14761477 if (isset ($ this ->data_mesgs [$ message ][$ field ])) {
@@ -1820,8 +1821,7 @@ public function isPaused()
18201821 foreach ($ tek as $ v ) {
18211822 if ($ this ->data_mesgs ['event ' ]['event_type ' ][$ v ] === 0 ) {
18221823 $ timer_start [$ v ] = $ this ->data_mesgs ['event ' ]['timestamp ' ][$ v ];
1823- }
1824- elseif ($ this ->data_mesgs ['event ' ]['event_type ' ][$ v ] === 4 ) {
1824+ } elseif ($ this ->data_mesgs ['event ' ]['event_type ' ][$ v ] === 4 ) {
18251825 $ timer_stop [$ v ] = $ this ->data_mesgs ['event ' ]['timestamp ' ][$ v ];
18261826 }
18271827 }
@@ -1840,8 +1840,7 @@ public function isPaused()
18401840 if ($ i == $ cur_stop ) {
18411841 $ bPaused = true ;
18421842 $ cur_stop = next ($ timer_stop );
1843- }
1844- elseif ($ i == $ cur_start ) {
1843+ } elseif ($ i == $ cur_start ) {
18451844 $ bPaused = false ;
18461845 $ cur_start = next ($ timer_start );
18471846 }
0 commit comments