Reset the mode's state machines when going to the disabled state.

This commit is contained in:
Jonathan Naylor
2019-01-19 17:15:24 +00:00
parent b16aaa653c
commit ae9e6ea6ab
15 changed files with 286 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 Jonathan Naylor, G4KLX
* Copyright (C) 2018,2019 Jonathan Naylor, G4KLX
*
* 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
@@ -69,6 +69,7 @@ m_buffer(),
m_ric(0U),
m_text(),
m_state(PS_NONE),
m_enabled(true),
m_fp(NULL)
{
assert(display != NULL);
@@ -414,3 +415,15 @@ void CPOCSAGControl::closeFile()
m_fp = NULL;
}
}
void CPOCSAGControl::enable(bool enabled)
{
if (!enabled && m_enabled) {
m_queue.clear();
m_output.clear();
m_state = PS_NONE;
}
m_enabled = enabled;
}