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

LOSoftPatch Class Reference

Defines soft patch parameters. More...

#import <LOSoftPatch.h>


Public Member Functions

(id) - initUniverseWithHWBridge:
 Initilise a complete DMX512 Universe.
(id) - initWithCapacity:
 Initilise a soft patch with a number of unpatched channels.
(NSXMLElement *) - XMLForOffset:
 Get the Channel Proxy details as XML.
(unsigned) - count
 Returns the maximum number of soft patch channels that can be held.
(NSArray *) - hwBridges
 Get all the hw bridges used by the soft patch.
(NSString *) - identifierForOffset:
 Get the identifier of the HWBridge this offset uses.
(NSString *) - identifierWithPhysicalForOffset:
 Get the identifierr and physical channel number on the HWBridge this offset uses.
(NSString *) - physicalAddressForOffset:
 Get the full physical address of a channel in the format universe/phyical.
(unsigned) - physicalForOffset:
 Get the physical channel number on the HWBridge this offset uses.
(void) - setProxy:forOffset:
 Set the channel proxy for the given offset.
(void) - addProxy:forOffset:
 Add a channel proxy for the given offset.
(LOHWChannelProxy *) - proxyForOffset:
 Get the proxy for a given offset.
(void) - setPatchForOffset:toPhysicalChannel:onHWBridge:
 Set the patch on a channel offset.
(void) - addPatchForOffset:toPhysicalChannel:onHWBridge:
 Add an additional patch to a channel offset.
(void) - updateOffset:withValue:
 Set the physical channel(s) on the HWBridge to the given value.
(void) - removeProxy:atOffset:
 Remove a specific proxy at a given offset.
(void) - unpatchForOffset:
 Mark the hw channle(s) as unpatched for the given offset.
(void) - unpatch
 Mark the hw channle(s) as unpatched for all offsets.
(BOOL) - isPatchedAtOffset:
 Check to see if a channel is patched.
(NSString *) - serialNumberForOffset:
(NSString *) - serialNumberWithPhysicalForOffset:

Protected Attributes

NSMutableArray * hwBridges
 All hadrware bridges used in this soft patch.
unsigned count
 The number of possible proxiex that can be held.
LOHWChannelProxy ** proxyArray
 Pointer to hold an array of all channel proxies.


Detailed Description

Defines soft patch parameters.

A soft patch is the relationship between a (soft) channel controlled the by the channle manager, and a (physical) channel output by a HWBridge.

A Soft Patch deals with channel offsets because it does not know the channle numbers given to it by the channelManager, just how many channels it is looking after.


Member Function Documentation

- (void) addPatchForOffset: (unsigned)  anOffset
toPhysicalChannel: (unsigned)  aChannel
onHWBridge: (LOHWBridge *)  aHWBridge 

Add an additional patch to a channel offset.

If no patch has yet been done on this offset, it has the same effect as setPatchForOffset: toPhysicalChannel: onHWBridge

It is assumed that the HWBridge has already been set to tx mode

Parameters:
anOffset The channel offset being patched (0 indexed)
aChannel The physical channel number
aHWBridge The HWBridge containing the physical channel

- (void) addProxy: (LOHWChannelProxy *)  aProxy
forOffset: (unsigned)  anOffset 

Add a channel proxy for the given offset.

Parameters:
aProxy The actuall proxy
anOffset The channel offset being patched (0 indexed)

- (unsigned) count  

Returns the maximum number of soft patch channels that can be held.

Returns:
The coutn of channels.

- (NSArray *) hwBridges  

Get all the hw bridges used by the soft patch.

Returns:
An array of hw bridges

- (NSString *) identifierForOffset: (unsigned)  anOffset  

Get the identifier of the HWBridge this offset uses.

Parameters:
anOffset The channel offset being patched (0 indexed)
See also:
- identifierWithPhysicalForOffset:

- physicalAddressForOffset:

- physicalForOffset:

- (NSString *) identifierWithPhysicalForOffset: (unsigned)  anOffset  

Get the identifierr and physical channel number on the HWBridge this offset uses.

Format is identifier:physical

Parameters:
anOffset The channel offset being patched (0 indexed)
See also:
identifierrForOffset:

- physicalAddressForOffset:

- physicalForOffset:

- (id) initUniverseWithHWBridge: (LOHWBridge *)  aHWBridge  

Initilise a complete DMX512 Universe.

Using the given HWBridge map a 1 to 1 soft patch for all 512 channels.

It is assumed that the HWBridge has already been set to tx mode

Parameters:
aHWBridge The HWBridge containing the physical channels

- (id) initWithCapacity: (unsigned)  theCapacity  

Initilise a soft patch with a number of unpatched channels.

Parameters:
theCapacity The number of unpatched channels to be created.

- (BOOL) isPatchedAtOffset: (unsigned)  anOffset  

Check to see if a channel is patched.

See also:
- unpatch

- unpatchForOffset:

- (NSString *) physicalAddressForOffset: (unsigned)  anOffset  

Get the full physical address of a channel in the format universe/phyical.

Parameters:
anOffset The channel offset being patched (0 indexed)
See also:
- identifierWithPhysicalForOffset:

identifierrForOffset:

- physicalForOffset:

- (unsigned) physicalForOffset: (unsigned)  anOffset  

Get the physical channel number on the HWBridge this offset uses.

Format is serial:physical

Parameters:
anOffset The channel offset being patched (0 indexed)
See also:
- serialNumberForOffset:

- serialNumberWithPhysicalForOffset:

- (LOHWChannelProxy *) proxyForOffset: (unsigned)  anOffset  

Get the proxy for a given offset.

Parameters:
anOffset The offset
Returns:
the offset

- (void) removeProxy: (LOHWChannelProxy *)  proxy
atOffset: (unsigned)  anOffset 

Remove a specific proxy at a given offset.

This could be the primary proxy or an additional linked one. Mark the hw channle as unpatched.

In the even that this is the primary proxy, the first additional one will be made the primary, and any extra additional ones will be now additional to the new primary one.

Parameters:
proxy The Channel proxy to remove
anOffset The offset within the softpatch to remove the proxy

- (NSString *) serialNumberForOffset: (unsigned)  anOffset  

Deprecated:
Use identifierForOffset

- (NSString *) serialNumberWithPhysicalForOffset: (unsigned)  anOffset  

Deprecated:
Use identifierWithPhysicalForOffset

- (void) setPatchForOffset: (unsigned)  anOffset
toPhysicalChannel: (unsigned)  aChannel
onHWBridge: (LOHWBridge *)  aHWBridge 

Set the patch on a channel offset.

It is assumed that the HWBridge has already been set to tx mode

Parameters:
anOffset The channel offset being patched (0 indexed)
aChannel The channel offset being patched (0 indexed)
aHWBridge The HWBridge containing the physical channel

- (void) setProxy: (LOHWChannelProxy *)  aProxy
forOffset: (unsigned)  anOffset 

Set the channel proxy for the given offset.

Parameters:
aProxy The actuall proxy
anOffset The channel offset being patched (0 indexed)

- (void) unpatch  

Mark the hw channle(s) as unpatched for all offsets.

See also:
- isPatchedAtOffset:

- (void) unpatchForOffset: (unsigned)  anOffset  

Mark the hw channle(s) as unpatched for the given offset.

Parameters:
anOffset The channel offset being patched (0 indexed)
See also:
- isPatchedAtOffset:

- (void) updateOffset: (unsigned)  anOffset
withValue: (unsigned char)  theValue 

Set the physical channel(s) on the HWBridge to the given value.

This is the function that actually calls the set channel command on behalf of the channel manager.

Parameters:
anOffset The channel offset being patched (0 indexed)
theValue The new channel value

- (NSXMLElement *) XMLForOffset: (unsigned)  anOffset  

Get the Channel Proxy details as XML.

 <interfaces>
  <interface serial="1001" physical="1"/>
 </interfaces>

Parameters:
anOffset The channel offset being patched (0 indexed)
Returns:
The XML Representation of the interface at the given offset


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