OpalRT.cc 505 Bytes
Newer Older
1
#include "OpalRT.h"
Don Gagne's avatar
Don Gagne committed
2
#include "QGCMessageBox.h"
3 4 5

namespace OpalRT
{
6 7 8 9 10
//    lastErrorMsg = QString();
void OpalErrorMsg::displayLastErrorMsg()
{
    static QString lastErrorMsg;
    setLastErrorMsg();
Don Gagne's avatar
Don Gagne committed
11
    QGCMessageBox::critical(QString(), lastErrorMsg);
12
}
13

14 15 16 17 18 19 20 21 22 23
void OpalErrorMsg::setLastErrorMsg()
{
    char* buf = new char[512];
    unsigned short len;
    static QString lastErrorMsg;
    OpalGetLastErrMsg(buf, sizeof(buf), &len);
    lastErrorMsg.clear();
    lastErrorMsg.append(buf);
    delete buf;
}
24
}