From 6daf70df84bf41cf5de178377e2c8785f4490dbc Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Tue, 27 Mar 2018 03:04:06 +0100 Subject: [PATCH 1/6] Add page and diagram --- content/codebase/robotd.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 content/codebase/robotd.md diff --git a/content/codebase/robotd.md b/content/codebase/robotd.md new file mode 100644 index 0000000..a55af70 --- /dev/null +++ b/content/codebase/robotd.md @@ -0,0 +1,27 @@ +--- +title: RobotD +--- + +Introductory sentence here. + +{{}} +graph TB +subgraph "" +BoardMeta --> Board +Board --> Camera +Board --> Motor +Board --> Servo +Board --> Game +Board --> Power +end +subgraph "" +MasterProcess -.-> BoardRunner +BoardRunner -.-> Connection +BoardRunner -.-> Board +end + +click BoardMeta "#BoardMeta" "More Info about BoardMeta" +{{}} + +## BoardMeta +Yes, this is a metaclass From 45048e6de0aea47151d5f21c471b1e3677f6ecbd Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Thu, 29 Mar 2018 16:02:09 +0100 Subject: [PATCH 2/6] Add more information about Robotd --- content/codebase/robotd.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/content/codebase/robotd.md b/content/codebase/robotd.md index a55af70..000a3ed 100644 --- a/content/codebase/robotd.md +++ b/content/codebase/robotd.md @@ -2,7 +2,13 @@ title: RobotD --- -Introductory sentence here. +RobotD runs a master process which motors for robot peripherals. For each peripheral it finds, it opens a UNIX seqpacket socket in `/var/robotd//`. + +You can find out more about how to use it at the GitHub page: {{< github "sourcebots/robotd" >}}. + +This page details information about how the code works that is beyond the scope of the README file. The information is not guarenteed to be completely up to date, but is intended to give a general overview of the structure and workings of the module. + +## Diagram of RobotD {{}} graph TB @@ -19,9 +25,26 @@ MasterProcess -.-> BoardRunner BoardRunner -.-> Connection BoardRunner -.-> Board end - -click BoardMeta "#BoardMeta" "More Info about BoardMeta" {{}} +This diagram represents a simplified structure of the classes inside robotD and how they interact with each other. More information on the individual classes can be found below. + ## BoardMeta -Yes, this is a metaclass +| Class: | BoardMeta | +| -------------- | ----------------- | +| Inherits From: | `type` | +| Subclasses: | `Board` | +| File: | `devices_base.py` | + +This is a [MetaClass](Some Python Docs) that manages the creation of Boards. + +It creates a list of all boards that have been defined in `BoardMeta.BOARDS`. + +## Board + +| Class: | Board | +| -------------- | ----------------- | +| Inherits From: | `object` | +| Subclasses: | `Lots of Boards` | +| File: | `devices_base.py` | + From 261883693622d29c7ab7abe0e1ddd6206e2988b5 Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Thu, 29 Mar 2018 16:03:48 +0100 Subject: [PATCH 3/6] Clean up Codebase Index --- content/codebase/_index.md | 104 ++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/content/codebase/_index.md b/content/codebase/_index.md index f29d750..83156ae 100644 --- a/content/codebase/_index.md +++ b/content/codebase/_index.md @@ -11,71 +11,71 @@ This page contains a summary of the repositories on [GitHub][sb-github]. ## Administration -| Name | GitHub Repository | More Info | -| ------------------------ | ---------------------------------------------------- | ---------- | -| bunfight-form | {{< github "sourcebots/bunfight-form" >}} | | -| compstate-smallpeice2017 | {{< github "sourcebots/compstate-smallpeice2017" >}} | | -| emails | {{< github "sourcebots/emails" >}} | | -| media-consent | {{< github "sourcebots/media-consent" >}} | | -| minutes | {{< github "sourcebots/minutes" >}} | | -| mixtape-smallpeice2017 | {{< github "sourcebots/mixtape-smallpeice2017" >}} | | -| sb-techday | {{< github "sourcebots/sb-techday" >}} | | -| sb2018-game-presentation | {{< github "sourcebots/sb2018-game-presentation" >}} | | -| sb2018-rules | {{< github "sourcebots/sb2018-rules" >}} | | -| wiki | {{< github "sourcebots/wiki" >}} | | +| Name | GitHub Repository | +| ------------------------ | ---------------------------------------------------- | +| bunfight-form | {{< github "sourcebots/bunfight-form" >}} | +| compstate-smallpeice2017 | {{< github "sourcebots/compstate-smallpeice2017" >}} | +| emails | {{< github "sourcebots/emails" >}} | +| media-consent | {{< github "sourcebots/media-consent" >}} | +| minutes | {{< github "sourcebots/minutes" >}} | +| mixtape-smallpeice2017 | {{< github "sourcebots/mixtape-smallpeice2017" >}} | +| sb-techday | {{< github "sourcebots/sb-techday" >}} | +| sb2018-game-presentation | {{< github "sourcebots/sb2018-game-presentation" >}} | +| sb2018-rules | {{< github "sourcebots/sb2018-rules" >}} | +| wiki | {{< github "sourcebots/wiki" >}} | ## Hardware -| Name | GitHub Repository | More Info | -| ----------- | --------------------------------------- | --------- | -| motor-v4-hw | {{< github "sourcebots/motor-v4-hw" >}} | | -| pcbmedals | {{< github "sourcebots/pcbmedals" >}} | | -| pkg | {{< github "sourcebots/pkg" >}} | | -| power-v4-hw | {{< github "sourcebots/power-v4-hw" >}} | | -| sym | {{< github "sourcebots/sym" >}} | | +| Name | GitHub Repository | +| ----------- | --------------------------------------- | +| motor-v4-hw | {{< github "sourcebots/motor-v4-hw" >}} | +| pcbmedals | {{< github "sourcebots/pcbmedals" >}} | +| pkg | {{< github "sourcebots/pkg" >}} | +| power-v4-hw | {{< github "sourcebots/power-v4-hw" >}} | +| sym | {{< github "sourcebots/sym" >}} | ## Media -| Name | GitHub Repository | More Info | -| -------------- | ------------------------------------------ | --------- | -| art | {{< github "sourcebots/art" >}} | | -| docs | {{< github "sourcebots/docs" >}} | | -| Mainroad | {{< github "sourcebots/Mainroad" >}} | | -| volunteer-docs | {{< github "sourcebots/volunteer-docs" >}} | | +| Name | GitHub Repository | +| -------------- | ------------------------------------------ | +| art | {{< github "sourcebots/art" >}} | +| docs | {{< github "sourcebots/docs" >}} | +| Mainroad | {{< github "sourcebots/Mainroad" >}} | +| volunteer-docs | {{< github "sourcebots/volunteer-docs" >}} | ## Misc -| Name | GitHub Repository | More Info | -| ----------------- | --------------------------------------------- | --------- | -| blocklyscienceday | {{< github "sourcebots/blocklyscienceday" >}} | | -| testing-repo | {{< github "sourcebots/testing-repo" >}} | | +| Name | GitHub Repository | +| ----------------- | --------------------------------------------- | +| blocklyscienceday | {{< github "sourcebots/blocklyscienceday" >}} | +| testing-repo | {{< github "sourcebots/testing-repo" >}} | ## Robot Code -| Module Name | GitHub Repository | Presentation | More Info | -| -------------- | ------------------------------------------ | ------------ | --------- | -| dfu-bootloader | {{< github "sourcebots/dfu-bootloader" >}} | | | -| motor-v4-fw | {{< github "sourcebots/motor-v4-fw" >}} | | | -| pi-image | {{< github "sourcebots/pi-image" >}} | | | -| powerman | {{< github "sourcebots/powerman" >}} | | | -| power-v4-fw | {{< github "sourcebots/power-v4-fw" >}} | | | -| robot-api | {{< github "sourcebots/robot-api" >}} | | | -| robotd | {{< github "sourcebots/robotd" >}} | | | -| runusb | {{< github "sourcebots/runusb" >}} | | | -| sb-vision | {{< github "sourcebots/sb-vision" >}} | | | -| servo-firmware | {{< github "sourcebots/servo-firmware" >}} | | | -| simulator | {{< github "sourcebots/simulator" >}} | | | -| zone-script | {{< github "sourcebots/zone-script" >}} | | | +| Module Name | GitHub Repository | Presentation | +| -------------- | ------------------------------------------ | ------------ | +| dfu-bootloader | {{< github "sourcebots/dfu-bootloader" >}} | | +| motor-v4-fw | {{< github "sourcebots/motor-v4-fw" >}} | | +| pi-image | {{< github "sourcebots/pi-image" >}} | | +| powerman | {{< github "sourcebots/powerman" >}} | | +| power-v4-fw | {{< github "sourcebots/power-v4-fw" >}} | | +| robot-api | {{< github "sourcebots/robot-api" >}} | | +| robotd | {{< github "sourcebots/robotd" >}} | | +| runusb | {{< github "sourcebots/runusb" >}} | | +| sb-vision | {{< github "sourcebots/sb-vision" >}} | | +| servo-firmware | {{< github "sourcebots/servo-firmware" >}} | | +| simulator | {{< github "sourcebots/simulator" >}} | | +| zone-script | {{< github "sourcebots/zone-script" >}} | | ## Utilities -| Name | GitHub Repository | More Info | -| ------------- | ----------------------------------------- | --------- | -| Arturo | {{< github "sourcebots/Arturo" >}} | | -| barcode-gen | {{< github "sourcebots/barcode-gen" >}} | | -| kit-testing | {{< github "sourcebots/kit-testing" >}} | | -| marker-to-pdf | {{< github "sourcebots/marker-to-pdf" >}} | | -| pcb-util | {{< github "sourcebots/pcb-util" >}} | | -| srcomp-kiosk | {{< github "sourcebots/srcomp-kiosk" >}} | | -| tools | {{< github "sourcebots/tools" >}} | | +| Name | GitHub Repository | +| ------------- | ----------------------------------------- | +| Arturo | {{< github "sourcebots/Arturo" >}} | +| barcode-gen | {{< github "sourcebots/barcode-gen" >}} | +| kit-testing | {{< github "sourcebots/kit-testing" >}} | +| marker-to-pdf | {{< github "sourcebots/marker-to-pdf" >}} | +| pcb-util | {{< github "sourcebots/pcb-util" >}} | +| srcomp-kiosk | {{< github "sourcebots/srcomp-kiosk" >}} | +| tools | {{< github "sourcebots/tools" >}} | [sb-github]: https://github.com/sourcebots From da2220b3cf6aecde030a2a1738ef465a15d708c9 Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Fri, 30 Mar 2018 19:45:13 +0100 Subject: [PATCH 4/6] Add some info on the classes --- content/codebase/robotd.md | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/content/codebase/robotd.md b/content/codebase/robotd.md index 000a3ed..f57cb82 100644 --- a/content/codebase/robotd.md +++ b/content/codebase/robotd.md @@ -2,11 +2,13 @@ title: RobotD --- -RobotD runs a master process which motors for robot peripherals. For each peripheral it finds, it opens a UNIX seqpacket socket in `/var/robotd//`. +{{% notice info %}} +This page details information about how the code works that is beyond the scope of the README file. The information is not guarenteed to be completely up to date, but is intended to give a general overview of the structure and workings of the module. +{{% /notice %}} -You can find out more about how to use it at the GitHub page: {{< github "sourcebots/robotd" >}}. +RobotD runs a master process which monitors for robot peripherals. For each peripheral it finds, it opens a [UNIX seqpacket socket](Link to info about unix sockets) in `/var/robotd//`. -This page details information about how the code works that is beyond the scope of the README file. The information is not guarenteed to be completely up to date, but is intended to give a general overview of the structure and workings of the module. +You can find out more about how to use it at the GitHub page: {{< github "sourcebots/robotd" >}}. ## Diagram of RobotD @@ -29,7 +31,10 @@ end This diagram represents a simplified structure of the classes inside robotD and how they interact with each other. More information on the individual classes can be found below. -## BoardMeta +## Classes + +### BoardMeta + | Class: | BoardMeta | | -------------- | ----------------- | | Inherits From: | `type` | @@ -40,7 +45,7 @@ This is a [MetaClass](Some Python Docs) that manages the creation of Boards. It creates a list of all boards that have been defined in `BoardMeta.BOARDS`. -## Board +### Board | Class: | Board | | -------------- | ----------------- | @@ -48,3 +53,15 @@ It creates a list of all boards that have been defined in `BoardMeta.BOARDS`. | Subclasses: | `Lots of Boards` | | File: | `devices_base.py` | +This class defines a generic device with empty methods. Subclasses of `Board` define how to detect these boards and how to interact with them. It is created using a MetaClass: `BoardMeta`. + +It is worth noting that `Board` is likely to be renamed in the future as not all peripherals are boards + +### Connection + +| Class: | Connection | +| -------------- | ----------- | +| Inherits From: | `object` | +| File: | `master.py` | + +This class provides an abstraction around the socket such that `robot-api` can communicate with the `Board` classes using \ No newline at end of file From d49e910777529a48d6d756516a6d01633f4e1642 Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Fri, 30 Mar 2018 21:00:24 +0100 Subject: [PATCH 5/6] Add class info generator --- content/codebase/robotd.md | 33 +------------------------ data/codebase/robotd.yml | 20 +++++++++++++++ layouts/shortcodes/display_classes.html | 28 +++++++++++++++++++++ 3 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 data/codebase/robotd.yml create mode 100644 layouts/shortcodes/display_classes.html diff --git a/content/codebase/robotd.md b/content/codebase/robotd.md index f57cb82..3a6186e 100644 --- a/content/codebase/robotd.md +++ b/content/codebase/robotd.md @@ -33,35 +33,4 @@ This diagram represents a simplified structure of the classes inside robotD and ## Classes -### BoardMeta - -| Class: | BoardMeta | -| -------------- | ----------------- | -| Inherits From: | `type` | -| Subclasses: | `Board` | -| File: | `devices_base.py` | - -This is a [MetaClass](Some Python Docs) that manages the creation of Boards. - -It creates a list of all boards that have been defined in `BoardMeta.BOARDS`. - -### Board - -| Class: | Board | -| -------------- | ----------------- | -| Inherits From: | `object` | -| Subclasses: | `Lots of Boards` | -| File: | `devices_base.py` | - -This class defines a generic device with empty methods. Subclasses of `Board` define how to detect these boards and how to interact with them. It is created using a MetaClass: `BoardMeta`. - -It is worth noting that `Board` is likely to be renamed in the future as not all peripherals are boards - -### Connection - -| Class: | Connection | -| -------------- | ----------- | -| Inherits From: | `object` | -| File: | `master.py` | - -This class provides an abstraction around the socket such that `robot-api` can communicate with the `Board` classes using \ No newline at end of file +{{% display_classes "robotd" %}} diff --git a/data/codebase/robotd.yml b/data/codebase/robotd.yml new file mode 100644 index 0000000..796b56e --- /dev/null +++ b/data/codebase/robotd.yml @@ -0,0 +1,20 @@ +classes: + - class: + name: BoardMeta + file: devices_base.py + inherits: type + subclasses: + - Board + description: This is a [MetaClass](Some Python Docs) that manages the creation of Boards. It creates a list of all boards that have been defined in `BoardMeta.BOARDS`. + - class: + name: Board + file: devices_base.py + subclasses: + - Camera + - MotorBoard + - etc + description: This class defines a generic device with empty methods. Subclasses of `Board` define how to detect these boards and how to interact with them. It is created using a MetaClass `BoardMeta`. It is worth noting that `Board` is likely to be renamed in the future as not all peripherals are boards + - class: + name: Connection + file: master.py + description: This class provides an abstraction around the socket such that `robot-api` can communicate with the `Board` classes using diff --git a/layouts/shortcodes/display_classes.html b/layouts/shortcodes/display_classes.html new file mode 100644 index 0000000..0c6698e --- /dev/null +++ b/layouts/shortcodes/display_classes.html @@ -0,0 +1,28 @@ +{{ with (index .Site.Data.codebase (.Get 0)) }} + {{ range .classes }} +

{{ .class.name }}

+ + + + + + {{ if isset .class "inherits" }} + + + + + {{ end }} + {{ if isset .class "subclasses" }} + + + + + {{ end }} +
File:{{ .class.file }}
Inherits From:{{ .class.inherits }}
Subclasses: + {{ range .class.subclasses }} + {{ . }}  + {{ end }} +
+

{{ .class.description | markdownify | safeHTML }}

+ {{ end }} +{{ end }} From ac6f4bb8fb64f6099613085ac60895fccf1758d5 Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Fri, 30 Mar 2018 21:15:55 +0100 Subject: [PATCH 6/6] Correct some spelling --- .spelling | 5 +++++ content/codebase/robotd.md | 4 ++-- data/codebase/robotd.yml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.spelling b/.spelling index c564e52..065d632 100644 --- a/.spelling +++ b/.spelling @@ -1,11 +1,14 @@ 6pm blocklyscienceday +BoardMeta +BoardRunner CircleCI compstate-smallpeice2017 dfu-bootloader dropdown GitHub Mainroad +MasterProcess mixtape-smallpeice2017 motor-v4-fw motor-v4-hw @@ -23,6 +26,8 @@ sb2018-game-presentation sb2018-rules sb-techday sb-vision +seqpacket SourceBots srcomp-kiosk +subgraph sym diff --git a/content/codebase/robotd.md b/content/codebase/robotd.md index 3a6186e..ad79e5b 100644 --- a/content/codebase/robotd.md +++ b/content/codebase/robotd.md @@ -3,10 +3,10 @@ title: RobotD --- {{% notice info %}} -This page details information about how the code works that is beyond the scope of the README file. The information is not guarenteed to be completely up to date, but is intended to give a general overview of the structure and workings of the module. +This page details information about how the code works that is beyond the scope of the README file. The information is not guaranteed to be completely up to date, but is intended to give a general overview of the structure and workings of the module. {{% /notice %}} -RobotD runs a master process which monitors for robot peripherals. For each peripheral it finds, it opens a [UNIX seqpacket socket](Link to info about unix sockets) in `/var/robotd//`. +RobotD runs a master process which monitors for robot peripherals. For each peripheral it finds, it opens a UNIX seqpacket socket in `/var/robotd//`. You can find out more about how to use it at the GitHub page: {{< github "sourcebots/robotd" >}}. diff --git a/data/codebase/robotd.yml b/data/codebase/robotd.yml index 796b56e..aaba61d 100644 --- a/data/codebase/robotd.yml +++ b/data/codebase/robotd.yml @@ -5,7 +5,7 @@ classes: inherits: type subclasses: - Board - description: This is a [MetaClass](Some Python Docs) that manages the creation of Boards. It creates a list of all boards that have been defined in `BoardMeta.BOARDS`. + description: This is a MetaClass that manages the creation of Boards. It creates a list of all boards that have been defined in `BoardMeta.BOARDS`. - class: name: Board file: devices_base.py