Exemplo n.º 1
0
        private void CreateRWRRenderer(byte[] rwrInfoArray, bool formatForVectorDisplay = false)
        {
            var rwrType = GetRWRType(rwrInfoArray);

            if (_rwrRenderer == null || rwrType != _lastRwrType)
            {
                if ((rwrType == "0" || rwrType == "1"))
                {
                    _rwrRenderer = _rwrRendererFactory.CreateRenderer(RWRType.ALR56, formatForVectorDisplay);
                }
                else if (rwrType == "2")
                {
                    _rwrRenderer = _rwrRendererFactory.CreateRenderer(RWRType.ALR69, formatForVectorDisplay);
                }
                else if (rwrType == "3")
                {
                    _rwrRenderer = _rwrRendererFactory.CreateRenderer(RWRType.ALR93, formatForVectorDisplay);
                }
                else if (rwrType == "4")
                {
                    _rwrRenderer = _rwrRendererFactory.CreateRenderer(RWRType.SPS1000, formatForVectorDisplay);
                }
                else if (rwrType == "5")
                {
                    _rwrRenderer = _rwrRendererFactory.CreateRenderer(RWRType.ALR67, formatForVectorDisplay);
                }
                else if (rwrType == "6")
                {
                    _rwrRenderer = _rwrRendererFactory.CreateRenderer(RWRType.CARAPACE, formatForVectorDisplay);
                }
                else
                {
                    _rwrRenderer = null;
                }
                _lastRwrType = rwrType;
            }
            if (_rwrRenderer != null && ActualWidth != 0 && ActualHeight != 0)
            {
                (_rwrRenderer as RWRRenderer).ActualWidth  = ActualWidth;
                (_rwrRenderer as RWRRenderer).ActualHeight = ActualHeight;
            }
        }