nearly compiling
This commit is contained in:
@@ -6,13 +6,14 @@
|
|||||||
#define FLIPPR_DRIVER_DISPLAYPINCONTROLLER_H
|
#define FLIPPR_DRIVER_DISPLAYPINCONTROLLER_H
|
||||||
|
|
||||||
#include "output/items/OutputDisplay.h"
|
#include "output/items/OutputDisplay.h"
|
||||||
|
#include "OutputPinController.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
namespace output
|
namespace output
|
||||||
{
|
{
|
||||||
|
|
||||||
class DisplayBoardPinController
|
class DisplayBoardPinController : public OutputPinController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~DisplayBoardPinController() = default;
|
virtual ~DisplayBoardPinController() = default;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#ifndef FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
|
#ifndef FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
|
||||||
#define FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
|
#define FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
|
||||||
|
|
||||||
|
#include "OutputPinController.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
@@ -16,7 +17,7 @@ namespace items
|
|||||||
class DriverBoardItem;
|
class DriverBoardItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
class DriverBoardPinController
|
class DriverBoardPinController : public OutputPinController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~DriverBoardPinController() = default;
|
virtual ~DriverBoardPinController() = default;
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ class OutputPinController : public PinController
|
|||||||
public:
|
public:
|
||||||
virtual ~OutputPinController() = default;
|
virtual ~OutputPinController() = default;
|
||||||
|
|
||||||
virtual void activate(items::DriverBoardItem &driver_board_item) = 0;
|
|
||||||
virtual void deactivate(items::DriverBoardItem &driver_board_item) = 0;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void initialize_i2c_address(uint8_t i2c_address, uint8_t pin_base);
|
static void initialize_i2c_address(uint8_t i2c_address, uint8_t pin_base);
|
||||||
static void initialize_pins_output(uint8_t pin_base, std::map<std::string, uint8_t>::iterator begin, std::map<std::string, uint8_t>::iterator end);
|
static void initialize_pins_output(uint8_t pin_base, std::map<std::string, uint8_t>::iterator begin, std::map<std::string, uint8_t>::iterator end);
|
||||||
|
|||||||
@@ -6,13 +6,14 @@
|
|||||||
#define FLIPPR_DRIVER_OUTPUT_SOUNDBOARDPINCONTROLLER_H
|
#define FLIPPR_DRIVER_OUTPUT_SOUNDBOARDPINCONTROLLER_H
|
||||||
|
|
||||||
#include "output/items/detail/Sound.h"
|
#include "output/items/detail/Sound.h"
|
||||||
|
#include "OutputPinController.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
namespace output
|
namespace output
|
||||||
{
|
{
|
||||||
|
|
||||||
class SoundBoardPinController
|
class SoundBoardPinController : public OutputPinController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~SoundBoardPinController() = default;
|
virtual ~SoundBoardPinController() = default;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace detail
|
|||||||
class DriverBoardItem : public output::items::DriverBoardItem
|
class DriverBoardItem : public output::items::DriverBoardItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DriverBoardItem(const uint8_t address);
|
DriverBoardItem(uint8_t address);
|
||||||
|
|
||||||
~DriverBoardItem() override = default;
|
~DriverBoardItem() override = default;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
|
|
||||||
Flipper::Flipper(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name) :
|
Flipper::Flipper(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name) :
|
||||||
DriverBoardItem(pin_controller, address, name)
|
Item(std::move(name)), DriverBoardItem(address), pin_controller(std::move(pin_controller))
|
||||||
{
|
{
|
||||||
CLOG(INFO, OUTPUT_LOGGER) << "Created Flipper relay " << this->name << " with address " << this->address;
|
CLOG(INFO, OUTPUT_LOGGER) << "Created Flipper relay " << this->name << " with address " << this->address;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define _SRC_FLIPPR_CODE_FLIPPER_H
|
#define _SRC_FLIPPR_CODE_FLIPPER_H
|
||||||
|
|
||||||
#include "output/items/Flipper.h"
|
#include "output/items/Flipper.h"
|
||||||
#include "output/items/DriverBoardItem.h"
|
#include "output/items/detail/DriverBoardItem.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
@@ -20,7 +20,7 @@ namespace items
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
class Flipper : public detail::Item, public items::Flipper, public DriverBoardItem
|
class Flipper : public detail::Item, public items::Flipper, public detail::DriverBoardItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Flipper(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name);
|
Flipper(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name);
|
||||||
@@ -31,6 +31,7 @@ public:
|
|||||||
bool is_activated() override;
|
bool is_activated() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
const std::shared_ptr<DriverBoardPinController> pin_controller;
|
||||||
bool activated;
|
bool activated;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,15 +13,10 @@ namespace items
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
Item::Item(uint8_t address, std::string name) :
|
Item::Item(std::string name) :
|
||||||
address(address), name(std::move(name))
|
name(std::move(name))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
uint8_t Item::get_address() const
|
|
||||||
{
|
|
||||||
return this->address;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Item::get_name() const
|
std::string Item::get_name() const
|
||||||
{
|
{
|
||||||
return this->name;
|
return this->name;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
|
|
||||||
Lamp::Lamp(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name) :
|
Lamp::Lamp(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name) :
|
||||||
detail::Item(std::move(name)), DriverBoardItem(address), pin_controller(std::move(pin_controller), activated(false)
|
detail::Item(std::move(name)), DriverBoardItem(address), pin_controller(std::move(pin_controller)), activated(false)
|
||||||
{
|
{
|
||||||
CLOG(INFO, OUTPUT_LOGGER) << "Created lamp " << name << " with address " << address;
|
CLOG(INFO, OUTPUT_LOGGER) << "Created lamp " << name << " with address " << address;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user