Adds the thermo-electric generator (#18840)

* Basic TEG start.

Connects via node group.

* Basic TEG test map

* Sensor monitoring basics, TEG circulator flow

* Basic power generation (it doesn't work)

* More sensor monitoring work

* Battery (SMES) monitoring system.

* Sensor monitoring fixes

Make it work properly when mapped.

* Test map improvements

* Revise TEG power output mechanism.

Now uses a fixed supplier with a custom ramping system.

* TEG test map fixes

* Make air alarms and pumps open UI on activate.

* Clean up thermo machines power switch.

Removed separate Enabled bool from the component that always matched the power receiver's state.

This enables adding a PowerSwitch component to give us alt click/verb menu.

* TEG but now fancy

* Make sensor monitoring console obviously WiP to mappers.

* Vending machine sound, because of course.

* Terrible, terrible graph background color

* Examine improvements for the TEG.

* Account for electrical power when equalizing gas mixtures.

* Get rid of the TegCirculatorArrow logic.

Use TimedDespawn instead. The "no show in right-click menuu" goes into a new general-purpose component.

Thanks Julian.

* Put big notice of "not ready, here's why" on the sensor monitoring console.

* TryGetComponent -> TryComp

* Lol there's a HideContextMenu tag

* Test fixes

* Guidebook for TEG

Fixed rotation on GuideEntityEmbed not working correctly.

Added Margin property to GuideEntityEmbed

* Make TEG power bar default to invisible.

So it doesn't appear in the guidebook and spawn menu.
This commit is contained in:
Pieter-Jan Briers
2023-08-12 22:41:55 +02:00
committed by GitHub
parent 61bf951ec4
commit a242af506e
74 changed files with 5546 additions and 22 deletions

View File

@@ -0,0 +1,64 @@
using Content.Shared.SensorMonitoring;
using Robust.Server.Player;
using Robust.Shared.Collections;
namespace Content.Server.SensorMonitoring;
[RegisterComponent]
public sealed class SensorMonitoringConsoleComponent : Component
{
/// <summary>
/// Used to assign network IDs for sensors and sensor streams.
/// </summary>
public int IdCounter;
/// <summary>
/// If enabled, additional data streams are shown intended to only be visible for debugging.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("debug_streams")]
public bool DebugStreams = false;
[ViewVariables(VVAccess.ReadWrite)]
public Dictionary<EntityUid, SensorData> Sensors = new();
[DataField("retentionTime")]
public TimeSpan RetentionTime = TimeSpan.FromMinutes(1);
// UI update tracking stuff.
public HashSet<IPlayerSession> InitialUIStateSent = new();
public TimeSpan LastUIUpdate;
public ValueList<int> RemovedSensors;
public sealed class SensorData
{
[ViewVariables(VVAccess.ReadWrite)]
public int NetId;
[ViewVariables(VVAccess.ReadWrite)]
public SensorDeviceType DeviceType;
[ViewVariables(VVAccess.ReadWrite)]
public Dictionary<string, SensorStream> Streams = new();
}
public sealed class SensorStream
{
[ViewVariables(VVAccess.ReadWrite)]
public int NetId;
[ViewVariables(VVAccess.ReadWrite)]
public SensorUnit Unit;
// Queue<T> is a ring buffer internally, and we can still iterate over it.
// I don't wanna write a ring buffer myself, so this is pretty convenient!
[ViewVariables]
public Queue<SensorSample> Samples = new();
}
public sealed class ViewingPlayer
{
}
}