Cancel
Showing results for 
Search instead for 
Did you mean: 

TxSimulationPlayer: Play operation step by step

Experimenter
Experimenter

Hey there,

 

so I'm selecting a Operation with several Locations. I'd like to move to each to the locations step by step, instead of TxSimulationPlayer.Play(). With Play() I'm able to play the whole simulation at once, but I'd like to do something at each location.

 TxGenericRoboticOperation _genericOperation = _calibrationOperation as TxGenericRoboticOperation;
            TxSimulationPlayer _player = new TxSimulationPlayer();
            _player.SetOperation(_genericOperation);
            TxApplication.ViewersManager.PathEditorViewer.AddOperation(_genericOperation);
            TxObjectList _locations = _genericOperation.GetAllDescendants(new TxTypeFilter(typeof(ITxRoboticLocationOperation)));
            foreach (ITxRoboticLocationOperation op in _locations)
            {
                TxRoboticViaLocationOperation _op = op as TxRoboticViaLocationOperation;
                //Here I'd like to just play until next TxRoboticViaLocationOperation is reached.
_player.Play() }

Am I missing any method?

 

Regards

4 REPLIES

Re: TxSimulationPlayer: Play operation step by step

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

 

This is an OOTB function in Path Editor when your specific operation is loaded.

play.png

 

Best regards

Patrick

Re: TxSimulationPlayer: Play operation step by step

Experimenter
Experimenter

At first thanks for your reply.

I already know the function inside the path editor.

I'd like to call this function with C# code.

 

Regards

Re: TxSimulationPlayer: Play operation step by step

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

 

To do this you can use the CommandExecutor.

TxApplication.CommandsManager.ExecuteCommand("Operations.PlayForwardToOperationStart"); 

I´m not 100% sure "Operations.PlayForwardToOperationStart" is the correct command but let have a try.

 

Best regards

Patrick

 

Re: TxSimulationPlayer: Play operation step by step

Experimenter
Experimenter

Hello Patrick,

 

thanks for your help. This kinda worked for me. I only need to find the correct parameter needed for the command.

 

I managed to find some information about ExecuteCommand:
It is possible that commandIDs (like "Operations.PlayForwardToOperationStart") change with new TX versions.

All commandIDs can be found inside the NewAssembler.xml under the eMPower folder.

 

Regards