From 19d286fa293895ce68f891986fe1a26df4f49576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Tue, 6 Mar 2012 17:09:25 +0100 Subject: [PATCH] removed toString and changed setChannelValueByName to return boolean status --- .../java/de/ctdo/bunti/model/BuntiDMXDevice.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/ctdo/bunti/model/BuntiDMXDevice.java b/src/main/java/de/ctdo/bunti/model/BuntiDMXDevice.java index 12359f1..99c8859 100644 --- a/src/main/java/de/ctdo/bunti/model/BuntiDMXDevice.java +++ b/src/main/java/de/ctdo/bunti/model/BuntiDMXDevice.java @@ -14,7 +14,6 @@ public abstract class BuntiDMXDevice extends BuntiDevice { public BuntiDMXDevice(int deviceId, int startAddress, String name) { super(deviceId,name); this.startAddress = startAddress; - } public final long getLastSendOut() { @@ -37,13 +36,16 @@ public abstract class BuntiDMXDevice extends BuntiDevice { * Set channel value by given channel name. * @param name The channel name to change the value. * @param value The channel value to set. + * @return True on success, otherwise false */ - protected final void setChannelValueByName(String name, int value) { + protected final boolean setChannelValueByName(String name, int value) { DMXChannel dx = dmxChannels.getChannelByName(name); if(dx != null) { dx.setValue(DMX.sanitizeDMXValue(value)); + lastChangedNow(); + return true; } - lastChangedNow(); + return false; } /** @@ -145,9 +147,4 @@ public abstract class BuntiDMXDevice extends BuntiDevice { public final boolean addChannel(DMXChannel channel){ return dmxChannels.addChannel(channel); } - - @Override - public String toString() { - return "BuntiDMXDevice " + getDeviceId() + ", " + getDeviceName(); - } }