Innovenergy_trunk/csharp/Lib/StatusApi/DeviceStatus.cs

52 lines
1.4 KiB
C#

using InnovEnergy.Lib.Utils;
namespace InnovEnergy.Lib.StatusApi;
public abstract record DeviceStatus
{
public String DeviceType => GetType()
.Unfold(t => t.BaseType)
.First(t => t.IsAbstract)
.Name
.Replace("Status", "");
}
// 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();
// }
// }