Skip to content

Commit

Permalink
started outlining the things needed for a new component and controlle…
Browse files Browse the repository at this point in the history
…r example
  • Loading branch information
SwindleA committed Sep 28, 2023
1 parent 3401707 commit 560b6e9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.opensourcewithslu.components.controllers;

import com.opensourcewithslu.inputdevices.ExamplHelper;
import com.opensourcewithslu.outputdevices.LEDHelper;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;

//tag::ex[]
@Controller("/example")
public class ExampleController {
private final PushButtonHelper pushButtonHelper;


public ExampleController(ExamplHelper exampleHelper) {
this.exampleHelper = exampleHelper;
}

@Get("/init")
public void initController(){
exampleHelper.addEventListener(e ->{
/*Some action */
});
}
}
//end::ex[]
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
=== How to Create a New Component
[.text-right]
https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc[Improve this doc]

TODO: add info on how to add a new component

TODO: add info on how to add a new component
* controller
** controls the component
** `components\src\main\java\com\opensourcewithslu\components\controllers`
include::exampleController.java[tag=ex]


* helper
** where all the actions are defined.
** `micronautpi4j-utils\src\main\java\com\opensourcewithslu`
* 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 changes: 2 additions & 0 deletions micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc[Improve this doc]

TODO: outline how someone can contribute to our library

include::contribute/newComponent.adoc[]

0 comments on commit 560b6e9

Please sign in to comment.