Exemple #1
0
 public vehicleglobal_position(MessageData m)
 {
     this.Timestamp = m.GetValue <UInt64>("timestamp");
     SetField("GPSTime", m.GetValue <UInt64>("timestamp"));
     SetField("EPH", m.GetValue <float>("eph"));
     SetField("EPV", m.GetValue <float>("epv"));
     SetField("Lat", m.GetValue <double>("lat"));
     SetField("Lon", m.GetValue <double>("lon"));
     SetField("Alt", m.GetValue <float>("alt"));
     SetField("VelN", m.GetValue <float>("vel_n"));
     SetField("VelE", m.GetValue <float>("vel_e"));
     SetField("VelD", m.GetValue <float>("vel_d"));
 }
Exemple #2
0
        public IEnumerable <DataValue> GetDataValues(LogItemSchema schema, DateTime startTime, TimeSpan duration)
        {
            List <LogItemSchema> path = new List <Model.LogItemSchema>();

            while (schema != null)
            {
                path.Insert(0, schema);
                schema = schema.Parent;
            }

            LogItemSchema root = path[0];

            foreach (var m in msgs)
            {
                if (m is MessageData)
                {
                    MessageData data = (MessageData)m;
                    if (data.format.name == root.Name)
                    {
                        // matching root schema, so drill down if necessary.
                        for (int i = 1, n = path.Count; i < n; i++)
                        {
                            LogItemSchema child = path[i];
                            foreach (var field in data.format.fields)
                            {
                                if (field.name == child.Name)
                                {
                                    yield return(data.GetValue(field));
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #3
0
        public IEnumerable <DataValue> GetDataValues(LogItemSchema schema, DateTime startTime, TimeSpan duration)
        {
            List <LogItemSchema> path = new List <Model.LogItemSchema>();

            while (schema != null)
            {
                path.Insert(0, schema);
                schema = schema.Parent;
            }

            LogItemSchema root = path[0];

            foreach (var m in msgs)
            {
                if (m is MessageData)
                {
                    MessageData data = (MessageData)m;
                    //if (data.subscription.id == root.Id)
                    {
                        MessageFormat f = data.format;
                        // matching root schema, so drill down if necessary.
                        for (int i = 1, n = path.Count; i < n; i++)
                        {
                            bool found = false;
                            if (path[i].Name == f.name && i + 1 < n)
                            {
                                LogItemSchema child = path[i + 1];
                                foreach (var field in f.fields)
                                {
                                    if (field.name == child.Name)
                                    {
                                        found = true;
                                        if (i + 1 < n && child.HasChildren)
                                        {
                                            // still need to drill down, so we need a MessageData and MessageFormat for the child item.
                                            data = data.GetNestedData(field.name);
                                            f    = data.format;
                                        }
                                        else
                                        {
                                            yield return(data.GetValue(field));

                                            found = false; // done drilling down
                                        }
                                        break;
                                    }
                                }
                            }
                            if (!found)
                            {
                                break;
                            }
                        }
                    }
                }
            }
        }