changed offline lines to "no data"

This commit is contained in:
Lucas Pleß 2014-04-23 22:35:04 +02:00
parent bcdd2e4013
commit 3c2cb48eed
1 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import java.awt.event.ActionEvent;
public class ActorDisplay { public class ActorDisplay {
private final static Color onColor = Color.WHITE; private final static Color onColor = Color.WHITE;
private final static Color offColor = Color.RED; private final static Color offColor = Color.RED;
private final static String offText = "no data";
private JPanel actorPanel; private JPanel actorPanel;
private JLabel lblCaption; private JLabel lblCaption;
@ -78,43 +79,49 @@ public class ActorDisplay {
if (++counterTemperature > timeout) { if (++counterTemperature > timeout) {
lblTemperature.setForeground(offColor); lblTemperature.setForeground(offColor);
lblTemperature.setText(offText);
} else { } else {
lblTemperature.setForeground(onColor); lblTemperature.setForeground(onColor);
} }
if (++counterPulse > timeout) { if (++counterPulse > timeout) {
lblPulse.setForeground(offColor); lblPulse.setForeground(offColor);
lblPulse.setText(offText);
} else { } else {
lblPulse.setForeground(onColor); lblPulse.setForeground(onColor);
} }
if (++counterOxy > timeout) { if (++counterOxy > timeout) {
lblOxy.setForeground(offColor); lblOxy.setForeground(offColor);
lblOxy.setText(offText);
} else { } else {
lblOxy.setForeground(onColor); lblOxy.setForeground(onColor);
} }
if (++counterEkg > timeout) { if (++counterEkg > timeout) {
lblEkg.setForeground(offColor); lblEkg.setForeground(offColor);
lblEkg.setText(offText);
} else { } else {
lblEkg.setForeground(onColor); lblEkg.setForeground(onColor);
} }
if (++counterEmg > timeout) { if (++counterEmg > timeout) {
lblEmg.setForeground(offColor); lblEmg.setForeground(offColor);
lblEkg.setText(offText);
} else { } else {
lblEmg.setForeground(onColor); lblEmg.setForeground(onColor);
} }
if (++counterHeartbeat > timeout) { if (++counterHeartbeat > timeout) {
lblHeartbeat.setForeground(offColor); lblHeartbeat.setForeground(offColor);
lblHeartbeat.setText("no data"); lblHeartbeat.setText(offText);
} else { } else {
lblHeartbeat.setForeground(onColor); lblHeartbeat.setForeground(onColor);
} }
if (++counterBreath > timeout) { if (++counterBreath > timeout) {
lblBreath.setForeground(offColor); lblBreath.setForeground(offColor);
lblBreath.setText(offText);
} else { } else {
lblBreath.setForeground(onColor); lblBreath.setForeground(onColor);
} }