Integrates SoundFactory

This commit is contained in:
Johannes Wendel
2019-12-29 15:55:43 +01:00
parent 989f532c6d
commit cbb03fa924
14 changed files with 41 additions and 50 deletions

View File

@@ -5,6 +5,7 @@
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
*/
#include <output/DisplayBoardPinController.h>
#include "DisplayFactory.h"
@@ -13,7 +14,8 @@ namespace flippR_driver
namespace output
{
DisplayFactory::DisplayFactory(nlohmann::json &object) : Factory(object)
DisplayFactory::DisplayFactory(nlohmann::json &object, std::shared_ptr<DisplayBoardPinController> pin_controller) :
Factory{object, pin_controller}
{
}

View File

@@ -18,7 +18,7 @@ namespace output
class DisplayFactory : Factory
{
public:
explicit DisplayFactory(nlohmann::json & object);
explicit DisplayFactory(nlohmann::json & object, std::shared_ptr<DisplayBoardPinController> pin_controller);
std::map<std::string, std::shared_ptr<items::Item>> getItemMap() override;
};

View File

@@ -12,11 +12,12 @@ namespace flippR_driver
namespace output
{
Factory::Factory(nlohmann::json &object) :
object{object}
Factory::Factory(nlohmann::json &object, std::shared_ptr<PinController> pin_controller) :
pin_controller{pin_controller}
{
this->object = object;
this->initialize_port_extenders();
this->port_extenders = this->object.at("port_extenders");
this->port_extenders = object.at("port_extenders");
}
void Factory::initialize_port_extender(nlohmann::json &extender)

View File

@@ -21,7 +21,7 @@ namespace output
class Factory
{
public:
Factory(nlohmann::json &object);
Factory(nlohmann::json &object, std::shared_ptr<PinController> pin_controller);
virtual std::map<std::string, std::shared_ptr<items::Item>> getItemMap() = 0;

View File

@@ -5,6 +5,7 @@
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
*/
#include <output/DriverBoardPinController.h>
#include "FlipperFactory.h"
namespace flippR_driver
@@ -12,7 +13,8 @@ namespace flippR_driver
namespace output
{
FlipperFactory::FlipperFactory(nlohmann::json &object) : Factory(object)
FlipperFactory::FlipperFactory(nlohmann::json &object, std::shared_ptr<DriverBoardPinController> pin_controller) :
Factory{object, pin_controller}
{
}

View File

@@ -19,7 +19,7 @@ namespace output
class FlipperFactory : Factory
{
public:
explicit FlipperFactory(nlohmann::json & object);
explicit FlipperFactory(nlohmann::json & object, std::shared_ptr<DriverBoardPinController> pin_controller);
std::map <std::string, std::shared_ptr<items::Item>> getItemMap() override;
};

View File

@@ -14,13 +14,13 @@ namespace flippR_driver
namespace output
{
LampFactory::LampFactory(nlohmann::json &object) :
Factory(object)
LampFactory::LampFactory(nlohmann::json &object, std::shared_ptr<DriverBoardPinController> pin_controller) :
Factory{object, pin_controller}
{}
std::map<std::string, std::shared_ptr<items::Item>> LampFactory::getItemMap()
{
auto lamps = object.at("lamps");
auto lamps = this->object.at("lamps");
std::map<std::string, std::shared_ptr<items::Item>> lamp_map;
for (auto lamp : lamps)
{

View File

@@ -8,6 +8,7 @@
#ifndef FLIPPR_DRIVER_LAMPFACTORY_H
#define FLIPPR_DRIVER_LAMPFACTORY_H
#include <output/DriverBoardPinController.h>
#include "Factory.h"
namespace flippR_driver
@@ -18,7 +19,7 @@ namespace output
class LampFactory : Factory
{
public:
explicit LampFactory(nlohmann::json & object);
explicit LampFactory(nlohmann::json & object, std::shared_ptr<DriverBoardPinController> pin_controller);
std::map<std::string, std::shared_ptr<items::Item>> getItemMap() override;
};

View File

@@ -4,13 +4,15 @@
* Created on: December 28, 2019
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
*/
#include <output/SoundBoardPinController.h>
#include "SoundFactory.h"
namespace flippR_driver
{
namespace output
{
SoundFactory::SoundFactory(nlohmann::json &object) : Factory(object)
SoundFactory::SoundFactory(nlohmann::json &object, std::shared_ptr<SoundBoardPinController> pin_controller) :
Factory{object, pin_controller}
{
}

View File

@@ -18,7 +18,7 @@ namespace output
class SoundFactory : Factory
{
public:
explicit SoundFactory(nlohmann::json & object);
explicit SoundFactory(nlohmann::json & object, std::shared_ptr<SoundBoardPinController> pin_controller);
std::map<std::string, std::shared_ptr<items::Item>> getItemMap() override;
};