Skip to content

Commit

Permalink
Add Design.md and component diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
nkh-lab committed Apr 24, 2023
1 parent 5b455be commit 55efe73
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# Folders
build/
out/
temp/

# VisualStudioCode #
Expand Down
2 changes: 2 additions & 0 deletions doc/Contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[Intro page](../README.md)

[Design](Design.md)

[GUI Application](GUI.md)

[Troubleshooting](Troubleshooting.md)
Expand Down
5 changes: 5 additions & 0 deletions doc/Design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Component diagram
![](diagrams/component-diagram.svg)

---
Go to [Contents](Contents.md)
75 changes: 75 additions & 0 deletions doc/diagrams/component-diagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@startuml

package "USB Relay Module" as package_usb_relay_module {

package "CLI Apps" as package_cli_apps {
component getrelay #LightGreen
component setrelay #LightGreen
}

package "GUI App" as package_gui_app {
component relaybox #LightGreen
}

component libusbrelaymodule #LightGreen
}

package "Utils" as package_utils {
component libcpputils #LightGreen
component liblightargparser #LightGreen
component logger #LightGreen
component jsoncpp

libcpputils -[hidden]d-> liblightargparser
liblightargparser -[hidden]d-> logger
logger -[hidden]d-> jsoncpp
}

package "hidapi" as package_hidapi {
component "libhidapi-hidraw" as libhidapi_hidraw
component hidapi
}


package "Windows OS" {
component hid
}

package "Linux OS" {
component libudev
}

node "USB Relay" as relay {
port channel1
port channel2
port channelN
}

interface USB

package_usb_relay_module --> package_utils : uses

getrelay -d-> libusbrelaymodule : uses

setrelay -d-> libusbrelaymodule : uses
relaybox -d-> libusbrelaymodule : uses

libusbrelaymodule -d-> libhidapi_hidraw : uses\n if Linux OS
libusbrelaymodule -d-> hidapi : uses\n if Windows OS

hidapi -d-> hid : uses

libhidapi_hidraw -d-> libudev : uses

hid -d-( USB
libudev -d-( USB

relay -u-( USB

legend left
Legend
| Symbol | Meaning |
|<#LightGreen>| nkh-lab components |
endlegend

@enduml
Loading

0 comments on commit 55efe73

Please sign in to comment.