made activation state more clear
This commit is contained in:
@@ -16,7 +16,7 @@ namespace flippR_driver
|
|||||||
namespace input
|
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)
|
input_gpio_interface(std::move(input_gpio_interface)), events(std::move(events)), is_running(true)
|
||||||
{
|
{
|
||||||
this->detect_thread = std::thread(&Detector::detect, this);
|
this->detect_thread = std::thread(&Detector::detect, this);
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ class Detector : public IDetector
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Detector(std::unique_ptr<IInputGPIOInterface> input_gpio_interface, std::vector<std::shared_ptr<DistributingEvent>>& events);
|
Detector(std::unique_ptr<IInputGPIOInterface> input_gpio_interface, std::vector<std::shared_ptr<DistributingEvent>> events);
|
||||||
~Detector();
|
~Detector() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void detect();
|
void detect();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ void flippR_driver::input::DistributingEvent::active()
|
|||||||
{
|
{
|
||||||
if(activation_state != ACTIVATED)
|
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();
|
last_activation = std::chrono::high_resolution_clock::now();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class DisplayController : public IDisplayController
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit DisplayController(std::vector<std::shared_ptr<items::IDisplay>> displays, std::shared_ptr<IOutputGPIOInterface> output_gpio_interface);
|
explicit DisplayController(std::vector<std::shared_ptr<items::IDisplay>> displays, std::shared_ptr<IOutputGPIOInterface> output_gpio_interface);
|
||||||
~DisplayController();
|
~DisplayController() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void cycle_displays();
|
void cycle_displays();
|
||||||
|
|||||||
Reference in New Issue
Block a user