Ejemplo n.º 1
0
        static void OnFileIDMesg(object sender, MesgEventArgs e)
        {
            Console.WriteLine("FileIdHandler: Received {1} Mesg with global ID#{0}", e.mesg.Num, e.mesg.Name);
            FileIdMesg myFileId = (FileIdMesg)e.mesg;

            try
            {
                Console.WriteLine("\tType: {0}", myFileId.GetType());
                Console.WriteLine("\tManufacturer: {0}", myFileId.GetManufacturer());
                Console.WriteLine("\tProduct: {0}", myFileId.GetProduct());
                Console.WriteLine("\tSerialNumber {0}", myFileId.GetSerialNumber());
                Console.WriteLine("\tNumber {0}", myFileId.GetNumber());
                Console.WriteLine("\tTimeCreated {0}", myFileId.GetTimeCreated());

                //Make sure properties with sub properties arent null before trying to create objects based on them
                if (myFileId.GetTimeCreated() != null)
                {
                    Dynastream.Fit.DateTime dtTime = new Dynastream.Fit.DateTime(myFileId.GetTimeCreated().GetTimeStamp());
                }
            }
            catch (FitException exception)
            {
                Console.WriteLine("\tOnFileIDMesg Error {0}", exception.Message);
                Console.WriteLine("\t{0}", exception.InnerException);
            }
        }
Ejemplo n.º 2
0
        public static void OnFileIDMesg(object sender, MesgEventArgs e)
        {
            FileIdValues values = new FileIdValues();
            FileIdMesg   mesg   = (FileIdMesg)e.mesg;

            try
            {
                values._fileType     = mesg.GetType();
                values._manufacturer = mesg.GetManufacturer();
                values._product      = mesg.GetProduct();
                values._serialNumber = mesg.GetSerialNumber();

                //Make sure properties with sub properties arent null before trying to create objects based on them
                if (mesg.GetTimeCreated() != null)
                {
                    uint tc = (uint)mesg.GetFieldValue("TimeCreated");
                    values._timeCreated = FitConvert.ToLocalDateTime(tc);
                }
            }
            catch (FitException exception)
            {
                Console.WriteLine("\tOnFileIDMesg Error {0}", exception.Message);
                Console.WriteLine("\t{0}", exception.InnerException);
            }
            DataManager.Instance.FileIdValues.Add(values);
        }
Ejemplo n.º 3
0
 public FitFileID(FileIdMesg msg)
 {
     FaveroProduct = msg.GetFaveroProduct();
     GarminProduct = msg.GetGarminProduct();
     Manufacturer  = msg.GetManufacturer();
     Number        = msg.GetNumber();
     ProductName   = msg.GetProductNameAsString();
     Product       = msg.GetProduct();
     SerialNumber  = msg.GetSerialNumber();
     CreationTime  = FitFile.GetDateTime(msg.GetTimeCreated());
     Type          = msg.GetType();
 }
Ejemplo n.º 4
0
        static void OnFileIDMesg(object sender, MesgEventArgs e)
        {
            Console.WriteLine("FileIdHandler: Received {1} Mesg with global ID#{0}", e.mesg.Num, e.mesg.Name);
            FileIdMesg myFileId = (FileIdMesg)e.mesg;

            try
            {
                Console.WriteLine("\tType: {0}", myFileId.GetType());
                Console.WriteLine("\tManufacturer: {0}", myFileId.GetManufacturer());
                Console.WriteLine("\tProduct: {0}", myFileId.GetProduct());
                Console.WriteLine("\tSerialNumber {0}", myFileId.GetSerialNumber());
                Console.WriteLine("\tNumber {0}", myFileId.GetNumber());
                Dynastream.Fit.DateTime dtTime = new Dynastream.Fit.DateTime(myFileId.GetTimeCreated().GetTimeStamp());
            }
            catch (FitException exception)
            {
                Console.WriteLine("\tOnFileIDMesg Error {0}", exception.Message);
                Console.WriteLine("\t{0}", exception.InnerException);
            }
        }