Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Alarm list and update
-
Hi all
I have some problems i am new in Mango, if someone can help me, i want to perform a simple thing but i cant do it.
I have a data source with a list of data point (binary). I want to show in a GUI "only" the one that is alarmed in realtime, mean value=true. and fill a table with that..This code that i am testing, Does not work property does not show in realtime, i change manually the value to test and no row is show in a table.
When i manually update the page, appear a row but not in realtime.
<ma-point-query query="{$and: true, deviceName:'Menerga Faults', name:''}" limit="30" points="puntos_faults"></ma-point-query> <ma-point-values points="puntos_faults" values="combined_faults" latest="1" from="dateBar.from" to="dateBar.to" rollup="{{dateBar.rollupType}}" rendered="true" rollup-interval="{{dateBar.rollupIntervals}} {{dateBar.rollupIntervalPeriod}}"> </ma-point-values> <div id="3a040097-4b4d-46c7-bcc4-1bb62d4563e8" style="position: absolute; left: 590px; top: 937px; border-width: medium; border-style: solid; border-radius: 10px; border-color: rgb(153, 153, 153); width: 485px; height: 165px;"> <table class="customTable"> <thead> <tr> <th>Current Faults</th> <th>Value</th> </tr> </thead> <tbody> <tr ng-repeat="punto in puntos_faults" ng-if="combined_faults[0]['value_' + punto.xid + '_rendered'] == 'true'"> <td>{{punto.name}}</td> <td style="color: red" ng-repeat="value in combined_faults">{{value['value_' + punto.xid + '_rendered']}}</td> </tr> </tbody> </table>
Thanks you very much for the help.
-
i forgot to mention, datapoints logging is set in "when point value changes", i want show the table with the current status of the system showing only the datapoint alarmed, and show a empty table when the system its ok.
Another small question, how i can get the value of a list of datapoints, i have to use ma-point-query with ma-point-value ? there is a way to have a list of datapoints and made a ng-repeat="point in points" then point.value?
Thanks a lot in advance.
-
I update the code to make it simplest
<ma-point-query query="{$and: true, deviceName:'Menerga Alarms', name:''}" limit="30" points="puntos"></ma-point-query> <ma-get-point-value points="puntos"></ma-get-point-value> <div id="f18b7537-6b27-406b-9d2c-48daa56b3ff0" style="position: absolute; left: 21px; top: 922px; border-width: medium; border-style: solid; border-radius: 10px; border-color: rgb(153, 153, 153); width: 485px; height: 165px;"> <table class="customTable"> <thead> <tr> <th>Current Alarms</th> <th>Value</th> </tr> </thead> <tbody> <tr ng-repeat="punto in puntos" ng-if="punto.renderedValue == true"> <td>{{punto.name}}</td> <td style="color: red">{{punto.renderedValue}}</td> </tr> </tbody> </table>
This work ok, but not in realtime, i changed the data point but the table is not updating with a new row, only when manualy reload the page. Also when i change back the data point does not remove the row :(. again only reloading the page. works.
Thanks.
-
<ma-point-query query="{$and: true, deviceName:'Menerga Faults', name:''}" limit="30" points="puntos_faults"></ma-point-query> <!-- replaced from and to with realtime --> <ma-point-values points="puntos_faults" values="combined_faults" latest="1" realtime="true" rollup="{{dateBar.rollupType}}" rendered="true" rollup-interval="{{dateBar.rollupIntervals}} {{dateBar.rollupIntervalPeriod}}"> </ma-point-values> <div id="3a040097-4b4d-46c7-bcc4-1bb62d4563e8" style="position: absolute; left: 590px; top: 937px; border-width: medium; border-style: solid; border-radius: 10px; border-color: rgb(153, 153, 153); width: 485px; height: 165px;"> <table class="customTable"> <thead> <tr> <th>Current Faults</th> <th>Value</th> </tr> </thead> <tbody> <!-- changed the ng-if to ng-show and used it to compare the boolean value, not the rendered one. --> <tr ng-repeat="punto in puntos_faults" ng-show="combined_faults[0]['value_' + punto.xid]"> <td>{{punto.name}}</td> <td style="color: red" ng-repeat="value in combined_faults">{{value['value_' + punto.xid + '_rendered']}}</td> </tr> </tbody> </table>
Looks pretty good, change the
'true'
totrue
, you're comparing booleans not strings.
Secondly, for better speed, change thoseng-if
statements tong-show
. You want it to be dynamic and only show if the value is valid, hide if invalid. ng-if will mess with this as it will have to re-render the elements every time your values are true.Also, I removed
from="dateBar.from" to="dateBar.to"
You don't need these if you are pulling the latest, which brings me to the next thing. If you want to pull the latest value, userealtime="true"
This is why it isn't updating automatically for you.Fox
-
@cristian-herrera said in Alarm list and update:
Another small question, how i can get the value of a list of datapoints, i have to use ma-point-query with ma-point-value ? there is a way to have a list of datapoints and made a ng-repeat="point in points" then point.value?
You can use ma-point-query, or the ma-watchlist-table, look at the examples on the menu. Turn on the api docs via aministration->edit menu and save. You will find it very beneficial.
-
Dear @MattFox Thanks a lot for the help and tips, i tried your code, but unfortunately does not work the realtime, i changed manually the status of the data point, from false to true, then i reload the page and the table does not show an alarm, after some time does it, but when i change it back to false, the row does not dissapear.
It is possible to change ma-point-value to ma-get-point-value ? but this last one does not have realtime option.
<ma-point-query query="{$and: true, deviceName:'Menerga Alarms', name:''}" limit="30" points="puntos"></ma-point-query> <ma-get-point-value points="puntos"></ma-get-point-value> <div id="f18b7537-6b27-406b-9d2c-48daa56b3ff0" style="position: absolute; left: 21px; top: 922px; border-width: medium; border-style: solid; border-radius: 10px; border-color: rgb(153, 153, 153); width: 485px; height: 165px;"> <table class="customTable"> <thead> <tr> <th>Current Alarms</th> <th>Value</th> </tr> </thead> <tbody> <tr ng-repeat="punto in puntos" ng-show="punto.value"> <td>{{punto.name}}</td> <td style="color: red">{{punto.renderedValue}}</td> </tr> </tbody> </table>
Thanks so much again.
-
oint-value to ma-get-point-value ? but this last one does not have realtime option. <ma-point-query query="{$and: true, deviceName:'Menerga Alarms', name:''}" limit="30" points="puntos"></ma-point-query> <div id="f18b7537-6b27-406b-9d2c-48daa56b3ff0" style="position: absolute; left: 21px; top: 922px; border-width: medium; border-style: solid; border-radius: 10px; border-color: rgb(153, 153, 153); width: 485px; height: 165px;"> <table class="customTable"> <thead> <tr> <th>Current Alarms</th> <th>Value</th> </tr> </thead> <tbody> <tr ng-repeat="punto in puntos" ng-show="punto.value"> <td><ma-get-point-value point="punto"></ma-get-point-value> {{punto.name}}</td> <td style="color: red">{{punto.renderedValue}}</td> </tr> </tbody> </table>
- Don't make too many changes in one go. You will only confuse yourself.
- move that ma-get-point-value inside the loop. Make it focus on only one point rather than many.
- Have you tried echoing out the points themselves onto the page, just to make sure all of the data you need is there?
-
Yep, i tried to echoing, works fine but only refreshing manually the page :(, with ma-point-values and realtime=true works with a delay when the page is refresh, but does not work when the alarm dissapear and does not delete the row in realtime.
Thanks :)
-
Rather than hiding rows, it would be better to validate if these point values are changing, remove the ng-show and focus on the point values first. If they are not updating in realtime, then you have other problems.
Fox