Skip to content

Commit ae85ed2

Browse files
authored
Merge pull request #1057 from OpenBCI/development
Second Team Review of 5.1.0
2 parents efddf87 + 1649690 commit ae85ed2

22 files changed

Lines changed: 165 additions & 65 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
* Update Band Power widget and add Average Band Power data type to Networking Widget
1818
* Update ControlP5 Library to 2.3.3 and change ScrollableList behavior to be more consistent with other front-end libraries
1919
* Remove old multi-line filter buttons in TopNav that draw incorrectly on some PCs #1013
20+
* Minor UI/UX improvements to Spectrogram widget to increase clarity for all users
21+
* Add slower options for FFT data smoothing
22+
* Fix certain Textfield and TextArea fonts not drawing correctly on some Macs
2023

2124
# v5.0.9
2225

OpenBCI_GUI/ADS1299SettingsController.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class ADS1299SettingsController {
387387
.setPosition(0, 0)
388388
.setCaptionLabel("")
389389
.setSize(120, 20)
390-
.setFont(f2)
390+
.setFont(createFont("Arial", 15, true))
391391
.setFocus(false)
392392
.setColor(color(26, 26, 26))
393393
.setColorBackground(color(255, 255, 255)) // text field bg color

OpenBCI_GUI/ConsoleLog.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ static class ConsoleWindow extends PApplet implements Runnable {
6565

6666
clipboardCopy = new ClipHelper();
6767
cp5 = new ControlP5(this);
68-
68+
PFont textAreaFont = createFont("Arial", 12, true);
6969
consoleTextArea = cp5.addTextarea("ConsoleWindow")
7070
.setPosition(0, headerHeight)
7171
.setSize(width, height - headerHeight)
72-
.setFont(p5)
72+
.setFont(textAreaFont)
7373
.setLineHeight(18)
7474
.setColor(color(242))
7575
.setColorBackground(color(42, 100))

OpenBCI_GUI/ControlPanel.pde

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,13 @@ class ControlPanel {
142142
public void open(){
143143
isOpen = true;
144144
topNav.controlPanelCollapser.setOn();
145+
topNav.setDropdownMenuIsOpen(true);
145146
}
146147

147148
public void close(){
148149
isOpen = false;
149150
topNav.controlPanelCollapser.setOff();
151+
topNav.setDropdownMenuIsOpen(false);
150152
}
151153

152154
public String getWifiSearchStyle() {
@@ -492,6 +494,7 @@ class SerialBox {
492494

493495
private void createAutoConnectButton(String name, String text, int _x, int _y, int _w, int _h) {
494496
autoConnectButton = createSBButton(name, text, _x, _y, _w, _h);
497+
autoConnectButton.setColorBackground(TURN_ON_GREEN);
495498
autoConnectButton.onRelease(new CallbackListener() {
496499
public void controlEvent(CallbackEvent theEvent) {
497500
controlPanel.comPortBox.attemptAutoConnectCyton();
@@ -999,7 +1002,7 @@ class WifiBox {
9991002
.setPosition(x + 90, y + 100)
10001003
.setCaptionLabel("")
10011004
.setSize(w - padding*2, 26)
1002-
.setFont(f2)
1005+
.setFont(createFont("Arial", 15, true))
10031006
.setFocus(false)
10041007
.setColor(color(26, 26, 26))
10051008
.setColorBackground(color(255, 255, 255)) // text field bg color
@@ -1295,7 +1298,7 @@ class SessionDataBox {
12951298
.setPosition(x + 60, y + 32)
12961299
.setCaptionLabel("")
12971300
.setSize(187, 26)
1298-
.setFont(f2)
1301+
.setFont(createFont("Arial", 15, true))
12991302
.setFocus(false)
13001303
.setColor(color(26, 26, 26))
13011304
.setColorBackground(color(255, 255, 255)) // text field bg color
@@ -2097,7 +2100,7 @@ class GaleaBox {
20972100
.setPosition(x + w - padding*2 - 60*2, y + 16 + padding*2)
20982101
.setCaptionLabel("")
20992102
.setSize(120 + padding, 26)
2100-
.setFont(f2)
2103+
.setFont(createFont("Arial", 15, true))
21012104
.setFocus(false)
21022105
.setColor(color(26, 26, 26))
21032106
.setColorBackground(color(255, 255, 255)) // text field bg color
@@ -2296,7 +2299,7 @@ class BrainFlowStreamerBox {
22962299
.setPosition(x + padding * 3, y + HEADER_H + padding*2)
22972300
.setCaptionLabel("")
22982301
.setSize(120, OBJECT_H)
2299-
.setFont(f2)
2302+
.setFont(createFont("Arial", 15, true))
23002303
.setFocus(false)
23012304
.setColor(color(26, 26, 26))
23022305
.setColorBackground(color(255, 255, 255)) // text field bg color
@@ -2327,7 +2330,7 @@ class BrainFlowStreamerBox {
23272330
.setPosition(x + padding*5 + w/2, y + HEADER_H + padding*2)
23282331
.setCaptionLabel("")
23292332
.setSize(50, OBJECT_H)
2330-
.setFont(f2)
2333+
.setFont(createFont("Arial", 15, true))
23312334
.setFocus(false)
23322335
.setColor(color(26, 26, 26))
23332336
.setColorBackground(color(255, 255, 255)) // text field bg color
@@ -2527,7 +2530,7 @@ class StreamingBoardBox {
25272530
.setPosition(x + padding * 3, y + headerH + padding*2)
25282531
.setCaptionLabel("")
25292532
.setSize(w / 3, objectH)
2530-
.setFont(f2)
2533+
.setFont(createFont("Arial", 15, true))
25312534
.setFocus(false)
25322535
.setColor(color(26, 26, 26))
25332536
.setColorBackground(color(255, 255, 255)) // text field bg color
@@ -2544,7 +2547,7 @@ class StreamingBoardBox {
25442547
.setPosition(x + padding*5 + w/2, y + headerH + padding*2)
25452548
.setCaptionLabel("")
25462549
.setSize(w / 5 + padding, objectH)
2547-
.setFont(f2)
2550+
.setFont(createFont("Arial", 15, true))
25482551
.setFocus(false)
25492552
.setColor(color(26, 26, 26))
25502553
.setColorBackground(color(255, 255, 255)) // text field bg color

OpenBCI_GUI/FilterUI.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ class FilterUIPopup extends PApplet implements Runnable {
315315
private void createAllCp5Objects() {
316316
calculateXYForHeaderColumnsAndFooter();
317317

318-
createFilterSettingsSaveButton("saveFilterSettingsButton", "Save Settings", footerObjX[0], footerObjY, headerObjWidth, uiObjectHeight);
319-
createFilterSettingsLoadButton("loadFilterSettingsButton", "Load Settings", footerObjX[1], footerObjY, headerObjWidth, uiObjectHeight);
320-
createFilterSettingsDefaultButton("defaultFilterSettingsButton", "Reset Settings", footerObjX[2], footerObjY, headerObjWidth, uiObjectHeight);
318+
createFilterSettingsSaveButton("saveFilterSettingsButton", "Save", footerObjX[0], footerObjY, headerObjWidth, uiObjectHeight);
319+
createFilterSettingsLoadButton("loadFilterSettingsButton", "Load", footerObjX[1], footerObjY, headerObjWidth, uiObjectHeight);
320+
createFilterSettingsDefaultButton("defaultFilterSettingsButton", "Reset", footerObjX[2], footerObjY, headerObjWidth, uiObjectHeight);
321321

322322
createOnOffButtons();
323323
createTextfields();

OpenBCI_GUI/Interactivity.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ synchronized void mousePressed() {
286286
//if clicked out of panel
287287
else {
288288
println("OpenBCI_GUI: mousePressed: outside of CP clicked");
289-
controlPanel.isOpen = false;
289+
controlPanel.close();
290290
topNav.controlPanelCollapser.setOff();
291291
}
292292
}

OpenBCI_GUI/OpenBCI_GUI.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ void introAnimation() {
10071007
if ((millis() >= settings.introAnimationInit + settings.introAnimationDuration)
10081008
&& controlPanel != null) {
10091009
systemMode = SYSTEMMODE_PREINIT;
1010-
controlPanel.isOpen = true;
1010+
controlPanel.open();
10111011
}
10121012
popStyle();
10131013
}

OpenBCI_GUI/PopupMessage.pde

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ class PopupMessage extends PApplet implements Runnable {
7474
.setFont(p1)
7575
.toUpperCase(false)
7676
.setSize(20)
77-
.setText(buttonMessage);
77+
.setText(buttonMessage)
78+
.getStyle()
79+
.setMarginTop(-2);
7880
}
7981

8082
@Override

OpenBCI_GUI/SessionSettings.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class SessionSettings {
129129
String[] fftMaxFrqArray = {"20 Hz", "40 Hz", "60 Hz", "100 Hz", "120 Hz", "250 Hz", "500 Hz", "800 Hz"};
130130
String[] fftVertScaleArray = {"10 uV", "50 uV", "100 uV", "1000 uV"};
131131
String[] fftLogLinArray = {"Log", "Linear"}; //share this with spectrogram also
132-
String[] fftSmoothingArray = {"0.0", "0.5", "0.75", "0.9", "0.95", "0.98"};
132+
String[] fftSmoothingArray = {"0.0", "0.5", "0.75", "0.9", "0.95", "0.98", "0.99", "0.999"};
133133
String[] fftFilterArray = {"Filtered", "Unfilt."};
134134

135135
//Used to set text in dropdown menus when loading Accelerometer settings
@@ -159,7 +159,7 @@ class SessionSettings {
159159

160160
//Used to set text in dropdown menus when loading Spectrogram Setings
161161
String[] spectMaxFrqArray = {"20 Hz", "40 Hz", "60 Hz", "100 Hz", "120 Hz", "250 Hz"};
162-
String[] spectSampleRateArray = {"1 Hz", "5 hz", "10 Hz", "20 Hz", "40 Hz"};
162+
String[] spectSampleRateArray = {"30 Min.", "6 Min.", "3 Min.", "1.5 Min.", "1 Min."};
163163

164164
//Load Accel. dropdown variables
165165
int loadAccelVertScale;

OpenBCI_GUI/TopNav.pde

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class TopNav {
5252
private final int SUBNAV_BUT_H = 26;
5353
private final int TOPNAV_BUT_H = SUBNAV_BUT_H;
5454

55+
private boolean topNavDropdownMenuIsOpen = false;
56+
5557
TopNav() {
5658
int controlPanel_W = 256;
5759

@@ -97,7 +99,7 @@ class TopNav {
9799
if (needToMakeSmoothingButton) {
98100
int pos_x = (int)filtersButton.getPosition()[0] + filtersButton.getWidth() + PAD_3;
99101
//Make smoothing button wider than most other topnav buttons to fit text comfortably
100-
createSmoothingButton(getSmoothingString(), pos_x, SUBNAV_BUT_Y, SUBNAV_BUT_W + 40, SUBNAV_BUT_H, h4, 14, SUBNAV_LIGHTBLUE, WHITE);
102+
createSmoothingButton(getSmoothingString(), pos_x, SUBNAV_BUT_Y, SUBNAV_BUT_W + 48, SUBNAV_BUT_H, h4, 14, SUBNAV_LIGHTBLUE, WHITE);
101103
}
102104

103105

@@ -469,7 +471,7 @@ class TopNav {
469471
//make Help button and Settings button mutually exclusive
470472
if (!tutorialSelector.isVisible) {
471473
configSelector.toggleVisibility();
472-
}
474+
}
473475
}
474476
});
475477
settingsButton.setDescription("Save and Load GUI Settings! Click Default to revert to factory settings.");
@@ -528,6 +530,14 @@ class TopNav {
528530
toggleDataStreamingButton.setLock(_b);
529531
filtersButton.setLock(_b);
530532
}
533+
534+
public boolean getDropdownMenuIsOpen() {
535+
return topNavDropdownMenuIsOpen;
536+
}
537+
538+
public void setDropdownMenuIsOpen(boolean b) {
539+
topNavDropdownMenuIsOpen = b;
540+
}
531541
}
532542

533543
class LayoutSelector {
@@ -621,6 +631,7 @@ class LayoutSelector {
621631

622632
void toggleVisibility() {
623633
isVisible = !isVisible;
634+
topNav.setDropdownMenuIsOpen(isVisible);
624635
if (isVisible) {
625636
//the very convoluted way of locking all controllers of a single controlP5 instance...
626637
for (int i = 0; i < wm.widgets.size(); i++) {
@@ -804,6 +815,7 @@ class ConfigSelector {
804815

805816
void toggleVisibility() {
806817
isVisible = !isVisible;
818+
topNav.setDropdownMenuIsOpen(isVisible);
807819
if (systemMode >= SYSTEMMODE_POSTINIT) {
808820
if (isVisible) {
809821
//the very convoluted way of locking all controllers of a single controlP5 instance...
@@ -1049,6 +1061,7 @@ class TutorialSelector {
10491061

10501062
void toggleVisibility() {
10511063
isVisible = !isVisible;
1064+
topNav.setDropdownMenuIsOpen(isVisible);
10521065
if (systemMode >= SYSTEMMODE_POSTINIT) {
10531066
if (isVisible) {
10541067
//the very convoluted way of locking all controllers of a single controlP5 instance...

0 commit comments

Comments
 (0)