AtmosSensorData.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Content.Shared.Atmos.Monitor.Components;
  2. using Robust.Shared.Serialization;
  3. namespace Content.Shared.Atmos.Monitor;
  4. [Serializable, NetSerializable]
  5. public sealed class AtmosSensorData : IAtmosDeviceData
  6. {
  7. public AtmosSensorData(float pressure, float temperature, float totalMoles, AtmosAlarmType alarmState, Dictionary<Gas, float> gases, AtmosAlarmThreshold pressureThreshold, AtmosAlarmThreshold temperatureThreshold, Dictionary<Gas, AtmosAlarmThreshold> gasThresholds)
  8. {
  9. Pressure = pressure;
  10. Temperature = temperature;
  11. TotalMoles = totalMoles;
  12. AlarmState = alarmState;
  13. Gases = gases;
  14. PressureThreshold = pressureThreshold;
  15. TemperatureThreshold = temperatureThreshold;
  16. GasThresholds = gasThresholds;
  17. }
  18. public bool Enabled { get; set; }
  19. public bool Dirty { get; set; }
  20. public bool IgnoreAlarms { get; set; }
  21. /// Most fields are readonly, because it's data that's meant to be transmitted.
  22. /// <summary>
  23. /// Current pressure detected by this sensor.
  24. /// </summary>
  25. public float Pressure { get; }
  26. /// <summary>
  27. /// Current temperature detected by this sensor.
  28. /// </summary>
  29. public float Temperature { get; }
  30. /// <summary>
  31. /// Current amount of moles detected by this sensor.
  32. /// </summary>
  33. public float TotalMoles { get; }
  34. /// <summary>
  35. /// Current alarm state of this sensor. Does not reflect the highest alarm state on the network.
  36. /// </summary>
  37. public AtmosAlarmType AlarmState { get; }
  38. /// <summary>
  39. /// Current number of gases on this sensor.
  40. /// </summary>
  41. public Dictionary<Gas, float> Gases { get; }
  42. public AtmosAlarmThreshold PressureThreshold { get; }
  43. public AtmosAlarmThreshold TemperatureThreshold { get; }
  44. public Dictionary<Gas, AtmosAlarmThreshold> GasThresholds { get; }
  45. }