1using System.ComponentModel;
3using Ctc.Palplus.Integration.Driver.Entities;
10 internal class CoffeeIngredientContainer : IConsumablePuddle
12 private Quantity mCurrentLevel;
14 public CoffeeIngredientContainer(CoffeeIngredient forPool,
string location,
string containerName, Quantity maxLevel, Quantity currentLevel)
17 Location = CoffeeConsumableManager.GetLocationIdentifier(forPool.ForDevice, location);
18 MaxLevel =
new Quantity(maxLevel.Value, maxLevel.Unit);
19 CurrentLevel =
new Quantity(currentLevel.Value, currentLevel.Unit);
20 ContainerName = containerName;
23 public string ContainerName {
get; }
25 public event PropertyChangedEventHandler PropertyChanged;
26 public IConsumablePool ParentPool {
get; }
27 public string Location {
get; }
28 public Quantity MaxLevel {
get; }
30 public Quantity CurrentLevel
35 mCurrentLevel = value;
36 PropertyChanged?.Invoke(
this,
new PropertyChangedEventArgs(nameof(CurrentLevel)));
40 public void ModifyBy(Quantity relativeAmount)
42 if (relativeAmount !=
null)
44 CurrentLevel = CurrentLevel + relativeAmount;
48 public void SetTo(Quantity absoluteAmount)
50 CurrentLevel = absoluteAmount;
53 public CoffeeIngredientContainer Clone(CoffeeIngredient forPool)
55 return new CoffeeIngredientContainer(forPool, Location, ContainerName, MaxLevel, CurrentLevel);
Foundation of a consumable management system. Not yet really utilized in Chronos itself,...
Classes for managing consumables of our imagined coffee machine.