Innovenergy_trunk/csharp/App/SchneiderMeterDriver/Signal.cs

16 lines
520 B
C#
Raw Normal View History

using InnovEnergy.Lib.Devices.IEM3kGridMeter;
2024-06-04 10:23:19 +00:00
using InnovEnergy.Lib.Protocols.DBus.Protocol.DataTypes;
using InnovEnergy.Lib.Victron.VeDBus;
2024-06-04 13:28:17 +00:00
namespace InnovEnergy.App.SchneiderDriver;
2024-06-04 10:23:19 +00:00
// TODO: Does not compile
public record Signal(Func<Iem3KGridMeterRegisters, Object> Source, ObjectPath Path, String Format = "")
2024-06-04 10:23:19 +00:00
{
public VeProperty ToVeProperty(Iem3KGridMeterRegisters status)
2024-06-04 10:23:19 +00:00
{
var value = Source(status);
return new VeProperty(Path, value, String.Format($"{{0:{Format}}}", value));
}
}