Skip to content

Commit

Permalink
release v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
swharden committed Feb 18, 2019
1 parent 7421e24 commit 0db7a15
Show file tree
Hide file tree
Showing 17 changed files with 359 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/SoundCardECG/ECG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class ECG
int bufferIndex = 0;
int buffersCaptured = 0;
public int beatThreshold = 3500;
public double signalMultiple = 1;

public List<double> beatTimes = new List<double>();
public List<double> beatRates = new List<double>();
Expand Down Expand Up @@ -77,7 +78,7 @@ private void OnDataAvailable(object sender, NAudio.Wave.WaveInEventArgs args)
int valuesInBuffer = args.BytesRecorded / bytesPerValue;
double[] bufferValues = new double[valuesInBuffer];
for (int i = 0; i < valuesInBuffer; i++)
bufferValues[i] = BitConverter.ToInt16(args.Buffer, i * bytesPerValue);
bufferValues[i] = BitConverter.ToInt16(args.Buffer, i * bytesPerValue) * signalMultiple;

// determine if a heartbeat occured
int j = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/SoundCardECG/FormAbout.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions src/SoundCardECG/FormAbout.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,81 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAKoBAACqAQAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA/////8f7/++H+//vg/v/7+Bj/8/hAYEH4cAAA+HgPkPB8D/LwfJ/y8Hy
f8/A8//PwPP/z8Dz/8/h8//P4fP/z+Hz/8/h8//P4fP/z+H////h////4f/Hj+GBAgPhgAID4Y44A+GA
PEPhgDh74YAAA/+BAgP/gceH//////////8=
</value>
</data>
</root>
35 changes: 28 additions & 7 deletions src/SoundCardECG/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions src/SoundCardECG/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ public FormMain()

private void FormMain_Load(object sender, EventArgs e)
{
//SelectSoundCard();
SelectSoundCard();
StartListening();
}

private void SelectSoundCard()
{
int deviceNumber;

using (FormSoundCard frm = new FormSoundCard())
{
frm.ShowDialog();
Expand All @@ -44,7 +42,7 @@ private void SelectSoundCard()
StartListening();
}

public int deviceNumber;
public int deviceNumber = 1;
private void StartListening()
{
// stop the old listener if it's running
Expand Down Expand Up @@ -105,8 +103,8 @@ private void timerRenderGraph_Tick(object sender, EventArgs e)
scottPlotUC2.plt.data.AddScatter(ecg.beatTimes.ToArray(), ecg.beatRates.ToArray());
if (cbAutoscale.Checked)
scottPlotUC2.plt.settings.AxisFit();
scottPlotUC2.Render();
lblBmp.Text = string.Format("{0:0.0} BPM", ecg.beatRates[ecg.beatRates.Count - 1]);
scottPlotUC2.Render();
}

Application.DoEvents();
Expand Down Expand Up @@ -212,5 +210,12 @@ private void saveCSVToolStripMenuItem_Click(object sender, EventArgs e)

#endregion

private void invertSignalToolStripMenuItem_Click(object sender, EventArgs e)
{
if (invertSignalToolStripMenuItem.Checked)
ecg.signalMultiple = -1;
else
ecg.signalMultiple = 1;
}
}
}
Loading

0 comments on commit 0db7a15

Please sign in to comment.