nearly compiling
This commit is contained in:
@@ -17,7 +17,7 @@ namespace flippR_driver
|
|||||||
namespace input
|
namespace input
|
||||||
{
|
{
|
||||||
|
|
||||||
Detector::Detector(std::unique_ptr<utility::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(events), is_running(true)
|
input_gpio_interface(std::move(input_gpio_interface)), events(events), is_running(true)
|
||||||
{
|
{
|
||||||
this->detect_thread = std::thread(&Detector::detect, this);
|
this->detect_thread = std::thread(&Detector::detect, this);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class Detector : public IDetector
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Detector(std::unique_ptr<utility::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();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -42,7 +42,7 @@ private:
|
|||||||
void check_inputs();
|
void check_inputs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<utility::IInputGPIOInterface> input_gpio_interface;
|
std::unique_ptr<IInputGPIOInterface> input_gpio_interface;
|
||||||
|
|
||||||
std::vector<std::shared_ptr<DistributingEvent>> events;
|
std::vector<std::shared_ptr<DistributingEvent>> events;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace flippR_driver
|
|||||||
namespace output
|
namespace output
|
||||||
{
|
{
|
||||||
|
|
||||||
DisplayController::DisplayController(std::vector<std::shared_ptr<items::IDisplay>> displays, std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface)
|
DisplayController::DisplayController(std::vector<std::shared_ptr<items::IDisplay>> displays, std::shared_ptr<IOutputGPIOInterface> output_gpio_interface)
|
||||||
: displays(displays), output_gpio_interface(output_gpio_interface), is_running(true)
|
: displays(displays), output_gpio_interface(output_gpio_interface), is_running(true)
|
||||||
{
|
{
|
||||||
this->display_cycle_thread = std::thread(&DisplayController::cycle_displays, this);
|
this->display_cycle_thread = std::thread(&DisplayController::cycle_displays, this);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace output
|
|||||||
class DisplayController : public IDisplayController
|
class DisplayController : public IDisplayController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit DisplayController(std::vector<std::shared_ptr<items::IDisplay>> displays, std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface);
|
explicit DisplayController(std::vector<std::shared_ptr<items::IDisplay>> displays, std::shared_ptr<IOutputGPIOInterface> output_gpio_interface);
|
||||||
~DisplayController();
|
~DisplayController();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -35,7 +35,7 @@ private:
|
|||||||
|
|
||||||
std::thread display_cycle_thread;
|
std::thread display_cycle_thread;
|
||||||
|
|
||||||
std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface;
|
std::shared_ptr<IOutputGPIOInterface> output_gpio_interface;
|
||||||
|
|
||||||
bool is_running;
|
bool is_running;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace output
|
|||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
|
|
||||||
Item::Item(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name) :
|
Item::Item(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name) :
|
||||||
address(address),
|
address(address),
|
||||||
name(name),
|
name(name),
|
||||||
gpio_interface(output_gpio_interface)
|
gpio_interface(output_gpio_interface)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace items
|
|||||||
class Item : public IItem
|
class Item : public IItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Item(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
Item(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
||||||
virtual ~Item();
|
virtual ~Item();
|
||||||
|
|
||||||
uint8_t get_address() override;
|
uint8_t get_address() override;
|
||||||
@@ -34,7 +34,7 @@ protected:
|
|||||||
const uint8_t address;
|
const uint8_t address;
|
||||||
const std::string name;
|
const std::string name;
|
||||||
|
|
||||||
const std::shared_ptr<utility::IOutputGPIOInterface> gpio_interface;
|
const std::shared_ptr<IOutputGPIOInterface> gpio_interface;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace output
|
|||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
|
|
||||||
Lamp::Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name)
|
Lamp::Lamp(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name)
|
||||||
:
|
:
|
||||||
Item(output_gpio_interface, address, name),
|
Item(output_gpio_interface, address, name),
|
||||||
activated(false)
|
activated(false)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace items
|
|||||||
class Lamp : public Item, ILamp, IDriverBoardItem
|
class Lamp : public Item, ILamp, IDriverBoardItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
Lamp(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
||||||
virtual ~Lamp() = default;
|
virtual ~Lamp() = default;
|
||||||
|
|
||||||
void activate();
|
void activate();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace output
|
|||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
|
|
||||||
Solenoid::Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time):
|
Solenoid::Solenoid(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time):
|
||||||
Item(output_gpio_interface, address, name),
|
Item(output_gpio_interface, address, name),
|
||||||
deactivation_time(deactivation_time)
|
deactivation_time(deactivation_time)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace items
|
|||||||
class Solenoid : public Item, ISolenoid, IDriverBoardItem
|
class Solenoid : public Item, ISolenoid, IDriverBoardItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
Solenoid(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
||||||
virtual ~Solenoid() = default;
|
virtual ~Solenoid() = default;
|
||||||
|
|
||||||
void trigger();
|
void trigger();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace output
|
|||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
|
|
||||||
Sound::Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id) :
|
Sound::Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id) :
|
||||||
Item(output_gpio_interface, address, name),
|
Item(output_gpio_interface, address, name),
|
||||||
deactivation_time(deactivation_time),
|
deactivation_time(deactivation_time),
|
||||||
id(id)
|
id(id)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
u_int id;
|
u_int id;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id);
|
Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id);
|
||||||
virtual ~Sound() = default;
|
virtual ~Sound() = default;
|
||||||
|
|
||||||
virtual void play();
|
virtual void play();
|
||||||
@@ -40,6 +40,7 @@ private:
|
|||||||
std::chrono::milliseconds deactivation_time;
|
std::chrono::milliseconds deactivation_time;
|
||||||
|
|
||||||
std::future<void> play_task;
|
std::future<void> play_task;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void playTask();
|
virtual void playTask();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user