• Jared Wiltshire

    @v8dave said in Can't get heading to change:

    This is the error from the console.

    mangoUi~ngMango~ngMangoServices.js?v=f41ab677f738e8ffe5b8:39 Error: <g> attribute transform: Expected number, "rotate()".

    You have not addressed any of the other comments I have made. You can see from that error that myDirection.value is undefined. See above for how to solve and for how to stop the error in the console.

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    @v8dave Have you checked the value of the point is coming through by putting something like this on your page-

    <pre ng-bind="myDirection.value | json"></pre>
    

    Use the Chrome debugger to ensure that the transform attribute is being set correctly on your element. I suspect it may be a scope issue. i.e. your ma-calc element is defining the myDirection variable in a nested scope and it is inaccessible where you are trying to use it.

    Try this - change myDirection to designer.myDirection wherever you use it.

    I would also suggest using the ng-attr- prefix to prevent errors in your console.

    ng-attr-transform="rotate({{myDirection.value}})"
    

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    @cwangv said in How to nest a map element in Dashboard Designer:

    Do I have to modify the html code directly to make this happen?

    Yes, unfortunately the dashboard designer does not currently support dragging/dropping nested elements.

    posted in How-To read more
  • Jared Wiltshire

    Can you please clearly outline the conditions under which
    a) It works
    b) It doesn't work

    You say it works from Safari "within the LAN environment", what exactly do you mean by this? Are you accessing the Mango server by IP address? Is the Mango server on the same subnet?

    When does it not work? Are you accessing the Mango server across the internet? Are you accessing it by domain name? Are you connecting via HTTPS?

    edit. I'll just add this, Safari is not a browser I would ever recommend to use for Mango. It is fine 90% of the time but you definitely might come across scenarios like this. The reason for this is that Apple does not focus on adhering to web standards and therefore there are often compatibility issues with the Safari browser. I would recommend using either Chrome or Firefox wherever possible.

    posted in User help read more
  • Jared Wiltshire

    @hayden_AUS I incorporated a calculator directly into the data point editor for modbus points -
    https://forum.infiniteautomation.com/topic/4477/release-notes-for-modbus-3-6-4

    posted in How-To read more
  • Jared Wiltshire

    @ozone There's actually a CSS class built into Mango which will make this really easy.
    Just add ma-throb-opacity to your ng-class expression.

    ng-class="{'good': myPoint.value === 0, 'warn': myPoint.value === 1, 'alarm': myPoint.value === 2, 'fault': myPoint.value === 3, 'isolated': myPoint.value === 4, 'ma-throb-opacity': myPoint.value > 0 }"
    

    If you want to see how it works, or modify it a bit, the CSS is supplied in this Mango example -
    /ui/examples/single-value-displays/led-indicator

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • Jared Wiltshire

    Here's a screenshot showing the command to build the app, the output, and the running app for those interested -
    0_1568387775335_f035eea9-6f3d-47bf-8970-be5cd7d65907-image.png

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • Jared Wiltshire

    Yep as @CraigWeb said we have been expending a bit of effort recently turning Mango into a PWA (Progressive Web App). We have implemented a service worker which pre-caches all the assets for fast startup time. The next UI module release will let you customize the application name and colors via the UI settings page.

    Next things on our plate for the PWA are:

    • A startup progress screen in the new UI
    • Better offline behavior (currently it just displays a pretty awful looking error message)
    • Push notifications for events (This might be a few releases away, its not as easy as it sounds)

    I gave nativefier a go and it seems to work pretty flawlessly with Mango. Thanks for the heads up, its nice thing to know about. I'll have to do a bit more reading about it but since it is a wrapper around the web app I would assume you can just create the app once and the web app will update itself via the service worker. Very nice.

    We probably wont distribute any native apps like this but it is a very useful tool for people in your scenario.

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • Jared Wiltshire

    It was actually a design decision not to include a "Select all" checkbox on the watch list page. We decided that trying to plot a large number of data points was simply not feasible.

    The BACnet module should definitely have a "Select all" feature / Shift-Click feature though. I will open an issue.

    edit. In fact @phildunlap already created one - https://github.com/infiniteautomation/ma-modules-private/issues/100

    posted in Wishlist read more
  • Jared Wiltshire

    @cwangv said in Cutomizing the tab name:

    Can I be greedy by asking how I can change the icon for the tab as well? Would it be similar in how to change the logoSrc as shown in the same JSON file below:

    The logoSrc in the UI settings only controls the logo at the top left of the UI pages.

    To change the tab icon you have to override the logoX.png (e.g. logo16.png, logo32.png etc) files by placing equivalents in ${MA_HOME}/overrides/web/modules/mangoUI/web/img/

    posted in User help read more
  • Jared Wiltshire

    @v8dave said in How to create data points to handle MQTT from multiple devices?:

    @jared-wiltshire That works for me as I only have about 20 data points per device. By using the device ID as part of the XID, and the topic, this means a simple find and replace in Excel and then save and import works.

    It doesn't really matter either way but you can just leave the XID blank and it will create new unique XIDs for each data point.

    Also we have toyed around with creating a templating system to easily create sets of data points for a device like this but haven't come up with a great solution yet. I am sure it is something that is going to keep coming up, so we could be re-visiting this space.

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    @v8dave said in How to create data points to handle MQTT from multiple devices?:

    I am trying to work out the best way to create the data points in Mango

    I would create the a of data points for a single device using the UI, add a tag like sensorId or just use the device name to identify the device. Then export this set of data points as a CSV. For every new device edit the CSV and re-import. You would only need to change the columns for the topic and the tags and/or device name.

    @v8dave said in How to create data points to handle MQTT from multiple devices?:

    handle this with a drop-down selection to select each device so that the data on the screen switches to that device. I will also have an overview display for all the important sensors that will navigate to the more detailed view.

    Create a tag based watch list and then use this in the dashboard designer.

    posted in Mango Automation general Discussion read more
  • Jared Wiltshire

    @cwangv said in Cutomizing the tab name:

    I can image for an OEM product, this display is quite prominent and it will be really nice to be able to change it.

    There is actually a hidden UI setting which enables you to do this now. If you go to
    /ui/administration/json-store-editor/mangoUI-settings

    Then change the JSON content to

    {
        "titleSuffix": "My app"
    }
    

    You will see the suffix appended to the page title is now different.

    posted in User help read more
  • Jared Wiltshire

    Removing the row from the CSV is the correct course of action if you do not want to modify that point in any way. The available options are CREATE, UPDATE, and DELETE. I will consider adding something like DO_NOTHING or IGNORE for convenience.

    posted in Mango Automation read more
  • Jared Wiltshire

    OK try changing your point to multistate and adding something like this to your controller -

    writeWithCompliment(point, value) {
        const littleEndian = false;
        const buffer = new ArrayBuffer(4); // 4 bytes or 32 bits
        const view = new DataView(buffer);
        
        const valueCompliment = value ^ 0xFFFF;
        view.setUint16(0, value, littleEndian);
        view.setUint16(2, valueCompliment, littleEndian);
    
        return point.setValue(view.getInt32(0, littleEndian));
    }
    

    You should then just able able to call $ctrl.writeWithCompliment(point, 35700) etc from your markup.

    posted in User help read more
  • Jared Wiltshire

    @jflores13 said in Help with 3.6.6 UI Menu and More:

    Nevertheless, about the bug in the UI menu editor, it does sound to me like there is one. Hope you can find it without too much hassle, please tell me if I can be of help, if I should try to recreate the error or whatever.

    Yeah it does sound like it. You probably should not be able to select "Show menu item as folder" when linking to a page either, that option was added for a reason which I wont get into but it doesn't seem to behave correctly when linking to a page.

    Glad you got it working.

    posted in User help read more
  • Jared Wiltshire

    @jmartinez0 said in How to set a Write-only Modbus IP Data point:

    5.- Then I proceeded to create a data point inside my Modbus IP data source that triggers this 4104 offset register and a Write-only type, as the following pic:

    I suspect that due to you are running into a problem with number conversion. If you create a numeric data point (which your screenshot shows) then the value you set to the data point will be coerced into a 64-bit IEEE 754 number. When this is written out to the Modbus device the binary representation will be different to the integer you input, and almost certainly the value written to register 4015 will not be the compliment of register 4014 anymore.

    If you check the checkbox "Multistate numeric" the value will instead be coerced into 32-bit signed integer, which you can get to work but will require a little manipulation with the value you set to the point.

    @jmartinez0 said in How to set a Write-only Modbus IP Data point:

    6.-
    with the method
    this.controllerClick = (variable, value) => {
    variable.value = value;
    };

    I tried to use a virtual data point and this method set the value successfully. But it doesn't work with the Modbus Write-only data point.

    This will absolutely not work for any type of data point assuming variable is a data point. You have to use variable.setValue(value);

    @jmartinez0 said in How to set a Write-only Modbus IP Data point:

    I also tried to use a virtual data point that set the Modbus data point with a scripting data source, but it says to me this error:
    "Permissions failure setting point DP_238a7211-42a8-469c-8b53-444fdc6fd9c2", this XID is the Modbus IP system control key data point.

    Data points have settings that restrict which role is allowed to set them. You must give your script the appropriate role.

    I will get back to you shortly with my proposed solution.

    posted in User help read more
  • Jared Wiltshire

    @jflores13 said in Help with 3.6.6 UI Menu and More:

    Well, I posted the JSON as I found it, didn't manually change anything before posting it here.
    ...
    As you say, it obviously looks screwed up, but I didn't screw it up myself, I actually had to manually fix what you are saying to make the menu work again.

    OK, so it sounds like there is a bug in the UI menu editor somewhere.

    @jflores13 said in Help with 3.6.6 UI Menu and More:

    Created a new desarrollo page and checked "Show menu item as folder".

    Did you create a page or a menu item? These are two distinct things. If you are using the page editor or the dashboard designer you can add a menu item which is linked to the page you are editing. This is why you cannot change the radio buttons as you noted.

    @jflores13 said in Help with 3.6.6 UI Menu and More:

    The page doesn't load anymore.

    Define "doesn't load". Screenshots, errors console messages etc would be useful. Note that the URL will change if you change the menu item's parent.

    @jflores13 said in Help with 3.6.6 UI Menu and More:

    NOTE: When I create a page, the radio buttons that should let me choose between "No content (folder only)", "Link to custom page", "External link", "Template URL" are fixed in "Link to custom page"; it doesn't let me change that.

    To choose these other options create a menu item from the "Edit menu" page.

    If you are just trying to create a folder, you should do so via the "Edit menu" page and set it to "No content (folder only)".

    posted in User help read more
  • Jared Wiltshire

    @jflores13 Your menu structure JSON is screwed up for sure. e.g. you have a state defined with a name desarrollo.monitoreo but there is no parent item defined (e.g. one with a name of desarrollo). This will certainly make things not work correctly.

    I don't know how it ended up like this, whether it was as a result of something you did in the UI or if this is a result of you manually editing the JSON.

    Anyhow, I would recommend removing your custom JSON entirely. Go to /ui/administration/edit-menu and hit "Delete custom menu" then recreate the menu items using the UI.

    If the edit menu page is not working as a result of the screwed up JSON, go to /ui/administration/json-store-editor/mangoUI-menu and replace the JSON with

    {
        "menuItems": []
    }
    

    Key points to note:

    • "abstract" states appear as folders in the menu and cannot be navigated to directly
    • You can't create a state named desarrollo.monitoreo without having another state named desarrollo which should be abstract
    • A state which has a parent of UI will get the side menu and toolbars (these states are named with a prefix of ui.)
    • A state with a parent of "Root" will not get any side menu or toolbars

    posted in User help read more
  • Jared Wiltshire

    Also given the way you are using the trend line @cwangv it is possible you might actually want a guide -
    https://docs.amcharts.com/3/javascriptcharts/Guide

    You can add guides to the value axis and the category axis, see example -

    <ma-watch-list-get ng-model="designer.watchList" parameters="designer.parameters" on-points-change="designer.points = $points" id="c7a76688-a0cb-4444-b0ac-846215027dbd" watch-list-xid="WL_ed918c86-646f-4760-b5af-d9285ff86505"></ma-watch-list-get>
    <div class="ma-designer-root" id="031da823-b132-4fb8-aac6-8b26115371ad" style="width: 1366px; height: 768px; position: relative;">
        <ma-point-values id="8a04f546-f144-468d-abd4-143f50cea62c" points="designer.points" from="dateBar.from" to="dateBar.to" rollup="{{dateBar.rollupType}}" rollup-interval="{{dateBar.rollupIntervals + ' ' + dateBar.rollupIntervalPeriod}}" style="position: absolute; left: 226px; top: 644px;" values="designer.values"></ma-point-values>
        <ma-serial-chart id="4c27166e-bae5-443f-9fae-2467c5e6dac3" style="position: absolute; width: 100%; height: 600px; left: 0px; top: 0px;" values="designer.values" points="designer.points" guides="[{date: dateBar.from.valueOf() + (60 * 60 * 1000), toDate: dateBar.to.valueOf() - (60 * 60 * 1000), fillAlpha: 0.2, fillColor: 'green', lineThickness: 2, lineAlpha: 1}]" options="{valueAxes:[{guides:[{value: 5, toValue: 20, fillAlpha: 0.2, fillColor: 'blue', lineThickness: 2, lineAlpha: 1}]}]}"></ma-serial-chart>
    </div>
    

    0_1567613673335_e72850a7-2b63-41c6-ad88-bd76d2d2d357-image.png

    posted in How-To read more