Permalink
Browse files

Fixed the sleep stage value. Again.

  • Loading branch information...
IAmCoder committed Oct 7, 2014
1 parent 7a89a0c commit 51778be76c73dcfe2fd65d3496f1bc9ad3beb61a
@@ -166,7 +166,7 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_74CC5CEA548AAB471EE4049C7020BD21"
"OwnerKey" = "8:_7477139A985373FCCAE741F7BAE81CE6"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@@ -178,7 +178,7 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_7477139A985373FCCAE741F7BAE81CE6"
"OwnerKey" = "8:_74CC5CEA548AAB471EE4049C7020BD21"
"MsmSig" = "8:_UNDEFINED"
}
}
@@ -278,7 +278,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"
}
@@ -941,15 +941,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Lucid Scribe Zeo"
"ProductCode" = "8:{262B8926-F9D8-47FB-98A7-A7619797BFAD}"
"PackageCode" = "8:{BDC46156-C47C-4463-A0D2-0B44AF42FA19}"
"ProductCode" = "8:{C45C1CFD-5236-459B-9869-BE35D7698FC8}"
"PackageCode" = "8:{6971806C-8C05-4299-AC8C-710A0D0AF999}"
"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:1.0.0"
"ProductVersion" = "8:1.0.1"
"Manufacturer" = "8:lucidcode"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://www.lucid-code.com/Support"
BIN +512 Bytes (100%) Lucid Scribe - Zeo.suo
Binary file not shown.
@@ -153,7 +153,7 @@ private static void UpdateZeo()
}

int stage = 0;
channels = zeoStream.ReadStageDataFromLastPosition(ref stageLastPosition, 64, ref stage);
zeoStream.ReadStageDataFromLastPosition(ref stage);
StageValue = stage * -100;
if (disposed) { break; }

@@ -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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
@@ -331,46 +331,23 @@ public ChannelData[] ReadFrequencyDataFromLastPosition(ref int lastPosition, int
return freqData;
}

public ChannelData[] ReadStageDataFromLastPosition(ref int lastPosition, int len, ref int stage)
public void ReadStageDataFromLastPosition(ref int stage)
{
this.rwLock.AcquireReaderLock(Timeout.Infinite);

ChannelData[] stageData = new ChannelData[len];

for (int i = lastPosition, j = 0; j < len && i < this.zeoMessages.Count; i++)
for (int i = this.zeoMessages.Count - 1; i > 0; i--)
{
ZeoMessage zeoMessage = this.zeoMessages[i];
stageData[j] = new ChannelData(2);
if (zeoMessage.SleepStage != null)
{
if (zeoMessage.SleepStage != ZeoSleepStage.Undefined & zeoMessage.SleepStage != ZeoSleepStage.Undefined0)
{
stage = -(int)zeoMessage.SleepStage;
}
stageData[j].Values[0] = -(int)zeoMessage.SleepStage;
stageData[j].Values[1] = zeoMessage.SoundAlarmVolume;
j++;
}
}

for (int i = 0; i < len; i++)
{
if (stageData[i] == null)
{
stageData[i] = new ChannelData(2);
stageData[i].Values[0] = -5;
stageData[i].Values[1] = ZeoMessage.MinSoundVolume;
}
else if (stageData[i].Values[0] == 0)
ZeoMessage zeoMessage = this.zeoMessages[i];
if (zeoMessage.SleepStage != null)
{
if (zeoMessage.SleepStage != ZeoSleepStage.Undefined & zeoMessage.SleepStage != ZeoSleepStage.Undefined0)
{
stageData[i].Values[0] = -5;
stageData[i].Values[1] = ZeoMessage.MinSoundVolume;
stage = -(int)zeoMessage.SleepStage;
break;
}
}
}

this.rwLock.ReleaseLock();

return stageData;
}

public ChannelData[] ReadEegFromLastPosition(ref int lastPosition, int len)

0 comments on commit 51778be

Please sign in to comment.