|
|
Here, I'll walk you through the java source code, responsible for starting the Light Controller. Additional startup procedures are explained in the documentation for the start_component.sh and the run_demo.sh scripts.
|
|
|
Here, I'll walk you through the java source code, responsible for starting the Light Controller. Additional startup procedures are explained in the documentation for the [`start_component.sh`](implementation/start_component.sh) and the [`run_demo.sh`](implementation/run_demo.sh) scripts.
|
|
|
|
|
|
We'll skip the license headers, imports and comments, as they are either pretty much self explanatory or not the product of conscious development effort.
|
|
|
|
|
|
# ILightController
|
|
|
|
|
|
The discussed file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/6d65d24412bda2e555e70a4f9581eb142096bd49/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/ILightController.java)
|
|
|
The discussed file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/64e67bdaae14ef6945ab3e73b5a9c70c9c1ced67/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/ILightController.java)
|
|
|
|
|
|
This interface defines what methods a light controller has to provide:
|
|
|
| Method | Purpose |
|
... | ... | @@ -21,7 +21,7 @@ This interface defines what methods a light controller has to provide: |
|
|
|
|
|
# LightController
|
|
|
|
|
|
The discussed file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/6d65d24412bda2e555e70a4f9581eb142096bd49/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/LightController.java)
|
|
|
The discussed file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/64e67bdaae14ef6945ab3e73b5a9c70c9c1ced67/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/LightController.java)
|
|
|
|
|
|
```java
|
|
|
public class LightController implements ILightController {
|
... | ... | @@ -198,13 +198,13 @@ Then, having found a Submodel with the ShortID "lightSwitch" as part of an AAS, |
|
|
|
|
|
We then decide whether we should put the submodel into to the list for green or red lights, depending on whether the short ID of the AAS (in addition to "Light") also contains the substring "red" or "green".
|
|
|
|
|
|
This could probably be done more elegantly by not searching for parts of the short ID but rather implementations of templates of submodels or AAS. This might be an interesting [future project](TODO)
|
|
|
This could probably be done more elegantly by not searching for parts of the short ID but rather implementations of templates of submodels or AAS. This might be an interesting [future project](home#future-projects).
|
|
|
|
|
|
# LightControllerSubmodelProvider
|
|
|
|
|
|
Just like the ordinary lights, The Light controller is itself an Asset, being integrated into the BaSyx environment hosting a submodel exposing it's interface to other members of the system.
|
|
|
|
|
|
The discussed file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/6d65d24412bda2e555e70a4f9581eb142096bd49/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/LightControllerSubmodelProvider.java)
|
|
|
The discussed file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/64e67bdaae14ef6945ab3e73b5a9c70c9c1ced67/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/LightControllerSubmodelProvider.java)
|
|
|
|
|
|
I advise you to take a look at the file, as it is already heavily commented.
|
|
|
|
... | ... | |