bis nächste woche
This commit is contained in:
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* ActivateStrategy.cpp
|
|
||||||
*
|
|
||||||
* Created on: Nov 8, 2018
|
|
||||||
* Author: johannes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ActivateStrategy.h"
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace output
|
|
||||||
{
|
|
||||||
namespace strategy
|
|
||||||
{
|
|
||||||
ActivateStrategy::ActivateStrategy()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ActivateStrategy::~ActivateStrategy()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated destructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* ActivateStrategy.h
|
|
||||||
*
|
|
||||||
* Created on: Nov 8, 2018
|
|
||||||
* Author: johannes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SRC_OUTPUT_ACTIVATESTRATEGY_H_
|
|
||||||
#define SRC_OUTPUT_ACTIVATESTRATEGY_H_
|
|
||||||
|
|
||||||
#include "ActivationStrategy.h"
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace output
|
|
||||||
{
|
|
||||||
namespace strategy
|
|
||||||
{
|
|
||||||
|
|
||||||
class ActivateStrategy : public ActivationStrategy
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ActivateStrategy();
|
|
||||||
virtual ~ActivateStrategy();
|
|
||||||
|
|
||||||
virtual void operator()();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* SRC_OUTPUT_ACTIVATESTRATEGY_H_ */
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
* ActivationStrategy.h
|
|
||||||
*
|
|
||||||
* Created on: Nov 8, 2018
|
|
||||||
* Author: johannes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SRC_OUTPUT_ACTIVATIONSTRATEGY_H_
|
|
||||||
#define SRC_OUTPUT_ACTIVATIONSTRATEGY_H_
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace output
|
|
||||||
{
|
|
||||||
namespace strategy
|
|
||||||
{
|
|
||||||
class ActivationStrategy
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~ActivationStrategy(){}
|
|
||||||
|
|
||||||
virtual void operator()() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* SRC_OUTPUT_ACTIVATIONSTRATEGY_H_ */
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* DeactivateStrategy.cpp
|
|
||||||
*
|
|
||||||
* Created on: Nov 8, 2018
|
|
||||||
* Author: johannes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "DeactivateStrategy.h"
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace output
|
|
||||||
{
|
|
||||||
namespace strategy
|
|
||||||
{
|
|
||||||
DeactivateStrategy::DeactivateStrategy()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DeactivateStrategy::~DeactivateStrategy()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated destructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* DeactivateStrategy.h
|
|
||||||
*
|
|
||||||
* Created on: Nov 8, 2018
|
|
||||||
* Author: johannes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SRC_OUTPUT_DEACTIVATESTRATEGY_H_
|
|
||||||
#define SRC_OUTPUT_DEACTIVATESTRATEGY_H_
|
|
||||||
|
|
||||||
#include "ActivationStrategy.h"
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace output
|
|
||||||
{
|
|
||||||
namespace strategy
|
|
||||||
{
|
|
||||||
class DeactivateStrategy : public ActivationStrategy
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DeactivateStrategy();
|
|
||||||
virtual ~DeactivateStrategy();
|
|
||||||
|
|
||||||
virtual void operator()();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* SRC_OUTPUT_DEACTIVATESTRATEGY_H_ */
|
|
||||||
@@ -24,5 +24,15 @@ Lamp::~Lamp()
|
|||||||
// TODO Auto-generated destructor stub
|
// TODO Auto-generated destructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lamp::activate()
|
||||||
|
{
|
||||||
|
// activate
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lamp::deactivate()
|
||||||
|
{
|
||||||
|
// deactivate
|
||||||
|
}
|
||||||
|
|
||||||
} /* namespace output */
|
} /* namespace output */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ class Lamp : public OutputItem
|
|||||||
public:
|
public:
|
||||||
Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
|
Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
|
||||||
virtual ~Lamp();
|
virtual ~Lamp();
|
||||||
|
|
||||||
|
void activate();
|
||||||
|
void deactivate();
|
||||||
|
bool is_activated();
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool activated;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace output */
|
} /* namespace output */
|
||||||
|
|||||||
@@ -27,16 +27,10 @@ public:
|
|||||||
OutputItem(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
|
OutputItem(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
|
||||||
virtual ~OutputItem();
|
virtual ~OutputItem();
|
||||||
|
|
||||||
virtual bool isActivated();
|
|
||||||
virtual bool activate();
|
|
||||||
virtual bool deactivate();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int address;
|
int address, i2c_address, data_pin_address;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
bool activated;
|
|
||||||
|
|
||||||
strategy::ActivationStrategy* strategy;
|
strategy::ActivationStrategy* strategy;
|
||||||
|
|
||||||
std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface;
|
std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface;
|
||||||
|
|||||||
@@ -18,10 +18,17 @@ Solenoid::Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_in
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Solenoid::~Solenoid()
|
Solenoid::~Solenoid()
|
||||||
{
|
{
|
||||||
// TODO Auto-generated destructor stub
|
// TODO Auto-generated destructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Solenoid::trigger()
|
||||||
|
{
|
||||||
|
// activate
|
||||||
|
// wait
|
||||||
|
// deactivate
|
||||||
|
}
|
||||||
|
|
||||||
} /* namespace output */
|
} /* namespace output */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ class Solenoid : public OutputItem
|
|||||||
public:
|
public:
|
||||||
Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
|
Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
|
||||||
virtual ~Solenoid();
|
virtual ~Solenoid();
|
||||||
|
|
||||||
|
//muss task sein
|
||||||
|
void trigger();
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace output */
|
} /* namespace output */
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ Sound::Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interfac
|
|||||||
void Sound::play()
|
void Sound::play()
|
||||||
{
|
{
|
||||||
// this->output_gpio_interface->activate(this);
|
// this->output_gpio_interface->activate(this);
|
||||||
|
// wait
|
||||||
|
// deactivate()
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace output */
|
} /* namespace output */
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* TriggerStrategy.cpp
|
|
||||||
*
|
|
||||||
* Created on: Nov 8, 2018
|
|
||||||
* Author: johannes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "TriggerStrategy.h"
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace output
|
|
||||||
{
|
|
||||||
namespace strategy
|
|
||||||
{
|
|
||||||
|
|
||||||
TriggerStrategy::TriggerStrategy()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
TriggerStrategy::~TriggerStrategy()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated destructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* TriggerStrategy.h
|
|
||||||
*
|
|
||||||
* Created on: Nov 8, 2018
|
|
||||||
* Author: johannes
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SRC_OUTPUT_TRIGGERSTRATEGY_H_
|
|
||||||
#define SRC_OUTPUT_TRIGGERSTRATEGY_H_
|
|
||||||
|
|
||||||
#include "ActivationStrategy.h"
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace output
|
|
||||||
{
|
|
||||||
namespace strategy
|
|
||||||
{
|
|
||||||
|
|
||||||
class TriggerStrategy : public ActivationStrategy
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
TriggerStrategy();
|
|
||||||
virtual ~TriggerStrategy();
|
|
||||||
|
|
||||||
virtual void operator()();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* SRC_OUTPUT_TRIGGERSTRATEGY_H_ */
|
|
||||||
@@ -18,8 +18,10 @@ namespace utility
|
|||||||
class IOutputGPIOInterface
|
class IOutputGPIOInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void activate(int address, std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface);
|
//muss alles geschützt sein
|
||||||
void deactivate(int address,std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface);
|
void set_address(int i2c_address, int address);
|
||||||
|
void activate_pin(int i2c_address, int pin);
|
||||||
|
void deactivate_pin(int i2c_address, int pin);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user