Add the callsign and DMR Id to the TFT Serial.

This commit is contained in:
Jonathan Naylor 2016-04-11 10:55:20 +01:00
parent 409c1e5154
commit ad1b30341d
4 changed files with 19 additions and 9 deletions

View file

@ -566,7 +566,7 @@ void CMMDVMHost::readParams()
void CMMDVMHost::createDisplay()
{
std::string type = m_conf.getDisplay();
std::string type = m_conf.getDisplay();
std::string callsign = m_conf.getCallsign();
unsigned int dmrid = m_conf.getDMRId();
@ -580,7 +580,7 @@ void CMMDVMHost::createDisplay()
LogInfo(" Port: %s", port.c_str());
LogInfo(" Brightness: %u", brightness);
m_display = new CTFTSerial(port, brightness);
m_display = new CTFTSerial(callsign.c_str(), dmrid, port, brightness);
} else if (type == "Nextion") {
std::string port = m_conf.getNextionPort();
unsigned int brightness = m_conf.getNextionBrightness();

View file

@ -52,8 +52,8 @@ public:
virtual void close();
private:
const char* m_callsign;
unsigned int m_dmrid;
const char* m_callsign;
unsigned int m_dmrid;
CSerialController m_serial;
unsigned int m_brightness;

View file

@ -44,7 +44,9 @@ const unsigned char FONT_LARGE = 3U;
// x = 0 to 159, y = 0 to 127 - Landscape
// x = 0 to 127, y = 0 to 159 - Portrait
CTFTSerial::CTFTSerial(const std::string& port, unsigned int brightness) :
CTFTSerial::CTFTSerial(const char* callsign, unsigned int dmrid, const std::string& port, unsigned int brightness) :
m_callsign(callsign),
m_dmrid(dmrid),
m_serial(port, SERIAL_9600),
m_brightness(brightness)
{
@ -86,7 +88,13 @@ void CTFTSerial::setIdle()
// Draw MMDVM logo
displayBitmap(0U, 0U, "MMDVM_sm.bmp");
gotoPosPixel(45U, 60U);
char text[30];
::sprintf(text, "%-6s / %u", m_callsign, m_dmrid);
gotoPosPixel(18U, 55U);
displayText(text);
gotoPosPixel(45U, 90U);
displayText("IDLE");
}

View file

@ -27,7 +27,7 @@
class CTFTSerial : public IDisplay
{
public:
CTFTSerial(const std::string& port, unsigned int brightness);
CTFTSerial(const char* callsign, unsigned int dmrid, const std::string& port, unsigned int brightness);
virtual ~CTFTSerial();
virtual bool open();
@ -52,8 +52,10 @@ public:
virtual void close();
private:
CSerialController m_serial;
unsigned int m_brightness;
const char* m_callsign;
unsigned int m_dmrid;
CSerialController m_serial;
unsigned int m_brightness;
void clearScreen();
void setBackground(unsigned char colour);