Files
flippr-code/FlippR-Driver/contrib/uml/uml.puml
2018-12-14 01:58:05 +01:00

257 lines
6.7 KiB
Plaintext

@startuml
/' Objects '/
namespace flippR_driver::output::items {
class Display <template<int DigitCount>> {
+Display(int address, int id)
+~Display()
-address : int
+content : std::array<char, DigitCount>
-fit_string(std::string& score_string) : std::string
+get_content() : std::vector<char>
+write_content(std::array<char, DigitCount> content) : void
+write_score(int score) : void
}
}
namespace flippR_driver::output {
class DisplayController {
+DisplayController(std::vector<std::shared_ptr<items::IDisplay> > displays, std::shared_ptr<IOutputGPIOInterface> pin_controller)
+~DisplayController()
-is_running : bool
-pin_controller : std::shared_ptr<IOutputGPIOInterface>
-display_cycle_thread : std::thread
-displays : std::vector<std::shared_ptr<items::IDisplay> >
-cycle_displays() : void
}
}
namespace flippR_driver::output::items {
class DriverBoardItem {
+DriverBoardItem(std::shared_ptr<IOutputGPIOInterface> pin_controller, uint8_t address, std::string name)
+~DriverBoardItem()
}
}
namespace flippR_driver::output::items {
abstract class IDisplay {
+~IDisplay()
+{abstract} get_content() : std::vector<char>
}
}
namespace flippR_driver::output {
class IDisplayController {
+~IDisplayController()
}
}
namespace flippR_driver::output::items {
abstract class IItem {
+~IItem()
+{abstract} get_name() : std::string
+{abstract} get_address() : uint8_t
}
}
namespace flippR_driver::output {
abstract class IOutputGPIOInterface {
+~IOutputGPIOInterface()
+{abstract} activate(items::DriverBoardItem* driver_board_item) : void
+{abstract} activate(items::SoundItem* sound) : void
+{abstract} deactivate(items::DriverBoardItem* driver_board_item) : void
+{abstract} deactivate(items::SoundItem* sound) : void
+{abstract} write_display(std::shared_ptr<output::items::IDisplay> display) : void
}
}
namespace flippR_driver::output::items {
class Item {
+Item(std::shared_ptr<IOutputGPIOInterface> pin_controller, uint8_t address, std::string name)
+~Item()
#gpio_interface : const std::shared_ptr<IOutputGPIOInterface>
#name : const std::string
#address : const uint8_t
+get_name() : std::string
+get_address() : uint8_t
}
}
namespace flippR_driver::output::items {
class Lamp {
+Lamp(std::shared_ptr<IOutputGPIOInterface> pin_controller, uint8_t address, std::string name)
+~Lamp()
-activated : bool
+is_activated() : bool
+activate() : void
+deactivate() : void
}
}
namespace flippR_driver::output {
class OutputDriver {
+OutputDriver(std::map<std::string, std::shared_ptr<items::ISolenoid> > solenoids, std::map<std::string, std::shared_ptr<items::ILamp> > lamps, std::map<std::string, std::shared_ptr<items::ISound> > sounds, std::map<char, std::shared_ptr<items::IDisplay> > displays)
+~OutputDriver()
+get_display(char number) : boost::optional<std::shared_ptr<items::IDisplay> >
+get_lamp(std::string name) : boost::optional<std::shared_ptr<items::ILamp> >
+get_solenoid(std::string name) : boost::optional<std::shared_ptr<items::ISolenoid> >
+get_sound(std::string name) : boost::optional<std::shared_ptr<items::ISound> >
-displays : const std::map<char, std::shared_ptr<items::IDisplay> >
-lamps : const std::map<std::string, std::shared_ptr<items::ILamp> >
-solenoids : const std::map<std::string, std::shared_ptr<items::ISolenoid> >
-sounds : const std::map<std::string, std::shared_ptr<items::ISound> >
+get_displays() : std::vector<std::shared_ptr<items::IDisplay> >
+get_lamps() : std::vector<std::shared_ptr<items::ILamp> >
+get_solenoids() : std::vector<std::shared_ptr<items::ISolenoid> >
+get_sounds() : std::vector<std::shared_ptr<items::ISound> >
}
}
namespace flippR_driver::output {
class OutputGPIOInterface {
+OutputGPIOInterface(std::map<std::string, uint8_t> pins_driver_board, std::map<std::string, uint8_t> pins_sound, std::map<std::string, uint8_t> pins_display)
+~OutputGPIOInterface()
-pins_display : const std::map<std::string, uint8_t>
-pins_driver_board : const std::map<std::string, uint8_t>
-pins_sound : const std::map<std::string, uint8_t>
-output_item_mutex : std::mutex
+activate(items::DriverBoardItem* driver_board_item) : void
+activate(items::SoundItem* sound) : void
+deactivate(items::DriverBoardItem* driver_board_item) : void
+deactivate(items::SoundItem* sound) : void
-fire_sound(bool fire) : void
-initialize_all_pins(uint8_t pin_base) : void
-initialize_i2c_addresses() : void
-initialize_pins() : void
-select_latch(uint8_t latch) : void
-select_mux(uint8_t latch) : void
-select_pin(uint8_t pin) : void
-write_data(bool data) : void
+write_display(std::shared_ptr<output::items::IDisplay> display) : void
-write_driver_board_address(uint8_t address) : void
-write_sound_address(uint8_t address) : void
}
}
namespace flippR_driver::output::items {
class Solenoid {
+Solenoid(std::shared_ptr<IOutputGPIOInterface> pin_controller, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time)
+~Solenoid()
-deactivation_time : std::chrono::milliseconds
-trigger_task : std::future<void>
+trigger() : void
-triggerTask() : void
}
}
namespace flippR_driver::output::items {
class Sound {
+Sound(std::shared_ptr<IOutputGPIOInterface> pin_controller, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id)
+~Sound()
-deactivation_time : std::chrono::milliseconds
-play_task : std::future<void>
+id : u_int
+play() : void
-playTask() : void
}
}
namespace flippR_driver::output::items {
class SoundItem {
+SoundItem(std::shared_ptr<IOutputGPIOInterface> pin_controller, uint8_t address, std::string name)
+~SoundItem()
}
}
/' Inheritance relationships '/
namespace flippR_driver::output::items {
DriverBoardItem <|-- Lamp
}
namespace flippR_driver::output::items {
DriverBoardItem <|-- Solenoid
}
namespace flippR_driver::output::items {
IDisplay <|-- Display
}
namespace flippR_driver::output {
IDisplayController <|-- DisplayController
}
namespace flippR_driver::output::items {
IItem <|-- Item
}
namespace flippR_driver::output {
IOutputGPIOInterface <|-- OutputGPIOInterface
}
namespace flippR_driver::output::items {
Item <|-- DriverBoardItem
}
namespace flippR_driver::output::items {
Item <|-- SoundItem
}
namespace flippR_driver::output::items {
SoundItem <|-- Sound
}
/' Aggregation relationships '/
flippR_driver::output.DisplayController o-- flippR_driver::output::items.IDisplay
namespace flippR_driver::output {
DisplayController o-- IOutputGPIOInterface
}
flippR_driver::output::items.Item o-- flippR_driver::output.IOutputGPIOInterface
flippR_driver::output.OutputDriver o-- flippR_driver::output::items.IDisplay
@enduml