• B
    bullitbd

    Hi @Jared-Wiltshire, @CraigWeb. Need to revisit this one. What I'm trying to accomplish:
    Have a dashboard that includes about 30 indicators. The indicators' colors and blink rates are determined by watch list point properties (.renderedValue, .value and .name) which are then parsed and used to call CSS classes on the various indicator divs via a directive. This code:

    html:

    <div ng-controller = "WlCtrl as wl">
    <ma-watch-list-get ng-model="indWl" parameters="indWl.parameters" on-points-change="indWl.points = $points" id="wl-indicator-id" watch-list-xid="WL_Indicator"></ma-watch-list-get>
    <ma-get-point-value points="indWl.points"></ma-get-point-value>
    
    <div>{{ indWl }} // writes out the on-scope watchlist object ;
    <div>{{ indWl.points[1] }}</div> // writes out a point object;
    <div>{{ $$watchersCount}}</div> // writes out a $scope member 
    
    </div>
    

    js

    
    define(['angular', 'require'], function(angular, require) {
        'use strict';
    
        var userModule = angular.module('userModule', ['maUiApp'])
    
          .controller('WlCtrl', ['$scope', '$filter', function($scope,$filter) {
            this.wList = [];
            this.scopeId = $scope.$id; // $scope.$id
            this.scope = $scope; // $scope
    
            // angular.forEach($scope.indWl.points, function(value, key){
            //   this.wList.push(value);
            // });
    
            this.wlist = $scope.watchList.points; // TypeError: Cannot read property 'points' of undefined - with or without loop;
            console.log(this.scopeId); // '1943'
            console.log(this.scope);  // logs the scope object {$$childTail:...},...,indWl:{..}..}
            console.log(this.wlist); // 
    
          }]);
    
       return userModule;
    
    }); // define
    

    presents my dilemma;

    1. watchlist is clearly on scope (and works like a charm - I'm using range switching)
    2. I need to access it in the controller (for further use in a parsing service). Sorry, this is clearly more angular than Mango, but any input would be appreciated.

    posted in User help read more
  • B
    bullitbd

    will do. thanks... and nothing there should be construed as in any way critical!

    posted in Mango feedback read more
  • B
    bullitbd

    Of course - why maintain it... but the UI is just easier to use in some cases - that is, instead mousing to and clicking 'NEXT' or 'PREVIOUS', just scroll. A lot less movement if you're dealing with lots of points. Thanks.

    posted in Mango feedback read more
  • B
    bullitbd

    (The one behind Please continue using the legacy page)

    The 3.6 UI is quite a step forward. I find, however, some of the old V2 functionality continues to be useful. Certainly the data_source_edit page is one of those instances - it can be very helpful to have it all right there in front of you, instead of button clicks away.

    Thanks for the great work.

    posted in Mango feedback read more
  • B
    bullitbd

    Actually figured out how to do this with a range renderer. Would be good to know, however, if there is access to the point properties via script. Guess I could try, huh...

    posted in User help read more
  • B
    bullitbd

    I have an indicator directive to which I want to pass a value depending upon values of 2 different points; ex;, assuming a scripting point, with two external multistate point inputs: mp1 (valve pos.1, 2 or 3 for instance), the other mp2 (system state). The color and blink rate of the indicator will depend on a functional combination of these two values.

    I would prefer to do all that calculating in a scripting data source, rather than in the directive. I can certainly hard code all the combinations into an alpha or numeric value, and pass that, then decode that in the directive. It would be far easier if I could pass an array value [position, state] into the directive. This doesn't appear possible given the data types available, but perhaps dynamic script access to other point properties (access to range rendering object, for instance, would be ideal - as I could pass an actual color value)?

    Thanks for any thoughts you might have.

    posted in User help read more
  • B
    bullitbd

    Thank you. The work you've done there is nothing short of amazing.

    posted in User help read more
  • B
    bullitbd

    Thanks, @CraigWeb. Appreciate the quick response. Pilot error there. But could you enlighten me on what parameters one might set on a watchlist?

    posted in User help read more
  • B
    bullitbd

    Thanks @Jared-Wiltshire. Just to be clear, by design the get-point-value then modifies the designer.points object on which it is called... so that, when passed via scope, designer.points includes the lastPayload object...

    Cool. Curious why values are not included in the designer.points object in the first place?

    Also, I'm a bit confused - in:

    <ma-watch-list-get ng-model="designer.watchList" parameters="designer.parameters" on-points-change="designer.points = $points" id="53368ae5-7ad5-40f7-b3e8-96dd61236a48" watch-list-xid="WL_test"></ma-watch-list-get>
    

    does on-points-change essentially update the model? perhaps the directive code would help my curiosity.

    Thanks for your patience and clear responses.

    posted in User help read more
  • B
    bullitbd

    This is no doubt explained somewhere, but I've been unable to find the answer. I'm attempting to pass a watchlist array via scope to a directive by an <ma-watch-list-get> request. The problem is that the {{points}} array therefrom doesn't contain the point's value (which is contained in the lastPayload object).

    If I request values via <ma-get-point-value>, the values angumagically appear in the returned {{points}} array, retrievable either through the newly included last payload object or, simply, through point.value.

    When I attempt to access the points array passed into a directive, however, I am unable to retrieve the point value. Any help would be appreciated.

    <ma-watch-list-get ng-model="designer.watchList" parameters="designer.parameters" on-points-change="designer.points = $points" id="53368ae5-7ad5-40f7-b3e8-96dd61236a48" watch-list-xid="WL_test"></ma-watch-list-get>
    
    <div>{{designer.points}}</div> <!--I'll save you the lengthy array here-->
    <table>
     <tbody>
      <tr ng-repeat="point in designer.points">
        <td><ma-get-point-value point="point"></ma-get-point-value></td>
        <td>{{point.name}}</td>
        <td>{{point.lastPayload.value.value}} </td>
        
        
        
      </tr>
     </tbody>
    </table>

    posted in User help read more
  • B
    bullitbd

    @jared-wiltshire said in amCharts - maTankLevel center chart column in div:

    marginRight: -74

    Aha! Thank you Jared! I was barking up another tree... sorry for all the code - TMI

    posted in User help read more
  • B
    bullitbd

    Hi - need a little help centering maTankLevel column in div...

    When using the ma-tank-level component, its width is greater than the actual chart data path. I've perused the amCharts documentation, and can't find a way to either center the data in the chart div, or to get the actual pixel width of the data element (column, in this case).

    I can hack it by placing the directive in a narrower div, but I can't dynamically size the containing div to the column size.

    html: (not relevant commented out; css below)

    <div id="09u098" class="table-block-top">
                <table class="first-table">
                    <thead>
                        <tr class="tank-row">
                            <th class="tank-col caption">FILLING</th>
                            <th></th>
                            <th class="tank-col caption">READY</th>
                        </tr>
                    </thead> -->
                    <tbody>
                        <tr class="tank-block">
                            <td id="tank1" class="tank-box"><ma-tank-level id="tank1Tank" class="ma-tank" options="{angle: 12}"></ma-tank-level></td>
                            <td></td>
                            <td id="tank2" class="tank-box"><ma-tank-level id="tank2Tank" class="ma-tank" options="{angle: 12}"></ma-tank-level></td>
                            
                        </tr>
                       /* <!-- <tr class="tank-row">
                            <td class="button">
                               <ma-switch-img class="rotate-180" id="569459e8-da3b-48e6-b127-bb9081b1342e" style="position: relative; width: 44px; height: 44px;" default-src="/rest/v2/file-stores/default/icons/button-153683_640.png" src-false="/rest/v2/file-stores/default/icons/button-153683_640.png" src-true="/rest/v2/file-stores/default/icons/button-153683_640.png" point-xid="DP_t1_fill"></ma-switch-img> 
                            </td>
                            <td class="text-lbl">FILL</td>
                            <td class="button">
                                <ma-switch-img class="rotate-180" id="569459e8-da3b-48e6-b127-bb9081b1340a" style="position: relative; width: 44px; height: 44px;" default-src="/rest/v2/file-stores/default/icons/button-153683_640.png" src-false="/rest/v2/file-stores/default/icons/button-153683_640.png" src-true="/rest/v2/file-stores/default/icons/button-153683_640.png" point-xid="DP_t1_fill"></ma-switch-img>
                            </td>
                        </tr>
                        <tr class="tank-row">
                            <td class="button">
                                <ma-switch-img id="b5a74da4-554e-48e0-beb6-96f2bd6e4bc4" style="position: relative; height: 46px; width: 46px" toggle-on-click="true" default-src="/rest/v2/file-stores/default/icons/slim-green-led-on-th.png" point-xid="DP_t1_fill"></ma-switch-img>
                            </td>
                            <td class="text-lbl">SEL</td>
                            <td class="button">
                                <ma-switch-img id="b5a74da4-554e-48e0-beb6-96f2bd6e4bc4" style="position: relative; height: 46px; width: 46px" toggle-on-click="true" default-src="/rest/v2/file-stores/default/icons/slim-green-led-on-th.png" point-xid="DP_t1_fill">1</ma-switch-img>
                            </td>
                        </tr>
                        <tr class="tank-row">
                            <td class="text-val">Tank 1</td>
                            <td></td>
                            <td class="text-val">Tank 2</td>
                        </tr>
                    </tbody>
                </table>
    ...
    </div> --> */
    

    relevant css:

    .tank-block {
       position: relative;
       /*left: 0px;
       top: 0px;*/
       padding: 20px;
       width: 400px;
       height: 300px; 
    }
    
    .tank-box {
      position: relative;
      display: inline-block;
      width: 175px; 
      height: 250px;
      padding:0 0;
    }
    
    .ma-tank {
       position: relative;
       height: 100%;
       width: 275px;
    }
    .table-block-top {
        display: flex;
        justify-content: flex-start;
    }
    table {
        max-width: 25%;
        /*display: inline-block;*/
        border: none;
        text-align: center;
        border-collapse: collapse;
        font-size: 1em;
        margin: 0 30px;
    }
    table.first-table {
        padding-left:5px;
    }
    table td, table th {
        border: none;
    }
    
    table tbody td {
        text-align: center;
    }
    .tank-row {
        height: 75px;
    }
    
    

    posted in User help read more
  • B
    bullitbd

    @bullitbd said in Unexpected date/time display behavior:

    Jan 18, 1970 14:55:02

    Thanks for the quick response, Phil. Right you are on number 2...
    to your third point, actually on GMT-08:00, which does explain that!

    The offsets are right - still trying to sort why the epoch value is off by a couple of days +/-. Will keep mucking about here.

    posted in User help read more
  • B
    bullitbd

    We are querying some epoch times via Modbus/tcp, and are experiencing some unexpected behavior:

    modbus register (a double word, 2 input registers) contains: 1551356992;
    data point as 4 byte signed integer, interprets the value differently as 1551302656 with plain formatting, but displays "Jan 18, 1970 14:55:02" when using date/time formatting;

    further, another register contains the value 0; data point interprets correctly as zero, but displays "Dec 31, 1969 16:00:00".

    No doubt serious pilot error here, but I'm at a loss to make any sense of it.

    posted in User help read more
  • B
    bullitbd

    perfect! Not sure how I missed About Mango Java Script - thank you!

    posted in Development general discussion read more
  • B
    bullitbd

    This may seem evident, but trying to figure out a way to log datapoints ONLY while an external process is running - perhaps by triggering an event in some watchdog point - or by scripting of some sort. Idea is, a process runs for, say, 3 hours per day; for a variety of reasons (charting being one of them), several points are logged at second or even sub-second intervals but don't want them logged when the external process is idle. Communication is via modbus, primarily TCP.

    Perhaps its possible to prevent (or enable, for that matter) modbus reads depending on a datapoint state.

    Any thoughts appreciated!

    posted in Development general discussion read more