Merge branch 'master' of https://github.com/swinginbird/flippr-code
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by rhetenor on 19.10.18.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef FLIPPR_DRIVER_ACTIVATEEVENT_H
|
|
||||||
#define FLIPPR_DRIVER_ACTIVATEEVENT_H
|
|
||||||
|
|
||||||
class ActivateEvent : public Event
|
|
||||||
{
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //FLIPPR_DRIVER_ACTIVATEEVENT_H
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by rhetenor on 19.10.18.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef FLIPPR_DRIVER_DEACTIVATEEVENT_H
|
|
||||||
#define FLIPPR_DRIVER_DEACTIVATEEVENT_H
|
|
||||||
|
|
||||||
class DeactivateEvent
|
|
||||||
{
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //FLIPPR_DRIVER_DEACTIVATEEVENT_H
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by rhetenor on 19.10.18.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef FLIPPR_DRIVER_EVENT_H
|
|
||||||
#define FLIPPR_DRIVER_EVENT_H
|
|
||||||
|
|
||||||
#include "OutputItem.h"
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
namespace FlippR_Driver
|
|
||||||
{
|
|
||||||
namespace output
|
|
||||||
{
|
|
||||||
class Event
|
|
||||||
{
|
|
||||||
std::shared_ptr<OutputItem> item;
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif //FLIPPR_DRIVER_EVENT_H
|
|
||||||
@@ -15,13 +15,13 @@ namespace flippR_driver
|
|||||||
namespace output
|
namespace output
|
||||||
{
|
{
|
||||||
|
|
||||||
OutputDriver::OutputDriver(std::map<std::string, std::shared_ptr<IOutputItem>> cabinet_items, std::map<char, std::shared_ptr<IDisplay>> displays, std::map<std::string, std::shared_ptr<ISound>> sounds)
|
OutputDriver::OutputDriver(std::map<std::string, std::shared_ptr<ICabinetItem>> cabinet_items, std::map<char, std::shared_ptr<IDisplay>> displays, std::map<std::string, std::shared_ptr<ISound>> sounds)
|
||||||
: cabinet_items(cabinet_items), displays(displays), sounds(sounds)
|
: cabinet_items(cabinet_items), displays(displays), sounds(sounds)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
std::vector<std::shared_ptr<IOutputItem>> OutputDriver::get_cabinet_items()
|
std::vector<std::shared_ptr<ICabinetItem>> OutputDriver::get_cabinet_items()
|
||||||
{
|
{
|
||||||
std::vector<std::shared_ptr<IOutputItem>> cabinet_items;
|
std::vector<std::shared_ptr<ICabinetItem>> cabinet_items;
|
||||||
|
|
||||||
boost::copy(this->cabinet_items | boost::adaptors::map_values, std::back_inserter(cabinet_items));
|
boost::copy(this->cabinet_items | boost::adaptors::map_values, std::back_inserter(cabinet_items));
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ std::vector<std::shared_ptr<IDisplay>> OutputDriver::get_displays()
|
|||||||
return displays;
|
return displays;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<IOutputItem> OutputDriver::get_cabinet_item(std::string name)
|
std::shared_ptr<ICabinetItem> OutputDriver::get_cabinet_item(std::string name)
|
||||||
{
|
{
|
||||||
return this->cabinet_items.find(name)->second;
|
return this->cabinet_items.find(name)->second;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "IOutputItem.h"
|
#include "ICabinetItem.h"
|
||||||
#include "IDisplay.h"
|
#include "IDisplay.h"
|
||||||
#include "ISound.h"
|
#include "ISound.h"
|
||||||
|
|
||||||
@@ -25,28 +25,10 @@ namespace output
|
|||||||
class OutputDriver : public IOutputDriver
|
class OutputDriver : public IOutputDriver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
<<<<<<< HEAD
|
|
||||||
OutputDriver(std::map<std::string, std::shared_ptr<IOutputItem>> cabinet_items, std::map<char, std::shared_ptr<IDisplay>> displays, std::map<std::string, std::shared_ptr<ISound>> sounds);
|
|
||||||
=======
|
|
||||||
OutputDriver(std::map<std::string, std::shared_ptr<ICabinetItem>> cabinet_items, std::map<char, std::shared_ptr<IDisplay>> displays, std::map<std::string, std::shared_ptr<ISound>> sounds);
|
OutputDriver(std::map<std::string, std::shared_ptr<ICabinetItem>> cabinet_items, std::map<char, std::shared_ptr<IDisplay>> displays, std::map<std::string, std::shared_ptr<ISound>> sounds);
|
||||||
>>>>>>> be582e9f7f0d29518665a131afce24ca0a43386e
|
|
||||||
|
|
||||||
virtual ~OutputDriver() = default;
|
virtual ~OutputDriver() = default;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
std::vector<std::shared_ptr<IOutputItem>> get_cabinet_items();
|
|
||||||
std::vector<std::shared_ptr<ISound>> get_sounds();
|
|
||||||
std::vector<std::shared_ptr<IDisplay>> get_displays();
|
|
||||||
|
|
||||||
std::shared_ptr<IOutputItem> get_cabinet_item(std::string name);
|
|
||||||
std::shared_ptr<ISound> get_sound(std::string name);
|
|
||||||
std::shared_ptr<IDisplay> get_display(char number);
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::map<std::string, std::shared_ptr<IOutputItem>> cabinet_items;
|
|
||||||
std::map<char, std::shared_ptr<IDisplay>> displays;
|
|
||||||
std::map<std::string, std::shared_ptr<ISound>> sounds;
|
|
||||||
=======
|
|
||||||
std::vector<std::shared_ptr<ICabinetItem>> get_cabinet_items();
|
std::vector<std::shared_ptr<ICabinetItem>> get_cabinet_items();
|
||||||
std::vector<std::shared_ptr<ISound>> get_sounds();
|
std::vector<std::shared_ptr<ISound>> get_sounds();
|
||||||
std::vector<std::shared_ptr<IDisplay>> get_displays();
|
std::vector<std::shared_ptr<IDisplay>> get_displays();
|
||||||
@@ -59,7 +41,6 @@ private:
|
|||||||
std::map<std::string, std::shared_ptr<ICabinetItem>> cabinet_items;
|
std::map<std::string, std::shared_ptr<ICabinetItem>> cabinet_items;
|
||||||
std::map<char, std::shared_ptr<IDisplay>> displays;
|
std::map<char, std::shared_ptr<IDisplay>> displays;
|
||||||
std::map<std::string, std::shared_ptr<ISound>> sounds;
|
std::map<std::string, std::shared_ptr<ISound>> sounds;
|
||||||
>>>>>>> be582e9f7f0d29518665a131afce24ca0a43386e
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace output */
|
} /* namespace output */
|
||||||
|
|||||||
@@ -9,9 +9,6 @@
|
|||||||
#define SRC_UTILITIES_OUTPUTGPIOINTERFACE_H_
|
#define SRC_UTILITIES_OUTPUTGPIOINTERFACE_H_
|
||||||
|
|
||||||
#include "GPIOInterface.h"
|
#include "GPIOInterface.h"
|
||||||
|
|
||||||
#include "output/Event.h"
|
|
||||||
|
|
||||||
#include <mcp23017.h>
|
#include <mcp23017.h>
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
@@ -22,22 +19,13 @@ class OutputGPIOInterface : GPIOInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OutputGPIOInterface();
|
void activate_cabinet_item(CabinetItem &item);
|
||||||
|
|
||||||
~OutputGPIOInterface() = default;
|
|
||||||
|
|
||||||
void queue_output_item(shared_ptr<OutputItem> item);
|
|
||||||
void write_display(Display &display);
|
void write_display(Display &display);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void cycle_output_items();
|
void
|
||||||
|
|
||||||
void activate_sounds(OutputItem &item);
|
|
||||||
void activate_cabinet_item(OutputItem &item);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IBlockingQueue <output::Event> event_queue;
|
IBlockingQueue <CabinetItem> event_queue;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user