asdf
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#ifndef FLIPPR_DRIVER_IDRIVERBOARDITEM_H
|
||||
#define FLIPPR_DRIVER_IDRIVERBOARDITEM_H
|
||||
|
||||
#include "IItem.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
@@ -14,8 +18,7 @@ namespace items
|
||||
|
||||
class IDriverBoardItem : public IItem
|
||||
{
|
||||
virtual ~IDriverBoardItem()
|
||||
{};
|
||||
virtual ~IDriverBoardItem(){};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef _SRC_OUTPUT_ICABINETITEM_H_
|
||||
#define _SRC_OUTPUT_ICABINETITEM_H_
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
@@ -22,6 +23,8 @@ public:
|
||||
virtual ~IItem();
|
||||
virtual void activate() = 0;
|
||||
virtual void deactivate() = 0;
|
||||
|
||||
virtual uint8_t get_address() = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
24
FlippR-Driver/src/output/items/ISoundItem.h
Normal file
24
FlippR-Driver/src/output/items/ISoundItem.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Created by rhetenor on 23.11.18.
|
||||
//
|
||||
|
||||
#ifndef FLIPPR_DRIVER_ISOUNDITEM_H
|
||||
#define FLIPPR_DRIVER_ISOUNDITEM_H
|
||||
|
||||
#include "IItem.h"
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
namespace items
|
||||
{
|
||||
class ISoundItem : public IItem
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif //FLIPPR_DRIVER_ISOUNDITEM_H
|
||||
@@ -11,12 +11,17 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
Item::Item(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name) :
|
||||
Item::Item(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name) :
|
||||
address(address),
|
||||
name(name),
|
||||
output_gpio_interface(output_gpio_interface)
|
||||
{}
|
||||
|
||||
uint8_t Item::get_address()
|
||||
{
|
||||
return this->address;
|
||||
}
|
||||
|
||||
void Item::activate()
|
||||
{
|
||||
output_gpio_interface->activate_output_item(this);
|
||||
|
||||
@@ -25,14 +25,15 @@ namespace items
|
||||
class Item : public IItem
|
||||
{
|
||||
public:
|
||||
Item(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name);
|
||||
Item(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
||||
virtual ~Item();
|
||||
|
||||
public:
|
||||
const u_int8_t address;
|
||||
const std::string name;
|
||||
virtual uint8_t get_address();
|
||||
|
||||
protected:
|
||||
const uint8_t address;
|
||||
const std::string name;
|
||||
|
||||
const std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "Item.h"
|
||||
#include "output/items/ILamp.h"
|
||||
#include "IDriverBoardItem.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
@@ -18,10 +19,10 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
class Lamp : public Item, ILamp
|
||||
class Lamp : public Item, ILamp, IDriverBoardItem
|
||||
{
|
||||
public:
|
||||
Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name);
|
||||
Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
||||
virtual ~Lamp() = default;
|
||||
|
||||
void activate();
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "output/items/ISolenoid.h"
|
||||
#include "Item.h"
|
||||
#include "IDriverBoardItem.h"
|
||||
|
||||
#include <future>
|
||||
#include <chrono>
|
||||
@@ -21,7 +22,7 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
class Solenoid : public Item, ISolenoid
|
||||
class Solenoid : public Item, ISolenoid, IDriverBoardItem
|
||||
{
|
||||
public:
|
||||
Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, unsigned int address, unsigned int i2c_address, unsigned int data_pin, std::string name, std::chrono::milliseconds deactivation_time);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
Sound::Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time) :
|
||||
Sound::Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time) :
|
||||
Item(output_gpio_interface, address, name),
|
||||
deactivation_time(deactivation_time)
|
||||
{}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#define _SRC_OUTPUT_SOUND_H_
|
||||
|
||||
#include "output/items/ISound.h"
|
||||
#include "ISoundItem.h"
|
||||
#include "Item.h"
|
||||
|
||||
#include <memory>
|
||||
@@ -24,13 +25,13 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
class Sound : public ISound, Item
|
||||
class Sound : public ISound, Item, ISoundItem
|
||||
{
|
||||
public:
|
||||
u_int id;
|
||||
|
||||
public:
|
||||
Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
||||
Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
||||
virtual ~Sound() = default;
|
||||
|
||||
virtual void play();
|
||||
|
||||
Reference in New Issue
Block a user