예제 #1
0
        public IEnumerable <DatapointType> dpTypes(string pattern)
        {
            //var result = new Dictionary<int, DatapointType>();
            var result = new List <DatapointType>();

            try
            {
                var wResult = wccXmlRpcProxy.dpTypes(pattern);
                foreach (var r in wResult)
                {
                    //var id = int.Parse(r[elementIdIndex]);
                    //var parentId = int.Parse(r[parentElementIdIndex]);
                    //var elementName = r[elementNameIndex];
                    //var elementType = int.Parse(r[elementTypeIndex]);
                    var dpType = new DatapointType(r);
                    //result.Add(id, dpType);
                    result.Add(dpType);
                    //DatapointType parent;

                    /*if (result.TryGetValue(parentId, out parent))
                     * {
                     *  parent.Items.Add(dpType);
                     *  dpType.Parent = parent;
                     * }*/
                }
            }
            catch (Exception e)
            {
                Debugger.Write(e.Message);
            }

            return(result);
        }
예제 #2
0
        //string[][] dpTypeGet(string dpType);

        public DatapointElement dpTypeGet(DatapointType dpType)
        {
            DatapointElement result = null;

            try
            {
                result = new DatapointElement();
                var wResult = wccXmlRpcProxy.dpTypeGet(dpType.Name);
                ParseTreeStruct(result, wResult, 0, 0);
            }
            catch (Exception e)
            {
                Debugger.Write(e.Message);
            }

            return(result);
        }
예제 #3
0
        public IEnumerable <Datapoint> dpNames(DatapointType dpType, string dpPattern = "*")
        {
            var result = new List <Datapoint>();

            try
            {
                var wResult = wccXmlRpcProxy.dpNames(dpType.Name, dpPattern);
                foreach (var r in wResult)
                {
                    var dp = new Datapoint(r.Split(':')[1], dpType);
                    result.Add(dp);
                }
            }
            catch (Exception e)
            {
                Debugger.Write(e.Message);
            }

            return(result);
        }