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);
 }
Exemple #2
0
        public void InitVm(Parameters parameters)
        {
            RuleDatas.Clear();
            RuleInscriptions.Clear();
            RulePointerLine.Clear();
            RulePointer.Clear();
            RuleFillPointer.Clear();
            SpeedMeaningZone.Clear();

            _parameters = parameters;
            SetLength();
            SetPointsValue();
        }
Exemple #3
0
        public void InitVm(Parameters parameters)
        {
            RuleDatas.Clear();
            RuleInscriptions.Clear();
            RulePointerLine.Clear();
            RulePointer.Clear();
            RuleFillPointer.Clear();
            PanelBorderLine.Clear();
            LevelsInscriptions.Clear();

            _parameters = parameters;
            SetLength();
            SetPointsValue();
        }
        public void InitVm(Parameters parameters)
        {
            BarsBackground.Clear();
            BarsContur.Clear();
            BarsContent.Clear();
            BarsValue.Clear();
            RuleDatas.Clear();
            RuleInscriptions.Clear();
            BarsName.Clear();
            BarsFrame.Clear();
            BindingLine.Clear();

            _parameters        = parameters;
            _greenZoneRabCyl1  = _mineConfig.BrakeSystemConfig.GreenZoneRabCyl1.Value;
            _greenZoneRabCyl2  = _mineConfig.BrakeSystemConfig.GreenZoneRabCyl2.Value;
            _greenZonePredCyl1 = _mineConfig.BrakeSystemConfig.GreenZonePredCyl1.Value;
            _greenZonePredCyl2 = _mineConfig.BrakeSystemConfig.GreenZonePredCyl2.Value;
            _rabCyl1Pressure   = (_parameters.BrakeRabCyl1Pressure - _mineConfig.BrakeSystemConfig.AdcZero.Value) * _mineConfig.BrakeSystemConfig.AdcValueToBarrKoef.Value;
            _rabCyl2Pressure   = (_parameters.BrakeRabCyl2Pressure - _mineConfig.BrakeSystemConfig.AdcZero.Value) * _mineConfig.BrakeSystemConfig.AdcValueToBarrKoef.Value;
            _predCyl1Pressure  = (_parameters.BrakePredCyl1Pressure - _mineConfig.BrakeSystemConfig.AdcZero.Value) * _mineConfig.BrakeSystemConfig.AdcValueToBarrKoef.Value;
            _predCyl2Pressure  = (_parameters.BrakePredCyl2Pressure - _mineConfig.BrakeSystemConfig.AdcZero.Value) * _mineConfig.BrakeSystemConfig.AdcValueToBarrKoef.Value;
        }
 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 #6
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 #7
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);
        }