Skip to content

Commit

Permalink
minor changes in test classes
Browse files Browse the repository at this point in the history
  • Loading branch information
matsfunk committed Nov 11, 2015
1 parent 37ecc6c commit 5405644
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions test/channel/TestChannelReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class TestChannelReceiver extends PApplet {

public void setup() {
size(200, 200);
noStroke();

// open connection to local OOCSI server
// (for more information how to run an OOCSI server refer to: https://iddi.github.io/oocsi/)
Expand Down
8 changes: 3 additions & 5 deletions test/data/TestDataReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import nl.tue.id.oocsi.OOCSI;
import nl.tue.id.oocsi.OOCSIEvent;
import processing.core.PApplet;
import processing.core.PVector;

/**
* example application - receives color and position values from OOCSI, on the channel "datachannel"
Expand All @@ -20,7 +19,7 @@ public class TestDataReceiver extends PApplet {
double numberDouble = 0;
long numberLong = 0;
String numberString = "";
PVector numberObject = new PVector(0, 0);
float[] numberArray = new float[] { 0, 0 };
Date dateObject = new Date();

public void setup() {
Expand Down Expand Up @@ -51,7 +50,7 @@ public void draw() {
text(numberString, 20, 20);
text(dateObject.toString(), 20, height - 20);
fill(220);
rect(numberObject.x, numberObject.y, 20, 20);
rect(numberArray[0], numberArray[1], 20, 20);
}

public void datachannel(OOCSIEvent event) {
Expand All @@ -72,8 +71,7 @@ public void datachannel(OOCSIEvent event) {
numberString = event.getString("string");

// get, cast and save array value
float[] floatArray = (float[]) event.getObject("array");
numberObject = new PVector(floatArray[0], floatArray[1]);
numberArray = (float[]) event.getObject("array");

// get, cast and save Date object value
dateObject = (Date) event.getObject("object");
Expand Down

0 comments on commit 5405644

Please sign in to comment.