From 066816bd8d6fe38871dafd8f09e1d3aa54b6d760 Mon Sep 17 00:00:00 2001 From: Michael Paul Coder Date: Sat, 13 Aug 2022 11:10:01 +1000 Subject: [PATCH] Add RAW vision channel --- ...code.LucidScribe.Interface.Illuminated.dll | Bin 0 -> 5632 bytes Halovision/Halovision.csproj | 3 + Halovision/PluginHandler.cs | 158 +++++++++++++++++- Halovision/VisionForm.designer.cs | 1 + Installer/Lucid Scribe Halovision.vdproj | 45 ++++- 5 files changed, 202 insertions(+), 5 deletions(-) create mode 100644 Halovision/Dependencies/lucidcode.LucidScribe.Interface.Illuminated.dll diff --git a/Halovision/Dependencies/lucidcode.LucidScribe.Interface.Illuminated.dll b/Halovision/Dependencies/lucidcode.LucidScribe.Interface.Illuminated.dll new file mode 100644 index 0000000000000000000000000000000000000000..a813739beed83a4d4d3b97ceb707bf9889e7a75e GIT binary patch literal 5632 zcmeHLVQd^n6@GJfc5El-#11Wi2D-tCWCK~9?K6$tD0S>}>?`NQ^|?*~i)8P1d|te_ zd+hGHaVimmC~E#y>W|WdA5`K8`Da8*D^Mi_$Pz+<7O8^%K|$gNfXw2Vb0z zcDqf9BYVYOqJ5Bbgwnr$5~GGbj?SQANQ8caQvUNu8|aX8OVaq0LGV)~w&0xlE1b!?dK4Sna(u?-zWXB+#`)94&m z)H#)rjMGKb)$qKXuF}_#>hCIi0oX-3F(TUOE%8TSPl8cbIID13;T46~6uzMFFNt3! z+DRlC_a}K(zrx3oQ^{$v;bJ>oPd<@sryl{?hcNS;LjiJ(rja$~p2u7T9BZ_(BI5hT zq3cbble8tCN36;Sa7+A@KHSvY62GEPkjfHPZlzzReyj}JR{9V0=@|DW=J4rLZ7cmx z%(b|r7z}F+vs>u{VkE|WOpK{~^1`k3fH)Q79u|dW*>0s5#3M28i=tnhk6PDOffYWj zkn_a(7MH#(z7XS{1jlD9=w)OoK|ccu`h}u@y^T)NZy`x3O+mj`v!TxW;Q(Dn1_l+5 zDm<+)ukaCtpHpZkw1B7R%Zgr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aCGv-5yZNref0pC-8{W7A7A3OHJ97qW zcoT9KDzpNxaQEzxX> W;e(d}E&M;Dzm0wHLcbd^(Z2zOM^GLB literal 0 HcmV?d00001 diff --git a/Halovision/Halovision.csproj b/Halovision/Halovision.csproj index a173c57..3d444ab 100644 --- a/Halovision/Halovision.csproj +++ b/Halovision/Halovision.csproj @@ -121,6 +121,9 @@ Dependencies\lucidcode.LucidScribe.Interface.dll False + + Dependencies\lucidcode.LucidScribe.Interface.Illuminated.dll + Dependencies\lucidcode.LucidScribe.TCMP.dll diff --git a/Halovision/PluginHandler.cs b/Halovision/PluginHandler.cs index 7027572..521f980 100644 --- a/Halovision/PluginHandler.cs +++ b/Halovision/PluginHandler.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.IO; using System.Media; using System.Threading; @@ -12,6 +13,11 @@ public static class Device static bool Initialized; static bool InitError; static int Value = 0; + static int Readings = 0; + + private static bool clearValue; + + public static EventHandler VisionChanged; static VisionForm visionForm; public static bool Initialize() @@ -38,7 +44,20 @@ public static bool Initialize() private static void VisionForm_ValueChanged(int value) { - Value = value; + Value = Value + value; + Readings = Readings + 1; + + if (clearValue) + { + clearValue = false; + Readings = 0; + Value = 0; + } + + if (VisionChanged != null) + { + VisionChanged((object)value, null); + } } static void loadVisionForm() @@ -73,7 +92,13 @@ public static void Dispose() public static int GetVision() { - return Value; + //if (Readings == 0) return 0; + + int value = Value; // + // Readings; + //if (Readings > 0) value = value / Readings; + clearValue = true; + return value; } public static int GetTossThreshold() @@ -261,8 +286,6 @@ namespace Vision { public class PluginHandler : lucidcode.LucidScribe.Interface.LucidPluginBase { - SoundPlayer sound = new SoundPlayer(); - public override string Name { get @@ -273,6 +296,10 @@ public override string Name public override bool Initialize() { + + if (Device.Auralize) { + System.Media.SystemSounds.Asterisk.Play(); + } return Device.Initialize(); } @@ -307,6 +334,7 @@ private void Auralize(double frequency) soundBytes.AddRange(format.GetBytes()); soundBytes.AddRange(austioChunk.GetBytes()); + var sound = new SoundPlayer(); sound.Stream = new MemoryStream(soundBytes.ToArray()); sound.Play(); } @@ -318,6 +346,128 @@ public override void Dispose() } } + namespace RAW + { + public class PluginHandler : lucidcode.LucidScribe.Interface.ILluminatedPlugin + { + + public string Name + { + get + { + return "Halovision RAW"; + } + } + + public bool Initialize() + { + try + { + bool initialized = Device.Initialize(); + Device.VisionChanged += VisionChanged; + return initialized; + } + catch (Exception ex) + { + throw (new Exception("The '" + Name + "' plugin failed to initialize: " + ex.Message)); + } + } + + public event Interface.SenseHandler Sensed; + public void VisionChanged(object sender, EventArgs e) + { + if (ClearTicks) + { + ClearTicks = false; + TickCount = ""; + } + TickCount += sender + ","; + + if (ClearBuffer) + { + ClearBuffer = false; + BufferData = ""; + } + BufferData += sender + ","; + } + + public void Dispose() + { + Device.VisionChanged -= VisionChanged; + Device.Dispose(); + } + + public Boolean isEnabled = false; + public Boolean Enabled + { + get + { + return isEnabled; + } + set + { + isEnabled = value; + } + } + + public Color PluginColor = Color.White; + public Color Color + { + get + { + return Color; + } + set + { + Color = value; + } + } + + private Boolean ClearTicks = false; + public String TickCount = ""; + public String Ticks + { + get + { + ClearTicks = true; + return TickCount; + } + set + { + TickCount = value; + } + } + + private Boolean ClearBuffer = false; + public String BufferData = ""; + public String Buffer + { + get + { + ClearBuffer = true; + return BufferData; + } + set + { + BufferData = value; + } + } + + int lastHour; + public int LastHour + { + get + { + return lastHour; + } + set + { + lastHour = value; + } + } + } + } + namespace REM { public class PluginHandler : lucidcode.LucidScribe.Interface.LucidPluginBase diff --git a/Halovision/VisionForm.designer.cs b/Halovision/VisionForm.designer.cs index c6585db..982e1dc 100644 --- a/Halovision/VisionForm.designer.cs +++ b/Halovision/VisionForm.designer.cs @@ -190,6 +190,7 @@ private void InitializeComponent() // tmrDiff // this.tmrDiff.Enabled = true; + this.tmrDiff.Interval = 20; this.tmrDiff.Tick += new System.EventHandler(this.tmrDiff_Tick); // // pbDifference diff --git a/Installer/Lucid Scribe Halovision.vdproj b/Installer/Lucid Scribe Halovision.vdproj index 0b47e19..de3998d 100644 --- a/Installer/Lucid Scribe Halovision.vdproj +++ b/Installer/Lucid Scribe Halovision.vdproj @@ -633,6 +633,12 @@ } "Entry" { + "MsmKey" = "8:_5294BB40EE33B2C3602EF328FF25AADE" + "OwnerKey" = "8:_395AC690E5F04358B866710FD743FFE4" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_53FD229DEDBBC6B6C38C5D53D2512E09" "OwnerKey" = "8:_395AC690E5F04358B866710FD743FFE4" "MsmSig" = "8:_UNDEFINED" @@ -2002,6 +2008,12 @@ "Entry" { "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_5294BB40EE33B2C3602EF328FF25AADE" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" "OwnerKey" = "8:_9768C46742605F22AB604239F03E17DD" "MsmSig" = "8:_UNDEFINED" } @@ -5273,6 +5285,37 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5294BB40EE33B2C3602EF328FF25AADE" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:lucidcode.LucidScribe.Interface.Illuminated, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_5294BB40EE33B2C3602EF328FF25AADE" + { + "Name" = "8:lucidcode.LucidScribe.Interface.Illuminated.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:lucidcode.LucidScribe.Interface.Illuminated.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_491A001224CF4D699EA475B2FB5F2890" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_53FD229DEDBBC6B6C38C5D53D2512E09" { "AssemblyRegister" = "3:1" @@ -10814,7 +10857,7 @@ "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Lucid Scribe Halovision" "ProductCode" = "8:{411774F8-3E0E-4CF2-9192-C614B596B336}" - "PackageCode" = "8:{29D970C5-AC16-4945-8EE1-803FDC2C989D}" + "PackageCode" = "8:{1BBABB08-9954-4183-AD1A-8EFC431B9F5F}" "UpgradeCode" = "8:{CAAB2187-AD23-435C-A3DB-568744247625}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE"