13 lines
346 B
C#
13 lines
346 B
C#
|
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();
|
||
|
}
|
||
|
}
|