Files
flippr-code/FlippR-Driver/src/output/detail/OutputDriver.h
2019-05-06 16:04:24 +02:00

70 lines
2.3 KiB
C++

/*
* OutputDriver.h
*
* Created on: Aug 2, 2018
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
*/
#ifndef _SRC_OUTPUT_OUTPUTDRIVER_H_
#define _SRC_OUTPUT_OUTPUTDRIVER_H_
#include <map>
#include "output/OutputDriver.h"
#include "output/DisplayController.h"
namespace flippR_driver
{
namespace output
{
namespace detail
{
class OutputDriver : public output::OutputDriver
{
public:
OutputDriver(std::unique_ptr<output::DisplayController> display_controller, std::map<std::string, std::shared_ptr<items::Solenoid>> solenoids,
std::map<std::string, std::shared_ptr<items::Lamp>> lamps, std::map<std::string, std::shared_ptr<items::Sound>> sounds,
std::map<uint8_t, std::shared_ptr<output::items::Display>> displays);
~OutputDriver() override = default;
void activate_displays() const override;
void deactivate_displays() const override;
void activate_all_lamps() const override;
void deactivate_all_lamps() const override;
void rotate_all_lamps() const override;
void activate_flipper_relay();
void activate_top_flipper_relay();
void deactivate_flipper_relay();
void deactivate_top_flipper_relay();
// todo driver board run for activate/deactivate?
// todo what is flipper_relay ?
std::vector<std::shared_ptr<items::Lamp>> get_lamps() const override;
std::vector<std::shared_ptr<items::Solenoid>> get_solenoids() const override;
std::vector<std::shared_ptr<items::Sound>> get_sounds() const override;
std::vector<std::shared_ptr<items::Display>> get_displays() const override;
boost::optional<std::shared_ptr<items::Lamp>> get_lamp(const std::string &name) const override;
boost::optional<std::shared_ptr<items::Solenoid>> get_solenoid(const std::string &name) const override;
boost::optional<std::shared_ptr<items::Sound>> get_sound(const std::string &name) const override;
boost::optional<std::shared_ptr<items::Display>> get_display(uint8_t number) const override;
private:
std::unique_ptr<output::DisplayController> display_controller;
const std::map<std::string, std::shared_ptr<items::Lamp>> lamps;
const std::map<std::string, std::shared_ptr<items::Solenoid>> solenoids;
const std::map<std::string, std::shared_ptr<items::Sound>> sounds;
const std::map<uint8_t, std::shared_ptr<items::Display>> displays;
};
}
} /* namespace output */
}
#endif