2023-02-26 18:20:43 +00:00
|
|
|
using InnovEnergy.Lib.Utils;
|
|
|
|
|
2023-02-26 09:38:28 +00:00
|
|
|
namespace InnovEnergy.Lib.StatusApi;
|
2023-02-21 06:27:20 +00:00
|
|
|
|
2023-02-26 09:38:28 +00:00
|
|
|
public abstract record DeviceStatus
|
2023-02-21 06:27:20 +00:00
|
|
|
{
|
2023-02-26 18:20:43 +00:00
|
|
|
public String DeviceType => GetType()
|
2023-03-06 08:52:27 +00:00
|
|
|
.Unfold(t => t.BaseType)
|
2023-02-26 18:20:43 +00:00
|
|
|
.First(t => t.IsAbstract)
|
|
|
|
.Name
|
|
|
|
.Replace("Status", "");
|
2023-03-02 17:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// public static class Program
|
|
|
|
// {
|
|
|
|
// public static void Main(string[] args)
|
|
|
|
// {
|
|
|
|
// var x = new ThreePhasePvInverterStatus
|
|
|
|
// {
|
|
|
|
// Ac = new()
|
|
|
|
// {
|
|
|
|
// Frequency = 50,
|
|
|
|
// L1 = new()
|
|
|
|
// {
|
|
|
|
// Current = 10,
|
|
|
|
// Voltage = 10,
|
|
|
|
// Phi = 0,
|
|
|
|
// },
|
|
|
|
// L2 = new()
|
|
|
|
// {
|
|
|
|
// Current = 52,
|
|
|
|
// Voltage = 220,
|
|
|
|
// Phi = Angle.Pi / 2,
|
|
|
|
// },
|
|
|
|
// L3 = new()
|
|
|
|
// {
|
|
|
|
// Current = 158,
|
|
|
|
// Voltage = 454,
|
|
|
|
// Phi = Angle.Pi / 3,
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// Strings = new DcBus[]
|
|
|
|
// {
|
|
|
|
// new() { Current = 10, Voltage = 22 },
|
|
|
|
// new() { Current = 12, Voltage = 33 },
|
|
|
|
// }
|
|
|
|
// };
|
|
|
|
//
|
|
|
|
// var s = x.ToJson();
|
|
|
|
// }
|
|
|
|
// }
|