Permalink
Browse files

Added a new channel, OpenEEG RAW that implements the Illuminated Inte…

…rface and averaged out the OpenEEG channel.
  • Loading branch information...
IAmCoder committed Dec 26, 2013
1 parent 6aa5c0b commit dd1a9e9691f6439586f93eaa52a32a8dff9b195a
@@ -99,6 +99,12 @@
}
"Entry"
{
"MsmKey" = "8:_99922EB46F4E4AC0AF421EF2BE406F1B"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_A50AD2CB84BC4354A0FBDE7F0519C9CC"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -135,6 +141,12 @@
}
"Entry"
{
"MsmKey" = "8:_C60045C60F7E6A1ECB89F4F9C68FBC67"
"OwnerKey" = "8:_C55B1C30F9804D249DF1E072DCF8CCAD"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_D561255389C842478CB86643369FC415"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -160,6 +172,12 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_C60045C60F7E6A1ECB89F4F9C68FBC67"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_B29DAD1442AE48789D2311EAFCFFFDEF"
"MsmSig" = "8:_UNDEFINED"
}
@@ -611,6 +629,26 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_99922EB46F4E4AC0AF421EF2BE406F1B"
{
"SourcePath" = "8:..\\OpenEEG\\Plugins\\OpenEEG RAW.lsd"
"TargetName" = "8:OpenEEG RAW.lsd"
"Tag" = "8:"
"Folder" = "8:_A367054D1B9A4B6A80E0431FF4130A8F"
"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:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A50AD2CB84BC4354A0FBDE7F0519C9CC"
{
"SourcePath" = "8:Logo.jpg"
@@ -744,6 +782,37 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_C60045C60F7E6A1ECB89F4F9C68FBC67"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:lucidcode.LucidScribe.Interface.Illuminated, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_C60045C60F7E6A1ECB89F4F9C68FBC67"
{
"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:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D561255389C842478CB86643369FC415"
{
"SourcePath" = "8:..\\OpenEEG\\Plugins\\OpenEEG Ch5.lsd"
@@ -970,14 +1039,14 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Lucid Scribe OpenEEG"
"ProductCode" = "8:{16B69B10-991C-49C4-920B-E9AB56A6D54B}"
"PackageCode" = "8:{3434653C-6FC8-47E7-AA7A-761D3312806C}"
"ProductCode" = "8:{E8942307-372A-4855-BDD0-C2B00C15D695}"
"PackageCode" = "8:{4DA8BE2E-E21A-402F-A3E8-0D7290F6B99D}"
"UpgradeCode" = "8:{D21B48DC-E942-48EA-9916-C569C46778E4}"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:0.9.8"
"ProductVersion" = "8:0.9.9"
"Manufacturer" = "8:lucidcode"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://www.lucid-code.com/Support"
BIN -3 KB (85%) Lucid Scribe - OpenEEG.suo
Binary file not shown.
@@ -48,6 +48,10 @@
<HintPath>Dependencies\lucidcode.LucidScribe.Interface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="lucidcode.LucidScribe.Interface.Illuminated, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Dependencies\lucidcode.LucidScribe.Interface.Illuminated.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
@@ -5,10 +5,10 @@
using System.Threading;
using System.IO.Ports;
using System.Windows.Forms;
using System.Drawing;

namespace lucidcode.LucidScribe.Plugin.OpenEEG
{

public static class Device
{
static bool Initialized;
@@ -17,12 +17,17 @@ public static class Device
static int[] eegChannels;
static double eegValue;

static double eegTicks;
static bool clearRaw;

static int[] buffer = new int[16];
static int index = 100;
static int lastByte = -1;
static int channels = 2;
public static string Algorithm = "REM Detection";

public static EventHandler<EventArgs> OpenEEGChanged;

public static Boolean Initialize()
{
eegChannels = new int[channels];
@@ -103,9 +108,23 @@ static void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e
}
}

int currentValue = 0;
if (activeChannels > 0)
{
eegValue = total / activeChannels;
currentValue = total / activeChannels;
if (clearRaw)
{
clearRaw = false;
eegValue = 0;
eegTicks = 0;
}
eegValue += currentValue;
eegTicks++;
}

if (OpenEEGChanged != null)
{
OpenEEGChanged((object)currentValue, null);
}
}

@@ -137,7 +156,13 @@ public static void Dispose()

public static Double GetEEG()
{
return eegValue;
if (eegTicks == 0) return 0;
return (eegValue / eegTicks);
}

public static void ClearEEG()
{
clearRaw = true;
}

public static Double GetChannel1()
@@ -200,8 +225,6 @@ namespace EEG
public class PluginHandler : lucidcode.LucidScribe.Interface.LucidPluginBase
{

private double m_dblValue = 256;

public override string Name
{
get
@@ -227,6 +250,7 @@ public override double Value
get
{
double tempValue = Device.GetEEG();
Device.ClearEEG();
if (tempValue > 999) { tempValue = 999; }
if (tempValue < 0) { tempValue = 0; }
return tempValue;
@@ -240,6 +264,130 @@ public override void Dispose()
}
}

namespace RAW
{
public class PluginHandler : lucidcode.LucidScribe.Interface.ILluminatedPlugin
{

private double m_dblValue = 256;

public string Name
{
get
{
return "OpenEEG RAW";
}
}

public bool Initialize()
{
try
{
bool initialized = Device.Initialize();
Device.OpenEEGChanged += OpenEEGChanged;
return initialized;
}
catch (Exception ex)
{
throw (new Exception("The '" + Name + "' plugin failed to initialize: " + ex.Message));
}
}

public event Interface.SenseHandler Sensed;
public void OpenEEGChanged(object sender, EventArgs e)
{
if (ClearTicks)
{
ClearTicks = false;
TickCount = "";
}
TickCount += sender + ",";

if (ClearBuffer)
{
ClearBuffer = false;
BufferData = "";
}
BufferData += sender + ",";
}

public void Dispose()
{
Device.OpenEEGChanged -= OpenEEGChanged;
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
@@ -0,0 +1,8 @@
<LucidScribeData>
<Plugin>
<Enabled>False</Enabled>
<Baseline>
</Baseline>
<Color>-1</Color>
</Plugin>
</LucidScribeData>
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.8.0")]
[assembly: AssemblyFileVersion("0.9.8.0")]
[assembly: AssemblyVersion("0.9.9.0")]
[assembly: AssemblyFileVersion("0.9.9.0")]

0 comments on commit dd1a9e9

Please sign in to comment.