46 lines
787 B
C++
46 lines
787 B
C++
/*
|
|
* Solenoid.h
|
|
*
|
|
* Created on: Aug 2, 2018
|
|
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
|
*/
|
|
|
|
#ifndef _SRC_OUTPUT_SOLENOID_H_
|
|
#define _SRC_OUTPUT_SOLENOID_H_
|
|
|
|
#include "output/items/ISolenoid.h"
|
|
#include "Item.h"
|
|
|
|
#include <future>
|
|
#include <chrono>
|
|
|
|
namespace flippR_driver
|
|
{
|
|
namespace output
|
|
{
|
|
namespace items
|
|
{
|
|
|
|
class Solenoid : public Item, public ISolenoid
|
|
{
|
|
public:
|
|
Solenoid(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
|
~Solenoid() override = default;
|
|
|
|
void trigger() override;
|
|
|
|
private:
|
|
std::chrono::milliseconds deactivation_time;
|
|
|
|
std::future<void> trigger_task;
|
|
|
|
private:
|
|
virtual void triggerTask();
|
|
|
|
};
|
|
|
|
} /* namespace output */
|
|
}
|
|
}
|
|
#endif
|