C#开发AGV地图编辑软件

C#自己开发AGV地图编辑软件:

1、自由添加和删除站点、停车位、小车、运行路径。

2、编辑得地图以XML文件保存。

3、导入编辑好地图的XML文件。

4、程序都是源码,可以直接在此基础上进行二次开发。

下载链接:https://download.csdn.net/download/panjinliang066333/88855372

部分代码展示:

#region 限制闪屏
        protected override CreateParams CreateParams
        {
            get
            {
                const int WS_MINIMIZEBOX = 0x00020000;  // Winuser.h中定义   
                CreateParams cp = base.CreateParams;
                cp.Style = cp.Style | WS_MINIMIZEBOX;   // 允许最小化操作
                return cp;
            }
        }
        #endregion

        NodeType newType = NodeType.MousePick;
        MapPanel mapPanelDocker;
        FloydHelper floydCurrent;

        #region AGV配置信息
        int AGVCount = 0;
        object[] lockObj;//线程间锁
        MapVehicle[] myAgvModel;
        //---占据的单元
        Dictionary<string, string> LockUnit = new Dictionary<string, string>();
        #endregion
        #region 画布属性
        private int maxScale = 0; //X轴最大刻度
        private static int AxisOffset = 32;//X轴的Y坐标偏移量
        private Font font = new Font("宋体", 9F, FontStyle.Regular); //刻度值显示字体
        bool showRule = true;
        bool showNetLine = true;

        public static int MonitorDPI = 12;//单位内像素点 
        public static float scaling = 1.0F; //缩放比例
        #endregion
        #region 变量
        #region 其他窗体
        frm_ModelProperty frm_Property;
        #endregion
        #endregion

        #region 其他窗体
        LoadingForm loadForm;
        #endregion
        #region 窗体初始化
        #region 初始化
        public frm_AGVMain()
        {
            InitializeComponent();
            loadForm = new LoadingForm();
            loadForm.ShowLoadingDealy(3);
            mapPanelDocker = new MapPanel();
            mapPanelDocker.Size = this.pnlMap.Size;
            mapPanelDocker.Location = new Point(0, 0);
            mapPanelDocker.BorderStyle = BorderStyle.FixedSingle;
            mapPanelDocker.MouseClick += mapPanel1_MouseClick;
            mapPanelDocker.MouseMove += mapPanelDocker_MouseMove;
            mapPanelDocker.MouseLeave += mapPanelDocker_MouseLeave;
            this.pnlMap.Controls.Add(mapPanelDocker);
            mapPanelDocker.LinePropertySelect += MapPanelDocker_LinePropertySelect;
            mapPanelDocker.MapNodePropertySelect += MapPanelDocker_CirclePropertySelect;
            mapPanelDocker.BezierLinePropertySelect += MapPanelDocker_BezierLinePropertySelect;
            mapPanelDocker.BlockPropertySelect += mapPanelDocker_BlockPropertySelect;
            mapPanelDocker.IsLine = newType == NodeType.DirectLineCap; ;
            mapPanelDocker.IsBezierLine = newType == NodeType.BezierLineCap;
            InitialControlsOptions();
            InitialTreeViewLayout();
        }
        #endregion
        #region 初始化加载控件属性
        private void InitialControlsOptions()
        {
            newType = NodeType.MousePick;
            this.btn_鼠标.Enabled = false;
            foreach (Control item in this.panel8.Controls)
            {
                if (item.GetType() == typeof(Button))
                {
                    Button btn = (Button)item;
                    if (btn.Name.Contains("_"))
                    {
                        btn.Click += btnAll_Click;
                    }
                }
            }
        }
        #endregion
        #region 鼠标箭头/站点、停车点......点击
        private void btnAll_Click(object sender, EventArgs e)
        {
            foreach (Control item in this.panel8.Controls)
            {
                if (item.GetType() == typeof(Button))
                {
                    Button btnTemp = (Button)item;
                    if (btnTemp.Name.Contains("_"))
                    {
                        btnTemp.Enabled = true;
                    }
                }
            }
            Button btn = (Button)sender;
            string strTemp = btn.Name.Split('_')[1];
            switch (strTemp)
            {
                case "鼠标":
                default:
                    newType = NodeType.MousePick;
                    this.btn_鼠标.Enabled = false;
                    break;
                case "站点":
                    newType = NodeType.StationNode;
                    this.btn_站点.Enabled = false;
                    break;
                case "停车点":
                    newType = NodeType.ParkingStationNode;
                    this.btn_停车点.Enabled = false;
                    break;
                case "直线箭头":
                    newType = NodeType.DirectLineCap;
                    this.btn_直线箭头.Enabled = false;
                    break;
                case "曲线箭头":
                    newType = NodeType.BezierLineCap;
                    this.btn_曲线箭头.Enabled = false;
                    break;
                case "块":
                    newType = NodeType.Block;
                    break;
                case "车":
                    newType = NodeType.Vehicle;
                    break;
            }
            mapPanelDocker.IsLine = newType == NodeType.DirectLineCap;
            mapPanelDocker.IsBezierLine = newType == NodeType.BezierLineCap;
        }
        #endregion
        #region 树状展开添加Layout
        private void InitialTreeViewLayout()
        {
            this.treeviewLayout.Nodes.Clear();
            TreeNode tn_origine = new TreeNode();
            tn_origine.Text = "Layout VLayout-01";
            tn_origine.ToolTipText = tn_origine.Text;
            this.treeviewLayout.Nodes.Add(tn_origine);
            AGV_Point[] allPoints = ReadXmlFile.ReadAllPoint(GlobalSystemConfig.Instance.AgvConfigPath);
            if (allPoints != null)
            {
                #region 添加所有的点
                TreeNode tn_sub = new TreeNode();
                tn_sub.Text = "Points";
                tn_sub.ToolTipText = tn_sub.Text;
                tn_origine.Nodes.Add(tn_sub);
                for (int i = 0; i < allPoints.Length; i++)
                {
                    TreeNode tn_child = new TreeNode();
                    tn_child.Text = "Point   " + allPoints[i]._Name;
                    tn_child.ToolTipText = tn_child.Text;
                    tn_sub.Nodes.Add(tn_child);//二级菜单
                }
                #endregion
            }
            AGV_Line[] allLines = ReadXmlFile.ReadAllLine(GlobalSystemConfig.Instance.AgvConfigPath);
            if (allLines != null)
            {
                #region 添加所有的路径
                TreeNode tn_sub = new TreeNode();
                tn_sub.Text = "Paths";
                tn_sub.ToolTipText = tn_sub.Text;
                tn_origine.Nodes.Add(tn_sub);
                for (int i = 0; i < allLines.Length; i++)
                {
                    TreeNode tn_child = new TreeNode();
                    tn_child.Text = "Path   " + allLines[i].LineName;
                    tn_child.ToolTipText = tn_child.Text;
                    tn_sub.Nodes.Add(tn_child);//二级菜单
                }
                #endregion
            }
            AGV_Block[] allBlocks = ReadXmlFile.ReadAllBlock(GlobalSystemConfig.Instance.AgvConfigPath);
            if (allBlocks != null)
            {
                #region 添加所有的块
                TreeNode tn_sub = new TreeNode();
                tn_sub.Text = "Blocks";
                tn_sub.ToolTipText = tn_sub.Text;
                tn_origine.Nodes.Add(tn_sub);
                for (int i = 0; i < allBlocks.Length; i++)
                {
                    TreeNode tn_child = new TreeNode();
                    tn_child.Text = "Block   " + allBlocks[i].BlockName;
                    tn_child.ToolTipText = tn_child.Text;
                    tn_child.ContextMenuStrip = this.menuBlock;
                    tn_sub.Nodes.Add(tn_child);//二级菜单
                    string[] strArr = allBlocks[i].menbers.Split(',');
                    for (int j = 0; j < strArr.Length; j++)
                    {
                        AGV_Line lineTemp = null;
                        for (int k = 0; k < allLines.Length; k++)
                        {
                            if (allLines[k].LineName == strArr[j])
                            {
                                lineTemp = allLines[k];
                                break;
                            }
                        }
                        if (lineTemp != null)
                        {
                            TreeNode tn_childchild = new TreeNode();
                            tn_childchild.Text = "Path   " + lineTemp.LineName;
                            tn_childchild.ToolTipText = tn_childchild.Text;
                            tn_child.Nodes.Add(tn_childchild);//三级菜单
                        }
                    }
                }
                #endregion
            }
            this.treeViewVehicle.Nodes.Clear();
            tn_origine = new TreeNode();
            tn_origine.Text = "Layout Vehicles";
            tn_origine.ToolTipText = tn_origine.Text;
            this.treeViewVehicle.Nodes.Add(tn_origine);

            mapPanelDocker.OpenMap(GlobalSystemConfig.Instance.AgvConfigPath);
            this.treeviewLayout.ExpandAll();
            this.treeViewVehicle.ExpandAll();
        }
        #region 添加子节点时
        public void TreeView1_DrawNode(object sender, DrawTreeNodeEventArgs e)
        {
            Font rootFont = new Font("微软雅黑", 9F, FontStyle.Bold);
            Font childFont = new Font("微软雅黑", 9F);

            Brush foreBrush = new SolidBrush(Color.FromArgb(81, 81, 81));
            Brush recBrush = new SolidBrush(Color.FromArgb(82, 218, 163));
            Brush recSelectedBrush = new SolidBrush(Color.FromArgb(248, 248, 255));

            Pen recPen = new Pen(new SolidBrush(Color.FromArgb(226, 226, 226)));
            Pen recHoverPen = new Pen(new SolidBrush(Color.FromArgb(82, 218, 163)));
            Pen linePen = new Pen(Color.Gray);
            linePen.DashStyle = DashStyle.Dot;

            Image icon;
            if (e.Node.Level == 0)//根节点
            {
                #region 绘制根节点
                icon = Resources.布局图;
                if (e.Node.Text.Contains("Vehicles"))
                {
                    icon = Resources.ziyuan;
                }
                e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(227, 251, 244)), e.Bounds);
                e.Graphics.DrawImage(icon, e.Node.Bounds.X - 20, e.Node.Bounds.Y + 5);
                e.Graphics.DrawString(e.Node.Text, rootFont, foreBrush, e.Node.Bounds.Left + 10, e.Node.Bounds.Top + 5);
                #endregion
            }
            else if (e.Node.Level == 1)
            {
                #region 一级子节点
                if (!e.Bounds.IsEmpty)
                {
                    Point start = new Point(e.Node.Bounds.X, e.Node.Bounds.Y + 15);
                    Point middle = new Point(e.Node.Bounds.X - 30, e.Node.Bounds.Y + 15);
                    Point topEnd = new Point(e.Node.Bounds.X - 30, e.Node.Bounds.Y);
                    Point bottomEnd = new Point(e.Node.Bounds.X - 30, e.Node.Bounds.Y + 30);
                    e.Graphics.DrawLine(linePen, start, middle);
                    e.Graphics.DrawLine(linePen, middle, topEnd);
                    if (null != e.Node.NextNode)
                    {
                        e.Graphics.DrawLine(linePen, middle, bottomEnd);
                    }

                    #region 重绘图标
                    if (!e.Node.IsExpanded)
                    {
                        icon = Resources.plus;
                        e.Graphics.DrawImage(icon, e.Node.Bounds.X - 25, e.Node.Bounds.Y + 8);

                        icon = Resources.wenjianjia__2_;
                        e.Graphics.DrawImage(icon, e.Node.Bounds.X - 10, e.Node.Bounds.Y + 8);
                    }
                    else
                    {
                        icon = Resources.jianhao_1;
                        e.Graphics.DrawImage(icon, e.Node.Bounds.X - 25, e.Node.Bounds.Y + 8);

                        icon = Resources.wenjianjia__2_;
                        e.Graphics.DrawImage(icon, e.Node.Bounds.X - 10, e.Node.Bounds.Y + 8);
                    }
                    #endregion

                    Rectangle box = new Rectangle(e.Bounds.Left + 60, e.Bounds.Top + 4, this.Width - 60 - 25, e.Bounds.Height - 8);
                    if (e.Node.IsSelected)//二级节点被选中
                    {
                        e.Graphics.FillRectangle(recBrush, box);
                    }
                    e.Graphics.DrawString(e.Node.Text, childFont, foreBrush, e.Node.Bounds.Left + 15, e.Node.Bounds.Top + 6);
                }
                #endregion
            }
            else
            {
                #region 二级子节点
                if (!e.Bounds.IsEmpty)
                {
                    Point start = new Point(e.Node.Bounds.X + 5, e.Node.Bounds.Y + 15);
                    Point middle = new Point(e.Node.Bounds.X - 20, e.Node.Bounds.Y + 15);
                    Point topEnd = new Point(e.Node.Bounds.X - 20, e.Node.Bounds.Y);
                    Point bottomEnd = new Point(e.Node.Bounds.X - 20, e.Node.Bounds.Y + 30);
                    e.Graphics.DrawLine(linePen, middle, topEnd);//|
                    e.Graphics.DrawLine(linePen, start, middle);//--
                    if (null != e.Node.NextNode)
                    {
                        e.Graphics.DrawLine(linePen, middle, bottomEnd);
                    }

                    Rectangle box = new Rectangle(e.Bounds.Left + 65, e.Bounds.Top + 4, this.Width - 55 - 25, e.Bounds.Height - 8);
                    if (e.Node.Text.StartsWith("Point"))
                    {
                        icon = Resources.icon_test;
                        e.Graphics.DrawImage(icon, e.Node.Bounds.X - 15, e.Node.Bounds.Y + 8);
                    }
                    else if (e.Node.Text.StartsWith("Path"))
                    {
                        icon = Resources.quxian;
                        e.Graphics.DrawImage(icon, e.Node.Bounds.X - 15, e.Node.Bounds.Y + 8);
                    }
                    else if (e.Node.Text.StartsWith("Block"))
                    {
                        icon = Resources.icon_block;
                        e.Graphics.DrawImage(icon, e.Node.Bounds.X - 15, e.Node.Bounds.Y + 8);
                    }
                    else if (e.Node.Text.StartsWith("Vehicle"))
                    {
                        icon = Resources.ziyuan;
                        e.Graphics.DrawImage(icon, e.Node.Bounds.X - 15, e.Node.Bounds.Y + 8);
                    }
                    if (e.Node.IsSelected)//二级节点被选中
                    {
                        e.Graphics.FillRectangle(recBrush, box);
                        e.Graphics.DrawString(e.Node.Text, childFont, recSelectedBrush, e.Node.Bounds.Left + 10, e.Node.Bounds.Top + 6);
                    }
                    else
                    {
                        if ((e.State & TreeNodeStates.Hot) != 0)//鼠标指针在二级节点上
                        {
                            e.Graphics.DrawRectangle(recHoverPen, box);
                        }
                        else
                        {
                            e.Graphics.DrawRectangle(recPen, box);
                        }
                        e.Graphics.DrawString(e.Node.Text, childFont, foreBrush, e.Node.Bounds.Left + 10, e.Node.Bounds.Top + 6);
                    }
                }
                #endregion
            }
        }
        #endregion
        #endregion
        #region 画标尺和网格
        /// <summary>
        /// 画标尺和网格
        /// </summary>
        /// <param name="showRule"></param>
        /// <param name="showNetLine"></param>
        /// <returns></returns>
        private Bitmap PaintRulesAndLine(bool showRule, bool showNetLine)
        {
            Bitmap bit = new Bitmap(this.Width * 4, this.Height * 4);
            Graphics g = Graphics.FromImage(bit);

            int widthInmm = bit.Width;
            int heightInmm = bit.Height;
            Pen p = new Pen(Color.Black, 1.5F);
            if (showRule)
            {
                #region 绘制X轴标尺
                for (int i = 0; i <= widthInmm / MonitorDPI * scaling; i++)//标尺总数
                {
                    float x = MonitorDPI * scaling * i + AxisOffset;
                    PointF start = new PointF(x, AxisOffset);
                    PointF end = new PointF(x, AxisOffset - 3);
                    if (i % 5 == 0)
                    {
                        end = new PointF(x, AxisOffset - 6);
                    }
                    if (i % 10 == 0)
                    {
                        end = new PointF(x, AxisOffset - 13);
                        PointF pStrPoint = i == 0 ? new PointF(x - 3, AxisOffset - 25) : new PointF(x - 10, AxisOffset - 25);
                        g.DrawString((i * 100).ToString(), font, Brushes.Black, pStrPoint);
                    }
                    g.DrawLine(Pens.Black, start, end);
                }
                #endregion

                Brush bBlack = Brushes.Black;

                #region 绘制y轴标尺
                for (int i = 0; i <= heightInmm / MonitorDPI * scaling; i++)
                {
                    float y = MonitorDPI * scaling * i + AxisOffset;
                    PointF start = new PointF(AxisOffset, y);
                    PointF end = new PointF(AxisOffset - 3, y);
                    if (i % 5 == 0)
                    {
                        end = new PointF(AxisOffset - 6, y);
                    }
                    if (i % 10 == 0)
                    {
                        end = new PointF(AxisOffset - 12, y);
                        PointF pStrPoint = i == 0 ? new PointF(AxisOffset - 20, y - 5) : new PointF(AxisOffset - 32, y - 12);
                        g.DrawString((i * 100).ToString(), font, bBlack, pStrPoint);
                    }
                    g.DrawLine(Pens.Black, start, end);
                }
                #endregion
            }

            if (showNetLine)
            {
                #region 绘制网格
                p = new Pen(Color.Gray, 1);
                p.DashStyle = DashStyle.Dot;
                for (int i = 0; i <= widthInmm / MonitorDPI; i++)//x方向网格
                {
                    g.DrawLine(p, AxisOffset, ((float)(MonitorDPI * i * scaling) + AxisOffset), widthInmm, ((float)(MonitorDPI * i * scaling) + AxisOffset));
                }
                for (int i = 0; i <= widthInmm / MonitorDPI; i++)//y方向网格
                {
                    g.DrawLine(p, ((float)(MonitorDPI * i * scaling) + AxisOffset), AxisOffset, ((float)(MonitorDPI * i * scaling) + AxisOffset), heightInmm);
                }
                #endregion
            }
            p = new Pen(Color.Black, 1);
            g.DrawLine(p, new PointF(AxisOffset, AxisOffset), new PointF(widthInmm, AxisOffset));
            g.DrawLine(p, new PointF(AxisOffset, AxisOffset), new PointF(AxisOffset, heightInmm));
            return bit;
        }
        #endregion
        #region 获得垂直的文本格式
        private string GetVString(string inStr)
        {
            string retStr = "";
            for (int i = 0; i < inStr.Length; i++)
            {
                retStr += inStr[i] + Environment.NewLine;
            }
            return retStr;
        }
        #endregion
        #endregion

        #region 窗体加载时
        private void frm_AGVMain_Load(object sender, EventArgs e)
        {
            timer1.Start();
        }
        #endregion
                
        #region 绑定对应的属性窗口
        private void MapPanelDocker_CirclePropertySelect(MapNodeProperty mapStation)
        {
            propertyGridControl.SelectedObject = mapStation;
        }

        private void MapPanelDocker_LinePropertySelect(MapLineProperty mapLine)
        {
            propertyGridControl.SelectedObject = mapLine;
        }

        private void MapPanelDocker_BezierLinePropertySelect(MapBezierProperty mapBezierLine)
        {
            propertyGridControl.SelectedObject = mapBezierLine;
        }
        private void mapPanelDocker_BlockPropertySelect(MapBlockProperty mapBlock)
        {
            propertyGridControl.SelectedObject = mapBlock;
        }
        #endregion
        #region 获取临近标尺内的网格点
        public static Point GetNearRulePoint(Point p)
        {
            Point retP = p;
            int x = p.X;
            int y = p.Y;
            int intTempx = (int)((x - AxisOffset) / MonitorDPI / scaling);//在第几个网格
            int intTempy = (int)((y - AxisOffset) / MonitorDPI / scaling);//在第几个网格
            int singleRuleNetWidth = (int)(MonitorDPI * scaling);
            int locationX = AxisOffset + (int)((intTempx + 1) * MonitorDPI * scaling);
            int locationX1 = AxisOffset + (int)((intTempx) * MonitorDPI * scaling);
            int locationY = AxisOffset + (int)((intTempy + 1) * MonitorDPI * scaling);
            int locationY1 = AxisOffset + (int)((intTempy) * MonitorDPI * scaling);
            if (retP.X >= locationX1 + singleRuleNetWidth / 2)
            {
                retP.X = locationX;
            }
            else
            {
                retP.X = locationX1;
            }
            if (retP.Y >= locationY1 + singleRuleNetWidth / 2)
            {
                retP.Y = locationY;
            }
            else
            {
                retP.Y = locationY1;
            }
            return retP;
        }
        #endregion
        #region 转换成模型坐标
        /// <summary>
        /// 转成模型坐标
        /// </summary>
        /// <param name="pSourceLocation"></param>
        /// <returns></returns>
        private Point GetInFactLocation(Point pSourceLocation)
        {
            int x = pSourceLocation.X;
            int y = pSourceLocation.Y;
            if (x >= AxisOffset && y >= AxisOffset)
            {
                x = (int)((x - AxisOffset) / MonitorDPI / scaling * 100);
                y = (int)((y - AxisOffset) / MonitorDPI / scaling * 100);
            }
            Point pTemp = new Point(x, y);
            return pTemp;
        }
        #endregion

        #region 点击添加MapNode
        private void mapPanel1_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left) return;
            if (newType == NodeType.StationNode)
            {
                #region 如果是站点
                MapNode mapCircle = new MapNode();
                mapPanelDocker.Controls.Add(mapCircle);
                mapCircle.Name = "Point-" + GetMaxPointName();
                mapCircle.NameText = mapCircle.Name;
                mapCircle.OnNameChange += mapPanelDocker.mapCircle_OnNameChange;
                mapCircle.Left = e.X;
                mapCircle.Top = e.Y;
                mapCircle.Size = new Size(20, 20);
                mapCircle._type = "站点";
                mapCircle.Click += mapPanelDocker.MapCircle_Click;
                mapCircle.Focus();

                Label label1 = new Label();
                label1.BorderStyle = BorderStyle.None;
                label1.Name = mapCircle.Name;
                label1.BackColor = Color.Transparent;
                label1.Location = new Point((mapCircle).Location.X - 15, (mapCircle).Location.Y - 12);
                label1.ForeColor = mapPanelDocker.BackColor == Color.Black ? Color.White : Color.Black;
                label1.Text = mapCircle.Name;
                label1.AutoSize = true;
                label1.Visible = true;
                label1.BringToFront();
                mapPanelDocker.Controls.Add(label1);
                #endregion
            }
            else if (newType == NodeType.ParkingStationNode)
            {
                #region 停车点
                MapNode mapCircle = new MapNode();
                mapPanelDocker.Controls.Add(mapCircle);
                mapCircle.Name = "Point-" + GetMaxPointName();
                mapCircle.NameText = mapCircle.Name;
                mapCircle.OnNameChange += mapPanelDocker.mapCircle_OnNameChange;
                mapCircle.Left = e.X;
                mapCircle.Top = e.Y;
                mapCircle.Size = new Size(20, 20);
                mapCircle._type = "停车点";
                mapCircle.Click += mapPanelDocker.MapCircle_Click;
                mapCircle.Focus();

                Label label1 = new Label();
                label1.BorderStyle = BorderStyle.None;
                label1.Name = mapCircle.Name;
                label1.BackColor = Color.Transparent;
                label1.Location = new Point((mapCircle).Location.X - 15, (mapCircle).Location.Y - 12);
                label1.ForeColor = mapPanelDocker.BackColor == Color.Black ? Color.White : Color.Black;
                label1.Text = mapCircle.Name;
                label1.AutoSize = true;
                label1.Visible = true;
                label1.BringToFront();
                mapPanelDocker.Controls.Add(label1);
                #endregion
            }
            else
            {
                propertyGridControl.SelectedObject = new MapPanelProperty((MapPanel)sender);
            }
        }
        #endregion

        #region 获得一个临时的最大的站点名称
        /// <summary>
        /// 获得一个临时的最大的站点数字编号
        /// </summary>
        /// <returns></returns>
        private string GetMaxPointName()
        {
            List<string> pointListTemp = new List<string>();
            foreach (Control item in this.mapPanelDocker.Controls)
            {
                if (item.GetType() == typeof(MapNode))
                {
                    MapNode station = (MapNode)item;
                    string _Name = station.Name;
                    if (!pointListTemp.Contains(_Name))
                    {
                        pointListTemp.Add(_Name);
                    }
                }
            }
            for (int i = 0; i < pointListTemp.Count; i++)
            {
                if (pointListTemp[i] == null)
                {
                    pointListTemp.Remove(pointListTemp[i]);
                }
            }
            if (pointListTemp.Count == 0)
            {
                return "001";
            }
            else if (pointListTemp.Count == 1 && pointListTemp[0] == "")
            {
                return "001";
            }
            else
            {
                string maxPoint = pointListTemp.OrderBy(a => a.ToString()).Max();
                string strTemp = maxPoint.Split('-')[1];
                int intTemp2 = int.Parse(strTemp);
                return (intTemp2 + 1).ToString().PadLeft(3, '0');
            }
        }
        #endregion
        #region 获得一个最大的块的名称
        public string GetMaxBlockName()
        {
            AGV_Block[] allBlocks = XmlHelper.ReadXmlFile.ReadAllBlock(GlobalSystemConfig.Instance.AgvConfigPath);
            if (allBlocks != null && allBlocks.Length > 0)
            {
                string strTemp = allBlocks.Select(e => e.BlockName).Max();
                if (strTemp != "")
                {
                    int intTemp = int.Parse(strTemp.Replace("Block-", ""));
                    return (intTemp + 1).ToString().PadLeft(3, '0');
                }
                else
                {
                    return "001";
                }
            }
            return "001";
        }
        #endregion

        #region 定时器主线程
        private void timer1_Tick(object sender, EventArgs e)
        {
            #region 显示指针样式和时间
            string temp = "";
            switch (newType)
            {
                case NodeType.MousePick:
                default:
                    temp = "鼠标";
                    break;
                case NodeType.StationNode:
                    temp = "站点";
                    break;
                case NodeType.ParkingStationNode:
                    temp = "停车点";
                    break;
                case NodeType.DirectLineCap:
                    temp = "直线箭头";
                    break;
                case NodeType.BezierLineCap:
                    temp = "曲线箭头";
                    break;
                case NodeType.Block:
                    temp = "块";
                    break;
                case NodeType.Vehicle:
                    temp = "车";
                    break;
            }
            this.lb_NewType.Text = "当前选项:" + temp;
            this.lbTime.Text = DateTime.Now.ToString("yyyy-MM-dd  hh:mm:ss(ddd)");
            #endregion
        }
        #endregion



        #region 窗体关闭时
        private void frm_AGVMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dg = MessageBox.Show("Do you want to exit this Application?", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            if (dg == DialogResult.OK)
            {
                try
                {
                    timer1.Stop();
                }
                catch
                {
                }
                finally
                {
                    loadForm = new LoadingForm();
                    loadForm.ShowLoadingDealy(2);
                    Application.ExitThread();
                    Application.Exit();//通知winform消息循环退出 在所有前台线程退出后退出应用 先停止线程 再终止线程
                    Environment.Exit(1);//直接终止所有线程,code为1即使有错误也直接终止 直接终止线程
                }
            }
            else
            {
                e.Cancel = true;
            }
        }
        #endregion
        #region 打开配置文件
        private void btn_打开文件_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = @"*.xml|*.xml";
            openFileDialog.InitialDirectory = GlobalSystemConfig.Instance.AppStartPath + @"\AppConfigDir\";
            if (openFileDialog.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            mapPanelDocker.OpenMap(openFileDialog.FileName);
            GlobalSystemConfig.Instance.AgvConfigPath = openFileDialog.FileName;
            InitialTreeViewLayout();
            floydCurrent = new FloydHelper();
        }
        #endregion
        #region 保存数据到xml文件
        private void bnt_保存_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = @"*.xml|*.xml";
            saveFileDialog.InitialDirectory = GlobalSystemConfig.Instance.AppStartPath + @"\AppConfigDir\";
            if (saveFileDialog.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            mapPanelDocker.SaveMap(saveFileDialog.FileName);
            XmlHelper.WriteXmlFile.UpdateModifiedDate(saveFileDialog.FileName);
            floydCurrent = new FloydHelper();
        }
        #endregion
        #region 上下左右
        private void btn_Left_Click(object sender, EventArgs e)
        {
            this.mapPanelDocker.Focus();
            this.btn_Left.Enabled = false;
            SendKeys.Send("{LEFT}");
            this.btn_Left.Enabled = true;
        }

        private void btn_up_Click(object sender, EventArgs e)
        {
            this.mapPanelDocker.Focus();
            this.btn_Left.Enabled = false;
            SendKeys.Send("{UP}");
            this.btn_Left.Enabled = true;
        }
        private void button4_Click(object sender, EventArgs e)
        {
            this.mapPanelDocker.Focus();
            this.btn_Left.Enabled = false;
            SendKeys.Send("{DOWN}");
            this.btn_Left.Enabled = true;
        }

        private void btn_right_Click(object sender, EventArgs e)
        {
            this.mapPanelDocker.Focus();
            this.btn_Left.Enabled = false;
            SendKeys.Send("{RIGHT}");
            this.btn_Left.Enabled = true;
        }
        #endregion
        #region 鼠标移入移出显示坐标
        private void mapPanelDocker_MouseMove(object sender, MouseEventArgs e)
        {
            this.lbLocation.Text = "X:" + e.Location.X.ToString() + "、Y:" + e.Location.Y.ToString();
        }

        private void mapPanelDocker_MouseLeave(object sender, EventArgs e)
        {
            this.lbLocation.Text = "";
        }
        #endregion
        #region treeView选中某一项时
        private void treeviewLayout_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode tn = e.Node;
            if (tn != null)
            {
                if (tn.Text != "")
                {
                    if (tn.Text.StartsWith("Path"))
                    {
                        this.mapPanelDocker.AddSelectLine(tn.Text);
                    }
                    else if (tn.Text.StartsWith("Point"))
                    {
                        this.mapPanelDocker.AddSelectStation(tn.Text);
                    }
                    else if (tn.Text.StartsWith("Block"))
                    {
                        this.mapPanelDocker.AddSelectBlck(tn.Text);
                    }
                }
            }
        }
        #endregion
        #region 添加或者删除一条路径到Block
        #region 添加
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (mapPanelDocker.SelectMapline != null || mapPanelDocker.SelectMapBezierline != null)
            {
                string strBlockName = this.treeviewLayout.SelectedNode.Text.Replace(" ", "").Replace("BlockBlock", "Block");
                string lineName = "";
                string BezierLineName = "";
                if (mapPanelDocker.SelectMapline != null)
                {
                    lineName = mapPanelDocker.SelectMapline.LineName;
                }
                if (mapPanelDocker.SelectMapBezierline != null)
                {
                    BezierLineName = mapPanelDocker.SelectMapBezierline.LineName;
                }
                AGV_Block[] allBlocks = ReadXmlFile.ReadAllBlock(GlobalSystemConfig.Instance.AgvConfigPath);
                for (int i = 0; i < allBlocks.Length; i++)
                {
                    if (allBlocks[i].BlockName == strBlockName)
                    {
                        if (lineName != "")
                        {
                            if (!allBlocks[i].menbers.Contains(lineName))
                            {
                                if (allBlocks[i].menbers == "")
                                {
                                    allBlocks[i].menbers = lineName;
                                }
                                else
                                {
                                    allBlocks[i].menbers = allBlocks[i].menbers + "," + lineName;
                                }
                            }
                        }
                        if (BezierLineName != "")
                        {
                            if (!allBlocks[i].menbers.Contains(BezierLineName))
                            {
                                if (allBlocks[i].menbers == "")
                                {
                                    allBlocks[i].menbers = BezierLineName;
                                }
                                else
                                {
                                    allBlocks[i].menbers = allBlocks[i].menbers + "," + BezierLineName;
                                }
                            }
                        }
                        XmlHelper.WriteXmlFile.WriteOrCreateBlockValue(allBlocks[i], GlobalSystemConfig.Instance.AgvConfigPath);
                        InitialTreeViewLayout();
                    }
                }
            }
        }
        #endregion
        #region 移除
        private void deleteSelectPathToBlocksToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (mapPanelDocker.SelectMapline != null || mapPanelDocker.SelectMapBezierline != null)
            {
                string strBlockName = this.treeviewLayout.SelectedNode.Text.Replace(" ", "").Replace("BlockBlock", "Block");
                string lineName = "";
                string BezierLineName = "";
                if (mapPanelDocker.SelectMapline != null)
                {
                    lineName = mapPanelDocker.SelectMapline.LineName;
                }
                if (mapPanelDocker.SelectMapBezierline != null)
                {
                    BezierLineName = mapPanelDocker.SelectMapBezierline.LineName;
                }
                AGV_Block[] allBlocks = ReadXmlFile.ReadAllBlock(GlobalSystemConfig.Instance.AgvConfigPath);
                for (int i = 0; i < allBlocks.Length; i++)
                {
                    if (allBlocks[i].BlockName == strBlockName)
                    {
                        if (lineName != "")
                        {
                            if (allBlocks[i].menbers.Contains(lineName))
                            {
                                if (allBlocks[i].menbers == lineName)
                                {
                                    allBlocks[i].menbers = "";
                                }
                                else if (allBlocks[i].menbers.Contains(lineName + ","))
                                {
                                    allBlocks[i].menbers = allBlocks[i].menbers.Replace(lineName + ",", "");
                                }
                                else
                                {
                                    allBlocks[i].menbers = allBlocks[i].menbers.Replace(lineName, "");
                                }
                            }
                        }
                        if (BezierLineName != "")
                        {
                            if (allBlocks[i].menbers.Contains(BezierLineName))
                            {
                                if (allBlocks[i].menbers == BezierLineName)
                                {
                                    allBlocks[i].menbers = "";
                                }
                                else if (allBlocks[i].menbers.Contains(BezierLineName + ","))
                                {
                                    allBlocks[i].menbers = allBlocks[i].menbers.Replace(BezierLineName + ",", "");
                                }
                                else
                                {
                                    allBlocks[i].menbers = allBlocks[i].menbers.Replace(BezierLineName, "");
                                }
                            }
                        }
                        XmlHelper.WriteXmlFile.WriteOrCreateBlockValue(allBlocks[i], GlobalSystemConfig.Instance.AgvConfigPath);
                        InitialTreeViewLayout();
                    }
                }
            }
        }
        #endregion
        #region 删除整个块
        private void deleteEntileBlocksToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string strBlockName = this.treeviewLayout.SelectedNode.Text.Replace(" ", "").Replace("BlockBlock", "Block");
            if (strBlockName.StartsWith("Block"))
            {
                if (mapPanelDocker.ListMapBlock != null && mapPanelDocker.ListMapBlock.Count > 0)
                {
                    for (int i = 0; i < mapPanelDocker.ListMapBlock.Count; i++)
                    {
                        if (mapPanelDocker.ListMapBlock[i].BlockName == strBlockName)
                        {
                            mapPanelDocker.ListMapBlock.Remove(mapPanelDocker.ListMapBlock[i]);
                            mapPanelDocker.SaveMap(GlobalSystemConfig.Instance.AgvConfigPath);
                            InitialTreeViewLayout();
                        }
                    }
                }
            }
        }
        #endregion
        #endregion
        #region 右键菜单打开时
        private void menuBlock_Opening(object sender, CancelEventArgs e)
        {

        }
        #endregion
        #region 点击进行选中当前节点
        private void treeviewLayout_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)
            {
                this.treeviewLayout.SelectedNode = e.Node;
            }
        }
        #endregion
        #region 块点击事件
        private void btn_块_Click(object sender, EventArgs e)
        {
            if (newType == NodeType.Block)
            {
                MapBlock block = new MapBlock();
                block.OnColorChange += mapPanelDocker.block_OnColorChange;
                block.BlockName = "Block-" + GetMaxBlockName();
                block.BlockColor = Color.Red;
                block.menberLines = new List<MapLine>();
                block.menberBezierLines = new List<MapBezierLine>();
                block.isSlected = true;
                mapPanelDocker.ListMapBlock.Add(block);
                mapPanelDocker.SaveMap(GlobalSystemConfig.Instance.AgvConfigPath);
            }
            InitialTreeViewLayout();
        }
        #endregion
        #region 双击查找路径或者站点
        private void treeviewLayout_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            string whichText = e.Node.Text.Replace(" ", "");
            if (whichText.StartsWith("PointPoint") || whichText.StartsWith("PathPoint"))
            {
                AGV_Line[] allLines = XmlHelper.ReadXmlFile.ReadAllLine(GlobalSystemConfig.Instance.AgvConfigPath);
                if (whichText.StartsWith("PointPoint"))
                {
                    whichText = whichText.Replace("PointPoint", "Point").Replace("PathPoint", "Point");//点
                    foreach (Control item in mapPanelDocker.Controls)
                    {
                        if(item.GetType()==typeof(MapNode))
                        {
                            MapNode node = (MapNode)item;
                            if(node.Name==whichText)
                            {
                                Graphics g = mapPanelDocker.CreateGraphics();
                                g.SmoothingMode = SmoothingMode.HighQuality;
                                Pen p = new Pen(Color.Lime, 2);
                                Point pointTemp = new Point(node.Location.X - 25, node.Location.Y - 25);
                                Size sizeTemp = new Size(70, 70);
                                g.DrawEllipse(p, pointTemp.X, pointTemp.Y, sizeTemp.Width, sizeTemp.Height);
                            }
                        }
                    }
                }
                else
                {
                    whichText = whichText.Replace("PointPoint", "Point").Replace("PathPoint", "Point");//路径
                    if (allLines != null && allLines.Length > 0)
                    {
                        for (int i = 0; i < allLines.Length; i++)
                        {
                            if (allLines[i].LineName == whichText)
                            {
                                AGV_Line agvLine = allLines[i];
                                Pen p = new Pen(Color.Red, 2);
                                Graphics g = mapPanelDocker.CreateGraphics();
                                g.SmoothingMode = SmoothingMode.HighQuality;
                                if (agvLine.controlPoint1.X != 0)
                                {
                                    Point pointTemp = new Point(((agvLine.controlPoint1.X + agvLine.controlPoint2.X) / 2) - 20, ((agvLine.controlPoint1.Y + agvLine.controlPoint2.Y) / 2) - 20);
                                    Size sizeTemp = new Size(60, 60);
                                    g.DrawEllipse(p, pointTemp.X, pointTemp.Y, sizeTemp.Width, sizeTemp.Height);
                                }
                                else
                                {
                                    Point pointTemp1 = new Point(0,0);
                                    Point pointTemp2 = new Point(0, 0);
                                    foreach (Control item in mapPanelDocker.Controls)
                                    {
                                        if (item.GetType() == typeof(MapNode))
                                        {
                                            MapNode node = (MapNode)item;
                                            if (node.Name == agvLine.StartControl)
                                            {
                                                pointTemp1 = node.Location;
                                            }
                                            if (node.Name == agvLine.EndControl)
                                            {
                                                pointTemp2 = node.Location;
                                            }
                                        }
                                    }
                                    if (pointTemp1.X != 0 && pointTemp2.X != 0)
                                    {
                                        Point pointTemp = new Point(((pointTemp1.X + pointTemp2.X) / 2) - 20, ((pointTemp1.Y + pointTemp2.Y) / 2) - 20);
                                        Size sizeTemp = new Size(60, 60);
                                        g.DrawEllipse(p, pointTemp.X, pointTemp.Y, sizeTemp.Width, sizeTemp.Height);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        #endregion
        #region 新建一个地图文件
        private void btn_New_Click(object sender, EventArgs e)
        {
            mapPanelDocker.OpenMap("");
            GlobalSystemConfig.Instance.AgvConfigPath = "";
            InitialTreeViewLayout();
            floydCurrent = new FloydHelper();
        }
        #endregion

        #region 车点击事件
        private void btn_车_Click(object sender, EventArgs e)
        {
            if (newType == NodeType.Vehicle)
            {
                MapBlock block = new MapBlock();
                block.OnColorChange += mapPanelDocker.block_OnColorChange;
                block.BlockName = "Vehicle-" + GetMaxBlockName();
                block.BlockColor = Color.Red;
                block.menberLines = new List<MapLine>();
                block.menberBezierLines = new List<MapBezierLine>();
                block.isSlected = true;
                mapPanelDocker.ListMapBlock.Add(block);
                mapPanelDocker.SaveMap(GlobalSystemConfig.Instance.AgvConfigPath);
            }
            InitialTreeViewLayout();
        }
        #endregion
        #region 双击时
        private void treeViewVehicle_AfterSelect(object sender, TreeViewEventArgs e)
        {

        }
        #endregion
        #region 双击时将当前小车进行标定
        private void treeViewVehicle_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {

        }
        #endregion
        #region 鼠标左键或者有键将当前节点选中
        private void treeViewVehicle_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)
            {
                this.treeViewVehicle.SelectedNode = e.Node;
            }
        }
        #endregion
        #region 是否显示站点的label
        bool showLabelFlag = true;
        private void button2_Click(object sender, EventArgs e)
        {
            if (showLabelFlag)
            {
                this.btn_ShowLabel.BackColor = Color.Transparent;
                showLabelFlag = false;
                foreach (Control item in this.mapPanelDocker.Controls)
                {
                    if (item.GetType() == typeof(Label))
                    {
                        item.Text = "";
                    }
                }
            }
            else
            {
                this.btn_ShowLabel.BackColor = Color.Wheat;
                showLabelFlag = true;
                foreach (Control item in this.mapPanelDocker.Controls)
                {
                    if (item.GetType() == typeof(Label))
                    {
                        item.Text = item.Name;
                    }
                }
            }
            this.mapPanelDocker.Invalidate();
        }
        #endregion
        #region 是否显示块的背景颜色
        bool showBlockLine = true;
        private void button1_Click(object sender, EventArgs e)
        {
            if (showBlockLine)
            {
                this.btn_ShowBlock.BackColor = Color.Wheat;
                showBlockLine = false;
                foreach (MapBlock item in this.mapPanelDocker.ListMapBlock)
                {
                    item.ShowBlockLineColor = false;
                }
            }
            else
            {
                this.btn_ShowBlock.BackColor = Color.Transparent;
                showBlockLine = true;
                foreach (MapBlock item in this.mapPanelDocker.ListMapBlock)
                {
                    item.ShowBlockLineColor = true;
                }
            }
            this.mapPanelDocker.Invalidate();
        }
        #endregion

        private void btn_查找小车_Click(object sender, EventArgs e)
        {

        }

        #region 显示当前地图的版本信息
        private void showToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string filePath = GlobalSystemConfig.Instance.AgvConfigPath;
            string StationNum, ParkingNum, DirectNum,
                   BezierNum, FileName, BlockNum,
                   VehicleNum, ModifyDate;
            ReadXmlFile.GetMapNodeNum(out StationNum, out ParkingNum, out DirectNum,
                                         out BezierNum, out FileName, out BlockNum,
                                         out VehicleNum, out ModifyDate, filePath);
            NumberModel model = new NumberModel()
            {
                StationNum = StationNum,
                ParkingStationnum = ParkingNum,
                DirectLineNum = DirectNum,
                BezierLineNum = BezierNum,
                FileName = FileName,
                BlockNum = BlockNum,
                VehicleNum = VehicleNum,
                ModifiedDate = ModifyDate
            };
            frm_Property = new frm_ModelProperty(model);
            frm_Property.ShowDialog();
        }
        #endregion

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/399398.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

[极客挑战2019]HTTP

这道题考察的是http请求头字段的含义和使用&#xff1b; 具体如下 Referer:来源地址 User-Agent:客户端配置信息&#xff1a;浏览器类型、版本、系统类型等 X-Forwarded-For:代理地址&#xff0c;即数据发出的地址 开始解题&#xff1a;&#xff08;对我这初学者真的烧脑&a…

解决数学计算公式在前端项目里的展示,涉及换肤适配各个框架

有时候我们项目里面会嵌套一些数学公式说明 例如 可能你会发现市面上有很多的第三方库可以实现&#xff0c;比如&#xff1a; MathJax&#xff1a; https://www.mathjax.org/ 但是我们项目里面用到公式可能就一个页面&#xff0c;引一个第三方库进来会显得十分臃肿&#xff0…

【python】linux系统python报错“ssl module in Python is not available”

一、问题现象 1.1 执行pip命令报错 pip安装时遇到openssl问题&#xff0c;没办法安装第三方库 “WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. ” 1.2 导入import ssl 报错 直接执行python&…

【Flink网络通讯(一)】Flink RPC框架的整体设计

文章目录 1. Akka基本概念与Actor模型2. Akka相关demo2.1. 创建Akka系统2.2. 根据path获取Actor并与之通讯 3. Flink RPC框架与Akka的关系4.运行时RPC整体架构设计5. RpcEndpoint的设计与实现 我们从整体的角度看一下Flink RPC通信框架的设计与实现&#xff0c;了解其底层Akka通…

IDEA 2023.2 配置 JavaWeb 工程

目录 1 不使用 Maven 创建 JavaWeb 工程 1.1 新建一个工程 1.2 配置 Tomcat 1.3 配置模块 Web 2 使用 Maven 配置 JavaWeb 工程 2.1 新建一个 Maven 工程 2.2 配置 Tomcat &#x1f4a5;提示&#xff1a;IDEA 只有专业版才能配置 JavaWeb 工程&#xff0c;若是社区版&am…

VIO第3讲:基于优化的IMU与视觉信息融合之最小二乘详解

第3讲&#xff1a;基于优化的IMU与视觉信息融合之最小二乘详解 文章目录 第3讲&#xff1a;基于优化的IMU与视觉信息融合之最小二乘详解1 最小二乘问题求解1.1 基础概念1.2 总结1.1 基础&#xff1a;最速下降法&#xff0c;牛顿法, 阻尼法1.1.1 迭代法1.1.2 最速下降法&#xf…

OAuth2.0 最简向导

本文是一篇关于OAuth2.0的启蒙教程&#xff0c;图文并茂&#xff0c;通俗易懂&#xff0c;力求用最简洁明了的方式向初学者解释OAuth2.0是什么。本文并不是冗杂难懂的长篇大论&#xff0c;一图胜千言&#xff0c;深入浅出OAuth2.0&#xff0c;知其然知其所以然。 参考文献 首…

DDI中的自适应子结构

SA-DDI提出了一种子结构感知图神经网络&#xff0c;一种配备了子结构注意力机制和用于DDI预测的子结构-子结构交互模块&#xff08;SSIM&#xff09;的消息传递神经网络。具体而言&#xff0c;基于分子中官能团的尺寸和形状通常是不规则的化学直觉&#xff0c;子结构注意力被设…

大模型时代下做科研的四个思路【论文精读·52】

大家好&#xff0c;上个礼拜FacebookMetaAI刚刚开源了他们自己的一个语言的大模型&#xff0c;叫做LLAMA&#xff0c;这个LLAMA的模型有65billing的参数&#xff0c;效果自然是不错的。他们的目的也是想让这个大模型更加的亲民&#xff0c;能够让更多人拿到这个模型的参数&…

ClickHouse快速上手

简介 ClickHouse是一个用于联机分析(OLAP)的列式数据库管理系统(DBMS) 官网(https://clickhouse.com/docs/zh)给出的定义&#xff0c;其实没看懂 特性 ClickHouse支持一种基于SQL的声明式查询语言&#xff0c;它在许多情况下与ANSI SQL标准相同。使用时和MySQL有点相似&#…

加固平板电脑在无人机的应用|亿道三防onerugged

无人机技术的快速发展已经在许多领域展现出巨大潜力&#xff0c;而加固平板电脑的应用在无人机领域中扮演着重要角色。 首先&#xff0c;加固平板电脑在无人机探测设备中发挥着关键作用。无人机探测设备通常需要实时传输高清图像和数据&#xff0c;以支持各种监测、勘测和检测…

JAVA高并发——无锁与死锁

文章目录 1、与众不同的并发策略&#xff1a;比较交换2、无锁的线程安全整数&#xff1a;AtomicInteger3、Java中的指针&#xff1a;Unsafe类4、无锁的对象引用&#xff1a;AtomicReference5、带有时间戳的对象引用&#xff1a;AtomicStampedReference6、数组也能无锁&#xff…

Unity2023.1.19_ShaderGraph节点说明以及使用技巧

Unity2023.1.19_ShaderGraph节点说明以及使用技巧 目录 Unity2023.1.19_ShaderGraph节点说明以及使用技巧 1. 快捷键CtrlG完成和UE蓝图使用快捷键C一样的蓝图分组注释效果&#xff1a; 2. Tiling And Offset&#xff1a; 3. 以下是两组URP材质渲染的效果对比&#xff1a; 4…

JWT 重点讲解

JWT 重点讲解 文章目录 JWT 重点讲解1. JWT 是什么2. JWT 的组成2.1 第一部分 HEADER2.2 第二部分 PAYLOAD2.3 第三部分 SIGNATURE 3. JWT 在线生成与解析4. JWT 的特点4.1 无状态4.2 可自定义4.3 扩展性强4.4 调试性好4.5 安全性取决于密钥管理4.6 无法撤销4.7 需要缓存到客户…

Android基础Adapter适配器详解

一、概念 Adapter是后端数据和前端显示UI的适配器接口。常见的View如ListView、GridView等需要用到Adapter. BaseAdapter&#xff1a;抽象类&#xff0c;实际开发中继承这个类并且重写相关方法&#xff0c;用得最多的一个Adapter&#xff01; ArrayAdapter&#xff1a;支持泛型…

第五篇【传奇开心果系列】Python文本和语音相互转换库技术点案例示例:详细解读pyttsx3的`preprocess_text`函数文本预处理。

传奇开心果短博文系列 系列短博文目录Python文本和语音相互转换库技术点案例示例系列 短博文目录前言一、pyttsx3的preprocess_text函数文本预处理基本用法示例代码二、实现更复杂的文本预处理逻辑示例代码三、去除停用词、词干提取示例代码四、词形还原、拼写纠正示例代码五、…

19-k8s的附加组件-coreDNS组件

一、概念 coreDNS组件&#xff1a;就是将svc资源的名称解析成ClusterIP&#xff1b; kubeadm部署的k8s集群自带coreDNS组件&#xff0c;二进制部署需要自己手动部署&#xff1b; [rootk8s231 ~]# kubectl get pods -o wide -A k8s系统中安装了coreDNS组件后&#xff0c;会有一个…

Linux(五)__系统管理

介绍 通常&#xff0c; Windows 中使用"任务管理器"主要有 3 个目的&#xff1a; 利用"应用程序"和"进程"标签来査看系统中到底运行了哪些程序和进程&#xff1b;利用"性能"和"用户"标签来判断服务器的健康状态&#xff1…

国际章真厉害,离婚后仍带汪峰继女小苹果赴日滑雪。

♥ 为方便您进行讨论和分享&#xff0c;同时也为能带给您不一样的参与感。请您在阅读本文之前&#xff0c;点击一下“关注”&#xff0c;非常感谢您的支持&#xff01; 文 |猴哥聊娱乐 编 辑|徐 婷 校 对|侯欢庭 在如今这个纷繁复杂的社会中&#xff0c;家庭关系和亲子关系的…

K8S | 全面解读CKA认证的重要性!

K8S认证工程师&#xff08;CKA&#xff09;备考与学习指南https://blog.csdn.net/XMWS_IT/article/details/133697915?ops_request_misc%257B%2522request%255Fid%2522%253A%2522170849020616800182129977%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2…
最新文章