Skip to content

Add support for dynamic properties #18

Open

Description

@kingcole
No description provided.

Activity

  1. added
    Priority 1That issue is highly essential and must be fixed/implemented
    on Feb 27, 2018
  2. deinhofer commented on Feb 27, 2018

    @deinhofer
    Contributor

    for a feature description see #26

  3. sabicalija commented on Mar 8, 2019

    @sabicalija
    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?

  4. ChrisVeigl commented on Mar 10, 2019

    @ChrisVeigl
    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

  5. sabicalija commented on Mar 10, 2019

    @sabicalija
    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?

  6. ChrisVeigl commented on Mar 10, 2019

    @ChrisVeigl
    Contributor

    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 ;-)

  7. sabicalija commented on Mar 10, 2019

    @sabicalija
    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?

  8. sabicalija commented on Mar 10, 2019

    @sabicalija
    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?

  9. sabicalija commented on Mar 11, 2019

    @sabicalija
    Contributor

    @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

  10. ChrisVeigl commented on Mar 11, 2019

    @ChrisVeigl
    Contributor

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

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

  11. sabicalija commented on Mar 11, 2019

    @sabicalija
    Contributor

    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.

  12. ChrisVeigl commented on Mar 11, 2019

    @ChrisVeigl
    Contributor

    ok great!

  13. sabicalija commented on Mar 11, 2019

    @sabicalija
    Contributor

    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.

  14. klues commented on Mar 12, 2019

    @klues

    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.

  15. sabicalija commented on Mar 12, 2019

    @sabicalija
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority 1That issue is highly essential and must be fixed/implementedenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions