Exemplo n.º 1
0
        private void BuildHierarchy(
            List<PropertyInfo> properties,
            SendTable send,
            Dictionary<string, SendTable> all,
            HashSet<string> excluding)
        {
            var nonDtProps = new List<PropertyInfo>();
            GatherProperties(properties, send, all, nonDtProps, excluding);

            properties.AddRange(nonDtProps);
        }
Exemplo n.º 2
0
        public static SendTable CreateWith(CSVCMsg_SendTable proto)
        {
            var table = new SendTable
            {
                NetTableName = proto.net_table_name,
                NeedsDecoder = proto.needs_decoder
            };

            foreach (var prop in proto.props)
            {
                table.Properties.Add(PropertyInfo.CreateWith(prop, table));
            }

            return table;
        }
Exemplo n.º 3
0
        public static SendTable CreateWith(CSVCMsg_SendTable proto)
        {
            var table = new SendTable
            {
                NetTableName = proto.net_table_name,
                NeedsDecoder = proto.needs_decoder
            };

            foreach (var prop in proto.props)
            {
                table.Properties.Add(PropertyInfo.CreateWith(prop, table));
            }

            return(table);
        }
Exemplo n.º 4
0
 public static PropertyInfo CreateWith(CSVCMsg_SendTable.sendprop_t proto, SendTable origin)
 {
     return(new PropertyInfo
     {
         Type = (PropertyType)proto.type,
         VarName = proto.var_name,
         Flags = (MultiFlag)proto.flags,
         Priority = (uint)proto.priority,
         DtName = proto.dt_name,
         NumElements = (uint)proto.num_elements,
         LowValue = proto.low_value,
         HighValue = proto.high_value,
         NumBits = (byte)proto.num_bits,
         Origin = origin
     });
 }
Exemplo n.º 5
0
 private void GatherExcludes(
     SendTable table,
     Dictionary<string, SendTable> all,
     HashSet<string> excluding)
 {
     foreach (var property in table.Properties)
     {
         if (property.Flags.HasFlag(PropertyInfo.MultiFlag.Exclude))
         {
             excluding.Add(QualifyProperty(property.DtName, property));
         }
         else if (property.Type == PropertyInfo.PropertyType.DataTable)
         {
             GatherExcludes(all[property.DtName], all, excluding);
         }
     }
 }
Exemplo n.º 6
0
        private void GatherProperties(
            List<PropertyInfo> properties,
            SendTable send,
            Dictionary<string, SendTable> all,
            List<PropertyInfo> nonDtProps,
            HashSet<string> excluding)
        {
            var skipOn = PropertyInfo.MultiFlag.Exclude | PropertyInfo.MultiFlag.InsideArray;

            foreach (var property in send.Properties)
            {
                if ((uint) (property.Flags & skipOn) > 0)
                {
                    continue;
                }
                if (excluding.Contains(QualifyProperty(property.Origin.NetTableName, property)))
                {
                    continue;
                }

                if (property.Type == PropertyInfo.PropertyType.DataTable)
                {
                    var pointsAt = all[property.DtName];

                    if (property.Flags.HasFlag(PropertyInfo.MultiFlag.Collapsible))
                    {
                        GatherProperties(properties, pointsAt, all, nonDtProps, excluding);
                    }
                    else
                    {
                        BuildHierarchy(properties, pointsAt, all, excluding);
                    }
                }
                else
                {
                    nonDtProps.Add(property);
                }
            }
        }