Asset configuration with table [message #1810176] |
Fri, 02 August 2019 09:49 |
Pedro de Arquer Messages: 34 Registered: December 2018 |
Member |
|
|
Hi,
I'm creating a wire to process incoming variables and map their name and value, so I need a specific configuration for each variable (for example, its assetName, original variableName, newName, and conversionFactor). To provide such information to the asset I've added a configuration field for a JSON where such configuration is listed. However, I think it would be much easier, robust and readable a table whose columns could be configured to ensure data is inserted and correct.
Is there a way to do this in wires configuration? Or anywhere in Kura besides Drivers?
Regards,
Pedro
|
|
|
|
Re: Asset configuration with table [message #1810180 is a reply to message #1810179] |
Fri, 02 August 2019 10:11 |
Pedro de Arquer Messages: 34 Registered: December 2018 |
Member |
|
|
Hi,
Of course.
Consider I need to process the variables read from a device in order to, for example, translate their format, generate alerts, etc. In this case i'm trying to rename the variable and scale the value to a different unit right before sending it to somewhere. For such conversion I need to define a set of fields for each variable. An example of those fields could be:
- asset: asset where the variable was read from
- originalName: name of the variable
- newName: new name of the variable
- factor: value to scale the variable
For example, with the following configuration:
- asset: asset1
- originalName: channel1
- newName: name1
- factor: 0.001
The WireRecord (simplified form):
[assetName=asset1, channel1=12345678]
Would become
[assetName=asset1, name1=1234.5678]
To be able to configure this for multiple variables, I need to provide the wire component with an array of sub-configurations. I'm currently doing this with a JSON string that the component must verify and map each time the configuration is updated. I think a table (with configurable columns and format validation) would be a great approach. Is there a way to create a table interface in the wire component configurations? If not, is there a better alternative to the JSON without such table?
Regards,
Pedro
[Updated on: Fri, 02 August 2019 10:15] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03893 seconds