Example #1
0
        private void updateRadarAreaShow(PlottingArea radarArea)
        {
            if ((IsMask && radarArea.RadarArea.IsMask) || (ManualExtract && radarArea.RadarArea.ManualIdenfity) || (SimuVoyage && radarArea.RadarArea.PassThrough))
            {
                radarArea.OnRefreshed();
                RadarAreaMaskColor colorMuxer = new RadarAreaMaskColor()
                {
                    Opacity     = 0,
                    FillColor   = (Color)ColorConverter.ConvertFromString("#00000000"),
                    StrokeColor = (Color)ColorConverter.ConvertFromString("#00000000"),
                };

                if (IsMask && radarArea.RadarArea.IsMask)
                {
                    updateMuxerColor(ref colorMuxer, _radarAreaColors[0]);
                }
                if (ManualExtract && radarArea.RadarArea.ManualIdenfity)
                {
                    updateMuxerColor(ref colorMuxer, _radarAreaColors[1]);
                }
                if (SimuVoyage && radarArea.RadarArea.PassThrough)
                {
                    updateMuxerColor(ref colorMuxer, _radarAreaColors[2]);
                }
                radarArea.PolygonOpacity = colorMuxer.Opacity;
                radarArea.FillColor      = colorMuxer.FillColor;
                radarArea.StrokeColor    = colorMuxer.StrokeColor;
            }
            else
            {
                radarArea.Visibility = System.Windows.Visibility.Hidden;
            }
        }
Example #2
0
 private void initMatchColorInfomation()
 {
     _radarAreaColors[0] = new RadarAreaMaskColor()
     {
         Heading = "屏蔽区"
     };
     _radarAreaColors[1] = new RadarAreaMaskColor()
     {
         Heading     = "非自动录取区",
         FillColor   = (Color)ColorConverter.ConvertFromString("#FF009F00"),
         StrokeColor = (Color)ColorConverter.ConvertFromString("#FF00009F")
     };
     _radarAreaColors[2] = new RadarAreaMaskColor()
     {
         Heading     = "模拟航行区",
         FillColor   = (Color)ColorConverter.ConvertFromString("#FF0000FF"),
         StrokeColor = (Color)ColorConverter.ConvertFromString("#FFFF0000")
     };
 }
Example #3
0
        private void resetMatchColorInfomation()
        {
            _isResetRadarAreasInfo = true;
            try
            {
                initMatchColorInfomation();
                var config = ConfigFile <ConfigRadarAreaColor[]> .FromFile(_configPath);

                if (config == null)
                {
                    saveMatchColorInfomation();
                }
                else
                {
                    for (int i = 0; i < config.Length; i++)
                    {
                        for (int j = 0; j < _radarAreaColors.Length; j++)
                        {
                            if (config[i].Heading == _radarAreaColors[j].Heading)
                            {
                                _radarAreaColors[j] = new RadarAreaMaskColor(config[i]);
                                break;
                            }
                        }
                    }
                    if (_radarAreaColors.Length >= 2)
                    {
                        IsMask        = _radarAreaColors[0].IsVisible;
                        ManualExtract = _radarAreaColors[1].IsVisible;
                        SimuVoyage    = _radarAreaColors[2].IsVisible;
                    }
                }
            }
            catch (Exception ex)
            {
                string stringShow = "在读取雷达特殊区域时,出错,文件地址:" + _configPath + Environment.NewLine;
                LogService.WarnFormat(stringShow + ex.ToString());
                System.Windows.MessageBox.Show(stringShow + ex.Message);
            }
            _isResetRadarAreasInfo = false;
        }
Example #4
0
 private void updateMuxerColor(ref RadarAreaMaskColor muxer, RadarAreaMaskColor resourse)
 {
     muxer.Opacity     = Math.Max(muxer.Opacity, resourse.Opacity);
     muxer.FillColor   = Color.Add(muxer.FillColor, resourse.FillColor);
     muxer.StrokeColor = Color.Add(muxer.StrokeColor, resourse.StrokeColor);
 }