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

Re: Problems with playing sequences on HoloLens

bgračnar
8-Gravel

Re: Problems with playing sequences on HoloLens

Hi,

<this is a new post based on a  quesiton to the old topic >

sequences are now working quite better.

Does anyone have a clue how to play 2 or more sequences on hololens?

 

 

Regards,

Bojan

2 REPLIES 2

Hi @bgračnar

yes this is possible via javaScript. Example for playing of 2 sequneces

*********/
 $scope.app.sequence1 = function() {  
     console.log("called $scope.sequence1");
     $scope.view.wdg['model-1']['sequence'] = 'app/resources/Uploaded/l-Creo 3D - fig_1.pvi';  
     $timeout(  
       //////////////////////////////////////////          
         //function() {angular.element(document.getElementById('model-1')).scope().playAll();}
       /////////////////////////////////////////
         function() { $scope.$broadcast('app.view["Home"].wdg["model-1"].svc.playAll');
                      $scope.$applyAsync();
       //////////////////////////////////////////            
                   },1000);  
     console.log("finished $scope.sequence1");
}  
  
$scope.app.sequence2 = function() {  
     console.log("called $scope.sequence2");
     $scope.view.wdg['model-1']['sequence'] = 'app/resources/Uploaded/l-Creo 3D - fig_2.pvi';  
     //$timeout(function() {angular.element(document.getElementById('model-1')).scope().playAll();},1000);
      $timeout(  
       
         function() { $scope.$broadcast('app.view["Home"].wdg["model-1"].svc.playAll');
                      $scope.$applyAsync();
       //////////////////////////////////////////            
                    },1000);

   console.log("finished $scope.sequence2");
}  


$scope.app.sequence = function() {  
    $scope.app.sequence1();  
    $scope.app.sequence2();  
}  

Ok the code above could work ok but there is another version which is more stable when you try  to play a sequence  on start / after model loaded event.

Here is another example which is more robust . There are  2 different functions for the calling of  play respectively  playAll .

 

$scope.app.loadsequence = function()
	{ $scope.setWidgetProp('model-1', 'sequence', "app/resources/Uploaded/l-Creo 3D - TestFigure1.pvi"); 
	  twx.app.fn.triggerWidgetService("model-1", 'play'); 
    };
///////
 $rootScope.$on('modelLoaded', function()
               {$scope.app.loadsequence();
                console.warn("$scope.app.loadsequence() executed");                         
 				$timeout( function() {
                          $scope.app.loadsequence();
                          console.warn("app.loadsequence() executed");                           
                          $scope.$applyAsync();
                                     }, 1000);
                                          
                                          });


$scope.app.loadsequence1 = function()
	{ $scope.setWidgetProp('model-1', 'sequence', "app/resources/Uploaded/l-Creo 3D - SecondTestFigure.pvi"); 
	  twx.app.fn.triggerWidgetService("model-1", 'playAll'); 
    };

I think it is possible to execute more than one sequence consecutively  in particular order. I could not remember if this was working but if there is a problem we can try to call the next sequence from the step-completed event of the last step (ok this requires some additional checks) but we need to consider this only if we face a problem when calling several sequences consecutively

Roland, 

thank you wery much for answer!

I see that there is option to play one sequence after another.

I guess there is no option to selecting sequences (for service procedures)?

 

Regards,

Bojan

Announcements

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