2016-01-14 19:45:04 +01:00
|
|
|
/*
|
2021-02-17 22:36:47 +01:00
|
|
|
* Copyright (C) 2016,2017,2018,2020,2021 by Jonathan Naylor G4KLX
|
2016-01-14 19:45:04 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if !defined(DISPLAY_H)
|
|
|
|
#define DISPLAY_H
|
|
|
|
|
2016-05-09 19:14:27 +02:00
|
|
|
#include "Timer.h"
|
2020-03-08 00:06:27 +01:00
|
|
|
#include "UserDBentry.h"
|
2020-12-15 17:21:07 +01:00
|
|
|
#include "Modem.h"
|
2016-05-09 19:14:27 +02:00
|
|
|
|
2016-01-14 19:45:04 +01:00
|
|
|
#include <string>
|
|
|
|
|
2018-06-11 22:30:49 +02:00
|
|
|
#include <cstdint>
|
|
|
|
|
2018-07-31 05:36:37 +02:00
|
|
|
class CConf;
|
2021-02-17 22:36:47 +01:00
|
|
|
class CModem;
|
2018-07-31 05:36:37 +02:00
|
|
|
|
2016-05-09 19:14:27 +02:00
|
|
|
class CDisplay
|
2016-01-14 19:45:04 +01:00
|
|
|
{
|
|
|
|
public:
|
2016-05-09 19:14:27 +02:00
|
|
|
CDisplay();
|
|
|
|
virtual ~CDisplay() = 0;
|
|
|
|
|
|
|
|
virtual bool open() = 0;
|
|
|
|
|
|
|
|
void setIdle();
|
|
|
|
void setLockout();
|
|
|
|
void setError(const char* text);
|
2018-08-15 18:17:42 +02:00
|
|
|
void setQuit();
|
2020-04-11 21:42:05 +02:00
|
|
|
void setFM();
|
2016-05-09 19:14:27 +02:00
|
|
|
|
|
|
|
void writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type);
|
2020-03-08 00:06:27 +01:00
|
|
|
void writeDMR(unsigned int slotNo, const class CUserDBentry& src, bool group, const std::string& dst, const char* type);
|
2017-01-05 20:44:52 +01:00
|
|
|
void writeDMRRSSI(unsigned int slotNo, unsigned char rssi);
|
2017-02-12 19:37:00 +01:00
|
|
|
void writeDMRBER(unsigned int slotNo, float ber);
|
2017-11-13 21:48:47 +01:00
|
|
|
void writeDMRTA(unsigned int slotNo, unsigned char* talkerAlias, const char* type);
|
2016-05-09 19:14:27 +02:00
|
|
|
void clearDMR(unsigned int slotNo);
|
2016-01-14 19:45:04 +01:00
|
|
|
|
2016-09-15 11:50:35 +02:00
|
|
|
void writeCW();
|
|
|
|
|
2016-05-09 19:14:27 +02:00
|
|
|
virtual void close() = 0;
|
2016-01-14 19:45:04 +01:00
|
|
|
|
2016-05-09 19:14:27 +02:00
|
|
|
void clock(unsigned int ms);
|
2016-03-03 19:01:01 +01:00
|
|
|
|
2021-02-17 22:36:47 +01:00
|
|
|
static CDisplay* createDisplay(const CConf& conf, CModem* modem);
|
2018-07-31 05:36:37 +02:00
|
|
|
|
2016-05-09 19:14:27 +02:00
|
|
|
protected:
|
|
|
|
virtual void setIdleInt() = 0;
|
|
|
|
virtual void setLockoutInt() = 0;
|
|
|
|
virtual void setErrorInt(const char* text) = 0;
|
2018-08-15 18:17:42 +02:00
|
|
|
virtual void setQuitInt() = 0;
|
2016-01-14 19:45:04 +01:00
|
|
|
|
2016-05-09 19:14:27 +02:00
|
|
|
virtual void writeDMRInt(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type) = 0;
|
2020-08-09 16:09:08 +02:00
|
|
|
virtual int writeDMRIntEx(unsigned int slotNo, const class CUserDBentry& src, bool group, const std::string& dst, const char* type);
|
2017-01-05 20:44:52 +01:00
|
|
|
virtual void writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi);
|
2017-11-13 21:48:47 +01:00
|
|
|
virtual void writeDMRTAInt(unsigned int slotNo, unsigned char* talkerAlias, const char* type);
|
2017-02-12 19:37:00 +01:00
|
|
|
virtual void writeDMRBERInt(unsigned int slotNo, float ber);
|
2016-05-09 19:14:27 +02:00
|
|
|
virtual void clearDMRInt(unsigned int slotNo) = 0;
|
2016-01-14 19:45:04 +01:00
|
|
|
|
2016-09-15 11:50:35 +02:00
|
|
|
virtual void writeCWInt() = 0;
|
2016-09-15 15:17:51 +02:00
|
|
|
virtual void clearCWInt() = 0;
|
2016-09-15 11:50:35 +02:00
|
|
|
|
2016-05-21 13:28:09 +02:00
|
|
|
virtual void clockInt(unsigned int ms);
|
|
|
|
|
2016-01-14 19:45:04 +01:00
|
|
|
private:
|
2016-05-09 19:14:27 +02:00
|
|
|
CTimer m_timer1;
|
|
|
|
CTimer m_timer2;
|
|
|
|
unsigned char m_mode1;
|
|
|
|
unsigned char m_mode2;
|
2016-01-14 19:45:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|