Innovenergy_trunk/csharp/lib/Devices/Trumpf/TruConvert/Utils.cs

13 lines
346 B
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvert;
public static class Utils
{
public static UInt16[] ToUInt16(this IEnumerable<Decimal> regs, Decimal resolution)
{
// LINQ
return regs
.Select(v => (Int16)(v / resolution))
.Select(v => unchecked((UInt16)v))
.ToArray();
}
}