Executable Not Functioning Properly
in
Integration and Hardware
•
4 months ago
Hello,
I have the following code that supposed to listen on the Local network port and display the incoming data.
I want to have it as a single executable... I tried the export function, but all I get is a white screen...
Any thoughts on this:
PS. I am running a windows 7 machine.
PPS. processing version 2.0b9
Thanks
I have the following code that supposed to listen on the Local network port and display the incoming data.
I want to have it as a single executable... I tried the export function, but all I get is a white screen...
Any thoughts on this:
PS. I am running a windows 7 machine.
PPS. processing version 2.0b9
Thanks
- // Network Monitor Program
// PABLO: 192.168.1.67:5204
// CARLOS: 192.168.1.73:5206
import processing.net.*;
Client PABLO;
Client CARLOS;
PFont f;
PImage Biper;
String[] beep = { "start", "C:/notify.wav" };
String dataPablo = null;
String lastDataPablo = null;
String dataCarlos = null;
String lastDataCarlos = null;
boolean flagP = false;
boolean flagC = false;
// checking variables
int lastCheck = 60000;
int count = 0;
void setup() {
size(385,200);
//frame.setAlwaysOnTop(true);
Biper = loadImage("BiperLogo.jpg");
imageMode(CORNERS);
//lastCheck = minute();
PABLO = new Client(this, "192.168.1.67",5204);
CARLOS = new Client(this, "192.168.1.73",5206);
}
void draw() {
background(200);
image(Biper,5,5, 380,100);
// check values every minute
if (millis() > lastCheck) {
if ((dataPablo.equals(lastDataPablo)) ||
(dataCarlos.equals(lastDataCarlos))) {
// Pablo or Carlos is the same
println("Fail "+ count++);
frame.toFront();
open(beep);
} else {
// Pablo or Carlos is different
}
lastDataPablo = dataPablo;
lastDataCarlos = dataCarlos;
lastCheck += 60000;
}
fill(50);
textSize(30);
textAlign(CENTER);
text("PABLO", 96, 140);
textAlign(CENTER);
text("CARLOS", 288, 140);
if (PABLO.available() > 0) {
dataPablo = PABLO.readStringUntil(10);
flagP = true;
}
if (CARLOS.available() > 0) {
dataCarlos = CARLOS.readStringUntil(10);
flagC = true;
}
textSize(20);
textAlign(CENTER);
if (flagP && (dataPablo != null)) {
text(dataPablo, 96, 170);
}
if (flagC && (dataCarlos != null)) {
text(dataCarlos, 288, 170);
}
}
void keyPressed(){
frame.toBack();
}
1