How can we send DateTime from Vuforia Studio to ThingWorx
Oct 23, 2024
06:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Oct 23, 2024
06:12 AM
How can we send DateTime from Vuforia Studio to ThingWorx
Hello Everyone,
Good Afternoon,
I want to send Start Time & End Time of experience from Vuforia Studio into ThingWorx.
Can anyone guide me how can I achieve it?
Thanks in advance.
Regards,
Aditya Gupta
2 REPLIES 2
Oct 23, 2024
10:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Oct 23, 2024
10:17 AM
Article - "How to write data to a ThingWorx stream from Vuforia Studio": https://www.ptc.com/en/support/article/CS304458
Nov 07, 2024
09:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Nov 07, 2024
09:41 AM
Hi @Aditya1702,
I want to add some further details to the answer of @VladimirN which referes to techniques showing how to wirte an entry to TWX log . There some addtional taks to complete the task
- Question when you need to call that twx service and how to prepare the time string:
- you can use some events e.g. when you enter a view
$scope.$on('$ionicView.afterEnter', function() { // when you enter a view , you can call that from there })
- or any other what you want to log mentioned in https://community.ptc.com/t5/Vuforia-Studio-and-Chalk-Tech/List-of-Vuforia-Studio-events-which-we-could-be-used-as-listener/ta-p/613258
- you can write an etry to log when you use $scope.navigate(<view>) or when you call
- use a time as https://support.ptc.com/help/vuforia/studio/en/#page/Studio_Help_Center%2FIntermediateJSInterval.html%23wwID0EG1AU
- when you try to open a new experience as mentioned in https://support.ptc.com/help/vuforia/studio/en/#page/Studio_Help_Center%2FTutorialExperienceFromExperience.html%23wwID0ESCFU
- bevore you go to scan mode ... e.g using the api call
$scope.app.fn.navigateToScanMode()
-what string you will write there .e.g. the timestring
- the generation of the time string in javascript is some think like that:
//================================================================================================= $scope.getTime = function() { var date = new Date(); var h = date.getHours(); // 0 - 23 var m = date.getMinutes(); // 0 - 59 var s = date.getSeconds(); // 0 - 59 var session = "AM"; if(h == 0){h = 12;} if(h > 12){h = h - 12;session = "PM";} h = (h < 10) ? "0" + h : h; m = (m < 10) ? "0" + m : m; s = (s < 10) ? "0" + s : s; var time = h + ":" + m + ":" + s + " " + session; return time; }
