Ejemplo n.º 1
0
        public static void OnDeviceInfoMesg(object sender, MesgEventArgs e)
        {
            DeviceInfoValues values = new DeviceInfoValues();
            DeviceInfoMesg   mesg   = (DeviceInfoMesg)e.mesg;

            try
            {
                values._deviceIndex     = mesg.GetDeviceIndex();
                values._deviceType      = mesg.GetDeviceType();
                values._manufacturer    = mesg.GetManufacturer();
                values._serialNumber    = mesg.GetSerialNumber();
                values._product         = mesg.GetProduct();
                values._softwareVersion = mesg.GetSoftwareVersion();
                values._batteryVoltage  = mesg.GetBatteryVoltage();
                values._batteryStatus   = mesg.GetBatteryStatus();
                values._descriptor      = mesg.GetDescriptorAsString();
                values._antDeviceNumber = mesg.GetAntDeviceNumber();
                values._sourceType      = mesg.GetSourceType();
                values._productName     = mesg.GetProductNameAsString();

                //Make sure properties with sub properties arent null before trying to create objects based on them
                if (mesg.GetTimestamp() != null)
                {
                    //values.timestamp = new Dynastream.Fit.DateTime(mesg.GetTimestamp().GetTimeStamp());
                    uint tc = (uint)mesg.GetTimestamp().GetTimeStamp();
                    values._timestamp = FitConvert.ToLocalDateTime(tc);
                }
            }
            catch (FitException exception)
            {
                Console.WriteLine("\tOnFileIDMesg Error {0}", exception.Message);
                Console.WriteLine("\t{0}", exception.InnerException);
            }
            DataManager.Instance.DeviceInfoValues.Add(values);
        }
Ejemplo n.º 2
0
 private void ClearAdditionalValues()
 {
     WahooFF00Values.Clear();
     WahooFF01Values.Clear();
     ActivityValues.Clear();
     FileIdValues.Clear();
     DeviceInfoValues.Clear();
     WorkoutValues.Clear();
     FieldDescriptionValues.Clear();
     DeveloperDataIdValues.Clear();
     EventValues.Clear();
     SportValues.Clear();
 }