02-17-2014 12:00 PM
We have a custom error callback in our process model to display errors to the operator. What we'd like to do is if in the sequence editor, use TestStands error handling (where it gives the options to cleanup, terminate, ignore, etc). I don't see the code for that anywhere. I could put in the example so that if in the editor, use the example which has similar options, but that has a different feel and form. Is there a way to programattically use the built in callback vs. the process model callback that we have created?
Solved! Go to Solution.
02-18-2014 11:46 AM
02-18-2014 12:11 PM
I can see how you can change the station options setting with that, but that doesn't impact how the callbacks work. Our process model has a callback for when a RTE occurs that we want to display to our operators a very generic message with no options. When running in the sequence editor, we'd like to have our developers have more options. The only way around this currently is to rename the callback sequence temporarily in the process model so it is no longer the RTE callback. But that is a real pain. I'd like to have the option to use our generic display or the build in error handling depending on if IsEditor is true. But I don't see a way to launch the TestStand built in error handling, which is the attached image here, which has some nice options for Run Cleanup, Retry, Ignore, Abort as well as Break and Don't show again.
02-19-2014 02:55 PM
02-19-2014 02:58 PM
we are running TestStand 2012 SP1, can you do your example in the older version? I can't open as is (I assume 2013 is what you did this in).
02-19-2014 03:56 PM
Sorry about that. Try this one.
02-19-2014 04:00 PM
@Sir_Mutt wrote:
We have a custom error callback in our process model to display errors to the operator. What we'd like to do is if in the sequence editor, use TestStands error handling (where it gives the options to cleanup, terminate, ignore, etc). I don't see the code for that anywhere. I could put in the example so that if in the editor, use the example which has similar options, but that has a different feel and form. Is there a way to programattically use the built in callback vs. the process model callback that we have created?
I think if you just do nothing in the error callback if you are inside the editor then it will work like you are wanting it to. You should be able to check Engine.ApplicationIsEditor in your callback to determine if you should do something or not.
-Doug
02-20-2014 06:55 AM
Thanks Much. That was much simpler than I thought it would be. Brilliant.
02-20-2014 11:20 AM
@friday_the_13th wrote:
Sorry about that. Try this one.
What this example shows in cleanup is not necessarily correct. That is causing the error to be ignored. If you instead want cleanup to happen as happens normally when an error occurs you can do the following instead to avoid the dialog:
RunState.Caller.RunState.ErrorReported = true
The basic idea is to do nothing in the callback when in an editor if you want to have the normal default behavior.
-Doug