70 lines
1.5 KiB
C++
Executable File
70 lines
1.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* SetRtProfileBase
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Fröbel, NLE, 2018-12-17
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AudioVideoManagement/icommand.h>
|
|
#include <AudioVideoManagement/list_response_collector.h>
|
|
#include <QVector>
|
|
#include <QString>
|
|
#include <boost/optional.hpp>
|
|
#include <functional>
|
|
|
|
class QByteArray;
|
|
|
|
namespace AudioVideoManagement
|
|
{
|
|
|
|
class IAvaComm;
|
|
|
|
namespace AvaCommands
|
|
{
|
|
|
|
/**
|
|
* Base class for setRtProfile-related commands.
|
|
* It implements the handling of the responses sent in return of a setRtProfile command.
|
|
*
|
|
* @see SetRtProfile, ChangeRtProfileCircuitName
|
|
* @author Christian Fröbel
|
|
*/
|
|
class SetRtProfileBase : public ICommand
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SetRtProfileBase(IAvaComm *comm);
|
|
|
|
const QVector<QString> &invalidNameList() const { return *m_invalidNames; }
|
|
|
|
protected:
|
|
/** Supposed to be called by the send() method of the derived class. */
|
|
void connectToComm();
|
|
/** Supposed to be called by the done() method of the derived class. */
|
|
void disconnectFromComm();
|
|
|
|
void sendCommand(const QString &cmd);
|
|
|
|
virtual void done() = 0;
|
|
|
|
bool nullifies(ICommand *other) const override;
|
|
|
|
private slots:
|
|
void onOk();
|
|
|
|
private:
|
|
void onInvalidNameListReceived(QVector<QString> &&invalidNames);
|
|
|
|
bool m_ok{false};
|
|
boost::optional<QVector<QString>> m_invalidNames;
|
|
IAvaComm *m_comm;
|
|
InvalidNameListCollector m_collector;
|
|
};
|
|
|
|
}} // namespace AudioVideoManagement::AvaCommands
|