9 #include "LumiverseCoreConfig.h"
14 #include "../lib/libjson/libjson.h"
68 virtual void update(set<Device *> devices);
95 virtual string getType() {
return "DMXPatch"; }
164 void moveInterface(
string id,
unsigned int universeFrom,
unsigned int universeTo);
208 void addDeviceMap(
string id, map<string, patchData> deviceMap);
243 bool setRawData(
unsigned int universe, vector<unsigned char> univData);
void moveInterface(string id, unsigned int universeFrom, unsigned int universeTo)
Moves an interface from a specified universe to a specified universe.
Definition: DMXPatch.cpp:402
size_t sizeOfDeviceMap(string id)
Gets the size in DMX addresses of the specified device map.
Definition: DMXPatch.cpp:469
void removeInterface(unsigned int universe, string id="")
Removes all interfaces from the selected universe Optionally specify a specific interface to remvoe f...
Definition: DMXPatch.cpp:364
void dumpUniverse(unsigned int universe)
Debug funtion that prints out all DMX values for a single universe.
Definition: DMXPatch.cpp:443
DMXPatch()
Constructs a DMXPatch object.
Definition: DMXPatch.cpp:26
Provides a common interface to various DMX devices.
Definition: DMXInterface.h:24
const multimap< string, unsigned int > getInterfaceInfo()
Returns the interface map. ID -> Universe.
Definition: DMXPatch.h:171
virtual void init()
Initializes connections and other network settings for the patch.
Definition: DMXPatch.cpp:247
conversionType
Enumeration maps to a function that performs the appropriate conversion from Lumiverse value to DMX v...
Definition: DMXDevicePatch.h:17
map< string, map< string, patchData > > m_deviceMaps
Stores information about device maps, which can be reused across devices. Key is the device map name...
Definition: DMXPatch.h:311
A Patch maps devices to output channels and handles the output of data to the network.
Definition: Patch.h:24
virtual JSONNode toJSON()
Exports a JSONNode with the data in this patch.
Definition: DMXPatch.cpp:264
void loadJSON(const JSONNode data)
Loads data from a parsed JSON object.
Definition: DMXPatch.cpp:34
This class includes information on how to translate the device properties for a given device to DMX v...
Definition: DMXDevicePatch.h:137
DMXInterface * getInterface(string id)
Returns a DMXInterface for editing.
Definition: DMXPatch.cpp:395
bool addInterface(DMXInterface *iface)
Adds an interface to the DMXPatch without assigning it to a universe.
Definition: DMXPatch.cpp:377
virtual ~DMXPatch()
Destroys the object.
Definition: DMXPatch.cpp:207
map< string, DMXInterface * > m_interfaces
DMX Interfaces controlled by this patch.
Definition: DMXPatch.h:297
vector< vector< unsigned char > > m_universes
Stores the state of the DMX universes.
Definition: DMXPatch.h:281
void dumpUniverses()
Debug function that prints out all DMX values for all universes in the patch.
Definition: DMXPatch.cpp:437
virtual void deleteDevice(string id)
Called when a device is deleted from the Rig.
Definition: DMXPatch.cpp:324
void deleteInterface(string id)
Deletes an interface with id "id" from the patch.
Definition: DMXPatch.cpp:385
vector< string > getInterfaceIDs()
Returns a list of the interface IDs used by this patch.
Definition: DMXPatch.cpp:510
bool setRawData(unsigned int universe, vector< unsigned char > univData)
Directly modifies the DMX data in the specified universe.
Definition: DMXPatch.cpp:453
void loadDeviceMaps(const JSONNode data)
Loads the device maps from a JSON node.
Definition: DMXPatch.cpp:177
Tells a DMXPatch how to interpret the Device data.
multimap< string, unsigned int > m_ifacePatch
Maps interface id to universe number (zero-indexed)
Definition: DMXPatch.h:289
JSONNode deviceMapToJSON(string id, map< string, patchData > data)
Converts a device map in the m_deviceMaps object into a JSON object.
Definition: DMXPatch.cpp:305
Base class describing how DMX Interfaces should act.
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
virtual void update(set< Device * > devices)
Updates the values sent to the DMX network given the list of devices in the rig.
Definition: DMXPatch.cpp:220
map< string, DMXDevicePatch * > m_patch
Maps devices to DMX outputs.
Definition: DMXPatch.h:305
void addParameter(string mapId, string paramId, unsigned int address, conversionType type)
Adds/modifies a parameter to/in a deviceMap.
Definition: DMXPatch.cpp:433
The DMX Patch object manages the communication between the DMX network and the Lumiverse devices...
Definition: DMXPatch.h:42
DMXDevicePatch * getDevicePatch(string id)
Gets a DMXDevicePatch for the specified Device.
Definition: DMXPatch.cpp:425
void addDeviceMap(string id, map< string, patchData > deviceMap)
Adds a device map to the Patch's database of mappings.
Definition: DMXPatch.cpp:429
A Device in Lumiverse maintains information about a lighting device.
Definition: Device.h:55
void assignInterface(DMXInterface *iface, unsigned int universe)
Assigns an interface to a universe.
Definition: DMXPatch.cpp:329
virtual void close()
Closes connections to the interfaces.
Definition: DMXPatch.cpp:258
virtual string getType()
Gets the type of this object.
Definition: DMXPatch.h:95
void patchDevice(Device *device, DMXDevicePatch *patch)
Patches a given device to the given DMXDevicePatch.
Definition: DMXPatch.cpp:417