Ejemplo n.º 1
0
        public void PrepareProcessing()
        {
            _buffer = new TimeLocatedBufferFFT(
                1, //DefaultParameters.DefaultBufferMilliseconds.ToFrames(ParentMetric.Samplerate, ParentMetric.FFTSize / 2),
                ParentMetric.FFTSize,
                ParentMetric.Samplerate
                );

            _line = new DataLine1D("", ParentMetric.FFTSize / 2, ParentMetric.Samplerate);
            _set.Data.Clear();
            _set.Data.Add(_line);

            _set.SamplesPerSecond = ParentMetric.Samplerate /* * 2*/;
            _set.Milliseconds     = new NodeSystemLib2.TimeStamp((long)(ParentMetric.FFTSize), ParentMetric.Samplerate /* * 2*/).AsSeconds() * 1000;

            _set.AxisX.VisibleMinimum = 0;
            _set.AxisX.VisibleMaximum = ParentMetric.FFTSize;
            _set.AxisY.VisibleMinimum = -0.1;
            _set.AxisY.VisibleMaximum = 1.5;

            _set.AxisX.LabelProvider = x => {
                return($"{(Math.Round(x * (ParentMetric.Samplerate / (double)ParentMetric.FFTSize /*/ 2*/), 1)).ToString(System.Globalization.CultureInfo.InvariantCulture)} Hz");
            };

            _set.Update();
            _plotCtrl.CreateLegend();
        }
Ejemplo n.º 2
0
        private void InitRenderers()
        {
            _set.Data.Clear();
            _renderers.Clear();
            foreach (var port in Channels.Keys)
            {
                if (port is InputPortData1D)
                {
                    AddRenderer((InputPortData1D)port, ((MetricDisplay2.DataChannel)Channels[port]).DisplayBuffer.Capacity);
                }
                else if (port is InputPortValueDouble)
                {
                    AddRenderer((InputPortValueDouble)port, ParentMetric.Milliseconds);
                }
            }
            _set.Update();
            _plotCtrl.CreateLegend();

            if (DEBUG_VISIBLE)
            {
                CreateInfoPanel();
            }
        }