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.
45 lines
789 B
45 lines
789 B
4 years ago
|
#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 ESeverityLevel::eSeverityLevel getSeverityLevel(quint32 id)
|
||
|
{
|
||
|
switch(id)
|
||
|
{
|
||
|
case HW_NOT_FOUND:
|
||
|
case TRX_INIT_FAILED:
|
||
|
case SLAVE_PROG_FAILED:
|
||
|
return ESeverityLevel::Error;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
#endif //HWEXCEPTIONDEF_H
|