Ejemplo n.º 1
0
 protected internal DryTask([NotNull] ILaundryMachineTaskExecutionContext <TaskResult> executionContext,
                            [NotNull] LaundryStatusFlagVault statusFlagsVault, [NotNull] IEventRaiser eventRaiser,
                            TimeSpan?timeDecrementOneDampUnit = null) :
     base(executionContext, statusFlagsVault, eventRaiser, TaskType.DryTask, CommandIds.Dry)
 {
     timeDecrementOneDampUnit ??= TimeSpan.FromMilliseconds(150);
     if (timeDecrementOneDampUnit.Value <= TimeSpan.Zero)
     {
         throw new ArgumentOutOfRangeException(nameof(timeDecrementOneDampUnit), timeDecrementOneDampUnit.Value,
                                               @"Value must be positive.");
     }
     TimeToDecrementDampnessPerUnit = timeDecrementOneDampUnit.Value;
 }
Ejemplo n.º 2
0
        protected internal WashTask([NotNull] ILaundryMachineTaskExecutionContext <TaskResult> executionContext,
                                    [NotNull] LaundryStatusFlagVault statusFlagsVault, [NotNull] IEventRaiser eventRaiser, TimeSpan?timeIncreaseDampnessPerUnit = null, TimeSpan?timeRemoveOneUnitSoil = null) :
            base(executionContext, statusFlagsVault, eventRaiser, TaskType.WashTask, CommandIds.Wash)
        {
            timeIncreaseDampnessPerUnit ??= TimeSpan.FromMilliseconds(50);
            timeRemoveOneUnitSoil ??= TimeSpan.FromMilliseconds(100);

            if (timeIncreaseDampnessPerUnit <= TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(timeIncreaseDampnessPerUnit), timeIncreaseDampnessPerUnit,
                                                      @"Value must be positive.");
            }
            if (timeRemoveOneUnitSoil <= TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(timeRemoveOneUnitSoil), timeRemoveOneUnitSoil,
                                                      @"Value must be positive.");
            }
            TimeToIncrementDampnessPerUnit = timeIncreaseDampnessPerUnit.Value;
            TimeToRemoveOneUnitOfSoil      = timeRemoveOneUnitSoil.Value;
        }