public static HumanSuperscale LoadFromXml(System.Xml.XmlNode node)
        {
            HumanSuperscale h = new HumanSuperscale();

            h.Enable     = Convert.ToBoolean(node.SelectSingleNode("Enable").InnerText);
            h.UpperLimit = Convert.ToUInt32(node.SelectSingleNode("UpperLimit").InnerText);
            h.UnitTime   = Convert.ToUInt32(node.SelectSingleNode("UnitTime").InnerText);
            return(h);
        }
Beispiel #2
0
        public static PassLine LoadFromXml(System.Xml.XmlNode node)
        {
            PassLine line = new PassLine();

            line.ID = Convert.ToUInt32(node.SelectSingleNode("ID").InnerText);
            line.TimelyReportTimeInterval = Convert.ToUInt32(node.SelectSingleNode("TimelyReportTimeInterval").InnerText);
            line.OutputResult             = Convert.ToBoolean(node.SelectSingleNode("OutputResult").InnerText);
            line.PosBeyond = HumanSuperscale.LoadFromXml(node.SelectSingleNode("HumanSuperscale/PosBeyond"));
            line.NegBeyond = HumanSuperscale.LoadFromXml(node.SelectSingleNode("HumanSuperscale/NegBeyond"));

            line.DirectLineStart = new System.Drawing.Point(Convert.ToInt32(node.SelectNodes("DirectLinePointSet/Point/X")[0].InnerText), Convert.ToInt32(node.SelectNodes("DirectLinePointSet/Point/Y")[0].InnerText));
            line.DirectLineEnd   = new System.Drawing.Point(Convert.ToInt32(node.SelectNodes("DirectLinePointSet/Point/X")[1].InnerText), Convert.ToInt32(node.SelectNodes("DirectLinePointSet/Point/Y")[1].InnerText));
            line.PassLineStart   = new System.Drawing.Point(Convert.ToInt32(node.SelectNodes("BeyondLinePointSet/Point/X")[0].InnerText), Convert.ToInt32(node.SelectNodes("BeyondLinePointSet/Point/Y")[0].InnerText));
            line.PassLineEnd     = new System.Drawing.Point(Convert.ToInt32(node.SelectNodes("BeyondLinePointSet/Point/X")[1].InnerText), Convert.ToInt32(node.SelectNodes("BeyondLinePointSet/Point/Y")[1].InnerText));
            line.PassLinePos     = Convert.ToBoolean(node.SelectSingleNode("PosBeyond").InnerText);
            line.PassLineNeg     = Convert.ToBoolean(node.SelectSingleNode("NegBeyond").InnerText);
            line.PassLineType    = 0;
            return(line);
        }
        public static BreakRegion LoadFromXml(System.Xml.XmlNode node)
        {
            BreakRegion region = new BreakRegion();

            region.ID = Convert.ToUInt32(node.SelectSingleNode("ID").InnerText);
            region.TimelyReportTimeInterval = Convert.ToUInt32(node.SelectSingleNode("TimelyReportTimeInterval").InnerText);
            region.OutputResult             = Convert.ToBoolean(node.SelectSingleNode("OutputResult").InnerText);
            region.BreakIn  = HumanSuperscale.LoadFromXml(node.SelectSingleNode("HumanSuperscale/InSide"));
            region.BreakOut = HumanSuperscale.LoadFromXml(node.SelectSingleNode("HumanSuperscale/OutSide"));

            region.RegionPointList = new List <System.Drawing.Point>();
            foreach (System.Xml.XmlNode item in node.SelectNodes("PointSet/Point"))
            {
                region.RegionPointList.Add(new System.Drawing.Point(Convert.ToInt32(item.SelectSingleNode("X").InnerText), Convert.ToInt32(item.SelectSingleNode("Y").InnerText)));
            }

            region.RegionTypeIn  = Convert.ToBoolean(node.SelectSingleNode("InSide").InnerText);
            region.RegionTypeOut = Convert.ToBoolean(node.SelectSingleNode("OutSide").InnerText);
            region.RegionType    = 0;
            return(region);
        }