cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Enhanced Engine Failure Visualization Part 3

No ratings

 

 

Step 7: Add Grid

 

It might also be helpful to display the data you've used to build the ThingWorx Analytics model.

 

In the future, this might be split out into an entirely separate page/Mashup that is exclusively devoted to backend model creation, but that would be beyond the scope of this guide.

 

For now, we'll simply display that collected data via the Grid Widget

 

   1. On the EEFV_Mashup, drag-and-drop a Grid Advanced Widget onto the bottom-left Canvas section..

 

IoTProductMgmt_0-1667832229096.png

 

2. On the top-right Data tab, click the green </> button beside Things_EdgeThing.

  • Note that this will open the Add Data pop-up, but with EdgeThing pre-selected.

IoTProductMgmt_1-1667832229099.png

 

3. In the Services Filter field, type getproperties.

 

4. Click the right-arrow beside GetProperties to add it to Selected Services on the right.

 

5. Check Execute on Load.

 

IoTProductMgmt_2-1667832229100.png

 

6. Click Done.

 

7. Under the Data tab, expand GetProperties to reveal the options.

 

IoTProductMgmt_3-1667832229102.png

 

8. Drag-and-drop Things_EdgeThing > GetProperties > infoTableProperty onto the Grid Advanced Widget.

 

IoTProductMgmt_4-1667832229118.png

 

9. On the Select Binding Target pop-up, click Data.

 

IoTProductMgmt_5-1667832229129.png

 

10. Click Save.

 

11. Click View Mashup.

 

IoTProductMgmt_6-1667832229142.png

 

 

 

Step 8: Add Controls

 

Throughout this Learning Path, it has been recommended that you stop Analysis Events when not actively using their functionality.

 

However, this requires going into the backend of ThingWorx Analytics to disable the event, which is not ideal.

 

Instead, let's enable or disable the Analysis Event from inside the Mashup by adding some Button Widgets to directly interface the Analytics backend for us.

 

    1. Click the bottom-right Canvas section to select it.

 

IoTProductMgmt_0-1667832811204.png

 

    2. In Mashup Builder top-left, click the Layout tab.

 

IoTProductMgmt_1-1667832811208.png

 

    3. Under Positioning, click the Static radio-button.

 

IoTProductMgmt_2-1667832811211.png

 

    4. Click the Widgets tab.

 

    5. Drag-and-drop a Button Widget onto the bottom-right section.

 

IoTProductMgmt_3-1667832811217.png

 

    6. Drag-and-drop another Button Widget onto the bottom-right section.

 

    7. Drag-and-drop a Text Field Widget onto the bottom-right section.

 

    8. Click Save.

 

IoTProductMgmt_4-1667832811222.png

 

 

Bring in More Data

 

Now that we have Buttons to trigger enable/disable, as well as a Text Field to display information,

we now need to bring in some additional Mashup Data Services to interact with the ThingWorx Analytics backend.

 

    1. Click the green + button at the top of the Data tab.

 

    2. In the Entity Filter field, search for and  select TW.AnalysisServices.EventManagementServicesAPI.

 

    3. In the Services Filter field, search for and add QueryAnalysisEvents by clicking the right arrow.

 

    4. Check Execute on Load.

 

IoTProductMgmt_5-1667832811225.png

 

    5. In Services Filter, search for and select EnableAnalysisEvent by clicking the right arrow.

  • Note that you should NOT check "Execute on Load", as we'll trigger this Service only when the Button is clicked.

    6. In Services Filter, search for and select DisableAnalysisEvent by clicking the right arrow.

  • Likewise, do NOT check "Execute on Load" here either.

IoTProductMgmt_6-1667832811227.png

 

    7. Click Done.

 

IoTProductMgmt_0-1667841076158.png

 

    8. Click Save.

 

 

Display Event Key

 

To enable or disable Analytics Events, we need to know the eventId, which is returned by QueryAnalysisEvent Service as the parameter labeled key.

 

We'll bind that to the Text Field Widget for later usage in enabling/disabling.

 

     1. Change the top-button's Label Property to Enable Analytics Event.

 

    2. Change the bottom-button's Label Property to Disable Analytics Event.

 

IoTProductMgmt_1-1667841076171.png

 

    3. Under the Data tab, expand QueryAnalysisEvents > Returned Data > All Data to reveal the options.

.IoTProductMgmt_2-1667841076173.png

 

    4. Drag-and-drop QueryAnalysisEvents > Returned Data > All Data > key to the TextField Widget.

 

IoTProductMgmt_3-1667841076178.png

 

    5. On the Select Binding Target pop-up, click Text.

 

IoTProductMgmt_4-1667841076181.png

 

    6. Click Save.

 

 

Enable/Disable Analytics Events

 

Now that we know the key/eventId, we can call the EnableAnalysisEvent and DisableAnalysisEvent services.

 

    1. Under the Data tab, expand EnableAnalysisEvent > Parameters to reveal eventId.

 

    2. Click the Text Field Widget to select it, and then click the top-left drop down to reveal the options.

 

IoTProductMgmt_5-1667841076184.png

 

    3. Drag-and-drop the Text Field's Text Property onto EnableAnalysisEvent > Parameters > eventId.

 

IoTProductMgmt_6-1667841076196.png

 

    4. Repeat steps 1-3 for DisableAnalysisEvent.

 

IoTProductMgmt_7-1667841076207.png

 

    5. Click the Enable Analytics Event Button Widget to select it, then click the top-left to reveal the drop down option

.IoTProductMgmt_8-1667841076207.png

 

    6. Drag-and-drop the Clicked Event onto the EnableAnalysisEvent Service under the Data tab.

 

IoTProductMgmt_9-1667841076221.png

 

    7. Repeat steps 5-6 for DisableAnalysisEvent, using the other Button Widget.

 

IoTProductMgmt_10-1667841076236.png

 

    8. Click Save

 

 

Step 9: View Mashup

 

Throughout this guide, we've added various additional functionality to our MVP Mashup. At this point, you could continue to update the Mashup as you see fit.

 

For instance, you could change the background color of the top-left section to better match the header. Or you could further modify the original Mashup shown in the Contained Mashup Widget so that it better fits in the allowed space. You could add another Label Widget to the Header section to also display the company's motto / tag-line.

 

Regardless, when you are done with modifications, Save and click View Mashup.

 

IoTProductMgmt_0-1667842102359.png

 

Note that you can left-click-and-drag on the Time Series Chart to select particular time ranges. Or you could add a Time Selector Widget to the bottom-right section to control it there.

 

Similarly, you could add controls for the Grid Widget to only show the Identifier ranges in which you were interested.

 

Or you could split out the Model-creation values to a completely separate Mashup as previously discussed.

 

The extent to which you develop your Mashup is entirely up to you.

 

 

 

 Step 10: Next Steps

 

Congratulations. You've completed the Enhanced Engine Failure Visualization guide.

In this guide, you learned how to:

 

  • Create a Mashup with a Header
  • Divide your Mashup into Sub-sections
  • Use a Contained Mashup to reuse development
  • Store historical data in a Value Steam
  • Display historical data in a Line Chart
  • Show spreadsheet data via a Grid Advanced Widget
  • Tie Mashup controls into the ThingWorx backend

 

This is the last guide in the Vehicle Predictive Pre-Failure Detection with ThingWorx Platform learning path.

 

Learn More

 

We recommend the following resources to continue your learning experience:

 

Capability Guide
BuildImplement Services, Events, and Subscriptions Guide

 

Additional Resources

 

If you have questions, issues, or need additional information, refer to:

 

ResourceLink
CommunityDeveloper Community Forum
SupportAnalytics Manager Help Center
Version history
Last update:
‎Mar 07, 2023 02:54 PM
Updated by:
Labels (2)
Contributors