removed toString and changed setChannelValueByName to return boolean status

This commit is contained in:
Lucas Pleß 2012-03-06 17:09:25 +01:00
parent f0f090ee31
commit 19d286fa29
1 changed files with 5 additions and 8 deletions

View File

@ -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();
}
}