working on big refactor
This commit is contained in:
@@ -19,10 +19,10 @@ namespace items
|
||||
class DriverBoardItem : public Item
|
||||
{
|
||||
public:
|
||||
DriverBoardItem(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name) :
|
||||
DriverBoardItem(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name) :
|
||||
Item(std::move(output_gpio_interface), address, std::move(name)) {}
|
||||
~DriverBoardItem() override = default;
|
||||
|
||||
~DriverBoardItem() override = default;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
Item::Item(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name) :
|
||||
Item::Item(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name) :
|
||||
address(address),
|
||||
name(std::move(name)),
|
||||
gpio_interface(std::move(output_gpio_interface))
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace flippR_driver
|
||||
namespace output
|
||||
{
|
||||
|
||||
class IOutputGPIOInterface;
|
||||
class OutputPinController;
|
||||
|
||||
namespace items
|
||||
{
|
||||
@@ -26,7 +26,7 @@ namespace items
|
||||
class Item : public IItem
|
||||
{
|
||||
public:
|
||||
Item(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
||||
Item(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name);
|
||||
~Item() override = default;
|
||||
|
||||
uint8_t get_address() override;
|
||||
@@ -36,7 +36,7 @@ protected:
|
||||
const uint8_t address;
|
||||
const std::string name;
|
||||
|
||||
const std::shared_ptr<IOutputGPIOInterface> gpio_interface;
|
||||
const std::shared_ptr<OutputPinController> gpio_interface;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "Lamp.h"
|
||||
|
||||
#include "output/IOutputGPIOInterface.h"
|
||||
#include "output/OutputPinController.h"
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
@@ -15,7 +15,7 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
Lamp::Lamp(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name) :
|
||||
Lamp::Lamp(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name) :
|
||||
DriverBoardItem(std::move(output_gpio_interface), address, std::move(name)), activated(false)
|
||||
{}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace items
|
||||
class Lamp : public DriverBoardItem, public ILamp
|
||||
{
|
||||
public:
|
||||
Lamp(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
||||
Lamp(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name);
|
||||
~Lamp() override = default;
|
||||
|
||||
void activate() override;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "Solenoid.h"
|
||||
|
||||
#include "output/IOutputGPIOInterface.h"
|
||||
#include "output/OutputPinController.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
@@ -16,7 +16,7 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
Solenoid::Solenoid(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time):
|
||||
Solenoid::Solenoid(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time):
|
||||
DriverBoardItem(std::move(output_gpio_interface), address, std::move(name)), deactivation_time(deactivation_time)
|
||||
{}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace items
|
||||
class Solenoid : public DriverBoardItem, public ISolenoid
|
||||
{
|
||||
public:
|
||||
Solenoid(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
||||
Solenoid(std::shared_ptr<OutputPinController> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
||||
~Solenoid() override = default;
|
||||
|
||||
void trigger() override;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "Sound.h"
|
||||
|
||||
#include "output/IOutputGPIOInterface.h"
|
||||
#include "output/OutputPinController.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
@@ -16,7 +16,7 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
Sound::Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id) :
|
||||
Sound::Sound(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id) :
|
||||
Item(std::move(output_gpio_interface), address, std::move(name)), deactivation_time(deactivation_time), id(id)
|
||||
{}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
u_int id;
|
||||
|
||||
public:
|
||||
Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id);
|
||||
Sound(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id);
|
||||
~Sound() override = default;
|
||||
|
||||
void play() override;
|
||||
|
||||
Reference in New Issue
Block a user