Пример #1
0
        /// <summary>
        /// 获取Agv地标
        /// </summary>
        /// <param name="nowsite"></param>
        /// <param name="dessite"></param>
        /// <returns></returns>
        public static AgvPoint GetMPointOnLine(string name, int nowsite, int dessite, float rate = -1)
        {
            nowsite = AgvOnLineMaster.GetNowSite(name, nowsite);
            agvLine = AgvLineList.Find(c => { return(c.NowSite == nowsite &&
                                                     ((c.IsSpecial && c.DesSite == dessite) || (!c.IsSpecial))); });

            if (agvLine != null)
            {
                return(agvLine.GetAgvLinePoint(name, rate));
            }
            return(null);
        }
Пример #2
0
        private void LineDownBtn_Click(object sender, EventArgs e)
        {
            if (AgvLineSelectedIndex == -1)
            {
                MessageBox.Show("请先选择线路!");
                return;
            }
            if (AgvLineSelectedIndex + 1 >= AgvLineDatas.Count - 1)
            {
                return;
            }
            AgvLineData line = AgvLineDatas[AgvLineSelectedIndex + 1];

            AgvLineDatas[AgvLineSelectedIndex + 1] = AgvLineDatas[AgvLineSelectedIndex];
            AgvLineDatas[AgvLineSelectedIndex]     = line;
            AgvLineSelectedIndex++;
            AgvLineListViewRefresh();
        }
Пример #3
0
        /// <summary>
        /// 添加线路
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddLineBtn_Click(object sender, EventArgs e)
        {
            if (LineNowSiteTB.Text.Length == 0)
            {
                MessageBox.Show("请先填写信息");
                return;
            }
            AgvLineData line = new AgvLineData
            {
                NowSite   = int.Parse(LineNowSiteTB.Text),
                IsSpecial = LineSpecialCB.Checked,
                DesSite   = GetDestSite(LineDesSiteCB.SelectedIndex),
                MoveSize  = float.Parse(LineMoveSizeTB.Text)
            };

            AgvLineDatas.Add(line);
            AgvLineListViewRefresh();
        }
Пример #4
0
        /// <summary>
        /// 使用地图解析的初步地标
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UseXmlAnBtn_Click(object sender, EventArgs e)
        {
            AgvLineDatas.Clear();
            foreach (Line line in LineDateCenter._linesPositive)
            {
                AgvLineData data = new AgvLineData
                {
                    NowSite  = line.LineID,
                    MoveSize = 0.1F
                };
                foreach (var p in line._points)
                {
                    data.Points.Add(new AgvPoint {
                        X = p.X, Y = p.Y
                    });
                }
                AgvLineDatas.Add(data);
            }

            AgvLineListViewRefresh();
        }