Skip to content

Commit d5d0593

Browse files
authored
Merge pull request #1060 from OpenBCI/team-review-4-5.1.0
Team review 4 5.1.0
2 parents ca3c4e9 + 5382b3f commit d5d0593

16 files changed

Lines changed: 131 additions & 50 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Revisit Ganglion Impedance widget so it behaves like new Cyton Impedance Widget #1021
66
* Fix dropdown backgrounds in Networking Widget
77
* Update priveleges for Windows users and check if GUI has been run as Administrator
8+
* Fix High DPI scaling on some Macs with Retina Display
89

910
### Improvements
1011
* Add new FilterUI to allow custom filters per channel #988
@@ -22,6 +23,7 @@
2223
* Fix certain Textfield and TextArea fonts not drawing correctly on some Macs
2324
* Update and enforce style guide throughout the GUI in preparation for multiple themes
2425
* Improve UI/UX for HelpWidget at the bottom of the GUI to make it more noticeable
26+
* Print OS Name and Version to Console Log on app start
2527

2628
# v5.0.9
2729

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(createFont("Arial", 15, true))
390+
.setFont(f2)
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ static class ConsoleWindow extends PApplet implements Runnable {
9494

9595
void createConsoleLogButton (String bName, String bText, int x) {
9696
int y = 4; // vertical position for button
97+
PFont buttonFont = createFont("Arial", 14, true);
9798
cp5.addButton(bName)
9899
.setPosition(x, y)
99100
.setSize(buttonWidth, buttonHeight)
@@ -102,7 +103,7 @@ static class ConsoleWindow extends PApplet implements Runnable {
102103
.setColorBackground(color(144, 100));
103104
cp5.getController(bName)
104105
.getCaptionLabel()
105-
.setFont(p4)
106+
.setFont(buttonFont)
106107
.toUpperCase(false)
107108
.setText(bText);
108109
}

OpenBCI_GUI/ControlPanel.pde

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,12 +1002,12 @@ class WifiBox {
10021002
.setPosition(x + 90, y + 100)
10031003
.setCaptionLabel("")
10041004
.setSize(w - padding*2, 26)
1005-
.setFont(createFont("Arial", 15, true))
1005+
.setFont(f2)
10061006
.setFocus(false)
10071007
.setColor(color(26, 26, 26))
10081008
.setColorBackground(color(255, 255, 255)) // text field bg color
10091009
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
1010-
.setColorForeground(isSelected_color) // border color when not selected
1010+
.setColorForeground(OPENBCI_DARKBLUE) // border color when not selected
10111011
.setColorActive(isSelected_color) // border color when selected
10121012
.setColorCursor(color(26, 26, 26))
10131013
.setText(wifi_ipAddress)
@@ -1298,12 +1298,12 @@ class SessionDataBox {
12981298
.setPosition(x + 60, y + 32)
12991299
.setCaptionLabel("")
13001300
.setSize(187, 26)
1301-
.setFont(createFont("Arial", 15, true))
1301+
.setFont(f2)
13021302
.setFocus(false)
13031303
.setColor(color(26, 26, 26))
13041304
.setColorBackground(color(255, 255, 255)) // text field bg color
13051305
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
1306-
.setColorForeground(isSelected_color) // border color when not selected
1306+
.setColorForeground(OPENBCI_DARKBLUE) // border color when not selected
13071307
.setColorActive(isSelected_color) // border color when selected
13081308
.setColorCursor(color(26, 26, 26))
13091309
.setText(directoryManager.getFileNameDateTime())
@@ -2100,12 +2100,12 @@ class GaleaBox {
21002100
.setPosition(x + w - padding*2 - 60*2, y + 16 + padding*2)
21012101
.setCaptionLabel("")
21022102
.setSize(120 + padding, 26)
2103-
.setFont(createFont("Arial", 15, true))
2103+
.setFont(f2)
21042104
.setFocus(false)
21052105
.setColor(color(26, 26, 26))
21062106
.setColorBackground(color(255, 255, 255)) // text field bg color
21072107
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
2108-
.setColorForeground(isSelected_color) // border color when not selected
2108+
.setColorForeground(OPENBCI_DARKBLUE) // border color when not selected
21092109
.setColorActive(isSelected_color) // border color when selected
21102110
.setColorCursor(color(26, 26, 26))
21112111
.setText(ipAddress)
@@ -2299,12 +2299,12 @@ class BrainFlowStreamerBox {
22992299
.setPosition(x + padding * 3, y + HEADER_H + padding*2)
23002300
.setCaptionLabel("")
23012301
.setSize(120, OBJECT_H)
2302-
.setFont(createFont("Arial", 15, true))
2302+
.setFont(f2)
23032303
.setFocus(false)
23042304
.setColor(color(26, 26, 26))
23052305
.setColorBackground(color(255, 255, 255)) // text field bg color
23062306
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
2307-
.setColorForeground(isSelected_color) // border color when not selected
2307+
.setColorForeground(OPENBCI_DARKBLUE) // border color when not selected
23082308
.setColorActive(isSelected_color) // border color when selected
23092309
.setColorCursor(color(26, 26, 26))
23102310
.setText(DEFAULT_IP_ADDRESS) //default ipAddress == ""
@@ -2330,12 +2330,12 @@ class BrainFlowStreamerBox {
23302330
.setPosition(x + padding*5 + w/2, y + HEADER_H + padding*2)
23312331
.setCaptionLabel("")
23322332
.setSize(50, OBJECT_H)
2333-
.setFont(createFont("Arial", 15, true))
2333+
.setFont(f2)
23342334
.setFocus(false)
23352335
.setColor(color(26, 26, 26))
23362336
.setColorBackground(color(255, 255, 255)) // text field bg color
23372337
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
2338-
.setColorForeground(isSelected_color) // border color when not selected
2338+
.setColorForeground(OPENBCI_DARKBLUE) // border color when not selected
23392339
.setColorActive(isSelected_color) // border color when selected
23402340
.setColorCursor(color(26, 26, 26))
23412341
.setText(DEFAULT_PORT) //default port == 0
@@ -2530,12 +2530,12 @@ class StreamingBoardBox {
25302530
.setPosition(x + padding * 3, y + headerH + padding*2)
25312531
.setCaptionLabel("")
25322532
.setSize(w / 3, objectH)
2533-
.setFont(createFont("Arial", 15, true))
2533+
.setFont(f2)
25342534
.setFocus(false)
25352535
.setColor(color(26, 26, 26))
25362536
.setColorBackground(color(255, 255, 255)) // text field bg color
25372537
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
2538-
.setColorForeground(isSelected_color) // border color when not selected
2538+
.setColorForeground(OPENBCI_DARKBLUE) // border color when not selected
25392539
.setColorActive(isSelected_color) // border color when selected
25402540
.setColorCursor(color(26, 26, 26))
25412541
.setText("") //default ipAddress == ""
@@ -2547,12 +2547,12 @@ class StreamingBoardBox {
25472547
.setPosition(x + padding*5 + w/2, y + headerH + padding*2)
25482548
.setCaptionLabel("")
25492549
.setSize(w / 5 + padding, objectH)
2550-
.setFont(createFont("Arial", 15, true))
2550+
.setFont(f2)
25512551
.setFocus(false)
25522552
.setColor(color(26, 26, 26))
25532553
.setColorBackground(color(255, 255, 255)) // text field bg color
25542554
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
2555-
.setColorForeground(isSelected_color) // border color when not selected
2555+
.setColorForeground(OPENBCI_DARKBLUE) // border color when not selected
25562556
.setColorActive(isSelected_color) // border color when selected
25572557
.setColorCursor(color(26, 26, 26))
25582558
.setText(Integer.toString(0)) //default port == 0

OpenBCI_GUI/CustomCp5Classes.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ public class MenuList extends controlP5.Controller {
216216
menu.fill(127, 134, 143);
217217
}
218218
if (i == activeItem) {
219-
menu.stroke(184, 220, 105, 255);
219+
menu.stroke(TURN_ON_GREEN);
220220
menu.strokeWeight(1);
221-
menu.fill(184, 220, 105, 255);
221+
menu.fill(TURN_ON_GREEN);
222222
menu.rect(0, 0, getWidth()-1, itemHeight-1 );
223223
menu.noStroke();
224224
} else {

OpenBCI_GUI/Debugging.pde

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ class HelpWidget {
109109
outputWasTriggered = false;
110110
}
111111
}
112-
// Color mode is switched to Hue, Saturation, Brightness in the next line
112+
//Colors in this method are calculated using Hue, Saturation, Brightness
113+
colorMode(HSB, 360, 100, 100);
113114
color c = getBackgroundColor(saturationFadeValue);
114115
stroke(c);
115116
fill(c);
@@ -128,6 +129,7 @@ class HelpWidget {
128129
}
129130

130131
private color getTextColor() {
132+
/*
131133
switch (curOutputLevel) {
132134
case INFO:
133135
return #00529B;
@@ -139,13 +141,13 @@ class HelpWidget {
139141
return #D8000C;
140142
case DEFAULT:
141143
default:
142-
return color(0, 5, 11);
144+
return color(0, 5, 11);
143145
}
146+
*/
147+
return OPENBCI_DARKBLUE;
144148
}
145149

146150
private color getBackgroundColor(int fadeVal) {
147-
//Colors in this method are calculated using Hue, Saturation, Brightness
148-
colorMode(HSB, 360, 100, 100);
149151
int sat = 0;
150152
int maxSat = 75;
151153
switch (curOutputLevel) {
@@ -156,6 +158,7 @@ class HelpWidget {
156158
return color(199, sat, 97);
157159
case SUCCESS:
158160
//base color - #DFF2BF;
161+
maxSat = 50;
159162
sat = 25;
160163
sat = (int)map(fadeVal, 0, 100, sat, maxSat);
161164
return color(106, sat, 95);

OpenBCI_GUI/Extras.pde

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,72 @@ private boolean isMac() {
3232
return !isWindows() && !isLinux();
3333
}
3434

35+
private void checkIsMacFullDetail() {
36+
StringBuilder response = new StringBuilder("MacOS Details: ");
37+
if (isMacOsLowerThanCatalina()) {
38+
response.append("MacOS Mojave or earlier");
39+
} else if (isMacOsBigSur()) {
40+
response.append("MacOS Big Sur");
41+
} else if (isMacOsMonterey()) {
42+
response.append("MacOS Monterey");
43+
} else {
44+
response.append("MacOS Catalina");
45+
}
46+
println(response);
47+
}
48+
49+
// For a full list of modern Mac OS versions, visit https://en.wikipedia.org/wiki/MacOS_version_history
50+
private boolean isMacOsLowerThanCatalina() {
51+
int[] versionInfo = fetchAndParseMacOsVersion();
52+
return versionInfo[0] <= 10 && versionInfo[1] < 15;
53+
}
54+
55+
private boolean isMacOsBigSur() {
56+
int[] versionInfo = fetchAndParseMacOsVersion();
57+
//This should return 11, but there was a recently discovered bug in Java 8 -- https://bugs.openjdk.java.net/browse/JDK-8274907
58+
int[] javaInfo = fetchAndParseJavaVersion();
59+
boolean usingJava8_202 = javaInfo[0] == 1 && javaInfo[1] == 8 && javaInfo[2] == 202;
60+
if (usingJava8_202) {
61+
return versionInfo[0] == 10 && versionInfo[1] == 16;
62+
} else {
63+
return versionInfo[0] == 11;
64+
}
65+
}
66+
67+
private boolean isMacOsMonterey() {
68+
int[] versionInfo = fetchAndParseMacOsVersion();
69+
return versionInfo[0] == 12;
70+
}
71+
72+
private String getOperatingSystemVersion() {
73+
return System.getProperty("os.version");
74+
}
75+
76+
private int[] fetchAndParseMacOsVersion() {
77+
if (!isMac()) {
78+
println("Oops! Please only call this method on MacOS");
79+
return null;
80+
}
81+
final String version = getOperatingSystemVersion();
82+
final String[] splitStrings = split(version, '.');
83+
int[] versionVals = new int[splitStrings.length];
84+
for (int i = 0; i < splitStrings.length; i++) {
85+
versionVals[i] = Integer.valueOf(splitStrings[i]);
86+
}
87+
return versionVals;
88+
}
89+
90+
private int[] fetchAndParseJavaVersion() {
91+
final String version = System.getProperty("java.version");
92+
final String[] splitStrings = split(version, '.');
93+
int[] versionVals = new int[splitStrings.length];
94+
versionVals[0] = Integer.valueOf(splitStrings[0]);
95+
versionVals[1] = Integer.valueOf(splitStrings[1]);
96+
final String[] minorVersion = split(splitStrings[2], "_");
97+
versionVals[2] = Integer.valueOf(minorVersion[minorVersion.length - 1]);
98+
return versionVals;
99+
}
100+
35101
//BrainFlow only supports Windows 8 and 10. This will help with OpenBCI support tickets. #964
36102
private void checkIsOldVersionOfWindowsOS() {
37103
boolean isOld = SystemUtils.IS_OS_WINDOWS_7 || SystemUtils.IS_OS_WINDOWS_VISTA || SystemUtils.IS_OS_WINDOWS_XP;
@@ -380,8 +446,8 @@ class DataStatus {
380446
private double percentage;
381447
public String notificationString;
382448
private final color default_color = OPENBCI_DARKBLUE;
383-
private final color yellow = color(221, 178, 13, 255);
384-
private final color red = TURN_OFF_RED;
449+
private final color yellow = SIGNAL_CHECK_YELLOW;
450+
private final color red = BOLD_RED;
385451
private color colorIndicator = default_color;
386452

387453
DataStatus(double thresh_railed, double thresh_railed_warn) {

OpenBCI_GUI/FilterUI.pde

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ class FilterUIPopup extends PApplet implements Runnable {
412412
private void updateChannelCp5Objects() {
413413

414414
//Reusable variables to update UI objects
415-
color onColor = TURN_ON_GREEN;
415+
color onColor = SUBNAV_LIGHTBLUE;
416416
color offColor = BUTTON_PRESSED_DARKGREY;
417417
color updateColor = offColor;
418418
String firstColumnTFValue = "";
@@ -558,6 +558,7 @@ class FilterUIPopup extends PApplet implements Runnable {
558558
.setText(Integer.toString(intValue)) //set the text
559559
.align(5, 10, 20, 40)
560560
.setAutoClear(false)
561+
.setIsCentered(true)
561562
; //Don't clear textfield when pressing Enter key
562563
myTextfield.getValueLabel().align(CENTER, CENTER);
563564
//Clear textfield on double click
@@ -950,7 +951,7 @@ class FilterUIPopup extends PApplet implements Runnable {
950951
}
951952

952953
private void createMasterOnOffButton(String name, final String text, int _x, int _y, int _w, int _h) {
953-
masterOnOffButton = createButton(cp5, name, text, _x, _y, _w, _h, 0, h2, 16, TURN_ON_GREEN, WHITE, BUTTON_HOVER, BUTTON_PRESSED, (Integer) null, -2);
954+
masterOnOffButton = createButton(cp5, name, text, _x, _y, _w, _h, 0, h2, 16, SUBNAV_LIGHTBLUE, WHITE, BUTTON_HOVER, BUTTON_PRESSED, (Integer) null, -2);
954955
masterOnOffButton.setCircularButton(true);
955956
masterOnOffButton.onRelease(new CallbackListener() {
956957
public void controlEvent(CallbackEvent theEvent) {

0 commit comments

Comments
 (0)