• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Filter Device Name after Tag Select

    Dashboard Designer & Custom AngularJS Pages
    2
    8
    1.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Pikey4
      last edited by

      Hello Again,

      I'm looking at a way to use Tags to Label specific Project locations then Device name will be the Plant or equipment at that site, then point names etc.

      Not sure if this below is an easy way to build a quick chart, I'm wanting to select the data point tag (Site) first then filter only device names related to that tag. I just can't figure out what the query would be or if I'm headed in the wrong direction.

      Also is there a way to Build the serial chart so that say the first two points automatically left axis then the next two points auto to the right?? or something like that??

      Thanks In advance as always.

      Cheers!

      <div layout="column" ng-init="points=[]">
          
          <md-input-container flex="">
              <ma-data-point-tag-select ng-model="maDataPointTagSelect" key="Site" ng-init="maDataPointTagSelect='68 Terrace Rd'"></ma-data-point-tag-select>
                  </md-input-container>
                  
          <md-input-container>
              <label>Plant or Equipment for the selected Project</label>
              <ma-device-name-list ng-model="DeviceName" query="???????"></ma-device-name-list>
                  </md-input-container>
                  
          <md-input-container flex="">
              <label>Add a point</label>
              <ma-point-list limit="200" ng-model="point" init-point="false" ng-change="point &amp;&amp; points.push(point); point=null"></ma-point-list>
          </md-input-container>
      </div>
      
      <md-chips ng-model="points" name="name" readonly="true" md-max-chips="4">
          <md-chip-template ng-click="points.splice($$replacedScope.$index,1)">
              <strong>{{$chip.name}}</strong>
              <em>({{$chip.deviceName}})</em>
              <md-icon>close</md-icon>
          </md-chip-template>
      </md-chips>
      
      <ma-point-values points="points" values="combined" 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%" values="combined" points="points" legend="true">
      </ma-serial-chart>
      
      

      Mango Core version: 3.5.6
      Mango API module version: 3.5.2
      MangoUi module version: 3.5.5
      Platform: 10.14 MacOS Mojave
      Chrome: Version 70.0.3538.110 (64-bit)

      1 Reply Last reply Reply Quote 0
      • P
        Pikey4
        last edited by

        I tried this one also but doesn't seem to like it.

        Any help appreciated.

        0_1544511058378_Screen Shot 2018-12-11 at 2.50.11 pm.png

        <div layout="column" ng-init="points=[]">
            
            <md-input-container flex="">
                <ma-data-point-tag-select ng-model="maDataPointTagSelect" key="Site" ng-init="maDataPointTagSelect='68 Terrace Rd'"></ma-data-point-tag-select>
                    </md-input-container>
                    
            <md-input-container>
                <label>Plant or Equipment for the selected Project</label>
                
                <ma-device-name-list ng-model="DeviceName" source-id="maDataPointTagSelect"></ma-device-name-list>
                    </md-input-container>
                    
            <md-input-container flex="">
                <label>Add a point</label>
                <ma-point-list query="{deviceName: DeviceName}" limit="200" ng-model="point" init-point="false" ng-change="point &amp;&amp; points.push(point); point=null"></ma-point-list>
            </md-input-container>
        </div>
        
        

        Mango Core version: 3.5.6
        Mango API module version: 3.5.2
        MangoUi module version: 3.5.5
        Platform: 10.14 MacOS Mojave
        Chrome: Version 70.0.3538.110 (64-bit)

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by

          Hi Pikey4,

          I suspect you could figure it out with two details: the device name is also stored under the 'device' tag, and the <ma-data-point-tag-select> component takes in a map of other tags and values, see /ui/docs/ng-mango/ma-data-point-tag-select

          So,

          <div layout="column" ng-init="points=[]">
              
              <md-input-container flex="">
                  <ma-data-point-tag-select ng-model="maSiteTagSelect" key="Site" ng-init="maSiteTagSelect='68 Terrace Rd'"></ma-data-point-tag-select>
                      </md-input-container>
                      
              <md-input-container>
                  <label>Plant or Equipment for the selected Project</label>
                  
                  <ma-data-point-tag-select ng-model="maDeviceSelect" key='device' restrictions="{Site:maSiteTagSelect}" ></ma-data-point-tag-select>
                      </md-input-container>
                      
              <md-input-container flex="">
                  <label>Add a point</label>
                  <ma-point-list ng-if="maDeviceSelect!==undefined && maSiteTagSelect!==undefined" query='"and(eq(deviceName,"+maDeviceSelect+"),eq(tags.Site,"+maSiteTagSelect+"))"' ng-model="point" init-point="false" ng-change="point &amp;&amp; points.push(point); point=null"></ma-point-list>
              </md-input-container>
          </div>
          

          I also reworked the query so that it would check the Site tag as well in getting the list of data points. Sometimes the RQL syntax can be complicated!

          1 Reply Last reply Reply Quote 0
          • P
            Pikey4
            last edited by

            Thanks Phil,

            I hadn't Considered this as an option so that is great.

            Is there a way to alter the default label - "Select a value for device"

            0_1544571341780_Screen Shot 2018-12-12 at 7.35.33 am.png
            as it doubles up if I have a <label>Plant or Equipment for the selected Project</label>

            @phildunlap said in Filter Device Name after Tag Select:

            I also reworked the query so that it would check the Site tag as well in getting the list of data points. Sometimes the RQL syntax can be complicated!

            Cheers, I am not up to speed with RQL stuff......Back to Khan Academy for me.

            @pikey4 said in Filter Device Name after Tag Select:

            Also is there a way to Build the serial chart so that say the first two points automatically left axis then the next two points auto to the right?? or something like that??

            Did you have any comment on this query?

            Thanks Again!

            Mango Core version: 3.5.6
            Mango API module version: 3.5.2
            MangoUi module version: 3.5.5
            Platform: 10.14 MacOS Mojave
            Chrome: Version 70.0.3538.110 (64-bit)

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by

              Certainly!

              You can preload the ma-serial-chart with series-n-axis desginations, like

              series-1-axis="left" series-2-axis="left" series-3-axis="right" series-4-axis="right"

              but that may have an initial display issue. It also may only be supported up to 99

              Someone else may contribute a cleaner way of doing it.

              1 Reply Last reply Reply Quote 0
              • P
                Pikey4
                last edited by

                Gee Wizz!!!!!

                How did I not think of that??

                Thank Phil,

                Mango Core version: 3.5.6
                Mango API module version: 3.5.2
                MangoUi module version: 3.5.5
                Platform: 10.14 MacOS Mojave
                Chrome: Version 70.0.3538.110 (64-bit)

                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  How did I not think of that??

                  Because it's...... hard code

                  :-)

                  1 Reply Last reply Reply Quote 0
                  • phildunlapP
                    phildunlap
                    last edited by phildunlap

                    To the question of the text in the tag select box, it looks like that's done with transclusion like,

                        <md-input-container>
                            <ma-data-point-tag-select ng-model="maDeviceSelect" key='device' restrictions="{Site:maSiteTagSelect}" >
                                <ma-label>Plant or Equipment for the selected Project</ma-label>
                            </ma-data-point-tag-select>
                        </md-input-container>
                    

                    And to the initial display issue if you do hardcode the series axis sides, you should be about to do something like,

                    <ma-serial-chart ng-if="points.length > 0" .... ></ma-serial-chart>
                    

                    to prevent it from showing up when empty with an enormous legend.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post