using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Data.Core.Plugins; using Avalonia.Markup.Xaml; using FxpConvert.Common; #if DEBUG using HotAvalonia; #endif using ShakerApp.ViewModels; using ShakerApp.Views; using System; using System.Globalization; using System.Linq; using System.Runtime.InteropServices; namespace ShakerApp; public partial class App : Application { public unsafe override void Initialize() { Test(); #if DEBUG if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { this.EnableHotReload(); } #endif AvaloniaXamlLoader.Load(this); } private void Test() { IFxpConvert convert = new SIMDFxpConvert.SIMDFxpConverter(); uint count = 4; double[] f = new double[] { -1, -2, 1, 2 }; ulong[] f2 = new ulong[count]; NiFpga_FxpTypeInfo typeInfo = new NiFpga_FxpTypeInfo() { integerWordLength = 5, Delta = 0.000031, isSigned = true, Max = 15.999969, Min = -16, wordLength = 20 }; convert.DoubleConvertToDxp(ref f[0], typeInfo, ref f2[0], count); byte[] bytes = new byte[(int)Math.Ceiling(typeInfo.wordLength * count / 8.0)]; string s = string.Empty; for(int i=0;i