示例#1
0
        public static HierachyItem GetItembyPath(UAVParameter param, string path)
        {
            string key     = path;
            string newpath = "";

            MonitoredDictionary <string, UAVParameter> .GetKeyPath(ref key, ref newpath);

            if (param is UAVStructure)
            {
                UAVStructure mystructure = ((UAVStructure)param);
                foreach (UAVParameter myparams in mystructure.values.Values)
                {
                    if (myparams.Name == key)
                    {
                        GetItembyPath(myparams, newpath);
                    }
                }
            }
            else
            if (param is UAVParameter)
            {
                if (param.Name == key)
                {
                    return(param);
                }
                //   remotedata.Add(newparam);
            }

            return(null);
        }
示例#2
0
        public static HierachyItem GetItembyPath(UAVBase core, string path)
        {
            List <UAVParameter> uavData = new List <UAVParameter>();
            string key     = path;
            string newpath = "";

            MonitoredDictionary <string, UAVParameter> .GetKeyPath(ref key, ref newpath);

            foreach (UAVParameter param in core.uavData.Values)
            {
                if (param.Name == key)
                {
                    if (newpath == key)
                    {
                        return(param);
                    }
                    if (param is UAVStructure)
                    {
                        return(GetItembyPath(param, newpath));
                    }
                }
            }

            return(null);
        }