示例#1
0
        /// <summary>
        /// 载入线路
        /// </summary>
        /// <param name="Times"></param>
        public void LoadLine(long Times)
        {
            string    Key  = $"Line_{Times}";
            DataTable Data = CachePlant.GetResult(Key, () => { return(IO_AGVMapService.LinelistArrer(Times.ToString())); });

            foreach (DataRow item in Data.Rows)
            {
                if (Convert.ToInt32(item["LineStyel"].ToString()) == 1)
                {
                    GetCircuitType = (CircuitType.Line);
                }
                else if (Convert.ToInt32(item["LineStyel"].ToString()) == 2)
                {
                    GetCircuitType = (CircuitType.Broken);
                }
                else
                {
                    GetCircuitType = (CircuitType.Semicircle);
                }
                Pairsarray.Add(new WirePoint()
                {
                    TagID = Convert.ToInt32(item["Tag1"].ToString().Substring(2)), SetPoint = new Point()
                    {
                        X = Convert.ToDouble(item["StartX"].ToString()) * 10, Y = Convert.ToDouble(item["StartY"].ToString()) * 10
                    }
                });
                Pairsarray.Add(new WirePoint()
                {
                    TagID = Convert.ToInt32(item["Tag2"].ToString().Substring(2)), SetPoint = new Point()
                    {
                        X = Convert.ToDouble(item["EndX"].ToString()) * 10, Y = Convert.ToDouble(item["EndY"].ToString()) * 10
                    }
                });
                AddLine();
                Pairsarray.Clear();
            }
        }