From ff2bd0a3bcd0877dc14ff3109158db1cdb7c5334 Mon Sep 17 00:00:00 2001 From: jsiegle <joshs@alleninstitute.org> Date: Fri, 19 Sep 2014 13:13:00 -0700 Subject: [PATCH] Fix problems with displaying channel numbers > 100 --- .../Processors/Editors/ChannelMappingEditor.cpp | 15 ++++++++++++++- Source/Processors/Editors/ElectrodeButtons.cpp | 5 +++++ Source/Processors/Editors/GenericEditor.cpp | 4 ++-- Source/Processors/FileReader.cpp | 2 +- .../Processors/Visualization/LfpDisplayCanvas.cpp | 12 +++++++++--- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Source/Processors/Editors/ChannelMappingEditor.cpp b/Source/Processors/Editors/ChannelMappingEditor.cpp index c18fa487b..6886d5a43 100644 --- a/Source/Processors/Editors/ChannelMappingEditor.cpp +++ b/Source/Processors/Editors/ChannelMappingEditor.cpp @@ -33,7 +33,7 @@ ChannelMappingEditor::ChannelMappingEditor(GenericProcessor* parentNode, bool us : GenericEditor(parentNode, useDefaultParameterEditors), previousChannelCount(0), isConfigured(false) { - desiredWidth = 340; + desiredWidth = 350; scrollDistance = 0; @@ -58,6 +58,19 @@ ChannelMappingEditor::ChannelMappingEditor(GenericProcessor* parentNode, bool us resetButton->setClickingTogglesState(false); resetButton->setEnabled(false); + // upButton = new TriangleButton(1); + // upButton->addListener(this); + // upButton->setBounds(285,10,10,8); + // addAndMakeVisible(upButton); + // upButton->setVisible(false); + + // downButton = new TriangleButton(2); + // downButton->addListener(this); + // downButton->setBounds(285,25,10,8); + // addAndMakeVisible(downButton); + // downButton->setVisible(false); + + // channelSelector->setRadioStatus(true); for (int i = 0 ; i < NUM_REFERENCES; i++) diff --git a/Source/Processors/Editors/ElectrodeButtons.cpp b/Source/Processors/Editors/ElectrodeButtons.cpp index 1cb20a654..01fa726a1 100644 --- a/Source/Processors/Editors/ElectrodeButtons.cpp +++ b/Source/Processors/Editors/ElectrodeButtons.cpp @@ -48,6 +48,11 @@ void ElectrodeButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDo g.setColour(Colours::grey); } + if (chan < 100) + g.setFont(10.f); + else + g.setFont(8.f); + if (chan >= 0) g.drawText(getButtonText(),0,0,getWidth(),getHeight(),Justification::centred,true); } diff --git a/Source/Processors/Editors/GenericEditor.cpp b/Source/Processors/Editors/GenericEditor.cpp index 0079d14a9..58b8e9d3c 100755 --- a/Source/Processors/Editors/GenericEditor.cpp +++ b/Source/Processors/Editors/GenericEditor.cpp @@ -961,13 +961,13 @@ void TriangleButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDow x2 = getWidth()/2; x3 = getWidth()-inset; - if (direction == 1) + if (direction == 1) // up { y1 = getHeight()-inset; y2 = inset; } - else + else if (direction == 2) // down { y1 = inset; y2 = getHeight()-inset; diff --git a/Source/Processors/FileReader.cpp b/Source/Processors/FileReader.cpp index b4c239f9b..d99534cc2 100644 --- a/Source/Processors/FileReader.cpp +++ b/Source/Processors/FileReader.cpp @@ -73,7 +73,7 @@ float FileReader::getDefaultSampleRate() int FileReader::getDefaultNumOutputs() { - return 16; + return 128; } float FileReader::getDefaultBitVolts() diff --git a/Source/Processors/Visualization/LfpDisplayCanvas.cpp b/Source/Processors/Visualization/LfpDisplayCanvas.cpp index b966c0222..4312c4e9c 100755 --- a/Source/Processors/Visualization/LfpDisplayCanvas.cpp +++ b/Source/Processors/Visualization/LfpDisplayCanvas.cpp @@ -1567,7 +1567,7 @@ LfpChannelDisplayInfo::LfpChannelDisplayInfo(LfpDisplayCanvas* canvas_, LfpDispl chan = ch; - enableButton = new UtilityButton("CH"+String(ch+1), Font("Small Text", 13, Font::plain)); + enableButton = new UtilityButton(String(ch+1), Font("Small Text", 13, Font::plain)); enableButton->setRadius(5.0f); enableButton->setEnabledState(true); @@ -1612,7 +1612,10 @@ void LfpChannelDisplayInfo::paint(Graphics& g) g.setColour(lineColour); - g.fillRoundedRectangle(5,center-8,41,22,8.0f); + //if (chan > 98) + // g.fillRoundedRectangle(5,center-8,51,22,8.0f); + //else + g.fillRoundedRectangle(5,center-8,41,22,8.0f); // g.setFont(channelFont); // g.setFont(channelHeightFloat*0.3); @@ -1626,7 +1629,10 @@ void LfpChannelDisplayInfo::resized() int center = getHeight()/2; - enableButton->setBounds(8,center-5,35,16); + //if (chan > 98) + // enableButton->setBounds(8,center-5,45,16); + //else + enableButton->setBounds(8,center-5,35,16); } -- GitLab