Esempio n. 1
0
        public MainViewModel(DeviceManager devices)
        {
            _devices = devices;
            _timer = new TimerManager();
            _timer.UpdateValues += ChangeValue;

            _analyzer = new PeakDetector();

            _filter = new LowHighPassFilter();

            this.AnalizeEvent += ECGAnalyzer.RRAnalayze.RRAnalayzer.Analize;
            _devices.AddHandler(NewSpectrumData);
        }
Esempio n. 2
0
        public MainWindow()
        {

            InitializeComponent();



            //string bigRes = string.Empty;
            //string allRes = string.Empty;
            //int b = ECGAnalyzer.RRAnalayze.ResultDict.Dict.Count;
            //int count = 0;
            //List<ECGAnalyzer.RRAnalayze.TrainPeriod> tr = ECGAnalyzer.RRAnalayze.TrainPeriod.ParseRange(@"D:\OneDrive\Study\beatcare\BeatCare\test_neuro.txt");
            //string n = ECGAnalyzer.RRAnalayze.RRAnalayzer.Result;
            //foreach(ECGAnalyzer.RRAnalayze.TrainPeriod t in tr)
            //{
            //    PointsAndPeaks p = new PointsAndPeaks();
            //    p.Points = t.Data.ToList();
            //    AnalizeEventArgs args = new AnalizeEventArgs(p);

            //    string res = string.Empty;
            //    while (res == string.Empty)
            //    {
            //        res = ECGAnalyzer.RRAnalayze.RRAnalayzer.Analize(new object(), args);
            //    }
            //    if (res == t.Name)
            //    {
            //        bigRes += res + '\n';
            //        count++;
            //    }
            //    allRes += res + '\n';
            //}
            //int a = 0;
            
            DataBase.DataBaseWindow dbWindow = new DataBase.DataBaseWindow();
            dbWindow.Show();
            _devices = new DeviceManager();
            _viewModel = new MainViewModel(_devices);
            
            _devices.Start();

            base.DataContext = _viewModel;      

            Application.Current.MainWindow.Closing += new CancelEventHandler(MainWindow_Closing);
        }