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
da4c59b5
Commit
da4c59b5
authored
11 years ago
by
jsiegle
Browse files
Options
Downloads
Patches
Plain Diff
Remove inappropriate scaling from LfpDisplayCanvas::updateScreenBuffer. Closes #30
parent
1ebc88a4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/Processors/Visualization/LfpDisplayCanvas.cpp
+30
-30
30 additions, 30 deletions
Source/Processors/Visualization/LfpDisplayCanvas.cpp
with
30 additions
and
30 deletions
Source/Processors/Visualization/LfpDisplayCanvas.cpp
+
30
−
30
View file @
da4c59b5
...
...
@@ -277,8 +277,6 @@ void LfpDisplayCanvas::updateScreenBuffer()
for
(
int
channel
=
0
;
channel
<
nChans
;
channel
++
)
{
gain
=
1.0
f
/
(
processor
->
channels
[
channel
]
->
bitVolts
*
float
(
0x7fff
));
screenBuffer
->
addFrom
(
channel
,
// destChannel
screenBufferIndex
,
// destStartSample
displayBuffer
->
getSampleData
(
channel
,
displayBufferIndex
),
// source
...
...
@@ -696,38 +694,38 @@ void LfpChannelDisplay::paint(Graphics& g)
{
// drawLine makes for nice anti-aliased plots, but is pretty slow
g
.
drawLine
(
i
,
(
canvas
->
getYCoord
(
chan
,
i
)
/
range
*
channelHeightFloat
)
+
getHeight
()
/
2
,
i
+
stepSize
,
(
canvas
->
getYCoord
(
chan
,
i
+
stepSize
)
/
range
*
channelHeightFloat
)
+
getHeight
()
/
2
);
//
g.drawLine(i,
//
(canvas->getYCoord(chan, i)/range*channelHeightFloat)+getHeight()/2,
//
i+stepSize,
//
(canvas->getYCoord(chan, i+stepSize)/range*channelHeightFloat)+getHeight()/2);
// // pixel wise line plot has no anti-aliasing, but runs much faster
//
double a = (canvas->getYCoord(chan, i)/range*channelHeightFloat)+getHeight()/2;
//
double b = (canvas->getYCoord(chan, i+stepSize)/range*channelHeightFloat)+getHeight()/2;
//
if (a<b){
//
from = (a);
//
to = (b);
//
} else {
//
from = (b);
//
to = (a);
//
}
double
a
=
(
canvas
->
getYCoord
(
chan
,
i
)
/
range
*
channelHeightFloat
)
+
getHeight
()
/
2
;
double
b
=
(
canvas
->
getYCoord
(
chan
,
i
+
stepSize
)
/
range
*
channelHeightFloat
)
+
getHeight
()
/
2
;
if
(
a
<
b
){
from
=
(
a
);
to
=
(
b
);
}
else
{
from
=
(
b
);
to
=
(
a
);
}
//
if ((to-from) < 40){ // if there is too much vertical range in one pixel, don't draw the full line for speed reasons
//
for (int j = from; j <= to; j += 1)
//
{
//
g.setPixel(i,j);
//
}
//
} else if ((to-from) < 100){
//
for (int j = from; j <= to; j += 2)
//
{
//
g.setPixel(i,j);
//
}
//
} else {
//
g.setPixel(i,to);
//
g.setPixel(i,from);
//
}
if
((
to
-
from
)
<
40
){
// if there is too much vertical range in one pixel, don't draw the full line for speed reasons
for
(
int
j
=
from
;
j
<=
to
;
j
+=
1
)
{
g
.
setPixel
(
i
,
j
);
}
}
else
if
((
to
-
from
)
<
100
){
for
(
int
j
=
from
;
j
<=
to
;
j
+=
2
)
{
g
.
setPixel
(
i
,
j
);
}
}
else
{
g
.
setPixel
(
i
,
to
);
g
.
setPixel
(
i
,
from
);
}
...
...
@@ -746,6 +744,8 @@ void LfpChannelDisplay::paint(Graphics& g)
void
LfpChannelDisplay
::
setRange
(
float
r
)
{
range
=
r
;
//std::cout << "Range: " << r << std::endl;
}
void
LfpChannelDisplay
::
select
()
...
...
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