Chronos Plugins 5.9.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
MockConsumablesForCoffeeMaker.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Linq;
4using Ctc.Palplus.Integration.Driver.Entities;
6
8{
12 internal class MockConsumablesForCoffeeMakerDevice
13 {
14 public MockDevice ForDevice { get; }
15
16 public MockConsumablesForCoffeeMakerDevice(MockDevice forDevice, CoffeeConsumableManager parentManager)
17 {
18 ForDevice = forDevice;
19 Pools = new List<CoffeeIngredient>{new Coffee(ForDevice, parentManager), new Milk(ForDevice, parentManager), new VeganCream(ForDevice, parentManager)};
20 }
21
22 private MockConsumablesForCoffeeMakerDevice(MockConsumablesForCoffeeMakerDevice copyFrom,
23 CoffeeConsumableManager parentManager)
24 {
25 ForDevice = copyFrom.ForDevice;
26 Pools = new List<CoffeeIngredient>(copyFrom.Pools.Select(somePool => somePool.Clone(parentManager)));
27 }
28
29 internal class VeganCream : CoffeeIngredient
30 {
31 public const string Name = "Soy Milk";
32 public VeganCream(MockDevice forDevice, CoffeeConsumableManager parentManager) : base(Name,forDevice,parentManager)
33 {
34 mPuddles.Add(new CoffeeIngredientContainer(this,Name, "Soy Milk Package",new Quantity(500,Units.MilliLiter), new Quantity(450,Units.MilliLiter)));
35 }
36 }
37
38 internal class Milk : CoffeeIngredient
39 {
40 public const string Name = "Milk";
41 public Milk(MockDevice forDevice, CoffeeConsumableManager parentManager) : base(Name, forDevice, parentManager)
42 {
43 mPuddles.Add(new CoffeeIngredientContainer(this, Name, "Milk Bottle", new Quantity(1, Units.Liter), new Quantity(975, Units.MilliLiter)));
44 }
45 }
46
47 internal class Coffee : CoffeeIngredient, IConsumablePool
48 {
49 public const string Name = "Coffee";
50 public Coffee(MockDevice forDevice, CoffeeConsumableManager parentManager) : base(Name, forDevice,parentManager)
51 {
52 mPuddles.Add(new CoffeeIngredientContainer(this,Name, "Coffee Container", new Quantity(250,Units.Gram), new Quantity(225,Units.Gram)));
53 }
54 }
55
56
57 public IReadOnlyCollection<CoffeeIngredient> Pools { get; }
58
59 public MockConsumablesForCoffeeMakerDevice Clone(CoffeeConsumableManager forManager)
60 {
61 return new MockConsumablesForCoffeeMakerDevice(this, forManager);
62 }
63 }
64}
A fake device. This namespace contains the fake device driver and auxiliary classes for settings,...
Information about the available consumables with a common name (like "Water" or "Liners")
readonly ObservableCollection< IConsumablePuddle > mPuddles
A chronos plugin implementation for a fake device. We pretend we are controlling a mixture of coffee ...
Definition MockDevice.cs:53