Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* QueryEloka
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Astrid Mueller, SGAS, 2017-11-14
|
||||
*/
|
||||
|
||||
#include "query_eloka.h"
|
||||
#include "iava_comm.h"
|
||||
#include "iava_command_done_observer.h"
|
||||
#include "av_helper.h"
|
||||
|
||||
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
namespace AvaCommands
|
||||
{
|
||||
|
||||
QueryEloka::QueryEloka(IAvaComm *comm, IAvaCommandDoneObserver *observer, AvaQueryElokaMode mode)
|
||||
: m_mode(mode)
|
||||
, m_comm(comm)
|
||||
, m_observer(observer)
|
||||
, m_collector(comm, [this] (QVector<AvaEloka> &&eloka) { onQueryElokaListReceived(std::move(eloka)); })
|
||||
{
|
||||
Q_ASSERT(comm);
|
||||
Q_ASSERT(observer);
|
||||
Q_ASSERT(mode != AvaQueryElokaMode::Stop); // queryEloka 0 (aka Stop) is a SimpleCommad; there is no QueryElokaList-response then
|
||||
}
|
||||
|
||||
void QueryEloka::send()
|
||||
{
|
||||
connect(m_comm, &IAvaComm::ok, this, &QueryEloka::onOk);
|
||||
m_collector.start();
|
||||
m_comm->queryEloka(m_mode);
|
||||
}
|
||||
|
||||
void QueryEloka::onOk()
|
||||
{
|
||||
Q_ASSERT(!m_ok);
|
||||
m_ok = true;
|
||||
}
|
||||
|
||||
void QueryEloka::done()
|
||||
{
|
||||
m_comm->disconnect(this);
|
||||
m_observer->done(this);
|
||||
}
|
||||
|
||||
void QueryEloka::onQueryElokaListReceived(QVector<AvaEloka> &&eloka)
|
||||
{
|
||||
Q_ASSERT(m_ok);
|
||||
m_eloka = std::move(eloka);
|
||||
done();
|
||||
}
|
||||
|
||||
} // namespace AvaCommands
|
||||
} // namespace AudioVideoManagement
|
||||
Reference in new issue
Block a user