Beispiel #1
0
        public CursorLinePack AddPairCursors(CursorLinePackConfig config)
        {
            var pack = new CursorLinePack(config);

            pack.AddToChart(ContainerChart);

            _packs.Add(pack);

            return(pack);
        }
Beispiel #2
0
 public CursorLinePack(CursorLinePackConfig config)
 {
     Config = config;
 }
Beispiel #3
0
        public void ReInitialize(int samplingRate = WaveformDefinitions.SAMPLES_COUNT)
        {
            _empty = new double[samplingRate];

            _samplingRate = samplingRate;
            _waveform     = new WaveformMonitor(Colors.DarkOrange);
            _waveform.Initialize(samplingRate, string.Empty);
            _waveform.SetRange(-120, 0);

            var color0  = Colors.OrangeRed;
            var config0 = new CursorLinePackConfig
            {
                LineWidth = 1.0f,
                BandColor = new Color
                {
                    A = 20,
                    R = color0.R,
                    G = color0.G,
                    B = color0.B,
                },
                Color            = color0,
                BandwidthMaximum = TransformToChartSamples(7500),
                BandwidthMinimum = TransformToChartSamples(-7500),
                ValueMaximum     = TransformToChartSamples(12000),
                ValueMinimum     = TransformToChartSamples(-12000),
            };

            _bandwidth = _waveform.AddPairCursors(config0);
            _bandwidth.ValueChanged += OnBandwidthChanged;
            _bandwidth.SetValue(TransformToChartSamples(-7500), TransformToChartSamples(7500));

            var color1  = Colors.White;
            var config1 = new CursorLinePackConfig
            {
                LineWidth = 1.0f,
                BandColor = new Color
                {
                    A = 128,
                    R = color1.R,
                    G = color1.G,
                    B = color1.B,
                },
                Color            = color1,
                BandwidthMaximum = TransformToChartSamples(1500),
                BandwidthMinimum = TransformToChartSamples(-1500),
                ValueMaximum     = TransformToChartSamples(12000),
                ValueMinimum     = TransformToChartSamples(-12000),
            };

            _notch = _waveform.AddPairCursors(config1);
            _notch.ValueChanged += OnNotchChanged;
            _notch.SetValue(TransformToChartSamples(-1500), TransformToChartSamples(1500));

            _waveform.AddHorizontalConstantLine(-100, Colors.Orange);
            //_waveform.AddHorizontalConstantLine(1000, Colors.YellowGreen);
            _waveform.AddVerticalConstantLine(0, Colors.Orange);
            _waveform.AddVerticalConstantLine(TransformToChartSamples(5000), Colors.YellowGreen);
            _waveform.AddVerticalConstantLine(TransformToChartSamples(-5000), Colors.YellowGreen);
            _waveform.AddVerticalConstantLine(TransformToChartSamples(10000), Colors.OrangeRed);
            _waveform.AddVerticalConstantLine(TransformToChartSamples(-10000), Colors.OrangeRed);

            GridWaveformMonitor.Children.Add(_waveform.ContainerChart);
        }