1
0
Fork 0

class hierarchy of Device, Controller, and Node

This commit is contained in:
Kevin Matz 2022-06-09 16:41:55 -04:00
parent 2942d2800d
commit 27e668457f
8 changed files with 294 additions and 5 deletions

View File

@ -1,6 +1,12 @@
target_sources(${PROJECT_NAME}
PRIVATE
artnet/artnet.h
artnet/controller.h
artnet/controller.cpp
artnet/device.h
artnet/device.cpp
artnet/node.h
artnet/node.cpp
artnet/packet.h
artnet/packet.cpp
)

View File

@ -1,10 +1,78 @@
# OpenLCP support for Art-Net
The Art-Net Version 4 describes three members of an Art-Net network:
- **Controller** _(requests)_
- **Node** _(replies)_
- **Media Server** _(mx extensions)_
The Art-Net 4 Release 1.4dd2 (1/2/2021) describes three members of an Art-Net network:
- **Controller** : A lighting console.
- **Node** : A DMX to / from Art-Net device.
- **Media Server** : A Media Server.
The ArtPollReply Styles (Table 4) enumerates those, plus an additional 4 device types:
- **Route** : A network routing device.
- **Backup** : A backup device.
- **Config** : A configuration or diagnostic tool
- **Visual** : A visualizer
The behaviors of Route, Backup, Config, and Visual devices is not specified. The behaviors of Controller, Node, and Media Server are defined, and summarized in a table below.
In OpenLCP, the base class for all Art-Net devices is the ARTNET::Device class. ARTNET::Controller and ARTNET::Node inherit from ARTNET::Device virtually, allowing custom implementations that may need to inherit from ARTNET::Controller _and_ ARTNET::Node to do so with a common base ARTNET::Device.
- ARTNET::Device carries the implementation for:
- Rx
- ArtPoll
- ArtTimeCode
- ArtCommand
- ArtTrigger
- ArtDmx
- ArtNzs
- ArtVlc
- ArtRdm
- ArtRdmSub
-Tx
- ArtPollReply
- ArtDiagData
- ArtTimeCode
- ArtCommand
- ArtTrigger
- ArtDmx
- ArtNzs
- ArtVlc
- ArtRdm
- ArtRdmSub
- ARTNET::Controller extends ARTNET::Device with:
- Rx
- ArtPollReply
- ArtIpProgReply
- ArtDiagData
- ArtFirmwareReply
- ArtTodData
- Tx
- ArtPoll
- ArtIpProg
- ArtAddress
- ArtSync
- ArtInput
- ArtFirmwareMaster
- ArtTodRequest
- ArtTodControl
- ARTNET::Node extends ARTNET::Device with:
- Rx
- ArtIpProg
- ArtAddress
- ArtSync
- ArtInput
- ArtFirmwareMaster
- ArtTodRequest
- ArtTodControl
- Tx
- ArtIpProgReply
- ArtFirmwareReply
- ArtTodData
## Art-Net Table of Behaviors
<table>
<tr>
<th rowspan=3>OpCode</th>
@ -142,5 +210,4 @@ The Art-Net Version 4 describes three members of an Art-Net network:
</tr>
</table>
Art-Net™ is a trade mark of Artistic Licence Holdings Ltd. The Art-Net protocol and associated documentation is copyright Artistic Licence Holdings Ltd.

View File

@ -0,0 +1,33 @@
/*
controller.cpp
Copyright (c) 2022 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "controller.h"
namespace ARTNET {
Controller::Controller()
{
}
} // namespace ARTNET

View File

@ -0,0 +1,40 @@
/*
controller.h
Copyright (c) 2022 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
#include "device.h"
namespace ARTNET {
/**
* @brief \cite ARTNET A generic term describing an Art-Net device with the
* primary task of generating control data. For example, a lighting console.
*/
class Controller : public virtual Device
{
public:
Controller();
};
} // namespace ARTNET

View File

@ -0,0 +1,33 @@
/*
device.cpp
Copyright (c) 2022 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "device.h"
namespace ARTNET {
Device::Device()
{
}
} // namespace ARTNET

38
protocol/artnet/device.h Normal file
View File

@ -0,0 +1,38 @@
/*
device.h
Copyright (c) 2022 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
namespace ARTNET {
/**
* @brief The Device class is the base class for ARTNET::Controller
* and ARTNET::Node
*/
class Device
{
public:
Device();
};
} // namespace ARTNET

33
protocol/artnet/node.cpp Normal file
View File

@ -0,0 +1,33 @@
/*
node.cpp
Copyright (c) 2022 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "node.h"
namespace ARTNET {
Node::Node()
{
}
} // namespace ARTNET

39
protocol/artnet/node.h Normal file
View File

@ -0,0 +1,39 @@
/*
node.h
Copyright (c) 2022 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
#include "device.h"
namespace ARTNET {
/**
* @brief \cite ARTNET A device that translates DMX512 to or from Art-Net
*/
class Node : public virtual Device
{
public:
Node();
};
} // namespace ARTNET