mirror of https://github.com/EspoTek/Labrador.git
Some unfinished scaffolding for non-ASCII UART decoding.
This commit is contained in:
parent
96cb814e8e
commit
f65c8aa5a0
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,137 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
** Resource object code
|
|
||||||
**
|
|
||||||
** Created by: The Resource Compiler for Qt version 5.9.1
|
|
||||||
**
|
|
||||||
** WARNING! All changes made in this file will be lost!
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
static const unsigned char qt_resource_data[] = {
|
|
||||||
// C:/Users/Esposch/Documents/Git/Labrador/Desktop_Interface/buffer_0.bmp
|
|
||||||
0x0,0x0,0x0,0x8d,
|
|
||||||
0x0,
|
|
||||||
0x0,0x28,0xb6,0x78,0x9c,0xed,0xd0,0xb1,0xd,0xc2,0x30,0x0,0x45,0xc1,0xb0,0x45,
|
|
||||||
0x6,0xa0,0xc8,0x4,0xc,0x90,0x3e,0x3b,0x30,0xa,0x53,0xb1,0x1e,0x98,0x28,0x5,
|
|
||||||
0xd5,0xd5,0x2e,0xde,0x49,0x5f,0xb2,0xec,0xc6,0x7a,0xfb,0xf1,0xde,0x96,0xd3,0x63,
|
|
||||||
0xec,0x77,0x7c,0x8e,0xdd,0xc7,0x6e,0xcb,0x7a,0xde,0xbf,0xae,0xf7,0x7f,0x9f,0x69,
|
|
||||||
0x4c,0xfb,0xb1,0x49,0xd4,0xc7,0xea,0x63,0xf5,0xb1,0xfa,0x58,0x7d,0xac,0x3e,0x56,
|
|
||||||
0x1f,0xab,0x8f,0xd5,0xc7,0xea,0x63,0xf5,0xb1,0xfa,0x58,0x7d,0xac,0x3e,0x56,0x1f,
|
|
||||||
0xab,0x8f,0xd5,0xc7,0xea,0x63,0xf5,0xb1,0xfa,0x58,0x7d,0xac,0x3e,0x56,0x1f,0xab,
|
|
||||||
0x8f,0xd5,0xc7,0xea,0x63,0xf5,0xb1,0xfa,0x58,0x7d,0xac,0x3e,0x56,0x1f,0xab,0x8f,
|
|
||||||
0xd5,0xc7,0xea,0x63,0x73,0xf6,0xf9,0x2,0xf4,0x4,0x42,0xe7,
|
|
||||||
// C:/Users/Esposch/Documents/Git/Labrador/Desktop_Interface/buffer_2.bmp
|
|
||||||
0x0,0x0,0x0,0x7b,
|
|
||||||
0x0,
|
|
||||||
0x0,0x28,0xb6,0x78,0x9c,0xed,0xd0,0x31,0xd,0x80,0x30,0x14,0x45,0xd1,0xe2,0x82,
|
|
||||||
0x81,0xb1,0x3,0xa,0x10,0xc0,0x8e,0x7,0xa4,0xa0,0xa,0x57,0x78,0xa0,0x34,0xc,
|
|
||||||
0x95,0xf0,0x86,0xf3,0x73,0x7f,0xd2,0xb4,0x4b,0x73,0xf6,0xe3,0x5e,0x4b,0x9f,0xad,
|
|
||||||
0xed,0x77,0x3c,0xdb,0xd6,0xb6,0x53,0x99,0xfb,0xfd,0xf5,0xbf,0x8f,0x53,0x97,0x27,
|
|
||||||
0xa4,0xd8,0x8f,0x85,0xc4,0x87,0xf,0x1f,0x3e,0x7c,0x32,0xe3,0xc3,0x87,0xf,0x1f,
|
|
||||||
0x3e,0x99,0xf1,0xe1,0xc3,0x87,0xf,0x9f,0xcc,0xf8,0xf0,0xe1,0xc3,0x87,0x4f,0x66,
|
|
||||||
0x7c,0xf8,0xf0,0xe1,0xc3,0x27,0x33,0x3e,0x7c,0xf8,0xf0,0xe1,0x93,0x19,0x1f,0x3e,
|
|
||||||
0x7c,0xf8,0xf0,0x19,0x7b,0x1,0x6d,0x5a,0xf,0xce,
|
|
||||||
// C:/Users/Esposch/Documents/Git/Labrador/Desktop_Interface/buffer_1.bmp
|
|
||||||
0x0,0x0,0x0,0x97,
|
|
||||||
0x0,
|
|
||||||
0x0,0x28,0xb6,0x78,0x9c,0xed,0xd0,0xb1,0xd,0xc2,0x30,0x10,0x40,0xd1,0xb0,0x5,
|
|
||||||
0x5,0x65,0xa,0x26,0x60,0x0,0x7a,0x76,0x60,0x14,0xa6,0x62,0x2b,0x66,0x0,0x27,
|
|
||||||
0x42,0x2,0x51,0xbc,0x96,0x14,0xff,0xc9,0x27,0x9d,0xec,0xc6,0xfa,0xe7,0xcb,0xfd,
|
|
||||||
0x38,0xad,0x4e,0x63,0x96,0xf5,0x3a,0x66,0x1e,0xb3,0x9b,0xf6,0xeb,0xfd,0xed,0xfd,
|
|
||||||
0xfe,0xed,0xb9,0x19,0x3f,0x1f,0x9b,0xf,0x8f,0x2d,0x9c,0x7f,0x57,0xf9,0xa8,0x8f,
|
|
||||||
0xd5,0xc7,0xea,0x63,0xf5,0xb1,0xfa,0x58,0x7d,0xac,0x3e,0x56,0x1f,0xab,0x8f,0xd5,
|
|
||||||
0xc7,0xea,0x63,0xf5,0xb1,0xfa,0x58,0x7d,0xac,0x3e,0x56,0x1f,0xab,0x8f,0xd5,0xc7,
|
|
||||||
0xea,0x63,0xf5,0xb1,0xfa,0x58,0x7d,0xac,0x3e,0x56,0x1f,0xab,0x8f,0xd5,0xc7,0xea,
|
|
||||||
0x63,0xf5,0xb1,0xfa,0x58,0x7d,0xac,0x3e,0x56,0x1f,0xab,0x8f,0xd5,0xc7,0xb6,0xd9,
|
|
||||||
0xe7,0x5,0x35,0x2d,0xc9,0xf3,
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
static const unsigned char qt_resource_name[] = {
|
|
||||||
// bitmap
|
|
||||||
0x0,0x6,
|
|
||||||
0x6,0x90,0xb3,0x80,
|
|
||||||
0x0,0x62,
|
|
||||||
0x0,0x69,0x0,0x74,0x0,0x6d,0x0,0x61,0x0,0x70,
|
|
||||||
// buffer_0.bmp
|
|
||||||
0x0,0xc,
|
|
||||||
0xd,0x14,0xd0,0xc0,
|
|
||||||
0x0,0x62,
|
|
||||||
0x0,0x75,0x0,0x66,0x0,0x66,0x0,0x65,0x0,0x72,0x0,0x5f,0x0,0x30,0x0,0x2e,0x0,0x62,0x0,0x6d,0x0,0x70,
|
|
||||||
// buffer_2.bmp
|
|
||||||
0x0,0xc,
|
|
||||||
0xd,0x12,0xd0,0xc0,
|
|
||||||
0x0,0x62,
|
|
||||||
0x0,0x75,0x0,0x66,0x0,0x66,0x0,0x65,0x0,0x72,0x0,0x5f,0x0,0x32,0x0,0x2e,0x0,0x62,0x0,0x6d,0x0,0x70,
|
|
||||||
// buffer_1.bmp
|
|
||||||
0x0,0xc,
|
|
||||||
0xd,0x17,0xd0,0xc0,
|
|
||||||
0x0,0x62,
|
|
||||||
0x0,0x75,0x0,0x66,0x0,0x66,0x0,0x65,0x0,0x72,0x0,0x5f,0x0,0x31,0x0,0x2e,0x0,0x62,0x0,0x6d,0x0,0x70,
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
static const unsigned char qt_resource_struct[] = {
|
|
||||||
// :
|
|
||||||
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
|
|
||||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
|
||||||
// :/bitmap
|
|
||||||
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x2,
|
|
||||||
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
|
||||||
// :/bitmap/buffer_2.bmp
|
|
||||||
0x0,0x0,0x0,0x30,0x0,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x91,
|
|
||||||
0x0,0x0,0x1,0x5f,0x3d,0x9a,0x27,0x47,
|
|
||||||
// :/bitmap/buffer_0.bmp
|
|
||||||
0x0,0x0,0x0,0x12,0x0,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
|
|
||||||
0x0,0x0,0x1,0x5f,0x3d,0x9a,0x27,0x46,
|
|
||||||
// :/bitmap/buffer_1.bmp
|
|
||||||
0x0,0x0,0x0,0x4e,0x0,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0x10,
|
|
||||||
0x0,0x0,0x1,0x5f,0x3d,0x9a,0x27,0x46,
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef QT_NAMESPACE
|
|
||||||
# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
|
|
||||||
# define QT_RCC_MANGLE_NAMESPACE0(x) x
|
|
||||||
# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
|
|
||||||
# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
|
|
||||||
# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
|
|
||||||
QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
|
|
||||||
#else
|
|
||||||
# define QT_RCC_PREPEND_NAMESPACE(name) name
|
|
||||||
# define QT_RCC_MANGLE_NAMESPACE(name) name
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef QT_NAMESPACE
|
|
||||||
namespace QT_NAMESPACE {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
|
|
||||||
|
|
||||||
bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
|
|
||||||
|
|
||||||
#ifdef QT_NAMESPACE
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int QT_RCC_MANGLE_NAMESPACE(qInitResources_resources)();
|
|
||||||
int QT_RCC_MANGLE_NAMESPACE(qInitResources_resources)()
|
|
||||||
{
|
|
||||||
QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData)
|
|
||||||
(0x2, qt_resource_struct, qt_resource_name, qt_resource_data);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resources)();
|
|
||||||
int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resources)()
|
|
||||||
{
|
|
||||||
QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData)
|
|
||||||
(0x2, qt_resource_struct, qt_resource_name, qt_resource_data);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
struct initializer {
|
|
||||||
initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_resources)(); }
|
|
||||||
~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resources)(); }
|
|
||||||
} dummy;
|
|
||||||
}
|
|
|
@ -108,7 +108,7 @@ void uartStyleDecoder::decodeNextUartBit(unsigned char bitValue)
|
||||||
{
|
{
|
||||||
if(dataBit_current == dataBit_max){
|
if(dataBit_current == dataBit_max){
|
||||||
if(numCharsInBuffer<SERIAL_BUFFER_LENGTH) numCharsInBuffer++;
|
if(numCharsInBuffer<SERIAL_BUFFER_LENGTH) numCharsInBuffer++;
|
||||||
serialBuffer->add(currentUartSymbol);
|
decodeDatabit(dataBit_max+1);
|
||||||
currentUartSymbol = 0;
|
currentUartSymbol = 0;
|
||||||
dataBit_current = 0;
|
dataBit_current = 0;
|
||||||
uartTransmitting = false;
|
uartTransmitting = false;
|
||||||
|
@ -154,3 +154,25 @@ bool uartStyleDecoder::jitterCompensationProcedure(double baudRate, unsigned cha
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Basically scaffoldingto add character maps for other modes (5 bit, for example).
|
||||||
|
void uartStyleDecoder::decodeDatabit(int mode){
|
||||||
|
unsigned short tempchar;
|
||||||
|
switch(mode){
|
||||||
|
case 5:
|
||||||
|
tempchar = decode_baudot(currentUartSymbol);
|
||||||
|
case 8: //8-bit ASCII;
|
||||||
|
tempchar = currentUartSymbol;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
qDebug() << "uartStyleDecoder::decodeDatabit is failing...";
|
||||||
|
}
|
||||||
|
serialBuffer->add(tempchar);
|
||||||
|
}
|
||||||
|
|
||||||
|
char uartStyleDecoder::decode_baudot(short symbol){
|
||||||
|
return 'a';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ private:
|
||||||
QPlainTextEdit *console;
|
QPlainTextEdit *console;
|
||||||
isoBufferBuffer *serialBuffer;
|
isoBufferBuffer *serialBuffer;
|
||||||
int numCharsInBuffer = 0;
|
int numCharsInBuffer = 0;
|
||||||
|
void decodeDatabit(int mode);
|
||||||
|
char decode_baudot(short symbol);
|
||||||
signals:
|
signals:
|
||||||
void wireDisconnected(int);
|
void wireDisconnected(int);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
Loading…
Reference in New Issue