thank you , didnt know all the capabilities of the ma-calc are there more examples or documentation available? i guess it can be used in various ways.
I have multiple errors now in my console
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [[{"msg":"fn: r","newVal":[{"hasData":true,"first":"...","last":"...","start":"...","minimum":"...","maximum":"...","average":"...","integral":"...","sum":"...","count":6912},
Basically my code now looks like that:
<ma-calc input="day | maMoment:'add':preset:'days'" output="day2"></ma-calc>
<ma-calc input="day2 | maMoment:'set':{'hour': 5, 'minute': 0}" output="myfrom"></ma-calc>
<ma-point-query query="'or(name=like=STR_4.*,name=like=*STR_5.*,name=like=*STR_6.*,name=like=STR_7.*,name=like=*STR_8.*,name=like=*STR_9.*)'" limit="300" points="points1"></ma-point-query>
<ma-point-values points="points1" values="combined" from="myfrom" to="dateBar.to" rollup="INTEGRAL" rollup-interval="1 DAYS">
</ma-point-values>
<ma-point-statistics points="points1" rendered=false from="myfrom" to="dateBar.to" display-mode="INTEGRAL" timeout=7000 statistics="statsObj"></ma-point-statistics>
<ma-calc input= statsObj|orderBy:'-integral.value'|maFirst output="max" ></ma-calc>
<ma-calc input= statsObj|orderBy:'-integral.value' output="sorted_integrals" ></ma-calc>
<ma-calc input= "((max.integral.value) * 0.8)" output="max8" ></ma-calc>
<div ng-repeat="(index,value) in sorted_integrals">
<div ng-repeat="point in points1">XID: {{point.xid}} , Time: {{value.timestamp | maMoment:'format':'DD/MM/YYYY'}} ,Point Name: {{point.name}} ,Point Value: {{value['value_' + point.xid]}}</div>
</div>
-
Seems that those ma-calc are updating their values constantly .. tried to timeout the statistics in 7seconds but didnt work .. is this the reason of the errors in the console ?
-
i would like to filter and get only the integral values of my statistics object so i can print that array sorted with the ng-repeat ..
first line should be the biggest integral ..
Tried with display-mode="INTEGRAL" in the ma-point-statistcs directive but im not sure exactly what is does since there is no example in the documentation ..is it supposed to filter only the integral values ?
Also i tried to filter it and print it by
<ma-calc input= statsObj |filter:{statistics:'INTEGRAL'}|orderBy:'-integral.value' output="sorted_integrals" ></ma-calc>
<div ng-repeat="(index,value) in sorted_integrals">
<div ng-repeat="point in points1">XID: {{point.xid}} , Time: {{value.timestamp | maMoment:'format':'DD/MM/YYYY'}} ,Point Name: {{point.name}} ,Point Value: {{value['value_' + point.xid]}}</div>
</div>
but its not working. the sorted_integrals still contains all the statistics like average, first etc that i dont need in order to correctly ng-repeat <div ng-repeat="(index,value) in sorted_integrals">
3)also my
<div ng-repeat="(index,value) in sorted_integrals">
<div ng-repeat="point in points1">XID: {{point.xid}} , Time: {{value.timestamp | maMoment:'format':'DD/MM/YYYY'}} ,Point Name: {{point.name}} ,Point Value: {{value['value_' + point.xid]}}</div>
</div>
Is not sorted by the biggest integral.. it gives me the default sort of the point XID of the ma-point-query
And it gets even more complicated when i have null or undefined values in my integral values .. the orderby by default sorts the nulls and undefined as greater than numbers ... tried few workarounds like the fowllowing but none of them work.. how to sort it correctly and keep the nulls and undefined at the end so i get the biggest value first ?
<ma-calc input= statsObj| orderBy:['integral.value==null || integral.value'] output="max" ></ma-calc>
<ma-calc input= statsObj| orderBy:['!integral.value', '-integral.value', ] output="max" ></ma-calc>
Basically i want to sort the statistics object by biggest integral, then keep only the integral values and then print a table of the sorted values withe their corresponding data point names and xid
What im doing wrong ?
thank you very much :)