add spout

This commit is contained in:
interfisch 2018-12-27 15:08:41 +01:00
parent 749509902c
commit c0a4e41bff
1 changed files with 17 additions and 2 deletions

View File

@ -3,6 +3,13 @@ import java.io.FileWriter;
import java.io.*;
import java.util.*;
import spout.*;
boolean spoutactive=true;
Spout spout;
PFont fontregular;
PImage image_line;
@ -58,6 +65,12 @@ void setup() {
pw=createWriter("speeds.txt");
background(0);
if (spoutactive){
spout=new Spout(this);
spout.createSender("Spout Processing");
}
}
@ -82,7 +95,6 @@ void draw() {
pw.flush();
unitdisplay=int(random(0,unitdisplay_count));
unitdisplay=1;
println("unitdisplay: "+unitdisplay);
triggerspeedmin=getTimesPercentile(0.8);
@ -121,7 +133,7 @@ void draw() {
text(nf(speedfloat*0.539957,1,2) + " knots" , xtext, ytext);
break;
case 6:
text(nf(speedfloat*1079000000,1,0) + " c" , xtext, ytext);
text(nf(speedfloat*0.000000000926567,1,9) + " c" , xtext, ytext);
break;
case 7:
text(nf(speedfloat*54.67469,1,0) + " ft/min" , xtext, ytext);
@ -154,6 +166,9 @@ void draw() {
text( "speed trap: "+nf(triggerspeedmin,1,1) +" km/h", 10, height-50);
if (spoutactive){
spout.sendTexture();
}
}