diff --git a/FlippR-Driver/contrib/uml/output_umldiagramm b/FlippR-Driver/contrib/uml/output_umldiagramm index 6f3f3e1..6d3e5a3 100644 --- a/FlippR-Driver/contrib/uml/output_umldiagramm +++ b/FlippR-Driver/contrib/uml/output_umldiagramm @@ -88,14 +88,22 @@ namespace flippR_driver::output { abstract class IDisplay { +IDisplay() +~IDisplay() - +{abstract} getID() : int - -fit_string(std::string& score_string) : std::string +{abstract} write_content(std::array content) : void +{abstract} write_score(int score) : void } } +namespace flippR_driver::output { + abstract class IDisplay { + +IDisplay() + +~IDisplay() + +{abstract} getID() : int + -fit_string(std::string& score_string) : std::string + } +} + + namespace flippR_driver::output { class IDisplayController { +IDisplayController() @@ -104,6 +112,12 @@ namespace flippR_driver::output { } +class IEightDigitDisplay { + +write_content(std::array content) : void + +write_score(int score) : void +} + + abstract class IEventHandler { +~IEventHandler() +{abstract} handle(flippR_driver::input::Event& event) : void @@ -161,6 +175,12 @@ namespace flippR_driver::output { } +class ISevenDigitDisplay { + +write_content(std::array content) : void + +write_score(int score) : void +} + + namespace flippR_driver::output { class ISolenoid { } @@ -197,7 +217,7 @@ namespace flippR_driver::utility { namespace flippR_driver::output { class Lamp { - +Lamp(std::shared_ptr output_gpio_interface, int address, std::string name, bool activated) + +Lamp(std::shared_ptr output_gpio_interface, int i2c_address, int data_pin, std::string name, bool activated) +~Lamp() -activated : bool +is_activated() : bool @@ -242,9 +262,8 @@ namespace flippR_driver::utility { namespace flippR_driver::output { class OutputItem { - +OutputItem(std::shared_ptr output_gpio_interface, int address, std::string name) + +OutputItem(std::shared_ptr output_gpio_interface, int i2c_address, int data_pin_address, std::string name) +~OutputItem() - #address : int #data_pin_address : int #i2c_address : int #output_gpio_interface : std::shared_ptr @@ -255,12 +274,13 @@ namespace flippR_driver::output { namespace flippR_driver::output { class Solenoid { - +Solenoid(std::shared_ptr output_gpio_interface, int address, std::string name, std::chrono::milliseconds deactivation_time) + +Solenoid(std::shared_ptr output_gpio_interface, int i2c_address, int data_pin, std::string name, std::chrono::milliseconds deactivation_time) +~Solenoid() -deactivation_time : std::chrono::milliseconds -wait_thread : std::future -activate() : void -deactivate() : void + -deactivate_after_wait() : void +trigger() : void } } @@ -268,11 +288,8 @@ namespace flippR_driver::output { namespace flippR_driver::output { class Sound { - +Sound(std::shared_ptr output_gpio_interface, int address, std::string name) + +Sound(std::shared_ptr output_gpio_interface, int i2c_address, int data_pin, std::string name) +~Sound() - -address : int - -output_gpio_interface : std::shared_ptr - -name : std::string +play() : void } } @@ -311,6 +328,11 @@ namespace flippR_driver::utility { } +namespace flippR_driver::output { + ILamp <|-- Lamp +} + + namespace flippR_driver::output { IOutputDriver <|-- OutputDriver } @@ -321,6 +343,11 @@ namespace flippR_driver::output { } +namespace flippR_driver::output { + ISolenoid <|-- Solenoid +} + + namespace flippR_driver::output { ISound <|-- Sound } @@ -336,13 +363,18 @@ namespace flippR_driver::output { } +namespace flippR_driver::output { + OutputItem <|-- Sound +} + + /' Aggregation relationships '/ namespace flippR_driver::output { - DisplayController o-- IDisplay + DisplayController "2" o-- IDisplay } @@ -355,7 +387,7 @@ namespace flippR_driver::input { namespace flippR_driver::output { - OutputDriver o-- IDisplay + OutputDriver "2" o-- IDisplay } @@ -372,9 +404,6 @@ namespace flippR_driver::utility { flippR_driver::output.OutputItem o-- flippR_driver::utility.IOutputGPIOInterface -flippR_driver::output.Sound o-- flippR_driver::utility.IOutputGPIOInterface - - @enduml diff --git a/FlippR-Driver/src/output/IOutputDisplay.h b/FlippR-Driver/src/output/IOutputDisplay.h new file mode 100644 index 0000000..bddd0b0 --- /dev/null +++ b/FlippR-Driver/src/output/IOutputDisplay.h @@ -0,0 +1,31 @@ +/* + * IOutputDisplay.h + * + * Created on: Nov 20, 2018 + * Author: johannes + */ + +#ifndef SRC_OUTPUT_IOUTPUTDISPLAY_H_ +#define SRC_OUTPUT_IOUTPUTDISPLAY_H_ + +namespace flippR_driver +{ +namespace output +{ + +class IDisplay +{ + +public: + IDisplay(); + virtual ~IDisplay(); + + virtual void write_score(int score) = 0; + virtual void write_content(std::array content) = 0; +}; + +} +} + + +#endif /* SRC_OUTPUT_IOUTPUTDISPLAY_H_ */