statusApi V2
This commit is contained in:
parent
249d4e7c31
commit
2ec5b34971
|
@ -1,15 +0,0 @@
|
||||||
using InnovEnergy.Lib.StatusApi.Connections;
|
|
||||||
using InnovEnergy.Lib.Units;
|
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
|
||||||
|
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
public record BatteryStatus : IDcConnection
|
|
||||||
{
|
|
||||||
public DcBus Dc { get; init; }
|
|
||||||
public Percent Soc { get; init; }
|
|
||||||
public Temperature Temperature { get; init; }
|
|
||||||
}
|
|
|
@ -1,12 +1,20 @@
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
namespace InnovEnergy.Lib.StatusApi;
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
#pragma warning disable CS8618
|
||||||
|
|
||||||
public record CombinedStatus<T>
|
public class CombinedStatus<T> : IReadOnlyList<T>
|
||||||
{
|
{
|
||||||
public T Combined { get; init; }
|
public T? Combined { get; init; }
|
||||||
public IReadOnlyList<T> Children { get; init; }
|
public IReadOnlyList<T> Stati { get; init; }
|
||||||
|
|
||||||
public Boolean Available => Children.Any();
|
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];
|
||||||
}
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
using InnovEnergy.Lib.StatusApi.Connections;
|
||||||
|
|
||||||
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
|
public interface IAc1Meter : IAc1Connection
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
using InnovEnergy.Lib.StatusApi.Connections;
|
||||||
|
|
||||||
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
|
public interface IAc3Meter : IAc3Connection
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
using InnovEnergy.Lib.StatusApi.Connections;
|
||||||
|
|
||||||
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IAcDc1 : IAc1Connection, IDcConnection
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
using InnovEnergy.Lib.StatusApi.Connections;
|
||||||
|
|
||||||
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IAcDc3 : IAc3Connection, IDcConnection
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
using InnovEnergy.Lib.StatusApi.Connections;
|
||||||
|
using InnovEnergy.Lib.Units;
|
||||||
|
|
||||||
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
|
public interface IBattery : IDcConnection
|
||||||
|
{
|
||||||
|
public Percent Soc { get;}
|
||||||
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
using InnovEnergy.Lib.Units.Composite;
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
#pragma warning disable CS8618
|
||||||
|
|
||||||
public record DcDcConverterStatus
|
public interface IDcDc
|
||||||
{
|
{
|
||||||
public DcBus Left { get; init; }
|
public DcBus Left { get; init; }
|
||||||
public DcBus Right { get; init; }
|
public DcBus Right { get; init; }
|
|
@ -0,0 +1,10 @@
|
||||||
|
using InnovEnergy.Lib.StatusApi.Connections;
|
||||||
|
|
||||||
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IMppt : IDcConnection, IPvConnection
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
using InnovEnergy.Lib.StatusApi.Connections;
|
||||||
|
|
||||||
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
|
public interface IPvAc1 : IAc1Connection, IPvConnection
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
using InnovEnergy.Lib.StatusApi.Connections;
|
||||||
|
|
||||||
|
namespace InnovEnergy.Lib.StatusApi.DeviceTypes;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IPvAc3 : IAc3Connection, IPvConnection
|
||||||
|
{
|
||||||
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
using InnovEnergy.Lib.StatusApi.Connections;
|
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
public record MpptStatus : IDcConnection, IPvConnection
|
|
||||||
{
|
|
||||||
public DcBus Dc { get; init; }
|
|
||||||
public IReadOnlyList<DcBus> Strings { get; init; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
using InnovEnergy.Lib.StatusApi.Connections;
|
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
public record PowerMeterStatus : IAc3Connection
|
|
||||||
{
|
|
||||||
public Ac3Bus Ac { get; init; }
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
using InnovEnergy.Lib.StatusApi.Connections;
|
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
|
||||||
|
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
public record SinglePhaseInverterStatus : IAc1Connection, IDcConnection
|
|
||||||
{
|
|
||||||
public Ac1Bus Ac { get; init; }
|
|
||||||
public DcBus Dc { get; init; }
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
using InnovEnergy.Lib.StatusApi.Connections;
|
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
public record SinglePhasePvInverterStatus : IAc1Connection, IPvConnection
|
|
||||||
{
|
|
||||||
public Ac1Bus Ac { get; init; }
|
|
||||||
public IReadOnlyList<DcBus> Strings { get; init; }
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
using InnovEnergy.Lib.StatusApi.Connections;
|
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
public record ThreePhaseInverterStatus : IAc3Connection, IDcConnection
|
|
||||||
{
|
|
||||||
public Ac3Bus Ac { get; init; }
|
|
||||||
public DcBus Dc { get; init; }
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
using InnovEnergy.Lib.StatusApi.Connections;
|
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.StatusApi;
|
|
||||||
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
public record ThreePhasePvInverterStatus : IAc3Connection, IPvConnection
|
|
||||||
{
|
|
||||||
public Ac3Bus Ac { get; init; }
|
|
||||||
public IReadOnlyList<DcBus> Strings { get; init; }
|
|
||||||
}
|
|
Loading…
Reference in New Issue