You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: OpenBCI_GUI/SoftwareSettings.pde
+30-16Lines changed: 30 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -379,12 +379,12 @@ class SoftwareSettings {
379
379
this.load(settingsFileToLoad);
380
380
errorUserSettingsNotFound =false;
381
381
} catch (Exception e) {
382
-
e.printStackTrace();
382
+
//e.printStackTrace();
383
383
println("InitSettings: "+ settingsFileToLoad +" not found or other error.");
384
384
errorUserSettingsNotFound =true;
385
-
File f =newFile(sketchPath()+System.getProperty("file.separator")+settingsFileToLoad);
385
+
File f =newFile(settingsFileToLoad);
386
386
if (f.exists()) {
387
-
if (f.delete()) println("SoftwareSettings: Removed old settings file.");
387
+
if (f.delete()) println("SoftwareSettings: Removed old/broken settings file.");
388
388
}
389
389
}
390
390
}
@@ -1532,7 +1532,7 @@ class SoftwareSettings {
1532
1532
output("The new data source is "+ dataModeVersionToPrint +" and NCHAN = ["+ nchan +"]. Data source error: Default Settings Loaded."); //Show a normal message for loading Default Settings
1533
1533
} elseif (errorUserSettingsNotFound) {
1534
1534
verbosePrint("OpenBCI_GUI: initSystem: -- Init 5 -- "+"Load settings error: File not found. "+millis()); //Print the error to console
1535
-
output("The new data source is "+ dataModeVersionToPrint +" and NCHAN = ["+ nchan +"]. User settings error: Default Settings Loaded."); //Show a normal message for loading Default Settings
1535
+
output("The new data source is "+ dataModeVersionToPrint +" and NCHAN = ["+ nchan +"]. User Settings Error: Default Settings Loaded."); //Show a normal message for loading Default Settings
1536
1536
} else {
1537
1537
verbosePrint("OpenBCI_GUI: initSystem: -- Init 5 -- "+"Load settings error: Connection Error: Failed to apply channel settings to Cyton"+millis()); //Print the error to console
1538
1538
outputError(dataModeVersionToPrint +" and NCHAN = ["+ nchan +"]. Connection Error: Channel settings failed to apply to Cyton."); //Show a normal message for loading Default Settings
@@ -1553,14 +1553,27 @@ class SoftwareSettings {
1553
1553
errorUserSettingsNotFound =true;
1554
1554
}
1555
1555
//Output message when Loading settings is complete
1556
+
String err =null;
1556
1557
if (chanNumError ==false&& dataSourceError ==false&& errorUserSettingsNotFound ==false&& loadErrorCytonEvent ==false) {
1557
1558
outputSuccess("Settings Loaded!");
1558
1559
} elseif (chanNumError) {
1559
-
outputError("Load Settings Error: Invalid number of channels");
1560
+
err ="Invalid number of channels";
1560
1561
} elseif (dataSourceError) {
1561
-
outputError("Load Settings Error: Invalid data source");
1562
-
} else {
1563
-
outputError("Load settings error: "+ settingsFileToLoad +" not found. ");
1562
+
err ="Invalid data source";
1563
+
} elseif (errorUserSettingsNotFound) {
1564
+
err = settingsFileToLoad +" not found.";
1565
+
}
1566
+
1567
+
if (err !=null) {
1568
+
println("Load Settings Error: "+ err);
1569
+
File f =newFile(settingsFileToLoad);
1570
+
if (f.exists()) {
1571
+
if (f.delete()) {
1572
+
outputError("Found old/broken GUI settings. Please reconfigure the GUI and save new settings.");
0 commit comments