예제 #1
0
 //Private methods
 private void btnShowLearningComparison_Click(object sender, RoutedEventArgs e)
 {
     if (previous != null)
     {
         LearningComparisonEvent?.Invoke(current.SessionId, previous.SessionId);
     }
 }
예제 #2
0
        public void IRLVCore_SelectedCaseDetailResultsHandler(IEnumerable <RlmLearnedCaseDetails> data, bool showComparison = false)
        {
            learnedCaseDetails = data.ToList();

            var inputs  = learnedCaseDetails.Where(a => a.IsCurrent).SelectMany(a => a.Inputs);
            var outputs = learnedCaseDetails.Where(a => a.IsCurrent).SelectMany(a => a.Outputs);

            current  = data.First(a => a.IsCurrent);
            previous = data.FirstOrDefault(a => !a.IsCurrent);

            if (previous != null)
            {
                ((RLVSelectedDetailVM)ViewModel).PreviousSessionId = previous.SessionId;
                ((RLVSelectedDetailVM)ViewModel).PreviousSession   = previous.SessionNum;
                ((RLVSelectedDetailVM)ViewModel).PreviousTime      = previous.SessionTime;
                ((RLVSelectedDetailVM)ViewModel).PreviousCase      = previous.CycleNum;
                ((RLVSelectedDetailVM)ViewModel).PreviousScore     = previous.SessionScore;
            }
            else
            {
                ((RLVSelectedDetailVM)ViewModel).PreviousSession = null;
                ((RLVSelectedDetailVM)ViewModel).PreviousTime    = null;
                ((RLVSelectedDetailVM)ViewModel).PreviousCase    = null;
                ((RLVSelectedDetailVM)ViewModel).PreviousScore   = null;
            }

            ((RLVSelectedDetailVM)ViewModel).CurrentSessionId = current.SessionId;
            ((RLVSelectedDetailVM)ViewModel).CurrentSession   = current.SessionNum;
            ((RLVSelectedDetailVM)ViewModel).CurrentTime      = current.SessionTime;
            ((RLVSelectedDetailVM)ViewModel).CurrentCase      = current.CycleNum;
            ((RLVSelectedDetailVM)ViewModel).CurrentScore     = current.SessionScore;

            //Make input details an observable collection for binding to its grid
            ObservableCollection <RLVIODetailsVM> inputCollection = new ObservableCollection <RLVIODetailsVM>();

            foreach (var a in inputs)
            {
                RLVIODetailsVM inputVm = new RLVIODetailsVM
                {
                    Name  = a.Name,
                    Value = a.Value
                };

                inputCollection.Add(inputVm);
            }

            //Make output details an observable collection for binding to its grid
            ObservableCollection <RLVIODetailsVM> outputCollection = new ObservableCollection <RLVIODetailsVM>();

            foreach (var a in outputs)
            {
                RLVIODetailsVM outputVm = new RLVIODetailsVM
                {
                    Name  = a.Name,
                    Value = a.Value
                };

                outputCollection.Add(outputVm);
            }

            ((RLVSelectedDetailVM)ViewModel).InputDetails  = inputCollection;
            ((RLVSelectedDetailVM)ViewModel).OutputDetails = outputCollection;

            if (showComparison)
            {
                if (previous != null)
                {
                    LearningComparisonEvent?.Invoke(current.SessionId, previous.SessionId);
                }
            }
        }
 public void IRLVSelectedDetailsShowLearningComparison(long currentSessionId, long previousSessionId)
 {
     LearningComparisonEvent?.Invoke(currentSessionId, previousSessionId);
 }