From 7c1f14845bc948e9ea25908e96099203d9433a69 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Tue, 6 Apr 2021 01:21:42 -0400 Subject: update wrapper + writer to handle lut grapher is building but applying options still broken for the most part --- grapher/Models/Serialized/LookupTable.cs | 50 -------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 grapher/Models/Serialized/LookupTable.cs (limited to 'grapher/Models/Serialized/LookupTable.cs') diff --git a/grapher/Models/Serialized/LookupTable.cs b/grapher/Models/Serialized/LookupTable.cs deleted file mode 100644 index d373461..0000000 --- a/grapher/Models/Serialized/LookupTable.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Models.Serialized -{ - [Serializable] - public static class LookupTable - { - public static void Deserialize(string lutFile, ref DriverSettings settings) - { - if (!File.Exists(lutFile)) - { - throw new Exception($"LUT file does not exist at {lutFile}."); - } - - JObject lutJObject = JObject.Parse(File.ReadAllText(lutFile)); - - var spacedLut = lutJObject.ToObject(JsonSerializer.Create(RawAccelSettings.SerializerSettings)); - - if (spacedLut is null) - { - var arbitraryLut = lutJObject.ToObject(JsonSerializer.Create(RawAccelSettings.SerializerSettings)); - - if (arbitraryLut is null || arbitraryLut.points is null) - { - throw new Exception($"{lutFile} does not contain valid lookuptable json."); - } - - settings.ArbitraryTable = arbitraryLut; - settings.args.x.lutArgs.type = TableType.arbitrary; - } - else - { - if (spacedLut.points is null) - { - throw new Exception($"{lutFile} does not contain valid lookuptable json."); - } - - settings.SpacedTable = spacedLut; - settings.args.x.lutArgs = spacedLut.args; - } - } - } -} -- cgit v1.2.3