Chronos Plugins 5.11.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.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.

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 {
98 mDevice.ShowTheMessage(Message);
99 RegisterCoffeeConsumption();
100 }

References MockPlugin.Tasks.CoffeeMachineBaseTask.mDevice, Message, and RegisterCoffeeConsumption().

◆ 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 {
104 RegisterCoffeeConsumption();
105 }

References 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 }

References MockPlugin.Tasks.CoffeeMachineBaseTask.Consumables, MockPlugin.Consumables.CoffeeConsumableManager.GetLocationIdentifier(), and MockPlugin.Tasks.CoffeeMachineBaseTask.mDevice.

Referenced by Execute(), and 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 Execute().


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