コード例 #1
0
ファイル: Form_Guide.cs プロジェクト: miphas/SmartCarB
        private void btnOK(object sender, EventArgs e)
        {
            if (this.comboBox1.SelectedIndex == -1)
            {
                return;
            }
            if (this.comboBox1.SelectedIndex == 0)
            {
                return;
            }
            if (hintMsg.Initializing)
            {
                return;
            }

            try { hintMsg.pCurrent.x = double.Parse(this.textBox5.Text); } catch { }
            try { hintMsg.pCurrent.y = double.Parse(this.textBox4.Text); } catch { }
            try { hintMsg.pCurrent.w = double.Parse(this.textBox3.Text); } catch { }

            DataArea.mapModel.Points[this.comboBox1.SelectedIndex] = hintMsg.pCurrent;
            this.panel1.Visible = false;

            DataArea.drawFormat.selfAdjustSize(DataArea.mapModel);
            DrawPath path = new DrawPath(DataArea.mapModel, DataArea.drawFormat);

            path.drawCurPos(new KeyPoint());
            this.picPath.Image           = path.getDrawImg();
            this.picPath.BackgroundImage = new DrawPolygon(DataArea.mapModel, DataArea.drawFormat).getDrawImg();
        }
コード例 #2
0
ファイル: Form_Guide.cs プロジェクト: miphas/SmartCarB
        private void updatePath(KeyPoint curPos)
        {
            DrawPath path = new DrawPath(DataArea.mapModel, DataArea.drawFormat);

            path.drawCurPos(curPos);
            this.picPath.Image = path.getDrawImg();
        }
コード例 #3
0
ファイル: Form_Path.cs プロジェクト: miphas/SmartCarB
        private void btnOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                // 打开对应文件
                DataArea.mapFile  = new MapFile(dialog.FileName);
                DataArea.mapModel = new MapModel();
                DataArea.mapFile.readNodeData(DataArea.mapModel);
                // 填写相关信息
                //this.textBox1.Text = FilenameUtil.getFilename(dialog.FileName, ".xml");
                //this.textBox2.Text = dialog.FileName;
                // 绘制路径
                DataArea.drawFormat.selfAdjustSize(DataArea.mapModel);
                DrawPath path = new DrawPath(DataArea.mapModel, DataArea.drawFormat);
                path.drawCurPos(new KeyPoint());
                this.picGenMap.Image           = path.getDrawImg();
                this.picGenMap.BackgroundImage = new DrawPolygon(DataArea.mapModel, DataArea.drawFormat).getDrawImg();
            }
        }
コード例 #4
0
ファイル: Form_Guide.cs プロジェクト: miphas/SmartCarB
        private void btnDelete(object sender, EventArgs e)
        {
            if (hintMsg.Initializing)
            {
                return;
            }
            if (this.comboBox1.SelectedIndex == 0)
            {
                return;
            }

            DataArea.mapModel.Points.RemoveAt(this.comboBox1.SelectedIndex);
            this.panel1.Visible = false;

            DataArea.drawFormat.selfAdjustSize(DataArea.mapModel);
            DrawPath path = new DrawPath(DataArea.mapModel, DataArea.drawFormat);

            path.drawCurPos(new KeyPoint());
            this.picPath.Image           = path.getDrawImg();
            this.picPath.BackgroundImage = new DrawPolygon(DataArea.mapModel, DataArea.drawFormat).getDrawImg();
        }