=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===

This commit is contained in:
julian
2026-06-28 02:50:05 -07:00
parent a19fb90902
commit 586f02a2ca
654 changed files with 5260 additions and 0 deletions
@@ -12,6 +12,7 @@ namespace adas_core.module.Relays.Devices;
/// The class also includes an event to notify when the status of a relay changes.
/// The implementation of the methods is left to the derived classes, which will provide specific functionality based on the type of relay device being used.
/// </summary>
/// <!-- aidoc:v1 sig=d49d435 -->
public abstract class RelayDevice
{
/// <summary>
@@ -42,6 +43,7 @@ public abstract class RelayDevice
/// </summary>
/// <param name="relay">The Relay object representing the relay device.</param>
/// <param name="relaySettings">The RelaySettings object containing the configuration settings for the relay device.</param>
/// <!-- aidoc:v1 sig=4036497 body=4a2098e -->
protected RelayDevice(Relay relay, RelaySettings relaySettings)
{
Relay = relay;
@@ -69,23 +71,32 @@ public abstract class RelayDevice
/// Checks the status of the relay device. This method is abstract and must be implemented by derived classes to provide specific functionality for checking the status of the relay device.
/// </summary>
/// <returns></returns>
/// <!-- aidoc-review:v1 severity=medium kind=missing_returns
/// "The <returns> tag is empty; the method returns a bool but its meaning (e.g., true = device OK/connected, false = fault/not found) is not documented." -->
/// <!-- aidoc-review:v1 severity=medium kind=wrong_summary
/// "The summary specifies 'relay device', but the code (CheckDevice) and signature provide no evidence the device is a relay; the term appears to be an unsupported assumption." -->
public abstract bool CheckDevice();
/// <summary>
/// Checks the status of the relays. This method is abstract and must be implemented by derived classes to provide specific functionality for checking the status of the relays.
/// </summary>
/// <!-- aidoc:v1 sig=7c1569a -->
public abstract void CheckStatus();
/// <summary>
/// Gets the status of the relay device. This method is abstract and must be implemented by derived classes to provide specific functionality for retrieving the status of the relay device.
/// </summary>
/// <returns></returns>
/// <!-- aidoc-review:v1 severity=medium kind=missing_returns
/// "The <returns> tag is empty; the method returns a bool indicating the relay status, which is not described." -->
public abstract bool GetStatusRelay();
/// <summary>
/// Gets the status of the relays. This method is abstract and must be implemented by derived classes to provide specific functionality for retrieving the status of the relays.
/// </summary>
/// <returns></returns>
/// <!-- aidoc-review:v1 severity=low kind=missing_returns
/// "The <returns> tag is empty and does not describe what the Task<bool> return value represents." -->
public abstract Task<bool> GetStatusRelayAsync();
/// <summary>
@@ -93,6 +104,7 @@ public abstract class RelayDevice
/// </summary>
/// <param name="outletId">The ID of the relay outlet.</param>
/// <returns>The status of the specified relay outlet.</returns>
/// <!-- aidoc:v1 sig=72e92a5 body=80cb7be -->
public virtual RelayEnum.Status GetStatusRelay(int outletId)
{
lock (_relaysStatus)
@@ -106,6 +118,7 @@ public abstract class RelayDevice
/// </summary>
/// <param name="outletId">The ID of the relay outlet.</param>
/// <param name="status">The new status of the relay outlet.</param>
/// <!-- aidoc:v1 sig=82b3cca body=3d9883a -->
public virtual void SetStatusRelay(int outletId, RelayEnum.Status status)
{
lock (_relaysStatus)
@@ -123,6 +136,8 @@ public abstract class RelayDevice
/// </summary>
/// <param name="outletId">The ID of the relay outlet.</param>
/// <param name="milliseconds">The duration in milliseconds for which the relay outlet should be powered off.</param>
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
/// "The summary states the method 'waits' for the specified milliseconds between PowerOffRelay and PowerOnRelay, but Task.Delay's returned Task is not awaited, so PowerOnRelay runs immediately after PowerOffRelay with no actual delay." -->
public virtual void PowerOnOffRelay(int outletId, int milliseconds)
{
Task.Run(() =>
@@ -137,6 +152,7 @@ public abstract class RelayDevice
/// <summary>
/// Refreshes the status of the relay device. This method is virtual and can be overridden by derived classes to provide specific functionality for refreshing the status of the relay device.
/// </summary>
/// <!-- aidoc:v1 sig=d883f16 body=4448e1d -->
public virtual void Refresh()
{
}
@@ -145,32 +161,38 @@ public abstract class RelayDevice
/// Powers on a specific relay outlet. This method is abstract and must be implemented by derived classes to provide specific functionality for powering on a relay outlet with the specified outlet ID.
/// </summary>
/// <param name="outletId">The ID of the relay outlet to power on.</param>
/// <!-- aidoc:v1 sig=d94c874 -->
public abstract void PowerOnRelay(int outletId);
/// <summary>
/// Powers off a specific relay outlet. This method is abstract and must be implemented by derived classes to provide specific functionality for powering off a relay outlet with the specified outlet ID.
/// </summary>
/// <param name="outletId">The ID of the relay outlet to power off.</param>
/// <!-- aidoc:v1 sig=5394819 -->
public abstract void PowerOffRelay(int outletId);
/// <summary>
/// Powers on all relay outlets. This method is abstract and must be implemented by derived classes to provide specific functionality for powering on all relay outlets.
/// </summary>
/// <!-- aidoc:v1 sig=c996518 -->
public abstract void PowerOnAll();
/// <summary>
/// Powers off all relay outlets. This method is abstract and must be implemented by derived classes to provide specific functionality for powering off all relay outlets.
/// </summary>
/// <!-- aidoc:v1 sig=489ea3b -->
public abstract void PowerOffAll();
/// <summary>
/// Reboots a specific relay outlet. This method is abstract and must be implemented by derived classes to provide specific functionality for rebooting a relay outlet with the specified outlet ID.
/// </summary>
/// <param name="outletId"></param>
/// <!-- aidoc:v1 sig=a3e578d -->
public abstract void RebootOutlet(int outletId);
/// <summary>
/// Reboots all relay outlets. This method is abstract and must be implemented by derived classes to provide specific functionality for rebooting all relay outlets.
/// </summary>
/// <!-- aidoc:v1 sig=4b9c90f -->
public abstract void Reboot();
}