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

Vuforia View app crashes when the property value changes

Regular Member

Vuforia View app crashes when the property value changes

Hi,

I would like to play a certain sequence, which i already created in my Creo Illustrate model, when the bool value changes in the PLC.
After entering the JS code I have the problem that the app sporadically crashes.
But usually it happens when the value to be monitored changes.

 

I tried to play the sequence by using the watch function

 

$scope.PlaySequence = function ()
{
$timeout (function() {
$scope.app.view.Startseite.wdg["model-1"].currentStep = 17;
$timeout(function () {
$scope.$root.$broadcast('app.view["Startseite"].wdg["model-1"].svc.play');},250);},250);
$scope.$applyAsync(()=>{angular.element(document.getElementById('model-1')).scope().reset();});
return;

};

 

$scope.$watch(function(scope)
{
return $scope.app.mdl.HoRe_ALL.properties.TestBool
},

function ()
{
$scope.PlaySequence();
}
);

 

Can someone tell me what I'm doing wrong with this function?

 

 

Yours sincerely
Marco

2 REPLIES 2
Highlighted

Re: Vuforia View app crashes when the property value changes

@Hi @MarcoNFT ,

 

I believe one problem which may   occur - is  when you are loading your project and the value changed but the model is not loaded yet.  If this is the problem you can avoid it  when you embed the watch construct inside the model Load event:

 

$rootScope.$on('modelLoaded', function() {  
/////////////////////////////////////////////
$scope.$watch(function(scope)
{
return $scope.app.mdl.HoRe_ALL.properties.TestBool
},

function ()
{
$scope.PlaySequence();
}
);
/////////////////////////////////////////
})

 

Re: Vuforia View app crashes when the property value changes

Hi Roland,

 

first of all. Thanks for your help. Sounds like a possible solution.

I'm going to try this as soon as possible  and will give a feedback.

 

 

Best regards

Marco

Announcements
Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection