public List <RuleData> GetTokAnchorRuleDatas()
 {
     RuleDatas.Add(new RuleData
     {
         Pen         = pen,
         FirstPoint  = new Point(0, panelHeight / 2),
         SecondPoint = new Point(panelWidth, panelHeight / 2)
     });
     for (int i = 0; i <= _mineConfig.MainViewConfig.MaxTokAnchor.Value * 10; i++)
     {
         if (i % 10 == 0)
         {
             RuleDatas.Add(new RuleData
             {
                 Pen         = pen,
                 FirstPoint  = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x1_long),
                 SecondPoint = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x2_long)
             });
             if (i / 10 >= 10)
             {
                 RuleInscriptions.Add(new RuleInscription
                 {
                     Text     = Convert.ToString(i / 10),
                     Font     = drawFont_two,
                     Brush    = black,
                     Position = new Point(Convert.ToInt32(pixel_pro_meter * i / 10) - 10, x2_long)
                 });
             }
             else
             {
                 RuleInscriptions.Add(new RuleInscription
                 {
                     Text     = Convert.ToString(i / 10),
                     Font     = drawFont_two,
                     Brush    = black,
                     Position = new Point(Convert.ToInt32(pixel_pro_meter * i / 10), x2_long)
                 });
             }
         }
         else if (i % 5 == 0)
         {
             RuleDatas.Add(new RuleData
             {
                 Pen         = pen,
                 FirstPoint  = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x1_middle),
                 SecondPoint = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x2_middle)
             });
         }
         else if (i % 1 == 0)
         {
             RuleDatas.Add(new RuleData
             {
                 Pen         = pen,
                 FirstPoint  = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x1_small),
                 SecondPoint = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x2_small)
             });
         }
     }
     return(RuleDatas);
 }
 public List <RuleData> GetTokExcitationRuleDatas()
 {
     RuleDatas.Add(new RuleData
     {
         Pen         = pen,
         FirstPoint  = new Point(0, panelHeight / 2),
         SecondPoint = new Point(panelWidth, panelHeight / 2)
     });
     for (int i = Convert.ToInt32(_mineConfig.MainViewConfig.MaxTokExcitation.Value * (-1)); i <= _mineConfig.MainViewConfig.MaxTokExcitation.Value; i++)
     {
         if (i % 50 == 0)
         {
             RuleDatas.Add(new RuleData
             {
                 Pen         = pen,
                 FirstPoint  = new Point((10 + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value) + Convert.ToInt32(pixel_pro_meter * i)), x1_long),
                 SecondPoint = new Point((10 + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value) + Convert.ToInt32(pixel_pro_meter * i)), x2_long)
             });
             if (i >= 10 && i < 100)
             {
                 RuleInscriptions.Add(new RuleInscription
                 {
                     Text     = Convert.ToString(i),
                     Font     = drawFont_two,
                     Brush    = black,
                     Position = new Point(Convert.ToInt32(pixel_pro_meter * i) + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value) - 5, x2_long)
                 });
             }
             else if (i >= 100 && i < _mineConfig.MainViewConfig.MaxTokExcitation.Value)
             {
                 RuleInscriptions.Add(new RuleInscription
                 {
                     Text     = Convert.ToString(i),
                     Font     = drawFont_two,
                     Brush    = black,
                     Position = new Point(Convert.ToInt32(pixel_pro_meter * i) + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value) - 10, x2_long)
                 });
             }
             else if (i >= _mineConfig.MainViewConfig.MaxTokExcitation.Value)
             {
                 RuleInscriptions.Add(new RuleInscription
                 {
                     Text     = Convert.ToString(i),
                     Font     = drawFont_two,
                     Brush    = black,
                     Position = new Point(Convert.ToInt32(pixel_pro_meter * i) + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value) - 20, x2_long)
                 });
             }
             else if (i <= -10 && i > -_mineConfig.MainViewConfig.MaxTokExcitation.Value)
             {
                 RuleInscriptions.Add(new RuleInscription
                 {
                     Text     = Convert.ToString(i),
                     Font     = drawFont_two,
                     Brush    = black,
                     Position = new Point(Convert.ToInt32(pixel_pro_meter * i) + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value) - 10, x2_long)
                 });
             }
             else
             {
                 RuleInscriptions.Add(new RuleInscription
                 {
                     Text     = Convert.ToString(i),
                     Font     = drawFont_two,
                     Brush    = black,
                     Position = new Point(Convert.ToInt32(pixel_pro_meter * i) + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value), x2_long)
                 });
             }
         }
         else if (i % 10 == 0)
         {
             RuleDatas.Add(new RuleData
             {
                 Pen         = pen,
                 FirstPoint  = new Point((10 + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value) + Convert.ToInt32(pixel_pro_meter * i)), x1_middle),
                 SecondPoint = new Point((10 + Convert.ToInt32(pixel_pro_meter * _mineConfig.MainViewConfig.MaxTokExcitation.Value) + Convert.ToInt32(pixel_pro_meter * i)), x2_middle)
             });
         }
     }
     return(RuleDatas);
 }
Exemple #3
0
 public List <RuleData> GetDopRuleDatas()
 {
     if (_parameters.v <= _mineConfig.MainViewConfig.MaxDopRuleSpeed.Value)
     {
         RuleDatas.Add(new RuleData
         {
             Pen         = pen,
             FirstPoint  = new Point(panelWidth / 2, 0),
             SecondPoint = new Point(panelWidth / 2, panelHeight)
         });
         for (int i = Convert.ToInt32(Math.Round(_parameters.s, 2) * 100) - 500;
              i <= Convert.ToInt32(Math.Round(_parameters.s, 2) * 100) + 500;
              i++)
         {
             if (i % 100 == 0)
             {
                 RuleDatas.Add(new RuleData
                 {
                     Pen        = pen,
                     FirstPoint =
                         new Point(x1_long,
                                   (10 + Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                    Convert.ToInt32(pixel_pro_ten_santimeter *
                                                    (Math.Round(_parameters.s, 2) - 5)))),
                     SecondPoint =
                         new Point(x2_long,
                                   (10 + Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                    Convert.ToInt32(pixel_pro_ten_santimeter *
                                                    (Math.Round(_parameters.s, 2) - 5))))
                 });
                 if ((i / 100) >= 10 && (i / 100) < 100)
                 {
                     RuleInscriptions.Add(new RuleInscription
                     {
                         Text     = Convert.ToString((i / 100) * (-1)),
                         Font     = drawFont_two,
                         Brush    = black,
                         Position =
                             new Point(x1_long - 35,
                                       Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                       Convert.ToInt32(pixel_pro_ten_santimeter *
                                                       (Math.Round(_parameters.s, 2) - 5)) - 2)
                     });
                 }
                 else if ((i / 100) <= -10)
                 {
                     RuleInscriptions.Add(new RuleInscription
                     {
                         Text     = Convert.ToString((i / 100) * (-1)),
                         Font     = drawFont_two,
                         Brush    = black,
                         Position =
                             new Point(x1_long - 25,
                                       Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                       Convert.ToInt32(pixel_pro_ten_santimeter *
                                                       (Math.Round(_parameters.s, 2) - 5)) - 2)
                     });
                 }
                 else if ((i / 100) <= 0 && (i / 100) > -10)
                 {
                     RuleInscriptions.Add(new RuleInscription
                     {
                         Text     = Convert.ToString((i / 100) * (-1)),
                         Font     = drawFont_two,
                         Brush    = black,
                         Position =
                             new Point(x1_long - 20,
                                       Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                       Convert.ToInt32(pixel_pro_ten_santimeter *
                                                       (Math.Round(_parameters.s, 2) - 5)) - 2)
                     });
                 }
                 else if ((i / 100) > 0 && (i / 100) < 10)
                 {
                     RuleInscriptions.Add(new RuleInscription
                     {
                         Text     = Convert.ToString((i / 100) * (-1)),
                         Font     = drawFont_two,
                         Brush    = black,
                         Position =
                             new Point(x1_long - 25,
                                       Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                       Convert.ToInt32(pixel_pro_ten_santimeter *
                                                       (Math.Round(_parameters.s, 2) - 5)) - 2)
                     });
                 }
                 else if ((i / 100) >= 100 && (i / 100) < 1000)
                 {
                     RuleInscriptions.Add(new RuleInscription
                     {
                         Text     = Convert.ToString((i / 100) * (-1)),
                         Font     = drawFont_two,
                         Brush    = black,
                         Position =
                             new Point(x1_long - 50,
                                       Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                       Convert.ToInt32(pixel_pro_ten_santimeter *
                                                       (Math.Round(_parameters.s, 2) - 5)) - 2)
                     });
                 }
                 else if ((i / 100) >= 1000)
                 {
                     RuleInscriptions.Add(new RuleInscription
                     {
                         Text     = Convert.ToString((i / 100) * (-1)),
                         Font     = drawFont_two,
                         Brush    = black,
                         Position =
                             new Point(x1_long - 58,
                                       Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                       Convert.ToInt32(pixel_pro_ten_santimeter *
                                                       (Math.Round(_parameters.s, 2) - 5)) - 2)
                     });
                 }
             }
             else if (i % 50 == 0)
             {
                 RuleDatas.Add(new RuleData
                 {
                     Pen        = pen,
                     FirstPoint =
                         new Point(x1_middle,
                                   (10 + Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                    Convert.ToInt32(pixel_pro_ten_santimeter *
                                                    (Math.Round(_parameters.s, 2) - 5)))),
                     SecondPoint =
                         new Point(x2_middle,
                                   (10 + Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                    Convert.ToInt32(pixel_pro_ten_santimeter *
                                                    (Math.Round(_parameters.s, 2) - 5))))
                 });
             }
             else if (i % 10 == 0)
             {
                 RuleDatas.Add(new RuleData
                 {
                     Pen        = pen,
                     FirstPoint =
                         new Point(x1_small,
                                   (10 + Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                    Convert.ToInt32(pixel_pro_ten_santimeter *
                                                    (Math.Round(_parameters.s, 2) - 5)))),
                     SecondPoint =
                         new Point(x2_small,
                                   (10 + Convert.ToInt32(pixel_pro_ten_santimeter * i / 100) -
                                    Convert.ToInt32(pixel_pro_ten_santimeter *
                                                    (Math.Round(_parameters.s, 2) - 5))))
                 });
             }
         }
     }
     return(RuleDatas);
 }
Exemple #4
0
        public List <RuleData> GetSpeedRuleDatas()
        {
            double speedBound = _parameters.defence_diagram;

            RuleDatas.Add(new RuleData
            {
                Pen         = pen,
                FirstPoint  = new Point(0, panelHeight / 2),
                SecondPoint = new Point(panelWidth, panelHeight / 2)
            });
            for (int i = 0; i <= _mineConfig.MainViewConfig.MaxSpeed.Value * 10; i++)
            {
                if (i % 10 == 0)
                {
                    RuleDatas.Add(new RuleData
                    {
                        Pen         = (double)(i) / 10 >= speedBound ? red_pen : pen,
                        FirstPoint  = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x1_long),
                        SecondPoint = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x2_long)
                    });
                    if (i / 10 >= 10)
                    {
                        RuleInscriptions.Add(new RuleInscription
                        {
                            Text     = Convert.ToString(i / 10),
                            Font     = drawFont_two,
                            Brush    = black,
                            Position = new Point(Convert.ToInt32(pixel_pro_meter * i / 10) - 10, x2_long)
                        });
                    }
                    else
                    {
                        RuleInscriptions.Add(new RuleInscription
                        {
                            Text     = Convert.ToString(i / 10),
                            Font     = drawFont_two,
                            Brush    = black,
                            Position = new Point(Convert.ToInt32(pixel_pro_meter * i / 10), x2_long)
                        });
                    }
                }
                else if (i % 5 == 0)
                {
                    RuleDatas.Add(new RuleData
                    {
                        Pen         = (double)(i) / 10 >= speedBound ? red_pen : pen,
                        FirstPoint  = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x1_middle),
                        SecondPoint = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x2_middle)
                    });
                }
                else if (i % 1 == 0)
                {
                    RuleDatas.Add(new RuleData
                    {
                        Pen         = (double)(i) / 10 >= speedBound ? red_pen : pen,
                        FirstPoint  = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x1_small),
                        SecondPoint = new Point((10 + Convert.ToInt32(pixel_pro_meter * i / 10)), x2_small)
                    });
                }
            }
            return(RuleDatas);
        }
        public List <RuleData> GetRuleDatas()
        {
            //RabCyl1
            int x     = _x - 70;
            int y     = _y + _height + _height + _height / 2 + _barHight;
            int color = 150;
            int shag  = Convert.ToInt32(_barWidth / _maxPressure);
            Pen pen   = new Pen(Color.FromArgb(255, color, color, color), 3);

            color = 200;
            SolidBrush brush = new SolidBrush(Color.FromArgb(255, color, color, color));
            Font       font  = new Font("Microsoft Sans Serif", 14, FontStyle.Bold);
            int        h     = 0;

            for (int i = 0; i <= _maxPressure; i++)
            {
                if (i % 2 == 0)
                {
                    RuleDatas.Add(new RuleData
                    {
                        FirstPoint  = new Point(x + i * shag, y),
                        SecondPoint = new Point(x + i * shag, y + 10),
                        Pen         = pen
                    });
                    if (i < 10)
                    {
                        h = 8;
                    }
                    else
                    {
                        h = 14;
                    }
                    RuleInscriptions.Add(new RuleInscription
                    {
                        Text     = i.ToString(CultureInfo.GetCultureInfo("en-US")),
                        Brush    = brush,
                        Font     = font,
                        Position = new Point(x + i * shag - h, y + 11)
                    });
                }
            }
            //PredCyl1
            x    = _x - 70;
            y    = _y + _height + _height + _height / 2 + _barHight - (_barHight + 75);
            shag = Convert.ToInt32(_barWidth / _maxPressure);
            h    = 0;
            for (int i = 0; i <= _maxPressure; i++)
            {
                if (i % 2 == 0)
                {
                    RuleDatas.Add(new RuleData
                    {
                        FirstPoint  = new Point(x + i * shag, y),
                        SecondPoint = new Point(x + i * shag, y + 10),
                        Pen         = pen
                    });
                    if (i < 10)
                    {
                        h = 8;
                    }
                    else
                    {
                        h = 14;
                    }
                    RuleInscriptions.Add(new RuleInscription
                    {
                        Text     = i.ToString(CultureInfo.GetCultureInfo("en-US")),
                        Brush    = brush,
                        Font     = font,
                        Position = new Point(x + i * shag - h, y + 11)
                    });
                }
            }
            //RabCyl2
            x    = _x - 70 + _barWidth + 50;
            y    = _y + _height + _height + _height / 2 + _barHight;
            shag = Convert.ToInt32(_barWidth / _maxPressure);
            h    = 0;
            for (int i = 0; i <= _maxPressure; i++)
            {
                if (i % 2 == 0)
                {
                    RuleDatas.Add(new RuleData
                    {
                        FirstPoint  = new Point(x + i * shag, y),
                        SecondPoint = new Point(x + i * shag, y + 10),
                        Pen         = pen
                    });
                    if (i < 10)
                    {
                        h = 8;
                    }
                    else
                    {
                        h = 14;
                    }
                    RuleInscriptions.Add(new RuleInscription
                    {
                        Text     = i.ToString(CultureInfo.GetCultureInfo("en-US")),
                        Brush    = brush,
                        Font     = font,
                        Position = new Point(x + i * shag - h, y + 11)
                    });
                }
            }
            //PredCyl2
            x    = _x - 70 + _barWidth + 50;
            y    = _y + _height + _height + _height / 2 + _barHight - (_barHight + 75);
            shag = Convert.ToInt32(_barWidth / _maxPressure);
            h    = 0;
            for (int i = 0; i <= _maxPressure; i++)
            {
                if (i % 2 == 0)
                {
                    RuleDatas.Add(new RuleData
                    {
                        FirstPoint  = new Point(x + i * shag, y),
                        SecondPoint = new Point(x + i * shag, y + 10),
                        Pen         = pen
                    });
                    if (i < 10)
                    {
                        h = 8;
                    }
                    else
                    {
                        h = 14;
                    }
                    RuleInscriptions.Add(new RuleInscription
                    {
                        Text     = i.ToString(CultureInfo.GetCultureInfo("en-US")),
                        Brush    = brush,
                        Font     = font,
                        Position = new Point(x + i * shag - h, y + 11)
                    });
                }
            }
            return(RuleDatas);
        }