• 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

    Dropdown selection for datapoint values

    User help
    2
    23
    7.0k
    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.
    • R
      RonnyHinkel @MattFox
      last edited by

      @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>
      
      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by

        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.

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        R 1 Reply Last reply Reply Quote 0
        • R
          RonnyHinkel @MattFox
          last edited by

          @mattfox

          0_1595302200187_Screenshot 2020-07-21 at 11.29.40.png

          R 1 Reply Last reply Reply Quote 0
          • R
            RonnyHinkel @RonnyHinkel
            last edited by

            @MattFox
            0_1595302363307_Screenshot 2020-07-21 at 11.32.08.png

            1 Reply Last reply Reply Quote 0
            • MattFoxM
              MattFox
              last edited by

              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

              Do not follow where the path may lead; go instead where there is no path.
              And leave a trail - Muriel Strode

              1 Reply Last reply Reply Quote 0
              • MattFoxM
                MattFox
                last edited by

                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 the to attribute or subtract for the from attribute...

                Fox

                Do not follow where the path may lead; go instead where there is no path.
                And leave a trail - Muriel Strode

                R 1 Reply Last reply Reply Quote 0
                • R
                  RonnyHinkel @MattFox
                  last edited by

                  @mattfox

                  the timestamp would be from Serial number to Serial Number+1

                  1 Reply Last reply Reply Quote 0
                  • MattFoxM
                    MattFox
                    last edited by MattFox

                    Then what do you do when you use the latest serial number? Go from that timestamp to now?

                    Do not follow where the path may lead; go instead where there is no path.
                    And leave a trail - Muriel Strode

                    R 1 Reply Last reply Reply Quote 0
                    • R
                      RonnyHinkel @MattFox
                      last edited by

                      @mattfox
                      yes you're correct

                      1 Reply Last reply Reply Quote 0
                      • MattFoxM
                        MattFox
                        last edited by

                        @ronnyhinkel said in Dropdown selection for datapoint values:

                        ng-change="callOnChange()"

                        ng-change="callOnChange()"
                        Are you writing your own controller?

                        Do not follow where the path may lead; go instead where there is no path.
                        And leave a trail - Muriel Strode

                        R 1 Reply Last reply Reply Quote 0
                        • R
                          RonnyHinkel @MattFox
                          last edited by

                          @mattfox
                          no thats just a left over from trying, sorry about that

                          1 Reply Last reply Reply Quote 0
                          • MattFoxM
                            MattFox
                            last edited by MattFox

                            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

                            Do not follow where the path may lead; go instead where there is no path.
                            And leave a trail - Muriel Strode

                            R 1 Reply Last reply Reply Quote 0
                            • R
                              RonnyHinkel @MattFox
                              last edited by

                              @mattfox
                              Perfect thats working for me

                              Thank you very much Mattfox

                              1 Reply Last reply Reply Quote 0
                              • MattFoxM
                                MattFox
                                last edited by

                                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

                                Do not follow where the path may lead; go instead where there is no path.
                                And leave a trail - Muriel Strode

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