Added more inline documentation.

Simplified joinedMulticastgroup.
Removed non-required functions and includes.


Former-commit-id: 829b5c6f89ee1e9a4789dbe18f911b05e3b5d8e1
This commit is contained in:
RickDB
2016-03-15 11:10:04 +01:00
parent fdb164da0a
commit 5be072be24
2 changed files with 29 additions and 31 deletions

View File

@@ -8,7 +8,6 @@
#include <QString>
#include <QNetworkAccessManager>
#include <QHostAddress>
#include <QTime>
// Leddevice includes
#include <leddevice/LedDevice.h>
@@ -41,9 +40,6 @@ public:
int lastGreen;
int lastBlue;
// Last command sent timer
QTime timer;
// Multicast status
bool joinedMulticastgroup;
@@ -60,7 +56,7 @@ public:
///
/// @param numLeds is the total amount of leds per Orb
///
/// @param orb ids to control
/// @param array containing orb ids
///
LedDeviceAtmoOrb(const std::string& output, bool switchOffOnBlack =
false, int transitiontime = 0, int port = 49692, int numLeds = 24, std::vector<unsigned int> orbIds = std::vector<unsigned int>());
@@ -79,33 +75,49 @@ public:
virtual int write(const std::vector<ColorRgb> & ledValues);
virtual int switchOff();
private:
/// Array to save the lamps.
std::vector<AtmoOrbLight> lights;
/// QNetworkAccessManager object for sending requests.
QNetworkAccessManager* manager;
/// String containing multicast group IP address
QString multicastGroup;
/// Switch off when detecting black
bool switchOffOnBlack;
/// Transition time between colors (not implemented)
int transitiontime;
/// Multicast port to send data to
int multiCastGroupPort;
/// Number of leds in Orb, used to determine buffer size
int numLeds;
/// QHostAddress object of multicast group IP address
QHostAddress groupAddress;
/// QUdpSocket object used to send data over
QUdpSocket *udpSocket;
/// Array of the light ids.
/// Array of the orb ids.
std::vector<unsigned int> orbIds;
///
/// Switches the leds on.
/// Set Orbcolor
///
/// @param nLights the number of lights
/// @param orbId the orb id
///
/// @param color which color to set
///
///
/// @param commandType which type of command to send (off / smoothing / etc..)
///
void switchOn(unsigned int nLights);
// Set color
void setColor(unsigned int orbId, const ColorRgb& color, int commandType);
// Send color command
///
/// Send Orb command
///
/// @param bytes the byte array containing command to send over multicast
///
void sendCommand(const QByteArray & bytes);
};