Chronos Plugins 5.9.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
MockPlugin.Tasks.BrewCoffee Class Reference

Calls a method of the device class with one if its task parameters. More...

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

Public Member Functions

override void Execute ()
 Do something with our device: The resulting message box is displayed by the device.
 
override void PostValidate ()
 Called after the schedule construction is completed.
 
override string GetTaskAction ()
 Show this task's action in the timetable.
 
- Public Member Functions inherited from MockPlugin.Tasks.CoffeeMachineBaseTask
void SetDevice (IDevice yourDevice)
 
virtual void PreValidate ()
 Called before 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)
 
- Public Member Functions inherited from AxelSemrau.Chronos.Plugin.ITask
- Public Member Functions inherited from AxelSemrau.Chronos.Plugin.ITaskForDevice
void SetDevice (IDevice yourDevice)
 Will be called by chronos when building the schedule.
 

Properties

string Message = LocalizeMockPlugin.BrewCoffee_mMessage_Do_you_want_sugar_ [get, set]
 Trivial property which can be changed in the method editor.
 
- Properties inherited from MockPlugin.Tasks.CoffeeMachineBaseTask
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

Private Member Functions

void RegisterCoffeeConsumption ()
 Inform the consumables tracker of the needed coffee amount.
 

Additional Inherited Members

- Protected Member Functions inherited from MockPlugin.Tasks.CoffeeMachineBaseTask
void CheckForCoffeeMachine (IDevice yourDevice)
 It makes no sense to use any other "Autosampler" than our fake coffee machine here.
 
- Protected Attributes inherited from MockPlugin.Tasks.CoffeeMachineBaseTask
MockDevice mDevice
 

Detailed Description

Calls a method of the device class with one if its task parameters.

This is a simple example of a task that makes use of the device. It has some ordinary properties and feeds these values into some operation on the device.

Definition at line 91 of file MockUseDeviceTasks.cs.

Member Function Documentation

◆ Execute()

override void MockPlugin.Tasks.BrewCoffee.Execute ( )

Do something with our device: The resulting message box is displayed by the device.

Implements AxelSemrau.Chronos.Plugin.ITask.

Definition at line 96 of file MockUseDeviceTasks.cs.

97 {
100 }
void ShowTheMessage(string messageText)
Let our device set a status message and display some message box instead of doing real work.
void RegisterCoffeeConsumption()
Inform the consumables tracker of the needed coffee amount.
string Message
Trivial property which can be changed in the method editor.

References MockPlugin.Tasks.CoffeeMachineBaseTask.mDevice, MockPlugin.Tasks.BrewCoffee.Message, MockPlugin.Tasks.BrewCoffee.RegisterCoffeeConsumption(), and MockPlugin.Device.MockDevice.ShowTheMessage().

◆ GetTaskAction()

override string MockPlugin.Tasks.BrewCoffee.GetTaskAction ( )

Show this task's action in the timetable.

Returns

Implements AxelSemrau.Chronos.Plugin.ITask.

Definition at line 119 of file MockUseDeviceTasks.cs.

120 {
121 return LocalizeMockPlugin.BrewCoffee_GetTaskAction_Send_a_message_to_my_device;
122 }

◆ PostValidate()

override void MockPlugin.Tasks.BrewCoffee.PostValidate ( )
virtual

Called after the schedule construction is completed.

Reimplemented from MockPlugin.Tasks.CoffeeMachineBaseTask.

Definition at line 102 of file MockUseDeviceTasks.cs.

103 {
105 }

References MockPlugin.Tasks.BrewCoffee.RegisterCoffeeConsumption().

◆ RegisterCoffeeConsumption()

void MockPlugin.Tasks.BrewCoffee.RegisterCoffeeConsumption ( )
private

Inform the consumables tracker of the needed coffee amount.

Definition at line 110 of file MockUseDeviceTasks.cs.

111 {
112 Consumables.ModifyLevel(CoffeeConsumableManager.GetLocationIdentifier(mDevice, MockConsumablesForCoffeeMakerDevice.Coffee.Name), new Quantity(-7, Units.Gram));
113 }
void ModifyLevel(string consumableLocation, Quantity amountDelta)
Change the level of a consumable.
Keeps track of all consumables that are associated to our mock coffee machine.
static string GetLocationIdentifier(MockDevice dev, string ingredientName)
string Name
User-selected name for the device instance.
Definition MockDevice.cs:88
IConsumableManipulator Consumables
You will get an instance of a helper class that helps your task to find the correct consumable puddle...

References MockPlugin.Tasks.CoffeeMachineBaseTask.Consumables, MockPlugin.Consumables.CoffeeConsumableManager.GetLocationIdentifier(), MockPlugin.Tasks.CoffeeMachineBaseTask.mDevice, AxelSemrau.Chronos.Plugin.Consumables.IConsumableManipulator.ModifyLevel(), and MockPlugin.Device.MockDevice.Name.

Referenced by MockPlugin.Tasks.BrewCoffee.Execute(), and MockPlugin.Tasks.BrewCoffee.PostValidate().

Property Documentation

◆ Message

string MockPlugin.Tasks.BrewCoffee.Message = LocalizeMockPlugin.BrewCoffee_mMessage_Do_you_want_sugar_
getset

Trivial property which can be changed in the method editor.

Definition at line 127 of file MockUseDeviceTasks.cs.

127{ get; set; } = LocalizeMockPlugin.BrewCoffee_mMessage_Do_you_want_sugar_;

Referenced by MockPlugin.Tasks.BrewCoffee.Execute().


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