Chronos Plugins 5.4.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
MockPlugin.Tasks.CoffeeMachineBaseTask Class Referenceabstract

Base class for our example, just contains some empty default implementations and a check for the right device type. More...

+ Inheritance diagram for MockPlugin.Tasks.CoffeeMachineBaseTask:
+ Collaboration diagram for MockPlugin.Tasks.CoffeeMachineBaseTask:

Public Member Functions

void SetDevice (IDevice yourDevice)
 
virtual void PreValidate ()
 Called before the schedule construction is completed.
 
virtual void PostValidate ()
 Called after the schedule construction is completed.
 
abstract void Execute ()
 Do whatever you have to do with your parameters.
 
abstract string GetTaskAction ()
 Description of the tasks's action (for hints/time table)
 
void PreValidate ()
 Called before the schedule construction is completed.
 
void PostValidate ()
 Called after the schedule construction is completed.
 
void Execute ()
 Do whatever you have to do with your parameters.
 
string GetTaskAction ()
 Description of the tasks's action (for hints/time table)
 

Protected Member Functions

void CheckForCoffeeMachine (IDevice yourDevice)
 It makes no sense to use any other "Autosampler" than our fake coffee machine here.
 

Protected Attributes

MockDevice mDevice
 

Properties

IConsumableManipulator Consumables [get, set]
 You will get an instance of a helper class that helps your task to find the correct consumable puddle.
 
- Properties inherited from AxelSemrau.Chronos.Plugin.Consumables.IConsumer
IConsumableManipulator Consumables [set]
 You will get an instance of a helper class that helps your task to find the correct consumable puddle.
 

Detailed Description

Base class for our example, just contains some empty default implementations and a check for the right device type.

Definition at line 26 of file MockUseDeviceTasks.cs.

Member Function Documentation

◆ CheckForCoffeeMachine()

void MockPlugin.Tasks.CoffeeMachineBaseTask.CheckForCoffeeMachine ( IDevice  yourDevice)
protected

It makes no sense to use any other "Autosampler" than our fake coffee machine here.

Parameters
yourDevice

Definition at line 34 of file MockUseDeviceTasks.cs.

35 {
36 mDevice = yourDevice as MockDevice;
37 if (mDevice == null && yourDevice != null)
38 {
39 throw new ArgumentException(
40 $"Device type {yourDevice.DisplayedTypeName} is not usable for a {GetType().Name}.");
41 }
42 if (yourDevice == null)
43 {
44 throw new ArgumentException("This kind of task needs an autosampler.");
45 }
46 }
A chronos plugin implementation for a fake device. We pretend we are controlling a mixture of coffee ...
Definition: MockDevice.cs:53

References MockPlugin.Tasks.CoffeeMachineBaseTask.mDevice.

Referenced by MockPlugin.Tasks.CoffeeMachineBaseTask.SetDevice().

◆ Execute()

abstract void MockPlugin.Tasks.CoffeeMachineBaseTask.Execute ( )
pure virtual

◆ GetTaskAction()

abstract string MockPlugin.Tasks.CoffeeMachineBaseTask.GetTaskAction ( )
pure virtual

◆ PostValidate()

virtual void MockPlugin.Tasks.CoffeeMachineBaseTask.PostValidate ( )
virtual

Called after the schedule construction is completed.

Implements AxelSemrau.Chronos.Plugin.ITask.

Reimplemented in MockPlugin.Tasks.BrewCoffee, and MockPlugin.Tasks.BrewFrappuccino.

Definition at line 57 of file MockUseDeviceTasks.cs.

58 {
59 }

◆ PreValidate()

virtual void MockPlugin.Tasks.CoffeeMachineBaseTask.PreValidate ( )
virtual

Called before the schedule construction is completed.

Implements AxelSemrau.Chronos.Plugin.ITask.

Definition at line 53 of file MockUseDeviceTasks.cs.

54 {
55 }

◆ SetDevice()

void MockPlugin.Tasks.CoffeeMachineBaseTask.SetDevice ( IDevice  yourDevice)

Definition at line 48 of file MockUseDeviceTasks.cs.

49 {
50 CheckForCoffeeMachine(yourDevice);
51 }
void CheckForCoffeeMachine(IDevice yourDevice)
It makes no sense to use any other "Autosampler" than our fake coffee machine here.

References MockPlugin.Tasks.CoffeeMachineBaseTask.CheckForCoffeeMachine().

Member Data Documentation

◆ mDevice

Property Documentation

◆ Consumables

IConsumableManipulator MockPlugin.Tasks.CoffeeMachineBaseTask.Consumables
getset

You will get an instance of a helper class that helps your task to find the correct consumable puddle.

You can use this indepenedently of active consumables manager - if there is none, you'll just get a dummy here. This will be set to different instances for validation and execution time. Please use this in ITask.PostValidate() (which may be called repeatedly), not ITask.PreValidate().

Implements AxelSemrau.Chronos.Plugin.Consumables.IConsumer.

Definition at line 64 of file MockUseDeviceTasks.cs.

64{ get; set; }

Referenced by MockPlugin.Tasks.BrewCoffee.RegisterCoffeeConsumption(), and MockPlugin.Tasks.BrewFrappuccino.RegisterConsumption().


The documentation for this class was generated from the following file: