Status API V2
This commit is contained in:
parent
62ff63c0bb
commit
045de6ac0d
|
@ -1,20 +0,0 @@
|
|||
using System.Collections;
|
||||
|
||||
namespace InnovEnergy.Lib.StatusApi;
|
||||
|
||||
#pragma warning disable CS8618
|
||||
|
||||
public class CombinedStatus<T> : IReadOnlyList<T>
|
||||
{
|
||||
public T? Combined { get; init; }
|
||||
public IReadOnlyList<T> Stati { get; init; }
|
||||
|
||||
public Boolean Available => Stati.Count > 0;
|
||||
|
||||
public IEnumerator<T> GetEnumerator() => Stati.GetEnumerator();
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public Int32 Count => Stati.Count;
|
||||
|
||||
public T this[Int32 index] => Stati[index];
|
||||
}
|
|
@ -5,4 +5,5 @@ namespace InnovEnergy.Lib.StatusApi.Connections;
|
|||
public interface IAc1Connection
|
||||
{
|
||||
Ac1Bus Ac { get; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,4 +5,5 @@ namespace InnovEnergy.Lib.StatusApi.Connections;
|
|||
public interface IAc3Connection
|
||||
{
|
||||
Ac3Bus Ac { get; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ using InnovEnergy.Lib.Units.Composite;
|
|||
|
||||
namespace InnovEnergy.Lib.StatusApi.Connections;
|
||||
|
||||
|
||||
public interface IDcConnection
|
||||
{
|
||||
DcBus Dc { get; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,4 +5,9 @@ namespace InnovEnergy.Lib.StatusApi.Connections;
|
|||
public interface IPvConnection
|
||||
{
|
||||
IReadOnlyList<DcBus> Strings { get; }
|
||||
}
|
||||
|
||||
public interface IPvConnection<out T> where T : IReadOnlyList<DcBus>
|
||||
{
|
||||
T Strings { get; }
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
using InnovEnergy.Lib.StatusApi.Connections;
|
||||
using InnovEnergy.Lib.Units.Composite;
|
||||
|
||||
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||
|
||||
public interface IAc1Meter : IAc1Connection
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using InnovEnergy.Lib.StatusApi.Connections;
|
||||
using InnovEnergy.Lib.Units.Composite;
|
||||
|
||||
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||
|
||||
public interface IAc3Meter : IAc3Connection
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
using InnovEnergy.Lib.StatusApi.Connections;
|
||||
using InnovEnergy.Lib.Units.Composite;
|
||||
|
||||
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||
|
||||
|
||||
public interface IAcDc1 : IAc1Connection, IDcConnection
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,7 @@ using InnovEnergy.Lib.StatusApi.Connections;
|
|||
|
||||
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||
|
||||
|
||||
public interface IAcDc3 : IAc3Connection, IDcConnection
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
using InnovEnergy.Lib.StatusApi.Connections;
|
||||
using InnovEnergy.Lib.Units;
|
||||
using InnovEnergy.Lib.Units.Composite;
|
||||
|
||||
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||
|
||||
public interface IBattery : IDcConnection
|
||||
{
|
||||
public Percent Soc { get;}
|
||||
}
|
||||
Percent Soc { get; }
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
|||
|
||||
#pragma warning disable CS8618
|
||||
|
||||
public interface IDcDc
|
||||
public interface IDcDc
|
||||
{
|
||||
public DcBus Left { get; init; }
|
||||
public DcBus Right { get; init; }
|
||||
DcBus DcLeft { get; }
|
||||
DcBus DcRight { get; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
using InnovEnergy.Lib.StatusApi.Connections;
|
||||
using InnovEnergy.Lib.Units.Composite;
|
||||
|
||||
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||
|
||||
|
||||
public interface IMppt : IDcConnection, IPvConnection
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using InnovEnergy.Lib.StatusApi.Connections;
|
||||
using InnovEnergy.Lib.Units.Composite;
|
||||
|
||||
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
using InnovEnergy.Lib.StatusApi.Connections;
|
||||
using InnovEnergy.Lib.Units.Composite;
|
||||
|
||||
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||
|
||||
|
||||
public interface IPvAc3 : IAc3Connection, IPvConnection
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
namespace InnovEnergy.Lib.StatusApi;
|
||||
|
||||
public interface IDeviceRecord<out S, out C>
|
||||
{
|
||||
S Status { get; }
|
||||
C Control { get; }
|
||||
}
|
Loading…
Reference in New Issue