Commit 349edebf authored by Leander Schulten's avatar Leander Schulten
Browse files

Add Class Name for Subclasses of NamedObject for the SyncService

parent 68516f8a
......@@ -18,6 +18,7 @@ class Device : public NamedObject, public IDBase<Device>
Q_PROPERTY(unsigned int startDMXChannel READ getStartDMXChannel WRITE setStartDMXChannel NOTIFY startDMXChannelChanged)
Q_PROPERTY(QPoint position READ getPosition WRITE setPosition NOTIFY positionChanged)
public:
static QString syncServiceClassName;
/**
* @brief prototype Ein Pointer auf den Typ/Prototype, von dem das Gerät ist. (Ist es eine Lamp, ein Laser, .. ?)
*/
......@@ -42,7 +43,7 @@ private slots:
public:
Device(const QJsonObject &o);
Device(DevicePrototype * prototype, int startDMXChannel, QString name, QString desciption="",QPoint position = QPoint(-1,-1)):NamedObject(name,desciption),prototype(prototype),startDMXChannel(startDMXChannel),position(position){
Device(DevicePrototype * prototype, int startDMXChannel, QString name, QString desciption="",QPoint position = QPoint(-1,-1)):NamedObject(name,desciption,&syncServiceClassName),prototype(prototype),startDMXChannel(startDMXChannel),position(position){
connect(prototype,&DevicePrototype::channelAdded,this,&Device::channelAdded);
}
......
......@@ -20,8 +20,9 @@ private:
*/
std::vector<Channel*> channels;
public:
static QString syncServiceClassName;
DevicePrototype(const QJsonObject &o);
DevicePrototype(QString name):NamedObject(name){}
DevicePrototype(QString name):NamedObject(name,&syncServiceClassName){}
int getNumberOfChannels()const{return channels.size();}
/**
* @brief removeChannels Entfernt Channel bis zu einem bestimmten Index
......
......@@ -3,7 +3,7 @@
#include <unordered_set>
Programm::Programm(const QJsonObject &o):NamedObject(o),IDBase<Programm>(o)
Programm::Programm(const QJsonObject &o):NamedObject(o,&syncServiceClassName),IDBase<Programm>(o)
{
auto array = o["programms"].toArray();
for(const auto r : array){
......
......@@ -96,8 +96,9 @@ class Programm : public NamedObject, public IDBase<Programm>
std::vector<DeviceProgramm*> programms;
TimeDistortion timeDistortion;
public:
static QString syncServiceClassName;
Programm(const QJsonObject &o);
Programm(QString name,QString description = ""):NamedObject(name,description){}
Programm(QString name,QString description = ""):NamedObject(name,description,&syncServiceClassName){}
Q_SLOT void setRunning(bool run){if(run != isRunning_)emit runningChanged(run);isRunning_ = run;SyncService::addUpdateMessage("Programm",getID(),"running",run?"true":"false");}
// Für jedes Programm für jedes Device für jeden Channel
std::map<Programm*,std::map<Device*,std::vector<Channel*>>> run();
......
......@@ -42,6 +42,7 @@ class ProgrammPrototype : public NamedObject, public IDBase<ProgrammPrototype>
Q_OBJECT
Q_PROPERTY(DevicePrototype* devicePrototype READ getDevicePrototype CONSTANT)
public:
static QString syncServiceClassName;
/**
* @brief devicePrototype Für diesen Typ soll das Programm sein.
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment