From 9010cc593af419dd824dba0ade6a2022aea6143f Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Mon, 31 Aug 2020 19:41:21 -0400 Subject: add independent xy accel to driver other changes: modifier_args type name is now settings, which is now the type passed in driver ioctl remove most settings/args verification from driver, plan to let gui handle most of it add another accel arg, rate, which is used to set the 'accel' parameter of types which call exp (nat/sig), might want to cap it add (update) serializable DriverSettings (ModifierArgs) class to gui and static methods for interop remove properties from ManagedAccel, its now just a black box for accessing modifier methods add exception handling in wrapper_io to throw proper managed types change SettingsManager::Startup to make a new settings file if an error occurs during deserialization change structure of accel types; how offset and weight are applied now depend on additivity of types remove tagged_union and add a handrolled variant/visit impl AccelGui::UpdateActiveValueLabels currently broken for caps and a few other args remove gui default layout and initial natural accel setup cli not updated --- grapher/Models/Serialized/ModifierArgs.cs | 75 ------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 grapher/Models/Serialized/ModifierArgs.cs (limited to 'grapher/Models/Serialized/ModifierArgs.cs') diff --git a/grapher/Models/Serialized/ModifierArgs.cs b/grapher/Models/Serialized/ModifierArgs.cs deleted file mode 100644 index 206a3c9..0000000 --- a/grapher/Models/Serialized/ModifierArgs.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Models.Serialized -{ - public enum accel_mode - { - linear=1, classic, natural, logarithmic, sigmoid, power, naturalgain, sigmoidgain, noaccel - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - [Serializable] - public struct vec2d - { - public double x; - public double y; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - [Serializable] - public struct accel_args - { - public double offset; - public double accel; - public double limit; - public double exponent; - public double midpoint; - public double power_scale; - public double gain_cap; - public vec2d weight; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - [Serializable] - public struct accel_fn_args - { - public accel_args acc_args; - public int accel_mode; - public double time_min; - public vec2d cap; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - [Serializable] - public struct modifier_args - { - public double degrees; - public vec2d sens; - public accel_fn_args acc_fn_args; - - public modifier_args(ManagedAccel managedAccel) - { - degrees = managedAccel.Rotation; - sens.x = managedAccel.SensitivityX; - sens.y = managedAccel.SensitivityY; - acc_fn_args.accel_mode = managedAccel.Type; - acc_fn_args.time_min = managedAccel.MinimumTime; - acc_fn_args.cap.x = managedAccel.CapX; - acc_fn_args.cap.y = managedAccel.CapY; - acc_fn_args.acc_args.accel = managedAccel.Acceleration; - acc_fn_args.acc_args.exponent = managedAccel.LimitExp; - acc_fn_args.acc_args.gain_cap = managedAccel.GainCap; - acc_fn_args.acc_args.limit = managedAccel.LimitExp; - acc_fn_args.acc_args.midpoint = managedAccel.Midpoint; - acc_fn_args.acc_args.offset = managedAccel.Offset; - acc_fn_args.acc_args.power_scale = managedAccel.PowerScale; - acc_fn_args.acc_args.weight.x = managedAccel.WeightX; - acc_fn_args.acc_args.weight.y = managedAccel.WeightY; - } - } -} -- cgit v1.2.3