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

#include "event/EventCenter.h"
#include "GUIErrorLW.h"
#include <QChar>

void GUIErrorLW::parse(const QString &errorMsg) {
    char s[4];
    s[0] = errorMsg.data()[0].toLatin1();
    s[1] = errorMsg.data()[1].toLatin1();
    s[2] = errorMsg.data()[2].toLatin1();
    s[3] = errorMsg.data()[3].toLatin1();
    int * v = (int*)s;
    value = *v;
}

void GUIErrorLW::handle() {
    EventCenter::Default()->triggerEvent(WarnStateFlagChange, nullptr,(QObject*)&value);
}
