bis nächste woche

This commit is contained in:
Johannes Wendel
2018-11-09 02:00:01 +01:00
parent 951b6bda2c
commit 8583294e0d
14 changed files with 35 additions and 230 deletions

View File

@@ -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
}
}
}
}

View File

@@ -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_ */

View File

@@ -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_ */

View File

@@ -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
}
}
}
}

View File

@@ -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_ */

View File

@@ -24,5 +24,15 @@ Lamp::~Lamp()
// TODO Auto-generated destructor stub
}
void Lamp::activate()
{
// activate
}
void Lamp::deactivate()
{
// deactivate
}
} /* namespace output */
}

View File

@@ -20,6 +20,13 @@ class Lamp : public OutputItem
public:
Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
virtual ~Lamp();
void activate();
void deactivate();
bool is_activated();
private:
bool activated;
};
} /* namespace output */

View File

@@ -27,16 +27,10 @@ public:
OutputItem(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
virtual ~OutputItem();
virtual bool isActivated();
virtual bool activate();
virtual bool deactivate();
protected:
int address;
int address, i2c_address, data_pin_address;
std::string name;
bool activated;
strategy::ActivationStrategy* strategy;
std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface;

View File

@@ -18,10 +18,17 @@ Solenoid::Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_in
}
Solenoid::~Solenoid()
Solenoid::~Solenoid()
{
// TODO Auto-generated destructor stub
}
void Solenoid::trigger()
{
// activate
// wait
// deactivate
}
} /* namespace output */
}

View File

@@ -20,6 +20,9 @@ class Solenoid : public OutputItem
public:
Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
virtual ~Solenoid();
//muss task sein
void trigger();
};
} /* namespace output */

View File

@@ -19,6 +19,8 @@ Sound::Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interfac
void Sound::play()
{
// this->output_gpio_interface->activate(this);
// wait
// deactivate()
}
} /* namespace output */

View File

@@ -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
}
}
}
}

View File

@@ -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_ */

View File

@@ -18,8 +18,10 @@ namespace utility
class IOutputGPIOInterface
{
public:
void activate(int address, std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface);
void deactivate(int address,std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface);
//muss alles geschützt sein
void set_address(int i2c_address, int address);
void activate_pin(int i2c_address, int pin);
void deactivate_pin(int i2c_address, int pin);
};
}