Merge branch 'master' of https://github.com/swinginbird/flippr-code
This commit is contained in:
@@ -11,10 +11,9 @@ namespace flippR_driver::output::items {
|
||||
+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
|
||||
+get_content() : std::vector<char>
|
||||
+write_content(std::array<char, DigitCount> content) : void
|
||||
+write_score(int score) : void
|
||||
}
|
||||
@@ -23,10 +22,10 @@ namespace flippR_driver::output::items {
|
||||
|
||||
namespace flippR_driver::output {
|
||||
class DisplayController {
|
||||
+DisplayController(std::vector<std::shared_ptr<items::IDisplay> > displays, std::shared_ptr<utility::IOutputGPIOInterface> gpio_interface)
|
||||
+DisplayController(std::vector<std::shared_ptr<items::IDisplay> > displays, std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface)
|
||||
+~DisplayController()
|
||||
-is_running : bool
|
||||
-gpio_interface : std::shared_ptr<utility::IOutputGPIOInterface>
|
||||
-output_gpio_interface : std::shared_ptr<utility::IOutputGPIOInterface>
|
||||
-display_cycle_thread : std::thread
|
||||
-displays : std::vector<std::shared_ptr<items::IDisplay> >
|
||||
-cycle_displays() : void
|
||||
@@ -46,11 +45,12 @@ namespace flippR_driver::utility {
|
||||
class GPIOInterface {
|
||||
+GPIOInterface()
|
||||
+~GPIOInterface()
|
||||
+{static} read_pin(char address) : bool
|
||||
#{static} read_pin(char address) : bool
|
||||
+{static} GPIO_LIB_INITIALIZED : static std::once_flag
|
||||
+{static} initialize_input_pin(char address) : void
|
||||
+{static} initialize_output_pin(char address) : void
|
||||
+{static} write_pin(char address, char data) : void
|
||||
-pin_base : unsigned int
|
||||
#{static} initialize_input_pin(char address) : void
|
||||
#{static} initialize_output_pin(char address) : void
|
||||
#{static} write_pin(char address, char data) : void
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace flippR_driver::output::items {
|
||||
abstract class IDisplay {
|
||||
+IDisplay()
|
||||
+~IDisplay()
|
||||
+{abstract} getID() : int
|
||||
+{abstract} get_content() : std::vector<char>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,13 @@ namespace flippR_driver::output {
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
class IDriverBoardItem {
|
||||
+~IDriverBoardItem()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::utility {
|
||||
abstract class IInputGPIOInterface {
|
||||
+~IInputGPIOInterface()
|
||||
@@ -89,29 +96,35 @@ namespace flippR_driver::utility {
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
abstract class IItem {
|
||||
+~IItem()
|
||||
+{abstract} get_address() : uint8_t
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::utility {
|
||||
class IOutputGPIOInterface {
|
||||
+activate_output_item(output::items::IOutputItem* item) : 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
|
||||
+set_address(int i2c_address, int address) : void
|
||||
abstract class IOutputGPIOInterface {
|
||||
+~IOutputGPIOInterface()
|
||||
+{abstract} activate(output::items::IDriverBoardItem* driver_board_item) : void
|
||||
+{abstract} activate(output::items::ISoundItem* sound) : void
|
||||
+{abstract} deactivate(output::items::IDriverBoardItem* driver_board_item) : void
|
||||
+{abstract} deactivate(output::items::ISoundItem* sound) : void
|
||||
+{abstract} write_display(std::shared_ptr<output::items::IDisplay> display) : void
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
abstract class IOutputItem {
|
||||
+~IOutputItem()
|
||||
+{abstract} activate() : void
|
||||
+{abstract} deactivate() : void
|
||||
class ISoundItem {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::utility {
|
||||
class InputGPIOInterface {
|
||||
+InputGPIOInterface(std::istream& input_config_stream)
|
||||
+InputGPIOInterface(std::istream& input_config)
|
||||
+read_data(char pin) : bool
|
||||
-col_address_A : char
|
||||
-col_address_B : char
|
||||
@@ -128,9 +141,30 @@ namespace flippR_driver::utility {
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::utility {
|
||||
class InputSocketHandler {
|
||||
+InputSocketHandler(boost::asio::io_service& service, std::string socket_file)
|
||||
-serialize_event(input::Event& event) : nlohmann::json
|
||||
+handle(input::Event& event) : void
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
class Item {
|
||||
+Item(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name)
|
||||
+~Item()
|
||||
#gpio_interface : const std::shared_ptr<utility::IOutputGPIOInterface>
|
||||
#name : const std::string
|
||||
#address : const uint8_t
|
||||
+get_address() : uint8_t
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
class Lamp {
|
||||
+Lamp(std::shared_ptr<utility::IOutputGPIOInterface> gpio_interface, unsigned int address, unsigned int i2c_address, unsigned int data_pin, std::string name)
|
||||
+Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name)
|
||||
+~Lamp()
|
||||
-activated : bool
|
||||
+is_activated() : bool
|
||||
@@ -169,33 +203,47 @@ namespace flippR_driver::output {
|
||||
|
||||
namespace flippR_driver::utility {
|
||||
class OutputGPIOInterface {
|
||||
+OutputGPIOInterface(std::istream& output_config_stream)
|
||||
+~OutputGPIOInterface()
|
||||
-pins_display : std::map<std::string, uint8_t>
|
||||
-pins_driver_board : std::map<std::string, uint8_t>
|
||||
-pins_sound : std::map<std::string, uint8_t>
|
||||
-output_item_mutex : std::mutex
|
||||
+activate_output_item(output::items::IOutputItem* item) : void
|
||||
+deactivate_output_item(output::items::IOutputItem* item) : void
|
||||
+write_display(output::items::IDisplay& display) : void
|
||||
+activate(output::items::IDriverBoardItem* driver_board_item) : void
|
||||
+activate(output::items::ISoundItem* sound) : void
|
||||
+deactivate(output::items::IDriverBoardItem* driver_board_item) : void
|
||||
+deactivate(output::items::ISoundItem* sound) : void
|
||||
-fire_sound(bool fire) : void
|
||||
-initialize_all_pins(uint8_t pin_base) : void
|
||||
-initialize_i2c_addresses() : void
|
||||
-initialize_pins() : void
|
||||
-parse_output_config(nlohmann::json& output_config) : void
|
||||
-parse_pins_display(nlohmann::json& display_board_config) : void
|
||||
-parse_pins_driver_board(nlohmann::json& driver_board_config) : void
|
||||
-parse_pins_sound(nlohmann::json& sound_board_config) : 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(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 Item {
|
||||
+Item(std::shared_ptr<utility::IOutputGPIOInterface> gpio_interface, unsigned int address, unsigned int i2c_address, unsigned int data_pin_address, std::string name)
|
||||
+~Item()
|
||||
#gpio_interface : const std::shared_ptr<utility::IOutputGPIOInterface>
|
||||
+name : const std::string
|
||||
+address : const unsigned int
|
||||
+data_pin_address : const unsigned int
|
||||
+i2c_address : const unsigned int
|
||||
#activate() : void
|
||||
#deactivate() : void
|
||||
namespace flippR_driver::utility {
|
||||
class SocketHandler {
|
||||
+SocketHandler(boost::asio::io_service& service, std::string socket_file)
|
||||
#socket : boost::asio::local::stream_protocol::socket
|
||||
#write_to_socket(nlohmann::json& data) : void
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
class Solenoid {
|
||||
+Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> gpio_interface, unsigned int address, unsigned int i2c_address, unsigned int data_pin, std::string name, std::chrono::milliseconds deactivation_time)
|
||||
+Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time)
|
||||
+~Solenoid()
|
||||
-deactivation_time : std::chrono::milliseconds
|
||||
-trigger_task : std::future<void>
|
||||
@@ -207,10 +255,11 @@ namespace flippR_driver::output::items {
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
class Sound {
|
||||
+Sound(std::shared_ptr<utility::IOutputGPIOInterface> gpio_interface, unsigned int address, unsigned int i2c_address, unsigned int data_pin, std::string name, std::chrono::milliseconds deactivation_time)
|
||||
+Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, 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
|
||||
}
|
||||
@@ -242,13 +291,43 @@ namespace flippR_driver::output {
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
IDriverBoardItem <|-- Lamp
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
IDriverBoardItem <|-- Solenoid
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::utility {
|
||||
IInputGPIOInterface <|-- InputGPIOInterface
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
IOutputItem <|-- Item
|
||||
IItem <|-- IDriverBoardItem
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
IItem <|-- ISoundItem
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
IItem <|-- Item
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::utility {
|
||||
IOutputGPIOInterface <|-- OutputGPIOInterface
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::output::items {
|
||||
ISoundItem <|-- Sound
|
||||
}
|
||||
|
||||
|
||||
@@ -267,6 +346,11 @@ namespace flippR_driver::output::items {
|
||||
}
|
||||
|
||||
|
||||
namespace flippR_driver::utility {
|
||||
SocketHandler <|-- InputSocketHandler
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -278,12 +362,12 @@ flippR_driver::output.DisplayController o-- flippR_driver::output::items.IDispla
|
||||
flippR_driver::output.DisplayController o-- flippR_driver::utility.IOutputGPIOInterface
|
||||
|
||||
|
||||
flippR_driver::output.OutputDriver o-- flippR_driver::output::items.IDisplay
|
||||
|
||||
|
||||
flippR_driver::output::items.Item o-- flippR_driver::utility.IOutputGPIOInterface
|
||||
|
||||
|
||||
flippR_driver::output.OutputDriver o-- flippR_driver::output::items.IDisplay
|
||||
|
||||
|
||||
|
||||
|
||||
@enduml
|
||||
|
||||
Reference in New Issue
Block a user