Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
0730a038
Commit
0730a038
authored
12 years ago
by
jsiegle
Browse files
Options
Downloads
Patches
Plain Diff
RHD2000Thread is working for 32 channels
parent
78a5a7e9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/DataThreads/RHD2000Thread.cpp
+19
-11
19 additions, 11 deletions
Source/Processors/DataThreads/RHD2000Thread.cpp
Source/Processors/DataThreads/RHD2000Thread.h
+2
-0
2 additions, 0 deletions
Source/Processors/DataThreads/RHD2000Thread.h
with
21 additions
and
11 deletions
Source/Processors/DataThreads/RHD2000Thread.cpp
+
19
−
11
View file @
0730a038
...
...
@@ -47,9 +47,13 @@ RHD2000Thread::RHD2000Thread(SourceNode* sn) : DataThread(sn)
// Initialize board.
evalBoard
->
initialize
();
evalBoard
->
setDataSource
(
0
,
Rhd2000EvalBoard
::
PortA1
);
evalBoard
->
setDataSource
(
1
,
Rhd2000EvalBoard
::
PortB1
);
evalBoard
->
setContinuousRunMode
(
false
);
numChannels
=
32
;
numChannelsPerDataStream
.
add
(
32
);
numChannelsPerDataStream
.
add
(
32
);
numChannels
=
64
;
// Select per-channel amplifier sampling rate.
evalBoard
->
setSampleRate
(
Rhd2000EvalBoard
::
SampleRate10000Hz
);
...
...
@@ -57,6 +61,7 @@ RHD2000Thread::RHD2000Thread(SourceNode* sn) : DataThread(sn)
// Now that we have set our sampling rate, we can set the MISO sampling delay
// which is dependent on the sample rate. We assume a 3-foot cable.
evalBoard
->
setCableLengthFeet
(
Rhd2000EvalBoard
::
PortA
,
3.0
);
evalBoard
->
setCableLengthFeet
(
Rhd2000EvalBoard
::
PortB
,
3.0
);
// Let's turn one LED on to indicate that the program is running.
int
ledArray
[
8
]
=
{
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
...
...
@@ -99,7 +104,7 @@ RHD2000Thread::~RHD2000Thread() {
int
RHD2000Thread
::
getNumChannels
()
{
return
32
;
return
numChannels
;
}
int
RHD2000Thread
::
getNumEventChannels
()
...
...
@@ -142,16 +147,15 @@ bool RHD2000Thread::startAcquisition()
std
::
cout
<<
"Setting max timestep."
<<
std
::
endl
;
evalBoard
->
setMaxTimeStep
(
100
);
//
evalBoard->setMaxTimeStep(100);
evalBoard
->
setContinuousRunMode
(
true
);
std
::
cout
<<
"Starting acquisition."
<<
std
::
endl
;
evalBoard
->
run
();
blockSize
=
dataBlock
->
calculateDataBlockSizeInWords
(
evalBoard
->
getNumEnabledDataStreams
());
blockSize
=
dataBlock
->
calculateDataBlockSizeInWords
(
evalBoard
->
getNumEnabledDataStreams
());
startThread
();
startThread
();
// isTransmitting = true;
...
...
@@ -191,9 +195,8 @@ bool RHD2000Thread::updateBuffer()
//cout << "Block size: " << blockSize << endl;
bool
return_code
;
int
lastBlock
;
for
(
int
n
=
0
;
n
<
1
;
n
++
)
for
(
int
n
=
0
;
n
<
1
0
;
n
++
)
{
if
(
evalBoard
->
numWordsInFifo
()
>=
blockSize
)
{
...
...
@@ -203,12 +206,17 @@ bool RHD2000Thread::updateBuffer()
for
(
int
samp
=
0
;
samp
<
dataBlock
->
getSamplesPerDataBlock
();
samp
++
)
{
for
(
int
chan
=
0
;
chan
<
numChannels
;
chan
++
)
for
(
int
dataStream
=
0
;
dataStream
<
1
;
dataStream
++
)
{
int
value
=
dataBlock
->
amplifierData
[
0
][
chan
][
samp
];
for
(
int
chan
=
0
;
chan
<
numChannelsPerDataStream
[
dataStream
];
chan
++
)
{
int
value
=
dataBlock
->
amplifierData
[
dataStream
][
chan
][
samp
];
thisSample
[
chan
]
=
float
(
value
-
32768
)
*
0.195
f
;
}
thisSample
[
chan
]
=
double
(
value
)
*
0.01
;
}
timestamp
=
dataBlock
->
timeStamp
[
samp
];
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/DataThreads/RHD2000Thread.h
+
2
−
0
View file @
0730a038
...
...
@@ -72,6 +72,8 @@ private:
ScopedPointer
<
Rhd2000Registers
>
chipRegisters
;
ScopedPointer
<
Rhd2000DataBlock
>
dataBlock
;
Array
<
int
>
numChannelsPerDataStream
;
int
numChannels
;
bool
deviceFound
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment