CLCmdGoGpsUpStreamData.fromNewProtocol constructor

CLCmdGoGpsUpStreamData.fromNewProtocol(
  1. CLCmdGogpsBodyPeakNew bodyItem,
  2. int workoutType,
  3. double speed,
  4. int currentDist,
  5. double dDistance,
  6. double lat,
  7. double lon,
  8. int cal,
)

Implementation

factory CLCmdGoGpsUpStreamData.fromNewProtocol(CLCmdGogpsBodyPeakNew bodyItem,int workoutType,double speed, int currentDist, double dDistance,double lat,double lon, int cal  ){
  return CLCmdGoGpsUpStreamData(
    timestamp: bodyItem.timestamp + bodyItem.secIndex,
    secondindex:bodyItem.secIndex,
    mSport_type:workoutType, //轨迹类型
    speed:speed,
    longitude:bodyItem.lon / 1000000,
    latitude:bodyItem.lat / 1000000,
    altitude:bodyItem.altitude.toDouble(),
    distance_km:currentDist,
    heartrate:bodyItem.heartrate,
    deltadis:dDistance,
    accuracy:bodyItem.accuracy,
    kcal: cal
  );

}