Do some cleanup

This commit is contained in:
Juergen Jung 2012-03-04 01:21:00 +01:00
parent cd5c434198
commit e786db9406
11 changed files with 30 additions and 33 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ bunti.server.iml
.classpath
.project
.settings/
target/

View File

@ -5,6 +5,6 @@ import de.ctdo.bunti.artnet.packets.ArtNetPacket;
public interface ArtNetSocket {
public boolean unicastPacket(ArtNetPacket pack, String address);
boolean unicastPacket(ArtNetPacket pack, String address);
}

View File

@ -4,6 +4,6 @@ import java.util.Map;
public interface SimpleArtNetSender {
public void sendDMXData(Map<Integer,Integer> dmxdata, String adr);
void sendDMXData(Map<Integer,Integer> dmxdata, String adr);
}

View File

@ -6,7 +6,7 @@ import de.ctdo.bunti.model.*;
public interface BuntiDevicesDAO {
public Collection<BuntiDMXDevice> getAllDMXDevices();
public BuntiDevice getDeviceById(int deviceId);
Collection<BuntiDMXDevice> getAllDMXDevices();
BuntiDevice getDeviceById(int deviceId);
}

View File

@ -2,16 +2,21 @@ package de.ctdo.bunti.dmx;
public class DMX {
public static int DMX_CHANNELS_MAX = (byte) 511;
public static int DMX_CHANNELS_MIN = 0;
public static int DMX_CHANNEL_VALUE_MAX = (byte) 255;
public static int DMX_CHANNEL_VALUE_MIN = 0;
public static final int DMX_CHANNELS_MAX = (byte) 511;
public static final int DMX_CHANNELS_MIN = 0;
public static final int DMX_CHANNEL_VALUE_MAX = (byte) 255;
public static final int DMX_CHANNEL_VALUE_MIN = 0;
/**
* Offset by which startaddress differs from DMX512 Data Array location
*/
public static int DMX_STARTADDRESS_OFFSET = -1;
public static final int DMX_STARTADDRESS_OFFSET = -1;
private DMX(){
}
/**
* Checks the DMX Value boundaries
* @param value

View File

@ -59,11 +59,11 @@ public class DMXChannels {
return false;
}
// entry must not exist by offset
if (this.channelByNumber.containsKey(channel.getOffset()) == true) {
if (this.channelByNumber.containsKey(channel.getOffset())) {
return false;
}
// entry must not exist by name
if (this.channelByName.containsKey(channel.getName()) == true) {
if (this.channelByName.containsKey(channel.getName())) {
return false;
}
this.channelByNumber.put(channel.getOffset(), channel);

View File

@ -6,7 +6,7 @@ import de.ctdo.bunti.model.BuntiDevice;
public interface DMXMixer {
public void setDMX512Channel(int channel, int value);
public void updateDevice(BuntiDevice device, Map<String, Object> options);
void setDMX512Channel(int channel, int value);
void updateDevice(BuntiDevice device, Map<String, Object> options);
}

View File

@ -20,8 +20,8 @@ import de.ctdo.bunti.model.*;
@Component
public class DMXMixerImpl implements DMXMixer, ApplicationListener<DeviceChangedEvent> {
private final Logger logger = LoggerFactory.getLogger(getClass());
private final String ARTNET_DEVICE_ADDRESS = "192.168.0.90";
private static final Logger LOGGER = LoggerFactory.getLogger(DMXMixerImpl.class);
private static final String ARTNET_DEVICE_ADDRESS = "192.168.0.90";
private final Map<Integer,Integer> dmxMap = Collections.synchronizedMap(new HashMap<Integer,Integer>());
private SimpleArtNetSender artNetSender;
@ -59,9 +59,9 @@ public class DMXMixerImpl implements DMXMixer, ApplicationListener<DeviceChanged
dmxMap.putAll(dmxDev.getChannelData());
logger.info("setValuesFromOptions on " + device);
LOGGER.info("setValuesFromOptions on " + device);
} else {
logger.info("setValuesFromOptions on " + device + " failed");
LOGGER.info("setValuesFromOptions on " + device + " failed");
}
}

View File

@ -54,7 +54,7 @@ public class Par56Spot extends BuntiDMXDevice {
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);;
setColorBlue(DMX.DMX_CHANNEL_VALUE_MAX);
setChannelValueByName(CHANNEL_SPEED, DMX.DMX_CHANNEL_VALUE_MIN);
}

View File

@ -15,7 +15,7 @@ import de.ctdo.bunti.control.BuntiController;
@Controller
public class TestController {
private Logger logger = LoggerFactory.getLogger(getClass());
private static final Logger LOGGER = LoggerFactory.getLogger(TestController.class);
BuntiController buntiController;
@Autowired
@ -54,9 +54,8 @@ public class TestController {
buntiController.setDevice(4, options);
ModelAndView mav = new ModelAndView("hello.jsp");
return mav;
return new ModelAndView("hello.jsp");
}
@RequestMapping("/foobar2")
@ -84,9 +83,8 @@ public class TestController {
buntiController.setDevice(5, options);
ModelAndView mav = new ModelAndView("hello.jsp");
return mav;
return new ModelAndView("hello.jsp");
}
}

View File

@ -1,17 +1,10 @@
package de.ctdo.bunti.websocket;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.sun.grizzly.websockets.WebSocketEngine;
// das klappt so jedenfalls alles noch nicht :)
@Component
public class BuntiControllerServlet { // extends HttpServlet {