Signed-off-by: Keith Packard <keithp@keithp.com>
}
public void abort() throws InterruptedException {
}
public void abort() throws InterruptedException {
- System.out.printf("Attempting to abort monitor thread\n");
- System.out.printf("Interrupting\n");
interrupt();
link.abort_reply();
Thread.sleep(100);
}
interrupt();
link.abort_reply();
Thread.sleep(100);
}
- System.out.printf("Appears to be dead now\n");
}
public boolean parse_line(String line) {
}
public boolean parse_line(String line) {
- System.out.printf ("parse %s\n", line);
String[] items = line.split("\\s+");
if (line.startsWith("Pressure:")) {
if (items.length >= 2) {
raw_pres = Integer.parseInt(items[1]);
String[] items = line.split("\\s+");
if (line.startsWith("Pressure:")) {
if (items.length >= 2) {
raw_pres = Integer.parseInt(items[1]);
- System.out.printf ("raw_pres %d\n", raw_pres);
}
} else if (line.startsWith("Temperature:")) {
if (items.length >= 2)
}
} else if (line.startsWith("Temperature:")) {
if (items.length >= 2)
if (items.length >= 3)
reserved = Integer.parseInt(items[2]);
} else if (line.startsWith("ms5607 sens:")) {
if (items.length >= 3)
reserved = Integer.parseInt(items[2]);
} else if (line.startsWith("ms5607 sens:")) {
- System.out.printf ("found sens length %d\n", items.length);
if (items.length >= 3) {
sens = Integer.parseInt(items[2]);
if (items.length >= 3) {
sens = Integer.parseInt(items[2]);
- System.out.printf ("sens %d\n", sens);
}
} else if (line.startsWith("ms5607 off:")) {
if (items.length >= 3)
}
} else if (line.startsWith("ms5607 off:")) {
if (items.length >= 3)
throw new TimeoutException();
}
if (!parse_line(line)) {
throw new TimeoutException();
}
if (!parse_line(line)) {
- System.out.printf ("stop parsing at %s\n", line);
- System.out.printf ("sens %d off %d tcs %d tco %d tref %d tempsens %d crc %d pres %d temp %d\n",
- sens, off, tcs, tco, tref, tempsens, crc, raw_pres, raw_temp);
- System.out.printf ("pa %d cc %d\n", pa, cc);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
- System.out.printf("Closing idle monitor window\n");
try {
disconnect();
} catch (Exception ex) {
System.out.println(Arrays.toString(ex.getStackTrace()));
}
try {
disconnect();
} catch (Exception ex) {
System.out.println(Arrays.toString(ex.getStackTrace()));
}
- System.out.printf("hiding\n");
setVisible(false);
dispose();
AltosUIPreferences.unregister_font_listener(AltosIdleMonitorUI.this);
setVisible(false);
dispose();
AltosUIPreferences.unregister_font_listener(AltosIdleMonitorUI.this);