working on item rewrite

This commit is contained in:
Jonas Zeunert
2019-05-06 18:03:50 +02:00
parent a780eea620
commit af00a67428
27 changed files with 113 additions and 176 deletions

View File

@@ -7,6 +7,7 @@
#include "Lamp.h"
#include <output/DriverBoardPinController.h>
#include "utility/config.h"
namespace flippR_driver
@@ -19,7 +20,7 @@ namespace detail
{
Lamp::Lamp(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name) :
DriverBoardItem(std::move(pin_controller), address, std::move(name)), activated(false)
detail::Item(std::move(name)), DriverBoardItem(std::move(pin_controller), address), activated(false)
{
CLOG(INFO, OUTPUT_LOGGER) << "Created lamp " << name << " with address " << address;
}
@@ -27,13 +28,13 @@ DriverBoardItem(std::move(pin_controller), address, std::move(name)), activated(
void Lamp::activate()
{
CLOG(INFO, OUTPUT_LOGGER) << "Activate lamp " << name;
pin_controller->activate(*this);
this->pin_controller->activate(*this);
}
void Lamp::deactivate()
{
CLOG(INFO, OUTPUT_LOGGER) << "Deactivate lamp " << name;
pin_controller->deactivate(*this);
this->pin_controller->deactivate(*this);
}
bool Lamp::is_activated()