SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <command.h>
Inherits QObject.
Public Member Functions | |
Command () | |
Command (const Command &command) | |
~Command () | |
void | resetToDefaults () |
QByteArray | serialize () const |
bool | deserialize (const QByteArray &data) |
void | setCommand (const QString &command) |
const QString & | getCommand () const |
void | setArgString (const QString &argString) |
const QString & | getArgString () const |
void | setGroup (const QString &group) |
const QString & | getGroup () const |
void | setDescription (const QString &description) |
const QString & | getDescription () const |
void | setKey (Qt::Key key) |
Qt::Key | getKey () const |
void | setKeyModifiers (Qt::KeyboardModifiers keyModifiers) |
Qt::KeyboardModifiers | getKeyModifiers () const |
void | setAssociateKey (bool associate) |
bool | getAssociateKey () const |
void | setRelease (bool release) |
bool | getRelease () const |
QString | getKeyLabel () const |
void | run (const QString &apiAddress, int apiPort, int deviceSetIndex) |
void | kill () |
QProcess::ProcessState | getLastProcessState () const |
bool | getLastProcessError (QProcess::ProcessError &error) const |
bool | getLastProcessExit (int &exitCode, QProcess::ExitStatus &exitStatus) const |
const QString & | getLastProcessLog () const |
uint64_t | getLastProcessStartTimestampms () const |
uint64_t | getLastProcessFinishTimestampms () const |
const QString & | getLastProcessCommandLine () const |
qint64 | getLastProcessPid () const |
Static Public Member Functions | |
static bool | commandCompare (const Command *c1, Command *c2) |
Private Slots | |
void | processStateChanged (QProcess::ProcessState newState) |
void | processError (QProcess::ProcessError error) |
void | processFinished (int exitCode, QProcess::ExitStatus exitStatus) |
Private Attributes | |
QString | m_group |
QString | m_description |
QString | m_command |
QString | m_argString |
Qt::Key | m_key |
Qt::KeyboardModifiers | m_keyModifiers |
bool | m_associateKey |
bool | m_release |
QProcess * | m_currentProcess |
QProcess::ProcessState | m_currentProcessState |
bool | m_isInError |
QProcess::ProcessError | m_currentProcessError |
bool | m_hasExited |
int | m_currentProcessExitCode |
QProcess::ExitStatus | m_currentProcessExitStatus |
QString | m_log |
uint64_t | m_currentProcessStartTimeStampms |
uint64_t | m_currentProcessFinishTimeStampms |
QString | m_currentProcessCommandLine |
qint64 | m_currentProcessPid |
Command::Command | ( | ) |
Definition at line 27 of file command.cpp.
References m_currentProcessFinishTimeStampms, m_currentProcessStartTimeStampms, and resetToDefaults().
Command::Command | ( | const Command & | command | ) |
Definition at line 43 of file command.cpp.
References m_currentProcessFinishTimeStampms, and m_currentProcessStartTimeStampms.
Command::~Command | ( | ) |
Definition at line 66 of file command.cpp.
References m_currentProcess, processError(), processFinished(), and processStateChanged().
Definition at line 72 of file command.h.
References m_description, m_group, m_key, and m_release.
Referenced by MainSettings::sortCommands().
bool Command::deserialize | ( | const QByteArray & | data | ) |
Definition at line 110 of file command.cpp.
References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_argString, m_associateKey, m_command, m_description, m_group, m_key, m_keyModifiers, m_release, SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), and resetToDefaults().
Referenced by MainSettings::load().
|
inline |
Definition at line 46 of file command.h.
Referenced by EditCommandDialog::fromCommand().
|
inline |
Definition at line 56 of file command.h.
Referenced by MainWindow::addCommandToTree(), MainWindow::commandKeyPressed(), and EditCommandDialog::fromCommand().
|
inline |
Definition at line 44 of file command.h.
Referenced by EditCommandDialog::fromCommand().
|
inline |
Definition at line 50 of file command.h.
Referenced by MainWindow::addCommandToTree(), EditCommandDialog::fromCommand(), and MainWindow::on_commandDelete_clicked().
|
inline |
Definition at line 48 of file command.h.
Referenced by MainWindow::addCommandToTree(), EditCommandDialog::fromCommand(), MainWindow::on_commandEdit_clicked(), and MainWindow::on_commandRun_clicked().
|
inline |
Definition at line 52 of file command.h.
Referenced by MainWindow::commandKeyPressed(), and EditCommandDialog::fromCommand().
QString Command::getKeyLabel | ( | ) | const |
Definition at line 144 of file command.cpp.
References m_key, and m_keyModifiers.
Referenced by MainWindow::addCommandToTree().
|
inline |
Definition at line 54 of file command.h.
Referenced by MainWindow::commandKeyPressed(), and EditCommandDialog::fromCommand().
|
inline |
Definition at line 69 of file command.h.
Referenced by CommandOutputDialog::refresh().
bool Command::getLastProcessError | ( | QProcess::ProcessError & | error | ) | const |
Definition at line 223 of file command.cpp.
References m_currentProcessError, and m_isInError.
Referenced by CommandOutputDialog::refresh().
bool Command::getLastProcessExit | ( | int & | exitCode, |
QProcess::ExitStatus & | exitStatus | ||
) | const |
Definition at line 232 of file command.cpp.
References m_currentProcessExitCode, m_currentProcessExitStatus, and m_hasExited.
Referenced by CommandOutputDialog::refresh().
|
inline |
Definition at line 68 of file command.h.
Referenced by CommandOutputDialog::refresh().
const QString & Command::getLastProcessLog | ( | ) | const |
Definition at line 243 of file command.cpp.
References m_log.
Referenced by CommandOutputDialog::refresh().
|
inline |
Definition at line 70 of file command.h.
Referenced by CommandOutputDialog::refresh().
|
inline |
Definition at line 67 of file command.h.
Referenced by CommandOutputDialog::refresh().
QProcess::ProcessState Command::getLastProcessState | ( | ) | const |
Definition at line 218 of file command.cpp.
References m_currentProcessState.
Referenced by CommandOutputDialog::refresh().
|
inline |
Definition at line 58 of file command.h.
Referenced by MainWindow::addCommandToTree(), MainWindow::commandKeyPressed(), and EditCommandDialog::fromCommand().
void Command::kill | ( | ) |
Definition at line 209 of file command.cpp.
References m_currentProcess, and m_currentProcessPid.
Referenced by CommandOutputDialog::on_processKill_toggled().
|
privateslot |
Definition at line 258 of file command.cpp.
References m_currentProcess, m_currentProcessError, m_currentProcessFinishTimeStampms, m_currentProcessState, m_isInError, m_log, TimeUtil::nowms(), processFinished(), and processStateChanged().
Referenced by processFinished(), run(), and ~Command().
|
privateslot |
Definition at line 282 of file command.cpp.
References m_currentProcess, m_currentProcessExitCode, m_currentProcessExitStatus, m_currentProcessFinishTimeStampms, m_hasExited, m_log, TimeUtil::nowms(), processError(), and processStateChanged().
Referenced by processError(), run(), and ~Command().
|
privateslot |
Definition at line 248 of file command.cpp.
References m_currentProcess, m_currentProcessPid, and m_currentProcessState.
Referenced by processError(), processFinished(), run(), and ~Command().
void Command::resetToDefaults | ( | ) |
Definition at line 81 of file command.cpp.
References m_argString, m_associateKey, m_command, m_description, m_group, m_key, m_keyModifiers, and m_release.
Referenced by Command(), and deserialize().
void Command::run | ( | const QString & | apiAddress, |
int | apiPort, | ||
int | deviceSetIndex | ||
) |
Definition at line 162 of file command.cpp.
References m_argString, m_command, m_currentProcess, m_currentProcessCommandLine, m_currentProcessStartTimeStampms, m_hasExited, m_isInError, TimeUtil::nowms(), processError(), processFinished(), and processStateChanged().
Referenced by MainWindow::commandKeyPressed(), and MainWindow::on_commandRun_clicked().
QByteArray Command::serialize | ( | ) | const |
Definition at line 93 of file command.cpp.
References SimpleSerializer::final(), m_argString, m_associateKey, m_command, m_description, m_group, m_key, m_keyModifiers, m_release, SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), and SimpleSerializer::writeString().
|
inline |
Definition at line 45 of file command.h.
Referenced by EditCommandDialog::toCommand().
|
inline |
Definition at line 55 of file command.h.
Referenced by EditCommandDialog::toCommand().
|
inline |
Definition at line 43 of file command.h.
Referenced by EditCommandDialog::toCommand().
|
inline |
Definition at line 49 of file command.h.
Referenced by MainWindow::on_commandNew_clicked(), and EditCommandDialog::toCommand().
|
inline |
Definition at line 47 of file command.h.
Referenced by MainWindow::on_commandNew_clicked(), MainSettings::renameCommandGroup(), and EditCommandDialog::toCommand().
|
inline |
Definition at line 51 of file command.h.
Referenced by EditCommandDialog::toCommand().
|
inline |
Definition at line 53 of file command.h.
Referenced by EditCommandDialog::toCommand().
|
inline |
Definition at line 57 of file command.h.
Referenced by EditCommandDialog::toCommand().
|
private |
Definition at line 98 of file command.h.
Referenced by deserialize(), resetToDefaults(), run(), and serialize().
|
private |
Definition at line 101 of file command.h.
Referenced by deserialize(), resetToDefaults(), and serialize().
|
private |
Definition at line 97 of file command.h.
Referenced by deserialize(), resetToDefaults(), run(), and serialize().
|
private |
Definition at line 103 of file command.h.
Referenced by kill(), processError(), processFinished(), processStateChanged(), run(), and ~Command().
|
private |
|
private |
Definition at line 106 of file command.h.
Referenced by getLastProcessError(), and processError().
|
private |
Definition at line 108 of file command.h.
Referenced by getLastProcessExit(), and processFinished().
|
private |
Definition at line 109 of file command.h.
Referenced by getLastProcessExit(), and processFinished().
|
private |
Definition at line 112 of file command.h.
Referenced by Command(), processError(), and processFinished().
|
private |
Definition at line 114 of file command.h.
Referenced by kill(), and processStateChanged().
|
private |
|
private |
Definition at line 104 of file command.h.
Referenced by getLastProcessState(), processError(), and processStateChanged().
|
private |
Definition at line 96 of file command.h.
Referenced by commandCompare(), deserialize(), resetToDefaults(), and serialize().
|
private |
Definition at line 95 of file command.h.
Referenced by commandCompare(), deserialize(), resetToDefaults(), and serialize().
|
private |
Definition at line 107 of file command.h.
Referenced by getLastProcessExit(), processFinished(), and run().
|
private |
Definition at line 105 of file command.h.
Referenced by getLastProcessError(), processError(), and run().
|
private |
Definition at line 99 of file command.h.
Referenced by commandCompare(), deserialize(), getKeyLabel(), resetToDefaults(), and serialize().
|
private |
Definition at line 100 of file command.h.
Referenced by deserialize(), getKeyLabel(), resetToDefaults(), and serialize().
|
private |
Definition at line 110 of file command.h.
Referenced by getLastProcessLog(), processError(), and processFinished().
|
private |
Definition at line 102 of file command.h.
Referenced by commandCompare(), deserialize(), resetToDefaults(), and serialize().