clean up
This commit is contained in:
parent
d5084b1290
commit
99ae75b88f
|
@ -2,6 +2,7 @@ package de.ctdo.bunti.dao;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -28,7 +29,6 @@ public class BuntiDevicesDAOImpl implements BuntiDevicesDAO {
|
||||||
devices.add(new Par56Spot(deviceID++, 11, "Par56 Lampe 3"));
|
devices.add(new Par56Spot(deviceID++, 11, "Par56 Lampe 3"));
|
||||||
devices.add(new Par56Spot(deviceID++, 16, "Par56 Lampe 4"));
|
devices.add(new Par56Spot(deviceID++, 16, "Par56 Lampe 4"));
|
||||||
devices.add(new Strobe1500(deviceID++, 21, "Stroboskop 1"));
|
devices.add(new Strobe1500(deviceID++, 21, "Stroboskop 1"));
|
||||||
|
|
||||||
devices.add(new Par56Spot(deviceID++, 508, "Par56 Lampe 5"));
|
devices.add(new Par56Spot(deviceID++, 508, "Par56 Lampe 5"));
|
||||||
logger.debug("added dummy devices in DAO");
|
logger.debug("added dummy devices in DAO");
|
||||||
}
|
}
|
||||||
|
@ -36,14 +36,19 @@ public class BuntiDevicesDAOImpl implements BuntiDevicesDAO {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final Collection<BuntiDMXDevice> getAllDMXDevices() {
|
public final Collection<BuntiDMXDevice> getAllDMXDevices() {
|
||||||
List<BuntiDMXDevice> liste = new ArrayList<BuntiDMXDevice>();
|
List<BuntiDMXDevice> list = new ArrayList<BuntiDMXDevice>();
|
||||||
for (BuntiDevice device : devices) {
|
for (BuntiDevice device : devices) {
|
||||||
if( device instanceof BuntiDMXDevice ) {
|
if( device instanceof BuntiDMXDevice ) {
|
||||||
liste.add((BuntiDMXDevice) device);
|
list.add((BuntiDMXDevice) device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return liste;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final Collection<BuntiDevice> getAllDevices() {
|
||||||
|
return Collections.unmodifiableCollection(devices);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final BuntiDevice getDeviceById(int deviceId) {
|
public final BuntiDevice getDeviceById(int deviceId) {
|
||||||
|
|
|
@ -1,98 +1,112 @@
|
||||||
package de.ctdo.bunti.model;
|
package de.ctdo.bunti.model;
|
||||||
|
|
||||||
|
import de.ctdo.bunti.dmx.DMX;
|
||||||
|
import de.ctdo.bunti.dmx.DMXChannel;
|
||||||
|
import de.ctdo.bunti.dmx.DMXChannels;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import de.ctdo.bunti.dmx.*;
|
|
||||||
|
|
||||||
public abstract class BuntiDMXDevice extends BuntiDevice {
|
public abstract class BuntiDMXDevice extends BuntiDevice {
|
||||||
private int startAddress;
|
private int startAddress;
|
||||||
private long lastSendOut;
|
private long lastSendOut;
|
||||||
private DMXChannels dmxChannels = new DMXChannels();
|
private final DMXChannels dmxChannels = new DMXChannels();
|
||||||
|
|
||||||
public BuntiDMXDevice(int deviceId, int startAddress, String name) {
|
public BuntiDMXDevice(int deviceId, int startAddress, String name) {
|
||||||
super(deviceId,name);
|
super(deviceId, name);
|
||||||
this.startAddress = startAddress;
|
this.startAddress = startAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final long getLastSendOut() {
|
|
||||||
return lastSendOut;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final void setSendOutNow() {
|
public final long getLastSendOut() {
|
||||||
this.lastSendOut = System.currentTimeMillis();
|
return lastSendOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getStartAddress() {
|
|
||||||
return startAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final void setStartAddress(int startAddress) {
|
public final void setSendOutNow() {
|
||||||
this.startAddress = startAddress;
|
this.lastSendOut = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public final int getStartAddress() {
|
||||||
* Set channel value by given channel name.
|
return startAddress;
|
||||||
* @param name The channel name to change the value.
|
}
|
||||||
* @param value The channel value to set.
|
|
||||||
|
public final void setStartAddress(int startAddress) {
|
||||||
|
this.startAddress = startAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* @return True on success, otherwise false
|
||||||
*/
|
*/
|
||||||
protected final boolean setChannelValueByName(String name, int value) {
|
protected final boolean setChannelValueByName(String name, int value) {
|
||||||
DMXChannel dx = dmxChannels.getChannelByName(name);
|
DMXChannel dx = dmxChannels.getChannelByName(name);
|
||||||
if(dx != null) {
|
if (dx != null) {
|
||||||
dx.setValue(DMX.sanitizeDMXValue(value));
|
dx.setValue(DMX.sanitizeDMXValue(value));
|
||||||
lastChangedNow();
|
lastChangedNow();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the channel value identified by channel name.
|
|
||||||
* @param name The channel name to get the value from.
|
|
||||||
* @return The desired channel value.
|
|
||||||
*/
|
|
||||||
protected final int getChannelValueByName(String name) {
|
|
||||||
DMXChannel dx = dmxChannels.getChannelByName(name);
|
|
||||||
if(dx != null) {
|
|
||||||
return dx.getValue();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<Integer,Integer> getChannelData() {
|
/**
|
||||||
Map<Integer,Integer> map = new HashMap<Integer, Integer>();
|
* Returns the channel value identified by channel name.
|
||||||
|
*
|
||||||
for (DMXChannel channel : dmxChannels.getAllChannels()) {
|
* @param name The channel name to get the value from.
|
||||||
int index = channel.getOffset() + startAddress + DMX.DMX_STARTADDRESS_OFFSET;
|
* @return The desired channel value.
|
||||||
|
*/
|
||||||
if(index >= DMX.DMX_CHANNELS_MIN && index <= DMX.DMX_CHANNELS_MAX){
|
protected final int getChannelValueByName(String name) {
|
||||||
map.put(index, channel.getValue());
|
DMXChannel dx = dmxChannels.getChannelByName(name);
|
||||||
}
|
if (dx != null) {
|
||||||
}
|
return dx.getValue();
|
||||||
|
}
|
||||||
return map;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public final boolean setValuesFromOptions(Map<String, Object> options) {
|
* Collect the DMX Channel Data with correct DMX512 calculated offsets
|
||||||
|
* @return The channel data with startaddress+offset of every channel
|
||||||
for (Entry<String, Object> opt : options.entrySet()) {
|
*/
|
||||||
|
public Map<Integer, Integer> getChannelData() {
|
||||||
|
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
|
||||||
|
|
||||||
|
for (DMXChannel channel : dmxChannels.getAllChannels()) {
|
||||||
|
int index = channel.getOffset() + startAddress + DMX.DMX_STARTADDRESS_OFFSET;
|
||||||
|
|
||||||
|
if (index >= DMX.DMX_CHANNELS_MIN && index <= DMX.DMX_CHANNELS_MAX) {
|
||||||
|
map.put(index, channel.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final boolean setValuesFromOptions(Map<String, Object> options) {
|
||||||
|
|
||||||
|
for (Entry<String, Object> opt : options.entrySet()) {
|
||||||
try {
|
try {
|
||||||
int value = Integer.parseInt(opt.getValue().toString());
|
int value = Integer.parseInt(opt.getValue().toString());
|
||||||
|
|
||||||
if(!setChannelValueByName(opt.getKey(), value)) {
|
if (!setChannelValueByName(opt.getKey(), value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean addChannel(DMXChannel channel){
|
/**
|
||||||
|
* Add a channel to this DMX Device
|
||||||
|
* used internally by subclasses to define their structure
|
||||||
|
* @param channel DMXChannel to add (name and offset)
|
||||||
|
* @return True on success, false otherwise.
|
||||||
|
*/
|
||||||
|
public final boolean addChannel(DMXChannel channel) {
|
||||||
return dmxChannels.addChannel(channel);
|
return dmxChannels.addChannel(channel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,9 @@ package de.ctdo.bunti.model;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class BuntiDevice {
|
public abstract class BuntiDevice {
|
||||||
private int deviceId;
|
private int deviceId;
|
||||||
private String deviceName;
|
private String deviceName;
|
||||||
private long lastChanged;
|
private long lastChanged;
|
||||||
|
|
||||||
public BuntiDevice(int deviceId, String deviceName, long lastChanged) {
|
public BuntiDevice(int deviceId, String deviceName, long lastChanged) {
|
||||||
this.deviceId = deviceId;
|
this.deviceId = deviceId;
|
||||||
|
@ -14,44 +14,45 @@ public abstract class BuntiDevice {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BuntiDevice(int deviceId, String deviceName) {
|
public BuntiDevice(int deviceId, String deviceName) {
|
||||||
this(deviceId,deviceName,System.currentTimeMillis());
|
this(deviceId, deviceName, System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getDeviceId() {
|
public final int getDeviceId() {
|
||||||
return deviceId;
|
return deviceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final long getLastChanged() {
|
public final long getLastChanged() {
|
||||||
return lastChanged;
|
return lastChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void lastChangedNow() {
|
|
||||||
this.lastChanged = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getDeviceName() {
|
|
||||||
return deviceName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final void setDeviceName(String deviceName) {
|
protected final void lastChangedNow() {
|
||||||
this.deviceName = deviceName;
|
this.lastChanged = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public final String getDeviceName() {
|
||||||
* Switch this device off.
|
return deviceName;
|
||||||
*/
|
}
|
||||||
public abstract void switchOff();
|
|
||||||
|
public final void setDeviceName(String deviceName) {
|
||||||
/**
|
this.deviceName = deviceName;
|
||||||
* Switch this device on.
|
}
|
||||||
*/
|
|
||||||
public abstract void switchOn();
|
/**
|
||||||
|
* Switch this device off.
|
||||||
/**
|
*/
|
||||||
* The the internal options corresponding to the given Key Value Map
|
public abstract void switchOff();
|
||||||
* @param options The options Map.
|
|
||||||
* @return True on success. False otherwise.
|
/**
|
||||||
*/
|
* Switch this device on.
|
||||||
public abstract boolean setValuesFromOptions(Map<String, Object> options);
|
*/
|
||||||
|
public abstract void switchOn();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The the internal options corresponding to the given Key Value Map
|
||||||
|
*
|
||||||
|
* @param options The options Map.
|
||||||
|
* @return True on success. False otherwise.
|
||||||
|
*/
|
||||||
|
public abstract boolean setValuesFromOptions(Map<String, Object> options);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package de.ctdo.bunti.model;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class BuntiSwitchingDevice extends BuntiDevice {
|
public abstract class BuntiSwitchingDevice extends BuntiDevice {
|
||||||
|
|
||||||
|
|
||||||
public BuntiSwitchingDevice(int deviceId, String deviceName, long lastChanged) {
|
public BuntiSwitchingDevice(int deviceId, String deviceName, long lastChanged) {
|
||||||
|
@ -13,24 +13,11 @@ public class BuntiSwitchingDevice extends BuntiDevice {
|
||||||
super(deviceId, deviceName);
|
super(deviceId, deviceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void switchOff() {
|
public final boolean setValuesFromOptions(Map<String, Object> options) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void switchOn() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public final boolean setValuesFromOptions(Map<String, Object> options) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// zum Beispiel Lampel, also nen Hostname und HTTP Krams hier rein
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,58 +8,63 @@ public class Par56Spot extends BuntiDMXDevice {
|
||||||
private static final String CHANNEL_MODE = "mode";
|
private static final String CHANNEL_MODE = "mode";
|
||||||
private static final String CHANNEL_RED = "red";
|
private static final String CHANNEL_RED = "red";
|
||||||
private static final String CHANNEL_GREEN = "green";
|
private static final String CHANNEL_GREEN = "green";
|
||||||
private static final String CHANNEL_BLUE = "blue";
|
private static final String CHANNEL_BLUE = "blue";
|
||||||
private static final String CHANNEL_SPEED = "speed";
|
private static final String CHANNEL_SPEED = "speed";
|
||||||
|
|
||||||
public Par56Spot(int deviceId, int startAddress, String deviceName) {
|
|
||||||
super(deviceId, startAddress, deviceName);
|
|
||||||
|
|
||||||
addChannel(new DMXChannel(0, CHANNEL_MODE));
|
public Par56Spot(int deviceId, int startAddress, String deviceName) {
|
||||||
addChannel(new DMXChannel(1, CHANNEL_RED));
|
super(deviceId, startAddress, deviceName);
|
||||||
addChannel(new DMXChannel(2, CHANNEL_GREEN));
|
|
||||||
addChannel(new DMXChannel(3, CHANNEL_BLUE));
|
|
||||||
addChannel(new DMXChannel(4, CHANNEL_SPEED));
|
|
||||||
}
|
|
||||||
|
|
||||||
public final void setColorRed(int value) {
|
|
||||||
setChannelValueByName(CHANNEL_RED, value);
|
|
||||||
}
|
|
||||||
public final void setColorGreen(int value) {
|
|
||||||
setChannelValueByName(CHANNEL_GREEN, value);
|
|
||||||
}
|
|
||||||
public final void setColorBlue(int value) {
|
|
||||||
setChannelValueByName(CHANNEL_BLUE, value);
|
|
||||||
}
|
|
||||||
public final int getColorRed() {
|
|
||||||
return getChannelValueByName(CHANNEL_RED);
|
|
||||||
}
|
|
||||||
public final int getColorGreen() {
|
|
||||||
return getChannelValueByName(CHANNEL_GREEN);
|
|
||||||
}
|
|
||||||
public final int getColorBlue() {
|
|
||||||
return getChannelValueByName(CHANNEL_BLUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void switchOff() {
|
|
||||||
setChannelValueByName(CHANNEL_MODE, DMX.DMX_CHANNEL_VALUE_MIN);
|
|
||||||
setColorRed(DMX.DMX_CHANNEL_VALUE_MIN);
|
|
||||||
setColorGreen(DMX.DMX_CHANNEL_VALUE_MIN);
|
|
||||||
setColorBlue(DMX.DMX_CHANNEL_VALUE_MIN);
|
|
||||||
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
addChannel(new DMXChannel(0, CHANNEL_MODE));
|
||||||
public final void switchOn() {
|
addChannel(new DMXChannel(1, CHANNEL_RED));
|
||||||
setChannelValueByName(CHANNEL_MODE, DMX.DMX_CHANNEL_VALUE_MIN);
|
addChannel(new DMXChannel(2, CHANNEL_GREEN));
|
||||||
setColorRed(DMX.DMX_CHANNEL_VALUE_MAX);
|
addChannel(new DMXChannel(3, CHANNEL_BLUE));
|
||||||
setColorGreen(DMX.DMX_CHANNEL_VALUE_MAX);
|
addChannel(new DMXChannel(4, CHANNEL_SPEED));
|
||||||
setColorBlue(DMX.DMX_CHANNEL_VALUE_MAX);
|
}
|
||||||
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public final void setColorRed(int value) {
|
||||||
public final String toString() {
|
setChannelValueByName(CHANNEL_RED, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setColorGreen(int value) {
|
||||||
|
setChannelValueByName(CHANNEL_GREEN, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setColorBlue(int value) {
|
||||||
|
setChannelValueByName(CHANNEL_BLUE, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getColorRed() {
|
||||||
|
return getChannelValueByName(CHANNEL_RED);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getColorGreen() {
|
||||||
|
return getChannelValueByName(CHANNEL_GREEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getColorBlue() {
|
||||||
|
return getChannelValueByName(CHANNEL_BLUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void switchOff() {
|
||||||
|
setChannelValueByName(CHANNEL_MODE, DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
|
setColorRed(DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
|
setColorGreen(DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
|
setColorBlue(DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
|
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void switchOn() {
|
||||||
|
setChannelValueByName(CHANNEL_MODE, DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
|
setColorRed(DMX.DMX_CHANNEL_VALUE_MAX);
|
||||||
|
setColorGreen(DMX.DMX_CHANNEL_VALUE_MAX);
|
||||||
|
setColorBlue(DMX.DMX_CHANNEL_VALUE_MAX);
|
||||||
|
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Par56Spot ");
|
sb.append("Par56Spot ");
|
||||||
sb.append(getDeviceId());
|
sb.append(getDeviceId());
|
||||||
|
@ -72,7 +77,7 @@ public class Par56Spot extends BuntiDMXDevice {
|
||||||
sb.append(",");
|
sb.append(",");
|
||||||
sb.append(getColorBlue());
|
sb.append(getColorBlue());
|
||||||
sb.append("]");
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,57 +4,57 @@ import de.ctdo.bunti.dmx.DMX;
|
||||||
import de.ctdo.bunti.dmx.DMXChannel;
|
import de.ctdo.bunti.dmx.DMXChannel;
|
||||||
|
|
||||||
public class Strobe1500 extends BuntiDMXDevice {
|
public class Strobe1500 extends BuntiDMXDevice {
|
||||||
|
|
||||||
private static final String CHANNEL_SPEED = "speed";
|
private static final String CHANNEL_SPEED = "speed";
|
||||||
private static final String CHANNEL_INTENSITY = "intensity";
|
private static final String CHANNEL_INTENSITY = "intensity";
|
||||||
private static final String CHANNEL_MODE = "mode";
|
private static final String CHANNEL_MODE = "mode";
|
||||||
|
|
||||||
public Strobe1500(int deviceId, int startAddress, String deviceName) {
|
public Strobe1500(int deviceId, int startAddress, String deviceName) {
|
||||||
super(deviceId, startAddress, deviceName);
|
super(deviceId, startAddress, deviceName);
|
||||||
|
|
||||||
addChannel(new DMXChannel(0, CHANNEL_SPEED));
|
addChannel(new DMXChannel(0, CHANNEL_SPEED));
|
||||||
addChannel(new DMXChannel(1, CHANNEL_INTENSITY));
|
addChannel(new DMXChannel(1, CHANNEL_INTENSITY));
|
||||||
addChannel(new DMXChannel(2, CHANNEL_MODE));
|
addChannel(new DMXChannel(2, CHANNEL_MODE));
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean setSpeed(int value) {
|
public final boolean setSpeed(int value) {
|
||||||
return setChannelValueByName(CHANNEL_SPEED, value);
|
return setChannelValueByName(CHANNEL_SPEED, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean setIntensity(int value) {
|
public final boolean setIntensity(int value) {
|
||||||
return setChannelValueByName(CHANNEL_INTENSITY, value);
|
return setChannelValueByName(CHANNEL_INTENSITY, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean setMode(int value) {
|
public final boolean setMode(int value) {
|
||||||
return setChannelValueByName(CHANNEL_MODE, value);
|
return setChannelValueByName(CHANNEL_MODE, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getSpeed() {
|
public final int getSpeed() {
|
||||||
return getChannelValueByName(CHANNEL_SPEED);
|
return getChannelValueByName(CHANNEL_SPEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getIntensity() {
|
public final int getIntensity() {
|
||||||
return getChannelValueByName(CHANNEL_INTENSITY);
|
return getChannelValueByName(CHANNEL_INTENSITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getMode() {
|
public final int getMode() {
|
||||||
return getChannelValueByName(CHANNEL_MODE);
|
return getChannelValueByName(CHANNEL_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void switchOff() {
|
public final void switchOff() {
|
||||||
setChannelValueByName(CHANNEL_MODE, DMX.DMX_CHANNEL_VALUE_MIN);
|
setChannelValueByName(CHANNEL_MODE, DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MIN);
|
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
setChannelValueByName(CHANNEL_INTENSITY, DMX.DMX_CHANNEL_VALUE_MIN);
|
setChannelValueByName(CHANNEL_INTENSITY, DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void switchOn() {
|
||||||
|
setChannelValueByName(CHANNEL_MODE, DMX.DMX_CHANNEL_VALUE_MIN);
|
||||||
|
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MAX);
|
||||||
|
setChannelValueByName(CHANNEL_INTENSITY, DMX.DMX_CHANNEL_VALUE_MAX);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void switchOn() {
|
|
||||||
setChannelValueByName(CHANNEL_MODE, DMX.DMX_CHANNEL_VALUE_MIN);
|
|
||||||
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MAX);
|
|
||||||
setChannelValueByName(CHANNEL_INTENSITY, DMX.DMX_CHANNEL_VALUE_MAX);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String toString() {
|
public final String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
Loading…
Reference in New Issue