Beispiel #1
0
 protected virtual void OnErrorFound(Error error)
 {
     if (!_ErrorList.Contains(error))
     {
         _ErrorList.Add(error);
         if (ErrorFound != null)
         {
             ErrorFound(this, error);
         }
         var errorControl = ErrorControl;
         if (errorControl != null)
         {
             errorControl.SetErrors(Errors);
         }
     }
 }
Beispiel #2
0
        public override async Task ReloadAsync()
        {
            using (new FlagInverseAction(true, v => IsLoading = v))
            {
                var hasOldState = Error != null;
                var oldAngle    = Error?.Angle;
                var oldVSet     = Error?.SelectedSet?.Value?.Set;

                foreach (var useTestAngle in new bool[] { false, true })
                {
                    var baseMeasures  = _calibrator.Results.ToList();
                    var calibratorApp = new CalibratorApplication(baseMeasures, _calibrator.Constants);
                    var points        = await calibratorApp.CalculateErrorsAsync(useTestAngle);

                    var errors = new ErrorsCollection();
                    var tasks  = points.Length.Range()
                                 .Select(i => TemperatureCalibrationErrorVM.CreateAsync(points[i]))
                                 .ToArray();
                    for (int i = 0; i < points.Length; i++)
                    {
                        errors.Add(await tasks[i]);
                        errors[i].PropertyChanged += TemperatureCalibrationErrorsVM_PropertyChanged1;
                    }

                    _errors[useTestAngle] = errors;
                }

                Update();

                if (hasOldState)
                {
                    Error             = _errors[UseTestPoint].First(e => e.Angle == oldAngle);
                    Error.SelectedSet = Error.VectorsSets.First(s => s.Value.Set == oldVSet);
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// Swallows the exception, and add corresponding error to the errors collection
 /// </summary>
 /// <param name="e">The AnalizeException for adding to the compile errors </param>
 public void SwallowException(AnalizeException e)
 {
     errors.Add(new Error(e));
 }
 public void Show(string newMessage)
 {
     _errors.Add(this);
     Message = newMessage;
 }