You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
744 B
44 lines
744 B
#ifndef HWEXCEPTIONDEF_H
|
|
#define HWEXCEPTIONDEF_H
|
|
|
|
#include <QString>
|
|
|
|
//#include "logger/ESeverityLevel.h"
|
|
|
|
#define HW_NOT_FOUND 0
|
|
#define TRX_INIT_FAILED 1
|
|
#define SLAVE_PROG_FAILED 2
|
|
|
|
struct HwErrors
|
|
{
|
|
static QString getErrorMessage(quint32 id)
|
|
{
|
|
switch(id)
|
|
{
|
|
case HW_NOT_FOUND:
|
|
return
|
|
"No hardware was detected, please check your hardware is properly powered on and try again.";
|
|
|
|
case TRX_INIT_FAILED:
|
|
return
|
|
"Could not init trx board.";
|
|
|
|
case SLAVE_PROG_FAILED:
|
|
return
|
|
"Could not program slave FPGAs.";
|
|
}
|
|
}
|
|
|
|
static int getSeverityLevel(quint32 id)
|
|
{
|
|
switch(id)
|
|
{
|
|
case HW_NOT_FOUND:
|
|
case TRX_INIT_FAILED:
|
|
case SLAVE_PROG_FAILED:
|
|
return 0;
|
|
}
|
|
}
|
|
};
|
|
|
|
#endif //HWEXCEPTIONDEF_H
|
|
|