Dropdown selection for datapoint values
-
<md-select ng-model="serialID" ng-required="true" ng-change="callOnChange()" > <md-option ng-repeat="serial in serials" ng-value="{{serial.value}}" > {{serial.value}} </md-option> </md-select> <ma-point-statistics point-xid="DP_7e9b56ef-578c-4a0a-96bc-289a29ccc37b" from='serialID' to='(serialID+1)' statistics="Ring"></ma-point-statistics>
if i would like to use the SerialID with a MA-point-statistics as a from- to, how i could include those values?
Sorry, really trying since days and have no conclusion yet.Thank you for giving me some help!!!
-
Whoa slow down!
Ok so first we have your latest batch of serials. You can set realtime="false" in the ma-point-values so that it doesn't update via the web socket.
Secondly, now you want to use the serials as a means of timestamp?
Looks like more information is required.
Use to and from with dates to make that happen. I'll look when I'm near a pc what you can use to tie it to the dateBar. However I will need more info from you first as to what you intend the "big picture" to be since the list here appears to be growing.Fox
-
@mattfox
Hi Mattfox
what i'm trying to do is a production report based on serial numbers. for this we have the selection of the serial number. After selection of the serial number, there is a start and end time for each serial number, which i would like to use for every datapoint at this page.<md-select ng-model="serialID" ng-required="true" ng-change="callOnChange()" > <md-option ng-repeat="serial in serials" ng-value="{{serial.value}}" > {{serial.value}} </md-option> </md-select> <ma-point-values point-xid="DP_bf4e8b98-ff25-439c-a63e-4af21bc92902" point="point1" values="point1Values" from="serialID.first.timestamp" to="serialID.last.timestamp" > </ma-point-values>
-
First up, what does serialID look like in the dashboard by itself
just enter the{{serialID}}
into the dashboard markup and show me what the actual value looks like. -
-
-
Ok, for a start, that's just a single number. It's not a javascript object so you can't use that dotted object notation.
Let's look at the raw data coming from the serials values, if it's anything like this:
[ {timestamp:1539247293,value:3}]
the approach will have to be changed.Fox
-
Yep, I think you need to look at changing your format. You need the timestamps as your values.
You also need to establish what your start and end times are per each serial. The timestamp by itself won't be enough unless you know you can comfortably add an additional hour for theto
attribute or subtract for thefrom
attribute...Fox
-
the timestamp would be from Serial number to Serial Number+1
-
Then what do you do when you use the latest serial number? Go from that timestamp to now?
-
@mattfox
yes you're correct -
@ronnyhinkel said in Dropdown selection for datapoint values:
ng-change="callOnChange()"
ng-change="callOnChange()"
Are you writing your own controller? -
@mattfox
no thats just a left over from trying, sorry about that -
Ok, I'm gonna be clever...
<md-select ng-model="serialID" ng-required="true" > <md-option ng-repeat="(index,serial) in serials" ng-value="index" > {{serial.value}} </md-option> </md-select> <div ng-if="serialID==(serials.length-1)"> <ma-now update-interval="15 MINUTES" output="time"></ma-now> <ma-point-values point-xid="DP_bf4e8b98-ff25-439c-a63e-4af21bc92902" point="point1" values="point1Values" from="serials[serialID].timestamp" to="time" ></ma-point-values> </div> <div ng-if="serialID<(serials.length-1)"> <ma-point-values point-xid="DP_bf4e8b98-ff25-439c-a63e-4af21bc92902" point="point1" values="point1Values" from="serials[serialID].timestamp" to="serials[(serialID+1)].timestamp" ></ma-point-values> </div>
Using Ng-if will create these elements provided one of the if statements are met. Using the index allows us to make this list grow wholly depending on the number of your serials. If you're on the last serial, it sees we're using the last index and thus uses a ma-now directive to give us the browser time from the serial creation time!
Fox
-
@mattfox
Perfect thats working for meThank you very much Mattfox
-
You're welcome, sorry for the lack of comments. Let me know if there's anything you don't understand after comparing it with the angularJS docs
Fox