added new uml
This commit is contained in:
@@ -6,29 +6,14 @@
|
|||||||
|
|
||||||
/' Objects '/
|
/' Objects '/
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
class Display <template <int DigitCount>> {
|
|
||||||
+Display(int address, int id)
|
|
||||||
+~Display()
|
|
||||||
-address : int
|
|
||||||
+getID() : int
|
|
||||||
-id : int
|
|
||||||
+content : std::array<char, DigitCount>
|
|
||||||
-fit_string(std::string& score_string) : std::string
|
|
||||||
+write_content(std::array<char, DigitCount> content) : void
|
|
||||||
+write_score(int score) : void
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
namespace flippR_driver::output {
|
||||||
class DisplayController {
|
class DisplayController {
|
||||||
+DisplayController(std::vector<std::shared_ptr<IDisplay> > displays, std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface)
|
+DisplayController(std::vector<std::shared_ptr<items::IDisplay> > displays, std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface)
|
||||||
+~DisplayController()
|
+~DisplayController()
|
||||||
-is_running : bool
|
-is_running : bool
|
||||||
-output_gpio_interface : std::shared_ptr<utility::IOutputGPIOInterface>
|
-output_gpio_interface : std::shared_ptr<utility::IOutputGPIOInterface>
|
||||||
-display_cycle_thread : std::thread
|
-display_cycle_thread : std::thread
|
||||||
-displays : std::vector<std::shared_ptr<IDisplay> >
|
-displays : std::vector<std::shared_ptr<items::IDisplay> >
|
||||||
-cycle_displays() : void
|
-cycle_displays() : void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,25 +49,6 @@ namespace flippR_driver::utility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
abstract class IDisplay {
|
|
||||||
+IDisplay()
|
|
||||||
+~IDisplay()
|
|
||||||
+{abstract} getID() : int
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
abstract class IDisplay {
|
|
||||||
+IDisplay()
|
|
||||||
+~IDisplay()
|
|
||||||
+{abstract} write_content(std::array<char, DigitCount> content) : void
|
|
||||||
+{abstract} write_score(int score) : void
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
namespace flippR_driver::output {
|
||||||
class IDisplayController {
|
class IDisplayController {
|
||||||
+IDisplayController()
|
+IDisplayController()
|
||||||
@@ -99,54 +65,17 @@ namespace flippR_driver::utility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
class ILamp {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
class IOutputDriver {
|
|
||||||
+IOutputDriver()
|
|
||||||
+~IOutputDriver()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::utility {
|
namespace flippR_driver::utility {
|
||||||
class IOutputGPIOInterface {
|
class IOutputGPIOInterface {
|
||||||
|
+activate_output_item(output::items::IOutputItem* item) : void
|
||||||
+activate_pin(int i2c_address, int pin) : void
|
+activate_pin(int i2c_address, int pin) : void
|
||||||
|
+deactivate_output_item(output::items::IOutputItem* item) : void
|
||||||
+deactivate_pin(int i2c_address, int pin) : void
|
+deactivate_pin(int i2c_address, int pin) : void
|
||||||
+set_address(int i2c_address, int address) : void
|
+set_address(int i2c_address, int address) : void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
abstract class IOutputItem {
|
|
||||||
-~IOutputItem()
|
|
||||||
-{abstract} activate() : bool
|
|
||||||
-{abstract} deactivate() : bool
|
|
||||||
-{abstract} isActivated() : bool
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
class ISolenoid {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
abstract class ISound {
|
|
||||||
+ISound()
|
|
||||||
+~ISound()
|
|
||||||
+{abstract} play() : void
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::utility {
|
namespace flippR_driver::utility {
|
||||||
class InputGPIOInterface {
|
class InputGPIOInterface {
|
||||||
+InputGPIOInterface(std::istream& input_config_stream)
|
+InputGPIOInterface(std::istream& input_config_stream)
|
||||||
@@ -166,34 +95,22 @@ namespace flippR_driver::utility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
class Lamp {
|
|
||||||
+Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int i2c_address, int data_pin, std::string name, bool activated)
|
|
||||||
+~Lamp()
|
|
||||||
-activated : bool
|
|
||||||
+is_activated() : bool
|
|
||||||
+activate() : void
|
|
||||||
+deactivate() : void
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
namespace flippR_driver::output {
|
||||||
class OutputDriver {
|
class OutputDriver {
|
||||||
+OutputDriver(std::map<std::string, std::shared_ptr<ISolenoid> > solenoids, std::map<std::string, std::shared_ptr<ILamp> > lamps, std::map<char, std::shared_ptr<IDisplay> > displays, std::map<std::string, std::shared_ptr<ISound> > sounds)
|
+OutputDriver(std::map<std::string, std::shared_ptr<items::ISolenoid> > solenoids, std::map<std::string, std::shared_ptr<items::ILamp> > lamps, std::map<char, std::shared_ptr<items::IDisplay> > displays, std::map<std::string, std::shared_ptr<items::ISound> > sounds)
|
||||||
+~OutputDriver()
|
+~OutputDriver()
|
||||||
-displays : std::map<char, std::shared_ptr<IDisplay> >
|
-displays : std::map<char, std::shared_ptr<items::IDisplay> >
|
||||||
-lamps : std::map<std::string, std::shared_ptr<ILamp> >
|
-lamps : std::map<std::string, std::shared_ptr<items::ILamp> >
|
||||||
-solenoids : std::map<std::string, std::shared_ptr<ISolenoid> >
|
-solenoids : std::map<std::string, std::shared_ptr<items::ISolenoid> >
|
||||||
-sounds : std::map<std::string, std::shared_ptr<ISound> >
|
-sounds : std::map<std::string, std::shared_ptr<items::ISound> >
|
||||||
+get_display(char number) : std::shared_ptr<IDisplay>
|
+get_display(char number) : std::shared_ptr<items::IDisplay>
|
||||||
+get_lamp(std::string name) : std::shared_ptr<ILamp>
|
+get_lamp(std::string name) : std::shared_ptr<items::ILamp>
|
||||||
+get_solenoid(std::string name) : std::shared_ptr<ISolenoid>
|
+get_solenoid(std::string name) : std::shared_ptr<items::ISolenoid>
|
||||||
+get_sound(std::string name) : std::shared_ptr<ISound>
|
+get_sound(std::string name) : std::shared_ptr<items::ISound>
|
||||||
+get_displays() : std::vector<std::shared_ptr<IDisplay> >
|
+get_displays() : std::vector<std::shared_ptr<items::IDisplay> >
|
||||||
+get_lamps() : std::vector<std::shared_ptr<ILamp> >
|
+get_lamps() : std::vector<std::shared_ptr<items::ILamp> >
|
||||||
+get_solenoids() : std::vector<std::shared_ptr<ISolenoid> >
|
+get_solenoids() : std::vector<std::shared_ptr<items::ISolenoid> >
|
||||||
+get_sounds() : std::vector<std::shared_ptr<ISound> >
|
+get_sounds() : std::vector<std::shared_ptr<items::ISound> >
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,44 +124,11 @@ namespace flippR_driver::output {
|
|||||||
|
|
||||||
namespace flippR_driver::utility {
|
namespace flippR_driver::utility {
|
||||||
class OutputGPIOInterface {
|
class OutputGPIOInterface {
|
||||||
+activate_cabinet_item(CabinetItem& item) : void
|
+~OutputGPIOInterface()
|
||||||
+write_display(Display& display) : void
|
-output_item_mutex : std::mutex
|
||||||
-event_queue : void:IBlockingQueue<CabinetItem>
|
+activate_output_item(output::items::IOutputItem* item) : void
|
||||||
}
|
+deactivate_output_item(output::items::IOutputItem* item) : void
|
||||||
}
|
+write_display(output::items::IDisplay& display) : void
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
class OutputItem {
|
|
||||||
+OutputItem(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int i2c_address, int data_pin_address, std::string name)
|
|
||||||
+~OutputItem()
|
|
||||||
#data_pin_address : int
|
|
||||||
#i2c_address : int
|
|
||||||
#output_gpio_interface : std::shared_ptr<utility::IOutputGPIOInterface>
|
|
||||||
#name : std::string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
class Solenoid {
|
|
||||||
+Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> 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<void>
|
|
||||||
-activate() : void
|
|
||||||
-deactivate() : void
|
|
||||||
-deactivate_after_wait() : void
|
|
||||||
+trigger() : void
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
class Sound {
|
|
||||||
+Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int i2c_address, int data_pin, std::string name)
|
|
||||||
+~Sound()
|
|
||||||
+play() : void
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,11 +148,6 @@ namespace flippR_driver::utility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
IDisplay <|-- Display
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
namespace flippR_driver::output {
|
||||||
IDisplayController <|-- DisplayController
|
IDisplayController <|-- DisplayController
|
||||||
}
|
}
|
||||||
@@ -279,87 +158,14 @@ namespace flippR_driver::utility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
ILamp <|-- Lamp
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
IOutputDriver <|-- OutputDriver
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
IOutputItem <|-- OutputItem
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
ISolenoid <|-- Solenoid
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
ISound <|-- Sound
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
OutputItem <|-- Lamp
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
OutputItem <|-- Solenoid
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
OutputItem <|-- Sound
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/' Aggregation relationships '/
|
/' Aggregation relationships '/
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
DisplayController "2" o-- IDisplay
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
flippR_driver::output.DisplayController o-- flippR_driver::utility.IOutputGPIOInterface
|
flippR_driver::output.DisplayController o-- flippR_driver::utility.IOutputGPIOInterface
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
OutputDriver "2" o-- IDisplay
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
OutputDriver o-- ILamp
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
OutputDriver o-- ISolenoid
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::output {
|
|
||||||
OutputDriver o-- ISound
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace flippR_driver::utility {
|
|
||||||
OutputGPIOInterface o-- IBlockingQueue
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
flippR_driver::output.OutputItem o-- flippR_driver::utility.IOutputGPIOInterface
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@enduml
|
@enduml
|
||||||
|
|||||||
Reference in New Issue
Block a user