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
cde648d3
Commit
cde648d3
authored
11 years ago
by
Jakob Voigts
Browse files
Options
Downloads
Patches
Plain Diff
added channel height selection
used the term 'spread' as in the neuralynx software for now
parent
7c0355b3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/Visualization/LfpDisplayCanvas.cpp
+42
-0
42 additions, 0 deletions
Source/Processors/Visualization/LfpDisplayCanvas.cpp
Source/Processors/Visualization/LfpDisplayCanvas.h
+4
-0
4 additions, 0 deletions
Source/Processors/Visualization/LfpDisplayCanvas.h
with
46 additions
and
0 deletions
Source/Processors/Visualization/LfpDisplayCanvas.cpp
+
42
−
0
View file @
cde648d3
...
...
@@ -69,6 +69,15 @@ LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) :
timebases
.
add
(
"5.0"
);
timebases
.
add
(
"10.0"
);
spreads
.
add
(
"10"
);
spreads
.
add
(
"20"
);
spreads
.
add
(
"30"
);
spreads
.
add
(
"40"
);
spreads
.
add
(
"50"
);
spreads
.
add
(
"60"
);
rangeSelection
=
new
ComboBox
(
"Voltage range"
);
rangeSelection
->
addItemList
(
voltageRanges
,
1
);
rangeSelection
->
setSelectedId
(
4
,
false
);
...
...
@@ -81,6 +90,14 @@ LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) :
timebaseSelection
->
addListener
(
this
);
addAndMakeVisible
(
timebaseSelection
);
spreadSelection
=
new
ComboBox
(
"Spread"
);
spreadSelection
->
addItemList
(
spreads
,
1
);
spreadSelection
->
setSelectedId
(
5
,
false
);
spreadSelection
->
addListener
(
this
);
addAndMakeVisible
(
spreadSelection
);
lfpDisplay
->
setNumChannels
(
nChans
);
lfpDisplay
->
setRange
(
1000.0
f
);
...
...
@@ -102,6 +119,7 @@ void LfpDisplayCanvas::resized()
rangeSelection
->
setBounds
(
5
,
getHeight
()
-
30
,
100
,
25
);
timebaseSelection
->
setBounds
(
175
,
getHeight
()
-
30
,
100
,
25
);
spreadSelection
->
setBounds
(
345
,
getHeight
()
-
30
,
100
,
25
);
}
...
...
@@ -152,6 +170,13 @@ void LfpDisplayCanvas::comboBoxChanged(ComboBox* cb)
lfpDisplay
->
setRange
(
voltageRanges
[
cb
->
getSelectedId
()
-
1
].
getFloatValue
());
//std::cout << "Setting range to " << voltageRanges[cb->getSelectedId()-1].getFloatValue() << std::endl;
}
else
if
(
cb
==
spreadSelection
)
{
//spread = spreads[cb->getSelectedId()-1].getFloatValue();
lfpDisplay
->
setChannelHeight
(
spreads
[
cb
->
getSelectedId
()
-
1
].
getFloatValue
());
lfpDisplay
->
resized
();
std
::
cout
<<
"Setting spread to "
<<
spreads
[
cb
->
getSelectedId
()
-
1
].
getFloatValue
()
<<
std
::
endl
;
}
timescale
->
setTimebase
(
timebase
);
}
...
...
@@ -333,6 +358,7 @@ void LfpDisplayCanvas::paint(Graphics& g)
g
.
drawText
(
"Voltage range (uV)"
,
5
,
getHeight
()
-
55
,
300
,
20
,
Justification
::
left
,
false
);
g
.
drawText
(
"Timebase (s)"
,
175
,
getHeight
()
-
55
,
300
,
20
,
Justification
::
left
,
false
);
g
.
drawText
(
"Spread (px)"
,
345
,
getHeight
()
-
55
,
300
,
20
,
Justification
::
left
,
false
);
}
...
...
@@ -351,8 +377,10 @@ void LfpDisplayCanvas::saveVisualizerParameters(XmlElement* xml)
XmlElement
*
xmlNode
=
xml
->
createNewChildElement
(
"LFPDISPLAY"
);
xmlNode
->
setAttribute
(
"Range"
,
rangeSelection
->
getSelectedId
());
xmlNode
->
setAttribute
(
"Timebase"
,
timebaseSelection
->
getSelectedId
());
xmlNode
->
setAttribute
(
"Spread"
,
spreadSelection
->
getSelectedId
());
xmlNode
->
setAttribute
(
"ScrollX"
,
viewport
->
getViewPositionX
());
xmlNode
->
setAttribute
(
"ScrollY"
,
viewport
->
getViewPositionY
());
...
...
@@ -367,6 +395,8 @@ void LfpDisplayCanvas::loadVisualizerParameters(XmlElement* xml)
{
rangeSelection
->
setSelectedId
(
xmlNode
->
getIntAttribute
(
"Range"
));
timebaseSelection
->
setSelectedId
(
xmlNode
->
getIntAttribute
(
"Timebase"
));
spreadSelection
->
setSelectedId
(
xmlNode
->
getIntAttribute
(
"Spread"
));
viewport
->
setViewPosition
(
xmlNode
->
getIntAttribute
(
"ScrollX"
),
xmlNode
->
getIntAttribute
(
"ScrollY"
));
}
...
...
@@ -559,6 +589,18 @@ void LfpDisplay::setRange(float r)
}
void
LfpDisplay
::
setChannelHeight
(
float
r
)
{
for
(
int
i
=
0
;
i
<
numChans
;
i
++
)
{
channels
[
i
]
->
setChannelHeight
(
r
);
}
}
void
LfpDisplay
::
mouseDown
(
const
MouseEvent
&
event
)
{
//int x = event.getMouseDownX();
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/Visualization/LfpDisplayCanvas.h
+
4
−
0
View file @
cde648d3
...
...
@@ -85,6 +85,7 @@ private:
float
timebase
;
float
displayGain
;
float
timeOffset
;
float
spread
;
// vertical spacing between channels
static
const
int
MAX_N_CHAN
=
256
;
// maximum number of channels
static
const
int
MAX_N_SAMP
=
5000
;
// maximum display size in pixels
...
...
@@ -101,9 +102,11 @@ private:
ScopedPointer
<
ComboBox
>
timebaseSelection
;
ScopedPointer
<
ComboBox
>
rangeSelection
;
ScopedPointer
<
ComboBox
>
spreadSelection
;
StringArray
voltageRanges
;
StringArray
timebases
;
StringArray
spreads
;
// option for vertical spacing between channels
void
refreshScreenBuffer
();
void
updateScreenBuffer
();
...
...
@@ -162,6 +165,7 @@ public:
void
mouseDown
(
const
MouseEvent
&
event
);
void
setRange
(
float
range
);
void
setChannelHeight
(
float
r
);
private
:
int
numChans
;
...
...
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