moved address configuration in seperate file
This commit is contained in:
parent
e5fb13bdcf
commit
40bf50c0f2
|
@ -19,7 +19,7 @@ import java.util.Map;
|
|||
|
||||
public class DMXMixerImpl implements DMXMixer, ApplicationListener<DeviceChangedEvent> {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DMXMixerImpl.class);
|
||||
private static final String ARTNET_DEVICE_ADDRESS = "192.168.0.90";
|
||||
private String artNetDeviceAddress;
|
||||
|
||||
private final Map<Integer, Integer> dmxMap = Collections.synchronizedMap(new HashMap<Integer, Integer>());
|
||||
private SimpleArtNetSender artNetSender;
|
||||
|
@ -30,6 +30,9 @@ public class DMXMixerImpl implements DMXMixer, ApplicationListener<DeviceChanged
|
|||
this.artNetSender = artNetSender;
|
||||
}
|
||||
|
||||
public void setArtNetDeviceAddress(String artNetDeviceAddress) {
|
||||
this.artNetDeviceAddress = artNetDeviceAddress;
|
||||
}
|
||||
|
||||
public final void initDMXData() {
|
||||
for (int i = 0; i <= DMX.DMX_CHANNELS_MAX; i++) {
|
||||
|
@ -45,7 +48,7 @@ public class DMXMixerImpl implements DMXMixer, ApplicationListener<DeviceChanged
|
|||
}
|
||||
|
||||
if (hasDataChanged) {
|
||||
artNetSender.sendDMXData(dmxMap, ARTNET_DEVICE_ADDRESS);
|
||||
artNetSender.sendDMXData(dmxMap, artNetDeviceAddress);
|
||||
hasDataChanged = false;
|
||||
}
|
||||
|
||||
|
@ -87,4 +90,5 @@ public class DMXMixerImpl implements DMXMixer, ApplicationListener<DeviceChanged
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
artnet.deviceAddress=192.168.0.90
|
|
@ -8,8 +8,13 @@
|
|||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
|
||||
|
||||
|
||||
<context:component-scan base-package="de.ctdo" />
|
||||
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location" value="classpath:bunti.properties"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
|
||||
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
|
||||
|
@ -19,4 +24,9 @@
|
|||
<task:executor id="myExecutor" pool-size="3-10" queue-capacity="50" />-->
|
||||
<task:scheduler id="myScheduler" pool-size="3"/>
|
||||
|
||||
|
||||
<bean class="de.ctdo.bunti.dmx.DMXMixerImpl">
|
||||
<property name="artNetDeviceAddress" value="${artnet.deviceAddress}"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
Loading…
Reference in New Issue