mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-22 08:05:49 +08:00
Hopefully fix the missing display of the first transmission in all modes.
This commit is contained in:
@@ -33,15 +33,12 @@ public:
|
|||||||
virtual void setLockout() = 0;
|
virtual void setLockout() = 0;
|
||||||
virtual void setError(const char* text) = 0;
|
virtual void setError(const char* text) = 0;
|
||||||
|
|
||||||
virtual void setDStar() = 0;
|
|
||||||
virtual void writeDStar(const char* my1, const char* my2, const char* your) = 0;
|
virtual void writeDStar(const char* my1, const char* my2, const char* your) = 0;
|
||||||
virtual void clearDStar() = 0;
|
virtual void clearDStar() = 0;
|
||||||
|
|
||||||
virtual void setDMR() = 0;
|
|
||||||
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type) = 0;
|
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type) = 0;
|
||||||
virtual void clearDMR(unsigned int slotNo) = 0;
|
virtual void clearDMR(unsigned int slotNo) = 0;
|
||||||
|
|
||||||
virtual void setFusion() = 0;
|
|
||||||
virtual void writeFusion(const char* source, const char* dest) = 0;
|
virtual void writeFusion(const char* source, const char* dest) = 0;
|
||||||
virtual void clearFusion() = 0;
|
virtual void clearFusion() = 0;
|
||||||
|
|
||||||
|
|||||||
82
HD44780.cpp
82
HD44780.cpp
@@ -38,7 +38,8 @@ m_d0(pins.at(2U)),
|
|||||||
m_d1(pins.at(3U)),
|
m_d1(pins.at(3U)),
|
||||||
m_d2(pins.at(4U)),
|
m_d2(pins.at(4U)),
|
||||||
m_d3(pins.at(5U)),
|
m_d3(pins.at(5U)),
|
||||||
m_fd(-1)
|
m_fd(-1),
|
||||||
|
m_dmr(false)
|
||||||
{
|
{
|
||||||
assert(rows > 1U);
|
assert(rows > 1U);
|
||||||
assert(cols > 15U);
|
assert(cols > 15U);
|
||||||
@@ -74,6 +75,8 @@ void CHD44780::setIdle()
|
|||||||
|
|
||||||
::lcdPosition(m_fd, 0, 1);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
::lcdPuts(m_fd, "MMDVM Idle");
|
::lcdPuts(m_fd, "MMDVM Idle");
|
||||||
|
|
||||||
|
m_dmr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::setError(const char* text)
|
void CHD44780::setError(const char* text)
|
||||||
@@ -87,6 +90,8 @@ void CHD44780::setError(const char* text)
|
|||||||
|
|
||||||
::lcdPosition(m_fd, 0, 1);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
::lcdPrintf(m_fd, "%s ERROR", text);
|
::lcdPrintf(m_fd, "%s ERROR", text);
|
||||||
|
|
||||||
|
m_dmr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::setLockout()
|
void CHD44780::setLockout()
|
||||||
@@ -98,17 +103,8 @@ void CHD44780::setLockout()
|
|||||||
|
|
||||||
::lcdPosition(m_fd, 0, 1);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
::lcdPuts(m_fd, "Lockout");
|
::lcdPuts(m_fd, "Lockout");
|
||||||
}
|
|
||||||
|
|
||||||
void CHD44780::setDStar()
|
m_dmr = false;
|
||||||
{
|
|
||||||
::lcdClear(m_fd);
|
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, 0);
|
|
||||||
::lcdPuts(m_fd, "D-Star");
|
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, 1);
|
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::writeDStar(const char* my1, const char* my2, const char* your)
|
void CHD44780::writeDStar(const char* my1, const char* my2, const char* your)
|
||||||
@@ -117,6 +113,11 @@ void CHD44780::writeDStar(const char* my1, const char* my2, const char* your)
|
|||||||
assert(my2 != NULL);
|
assert(my2 != NULL);
|
||||||
assert(your != NULL);
|
assert(your != NULL);
|
||||||
|
|
||||||
|
::lcdClear(m_fd);
|
||||||
|
|
||||||
|
::lcdPosition(m_fd, 0, 0);
|
||||||
|
::lcdPuts(m_fd, "D-Star");
|
||||||
|
|
||||||
if (m_rows > 2U) {
|
if (m_rows > 2U) {
|
||||||
char buffer[40U];
|
char buffer[40U];
|
||||||
|
|
||||||
@@ -134,6 +135,8 @@ void CHD44780::writeDStar(const char* my1, const char* my2, const char* your)
|
|||||||
::lcdPosition(m_fd, 0, 1);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_dmr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::clearDStar()
|
void CHD44780::clearDStar()
|
||||||
@@ -150,30 +153,27 @@ void CHD44780::clearDStar()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::setDMR()
|
|
||||||
{
|
|
||||||
::lcdClear(m_fd);
|
|
||||||
|
|
||||||
int row = 0;
|
|
||||||
if (m_rows > 2U) {
|
|
||||||
::lcdPosition(m_fd, 0, row);
|
|
||||||
::lcdPuts(m_fd, "DMR");
|
|
||||||
row++;
|
|
||||||
}
|
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, row);
|
|
||||||
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING);
|
|
||||||
|
|
||||||
row++;
|
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, row);
|
|
||||||
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CHD44780::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
void CHD44780::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
||||||
{
|
{
|
||||||
assert(type != NULL);
|
assert(type != NULL);
|
||||||
|
|
||||||
|
::lcdClear(m_fd);
|
||||||
|
|
||||||
|
if (m_rows > 2U) {
|
||||||
|
::lcdPosition(m_fd, 0, 0);
|
||||||
|
::lcdPuts(m_fd, "DMR");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_dmr) {
|
||||||
|
if (slotNo == 1U) {
|
||||||
|
::lcdPosition(m_fd, 0, m_rows > 2U ? 2 : 1);
|
||||||
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING);
|
||||||
|
} else {
|
||||||
|
::lcdPosition(m_fd, 0, m_rows > 2U ? 1 : 0);
|
||||||
|
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (slotNo == 1U) {
|
if (slotNo == 1U) {
|
||||||
char buffer[40U];
|
char buffer[40U];
|
||||||
if (m_cols > 16U)
|
if (m_cols > 16U)
|
||||||
@@ -193,6 +193,8 @@ void CHD44780::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, uns
|
|||||||
::lcdPosition(m_fd, 0, m_rows > 2U ? 2 : 1);
|
::lcdPosition(m_fd, 0, m_rows > 2U ? 2 : 1);
|
||||||
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_dmr = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::clearDMR(unsigned int slotNo)
|
void CHD44780::clearDMR(unsigned int slotNo)
|
||||||
@@ -206,22 +208,16 @@ void CHD44780::clearDMR(unsigned int slotNo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::setFusion()
|
|
||||||
{
|
|
||||||
::lcdClear(m_fd);
|
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, 0);
|
|
||||||
::lcdPuts(m_fd, "System Fusion");
|
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, 1);
|
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CHD44780::writeFusion(const char* source, const char* dest)
|
void CHD44780::writeFusion(const char* source, const char* dest)
|
||||||
{
|
{
|
||||||
assert(source != NULL);
|
assert(source != NULL);
|
||||||
assert(dest != NULL);
|
assert(dest != NULL);
|
||||||
|
|
||||||
|
::lcdClear(m_fd);
|
||||||
|
|
||||||
|
::lcdPosition(m_fd, 0, 0);
|
||||||
|
::lcdPuts(m_fd, "System Fusion");
|
||||||
|
|
||||||
if (m_rows > 2U) {
|
if (m_rows > 2U) {
|
||||||
char buffer[40U];
|
char buffer[40U];
|
||||||
|
|
||||||
@@ -239,6 +235,8 @@ void CHD44780::writeFusion(const char* source, const char* dest)
|
|||||||
::lcdPosition(m_fd, 0, 1);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_dmr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::clearFusion()
|
void CHD44780::clearFusion()
|
||||||
|
|||||||
@@ -37,15 +37,12 @@ public:
|
|||||||
virtual void setError(const char* text);
|
virtual void setError(const char* text);
|
||||||
virtual void setLockout();
|
virtual void setLockout();
|
||||||
|
|
||||||
virtual void setDStar();
|
|
||||||
virtual void writeDStar(const char* my1, const char* my2, const char* your);
|
virtual void writeDStar(const char* my1, const char* my2, const char* your);
|
||||||
virtual void clearDStar();
|
virtual void clearDStar();
|
||||||
|
|
||||||
virtual void setDMR();
|
|
||||||
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type);
|
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type);
|
||||||
virtual void clearDMR(unsigned int slotNo);
|
virtual void clearDMR(unsigned int slotNo);
|
||||||
|
|
||||||
virtual void setFusion();
|
|
||||||
virtual void writeFusion(const char* source, const char* dest);
|
virtual void writeFusion(const char* source, const char* dest);
|
||||||
virtual void clearFusion();
|
virtual void clearFusion();
|
||||||
|
|
||||||
@@ -63,6 +60,7 @@ private:
|
|||||||
unsigned int m_d2;
|
unsigned int m_d2;
|
||||||
unsigned int m_d3;
|
unsigned int m_d3;
|
||||||
int m_fd;
|
int m_fd;
|
||||||
|
bool m_dmr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -625,7 +625,6 @@ void CMMDVMHost::setMode(unsigned char mode, bool logging)
|
|||||||
LogMessage("Mode set to D-Star");
|
LogMessage("Mode set to D-Star");
|
||||||
if (m_dmrNetwork != NULL)
|
if (m_dmrNetwork != NULL)
|
||||||
m_dmrNetwork->enable(false);
|
m_dmrNetwork->enable(false);
|
||||||
m_display->setDStar();
|
|
||||||
m_modem->setMode(MODE_DSTAR);
|
m_modem->setMode(MODE_DSTAR);
|
||||||
m_mode = MODE_DSTAR;
|
m_mode = MODE_DSTAR;
|
||||||
m_modeTimer.start();
|
m_modeTimer.start();
|
||||||
@@ -636,7 +635,6 @@ void CMMDVMHost::setMode(unsigned char mode, bool logging)
|
|||||||
LogMessage("Mode set to DMR");
|
LogMessage("Mode set to DMR");
|
||||||
if (m_dstarNetwork != NULL)
|
if (m_dstarNetwork != NULL)
|
||||||
m_dstarNetwork->enable(false);
|
m_dstarNetwork->enable(false);
|
||||||
m_display->setDMR();
|
|
||||||
m_modem->setMode(MODE_DMR);
|
m_modem->setMode(MODE_DMR);
|
||||||
if (m_duplex)
|
if (m_duplex)
|
||||||
m_modem->writeDMRStart(true);
|
m_modem->writeDMRStart(true);
|
||||||
@@ -651,7 +649,6 @@ void CMMDVMHost::setMode(unsigned char mode, bool logging)
|
|||||||
m_dstarNetwork->enable(false);
|
m_dstarNetwork->enable(false);
|
||||||
if (m_dmrNetwork != NULL)
|
if (m_dmrNetwork != NULL)
|
||||||
m_dmrNetwork->enable(false);
|
m_dmrNetwork->enable(false);
|
||||||
m_display->setFusion();
|
|
||||||
m_modem->setMode(MODE_YSF);
|
m_modem->setMode(MODE_YSF);
|
||||||
m_mode = MODE_YSF;
|
m_mode = MODE_YSF;
|
||||||
m_modeTimer.start();
|
m_modeTimer.start();
|
||||||
|
|||||||
50
Nextion.cpp
50
Nextion.cpp
@@ -27,7 +27,8 @@ CNextion::CNextion(const char* callsign, unsigned int dmrid, const std::string&
|
|||||||
m_callsign(callsign),
|
m_callsign(callsign),
|
||||||
m_dmrid(dmrid),
|
m_dmrid(dmrid),
|
||||||
m_serial(port, SERIAL_9600),
|
m_serial(port, SERIAL_9600),
|
||||||
m_brightness(brightness)
|
m_brightness(brightness),
|
||||||
|
m_mode(MODE_IDLE)
|
||||||
{
|
{
|
||||||
assert(brightness >= 0U && brightness <= 100U);
|
assert(brightness >= 0U && brightness <= 100U);
|
||||||
}
|
}
|
||||||
@@ -64,6 +65,8 @@ void CNextion::setIdle()
|
|||||||
|
|
||||||
sendCommand(command);
|
sendCommand(command);
|
||||||
sendCommand("t1.txt=\"MMDVM IDLE\"");
|
sendCommand("t1.txt=\"MMDVM IDLE\"");
|
||||||
|
|
||||||
|
m_mode = MODE_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNextion::setError(const char* text)
|
void CNextion::setError(const char* text)
|
||||||
@@ -77,6 +80,8 @@ void CNextion::setError(const char* text)
|
|||||||
|
|
||||||
sendCommand(command);
|
sendCommand(command);
|
||||||
sendCommand("t1.txt=\"ERROR\"");
|
sendCommand("t1.txt=\"ERROR\"");
|
||||||
|
|
||||||
|
m_mode = MODE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNextion::setLockout()
|
void CNextion::setLockout()
|
||||||
@@ -84,13 +89,8 @@ void CNextion::setLockout()
|
|||||||
sendCommand("page MMDVM");
|
sendCommand("page MMDVM");
|
||||||
|
|
||||||
sendCommand("t0.txt=\"LOCKOUT\"");
|
sendCommand("t0.txt=\"LOCKOUT\"");
|
||||||
}
|
|
||||||
|
|
||||||
void CNextion::setDStar()
|
m_mode = MODE_LOCKOUT;
|
||||||
{
|
|
||||||
sendCommand("page DStar");
|
|
||||||
|
|
||||||
sendCommand("t0.txt=\"Listening\"");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNextion::writeDStar(const char* my1, const char* my2, const char* your)
|
void CNextion::writeDStar(const char* my1, const char* my2, const char* your)
|
||||||
@@ -99,12 +99,17 @@ void CNextion::writeDStar(const char* my1, const char* my2, const char* your)
|
|||||||
assert(my2 != NULL);
|
assert(my2 != NULL);
|
||||||
assert(your != NULL);
|
assert(your != NULL);
|
||||||
|
|
||||||
|
if (m_mode != MODE_DSTAR)
|
||||||
|
sendCommand("page DStar");
|
||||||
|
|
||||||
char text[30U];
|
char text[30U];
|
||||||
::sprintf(text, "t0.txt=\"%.8s/%4.4s\"", my1, my2);
|
::sprintf(text, "t0.txt=\"%.8s/%4.4s\"", my1, my2);
|
||||||
sendCommand(text);
|
sendCommand(text);
|
||||||
|
|
||||||
::sprintf(text, "t1.txt=\"%.8s\"", your);
|
::sprintf(text, "t1.txt=\"%.8s\"", your);
|
||||||
sendCommand(text);
|
sendCommand(text);
|
||||||
|
|
||||||
|
m_mode = MODE_DSTAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNextion::clearDStar()
|
void CNextion::clearDStar()
|
||||||
@@ -113,18 +118,19 @@ void CNextion::clearDStar()
|
|||||||
sendCommand("t1.txt=\"\"");
|
sendCommand("t1.txt=\"\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNextion::setDMR()
|
|
||||||
{
|
|
||||||
sendCommand("page DMR");
|
|
||||||
|
|
||||||
sendCommand("t0.txt=\"1 Listening\"");
|
|
||||||
sendCommand("t2.txt=\"2 Listening\"");
|
|
||||||
}
|
|
||||||
|
|
||||||
void CNextion::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
void CNextion::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
||||||
{
|
{
|
||||||
assert(type != NULL);
|
assert(type != NULL);
|
||||||
|
|
||||||
|
if (m_mode != MODE_DMR) {
|
||||||
|
sendCommand("page DMR");
|
||||||
|
|
||||||
|
if (slotNo == 1U)
|
||||||
|
sendCommand("t2.txt=\"2 Listening\"");
|
||||||
|
else
|
||||||
|
sendCommand("t0.txt=\"1 Listening\"");
|
||||||
|
}
|
||||||
|
|
||||||
if (slotNo == 1U) {
|
if (slotNo == 1U) {
|
||||||
char text[30U];
|
char text[30U];
|
||||||
|
|
||||||
@@ -142,6 +148,8 @@ void CNextion::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, uns
|
|||||||
::sprintf(text, "t3.txt=\"%s%u\"", group ? "TG" : "", dstId);
|
::sprintf(text, "t3.txt=\"%s%u\"", group ? "TG" : "", dstId);
|
||||||
sendCommand(text);
|
sendCommand(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_mode = MODE_DMR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNextion::clearDMR(unsigned int slotNo)
|
void CNextion::clearDMR(unsigned int slotNo)
|
||||||
@@ -155,24 +163,22 @@ void CNextion::clearDMR(unsigned int slotNo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNextion::setFusion()
|
|
||||||
{
|
|
||||||
sendCommand("page YSF");
|
|
||||||
|
|
||||||
sendCommand("t0.txt=\"Listening\"");
|
|
||||||
}
|
|
||||||
|
|
||||||
void CNextion::writeFusion(const char* source, const char* dest)
|
void CNextion::writeFusion(const char* source, const char* dest)
|
||||||
{
|
{
|
||||||
assert(source != NULL);
|
assert(source != NULL);
|
||||||
assert(dest != NULL);
|
assert(dest != NULL);
|
||||||
|
|
||||||
|
if (m_mode != MODE_YSF)
|
||||||
|
sendCommand("page YSF");
|
||||||
|
|
||||||
char text[30U];
|
char text[30U];
|
||||||
::sprintf(text, "t0.txt=\"%.10s\"", source);
|
::sprintf(text, "t0.txt=\"%.10s\"", source);
|
||||||
sendCommand(text);
|
sendCommand(text);
|
||||||
|
|
||||||
::sprintf(text, "t1.txt=\"%.10s\"", dest);
|
::sprintf(text, "t1.txt=\"%.10s\"", dest);
|
||||||
sendCommand(text);
|
sendCommand(text);
|
||||||
|
|
||||||
|
m_mode = MODE_YSF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNextion::clearFusion()
|
void CNextion::clearFusion()
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#define NEXTION_H
|
#define NEXTION_H
|
||||||
|
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
|
#include "Defines.h"
|
||||||
#include "SerialController.h"
|
#include "SerialController.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -37,15 +38,12 @@ public:
|
|||||||
virtual void setError(const char* text);
|
virtual void setError(const char* text);
|
||||||
virtual void setLockout();
|
virtual void setLockout();
|
||||||
|
|
||||||
virtual void setDStar();
|
|
||||||
virtual void writeDStar(const char* my1, const char* my2, const char* your);
|
virtual void writeDStar(const char* my1, const char* my2, const char* your);
|
||||||
virtual void clearDStar();
|
virtual void clearDStar();
|
||||||
|
|
||||||
virtual void setDMR();
|
|
||||||
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type);
|
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type);
|
||||||
virtual void clearDMR(unsigned int slotNo);
|
virtual void clearDMR(unsigned int slotNo);
|
||||||
|
|
||||||
virtual void setFusion();
|
|
||||||
virtual void writeFusion(const char* source, const char* dest);
|
virtual void writeFusion(const char* source, const char* dest);
|
||||||
virtual void clearFusion();
|
virtual void clearFusion();
|
||||||
|
|
||||||
@@ -56,6 +54,7 @@ private:
|
|||||||
unsigned int m_dmrid;
|
unsigned int m_dmrid;
|
||||||
CSerialController m_serial;
|
CSerialController m_serial;
|
||||||
unsigned int m_brightness;
|
unsigned int m_brightness;
|
||||||
|
unsigned char m_mode;
|
||||||
|
|
||||||
void sendCommand(const char* command);
|
void sendCommand(const char* command);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,10 +43,6 @@ void CNullDisplay::setLockout()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNullDisplay::setDStar()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void CNullDisplay::writeDStar(const char* my1, const char* my2, const char* your)
|
void CNullDisplay::writeDStar(const char* my1, const char* my2, const char* your)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -55,10 +51,6 @@ void CNullDisplay::clearDStar()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNullDisplay::setDMR()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void CNullDisplay::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
void CNullDisplay::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -67,10 +59,6 @@ void CNullDisplay::clearDMR(unsigned int slotNo)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNullDisplay::setFusion()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void CNullDisplay::writeFusion(const char* source, const char* dest)
|
void CNullDisplay::writeFusion(const char* source, const char* dest)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,15 +36,12 @@ public:
|
|||||||
virtual void setError(const char* text);
|
virtual void setError(const char* text);
|
||||||
virtual void setLockout();
|
virtual void setLockout();
|
||||||
|
|
||||||
virtual void setDStar();
|
|
||||||
virtual void writeDStar(const char* my1, const char* my2, const char* your);
|
virtual void writeDStar(const char* my1, const char* my2, const char* your);
|
||||||
virtual void clearDStar();
|
virtual void clearDStar();
|
||||||
|
|
||||||
virtual void setDMR();
|
|
||||||
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type);
|
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type);
|
||||||
virtual void clearDMR(unsigned int slotNo);
|
virtual void clearDMR(unsigned int slotNo);
|
||||||
|
|
||||||
virtual void setFusion();
|
|
||||||
virtual void writeFusion(const char* source, const char* dest);
|
virtual void writeFusion(const char* source, const char* dest);
|
||||||
virtual void clearFusion();
|
virtual void clearFusion();
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ CTFTSerial::CTFTSerial(const char* callsign, unsigned int dmrid, const std::stri
|
|||||||
m_callsign(callsign),
|
m_callsign(callsign),
|
||||||
m_dmrid(dmrid),
|
m_dmrid(dmrid),
|
||||||
m_serial(port, SERIAL_9600),
|
m_serial(port, SERIAL_9600),
|
||||||
m_brightness(brightness)
|
m_brightness(brightness),
|
||||||
|
m_mode(MODE_IDLE)
|
||||||
{
|
{
|
||||||
assert(brightness >= 0U && brightness <= 100U);
|
assert(brightness >= 0U && brightness <= 100U);
|
||||||
}
|
}
|
||||||
@@ -96,6 +97,8 @@ void CTFTSerial::setIdle()
|
|||||||
|
|
||||||
gotoPosPixel(45U, 90U);
|
gotoPosPixel(45U, 90U);
|
||||||
displayText("IDLE");
|
displayText("IDLE");
|
||||||
|
|
||||||
|
m_mode = MODE_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::setError(const char* text)
|
void CTFTSerial::setError(const char* text)
|
||||||
@@ -119,6 +122,8 @@ void CTFTSerial::setError(const char* text)
|
|||||||
displayText("ERROR");
|
displayText("ERROR");
|
||||||
|
|
||||||
setForeground(COLOUR_BLACK);
|
setForeground(COLOUR_BLACK);
|
||||||
|
|
||||||
|
m_mode = MODE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::setLockout()
|
void CTFTSerial::setLockout()
|
||||||
@@ -133,20 +138,8 @@ void CTFTSerial::setLockout()
|
|||||||
|
|
||||||
gotoPosPixel(20U, 60U);
|
gotoPosPixel(20U, 60U);
|
||||||
displayText("LOCKOUT");
|
displayText("LOCKOUT");
|
||||||
}
|
|
||||||
|
|
||||||
void CTFTSerial::setDStar()
|
m_mode = MODE_LOCKOUT;
|
||||||
{
|
|
||||||
// Clear the screen
|
|
||||||
clearScreen();
|
|
||||||
|
|
||||||
setFontSize(FONT_MEDIUM);
|
|
||||||
|
|
||||||
// Draw D-Star insignia
|
|
||||||
displayBitmap(0U, 0U, "DStar_sm.bmp");
|
|
||||||
|
|
||||||
gotoPosPixel(30U, 80U);
|
|
||||||
displayText("Listening");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::writeDStar(const char* my1, const char* my2, const char* your)
|
void CTFTSerial::writeDStar(const char* my1, const char* my2, const char* your)
|
||||||
@@ -155,6 +148,16 @@ void CTFTSerial::writeDStar(const char* my1, const char* my2, const char* your)
|
|||||||
assert(my2 != NULL);
|
assert(my2 != NULL);
|
||||||
assert(your != NULL);
|
assert(your != NULL);
|
||||||
|
|
||||||
|
if (m_mode != MODE_DSTAR) {
|
||||||
|
// Clear the screen
|
||||||
|
clearScreen();
|
||||||
|
|
||||||
|
setFontSize(FONT_MEDIUM);
|
||||||
|
|
||||||
|
// Draw D-Star insignia
|
||||||
|
displayBitmap(0U, 0U, "DStar_sm.bmp");
|
||||||
|
}
|
||||||
|
|
||||||
char text[30U];
|
char text[30U];
|
||||||
::sprintf(text, "%.8s/%4.4s", my1, my2);
|
::sprintf(text, "%.8s/%4.4s", my1, my2);
|
||||||
|
|
||||||
@@ -165,6 +168,8 @@ void CTFTSerial::writeDStar(const char* my1, const char* my2, const char* your)
|
|||||||
|
|
||||||
gotoPosPixel(5U, 100U);
|
gotoPosPixel(5U, 100U);
|
||||||
displayText(text);
|
displayText(text);
|
||||||
|
|
||||||
|
m_mode = MODE_DSTAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::clearDStar()
|
void CTFTSerial::clearDStar()
|
||||||
@@ -176,8 +181,11 @@ void CTFTSerial::clearDStar()
|
|||||||
displayText(" ");
|
displayText(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::setDMR()
|
void CTFTSerial::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
||||||
{
|
{
|
||||||
|
assert(type != NULL);
|
||||||
|
|
||||||
|
if (m_mode != MODE_DMR) {
|
||||||
// Clear the screen
|
// Clear the screen
|
||||||
clearScreen();
|
clearScreen();
|
||||||
|
|
||||||
@@ -186,16 +194,14 @@ void CTFTSerial::setDMR()
|
|||||||
// Draw DMR insignia
|
// Draw DMR insignia
|
||||||
displayBitmap(0U, 0U, "DMR_sm.bmp");
|
displayBitmap(0U, 0U, "DMR_sm.bmp");
|
||||||
|
|
||||||
gotoPosPixel(5U, 55U);
|
if (slotNo == 1U) {
|
||||||
displayText("1 Listening");
|
|
||||||
|
|
||||||
gotoPosPixel(5U, 90U);
|
gotoPosPixel(5U, 90U);
|
||||||
displayText("2 Listening");
|
displayText("2 Listening");
|
||||||
|
} else {
|
||||||
|
gotoPosPixel(5U, 55U);
|
||||||
|
displayText("1 Listening");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
|
||||||
{
|
|
||||||
assert(type != NULL);
|
|
||||||
|
|
||||||
if (slotNo == 1U) {
|
if (slotNo == 1U) {
|
||||||
char text[30U];
|
char text[30U];
|
||||||
@@ -218,6 +224,8 @@ void CTFTSerial::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, u
|
|||||||
gotoPosPixel(65U, 107U);
|
gotoPosPixel(65U, 107U);
|
||||||
displayText(text);
|
displayText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_mode = MODE_DMR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::clearDMR(unsigned int slotNo)
|
void CTFTSerial::clearDMR(unsigned int slotNo)
|
||||||
@@ -237,8 +245,12 @@ void CTFTSerial::clearDMR(unsigned int slotNo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::setFusion()
|
void CTFTSerial::writeFusion(const char* source, const char* dest)
|
||||||
{
|
{
|
||||||
|
assert(source != NULL);
|
||||||
|
assert(dest != NULL);
|
||||||
|
|
||||||
|
if (m_mode != MODE_YSF) {
|
||||||
// Clear the screen
|
// Clear the screen
|
||||||
clearScreen();
|
clearScreen();
|
||||||
|
|
||||||
@@ -246,16 +258,8 @@ void CTFTSerial::setFusion()
|
|||||||
|
|
||||||
// Draw the System Fusion insignia
|
// Draw the System Fusion insignia
|
||||||
displayBitmap(0U, 0U, "YSF_sm.bmp");
|
displayBitmap(0U, 0U, "YSF_sm.bmp");
|
||||||
|
|
||||||
gotoPosPixel(30U, 80U);
|
|
||||||
displayText("Listening");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::writeFusion(const char* source, const char* dest)
|
|
||||||
{
|
|
||||||
assert(source != NULL);
|
|
||||||
assert(dest != NULL);
|
|
||||||
|
|
||||||
char text[30U];
|
char text[30U];
|
||||||
::sprintf(text, "%.10s", source);
|
::sprintf(text, "%.10s", source);
|
||||||
|
|
||||||
@@ -266,6 +270,8 @@ void CTFTSerial::writeFusion(const char* source, const char* dest)
|
|||||||
|
|
||||||
gotoPosPixel(5U, 100U);
|
gotoPosPixel(5U, 100U);
|
||||||
displayText(text);
|
displayText(text);
|
||||||
|
|
||||||
|
m_mode = MODE_YSF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTFTSerial::clearFusion()
|
void CTFTSerial::clearFusion()
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#define TFTSERIAL_H
|
#define TFTSERIAL_H
|
||||||
|
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
|
#include "Defines.h"
|
||||||
#include "SerialController.h"
|
#include "SerialController.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -37,15 +38,12 @@ public:
|
|||||||
virtual void setError(const char* text);
|
virtual void setError(const char* text);
|
||||||
virtual void setLockout();
|
virtual void setLockout();
|
||||||
|
|
||||||
virtual void setDStar();
|
|
||||||
virtual void writeDStar(const char* my1, const char* my2, const char* your);
|
virtual void writeDStar(const char* my1, const char* my2, const char* your);
|
||||||
virtual void clearDStar();
|
virtual void clearDStar();
|
||||||
|
|
||||||
virtual void setDMR();
|
|
||||||
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type);
|
virtual void writeDMR(unsigned int slotNo, unsigned int srdId, bool group, unsigned int dstId, const char* type);
|
||||||
virtual void clearDMR(unsigned int slotNo);
|
virtual void clearDMR(unsigned int slotNo);
|
||||||
|
|
||||||
virtual void setFusion();
|
|
||||||
virtual void writeFusion(const char* source, const char* dest);
|
virtual void writeFusion(const char* source, const char* dest);
|
||||||
virtual void clearFusion();
|
virtual void clearFusion();
|
||||||
|
|
||||||
@@ -56,6 +54,7 @@ private:
|
|||||||
unsigned int m_dmrid;
|
unsigned int m_dmrid;
|
||||||
CSerialController m_serial;
|
CSerialController m_serial;
|
||||||
unsigned int m_brightness;
|
unsigned int m_brightness;
|
||||||
|
unsigned char m_mode;
|
||||||
|
|
||||||
void clearScreen();
|
void clearScreen();
|
||||||
void setBackground(unsigned char colour);
|
void setBackground(unsigned char colour);
|
||||||
|
|||||||
Reference in New Issue
Block a user