Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dynamic properties #18

Open
kingcole opened this issue Jan 11, 2018 · 14 comments
Open

Add support for dynamic properties #18

kingcole opened this issue Jan 11, 2018 · 14 comments
Labels
enhancement Priority 1 That issue is highly essential and must be fixed/implemented

Comments

@kingcole
Copy link

No description provided.

@deinhofer deinhofer added the Priority 1 That issue is highly essential and must be fixed/implemented label Feb 27, 2018
@deinhofer
Copy link
Contributor

for a feature description see #26

@sabicalija
Copy link
Contributor

I've investigated this issue a little. The combo box is actually working fine. For example, I've created a simple model consisting of a KNX and an Averager plugin. The Averager plugin has a combo box too:

image

However, the combo box is not displayed with the KNX plugin:

image

The combo box is missing for the KNX plugin, because the defaultComponentCollection.abd does not provide values for the combo box of the KNX plugin:

image

whereas the Averager plugin does:

image

When I add values for the combo box:

image

the combo box is displayed as requested:

image

So the "only" thing left to do is to add possible values to the defaultComponentCollection.abd. The picture of the ACS (see #26) indicates that possible values should be available (at least for the "normal" ACS).

What would be the best way to proceed?

I'm a little bit struggling with the term "dynamic" properties. Is there a difference between the combo box of the Averager and the KNX plugin? Why is the value of the combo box of the KNX plugin (and others) not stored in the defaultComponentCollection.abd?

@ChrisVeigl
Copy link
Contributor

"dynamic properties" are properties with combobox values that are updated from the ARE.
this happens when you connect ACS and ARE and upload the model. in this moment, the combo box is created / filled in the ACS property editor. for example: a property "soundfiles" displays available sound file names which exist in a particular folder on the ARE etc. (this feature is missing in the WebACS -> try e.g. the KNX plugin in the ACS). The "mode" property of the averager plugin is not a dynamic property.

BTW: properties with combo boxes should be integer types AFAIK (see e.g. averager plugin)
https://github.com/asterics/AsTeRICS/blob/295a1e5bb3cfdb257ebb7f283e89eab314c944aa/ARE/components/processor.averager/src/main/java/eu/asterics/component/processor/averager/AveragerInstance.java#L160

@sabicalija
Copy link
Contributor

Does that mean that we need additional functionality at areCommunicator.js? Or is there a way to retrieve those "dynamic" properties somehow? Are they available over the REST interface of the ARE?

@ChrisVeigl
Copy link
Contributor

ChrisVeigl commented Mar 10, 2019

the ACS calls the getRuntimePropertyList() commmand via ASAPI to retrieve the list of desired values for the combobox. For an example see the getRuntimePropertyList() method of the wavefileplayer plugin which returns available sound files:
https://github.com/asterics/AsTeRICS/blob/c72a80d4c5130ba48364094a3f2499e306de94cf/ARE/components/actuator.wavefileplayer/src/main/java/eu/asterics/component/actuator/wavefileplayer/WavefilePlayerInstance.java#L271

WebACS should do the same. Kingcole probably has already a concept for that ;-)

@sabicalija
Copy link
Contributor

There are two functions in the areCommunicator.js: getRuntimeComponentPropertyKeys() and getRuntimeComponentProperty(). They could provide the needed information. 😆

I think @deinhofer created the REST interface. Right? @deinhofer does one of these functions provide some list of runtime properties of the components inside a model?

@sabicalija
Copy link
Contributor

@deinhofer I wanted to take a look on the REST API of the ARE. When I retrieve all component ids of the loaded model using 127.0.0.1:8081/rest/runtime/model/components/ids I get:

[
    "Knx.1",
    "Averager.1"
]

But when I try to get all properties using 127.0.0.1:8081/rest/runtime/model/components/Knx.1/properties I get:

  Couldn't retrieve 'properties' property from 'Knx.1' (Undefined component ID: null)

What am I doing wrong?

@sabicalija
Copy link
Contributor

sabicalija commented Mar 11, 2019

@ChrisVeigl How do I know what plugins or which of their properties have "dynamic properties"? Is the property getStringList a sufficient indicator for "dynamic properties"?

image

@ChrisVeigl
Copy link
Contributor

in the bundle descriptor, the property entry has
getStringList="true"

(and as the name suggests, the type for dynamic properties is "string" ... )

@sabicalija
Copy link
Contributor

sabicalija commented Mar 11, 2019

I've added a new function to areCommunicator.js: getRuntimeComponentPropertyList() (see ffdb45d) and the associated REST path to the server of the ARE (see cf5aab8).

Those "dynamic" properties can now be obtained using a GET request at /runtime/model/components/{componentId}/properties/{componentKey} or using getRuntimeComponentPropertyList(componentId, componentKey).

Next step is the integration in WebACS.

@ChrisVeigl
Copy link
Contributor

ok great!

@sabicalija
Copy link
Contributor

sabicalija commented Mar 11, 2019

I've added the functionality for dynamic properties for the WebACS. It's almost done. There seems to be an issue with the first two dynamic properties:

image

I have to investigate what might be causing this problem. @klues do you have a clue (as your name implies 🙈) what might be causing troubles? I've added the position, id and key to the log (red frame) and id and key to the selection list (dropdown). As you can see from the picture, the handler is called for DPTEvent1 and DPTEvent2, even with the correct position (row in the property editor), but the dropdown list is not added for those first two DPTEvents.

EDIT:

image

I took a look at the "table" that is being built when the property editor is opened. Apparently there are additional td elements (see row[6].children, row[9].children) which are missing for row[12].children (i.e., DPTEvent3). But I have no clue where (nor when or what) those td element are added.

@klues
Copy link
Contributor

klues commented Mar 12, 2019

instead of /runtime/model/components/{componentId}/properties/{componentKey} maybe /runtime/model/components/{componentId}/properties/{propertyKey} would make more sense?!

@sabicalija I think it's best to investigate this issue in person in the office, I'll be there at about 10:30 am.

@sabicalija
Copy link
Contributor

WebACS now loads dynamic properties (see f16261f, PR#35).

@klues Thank's for the support. 🙂 You're right with the naming. It is not ideal, but I wanted to keep the existing naming convention and not introduce a new one (at least - not right now 😏).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Priority 1 That issue is highly essential and must be fixed/implemented
Projects
None yet
Development

No branches or pull requests

5 participants