made activation state more clear

This commit is contained in:
Jonas Zeunert
2018-12-07 11:44:07 +01:00
parent 0f0f404e19
commit 8fd5588d02
4 changed files with 5 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ namespace flippR_driver
namespace input
{
Detector::Detector(std::unique_ptr<IInputGPIOInterface> input_gpio_interface, std::vector<std::shared_ptr<DistributingEvent>>& events) :
Detector::Detector(std::unique_ptr<IInputGPIOInterface> input_gpio_interface, std::vector<std::shared_ptr<DistributingEvent>> events) :
input_gpio_interface(std::move(input_gpio_interface)), events(std::move(events)), is_running(true)
{
this->detect_thread = std::thread(&Detector::detect, this);

View File

@@ -34,8 +34,8 @@ class Detector : public IDetector
{
public:
Detector(std::unique_ptr<IInputGPIOInterface> input_gpio_interface, std::vector<std::shared_ptr<DistributingEvent>>& events);
~Detector();
Detector(std::unique_ptr<IInputGPIOInterface> input_gpio_interface, std::vector<std::shared_ptr<DistributingEvent>> events);
~Detector() override;
private:
void detect();

View File

@@ -23,7 +23,7 @@ void flippR_driver::input::DistributingEvent::active()
{
if(activation_state != ACTIVATED)
{
activation_state = static_cast<ActivationState>(static_cast<int>(activation_state) + 1);
activation_state = activation_state == NOT_ACTIVATED ? FIRST_ACTIVATED : ACTIVATED;
}
last_activation = std::chrono::high_resolution_clock::now();

View File

@@ -25,7 +25,7 @@ class DisplayController : public IDisplayController
{
public:
explicit DisplayController(std::vector<std::shared_ptr<items::IDisplay>> displays, std::shared_ptr<IOutputGPIOInterface> output_gpio_interface);
~DisplayController();
~DisplayController() override;
private:
void cycle_displays();