Chronos Plugins  5.2.0
This documentation covers the plugin interfaces definitions and an example implementation.
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. More...
 
override void PostValidate ()
 Called after the schedule construction is completed. More...
 
override string GetTaskAction ()
 Show this task's action in the timetable. More...
 
- Public Member Functions inherited from MockPlugin.Tasks.CoffeeMachineBaseTask
void SetDevice (IDevice yourDevice)
 
virtual void PreValidate ()
 Called before the schedule construction is completed. More...
 
- Public Member Functions inherited from AxelSemrau.Chronos.Plugin.ITaskForDevice
void SetDevice (IDevice yourDevice)
 Will be called by chronos when building the schedule. More...
 

Properties

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

Private Member Functions

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

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. More...
 
- 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 ( )
virtual

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

Implements MockPlugin.Tasks.CoffeeMachineBaseTask.

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.
Definition: MockDevice.cs:156
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 ( )
virtual

Show this task's action in the timetable.

Returns

Implements MockPlugin.Tasks.CoffeeMachineBaseTask.

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)

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: