summaryrefslogtreecommitdiff
path: root/writer/Program.cs
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-09-25 18:46:04 -0400
committera1xd <[email protected]>2020-09-25 18:46:04 -0400
commitfd184b6ffeaf5b1d1dceb7de58a8ebb7c3d8c760 (patch)
tree4e00b478ac1d888c50beaa782733cf52c61d038b /writer/Program.cs
parentMerge pull request #22 from JacobPalecki/GUI (diff)
downloadrawaccel-fd184b6ffeaf5b1d1dceb7de58a8ebb7c3d8c760.tar.xz
rawaccel-fd184b6ffeaf5b1d1dceb7de58a8ebb7c3d8c760.zip
add initial writer
move managed settings into wrapper move gui build into driver build dir
Diffstat (limited to 'writer/Program.cs')
-rw-r--r--writer/Program.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/writer/Program.cs b/writer/Program.cs
new file mode 100644
index 0000000..7f9c37c
--- /dev/null
+++ b/writer/Program.cs
@@ -0,0 +1,30 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+using System;
+using System.IO;
+
+namespace writer
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ try
+ {
+ var serializerSettings = new JsonSerializerSettings
+ {
+ MissingMemberHandling = MissingMemberHandling.Error,
+ };
+ var token = JObject.Parse(File.ReadAllText(args[0]))["AccelerationSettings"];
+ var settings = token.ToObject<DriverSettings>(JsonSerializer.Create(serializerSettings));
+ DriverInterop.SetActiveSettings(settings);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ Console.ReadLine();
+ }
+ }
+ }
+}