Esempio n. 1
0
        private void BindCharts()
        {
            BindSeries();

            FirstSignalChartValues.Clear();
            SecondSignalChartValues.Clear();
            FinalSignalChartValues.Clear();


            foreach (var item in FirstSignal)
            {
                FirstSignalChartValues.Add(new ObservablePoint(item.Key, item.Value));
            }

            foreach (var item in SecondSignal)
            {
                SecondSignalChartValues.Add(new ObservablePoint(item.Key, item.Value));
            }

            OuputString = "";

            foreach (var item in FinalSignal)
            {
                FinalSignalChartValues.Add(new ObservablePoint(item.Key, item.Value));
                OuputString += $"{item.Key};{item.Value:f1} ";
            }
        }
        public void Proceed()
        {
            Reset();

            if (FirstSignal.Count > 0 && IsAllChecked())
            {
                switch (CurrentMethod)
                {
                case EMeths.Scale:
                    FinalSignal = Operations.Scale(FirstSignal, Factor);
                    break;

                case EMeths.AddTwoSignals:
                    FinalSignal = Operations.AddTwoSignals(FirstSignal, SecondSignal);
                    break;

                case EMeths.ExpandInTime:
                    FinalSignal = Operations.ExpandInTime(FirstSignal, Factor, !isSqueeze);
                    break;

                case EMeths.MultiplyTwoSignals:
                    FinalSignal = Operations.Multiply(FirstSignal, SecondSignal);
                    break;

                case EMeths.Reverse:
                    FinalSignal = Operations.Reverse(FirstSignal);
                    break;

                case EMeths.ShiftByTime:
                    FinalSignal = Operations.ShiftByTime(FirstSignal, Factor * -1);
                    break;

                default:
                    break;
                }
            }

            foreach (var item in FirstSignal)
            {
                FirstSignalChartValues.Add(new ObservablePoint(item.Key, item.Value));
            }

            if (SecondSignalBlock.Visibility == Visibility.Visible)
            {
                foreach (var item in SecondSignal)
                {
                    SecondSignalChartValues.Add(new ObservablePoint(item.Key, item.Value));
                }
            }

            OuputString = "";
            foreach (var item in FinalSignal)
            {
                FinalSignalChartValues.Add(new ObservablePoint(item.Key, item.Value));
                OuputString += $"{item.Key};{item.Value:f1} ";
            }

            OutputSignal.Text = OuputString;
        }