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
d3a3d992
Commit
d3a3d992
authored
10 years ago
by
Aaron Cuevas Lopez
Browse files
Options
Downloads
Patches
Plain Diff
Add buttons to select channel type for voltage range in Lfp viewer
parent
9a13283f
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/LfpDisplayNode/LfpDisplayCanvas.cpp
+59
-3
59 additions, 3 deletions
Source/Processors/LfpDisplayNode/LfpDisplayCanvas.cpp
Source/Processors/LfpDisplayNode/LfpDisplayCanvas.h
+3
-1
3 additions, 1 deletion
Source/Processors/LfpDisplayNode/LfpDisplayCanvas.h
with
62 additions
and
4 deletions
Source/Processors/LfpDisplayNode/LfpDisplayCanvas.cpp
+
59
−
3
View file @
d3a3d992
...
...
@@ -69,6 +69,8 @@ LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) :
addAndMakeVisible
(
viewport
);
addAndMakeVisible
(
timescale
);
UtilityButton
*
tbut
;
//Ranges for neural data
voltageRanges
[
DATA_CHANNEL
].
add
(
"25"
);
voltageRanges
[
DATA_CHANNEL
].
add
(
"50"
);
...
...
@@ -86,6 +88,15 @@ LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) :
rangeSteps
[
DATA_CHANNEL
]
=
10
;
rangeUnits
.
add
(
"uV"
);
typeNames
.
add
(
"DATA"
);
tbut
=
new
UtilityButton
(
"DATA"
,
Font
(
"Small Text"
,
9
,
Font
::
plain
));
tbut
->
setEnabledState
(
true
);
tbut
->
setCorners
(
false
,
false
,
false
,
false
);
tbut
->
addListener
(
this
);
tbut
->
setClickingTogglesState
(
true
);
tbut
->
setRadioGroupId
(
100
,
dontSendNotification
);
tbut
->
setToggleState
(
true
,
dontSendNotification
);
addAndMakeVisible
(
tbut
);
typeButtons
.
add
(
tbut
);
//Ranges for AUX/accelerometer data
...
...
@@ -104,6 +115,15 @@ LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) :
rangeSteps
[
AUX_CHANNEL
]
=
10
;
rangeUnits
.
add
(
"uV"
);
typeNames
.
add
(
"AUX"
);
tbut
=
new
UtilityButton
(
"AUX"
,
Font
(
"Small Text"
,
9
,
Font
::
plain
));
tbut
->
setEnabledState
(
true
);
tbut
->
setCorners
(
false
,
false
,
false
,
false
);
tbut
->
addListener
(
this
);
tbut
->
setClickingTogglesState
(
true
);
tbut
->
setRadioGroupId
(
100
,
dontSendNotification
);
tbut
->
setToggleState
(
false
,
dontSendNotification
);
addAndMakeVisible
(
tbut
);
typeButtons
.
add
(
tbut
);
//Ranges for ADC data
voltageRanges
[
ADC_CHANNEL
].
add
(
"0.01"
);
...
...
@@ -119,6 +139,15 @@ LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) :
rangeSteps
[
ADC_CHANNEL
]
=
0.1
;
//in V
rangeUnits
.
add
(
"V"
);
typeNames
.
add
(
"ADC"
);
tbut
=
new
UtilityButton
(
"ADC"
,
Font
(
"Small Text"
,
9
,
Font
::
plain
));
tbut
->
setEnabledState
(
true
);
tbut
->
setCorners
(
false
,
false
,
false
,
false
);
tbut
->
addListener
(
this
);
tbut
->
setClickingTogglesState
(
true
);
tbut
->
setRadioGroupId
(
100
,
dontSendNotification
);
tbut
->
setToggleState
(
false
,
dontSendNotification
);
addAndMakeVisible
(
tbut
);
typeButtons
.
add
(
tbut
);
selectedVoltageRangeValues
[
DATA_CHANNEL
]
=
voltageRanges
[
DATA_CHANNEL
][
selectedVoltageRange
[
DATA_CHANNEL
]
-
1
];
selectedVoltageRangeValues
[
AUX_CHANNEL
]
=
voltageRanges
[
AUX_CHANNEL
][
selectedVoltageRange
[
AUX_CHANNEL
]
-
1
];
...
...
@@ -273,6 +302,11 @@ void LfpDisplayCanvas::resized()
eventDisplayInterfaces
[
i
]
->
repaint
();
}
int
bh
=
25
/
typeButtons
.
size
();
for
(
int
i
=
0
;
i
<
typeButtons
.
size
();
i
++
)
{
typeButtons
[
i
]
->
setBounds
(
110
,
getHeight
()
-
30
+
i
*
bh
,
50
,
bh
);
}
// std::cout << "Canvas thinks LfpDisplay should be this high: "
// << lfpDisplay->getTotalHeight() << std::endl;
...
...
@@ -346,15 +380,31 @@ void LfpDisplayCanvas::buttonClicked(Button* b)
if
(
b
==
invertInputButton
)
{
lfpDisplay
->
setInputInverted
(
b
->
getToggleState
());
return
;
}
if
(
b
==
drawMethodButton
)
{
lfpDisplay
->
setDrawMethod
(
b
->
getToggleState
());
return
;
}
if
(
b
==
pauseButton
)
{
lfpDisplay
->
isPaused
=
b
->
getToggleState
();
return
;
}
int
idx
=
typeButtons
.
indexOf
((
UtilityButton
*
)
b
);
if
((
idx
>=
0
)
&&
(
b
->
getToggleState
()))
{
for
(
int
i
=
0
;
i
<
processor
->
getNumInputs
();
i
++
)
{
if
(
lfpDisplay
->
channels
[
i
]
->
getSelected
())
{
lfpDisplay
->
channels
[
i
]
->
deselect
();
lfpDisplay
->
channels
[
i
]
->
repaint
();
}
}
setSelectedType
((
channelType
)
idx
,
false
);
}
}
...
...
@@ -798,7 +848,7 @@ void LfpDisplayCanvas::paint(Graphics& g)
g
.
drawText
(
"Spread (px)"
,
345
,
getHeight
()
-
55
,
300
,
20
,
Justification
::
left
,
false
);
g
.
drawText
(
"Color grouping"
,
620
,
getHeight
()
-
55
,
300
,
20
,
Justification
::
left
,
false
);
g
.
drawText
(
typeNames
[
selectedChannelType
],
110
,
getHeight
()
-
30
,
50
,
20
,
Justification
::
centredLeft
,
false
);
//
g.drawText(typeNames[selectedChannelType],110,getHeight()-30,50,20,Justification::centredLeft,false);
g
.
drawText
(
"Event disp."
,
500
,
getHeight
()
-
55
,
300
,
20
,
Justification
::
left
,
false
);
...
...
@@ -965,7 +1015,7 @@ channelType LfpDisplayCanvas::getSelectedType()
return
selectedChannelType
;
}
void
LfpDisplayCanvas
::
setSelectedType
(
channelType
type
)
void
LfpDisplayCanvas
::
setSelectedType
(
channelType
type
,
bool
toggleButton
)
{
if
(
selectedChannelType
==
type
)
return
;
//Nothing to do here
...
...
@@ -977,7 +1027,8 @@ void LfpDisplayCanvas::setSelectedType(channelType type)
rangeSelection
->
setSelectedId
(
id
,
sendNotification
);
else
rangeSelection
->
setText
(
selectedVoltageRangeValues
[
selectedChannelType
],
dontSendNotification
);
repaint
(
5
,
getHeight
()
-
55
,
300
,
100
);
if
(
toggleButton
)
typeButtons
[
type
]
->
setToggleState
(
true
,
dontSendNotification
);
}
String
LfpDisplayCanvas
::
getTypeName
(
channelType
type
)
...
...
@@ -1788,6 +1839,11 @@ void LfpChannelDisplay::deselect()
isSelected
=
false
;
}
bool
LfpChannelDisplay
::
getSelected
()
{
return
isSelected
;
}
void
LfpChannelDisplay
::
setColour
(
Colour
c
)
{
lineColour
=
c
;
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/LfpDisplayNode/LfpDisplayCanvas.h
+
3
−
1
View file @
d3a3d992
...
...
@@ -103,7 +103,7 @@ public:
String
getTypeName
(
channelType
type
);
int
getRangeStep
(
channelType
type
);
void
setSelectedType
(
channelType
type
);
void
setSelectedType
(
channelType
type
,
bool
toggleButton
=
true
);
//void scrollBarMoved(ScrollBar *scrollBarThatHasMoved, double newRangeStart);
...
...
@@ -150,6 +150,7 @@ private:
ScopedPointer
<
UtilityButton
>
invertInputButton
;
ScopedPointer
<
UtilityButton
>
drawMethodButton
;
ScopedPointer
<
UtilityButton
>
pauseButton
;
OwnedArray
<
UtilityButton
>
typeButtons
;
StringArray
voltageRanges
[
CHANNEL_TYPES
];
StringArray
timebases
;
...
...
@@ -289,6 +290,7 @@ public:
void
select
();
void
deselect
();
bool
getSelected
();
void
setName
(
String
);
...
...
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