Filter Device Name after Tag Select
-
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 && 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>
-
I tried this one also but doesn't seem to like it.
Any help appreciated.
<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 && points.push(point); point=null"></ma-point-list> </md-input-container> </div>
-
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-selectSo,
<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 && 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!
-
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"
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!
-
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.
-
Gee Wizz!!!!!
How did I not think of that??
Thank Phil,
-
How did I not think of that??
Because it's...... hard code
:-)
-
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.