From fa4e3ddbdfaa6b96865555de0307e6cec6df1939 Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 26 May 2023 14:12:02 +0200 Subject: [PATCH] wave11 correction crlf --- src/userinterface.cpp | 94 +------------------------------------------ src/userinterface.h | 17 +------- 2 files changed, 3 insertions(+), 108 deletions(-) diff --git a/src/userinterface.cpp b/src/userinterface.cpp index 3289245..0bcd931 100644 --- a/src/userinterface.cpp +++ b/src/userinterface.cpp @@ -27,13 +27,8 @@ LOGMODULE ("ui"); -CUserInterface::CUserInterface ( - CMiniDexed *pMiniDexed, - CGPIOManager *pGPIOManager, - CI2CMaster *pI2CMaster, - CConfig *pConfig -) : - m_pMiniDexed (pMiniDexed), +CUserInterface::CUserInterface (CMiniDexed *pMiniDexed, CGPIOManager *pGPIOManager, CI2CMaster *pI2CMaster, CConfig *pConfig) +: m_pMiniDexed (pMiniDexed), m_pGPIOManager (pGPIOManager), m_pI2CMaster (pI2CMaster), m_pConfig (pConfig), @@ -236,91 +231,6 @@ void CUserInterface::DisplayWrite (const char *pMenu, const char *pParam, const LCDWrite (Msg); } -#if defined(DEBUG) -#include -#include -#include -#include - -void CUserInterface::clear() -{ - static size_t nbChars = this->m_pConfig->GetLCDColumns() * this->m_pConfig->GetLCDRows(); - - if (this->m_pLCDBuffered) - { - std::string txt("\x1B[H\E[?25l"); - txt.append(nbChars, ' '); - txt.append("\x1B[K"); - - this->m_pLCDBuffered->Write(txt.c_str(), txt.length()); - this->m_pLCDBuffered->Update (); - } -} - -void CUserInterface::log(const char* txt, bool clear) -{ - if (this->m_pLCDBuffered) - { - if(clear) - { - this->clear(); - } - - this->m_pLCDBuffered->Write(txt, strlen(txt)); - this->m_pLCDBuffered->Update (); - } -} - -void CUserInterface::log(float32_t v, bool clear) -{ - if (this->m_pLCDBuffered) - { - if(clear) - { - this->clear(); - } - - std::ostringstream ss; - ss << std::fixed << std::setprecision(2) << v; - std::string txt = ss.str(); - - this->m_pLCDBuffered->Write(txt.c_str(), txt.length()); - this->m_pLCDBuffered->Update (); - } -} - -void CUserInterface::log(unsigned v, bool clear) -{ - if (this->m_pLCDBuffered) - { - if(clear) - { - this->clear(); - } - - std::string txt = std::to_string(v); - this->m_pLCDBuffered->Write(txt.c_str(), txt.length()); - this->m_pLCDBuffered->Update (); - } -} - -void CUserInterface::log(int v, bool clear) -{ - if (this->m_pLCDBuffered) - { - if(clear) - { - this->clear(); - } - - std::string txt = std::to_string(v); - this->m_pLCDBuffered->Write(txt.c_str(), txt.length()); - this->m_pLCDBuffered->Update (); - } -} - -#endif // DEBUG - void CUserInterface::LCDWrite (const char *pString) { if (m_pLCDBuffered) diff --git a/src/userinterface.h b/src/userinterface.h index 14457ef..5de2846 100644 --- a/src/userinterface.h +++ b/src/userinterface.h @@ -23,7 +23,6 @@ #include "config.h" #include "uimenu.h" #include "uibuttons.h" -#include #include #include #include @@ -36,11 +35,7 @@ class CMiniDexed; class CUserInterface { public: - CUserInterface ( - CMiniDexed *pMiniDexed, - CGPIOManager *pGPIOManager, - CI2CMaster *pI2CMaster, - CConfig *pConfig); + CUserInterface (CMiniDexed *pMiniDexed, CGPIOManager *pGPIOManager, CI2CMaster *pI2CMaster, CConfig *pConfig); ~CUserInterface (void); bool Initialize (void); @@ -60,19 +55,9 @@ public: // To be called from the MIDI device on reception of a MIDI CC message void UIMIDICmdHandler (unsigned nMidiCh, unsigned nMidiCmd, unsigned nMidiData1, unsigned nMidiData2); -#if defined(DEBUG) -public: - void clear(); - void log(const char* txt, bool clear = true); - void log(float32_t v, bool clear = true); - void log(unsigned v, bool clear = true); - void log(int v, bool clear = true); -#endif - private: void LCDWrite (const char *pString); // Print to optional HD44780 display -private: void EncoderEventHandler (CKY040::TEvent Event); static void EncoderEventStub (CKY040::TEvent Event, void *pParam); void UIButtonsEventHandler (CUIButton::BtnEvent Event);