@@ -149,7 +149,6 @@ void serialEvent(Serial port) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void writeRawData_dataPacket_bdf() {
|
||||
fileoutput_bdf.writeRawData_dataPacket(dataPacketBuff[curBDFDataPacketInd]);
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ void parseKeycode(int val) {
|
||||
break;
|
||||
case 10:
|
||||
println("Enter was pressed.");
|
||||
// drawPresentation = !drawPresentation;
|
||||
drawPresentation = !drawPresentation;
|
||||
break;
|
||||
case 16:
|
||||
println("OpenBCI_GUI: parseKeycode(" + val + "): received SHIFT keypress. Ignoring...");
|
||||
@@ -372,7 +372,6 @@ void parseKeycode(int val) {
|
||||
println("OpenBCI_GUI: parseKeycode(" + val + "): received HOME keypress. Ignoring...");
|
||||
break;
|
||||
case 37:
|
||||
println("Slide Back!");
|
||||
if (millis() - myPresentation.timeOfLastSlideChange >= 250) {
|
||||
if(myPresentation.currentSlide >= 0){
|
||||
myPresentation.slideBack();
|
||||
@@ -385,7 +384,6 @@ void parseKeycode(int val) {
|
||||
dataProcessing_user.switchesActive = true;
|
||||
break;
|
||||
case 39:
|
||||
println("Forward!");
|
||||
if (millis() - myPresentation.timeOfLastSlideChange >= 250) {
|
||||
if(myPresentation.currentSlide < myPresentation.presentationSlides.length - 1){
|
||||
myPresentation.slideForward();
|
||||
|
||||
@@ -920,9 +920,10 @@ void systemDraw() { //for drawing to the screen
|
||||
}
|
||||
}
|
||||
|
||||
//draw presentation last, bc it is intended to be rendered on top of the GUI ...
|
||||
if (drawPresentation) {
|
||||
myPresentation.draw();
|
||||
emg_widget.drawTriggerFeedback();
|
||||
// emg_widget.drawTriggerFeedback();
|
||||
//dataProcessing_user.drawTriggerFeedback();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,73 +25,41 @@ boolean drawPresentation = false;
|
||||
|
||||
class Presentation {
|
||||
//presentation images
|
||||
PImage presentationSlides[] = new PImage[16];
|
||||
int slideCount = 4;
|
||||
PImage presentationSlides[] = new PImage[slideCount];
|
||||
float timeOfLastSlideChange = 0;
|
||||
int currentSlide = 1;
|
||||
int slideCount = 0;
|
||||
int currentSlide = 0;
|
||||
boolean lockSlides = false;
|
||||
|
||||
Presentation (){
|
||||
//loading presentation images
|
||||
println("attempting to load images for presentation...");
|
||||
// presentationSlides[0] = loadImage("prez-images/DemocratizationOfNeurotech.001.jpg");
|
||||
// presentationSlides[1] = loadImage("prez-images/DemocratizationOfNeurotech.001.jpg");
|
||||
// presentationSlides[2] = loadImage("prez-images/DemocratizationOfNeurotech.002.jpg");
|
||||
// presentationSlides[3] = loadImage("prez-images/DemocratizationOfNeurotech.003.jpg");
|
||||
// presentationSlides[4] = loadImage("prez-images/DemocratizationOfNeurotech.004.jpg");
|
||||
// presentationSlides[5] = loadImage("prez-images/DemocratizationOfNeurotech.005.jpg");
|
||||
// presentationSlides[6] = loadImage("prez-images/DemocratizationOfNeurotech.006.jpg");
|
||||
// presentationSlides[7] = loadImage("prez-images/DemocratizationOfNeurotech.007.jpg");
|
||||
// presentationSlides[8] = loadImage("prez-images/DemocratizationOfNeurotech.008.jpg");
|
||||
// presentationSlides[9] = loadImage("prez-images/DemocratizationOfNeurotech.009.jpg");
|
||||
// presentationSlides[10] = loadImage("prez-images/DemocratizationOfNeurotech.010.jpg");
|
||||
// presentationSlides[11] = loadImage("prez-images/DemocratizationOfNeurotech.011.jpg");
|
||||
// presentationSlides[12] = loadImage("prez-images/DemocratizationOfNeurotech.012.jpg");
|
||||
// presentationSlides[13] = loadImage("prez-images/DemocratizationOfNeurotech.013.jpg");
|
||||
// presentationSlides[14] = loadImage("prez-images/DemocratizationOfNeurotech.014.jpg");
|
||||
// presentationSlides[15] = loadImage("prez-images/DemocratizationOfNeurotech.015.jpg");
|
||||
//presentationSlides[16] = loadImage("prez-images/DemocratizationOfNeurotech.016.jpg");
|
||||
//presentationSlides[17] = loadImage("prez-images/DemocratizationOfNeurotech.017.jpg");
|
||||
//presentationSlides[18] = loadImage("prez-images/DemocratizationOfNeurotech.018.jpg");
|
||||
//presentationSlides[19] = loadImage("prez-images/DemocratizationOfNeurotech.019.jpg");
|
||||
//presentationSlides[20] = loadImage("prez-images/DemocratizationOfNeurotech.020.jpg");
|
||||
//presentationSlides[21] = loadImage("prez-images/DemocratizationOfNeurotech.021.jpg");
|
||||
//presentationSlides[22] = loadImage("prez-images/DemocratizationOfNeurotech.022.jpg");
|
||||
//presentationSlides[23] = loadImage("prez-images/DemocratizationOfNeurotech.023.jpg");
|
||||
//presentationSlides[24] = loadImage("prez-images/DemocratizationOfNeurotech.024.jpg");
|
||||
//presentationSlides[25] = loadImage("prez-images/DemocratizationOfNeurotech.025.jpg");
|
||||
//presentationSlides[26] = loadImage("prez-images/DemocratizationOfNeurotech.026.jpg");
|
||||
//presentationSlides[27] = loadImage("prez-images/DemocratizationOfNeurotech.027.jpg");
|
||||
//presentationSlides[28] = loadImage("prez-images/DemocratizationOfNeurotech.028.jpg");
|
||||
//presentationSlides[29] = loadImage("prez-images/DemocratizationOfNeurotech.029.jpg");
|
||||
//presentationSlides[30] = loadImage("prez-images/DemocratizationOfNeurotech.030.jpg");
|
||||
//presentationSlides[31] = loadImage("prez-images/DemocratizationOfNeurotech.031.jpg");
|
||||
//presentationSlides[32] = loadImage("prez-images/DemocratizationOfNeurotech.032.jpg");
|
||||
//presentationSlides[33] = loadImage("prez-images/DemocratizationOfNeurotech.033.jpg");
|
||||
//presentationSlides[34] = loadImage("prez-images/DemocratizationOfNeurotech.034.jpg");
|
||||
//presentationSlides[35] = loadImage("prez-images/DemocratizationOfNeurotech.035.jpg");
|
||||
//presentationSlides[36] = loadImage("prez-images/DemocratizationOfNeurotech.036.jpg");
|
||||
//presentationSlides[37] = loadImage("prez-images/DemocratizationOfNeurotech.037.jpg");
|
||||
//presentationSlides[38] = loadImage("prez-images/DemocratizationOfNeurotech.038.jpg");
|
||||
//presentationSlides[39] = loadImage("prez-images/DemocratizationOfNeurotech.039.jpg");
|
||||
//presentationSlides[40] = loadImage("prez-images/DemocratizationOfNeurotech.040.jpg");
|
||||
//presentationSlides[41] = loadImage("prez-images/DemocratizationOfNeurotech.041.jpg");
|
||||
//presentationSlides[42] = loadImage("prez-images/DemocratizationOfNeurotech.042.jpg");
|
||||
//presentationSlides[43] = loadImage("prez-images/DemocratizationOfNeurotech.043.jpg");
|
||||
//presentationSlides[44] = loadImage("prez-images/DemocratizationOfNeurotech.044.jpg");
|
||||
//presentationSlides[45] = loadImage("prez-images/DemocratizationOfNeurotech.045.jpg");
|
||||
//presentationSlides[46] = loadImage("prez-images/DemocratizationOfNeurotech.046.jpg");
|
||||
//presentationSlides[47] = loadImage("prez-images/DemocratizationOfNeurotech.047.jpg");
|
||||
//presentationSlides[48] = loadImage("prez-images/DemocratizationOfNeurotech.048.jpg");
|
||||
slideCount = 0;
|
||||
presentationSlides[0] = loadImage("prez-images/Presentation.000.jpg");
|
||||
presentationSlides[1] = loadImage("prez-images/Presentation.001.jpg");
|
||||
presentationSlides[2] = loadImage("prez-images/Presentation.002.jpg");
|
||||
presentationSlides[3] = loadImage("prez-images/Presentation.003.jpg");
|
||||
// presentationSlides[4] = loadImage("prez-images/Presentation.004.jpg");
|
||||
// presentationSlides[5] = loadImage("prez-images/Presentation.005.jpg");
|
||||
// presentationSlides[6] = loadImage("prez-images/Presentation.006.jpg");
|
||||
// presentationSlides[7] = loadImage("prez-images/Presentation.007.jpg");
|
||||
// presentationSlides[8] = loadImage("prez-images/Presentation.008.jpg");
|
||||
// presentationSlides[9] = loadImage("prez-images/Presentation.009.jpg");
|
||||
// presentationSlides[10] = loadImage("prez-images/Presentation.010.jpg");
|
||||
// presentationSlides[11] = loadImage("prez-images/Presentation.011.jpg");
|
||||
// presentationSlides[12] = loadImage("prez-images/Presentation.012.jpg");
|
||||
// presentationSlides[13] = loadImage("prez-images/Presentation.013.jpg");
|
||||
// presentationSlides[14] = loadImage("prez-images/Presentation.014.jpg");
|
||||
// presentationSlides[15] = loadImage("prez-images/Presentation.015.jpg");
|
||||
// slideCount = 4;
|
||||
println("DONE loading images!");
|
||||
|
||||
}
|
||||
|
||||
public void slideForward() {
|
||||
if(currentSlide < slideCount - 1 && drawPresentation && !lockSlides){
|
||||
println("Slide Forward!");
|
||||
currentSlide++;
|
||||
} else{
|
||||
println("No more slides. Can't go forward...");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,6 +67,8 @@ class Presentation {
|
||||
if(currentSlide > 0 && drawPresentation && !lockSlides){
|
||||
println("Slide Back!");
|
||||
currentSlide--;
|
||||
} else {
|
||||
println("On the first slide. Can't go back...");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//
|
||||
// W_template.pde (ie "Widget Template")
|
||||
//
|
||||
// This is a Template Widget, intended to be used as a starting point for OpenBCI Community members that want to develop their own custom widgets!
|
||||
// Good luck! If you embark on this journey, please let us know. Your contributions are valuable to everyone!
|
||||
//
|
||||
// Created by: Conor Russomanno, November 2016
|
||||
//
|
||||
///////////////////////////////////////////////////,
|
||||
|
||||
class W_networking extends Widget {
|
||||
|
||||
//to see all core variables/methods of the Widget class, refer to Widget.pde
|
||||
//put your custom variables here...
|
||||
Button widgetTemplateButton;
|
||||
int protocolMode = 0;
|
||||
|
||||
W_networking(PApplet _parent){
|
||||
super(_parent); //calls the parent CONSTRUCTOR method of Widget (DON'T REMOVE)
|
||||
|
||||
//This is the protocol for setting up dropdowns.
|
||||
//Note that these 3 dropdowns correspond to the 3 global functions below
|
||||
//You just need to make sure the "id" (the 1st String) has the same name as the corresponding function
|
||||
addDropdown("Protocol", "Drop 1", Arrays.asList("OSC", "UDC", "LSL", "Serial"), protocolMode);
|
||||
// addDropdown("Dropdown2", "Drop 2", Arrays.asList("C", "D", "E"), 1);
|
||||
// addDropdown("Dropdown3", "Drop 3", Arrays.asList("F", "G", "H", "I"), 3);
|
||||
|
||||
widgetTemplateButton = new Button (x + w/2, y + h/2, 200, navHeight, "Design Your Own Widget!", 12);
|
||||
widgetTemplateButton.setFont(p4, 14);
|
||||
widgetTemplateButton.setURL("http://docs.openbci.com/OpenBCI%20Software/");
|
||||
|
||||
}
|
||||
|
||||
void update(){
|
||||
super.update(); //calls the parent update() method of Widget (DON'T REMOVE)
|
||||
|
||||
//put your code here...
|
||||
|
||||
}
|
||||
|
||||
void draw(){
|
||||
super.draw(); //calls the parent draw() method of Widget (DON'T REMOVE)
|
||||
|
||||
//put your code here... //remember to refer to x,y,w,h which are the positioning variables of the Widget class
|
||||
pushStyle();
|
||||
|
||||
if(protocolMode == 0){
|
||||
fill(255,0,0);
|
||||
} else if (protocolMode == 1){
|
||||
fill(0,255,0);
|
||||
} else if (protocolMode == 2){
|
||||
fill(0,0,255);
|
||||
} else if (protocolMode == 3){
|
||||
fill(0,255,255);
|
||||
}
|
||||
|
||||
rect(x, y, w, h);
|
||||
|
||||
widgetTemplateButton.draw();
|
||||
|
||||
popStyle();
|
||||
|
||||
}
|
||||
|
||||
void screenResized(){
|
||||
super.screenResized(); //calls the parent screenResized() method of Widget (DON'T REMOVE)
|
||||
|
||||
//put your code here...
|
||||
widgetTemplateButton.setPos(x + w/2 - widgetTemplateButton.but_dx/2, y + h/2 - widgetTemplateButton.but_dy/2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void mousePressed(){
|
||||
super.mousePressed(); //calls the parent mousePressed() method of Widget (DON'T REMOVE)
|
||||
|
||||
//put your code here...
|
||||
if(widgetTemplateButton.isMouseHere()){
|
||||
widgetTemplateButton.setIsActive(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void mouseReleased(){
|
||||
super.mouseReleased(); //calls the parent mouseReleased() method of Widget (DON'T REMOVE)
|
||||
|
||||
//put your code here...
|
||||
if(widgetTemplateButton.isActive && widgetTemplateButton.isMouseHere()){
|
||||
widgetTemplateButton.goToURL();
|
||||
}
|
||||
widgetTemplateButton.setIsActive(false);
|
||||
|
||||
}
|
||||
|
||||
//add custom functions here
|
||||
void customFunction(){
|
||||
//this is a fake function... replace it with something relevant to this widget
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//These functions need to be global! These functions are activated when an item from the corresponding dropdown is selected
|
||||
void Protocol(int n){
|
||||
println("Item " + (n+1) + " selected from Dropdown 1");
|
||||
// if(n==0){
|
||||
// protcolMode = 0;
|
||||
// } else if(n==1){
|
||||
// protcolMode = 1;
|
||||
// } else if(n==2){
|
||||
// protcolMode = 2;
|
||||
// } else if(n==3){
|
||||
// protcolMode = 3;
|
||||
// }
|
||||
w_networking.protocolMode = n;
|
||||
|
||||
closeAllDropdowns(); // do this at the end of all widget-activated functions to ensure proper widget interactivity ... we want to make sure a click makes the menu close
|
||||
}
|
||||
@@ -16,6 +16,7 @@ W_timeSeries w_timeSeries;
|
||||
W_fft w_fft;
|
||||
W_headPlot w_headPlot;
|
||||
W_accelerometer w_accelerometer;
|
||||
W_networking w_networking;
|
||||
W_ganglionImpedance w_ganglionImpedance;
|
||||
W_template w_template1;
|
||||
W_template w_template2;
|
||||
@@ -45,6 +46,10 @@ void setupWidgets(PApplet _this, ArrayList<Widget> w){
|
||||
w_accelerometer = new W_accelerometer(_this);
|
||||
w_accelerometer.setTitle("Accelerometer");
|
||||
addWidget(w_accelerometer, w);
|
||||
//
|
||||
// w_networking = new W_networking(_this);
|
||||
// w_networking.setTitle("Networking");
|
||||
// addWidget(w_networking, w);
|
||||
|
||||
w_template1 = new W_template(_this);
|
||||
w_template1.setTitle("Widget Template 1");
|
||||
|
||||
|
Antes Largura: | Altura: | Tamanho: 328 KiB |
|
Antes Largura: | Altura: | Tamanho: 341 KiB |
|
Antes Largura: | Altura: | Tamanho: 509 KiB |
|
Antes Largura: | Altura: | Tamanho: 459 KiB |
|
Antes Largura: | Altura: | Tamanho: 288 KiB |
|
Antes Largura: | Altura: | Tamanho: 555 KiB |
|
Antes Largura: | Altura: | Tamanho: 424 KiB |
|
Antes Largura: | Altura: | Tamanho: 310 KiB |
|
Antes Largura: | Altura: | Tamanho: 539 KiB |
|
Antes Largura: | Altura: | Tamanho: 374 KiB |
|
Antes Largura: | Altura: | Tamanho: 412 KiB |
|
Antes Largura: | Altura: | Tamanho: 475 KiB |
|
Antes Largura: | Altura: | Tamanho: 463 KiB |
|
Antes Largura: | Altura: | Tamanho: 613 KiB |
|
Antes Largura: | Altura: | Tamanho: 218 KiB |
|
Depois Largura: | Altura: | Tamanho: 75 KiB |
|
Depois Largura: | Altura: | Tamanho: 74 KiB |
|
Depois Largura: | Altura: | Tamanho: 76 KiB |
|
Depois Largura: | Altura: | Tamanho: 76 KiB |