• Jared Wiltshire

    @wingnut2-0 said in Heartbeat for Cloud Connect Clients:

    The goal is to monitor the status of cloud connect clients via the cloud connect server and alert/generate an event if a client becomes unresponsive.

    We could probably add some events to the Cloud Connect module for this purpose. On both the client and the server. Good idea!

    @wingnut2-0 said in Heartbeat for Cloud Connect Clients:

    Would/Can this be done by creating points on the clients and publish to the server?

    I assume you are talking about the Persistent TCP publisher/data source? This does not currently operate through the Cloud Connect module so it wont tell you anything about the status of the Cloud Connect tunnel. We definitely have it in our plans to allow it to tunnel through the CC module. Stay posted.

    posted in User help read more
  • Jared Wiltshire

    @gordoe said in Values not showing up in v3 pages but will in v2:

    /rest/v2/data-points/DP_Site99_CB2-breakerStatus:1 Failed to load resource: the server responded with a status of 404 (Not Found)

    This indicates that the data point with XID DP_Site99_CB2-breakerStatus doesn't exist but that doesn't seem to be the data point you are looking at.

    @gordoe said in Values not showing up in v3 pages but will in v2:

    The server is running with a dual nic. Think that might have an impact?

    Not unless your routing is setup incorrectly.

    @gordoe said in Values not showing up in v3 pages but will in v2:

    WebSocket connection to 'ws://172.30.0.5/rest/v1/websocket/json-data' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET

    WebSocket issues normally indicate that there is a transparent proxy between the client and the server. We always recommend to use HTTPS for security and reliability of WebSocket connections.

    The old UI pages use a long polling technique not WebSockets so this does not affect them.

    posted in User help read more
  • Jared Wiltshire

    @davide27 said in DataPoint values into a var javascript:

    I need to download a csv file with the values ​​of multiple data points, but not all values ​​have the same timestamp. For this reason, I would like to have the values in a variable so I can process it and write it all in one line.

    Please have a play with the CSV download from the watch list. Try it with different rollup options and see if you can get something that works for you. If this suffices I can give you an example of a new URL you can use in the example I posted above.

    The reason I am suggesting this is because it will be easier for you, I have given you suggestions on how to proceed if you really want to process the values using JavaScript but you haven't given me any indication that you have looked at the documentation I referenced.

    posted in How-To read more
  • Jared Wiltshire

    There are no options for password complexity yet, we have added support for it in the back-end but it is not configurable yet. Next release should have some options for it.

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    Since you did not provide any sort of logs, screenshots or metrics I cannot really comment. I would suggest looking at the network tab of the chrome debugger (ensure that "Disable cache" is not checked).

    The first load after upgrading a module will take longer as it has to fetch the new versions of resources. After that it should be cached.

    posted in User help read more
  • Jared Wiltshire

    You can add &dateTimeFormat=yyyy-MM-dd%20HH%3Amm%3Ass.SSS to the end of the URL to change the date encoding to a Excel compatible format.

    edit.
    Also, you can write a user module that loads point values using the maPointValues service and do whatever you please. Reference the thread that @MattFox linked to above for inspiration. Also search the help site and forum, there are lots of threads about user modules / components.

    posted in How-To read more
  • Jared Wiltshire

    Here's an example, you can download CSV straight from the REST API

    <ma-watch-list-get ng-model="designer.watchList" parameters="designer.parameters" on-points-change="designer.points = $points" id="29305bf3-cc2a-4bac-9650-3cbf64d738a9" watch-list-xid="WL_Flow"></ma-watch-list-get>
    <div class="ma-designer-root" id="1a2a6980-f5bb-4acc-a41a-f8f69d5c12d2" style="width: 1366px; height: 768px; position: relative;">
    
        <ma-calc input="designer.points | filter:{name:'Flow'}:true | maFirst" output="point"></ma-calc>
        
        <md-button id="2585b1fa-a630-4255-8670-41884b8754e2" style="position: absolute; left: 260px; top: 70px;" class="md-raised" ng-href="/rest/v2/point-values/time-period/{{point.xid}}?fields=TIMESTAMP&fields=VALUE&fields=ANNOTATION&from={{dateBar.from.toISOString()}}&to={{dateBar.to.toISOString()}}&format=csv2" download="{{point.name}}.csv">Download values</md-button>
    </div>
    

    posted in How-To read more
  • Jared Wiltshire

    Personally, I would create a little dashboard to do what you need to do in his browser, you wouldn't need to upload the file to Mango at all. There's obviously a lot of ways to skin this cat and I'm sure my colleagues might chime in with another solution. You could for example upload the file to the file store via a dashboard and do the processing via a script run on the back-end.

    Front-end only solution using Papa Parse (see their documentation for parsing / output options). You need to add this as a user module - https://help.infiniteautomation.com/getting-started-with-a-user-module/

    define(['angular', 'require', 'papaparse'], function(angular, require, Papa) {
        'use strict';
        
        const userModule = angular.module('userModule', ['maUiApp']);
        
        class ProcessCsvController {
            fileSelected(event) {
                const files = event.target.files;
                if (files.length) {
                    this.parseFile(files[0]);
                }
                event.target.value = null;
            }
            
            parseFile(file) {
                Papa.parse(file, {
                	complete: results => {
                		this.modifyRows(results.data);
                	}
                });
            }
            
            modifyRows(rows) {
                rows.forEach(row => {
                    // whatever you want to do
                    console.log(row);
                });
                
                this.downloadCsv(rows, 'myFile.csv');
            }
            
            downloadCsv(rows, filename) {
                const csvBlob = new Blob([Papa.unparse(rows)]);
                const url = URL.createObjectURL(csvBlob);
                try {
                    const a = document.createElement('a');
                    a.style.display = 'none';
                    a.href = url;
                    a.download = filename;
                    document.body.appendChild(a);
                    a.click();
                    document.body.removeChild(a);
                } finally {
                    URL.revokeObjectURL(url);
                }
            }
        }
    
        userModule.component('processCsv', {
            template: `<input type="file" accept="text/*,.csv,.txt" ma-change="$ctrl.fileSelected($event)">`,
            controller: ProcessCsvController
        });
        
        return userModule;
    }); // define
    

    All you have to do to use this is plonk it onto a page -

    <process-csv></process-csv>
    

    posted in User help read more
  • Jared Wiltshire

    Here's another way of doing it that will only fetch the values for the selected point. The buttons also highlight to show which point is selected.

    <!-- set the initial data point XID for when the page loads -->
    <div ng-init="dataPointXid = 'temperature'"></div>
    
    <ma-get-point-value point-xid="{{dataPointXid}}" point="selectedPoint"></ma-get-point-value>
    <md-button ng-click="dataPointXid = 'temperature'" ng-class="{'md-raised': dataPointXid === 'temperature'}">Data point 1</md-button>
    <md-button ng-click="dataPointXid = 'voltage'" ng-class="{'md-raised': dataPointXid === 'voltage'}">Data point 2</md-button>
    
    <ma-point-values point="selectedPoint" values="pointValues" from="dateBar.from" to="dateBar.to" rollup="{{dateBar.rollupType}}" rollup-interval="{{dateBar.rollupIntervals}} {{dateBar.rollupIntervalPeriod}}">
    </ma-point-values>
    
    <ma-serial-chart style="height: 300px; width: 100%" series-1-values="pointValues" series-1-point="selectedPoint">
    </ma-serial-chart>
    

    0_1548952726907_cca593a7-6577-4b09-b4b7-70066a9d8e9a-image.png

    posted in User help read more
  • Jared Wiltshire

    @andrewh The timeout is configured from our code, its not something set by the browser. You can change the default timeout using a user module like so -

    define(['angular', 'require'], function(angular, require) {
        'use strict';
        const userModule = angular.module('userModule', ['maUiApp']);
        userModule.constant('MA_TIMEOUT', 60000);
        return userModule;
    }); // define
    

    PS I might increase the default timeout for point value requests in the next release.

    posted in User help read more