Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* SetRtProfileBase
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Fröbel, NLE, 2018-12-17
|
||||
*/
|
||||
|
||||
#include "set_rt_profile_base.h"
|
||||
#include <AudioVideoManagement/iava_comm.h>
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
namespace AvaCommands
|
||||
{
|
||||
|
||||
SetRtProfileBase::SetRtProfileBase(IAvaComm *comm)
|
||||
: m_comm(comm)
|
||||
, m_collector(comm, [this] (QVector<QString> &&invalidNames) { onInvalidNameListReceived(std::move(invalidNames)); })
|
||||
{
|
||||
Q_ASSERT(comm);
|
||||
}
|
||||
|
||||
void SetRtProfileBase::connectToComm()
|
||||
{
|
||||
connect(m_comm, &IAvaComm::ok, this, &SetRtProfileBase::onOk);
|
||||
m_collector.start();
|
||||
}
|
||||
|
||||
void SetRtProfileBase::disconnectFromComm()
|
||||
{
|
||||
m_comm->disconnect(this);
|
||||
}
|
||||
|
||||
void SetRtProfileBase::sendCommand(const QString &cmd)
|
||||
{
|
||||
m_comm->sendPreparedCommand(cmd);
|
||||
}
|
||||
|
||||
bool SetRtProfileBase::nullifies(ICommand *other) const
|
||||
{
|
||||
Q_ASSERT(other);
|
||||
SetRtProfileBase *other_ = dynamic_cast<SetRtProfileBase*>(other);
|
||||
if (!other_)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetRtProfileBase::onOk()
|
||||
{
|
||||
Q_ASSERT(!m_ok);
|
||||
m_ok = true;
|
||||
}
|
||||
|
||||
void SetRtProfileBase::onInvalidNameListReceived(QVector<QString> &&invalidNames)
|
||||
{
|
||||
Q_ASSERT(m_ok);
|
||||
Q_ASSERT(!m_invalidNames);
|
||||
m_invalidNames = std::move(invalidNames);
|
||||
done();
|
||||
}
|
||||
|
||||
}} // namespace AudioVideoManagement::AvaCommands
|
||||
Reference in new issue
Block a user