Latest point values
-
Hello, I'm creating a page and wanted to use the "Latest point values", follow the code below:
<div layout="row"> <md-input-container flex> <label>Choose a point</label> <ma-point-list limit="200" ng-model="point1"></ma-point-list> </md-input-container> <md-input-container flex="25"> <label>Number of latest values</label> <input ng-init="latestX=10" type="number" step="1" min="1" max="50" ng-model="latestX" ng-model-options="{debounce:500}"> </md-input-container> <md-switch ng-init="realtime=true" ng-model="realtime"> Realtime </md-switch> </div> <div layout="row"> </div> <ma-point-values point="point1" values="point1Values" latest="latestX" realtime="realtime" rendered="true"> </ma-point-values> <md-table-container> <table md-table> <thead md-head> <tr> <th md-column>Time</th> <th md-column>Value</th> </tr> </thead> <tbody md-body> <tr ng-repeat="value in point1Values | orderBy:'-timestamp'"> <td md-cell>{{value.timestamp | maMoment:'format':'ll LTS'}}</td> <td md-cell>{{value.value}}</td> </tr> </tbody> </table> </md-table-container>
I would like to make the values it shows are the "renderedValue", I tried to add this type of value in the ready code but I did not succeed.
Would anyone have any tips?
-
In
<md-table-container> <table md-table> <thead md-head> <tr> <th md-column>Time</th> <th md-column>Value</th> </tr> </thead> <tbody md-body> <tr ng-repeat="value in point1Values | orderBy:'-timestamp'"> <td md-cell>{{value.timestamp | maMoment:'format':'ll LTS'}}</td> <td md-cell>{{value.value}}</td> </tr> </tbody> </table> </md-table-container>
replace
{{value.value}}
with{{value.value}} {{point1.unit}}
You may be able to use{{value.renderedValue}}
instead but I cannot remember right now off the top of my head if <ma-point-values> does it...
Two: Also note that for renderedValue to work, you need to have the units field set for the chosen datapoint. -
It'd be
{{value.rendered}}
-
Thanks Phil
-
It worked, thank you.