fix(simulator): fixed LCD flush sync with QT simulator (#2030)
This commit is contained in:
@@ -133,6 +133,8 @@ void SimulatedUIWidget::onLcdChange(bool backlightEnable)
|
||||
return;
|
||||
|
||||
m_lcd->onLcdChanged(backlightEnable);
|
||||
m_simulator->lcdFlushed();
|
||||
|
||||
setLightOn(backlightEnable);
|
||||
}
|
||||
|
||||
|
||||
@@ -145,6 +145,7 @@ class SimulatorInterface : public QObject
|
||||
virtual void setInputValue(int type, uint8_t index, int16_t value) = 0;
|
||||
virtual void rotaryEncoderEvent(int steps) = 0;
|
||||
virtual void touchEvent(int type, int x, int y) = 0;
|
||||
virtual void lcdFlushed() = 0;
|
||||
virtual void setTrainerTimeout(uint16_t ms) = 0;
|
||||
virtual void sendTelemetry(const QByteArray data) = 0;
|
||||
virtual void setLuaStateReloadPermanentScripts() = 0;
|
||||
|
||||
@@ -96,7 +96,6 @@ FXIMPLEMENT(OpenTxSim, FXMainWindow, OpenTxSimMap, ARRAYNUMBER(OpenTxSimMap))
|
||||
OpenTxSim::OpenTxSim(FXApp* a):
|
||||
FXMainWindow(a, "OpenTX Simu", nullptr, nullptr, DECOR_ALL, 20, 90, 0, 0)
|
||||
{
|
||||
lcdInit();
|
||||
bmp = new FXPPMImage(getApp(), nullptr, IMAGE_OWNED|IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP, W2, H2);
|
||||
|
||||
#if defined(SIMU_AUDIO)
|
||||
|
||||
@@ -132,8 +132,7 @@ void OpenTxSimulator::init()
|
||||
|
||||
void OpenTxSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
if (isRunning())
|
||||
return;
|
||||
if (isRunning()) return;
|
||||
ETXS_DBG << "file:" << filename << "tests:" << tests;
|
||||
|
||||
QMutexLocker lckr(&m_mtxSimuMain);
|
||||
@@ -375,6 +374,11 @@ void OpenTxSimulator::touchEvent(int type, int x, int y)
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::lcdFlushed()
|
||||
{
|
||||
::lcdFlushed();
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setTrainerTimeout(uint16_t ms)
|
||||
{
|
||||
ppmInputValidityTimer = ms;
|
||||
|
||||
@@ -76,6 +76,7 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface
|
||||
virtual void setInputValue(int type, uint8_t index, int16_t value);
|
||||
virtual void rotaryEncoderEvent(int steps);
|
||||
virtual void touchEvent(int type, int x, int y);
|
||||
virtual void lcdFlushed();
|
||||
virtual void setTrainerTimeout(uint16_t ms);
|
||||
virtual void sendTelemetry(const QByteArray data);
|
||||
virtual void setLuaStateReloadPermanentScripts();
|
||||
|
||||
@@ -207,6 +207,9 @@ void simuStart(bool tests, const char * sdPath, const char * settingsPath)
|
||||
try {
|
||||
#endif
|
||||
|
||||
// Init LCD call backs
|
||||
lcdInit();
|
||||
|
||||
#if !defined(SIMU_BOOTLOADER)
|
||||
simuMain();
|
||||
#else
|
||||
|
||||
@@ -947,6 +947,7 @@ void lcdSetRefVolt(unsigned char val);
|
||||
#ifdef __cplusplus
|
||||
void lcdSetContrast(bool useDefault = false);
|
||||
#endif
|
||||
void lcdFlushed();
|
||||
|
||||
// Top LCD driver
|
||||
#if defined(TOPLCD_GPIO)
|
||||
|
||||
Reference in New Issue
Block a user