Permalink
Browse files

Smoothed out the Zeo EEG channel.

  • Loading branch information...
IAmCoder committed Sep 24, 2014
1 parent 726f398 commit fd4ff3eb07bfc09b248c94ebd61a7d7dd491fdc7
@@ -124,7 +124,7 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_7477139A985373FCCAE741F7BAE81CE6"
"OwnerKey" = "8:_74CC5CEA548AAB471EE4049C7020BD21"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@@ -136,7 +136,7 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_74CC5CEA548AAB471EE4049C7020BD21"
"OwnerKey" = "8:_7477139A985373FCCAE741F7BAE81CE6"
"MsmSig" = "8:_UNDEFINED"
}
}
@@ -236,7 +236,7 @@
{
"Name" = "8:.NET Framework"
"Message" = "8:[VSDNETMSG]"
"FrameworkVersion" = "8:3.5.30729 "
"FrameworkVersion" = "8:3.5.30729 "
"AllowLaterVersions" = "11:FALSE"
"InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=76617"
}
@@ -431,11 +431,6 @@
"AssemblyAsmDisplayName" = "8:lucidcode.LucidScribe.Interface.Illuminated, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_7477139A985373FCCAE741F7BAE81CE6"
{
"Name" = "8:lucidcode.LucidScribe.Interface.Illuminated.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:lucidcode.LucidScribe.Interface.Illuminated.dll"
"TargetName" = "8:"
@@ -462,11 +457,6 @@
"AssemblyAsmDisplayName" = "8:lucidcode.Controls, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_74CC5CEA548AAB471EE4049C7020BD21"
{
"Name" = "8:lucidcode.Controls.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:lucidcode.Controls.dll"
"TargetName" = "8:"
@@ -553,11 +543,6 @@
"AssemblyAsmDisplayName" = "8:lucidcode.LucidScribe.Interface, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_A6D309C81FB7C7C8EB6F2A75CDAED83F"
{
"Name" = "8:lucidcode.LucidScribe.Interface.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:lucidcode.LucidScribe.Interface.dll"
"TargetName" = "8:"
@@ -730,15 +715,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Lucid Scribe Zeo"
"ProductCode" = "8:{79E5B036-2906-473A-99B8-90D430415C2F}"
"PackageCode" = "8:{D8F94BCD-72C3-4A1C-8E2E-7868AC1133D8}"
"ProductCode" = "8:{44881FFA-1589-4B1B-9FF1-3F3788F04F53}"
"PackageCode" = "8:{C9B69A65-3E3C-4AEA-9C2D-8147185363C6}"
"UpgradeCode" = "8:{7FC45659-EDA9-401F-A2DB-7EE30232BDE8}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:0.9.7"
"ProductVersion" = "8:0.9.8"
"Manufacturer" = "8:lucidcode"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://www.lucid-code.com/Support"
@@ -1262,7 +1247,7 @@
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_6E53E465C78D42C1942D99252A19174B"
{
"SourcePath" = "8:..\\Zeo\\obj\\Debug\\lucidcode.LucidScribe.Plugin.Zeo.dll"
"SourcePath" = "8:..\\Zeo\\obj\\Release\\lucidcode.LucidScribe.Plugin.Zeo.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_491A001224CF4D699EA475B2FB5F2890"
BIN +0 Bytes (100%) Lucid Scribe - Zeo.suo
Binary file not shown.
@@ -42,10 +42,11 @@ public static class Device

public static EventHandler<RawEventArgs> ZeoChanged;

private static bool ClearDisplay;
private static double DisplayValue;
private static double StageValue;

private static int[] eigths = new int[8];
private static List<int> tenths = new List<int>();

public static Boolean Initialize()
{
try
@@ -54,8 +55,6 @@ public static Boolean Initialize()

if (!m_boolInitialized)
{


PortForm formPort = new PortForm();
if (formPort.ShowDialog() == DialogResult.OK)
{
@@ -111,7 +110,36 @@ private static void UpdateZeo()
ZeoChanged(null, e);
}
}
DisplayValue = total / 128;

if (channels.Length == 128)
{
for (int x = 0; x < 8; x++)
{
float maximum = 0;
float minimum = 0;

for (int y = 0; y < 16; y++)
{
int index = (x * 16) + y;
if (channels[index].Values[0] > maximum)
{
maximum = channels[index].Values[0];
}
if (channels[index].Values[0] < minimum)
{
minimum = channels[index].Values[0];
}
}

float greatest = maximum;
if (minimum * -1 > maximum)
{
greatest = minimum;
}

eigths[x] = Convert.ToInt32((greatest * 10) + 3000) / 6;
}
}
}

channels = zeoStream.ReadStageDataFromLastPosition(ref stageLastPosition, 1);
@@ -136,9 +164,8 @@ public static void Dispose()

public static Double GetValueEEG()
{
double temp = DisplayValue;
ClearDisplay = true;
return DisplayValue;
double eigth = DateTime.Now.Millisecond / 125;
return eigths[(int)(Math.Round(eigth))];
}

public static Double GetValueStage()
@@ -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.7.0")]
[assembly: AssemblyFileVersion("0.9.7.0")]
[assembly: AssemblyVersion("0.9.8.0")]
[assembly: AssemblyFileVersion("0.9.8.0")]
@@ -405,11 +405,11 @@ public ChannelData[] ReadEegFromLastPosition(ref int lastPosition, int len)
}
}

//ChannelData[] filteredValues = this.Filter50Hz(eegValues);
//for (int i = 0; i < len; i++)
//{
// eegValues[i] = filteredValues[i];
//}
ChannelData[] filteredValues = this.Filter50Hz(eegValues);
for (int i = 0; i < len; i++)
{
eegValues[i] = filteredValues[i];
}

this.rwLock.ReleaseLock();

0 comments on commit fd4ff3e

Please sign in to comment.