Exemple #1
0
        /// <summary>
        ///绘制运行线与冲突
        /// </summary>
        public void DrawPicture()
        {
            pictureBox2.Size = new Size(TD_Width, TD_Height);
            Graphics gs;

            gs = Graphics.FromImage(bmp);
            int           ix      = dm.stationDrawList.Count();
            List <double> staMile = new List <double>();

            for (int i = 0; i < ix; i++)
            {
                staMile.Add(dm.stationDrawList[i].totalMile);
            }
            pt.Branch(dm.stationDrawStringList, staMile, this.bmp.Width, this.bmp.Height);
            int k = pt.border2.Count;

            pictureBox2.BackgroundImage = null;
            gs.Clear(this.pictureBox2.BackColor);
            if (checkBox1.Checked == true && checkBox2.Checked == true)
            {
                for (int i = 0; i < k; i++)
                {
                    int    ii     = i + 1;
                    double total1 = pt.Mile1[ii].Last();
                    pt.TimetableFrame(this.bmp.Width, pt.border2[i].up, pt.border2[i].down, total1, pt.Mile1[ii], gs, pt.str1[ii], ii);
                    pt.TrainLine(gs, dm.upTrainList, pt.str1[ii], ii);
                    pt.TrainLine(gs, dm.downTrainList, pt.str1[ii], ii);
                }
            }
            else if (checkBox1.Checked == true && checkBox2.Checked == false)
            {
                for (int i = 0; i < k; i++)
                {
                    int    ii     = i + 1;
                    double total1 = pt.Mile1[ii].Last();
                    pt.TimetableFrame(this.bmp.Width, pt.border2[i].up, pt.border2[i].down, total1, pt.Mile1[ii], gs, pt.str1[ii], ii);
                    pt.TrainLine(gs, dm.upTrainList, pt.str1[ii], ii);
                }
            }
            else if (checkBox1.Checked == false && checkBox2.Checked == true)
            {
                for (int i = 0; i < k; i++)
                {
                    int    ii     = i + 1;
                    double total1 = pt.Mile1[ii].Last();
                    pt.TimetableFrame(this.bmp.Width, pt.border2[i].up, pt.border2[i].down, total1, pt.Mile1[ii], gs, pt.str1[ii], ii);
                    pt.TrainLine(gs, dm.downTrainList, pt.str1[ii], ii);
                }
            }
            else
            {
                for (int i = 0; i < k; i++)
                {
                    int    ii     = i + 1;
                    double total1 = pt.Mile1[ii].Last();
                    pt.TimetableFrame(this.bmp.Width, pt.border2[i].up, pt.border2[i].down, total1, pt.Mile1[ii], gs, pt.str1[ii], ii);
                }
            }
            for (int i = 0; i < k; i++)
            {
                pt.GetTrainPoint(dm.TrainList, pt.str1[i + 1], i);
            }
            pt.GetConflictPoint(ci.ConflictList, dm.TrainList);
            this.pictureBox2.BackgroundImage = bmp;
        }