model.device
Class ADMXDevice

java.lang.Object
  extended by model.device.ADMXDevice
Direct Known Subclasses:
DummyDMXDevice, USBDMXInterface

public abstract class ADMXDevice
extends Object

This abstract class defines the device framework for DMX devices.

TODO: fadeValue is commented out because the program never uses it, and the code for it is out of date. It should probably exist, but I havn't seen the need yet.


Constructor Summary
ADMXDevice()
           
 
Method Summary
abstract  void closeDevice()
          This method will be called before the program closes, or when the program is disconnecting from the device.
abstract  void fadeValues(CueValueSet startCue, CueValueSet endCue, short[] changedAddrs)
          This method will start a fade from the startValues to the endValues.
abstract  void setMaxAddress(short maxChannels)
          This method allows you to set a maximum address on the device, if the device supports it.
abstract  Channel setValue(Channel channel)
          This method sets the given channel, value pair on the device.
abstract  Channel[] setValues(Channel[] channels)
          This method sets a series of values on the device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADMXDevice

public ADMXDevice()
Method Detail

setValue

public abstract Channel setValue(Channel channel)
                          throws ADMXDeviceException
This method sets the given channel, value pair on the device.

Parameters:
channel - The Channel object with the address, value pair to set on the device.
Returns:
A Channel object containing the new value of the given address.
Throws:
ADMXDeviceException - This exception will be thrown if there is an error while writting to the device.

setValues

public abstract Channel[] setValues(Channel[] channels)
                             throws ADMXDeviceException
This method sets a series of values on the device.

Parameters:
channels - The array of address, value pairs to set on the device.
Returns:
The Channel objects containing the new values of the given addresses.
Throws:
ADMXDeviceException - This exception will be thrown if there is an error while writing to the device.

fadeValues

public abstract void fadeValues(CueValueSet startCue,
                                CueValueSet endCue,
                                short[] changedAddrs)
                         throws ADMXDeviceException
This method will start a fade from the startValues to the endValues. The two Channel object arrays must be the same length and contain the same channel addresses, in the same order. IUpdateChannel and IUpdateFadeProgress are used to update the view during the fade.

Parameters:
startValues - The Channel object array of the starting values for the fade. These values will be faded down in fadeDownMillis milliseconds. This array must be the same length as endValues, and contain the same addresses in the same order.
endValues - The Channel object array of the ending values for the fade. These values will be faded up in fadeUpMillis milliseconds. This array must be the same length as startValues, and contain the same addresses in the same order.
fadeUpMillis - The time in milliseconds that it will take to fade in the endValues.
fadeDownMillis - The time in milliseconds that it will take to fade out the startValues.
channelUpdater - This interface contains two methods that will be called every time a new value is written to the device. These methods tell the model the current values of the channels during the fade. Using these values, the view can be updated as the channels fade.
fadeUpdater - This class contains two methods that are used to update the fade progress bars during the fade. They should be called every time a value is written to the device.
Throws:
ADMXDeviceException - This exception will be thrown if there is an error while writing to the device.

setMaxAddress

public abstract void setMaxAddress(short maxChannels)
                            throws ADMXDeviceException
This method allows you to set a maximum address on the device, if the device supports it.

TODO: This method should be renamed to setMaxChannels().

Parameters:
maxChannels - The maximum number of channels.
Throws:
ADMXDeviceException - This exception will be thrown if there is an error while writing to the device.

closeDevice

public abstract void closeDevice()
                          throws ADMXDeviceException
This method will be called before the program closes, or when the program is disconnecting from the device. If the device does not need to be 'closed' in any way, this method can be left blank.

Throws:
ADMXDeviceException - This exception will be thrown if there is an error while closing the device.