Skip to content

Commit 6a258db

Browse files
authored
Merge pull request #619 from OpenBCI/development
4.1.6 Stable Release w/ Fixes
2 parents cb90c1e + d6cdabb commit 6a258db

7 files changed

Lines changed: 66 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# v4.1.6
22
Use OpenBCIHub v2.1.0 please.
33

4+
### Improvements
5+
* Fix LSL streaming more than one data type #592
6+
47
## Beta 0
58

69
### Improvements
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""Example program to show how to read a multi-channel time series from LSL."""
2+
3+
from pylsl import StreamInlet, resolve_stream
4+
5+
# first resolve an EEG stream on the lab network
6+
print("looking for an EEG stream...")
7+
streams = resolve_stream('type', 'EEG')
8+
9+
# create a new inlet to read from the stream
10+
inlet = StreamInlet(streams[0])
11+
12+
while True:
13+
# get a new sample (you can also omit the timestamp part if you're not
14+
# interested in it)
15+
sample, timestamp = inlet.pull_sample()
16+
print(timestamp, sample)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"""Example program to demonstrate how to read a multi-channel time-series
2+
from LSL in a chunk-by-chunk manner (which is more efficient).
3+
4+
Please restart this script if you change one of the data types.
5+
Also, the # Chan should match the data type (Examples: 1 for Focus, 3 for Accel)
6+
7+
"""
8+
9+
from pylsl import StreamInlet, resolve_stream
10+
11+
numStreams = 3
12+
# first resolve an EEG stream on the lab network
13+
print("looking for an EEG stream...")
14+
stream1 = resolve_stream('name', 'obci_eeg1')
15+
stream2 = resolve_stream('name', 'obci_eeg2')
16+
stream3 = resolve_stream('name', 'obci_eeg3')
17+
18+
# create a new inlet to read from the stream
19+
inlet = StreamInlet(stream1[0])
20+
inlet2 = StreamInlet(stream2[0])
21+
inlet3 = StreamInlet(stream3[0])
22+
23+
while True:
24+
for i in range(numStreams):
25+
# get a new sample (you can also omit the timestamp part if you're not
26+
# interested in it)
27+
if i == 0:
28+
chunk, timestamps = inlet.pull_chunk()
29+
if timestamps:
30+
print("Stream", i + 1, " == ", chunk)
31+
elif i == 1:
32+
chunk, timestamps = inlet2.pull_chunk()
33+
if timestamps:
34+
print("Stream", i + 1, " == ", chunk)
35+
elif i == 2:
36+
chunk, timestamps = inlet3.pull_chunk()
37+
if timestamps:
38+
print("Stream", i + 1, " == ", chunk)

OpenBCI_GUI/ControlPanel.pde

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,15 +1797,6 @@ class SerialBox {
17971797
autoConnect.setHelpText("Attempt to auto-connect to Cyton. Try \"Manual\" if this does not work.");
17981798
popOutRadioConfigButton = new Button(x + w - 70 - padding, y + padding*3 + 4, 70, 24,"Manual >",fontInfo.buttonLabel_size);
17991799
popOutRadioConfigButton.setHelpText("Having trouble connecting to Cyton? Click here to access Radio Configuration tools.");
1800-
1801-
serialList = new MenuList(cp5, "serialList", w - padding*2, 72, p4);
1802-
// println(w-padding*2);
1803-
serialList.setPosition(x + padding, y + padding*3 + 8);
1804-
serialPorts = Serial.list();
1805-
for (int i = 0; i < serialPorts.length; i++) {
1806-
String tempPort = serialPorts[(serialPorts.length-1) - i]; //list backwards... because usually our port is at the bottom
1807-
serialList.addItem(makeItem(tempPort));
1808-
}
18091800
}
18101801

18111802
public void update() {

OpenBCI_GUI/Info.plist.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<key>CFBundleShortVersionString</key>
2424
<string>4</string>
2525
<key>CFBundleVersion</key>
26-
<string>4.1.6-beta.0</string>
26+
<string>4.1.6</string>
2727
<key>CFBundleSignature</key>
2828
<string>????</string>
2929
<key>NSHumanReadableCopyright</key>

OpenBCI_GUI/OpenBCI_GUI.pde

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import com.sun.jna.Pointer;
5656
// Global Variables & Instances
5757
//------------------------------------------------------------------------
5858
//Used to check GUI version in TopNav.pde and displayed on the splash screen on startup
59-
String localGUIVersionString = "v4.1.6-beta.0";
59+
String localGUIVersionString = "v4.1.6";
6060
String localGUIVersionDate = "September 2019";
6161
String guiLatestReleaseLocation = "https://github.com/OpenBCI/OpenBCI_GUI/releases/latest";
6262
Boolean guiVersionCheckHasOccured = false;
@@ -839,6 +839,7 @@ void initSystem() throws Exception {
839839
outputError("Failed to connect. Check that the device is powered on and in range.");
840840
}
841841
controlPanel.open();
842+
systemMode = SYSTEMMODE_PREINIT; // leave this here
842843
}
843844

844845
//reset init variables

OpenBCI_GUI/W_Networking.pde

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ class W_Networking extends Widget {
192192
if (stream2!=null) {
193193
stream2.run();
194194
}
195-
if (stream2!=null) {
196-
stream2.run();
195+
if (stream3!=null) {
196+
stream3.run();
197197
}
198+
//Setting this var here fixes #592 to allow multiple LSL streams
199+
dataProcessing.newDataToSend = false;
198200
}
199201

200202
checkTopNovEvents();
@@ -1297,8 +1299,7 @@ class Stream extends Thread {
12971299
} else if (this.dataType.equals("SSVEP")) {
12981300
sendSSVEPData();
12991301
}
1300-
setDataFalse();
1301-
// newData = false;
1302+
//setDataFalse(); //Wait until all streams are done, Fixes 592
13021303
}
13031304
}
13041305
}
@@ -1344,6 +1345,7 @@ class Stream extends Thread {
13441345
dataProcessing.newDataToSend = false;
13451346
}
13461347
}
1348+
13471349
/* This method contains all of the policies for sending data types */
13481350
void sendTimeSeriesData() {
13491351

0 commit comments

Comments
 (0)