Skip to content

Commit

Permalink
Merge pull request #848 from OpenBCI/development
Browse files Browse the repository at this point in the history
GUI v5
  • Loading branch information
retiutut authored Aug 3, 2020
2 parents 9634ae7 + cae66e0 commit aa6352c
Show file tree
Hide file tree
Showing 249 changed files with 205,834 additions and 40,175 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ OpenBCI_GUI/SavedData/EEG_Data/SDconverted-*
OpenBCI_GUI/data/EEG_Data/*
OpenBCI_GUI/data/OpenBCIHub/*
OpenBCI_GUI/application.*
OpenBCI_GUI/openbcigui_*
openbcigui_*
*.autosave
.vscode/*
51 changes: 51 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
os:
- linux
- osx

addons:
artifacts:
paths:
- $(ls $TRAVIS_BUILD_DIR/openbcigui_*_macosx.dmg | tr "\n" ":")
- $(ls $TRAVIS_BUILD_DIR/openbcigui_*_linux64.zip | tr "\n" ":")
target_paths:
- /${TRAVIS_BRANCH}/${TRAVIS_COMMIT}
- /${TRAVIS_BRANCH}/latest
working_dir: $TRAVIS_BUILD_DIR

before_install:
- if [ "$TRAVIS_OS_NAME" = osx ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then openssl aes-256-cbc -K $encrypted_2f5d2771e3cb_key -iv $encrypted_2f5d2771e3cb_iv -in release_script/mac_only/Certificates.p12.enc -out release_script/mac_only/Certificates.p12 -d; fi
- if [ "$TRAVIS_OS_NAME" = osx ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then chmod +x release_script/mac_only/add-osx-cert.sh; fi
- if [ "$TRAVIS_OS_NAME" = osx ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./release_script/mac_only/add-osx-cert.sh; fi

install:
- mkdir $TRAVIS_BUILD_DIR/temp; cd $TRAVIS_BUILD_DIR/temp

### ### LINUX ### ###
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then curl -O -L http://download.processing.org/processing-3.5.3-linux64.tgz ;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then tar -xzvf processing-3.5.3-linux64.tgz ;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then export PATH=$TRAVIS_BUILD_DIR/temp/processing-3.5.3:$PATH ;fi
# copy libraries to linux location
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then mkdir -p $HOME/sketchbook/libraries/ ;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cp -a $TRAVIS_BUILD_DIR/OpenBCI_GUI/libraries/. $HOME/sketchbook/libraries/ ;fi

### ### MAC ### ###
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then curl -O -L http://download.processing.org/processing-3.5.3-macosx.zip ;fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then unzip processing-3.5.3-macosx.zip ;fi
# Processing.app must be in this location for processing-java to work
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then mv Processing.app /Applications/Processing.app ;fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH=$TRAVIS_BUILD_DIR/release_script/mac_only:$PATH ;fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then chmod +x $TRAVIS_BUILD_DIR/release_script/mac_only/processing-java ;fi
# copy libraries to mac location
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then mkdir -p $HOME/Documents/Processing/libraries/ ;fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then cp -a $TRAVIS_BUILD_DIR/OpenBCI_GUI/libraries/. $HOME/Documents/Processing/libraries/ ;fi
# used to create .dmg
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then pip install dmgbuild ;fi

script:
- cd $TRAVIS_BUILD_DIR
- python $TRAVIS_BUILD_DIR/release_script/make-release.py --no-prompts

notifications:
email:
on_success: never
on_failure: always
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
# v5.0.0

### Improvements
* Use BrainFlow Java Binding to handle data acquisition (no need to run the Hub!)
* Speed up entire GUI by plotting data more efficiently
* Updated OpenBCI Data Format (CSV) Files, with more detailed information and data
* Popup with link to GUI v4 file coverter script
* Improved Playback Mode and Time Series
* Refactored GUI data flow
* Add Travis and Appveyor CI tests and builds for all OS
* Add data smoothing option for live Cyton data
* Cyton Port manual selection only displays serial ports with a dongle connected.
* Cyton SD file read works without conversion to playback file
* Use BrainFlow filters, add 1-100 BandPass filter
* Can Hide/Show channels in time series

### Bug Fixes
* Remove OpenBCI Hub #665 #669 #708
* General UI/UX improvements
* Missing Filter Button Label in Networking #696
* Ganglion+WiFi Accelerometer Data not in Sync #512
* Remove # Chan Textfield from LSL in Networking Widget #644
* LSL manual timestamping interferes with LSL clock_offset correction #775
* Fixed a graphics related error on linux #816

### Deprecated Features
* OpenBCI Hub - This is no longer required to run the GUI!
* Old OBCI (CSV) Files - A converter will be made available
* Presentation Mode
* SSVEP_Beta Widget
* Focus Widget
* Marker Mode Widget
* OpenBionics Widget

# v4.2.0
Please use OpenBCIHub v2.1.0 and Processing 4.

# Improvements
### Improvements
* Update to Processing 4 and Java 11! #671
* Add functional Spectrogram Widget! #416
* Clean up Marker Mode UDP listener #305
Expand Down
18 changes: 14 additions & 4 deletions Networking-Test-Kit/LSL/lslStreamTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Example program to show how to read a multi-channel time series from LSL."""

import time
from pylsl import StreamInlet, resolve_stream

# first resolve an EEG stream on the lab network
Expand All @@ -9,8 +9,18 @@
# create a new inlet to read from the stream
inlet = StreamInlet(streams[0])

while True:

def testLSLSamplingRate():
start = time.time()
numSamples = 0
while time.time() < start + 5:
# get a new sample (you can also omit the timestamp part if you're not
# interested in it)
sample, timestamp = inlet.pull_sample()
print(timestamp, sample)
sample, timestamp = inlet.pull_chunk()
# print(timestamp, sample)
if timestamp:
numSamples += 1
print( numSamples / 5 )


testLSLSamplingRate()
52 changes: 33 additions & 19 deletions Networking-Test-Kit/LSL/lslStreamTest_3Streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,46 @@
"""

from pylsl import StreamInlet, resolve_stream
import time

numStreams = 3
# first resolve an EEG stream on the lab network
print("looking for an EEG stream...")
stream1 = resolve_stream('name', 'obci_eeg1')
stream2 = resolve_stream('name', 'obci_eeg2')
stream3 = resolve_stream('name', 'obci_eeg3')
stream1 = resolve_stream('type', 'EEG')
stream2 = resolve_stream('type', 'AUX')
stream3 = resolve_stream('type', 'FFT')

# create a new inlet to read from the stream
inlet = StreamInlet(stream1[0])
inlet2 = StreamInlet(stream2[0])
inlet3 = StreamInlet(stream3[0])

while True:
for i in range(numStreams):
# get a new sample (you can also omit the timestamp part if you're not
# interested in it)
if i == 0:
chunk, timestamps = inlet.pull_chunk()
if timestamps:
print("Stream", i + 1, " == ", chunk)
elif i == 1:
chunk, timestamps = inlet2.pull_chunk()
if timestamps:
print("Stream", i + 1, " == ", chunk)
elif i == 2:
chunk, timestamps = inlet3.pull_chunk()
if timestamps:
print("Stream", i + 1, " == ", chunk)
def testLSLSamplingRates():
print( "Testing Sampling Rates..." )
start = time.time()
numSamples1 = 0
numSamples2 = 0
numSamples3 = 0
while time.time() < start + 5:
# get a new sample (you can also omit the timestamp part if you're not
# interested in it)
for i in range(numStreams):
if i == 0:
chunk, timestamps = inlet.pull_chunk()
if timestamps:
numSamples1 += 1
elif i == 1:
chunk, timestamps2 = inlet2.pull_chunk()
if timestamps2:
numSamples2 += 1
elif i == 2:
chunk, timestamps3 = inlet3.pull_chunk()
if timestamps3:
numSamples3 += 1
#print("Stream", i + 1, " == ", chunk)
print( "Stream 1 Sampling Rate == ", numSamples1, " | Type : EEG")
print( "Stream 2 Sampling Rate == ", numSamples2, " | Type : AUX")
print( "Stream 3 Sampling Rate == ", numSamples3, " | Type : FFT")


testLSLSamplingRates()
11 changes: 11 additions & 0 deletions Networking-Test-Kit/Serial/SerialPortListTest.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import com.fazecast.jSerialComm.*;

println("GETTING A LIST OF SERIAL PORTS: ");

printArray(SerialPort.getCommPorts());

SerialPort comPort = SerialPort.getCommPorts()[1];

println(comPort.getSystemPortName());

println("Done :)");
85 changes: 85 additions & 0 deletions Networking-Test-Kit/Serial/USB4JavaTest.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright (C) 2014 Klaus Reimer <[email protected]>
* See LICENSE.txt for licensing information.
*/
import java.nio.ByteBuffer;
import org.usb4java.Context;
import org.usb4java.Device;
import org.usb4java.DeviceDescriptor;
import org.usb4java.DeviceList;
import org.usb4java.LibUsb;
import org.usb4java.LibUsbException;
import org.usb4java.BufferUtils;

// This example will fetch Vendor ID and Product ID for all USB ports
// However, this doesn't help identify COM port names across OS

/**
* Simply lists all available USB devices.
*
* @author Klaus Reimer <k@ailis.de>
*/

// Create the libusb context
Context context = new Context();

// Initialize the libusb context
int result = LibUsb.init(context);
if (result < 0)
{
throw new LibUsbException("Unable to initialize libusb", result);
}

// Read the USB device list
DeviceList list = new DeviceList();
result = LibUsb.getDeviceList(context, list);
if (result < 0)
{
throw new LibUsbException("Unable to get device list", result);
}

try
{
// Iterate over all devices and list them
for (Device device: list)
{
int address = LibUsb.getDeviceAddress(device);
int busNumber = LibUsb.getBusNumber(device);
DeviceDescriptor descriptor = new DeviceDescriptor();
result = LibUsb.getDeviceDescriptor(device, descriptor);
if (result < 0)
{
throw new LibUsbException(
"Unable to read device descriptor", result);
}
System.out.format(
"Bus %03d, Device %03d: Vendor %04x, Product %04x%n",
busNumber, address, descriptor.idVendor(),
descriptor.idProduct());

println(descriptor.dump());

ByteBuffer path = BufferUtils.allocateByteBuffer(8);
result = LibUsb.getPortNumbers(device, path);
if (result > 0)
{
for (int i = 0; i < result; i++)
{
System.out.print(path.get(i));
if (i + 1 < result) System.out.print("-");
}
System.out.println("");
}

}


}
finally
{
// Ensure the allocated device list is freed
LibUsb.freeDeviceList(list, true);
}

// Deinitialize the libusb context
LibUsb.exit(context);
Loading

0 comments on commit aa6352c

Please sign in to comment.