-
Notifications
You must be signed in to change notification settings - Fork 1
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 arbitrary data mapping #58
Comments
I might also propose a more complex mapping, to accommodate all the other possibilities. "[target attr]":{ |
To clarify in the default case you are asking for data-map to map value (pv) to key (attribute) on the same element. So... <ob-rudder-medium rudderAngle="0"
rudderSetPointAngle="0"
showPortStarboard="false"
showSetPoint="false"
data-map="{ 'rudderAngle' : 'tmplitTest:tmplit.Slider' , ' rudderSetPointAngle' : 'tmp1itTest:tmplit.Numericlnput' }"/> Assuming variables tmplitTest:tmplit.Slider = 100 and tmp1itTest:tmplit.Numericlnput = 200 Then <ob-rudder-medium rudderAngle="100"
rudderSetPointAngle="200"
showPortStarboard="false"
showSetPoint="false"
data-map="{ 'rudderAngle' : 'tmplitTest:tmplit.Slider' , ' rudderSetPointAngle' : 'tmp1itTest:tmplit.Numericlnput' }"/> Then if |
Yes, but actually.. I would parse it and check if the parsed value was a string or object. If it's a string we assume it's a PV, but if it's an object we get the parameters from the object |
add a data-map attribute that accepts json? Could also just see it accepting an array of key-value pairs. Could also allow selectors with the element as a scope.
something like:
OnUpdate(el){
For (map [key, pvname ])
El.querySelector(item) = machine.value(pvname)
}
or the simple version would just set like this:
The text was updated successfully, but these errors were encountered: