Merge pull request #145 from phl0/CW2display
Display CW activity on displays
This commit is contained in:
commit
cb8cc99efd
12 changed files with 82 additions and 1 deletions
|
@ -23,6 +23,7 @@ const unsigned char MODE_IDLE = 0U;
|
||||||
const unsigned char MODE_DSTAR = 1U;
|
const unsigned char MODE_DSTAR = 1U;
|
||||||
const unsigned char MODE_DMR = 2U;
|
const unsigned char MODE_DMR = 2U;
|
||||||
const unsigned char MODE_YSF = 3U;
|
const unsigned char MODE_YSF = 3U;
|
||||||
|
const unsigned char MODE_CW = 4U;
|
||||||
const unsigned char MODE_LOCKOUT = 99U;
|
const unsigned char MODE_LOCKOUT = 99U;
|
||||||
const unsigned char MODE_ERROR = 100U;
|
const unsigned char MODE_ERROR = 100U;
|
||||||
|
|
||||||
|
|
13
Display.cpp
13
Display.cpp
|
@ -155,6 +155,14 @@ void CDisplay::clearFusion()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDisplay::writeCW()
|
||||||
|
{
|
||||||
|
m_timer1.start();
|
||||||
|
m_mode1 = MODE_CW;
|
||||||
|
|
||||||
|
writeCWInt();
|
||||||
|
}
|
||||||
|
|
||||||
void CDisplay::clock(unsigned int ms)
|
void CDisplay::clock(unsigned int ms)
|
||||||
{
|
{
|
||||||
m_timer1.clock(ms);
|
m_timer1.clock(ms);
|
||||||
|
@ -175,6 +183,11 @@ void CDisplay::clock(unsigned int ms)
|
||||||
m_mode1 = MODE_IDLE;
|
m_mode1 = MODE_IDLE;
|
||||||
m_timer1.stop();
|
m_timer1.stop();
|
||||||
break;
|
break;
|
||||||
|
case MODE_CW:
|
||||||
|
clearCWInt();
|
||||||
|
m_mode1 = MODE_IDLE;
|
||||||
|
m_timer1.stop();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,9 @@ public:
|
||||||
void writeFusion(const char* source, const char* dest, const char* type, const char* origin);
|
void writeFusion(const char* source, const char* dest, const char* type, const char* origin);
|
||||||
void clearFusion();
|
void clearFusion();
|
||||||
|
|
||||||
|
void writeCW();
|
||||||
|
void clearCW();
|
||||||
|
|
||||||
virtual void close() = 0;
|
virtual void close() = 0;
|
||||||
|
|
||||||
void clock(unsigned int ms);
|
void clock(unsigned int ms);
|
||||||
|
@ -62,6 +65,9 @@ protected:
|
||||||
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin) = 0;
|
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin) = 0;
|
||||||
virtual void clearFusionInt() = 0;
|
virtual void clearFusionInt() = 0;
|
||||||
|
|
||||||
|
virtual void writeCWInt() = 0;
|
||||||
|
virtual void clearCWInt() = 0;
|
||||||
|
|
||||||
virtual void clockInt(unsigned int ms);
|
virtual void clockInt(unsigned int ms);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
12
HD44780.cpp
12
HD44780.cpp
|
@ -730,6 +730,18 @@ void CHD44780::clearFusionInt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHD44780::writeCWInt()
|
||||||
|
{
|
||||||
|
::lcdPosition(m_fd, m_cols - 5, m_rows - 1);
|
||||||
|
::lcdPuts(m_fd, "CW TX");
|
||||||
|
}
|
||||||
|
|
||||||
|
void CHD44780::clearCWInt()
|
||||||
|
{
|
||||||
|
::lcdPosition(m_fd, m_cols - 5, m_rows - 1);
|
||||||
|
::lcdPuts(m_fd, " Idle");
|
||||||
|
}
|
||||||
|
|
||||||
void CHD44780::clockInt(unsigned int ms)
|
void CHD44780::clockInt(unsigned int ms)
|
||||||
{
|
{
|
||||||
m_clockDisplayTimer.clock(ms);
|
m_clockDisplayTimer.clock(ms);
|
||||||
|
|
|
@ -110,6 +110,9 @@ protected:
|
||||||
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin);
|
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin);
|
||||||
virtual void clearFusionInt();
|
virtual void clearFusionInt();
|
||||||
|
|
||||||
|
virtual void writeCWInt();
|
||||||
|
virtual void clearCWInt();
|
||||||
|
|
||||||
virtual void clockInt(unsigned int ms);
|
virtual void clockInt(unsigned int ms);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -628,6 +628,7 @@ int CMMDVMHost::run()
|
||||||
if (m_cwIdTimer.isRunning() && m_cwIdTimer.hasExpired()) {
|
if (m_cwIdTimer.isRunning() && m_cwIdTimer.hasExpired()) {
|
||||||
if (m_mode == MODE_IDLE && !m_modem->hasTX()){
|
if (m_mode == MODE_IDLE && !m_modem->hasTX()){
|
||||||
LogDebug("sending CW ID");
|
LogDebug("sending CW ID");
|
||||||
|
m_display->writeCW();
|
||||||
m_modem->sendCWId(m_callsign);
|
m_modem->sendCWId(m_callsign);
|
||||||
|
|
||||||
m_cwIdTimer.start(); //reset only after sending ID, timer-overflow after 49 days doesnt matter
|
m_cwIdTimer.start(); //reset only after sending ID, timer-overflow after 49 days doesnt matter
|
||||||
|
|
16
Nextion.cpp
16
Nextion.cpp
|
@ -233,11 +233,25 @@ void CNextion::clearFusionInt()
|
||||||
sendCommand("t2.txt=\"\"");
|
sendCommand("t2.txt=\"\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CNextion::writeCWInt()
|
||||||
|
{
|
||||||
|
sendCommand("t1.txt=\"Sending CW Ident\"");
|
||||||
|
|
||||||
|
m_clockDisplayTimer.start();
|
||||||
|
|
||||||
|
m_mode = MODE_CW;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CNextion::clearCWInt()
|
||||||
|
{
|
||||||
|
sendCommand("t1.txt=\"MMDVM IDLE\"");
|
||||||
|
}
|
||||||
|
|
||||||
void CNextion::clockInt(unsigned int ms)
|
void CNextion::clockInt(unsigned int ms)
|
||||||
{
|
{
|
||||||
// Update the clock display in IDLE mode every 400ms
|
// Update the clock display in IDLE mode every 400ms
|
||||||
m_clockDisplayTimer.clock(ms);
|
m_clockDisplayTimer.clock(ms);
|
||||||
if (m_displayClock && m_mode == MODE_IDLE && m_clockDisplayTimer.isRunning() && m_clockDisplayTimer.hasExpired()) {
|
if (m_displayClock && (m_mode == MODE_IDLE || m_mode == MODE_CW) && m_clockDisplayTimer.isRunning() && m_clockDisplayTimer.hasExpired()) {
|
||||||
time_t currentTime;
|
time_t currentTime;
|
||||||
struct tm *Time;
|
struct tm *Time;
|
||||||
::time(¤tTime); // Get the current time
|
::time(¤tTime); // Get the current time
|
||||||
|
|
|
@ -50,6 +50,9 @@ protected:
|
||||||
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin);
|
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin);
|
||||||
virtual void clearFusionInt();
|
virtual void clearFusionInt();
|
||||||
|
|
||||||
|
virtual void writeCWInt();
|
||||||
|
virtual void clearCWInt();
|
||||||
|
|
||||||
virtual void clockInt(unsigned int ms);
|
virtual void clockInt(unsigned int ms);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -68,6 +68,14 @@ void CNullDisplay::clearFusionInt()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CNullDisplay::writeCWInt()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CNullDisplay::clearCWInt()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void CNullDisplay::close()
|
void CNullDisplay::close()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,9 @@ protected:
|
||||||
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin);
|
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin);
|
||||||
virtual void clearFusionInt();
|
virtual void clearFusionInt();
|
||||||
|
|
||||||
|
virtual void writeCWInt();
|
||||||
|
virtual void clearCWInt();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -311,6 +311,20 @@ void CTFTSerial::clearFusionInt()
|
||||||
displayText(" ");
|
displayText(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CTFTSerial::writeCWInt()
|
||||||
|
{
|
||||||
|
gotoPosPixel(45U, 90U);
|
||||||
|
displayText("CW TX");
|
||||||
|
|
||||||
|
m_mode = MODE_CW;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CTFTSerial::clearCWInt()
|
||||||
|
{
|
||||||
|
gotoPosPixel(45U, 90U);
|
||||||
|
displayText("IDLE");
|
||||||
|
}
|
||||||
|
|
||||||
void CTFTSerial::close()
|
void CTFTSerial::close()
|
||||||
{
|
{
|
||||||
m_serial.close();
|
m_serial.close();
|
||||||
|
|
|
@ -49,6 +49,9 @@ protected:
|
||||||
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin);
|
virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin);
|
||||||
virtual void clearFusionInt();
|
virtual void clearFusionInt();
|
||||||
|
|
||||||
|
virtual void writeCWInt();
|
||||||
|
virtual void clearCWInt();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_callsign;
|
std::string m_callsign;
|
||||||
unsigned int m_dmrid;
|
unsigned int m_dmrid;
|
||||||
|
|
Loading…
Reference in a new issue