• P
    Phillip Weeks

    Interestingly enough Jared I got the info-window working with dynamic content in a separate dashboard using a querystring but if I call this db from another db using its ui-state, the dynamic content breaks as the info-window loses scope on the variables for some reason? If I refresh the window it restores the scope and it can display the dynamic content. So I dunno what it could be, i's curious and frustrating. :)

    posted in User help read more
  • P
    Phillip Weeks

    Strangely enough I had it working with a {{'path'+mypoint.deviceName}} inside the image tag and I could see the all the object inside the info-window. It was dynamically building a filepath out of the DSname and working great. I changed the structure of a few md-cards, and some style stuff and before I realized scope was broken again without doing anything inside the <ma-map section. So something is very odd about it for sure. Is there a way to copy a point variable to a <script> variable?

    posted in User help read more
  • P
    Phillip Weeks

    So I really cannot figure out why some of this works and some of it does not work.
    If I put the two expressions one after the other the value outputs correctly.
    If I remove either of these expressions for one variable no value will display.
    If I try to put either expression in as an image parmeter it will not work but works if I hard code it in. What in the world is going on?

      <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="myValue.lat" long="myValue.lon" map-type="HYBRID" info-window-theme="dark" center="[44.654224,-63.586408]" desktop-height="800px" mobile-height="600px" zoom="13" style="width: 50%; height: 0px;">
                        <marker id="marker1"  position="{{myValue.lat}},{{myValue.lon}}"  icon="{url:'/rest/v2/file-stores/public/Thermostat/red-circle-xxsmall.png'}" draggable="false" on-click="$parent.$ctrl.toggleInfoWindow('Info1', 'marker1')">
                        </marker>
                        <info-window id="Info1">    
                            <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                                <center> 
                                             {{myItem.jaonData.clientname}}  
                                             {{myValue.clientname}}
                                             <br>
                                             {{myItem.jaonData.tonnage}}  
                                             {{myValue.tonnage}}
                                             &nbsp;Ton Unit
                                             <br>
                                             {{myItem.jaonData.installpic}}  
                                             {{myValue.installpic}}
                                             <br>
                                             {{myItem.jaonData.phone}}  
                                             {{myValue.phone}}
                                             <br>
                                             {{myItem.jaonData.address}}  
                                             {{myValue.address}}
                                             <hr>
                                    <img width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="{{myItem.jaonData.installpic}}"></img>
                                </center>
                            </div>
                            </info-window>
                        
                       </ma-map>
    

    0_1565028816541_3451342d-465e-472a-b2d4-744a5fb37ce7-image.png

    and hardcoded...

       <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="myValue.lat" long="myValue.lon" map-type="HYBRID" info-window-theme="dark" center="[44.654224,-63.586408]" desktop-height="800px" mobile-height="600px" zoom="13" style="width: 50%; height: 0px;">
                        <marker id="marker1"  position="{{myValue.lat}},{{myValue.lon}}"  icon="{url:'/rest/v2/file-stores/public/Thermostat/red-circle-xxsmall.png'}" draggable="false" on-click="$parent.$ctrl.toggleInfoWindow('Info1', 'marker1')">
                        </marker>
                        <info-window id="Info1">    
                            <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                                <center> 
                                             {{myItem.jaonData.clientname}}  
                                             {{myValue.clientname}}
                                             <br>
                                             {{myItem.jaonData.tonnage}}  
                                             {{myValue.tonnage}}
                                             &nbsp;Ton Unit
                                             <br>
                                             {{myItem.jaonData.installpic}}  
                                             {{myValue.installpic}}
                                             <br>
                                             {{myItem.jaonData.phone}}  
                                             {{myValue.phone}}
                                             <br>
                                             {{myItem.jaonData.address}}  
                                             {{myValue.address}}
                                             <hr>
                                             <img  width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="{{'/rest/v2/file-stores/public/Res_Client_Pics/SBUTLER1.jpg'}}"></img>             
                                             
                                </center>
                            </div>
                            </info-window>
                        
                       </ma-map>
    

    0_1565027932832_35d2d512-060b-4d2d-8d04-d331148e1dc8-image.png

    posted in User help read more
  • P
    Phillip Weeks

    I thought I could recreate the JSON record as a new object inside the info-window scope but it cannot find the dataSourcesArray[0].xid value inside the
    <info-window?? So I still don't know how to resolve the scope issue. Seems like I lose reference to the variables inside the info-window. Surely this is a known issue else there would be plenty of examples of it working.

    posted in User help read more
  • P
    Phillip Weeks

    Sorry for switching the nomenclature there I rewrote it a few times so I changed the names but I went back to the original and did and created the instance in an outside div and still no sign of them within the info-window

       <div ng-init="InfoRecord = {}">
                          <ma-json-store xid="{{dataSourcesArray[0].xid}}" item="InfoRecord" value="InfoValue"></ma-json-store>
                          {{InfoValue.name}} {{InfoValue.xid}} {{InfoValue.tonnage}} {{InfoValue.lat}} {{InfoValue.lon}}
                        
                          <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="InfoValue.lat" long="InfoValue.lon" map-type="HYBRID" info-window-theme="dark" center="[44.654224,-63.586408]" desktop-height="800px" mobile-height="600px" zoom="13" style="width: 50%; height: 0px;">
                           
                             <marker id="marker1" position="{{InfoValue.lat}},{{InfoValue.lon}}" icon="{url:'/rest/v2/file-stores/public/Thermostat/red-circle-xxsmall.png'}" draggable="false" on-click="$parent.$ctrl.toggleInfoWindow('Info1', 'marker1')">
                            </marker>
                             
                             <info-window id="Info1">    
                                <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                                    <center> <h3>Lat: {{InfoValue.lat}}</h3><br>
                                                Lon: {{InfoValue.lon}} <hr>
                                        <img width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="/rest/v2/file-stores/public/Q-Lofts_xSmallPic.png"></img>
                                    </center>
                                </div>
                            </info-window>
                            </ma-map>
                           
                           </div>
                        </div>
    

    posted in User help read more
  • P
    Phillip Weeks

    @phillip-weeks said in Help Using <ma-map & <info-window:

    xid="{{dataSourcesArray[0].xid}}

    I used the sames variables that creates the map and marker lat and long inside the info-window and there is still no value for these??
    0_1565014782932_8926c489-a6f4-4eb3-a361-dc1d61c1404f-image.png

    
    
    

    <ma-json-store xid="{{dataSourcesArray[0].xid}}" item="myItem" value="myValue"></ma-json-store>

     <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="myValue.lat" long="myValue.lon" map-type="HYBRID" info-window-theme="dark" center="[44.654224,-63.586408]" desktop-height="800px" mobile-height="600px" zoom="13" style="width: 50%; height: 0px;">
                           
                             <marker id="marker1" position="{{myValue.lat}},{{myValue.lon}}" icon="{url:'/rest/v2/file-stores/public/Thermostat/red-circle-xxsmall.png'}" draggable="false" on-click="$parent.$ctrl.toggleInfoWindow('Info1', 'marker1')">
                            </marker>
                            <info-window id="Info1">    
                                <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                                    <center> <h3>Lat: {{myValue.lat}}</h3><br>
                                                Lon: {{myValue.lon}} <hr>
                                        <img width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="/rest/v2/file-stores/public/Q-Lofts_xSmallPic.png"></img>
                                    </center>
                                </div>
                            </info-window>
                            
    

    posted in User help read more
  • P
    Phillip Weeks

    The map loads a JSON file and renders coordinates properly using values retrieved from this file but I cannot figure out how to get these same JSON variables into the info-window?

     <ma-json-store xid="{{dataSourcesArray[0].xid}}" item="InfoRecord" value="InfoValue"></ma-json-store>
                        {{dataSourcesArray[0].xid}}  --  {{InfoRecord.name}} -- {{InfoRecord.jsonData.name}} -- {{InfoRecord.jsonData.tonnage}}
                    <info-window id="Info1">    
                        <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                            <center> <h4>{{InfoRecord.jsonData.name}}</h4><br>
                                {{InfoRecord.jsonData.tonnage}} Ton Air to Water Heat Pump<br>
                                 {{InfoRecord.jsonData.address}}<br>
                                 {{InfoRecord.jsonData.phone}}
                                <hr>
                                <img width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="/rest/v2/file-stores/public/Q-Lofts_xSmallPic.png"></img>
                              
                            </center>
                              
                        </div>
                        </info-window>
                  
    

    Result:
    0_1565012150056_2c92f9fa-e61b-48d6-ab62-95d025eb4f37-image.png

    posted in User help read more
  • P
    Phillip Weeks

    Problem resolved. So I discovered not all our data sources have identical point names and one of the common points I was using to identify its device name did not exist in certain DS so it reverted to the previous values in the data sources array.
    This was nothing to so with the JSON store functionality and its all working as it should now . :) Thanks again guys.

    posted in How-To read more
  • P
    Phillip Weeks

    Everything works great when <ma-json-store> finds the JSON File matching the current DS xid however when the file is not found, it loads xid values from a previous JSON file creation??

    These expressions have two different values for the dataSourcesArray[0].xid and dataSourcesArray[0].name?

    <ma-json-store xid={{dataSourcesArray[0].xid}} item="ClientInfo" value="myValue"></ma-json-store>

    If the JSON file with the xid doesn't exist this directive loads an xid value and name value in the New ClientInfo record as "DS_549018", "DS_549018",

    yet {{dataSourcesArray[0].xid}} renders "DS_096207" and {{dataSourcesArray[0].name}} is "DRYAN" which is the correct xid and name for the DS in the designer.watchlist.

    0_1564841075975_2c1affeb-c44b-40de-a545-14f754de3de8-image.png

    posted in How-To read more
  • P
    Phillip Weeks

    So I have a more specific question about using the directive
    If we have one json file for each DS how do I seed values in the input boxes with stored data using the directive below and the current DSxid as the json file xid?
    OK so this is retrieving the data.
    Thanks again guys. Great solution!
    <ma-json-store xid={{dataSourcesArray[0].xid}} item="ClientInfo" value="myValue"></ma-json-store>

    0_1564782119957_6f57b3e1-2386-4b3b-b54b-20750036981b-image.png

    posted in How-To read more
  • P
    Phillip Weeks

    Awesome thanks guys didn't know these examples existed. I can definitely see the advantage of this format being a great help for sure and much simpler than the php/ajax/sql route no doubt.

    posted in How-To read more
  • P
    Phillip Weeks

    OK lets talk this out. We store all client information in one JSON file? Then load and search the file for the DS xid at runtime to get the associated values? If this is right can you show an example?

    posted in How-To read more
  • P
    Phillip Weeks

    Ok I am just wondering how others do this? Each datasource on our system represent a unique client location. We want to access the attributes stored in the mysql with row based queries on this db indexed on the DS's xid and return one row for each client/datasource xid. The values describe customer details, name, address, geospatial location data that enables the map api to construct and show map markers and info-windows.

    I suspect others are using jquery/ajax/php to retrieve the data. Am I missing something on how I can use Mango's SQL implementation to do this?

    0_1564757845256_0eed63da-da63-4533-8bc9-3f890ca7504c-image.png
    0_1564757560371_1ed49418-1783-4832-9bd2-068088d517ab-image.png

    posted in How-To read more
  • P
    Phillip Weeks

    So I am attempting to use mysql to store the attribute data for each datasource. I have a mysql table created and keyed on the data source xid's and the table columns are represented as the points. The test returns all rows within the table. But how does one query this database dynamically to get only the one row info I am looking for?

    posted in How-To read more
  • P
    Phillip Weeks

    I noticed that the original Persistent data source has Point locator info for modbus in side its definition.
    So I edited each one of these original Persistent TCP points that were offending and re-saved them and this removed that info and corrected the definitions inside the receiving points and the stream reconnected . Yahoo! Unknown how this modbus details got into the persistent DS to start with?

    posted in User help read more
  • P
    Phillip Weeks

    Phil the log shows a java.lang.ClassCastException... ??

    332 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT.initialize:250) - Initializing
    INFO 2019-07-26 20:02:06,333 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT.initialize:281) - Initialized
    INFO 2019-07-26 20:02:44,959 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT.run:417) - Received socket from /174.117.204.151:45714
    DEBUG 2019-07-26 20:02:44,973 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:684) - /174.117.204.151:45714: client requested version 11
    DEBUG 2019-07-26 20:02:44,974 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:692) - /174.117.204.151:45714: using version 10
    DEBUG 2019-07-26 20:02:45,068 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:717) - /174.117.204.151:45714: authentication ok
    DEBUG 2019-07-26 20:02:45,309 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:769) - /174.117.204.151:45714: ensuring point DP_770839, index: 1
    DEBUG 2019-07-26 20:02:45,309 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.ensurePointV5:1079) - /174.117.204.151:45714: ensuring point DP_770839
    DEBUG 2019-07-26 20:02:45,309 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.ensurePointV5:1089) - /174.117.204.151:45714: point DP_770839 already exists in RT list
    DEBUG 2019-07-26 20:02:45,309 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.updatePointV5:1183) - /174.117.204.151:45714: saving point DP_770839 updates
    DEBUG 2019-07-26 20:02:45,324 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:779) - /174.117.204.151:45714: confirmed DP_770839 with client
    DEBUG 2019-07-26 20:02:45,325 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:769) - /174.117.204.151:45714: ensuring point DP_355921, index: 2
    DEBUG 2019-07-26 20:02:45,325 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.ensurePointV5:1079) - /174.117.204.151:45714: ensuring point DP_355921
    DEBUG 2019-07-26 20:02:45,325 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.ensurePointV5:1089) - /174.117.204.151:45714: point DP_355921 already exists in RT list
    DEBUG 2019-07-26 20:02:45,325 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.updatePointV5:1183) - /174.117.204.151:45714: saving point DP_355921 updates
    DEBUG 2019-07-26 20:02:45,326 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:779) - /174.117.204.151:45714: confirmed DP_355921 with client
    DEBUG 2019-07-26 20:02:45,326 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:769) - /174.117.204.151:45714: ensuring point DP_707338, index: 3
    DEBUG 2019-07-26 20:02:45,326 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.ensurePointV5:1079) - /174.117.204.151:45714: ensuring point DP_707338
    DEBUG 2019-07-26 20:02:45,326 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.ensurePointV5:1089) - /174.117.204.151:45714: point DP_707338 already exists in RT list
    DEBUG 2019-07-26 20:02:45,326 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.updatePointV5:1183) - /174.117.204.151:45714: saving point DP_707338 updates
    WARN 2019-07-26 20:02:45,326 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.run:602) - /174.117.204.151:45714: Connection handler exception
    java.lang.ClassCastException
    INFO 2019-07-26 20:02:47,393 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT.run:417) - Received socket from /174.117.204.151:45716
    DEBUG 2019-07-26 20:02:47,417 (com.serotonin.m2m2.persistent.ds.PersistentDataSourceRT$TcpConnectionHandler.runImpl:684) - /174.117.204.151:45716: client requested version 10
    DEBUG 2019-07-26 20:02:47,417

    Data point Definitions on Cloud and ES:
    Cloud Definition
    {
    "dataPoints":[
    {
    "xid":"DP_770839",
    "name":"BOILER LOOP TEMP",
    "enabled":true,
    "loggingType":"ALL",
    "intervalLoggingPeriodType":"MINUTES",
    "intervalLoggingType":"INSTANT",
    "purgeType":"YEARS",
    "pointLocator":{
    "dataTypeId":3,
    "settable":false
    },
    "eventDetectors":[
    ],
    "plotType":"SPLINE",
    "rollup":"NONE",
    "unit":"°F",
    "simplifyType":"NONE",
    "chartColour":"red",
    "chartRenderer":{
    "type":"IMAGE",
    "timePeriodType":"DAYS",
    "numberOfPeriods":1
    },
    "dataSourceXid":"DS_060715",
    "defaultCacheSize":1,
    "deviceName":"QLOFTS-SYSTEM",
    "discardExtremeValues":false,
    "discardHighLimit":1.7976931348623157E308,
    "discardLowLimit":-1.7976931348623157E308,
    "intervalLoggingPeriod":15,
    "intervalLoggingSampleWindowSize":0,
    "overrideIntervalLoggingSamples":false,
    "preventSetExtremeValues":false,
    "purgeOverride":false,
    "purgePeriod":1,
    "readPermission":"User,PPolley,superadmin,user",
    "setExtremeHighLimit":1.7976931348623157E308,
    "setExtremeLowLimit":-1.7976931348623157E308,
    "setPermission":"superadmin",
    "tags":{
    },
    "textRenderer":{
    "type":"ANALOG",
    "useUnitAsSuffix":true,
    "unit":"°F",
    "renderedUnit":"°F",
    "format":"0"
    },
    "tolerance":0.0
    }
    ]
    }

    ES Definition:
    {
    "dataPoints":[
    {
    "xid":"DP_707338",
    "name":"BOILERS KWH",
    "enabled":true,
    "loggingType":"ON_TS_CHANGE",
    "intervalLoggingPeriodType":"DAYS",
    "intervalLoggingType":"INSTANT",
    "purgeType":"YEARS",
    "pointLocator":{
    "range":"HOLDING_REGISTER",
    "modbusDataType":"TWO_BYTE_INT_SIGNED",
    "writeType":"SETTABLE",
    "additive":0.0,
    "bit":0,
    "charset":"ASCII",
    "multiplier":1.0,
    "multistateNumeric":false,
    "offset":576,
    "registerCount":0,
    "slaveId":212,
    "slaveMonitor":false
    },
    "eventDetectors":[
    ],
    "plotType":"SPLINE",
    "rollup":"NONE",
    "unit":"",
    "templateXid":"BoilerkWh",
    "simplifyType":"NONE",
    "chartColour":"yellow",
    "chartRenderer":{
    "type":"IMAGE",
    "timePeriodType":"DAYS",
    "numberOfPeriods":1
    },
    "dataSourceXid":"DS_QLOFTS_HVAC",
    "defaultCacheSize":1,
    "deviceName":"QLOFTS-SYSTEM",
    "discardExtremeValues":false,
    "discardHighLimit":1.7976931348623157E308,
    "discardLowLimit":-1.7976931348623157E308,
    "intervalLoggingPeriod":1,
    "intervalLoggingSampleWindowSize":0,
    "overrideIntervalLoggingSamples":false,
    "preventSetExtremeValues":false,
    "purgeOverride":false,
    "purgePeriod":1,
    "readPermission":"superadmin",
    "setExtremeHighLimit":1.7976931348623157E308,
    "setExtremeLowLimit":-1.7976931348623157E308,
    "setPermission":"superadmin",
    "tags":{
    },
    "textRenderer":{
    "type":"ANALOG",
    "useUnitAsSuffix":false,
    "suffix":" kW·hrs",
    "format":"0.0"
    },
    "tolerance":0.0
    }
    ]
    }

    posted in User help read more
  • P
    Phillip Weeks

    So I recreated the data sources using the same XID's of the previous points so the ES database has the same XID's and the same modbus offsets and slave id's, everything as the original ES. I compared the clouds points to the ES points and all are either numeric or binary and have same xid's. Still the publisher is not connecting. This is what the connection status is looks like :
    /xxx.117.204.151:37986: 0 points, connected for 44ms, 1 packets received, 0 timeouts

    Connection resets continually.

    How do I enable the logging for the connection negotiation?
    I was not using any prefix before.
    I might add that the original ES was 288 and this replacement ES is 3.6.3 cloud is 3.5.6.

    posted in User help read more
  • P
    Phillip Weeks

    Guys one of our ES systems crashed and I rebuilt the new ES from a backup however there were a group of points recently added to the ES definition and publishing to destination that were not in the backup and so exist on the destination server but not in the new ES definition, Since I am unable to recreate these points, I seem to have trouble getting the new publisher to connect to the existing stream on the destination. I wonder if that is because the number of points are now different from what was last being transmitted.
    If I prefix the XID's the Publisher's data it does create all the points new on the destination however I really want to reconnect to the existing DS on the destination.

    posted in User help read more
  • P
    Phillip Weeks

    Success Terry, it was a capital I in an if statement within a script that was causing the invalidation.. Got it working between excel and open office I got it to preserve the " and all but I get what you are saying about not being strictly required and It probably works in Excel too
    Thank-you for all your guidance here. The new UI scares a bit me if I can jump back to the legacy screen. lol

    posted in User help read more