Files
qt5-legatus-legacy/Lts/Tools/DotMatrixDisplay/customMapsAndEnum.h
T
2026-08-13 18:33:10 +02:00

61 lines
1.0 KiB
C
Executable File

/**
* @RDE_HEADER@
* Provides structs, typedefs and an enum
* $Id$
* $HeadURL$
* $Author$
* Created by Florian Schult, SLSE, 2016-03-18
*/
#pragma once
#include <QString>
#include <QMap>
struct Mode
{
QString name;
int lines = 0;
int letters = 0;
int height = 0;
};
struct Port
{
int port = 0;
QString name;
};
typedef QMap<QString, Mode> ModeMap;
typedef QMap<int, Port> PortMap;
enum MsgLvl
{
MSGLVL_TRACE = 1,
MSGLVL_DEBUG = 2,
MSGLVL_INFO = 3,
MSGLVL_WARNING = 4,
MSGLVL_ERROR = 5,
MSGLVL_FATAL = 6
};
inline static QString levelName(MsgLvl lvl)
{
switch (lvl)
{
case MSGLVL_TRACE:
return QStringLiteral("Trace");
case MSGLVL_DEBUG:
return QStringLiteral("Debug");
case MSGLVL_INFO:
return QStringLiteral("Info");
case MSGLVL_WARNING:
return QStringLiteral("Warning");
case MSGLVL_ERROR:
return QStringLiteral("Error");
case MSGLVL_FATAL:
return QStringLiteral("Fatal");
}
return QStringLiteral("Unknown (%1)").arg(lvl);
}