public FileMenuViewObject()
 {
     _abcModelList              = ABCTestDetailsModel.GetInstance;
     _mushraModelList           = MushraTestDetailsModel.GetInstance;
     _scorerDetails             = ScorerDetails.GetInstance;
     ABCTestView.TestModeOnOff += ABCTest_TestModeOnOff;
 }
Example #2
0
        private void MUSHRASessionWindow_DisplaySession(object sender, MushraTestDetailsModel e)
        {
            SessGrid.ItemsSource = null;
            SessGrid.Items.Clear();


            var trialList = new List <TrialList>();
            var titleText = string.Format("SLEP - MUSHRA Session ({0})", e.SessionFileName);

            this.Title = titleText;

            _mushraModelList.trials.All(trials =>
            {
                var trial = new TrialList();

                trial.TrialNumber = trials.TrialNumber;
                trial.TrialName   = trials.TrialName;

                SessGrid.Items.Add(trial);
                SessGrid.Width            = 1200;
                SessGrid.Columns[0].Width = 500;
                SessGrid.Columns[1].Width = 690;


                return(true);
            });
        }
Example #3
0
        private void MUSHRASessionWindow_SessionCreated(object sender, MushraTestDetailsModel e)
        {
            _mushraTestDetailsModel = e;
            ClearState();

            _mushraSessionEnumerator = _mushraTestDetailsModel.trials.ToList();

            _sessCreatedFlag = ConstructMushraComponents();

            ConfigureTimer();

            if (_isCanvasCleared)
            {
                WaveFormDisplay.ConstructWaveFormControl();
                _isCanvasCleared = false;
            }

            if (_sessCreatedFlag)
            {
                MushraTestModeOnOff?.Invoke(this, false);
                PlayEnabled(true);
                _settingsObject.SessionCreatedFlag = true;
                Log.Write(LogLevel.Info, "The MUSHRA Session has been loaded Sucessfully!!!");
            }
            else
            {
                using (var obj = new FileMenuViewObject())
                {
                    MessageBox.Show("Audio Hardware not Connected/Installed", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    obj.CloseSession();
                }
            }
        }
Example #4
0
 private void OnMushraSessionCreated(object sender, MushraTestDetailsModel e)
 {
     //_resetFlag = false;
     LoadScaleSection();
     PopulateScaleParameters();
     _clickedButton    = 0;
     RefBtn.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1AB3D6"));
 }
Example #5
0
        private void MUSHRASessionWindow_SessionClosed(object sender, MushraTestDetailsModel e)
        {
            var titleText = "SLEP";

            Title = titleText;
            _mushraAuditionModeFlag = -1;
            SessGrid.ItemsSource    = null;
            SessGrid.Items.Clear();
        }
Example #6
0
 private void MUSHRASessionWindow_SessionClosed(object sender, MushraTestDetailsModel e)
 {
     if (_isPlaying)
     {
         _audioObject.FadeOut(_doAudioOperations[_current], 20);
         Thread.Sleep(500);
     }
     ClearState();
 }
Example #7
0
        private void OnMushraSessionClosed(object sender, MushraTestDetailsModel e)
        {
            _sliders.ForEach(slider => slider.IsEnabled = false);

            for (var count = 1; count <= MAXSTIMULUS; count++)
            {
                var button = (Button)_buttonNames[count];
                button.IsEnabled = false;
            }
            RefBtn.IsEnabled = false;
            ResetButtons();
            ResetScales();
        }
        public MUSHRASessionWindow(string fileName = "")
        {
            InitializeComponent();

            _mushraSessionList = new List <MushraSessionModel>();
            _mushraModelList   = MushraTestDetailsModel.GetInstance;

            _sessionLogger = LogFactory.GetLoggerObject((byte)LoggerType.SessionLogger);

            _fileName            = fileName;
            _sessionAlreadySaved = false;
            InitializeEditOrOpenSession();
            ReadCustomScaleElements();
            _mushraModelList.trials.Clear();
        }
Example #9
0
        public MushraTestScoreView()
        {
            InitializeComponent();
            try
            {
                _buttonNames.Add(1, ABtn);
                _buttonNames.Add(2, BBtn);
                _buttonNames.Add(3, CBtn);
                _buttonNames.Add(4, DBtn);
                _buttonNames.Add(5, EBtn);
                _buttonNames.Add(6, FBtn);
                _buttonNames.Add(7, GBtn);
                _buttonNames.Add(8, HBtn);
                _buttonNames.Add(9, IBtn);
                _buttonNames.Add(10, JBtn);
                _buttonNames.Add(11, KBtn);
                _buttonNames.Add(12, LBtn);

                _sliders.Add(sliderA);
                _sliders.Add(sliderB);
                _sliders.Add(sliderC);
                _sliders.Add(sliderD);
                _sliders.Add(sliderE);
                _sliders.Add(sliderF);
                _sliders.Add(sliderG);
                _sliders.Add(sliderH);
                _sliders.Add(sliderI);
                _sliders.Add(sliderJ);
                _sliders.Add(sliderK);
                _sliders.Add(sliderL);

                _mushraModelList       = MushraTestDetailsModel.GetInstance;
                _mushraModelList.Score = new List <double>();
                LoadScaleSection();
                PopulateScaleParameters();
                MUSHRASessionWindow.SessionCreated += OnMushraSessionCreated;
                MushraTestTransportControlsView.MushraNextTrial += OnMushraNextTrial;
                MUSHRASessionWindow.SessionClosed                   += OnMushraSessionClosed;
                MushraTestTransportControlsView.AddScore            += MushraTestTransportControlsView_AddScore;
                MushraTestTransportControlsView.MushraTestModeOnOff += MushraTestModeOnOff;
                SliderChanged += MushraTestScoreView_SliderChanged;
            }
            catch (Exception) { }
        }
Example #10
0
        public ShellWindow()
        {
            InitializeComponent();
            _abcModelList        = ABCTestDetailsModel.GetInstance;
            _abcModelList.trials = new List <ABCSessionModel>();

            _mushraModelList        = MushraTestDetailsModel.GetInstance;
            _mushraModelList.trials = new List <MushraSessionModel>();

            ABCSessionWindow.DisplaySession += ABCSessionWindow_DisplaySession;
            ABCSessionWindow.SessionClosed  += ABCSessionWindow_SessionClosed;

            MUSHRASessionWindow.DisplaySession += MUSHRASessionWindow_DisplaySession;
            MUSHRASessionWindow.SessionClosed  += MUSHRASessionWindow_SessionClosed;

            ABCTestView.TestModeOnOff += ABCTestModeOnOff;
            MushraTestTransportControlsView.MushraTestModeOnOff += MushraTestModeOnOff;

            ABCTestView.AddScore += ABCAddScore;
            //MushraTestTransportControlsView.AddScore += MushraAddScore;
            _dataGridWidth = SessGrid.Width;
        }
 public static void InvokeSessionClosed(object sender, MushraTestDetailsModel e)
 {
     SessionClosed?.Invoke(sender, e);
     _sessionCreatedFlag = false;
 }
 public static void InvokeEvents(object sender, MushraTestDetailsModel e)
 {
     DisplaySession?.Invoke(sender, e);
     SessionCreated?.Invoke(sender, e);
     _sessionCreatedFlag = true;
 }