• Jared Wiltshire

    The XID is still in the URL for the GET variant e.g. where temperature is the XID
    /rest/v2/point-values/time-period/temperature?bookend=true&fields=TIMESTAMP&fields=VALUE&fields=RENDERED&fields=ANNOTATION&fields=BOOKEND&from=2019-06-14T20:46:04.291Z&limit=5001&timezone=America%2FDenver&to=2019-06-14T21:01:04.291Z

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    Have you seen the swagger documentation for the REST API? https://help.infiniteautomation.com/explore-the-api

    There are HTTP GET and POST variants.

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    @johautt said in Questions about point-values endpoint:

    I just want to ask if this is the expected behaviour, to adapt my code to this response.

    In response to question #1 - Yes, this is the expected behavior, I would probably use the V2 version of the point values REST controller though.

    The difference between the end points is that the events endpoint accepts a RQL query, our endpoints which accept RQL queries typically return an array of results and a total showing the number of results that could be returned if you didn't limit them.

    @johautt said in Questions about point-values endpoint:

    I ask if there is something bad with this format.

    In response to question #2 - The query parameters are expected to be in ISO 8601 format as Phillip said. In JavaScript you can use toISOString()

    Note that to query for a whole day you should use from=2019-06-14T04:00:00.000Z&to=2019-06-15T04:00:00.000Z as the from time is inclusive and the to time is exclusive.

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    I would agree! I will make it behave the same.

    posted in User help read more
  • Jared Wiltshire

    @pyeager said in Slider Problem:

    ng-model="Settings.TrendSet" ng-model-options="{getterSetter:true}"

    OK, <ma-slider> should not have a ng-model or ng-model-options attribute. This is incorrect and may be messing with things.

    Second issue is that <ma-slider> does not actually retrieve the point value, you have to use a <ma-get-point-value> for this e.g. <ma-get-point-value points="designer.points"></ma-get-point-value>

    Full working example -

    <ma-watch-list-get ng-model="designer.watchList" parameters="designer.parameters" on-points-change="designer.points = $points" id="41a7c1bf-a1bb-4d3f-ac6c-18da35e33828" watch-list-xid="WL_ed918c86-646f-4760-b5af-d9285ff86505"></ma-watch-list-get>
    <div class="ma-designer-root" id="160b37d3-12b5-473b-a6cc-8a4c79369fe7" style="width: 1366px; height: 768px; position: relative;">
        <ma-slider id="fb902626-d98c-4d3e-a422-1343f98eabf3" min="0" max="100" step="1" vertical="false" invert="false" discrete="false" hide-input="true" style="position: absolute; left: 117px; top: 221px; width: 451px; height: 58px;" point="designer.points | filter:{name:'Temperature'}:true | maFirst"></ma-slider>
        <ma-slider id="f1cb7f87-3da5-494d-b8c5-b039ec3a9f56" min="0" max="100" step="1" vertical="false" invert="false" discrete="false" hide-input="true" style="position: absolute; left: 117px; top: 279px; width: 451px; height: 58px;" point="designer.points | filter:{name:'Temperature2'}:true | maFirst"></ma-slider>
        <ma-get-point-value id="e0000313-b1b7-4c96-8862-191775ea04d9" style="position: absolute; left: 109px; top: 97px;" points="designer.points"></ma-get-point-value>
    </div>
    

    posted in User help read more
  • Jared Wiltshire

    @pyeager There is a lot of speculation in this thread. Lets go back to what was going wrong in the first place.

    • What were the actual symptoms? Tell me exactly what you did, and what you saw.
    • Were there any errors in the browser console?
    • Can you see a set point value request being made under the network tab when you adjust the slider?
    • What version of Mango are you using?
    • What version of the UI module are you using?

    posted in User help read more
  • Jared Wiltshire

    eventTypes and levels are the only two options. If you need further filtering you can filter the events on the client side.

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    @richard-mortimer said in maJsonStore (JSON store):

    Any idea how to put the number filter in there? The kW was to one decimal place, and the W was to 0 ...

    You would need another ternary operator. IMO the way you had it in the first place is easier to read.

    If you use this pattern often, consider adding an AngularJS filter to a user module. You could then use it just like
    <span ng-bind="point.value | formatPower"></span>

    posted in Scripting general Discussion read more
  • Jared Wiltshire

    @richard-mortimer I'm taking a guess at what is happening, but I'm pretty confident that this will fix it -

    <span ng-repeat="point in points[site.name] track by point.xid"><!-- Load -->
        <ma-get-point-value point="point"></ma-get-point-value>
        <div ng-if="point.value > 1000">{{ (point.value / 1000) | number:1 }}kW</div>
        <div ng-if="point.value <= 1000">{{ point.value | number:0 }}W</div>
    </span><!-- end Load -->
    

    Two things -

    • Use track by in your ng-repeat expression so that Angular can correlate which points correspond to each span element when the points change.
    • Just pass the point to the <ma-get-point-value> component instead of retrieving it by XID again

    posted in Scripting general Discussion read more
  • Jared Wiltshire

    @Phillip-Weeks This is how you add it as a user module - https://help.infiniteautomation.com/getting-started-with-a-user-module

    If it is being loaded correctly you will see it on the sources tab of Chrome's dev tools (under /rest/v2/file-stores/public/userModule.js for example).

    You should also see the network request being issued on the network tab when you click the button.

    posted in Dashboard Designer & Custom AngularJS Pages read more