//
// Created by Krad on 2021/12/16.
//

#include "GUIErrorLE.h"
#include "event/EventCenter.h"
#include <QDebug>
#include <QApplication>

void GUIErrorLE::parse(const QString &errorMsg) {
    if (errorMsg.isEmpty()) return;
    if (errorMsg[0] == 'e' && errorMsg[1] == ' ')
    {
        errorMessage = errorMsg.right(errorMsg.length()-2);
    } else{
        errorMessage = errorMsg;
    }
}

void GUIErrorLE::handle() {
    EventCenter::Default()->triggerEvent(DeviceErrorRaise, nullptr,(QObject*)&errorMessage);
}

