From ef4eb3006da80084d7841b726e4d51c7886f77f4 Mon Sep 17 00:00:00 2001 From: Adrian Swindle Date: Mon, 2 Oct 2023 10:33:12 -0500 Subject: [PATCH] outline of how to add new component The outline is more clean than before but still lacks precise information. Will need to double check if all the appropriate steps are there and get the specific information. --- .../asciidoc/contribute/newComponent.adoc | 40 +++++++++++-------- .../src/docs/asciidoc/howContribute.adoc | 4 ++ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc b/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc index e6365ee2..2344905c 100644 --- a/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc +++ b/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc @@ -4,32 +4,38 @@ https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/doc TODO: add info on how to add a new component -NOTE: helper and controller are just micronaut framework practices, might not need to include exact details, may just reference a user to the micronaut documentation. +If its compatible with a Raspberry Pi then it should work well with the Pi4Micronaut framework. The following steps should encompass how most components are added to the framework, but should more or different steps be needed, use the +https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc[Improve this doc] link to suggest changes. -* controller -** controls the component -** `components\src\main\java\com\opensourcewithslu\components\controllers` -include::exampleController.java[tag=ex] +TODO: helper and controller are just micronaut framework practices, might not need to include exact details, may just reference a user to the micronaut documentation. -* helper -** where all the actions are defined. -** `micronautpi4j-utils\src\main\java\com\opensourcewithslu` +1. Determine if the device is Input or Output: +** (TODO: find better definition of what an input device is)input devices main task is taking in information +** (TODO: find better definition of what an output device is) output devices display or output information -* input versus output device -** input devices main task is taking in information -*** `micronautpi4j-utils\src\main\java\com\opensourcewithslu\inputdevices` -** output devices display or output information -*** `micronautpi4j-utils\src\main\java\com\opensourcewithslu\outputdevices` +2. Create a Controller: +** TODO: define what a controller is and reference the Micronaut documentation +** (TODO: better describe the code base structure) + Where the controllers go: +`components\src\main\java\com\opensourcewithslu\components\controllers` +//include::exampleController.java[tag=ex] +3. Create a Helper: +** TODO: define what a helper does and reference the micronaut documentation +** (TODO: better describe the code base structure) + Where the helpers go: `micronautpi4j-utils\src\main\java\com\opensourcewithslu`\ (inputdevices or outputdevices) +4. Add Component to the Application yml + ** TODO: explain the purpose of the yml file and what parameters each component will need to have, it will presumably be different for each component type. -## Adding components to the application yml + ** Each component will need to be added to the application yml found at `components\src\main\resources\application.yml`. -TODO: explain the purpose of the yml file and what parameters each component will need to have, it will presumably be different for each component type. - -Each component will need to be added to the application yml found at `components\src\main\resources\application.yml`. \ No newline at end of file +5. Thoroughly test: + ** Contributors should thoroughly test their integrations + ** When submitting a pull request, make sure to include the circuit setup you used and the steps you took to setup the example that you used for testing. + ** It is important that reviewers are able to replicated your work in order to properly test the implementation. \ No newline at end of file diff --git a/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc b/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc index 2e8288f2..c33e5f2c 100644 --- a/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc +++ b/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc @@ -4,4 +4,8 @@ https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/doc TODO: outline how someone can contribute to our library +There are several ways to contribute to the Pi4Micronaut framework, such as, suggesting changes to the code or documentation, bug fixes, or adding new components. Familiarity with the Micronaut framework will greatly help potential contributors understanding of how the code base works or how to implement new components. If help is needed with Micronaut related issues, reference the https://micronaut-projects.github.io/micronaut-docs-mn3/3.8.1/guide/[Micronaut Documentation] and the https://github.com/micronaut-projects/micronaut-core[Micronaut GitHub]. + + + include::contribute/newComponent.adoc[] \ No newline at end of file