#include "process/update_dc_command.h"
#include "worker.h"

UpdateDCCommand::UpdateDCCommand(QString const &command,
                                 Worker *worker,
                                 int nextCommandIndex,
                                 int start_timeout,
                                 int finish_timeout)
  : UpdateCommand(command, worker, nextCommandIndex, start_timeout, finish_timeout) {
}

void UpdateDCCommand::finished(int exitCode, QProcess::ExitStatus exitStatus) {
    return UpdateCommand::finished(exitCode, exitStatus);
}

void UpdateDCCommand::readyReadStandardOutput() {
    QProcess *p = (QProcess *)sender();
    if (p) {
        QString s = p->readAllStandardOutput();

        // TODO
        Worker *w = worker();
        if (w) {
    // static constexpr const char *UPDATE_DC_FIRMARE_SUCCESS"success"};
            emit w->showUpdateDCFirmware(UpdateCommand::UPDATE_DC_FIRMARE_SUCCESS);
        }
    }
}