usbdmx.com Home of the opto isolated, bus powered, DMX512 interface with both in and out universes. Cheap and simple to build. USBDMX logo

LOHWChannelProxy Class Reference

A channel proxy to allow a single channel to be updated on a given interface. More...

#import <LOHWChannelProxy.h>


Public Member Functions

(id) - initForChannel:onBridge:
 Initilise the object with a HWInterface and Channel.
(id) - initWithXML:
 Initilise the object from an XML element.
(id) - initWithXML:offsetBy:
 Initilise the object from an XML element.
(void) - XMLIntoElement:
 Get the Channel Proxy details as XML.
(LOHWBridge *) - hwBridge
 Get the HW Bridge used for this proxy.
(unsigned int) - physicalChannel
 Get the physical channel number used by the HWBridge.
(void) - setChannelValue:
 Set the physical channel on the HWBridge to the given value.
(void) - addAdditionalProxy:
 Add an additional proxy.
(NSArray *) - additionalProxies
 Get the additional proxies.
(void) - removeAdditionalProxy:
 Remove a specific additional proxy object.
(void) - removeAdditionalProxyAtIndex:
 Remove a given proxy by index.
(BOOL) - containsAdditionalProxy:
 Test is aProxy is an additional proxy to this one.
(unsigned) - additionalProxiesCount
 Count of how many linked proxies there are.
(void) - linkAdditionalProxy:
 Add an additional linked proxy.
(LOHWChannelProxy *) - linkedChannel
 Get the linked channel, or nil.

Static Public Member Functions

(id) + proxyForChannel:onBridge:
 Convienience method.

Protected Attributes

LOHWBridgehwBridge
unsigned int channel
int lastValue
NSMutableArray * additionalProxies


Detailed Description

A channel proxy to allow a single channel to be updated on a given interface.

As used by the soft patch system


Member Function Documentation

- (void) addAdditionalProxy: (LOHWChannelProxy *)  aProxy  

Add an additional proxy.

This additional proxy will receive the same setChannel message as this on. As many proxies can be added as desired.

Parameters:
aProxy The additional proxy to link in.
See also:
additionalProxies

- (NSArray *) additionalProxies  

Get the additional proxies.

See also:
- addAdditionalProxy:

- (BOOL) containsAdditionalProxy: (LOHWChannelProxy *)  aProxy  

Test is aProxy is an additional proxy to this one.

Parameters:
aProxy The proxy to test

- (LOHWBridge *) hwBridge  

Get the HW Bridge used for this proxy.

- (id) initForChannel: (unsigned int)  theChannel
onBridge: (LOHWBridge *)  theHWBridge 

Initilise the object with a HWInterface and Channel.

Parameters:
theHWBridge The interface to be used
theChannel The channel on the interface

- (id) initWithXML: (NSXMLElement *)  XMLElement  

Initilise the object from an XML element.

The expected format is the interface element.

If the XML contains a HWBridge that is not on the system it will call the replaceHWBridge function in LOFileManager to see what it should do.

See also:
- initWithXML:offsetBy:

XMLIntoElement

- (id) initWithXML: (NSXMLElement *)  XMLElement
offsetBy: (int)  offset 

Initilise the object from an XML element.

The expected format is the interface element.

If the XML contains a HWBridge that is not on the system it will call the replaceHWBridge function in LOFileManager to see what it should do.

The offset adjusts the physical channel

See also:
- initWithXML:

XMLIntoElement

- (void) linkAdditionalProxy: (LOHWChannelProxy *)  aProxy  

Add an additional linked proxy.

This additional proxy will receive the same setChannel message as this on. As many proxies can be added as desired.

Parameters:
aProxy The additional proxy to link in.
Deprecated:
see addAdditionalProxy: instead
See also:
- linkedChannel:

- (LOHWChannelProxy *) linkedChannel  

Get the linked channel, or nil.

See also:
- linkAdditionalProxy:

- (unsigned int) physicalChannel  

Get the physical channel number used by the HWBridge.

+ (id) proxyForChannel: (unsigned int)  theChannel
onBridge: (LOHWBridge *)  theHWBridge 

Convienience method.

Parameters:
theChannel The channel on the interface
theHWBridge The interface to be used

- (void) removeAdditionalProxy: (LOHWChannelProxy *)  aProxy  

Remove a specific additional proxy object.

aProxy: The proxy to remove

See also:
- removeAdditionalProxyAtIndex:

- (void) removeAdditionalProxyAtIndex: (unsigned)  index  

Remove a given proxy by index.

Parameters:
index The index of the proxy to remove
See also:
- removeAdditionalProxy:

- (void) setChannelValue: (unsigned char)  theValue  

Set the physical channel on the HWBridge to the given value.

Parameters:
theValue The new channel value

- (void) XMLIntoElement: (NSXMLElement *)  parentElement  

Get the Channel Proxy details as XML.

 <parent element>
  <interface serial="1001" physical="1"/>
 </parent element>

Linked channels will simply include multiple interface elements. This is different from most other objects with an XML function. You need to include the parent object, this is because it needs to be passed down to the linked proxies

Parameters:
parentElement The parent element that the inteface elements are put into


The documentation for this class was generated from the following files: