Skip to content

Commit 408b215

Browse files
authored
Merge pull request #974 from OpenBCI/gui505-minor-fixes
Gui 5.0.5 minor fixes
2 parents ac2ff3e + 1031ce1 commit 408b215

File tree

9 files changed

+70
-36
lines changed

9 files changed

+70
-36
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# v5.0.5
22

33
### Improvements
4-
* Implement Focus Widget using BrainFlow Metrics
4+
* Implement Focus Widget using BrainFlow Metrics! #924
5+
* Throw a popup if users are are running an old version of Windows operating system. GUI v5 supports 64-bit Windows 8, 8.1, and 10. #964
6+
* Throw a popup if Windows users are using 32-bit Java and Processing. #964
7+
* Set Networking Widget default baud rate for Serial output to 57600
58

69
### Bug Fixes
710
* Fix Y axis Autoscale in TimeSeries when all values are less than zero. Example: Cyton with filters off
11+
* Gracefully handle cases when Cyton or Cyton+Daisy users want to use 8 or 16 channels #954
12+
* Update Save Session Settings success message. Session settings are no longer auto-loaded on Session start. #969
13+
* Session settings are no longer auto-saved when system is halted #969
814

915
# v5.0.4
1016

OpenBCI_GUI/Extras.pde

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ private boolean isMac() {
2626
return !isWindows() && !isLinux();
2727
}
2828

29+
//BrainFlow only supports Windows 8 and 10. This will help with OpenBCI support tickets. #964
30+
private void checkIsOldVersionOfWindowsOS() {
31+
boolean isOld = SystemUtils.IS_OS_WINDOWS_7 || SystemUtils.IS_OS_WINDOWS_VISTA || SystemUtils.IS_OS_WINDOWS_XP;
32+
if (isOld) {
33+
PopupMessage msg = new PopupMessage("Old Windows OS Detected", "OpenBCI GUI v5 and BrainFlow are made for 64-bit Windows 8, 8.1, and 10. Please update your OS, computer, or revert to GUI v4.2.0.");
34+
}
35+
}
36+
37+
//Sanity check for 64-bit Java for Windows users #964
38+
private void checkIs64BitJava() {
39+
boolean is64Bit = System.getProperty("sun.arch.data.model").indexOf("64") >= 0;
40+
if (!is64Bit) {
41+
PopupMessage msg = new PopupMessage("32-bit Java Detected", "OpenBCI GUI v5 and BrainFlow are made for 64-bit Java (Windows, Linux, and Mac). Please update your OS, computer, Processing IDE, or revert to GUI v4 or earlier.");
42+
}
43+
}
44+
2945

3046
//compute the standard deviation
3147
float std(float[] data) {

OpenBCI_GUI/Info.plist.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
<!-- Customize this set as you wish -->
2323
<key>CFBundleShortVersionString</key>
24-
<string>4</string>
24+
<string>5</string>
2525
<key>CFBundleVersion</key>
26-
<string>5.0.4</string>
26+
<string>5.0.5</string>
2727
<key>CFBundleSignature</key>
2828
<string>????</string>
2929
<key>NSHumanReadableCopyright</key>
@@ -32,7 +32,7 @@
3232
Copyright © 2021 OpenBCI
3333
</string>
3434
<key>CFBundleGetInfoString</key>
35-
<string>March 2021</string>
35+
<string>May 2021</string>
3636
<!-- End of the set that can be customized -->
3737

3838
@@jvm_runtime@@

OpenBCI_GUI/Interactivity.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ void parseKey(char val) {
106106

107107
///////////////////// Save User settings lowercase n
108108
case 'n':
109-
println("Save key pressed!");
109+
println("Interactivity: Save key pressed!");
110110
settings.save(settings.getPath("User", eegDataSource, nchan));
111-
outputSuccess("Settings Saved! The GUI will now load with these settings. Click \"Default\" to revert to factory settings.");
111+
outputSuccess("Settings Saved! Using Expert Mode, you can load these settings using 'N' key. Click \"Default\" to revert to factory settings.");
112112
return;
113113

114114
///////////////////// Load User settings uppercase N
115115
case 'N':
116-
println("Load key pressed!");
116+
println("Interactivity: Load key pressed!");
117117
settings.loadKeyPressed();
118118
return;
119119

OpenBCI_GUI/OpenBCI_GUI.pde

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ import oscP5.*; // for OSC
5151
import hypermedia.net.*; //for UDP
5252
import java.nio.ByteBuffer; //for UDP
5353
import edu.ucsd.sccn.LSL; //for LSL
54-
//These are used by LSL
55-
//import com.sun.jna.Library;
56-
//import com.sun.jna.Native;
57-
//import com.sun.jna.Platform;
58-
//import com.sun.jna.Pointer;
5954
import com.fazecast.jSerialComm.*; //Helps distinguish serial ports on Windows
6055
import org.apache.commons.lang3.time.StopWatch;
6156
import http.requests.*;
@@ -65,7 +60,7 @@ import http.requests.*;
6560
// Global Variables & Instances
6661
//------------------------------------------------------------------------
6762
//Used to check GUI version in TopNav.pde and displayed on the splash screen on startup
68-
String localGUIVersionString = "v5.0.5-alpha.3";
63+
String localGUIVersionString = "v5.0.5";
6964
String localGUIVersionDate = "May 2021";
7065
String guiLatestVersionGithubAPI = "https://api.github.com/repos/OpenBCI/OpenBCI_GUI/releases/latest";
7166
String guiLatestReleaseLocation = "https://github.com/OpenBCI/OpenBCI_GUI/releases/latest";
@@ -363,18 +358,22 @@ void setup() {
363358
System.setOut(outputStream);
364359
System.setErr(outputStream);
365360

366-
String osName = "Operating System: ";
361+
StringBuilder osName = new StringBuilder("Operating System: ");
367362
if (isLinux()) {
368-
osName += "Linux";
363+
osName.append("Linux");
369364
} else if (isWindows()) {
370-
osName += "Windows";
365+
osName.append("Windows");
366+
//Throw a popup if we detect an incompatible version of Windows. Fixes #964. Found in Extras.pde.
367+
checkIsOldVersionOfWindowsOS();
368+
//This is an edge case when using 32-bit Processing Java on Windows. Throw a popup if detected.
369+
checkIs64BitJava();
371370
} else if (isMac()) {
372-
osName += "Mac";
371+
osName.append("Mac");
373372
}
374373

375374
println("Console Log Started at Local Time: " + directoryManager.getFileNameDateTime());
376375
println("Screen Resolution: " + displayWidth + " X " + displayHeight);
377-
println(osName);
376+
println(osName.toString());
378377
println("Welcome to the Processing-based OpenBCI GUI!"); //Welcome line.
379378
println("For more information, please visit: https://openbci.github.io/Documentation/docs/06Software/01-OpenBCISoftware/GUIDocs");
380379

@@ -571,6 +570,27 @@ void initSystem() {
571570
// initialize the chosen board
572571
boolean success = currentBoard.initialize();
573572
abandonInit = !success; // abandon if init fails
573+
574+
//Handle edge cases for Cyton and Cyton+Daisy users immediately after board is initialized. Fixes #954
575+
if (eegDataSource == DATASOURCE_CYTON) {
576+
println("OpenBCI_GUI: Configuring Cyton Channel Count...");
577+
if (currentBoard instanceof BoardCytonSerial) {
578+
Pair<Boolean, String> res = ((BoardBrainFlow)currentBoard).sendCommand("c");
579+
//println(res.getKey().booleanValue(), res.getValue());
580+
if (res.getValue().startsWith("daisy removed")) {
581+
println("OpenBCI_GUI: Daisy is physically attached, using Cyton 8 Channels instead.");
582+
}
583+
} else if (currentBoard instanceof BoardCytonSerialDaisy) {
584+
Pair<Boolean, String> res = ((BoardBrainFlow)currentBoard).sendCommand("C");
585+
//println(res.getKey().booleanValue(), res.getValue());
586+
if (res.getValue().startsWith("no daisy to attach")) {
587+
haltSystem();
588+
outputError("User selected Cyton+Daisy, but no Daisy is attached. Please change Channel Count to 8 Channels.");
589+
controlPanel.open();
590+
return;
591+
}
592+
}
593+
}
574594

575595
updateToNChan(currentBoard.getNumEXGChannels());
576596

@@ -746,14 +766,6 @@ void haltSystem() {
746766
topNav.resetStartStopButton();
747767
topNav.destroySmoothingButton(); //Destroy this button if exists and make null, will be re-init if needed next time session starts
748768

749-
//Save a snapshot of User's GUI settings if the system is stopped, or halted. This will be loaded on next Start System.
750-
//This method establishes default and user settings for all data modes
751-
if (systemMode == SYSTEMMODE_POSTINIT &&
752-
eegDataSource != DATASOURCE_GALEA &&
753-
eegDataSource != DATASOURCE_STREAMING) {
754-
settings.save(settings.getPath("User", eegDataSource, nchan));
755-
}
756-
757769
//reset connect loadStrings
758770
openBCI_portName = "N/A"; // Fixes inability to reconnect after halding JAM 1/2017
759771
ganglion_portName = "";
@@ -891,7 +903,7 @@ void updateToNChan(int _nchan) {
891903
nchan = _nchan;
892904
settings.slnchan = _nchan; //used in SoftwareSettings.pde only
893905
fftBuff = new FFT[nchan]; //reinitialize the FFT buffer
894-
println("Channel count set to " + str(nchan));
906+
println("OpenBCI_GUI: Channel count set to " + str(nchan));
895907
}
896908

897909
void introAnimation() {

OpenBCI_GUI/SessionSettings.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ void saveConfigFile(File selection) {
11711171
println("SessionSettings: saveConfigFile: User selected " + selection.getAbsolutePath());
11721172
settings.saveDialogName = selection.getAbsolutePath();
11731173
settings.save(settings.saveDialogName); //save current settings to JSON file in SavedData
1174-
outputSuccess("Settings Saved! The GUI will now load with these settings. Click \"Default\" to revert to factory settings."); //print success message to screen
1174+
outputSuccess("Settings Saved! Using Expert Mode, you can load these settings using 'N' key. Click \"Default\" to revert to factory settings."); //print success message to screen
11751175
settings.saveDialogName = null; //reset this variable for future use
11761176
}
11771177
}

OpenBCI_GUI/W_Focus.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class W_Focus extends Widget {
4444
private final int CLASSIFIER_DROPDOWN_W = 80;
4545

4646
private FocusBar focusBar;
47-
private float focusBarHardYAxisLimit = 1f;
47+
private float focusBarHardYAxisLimit = 1.05f; //Provide slight "breathing room" to avoid GPlot error when metric value == 1.0
4848
FocusXLim xLimit = FocusXLim.TEN;
4949
FocusMetric focusMetric = FocusMetric.RELAXATION;
5050
FocusClassifier focusClassifier = FocusClassifier.REGRESSION;

OpenBCI_GUI/W_Networking.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class W_Networking extends Widget {
148148
if (eegDataSource != DATASOURCE_CYTON) {
149149
dataTypes.remove("Pulse");
150150
}
151-
defaultBaud = "115200";
151+
defaultBaud = "57600";
152152
baudRates = Arrays.asList(settings.nwBaudRatesArray);
153153
protocolMode = "Serial"; //default to Serial
154154
addDropdown("Protocol", "Protocol", Arrays.asList(settings.nwProtocolArray), protocolIndex);

OpenBCI_GUI/WidgetManager.pde

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ void setupWidgets(PApplet _this, ArrayList<Widget> w){
3636
addWidget(w_timeSeries, w);
3737
// println(" setupWidgets time series -- " + millis());
3838

39-
//Cyton Widget_12, Synthetic Widget_9, Ganglion/Playback Widget_10
40-
w_focus = new W_Focus(_this);
41-
w_focus.setTitle("Focus Widget");
42-
addWidget(w_focus, w);
43-
// println(" setupWidgets focus widget -- " + millis());
44-
4539
//Widget_1
4640
w_fft = new W_fft(_this);
4741
w_fft.setTitle("FFT Plot");
@@ -70,6 +64,12 @@ void setupWidgets(PApplet _this, ArrayList<Widget> w){
7064
addWidget(w_ganglionImpedance, w);
7165
}
7266

67+
//Cyton Widget_12, Synthetic Widget_9, Ganglion/Playback Widget_10
68+
w_focus = new W_Focus(_this);
69+
w_focus.setTitle("Focus Widget");
70+
addWidget(w_focus, w);
71+
// println(" setupWidgets focus widget -- " + millis());
72+
7373
//Cyton/Synthetic Widget_3, Ganglion/Playback Widget_4
7474
w_networking = new W_Networking(_this);
7575
w_networking.setTitle("Networking");

0 commit comments

Comments
 (0)