02-01-2006 12:25 PM
Hello all
I just want to change the look and feel of the buttons in operator interface Like Break/Resume, logout etc. buttons.
I.e. I want to set background images for these buttons. Basically in .net, button controls have a property background image to achieve this but for the test stand ActiveX button I couldn't find any these kinds of properties is there any way to do it??
And need one more clarification
We want to enter some notes in between the test process, or end of test sequence (i.e. notes - the reason for the test pass/fail) is there any way to achieve this??
02-01-2006 05:13 PM
The TestStand UI Buttons do not expose any methods or properties to change a background image. If you wish to have this behavior, you will have to create your own controls, and respond to Events coming from the Manager Controls to update the controls (text/visibility/etc...).
If you wish to add notes, I would suggest adding code to the process model (if you wish to have this functionality to every sequence and change the testing process), or in a model callback (if you wish to have this functionality in only some sequences).
Let me know if you need any more details on these topics.
Allen P.
NI
02-01-2006 11:47 PM
Hi thanks allen
I have used this command
axSequenceFileViewMgr.ConnectCommand(axEntryPoint1Button , CommandKinds.CommandKind_ExecutionEntryPoints_Set, 0, CommandConnectionOptions.CommandConnection_NoOptions);
when I try to pass windows button control as 1st parameter in the function it throws me a exception “INVALID CAST EXCEPTION”, ie. It is accepting only the National instrument ActiveX Button controls right??
How to add properties(backGround Image) to these Activex controls could u please post me some sample code(in C#).
Or I have button control which has all the properties how to use this one for the above purpose?
And regarding the second one u r talking about the sequence , I want to enter notes for each and every test step in the sequence and also at the end of the sequence ?? can u send me some sample regarding on this.
Thanks & Regards,
Srini
02-02-2006 10:52 AM
Srini,
You are correct, the manager controls only know how to accept the TestStand UI Button Controls (or other TestStand UI Controls). As I posted in the first message, there is no property or method exposed in these controls that will allow you to set a background image.
As an alternative, you can create your own control, and rather than using the ConnectCommand API method, create your own callback function on an event, and use the function ApplicationMgr.GetCommand(....) (or other managers depending on the command), and Command.Execute. Since the button is not hooked up to your manager controls, you will also have to manage when to make this control visible or disabled, and when to change the text of the button. The best place to do this is through the Events of the Manager Controls.
If you would like to execute some piece of code after every step, you would want to insert PostResultListEntry. You can do this at the Sequence File or Process Model level. By putting it in the Sequence File, this behavior will happen for every step (that is recording results). For this example, I am just putting the notes into the ReportText field for each step. I am ignoring the notes regarding the Sequence Execution, but you could insert code here to do this.
Let me know if you have any more questions.
Allen P.
NI
02-03-2006 04:43 AM
Again Thanks Allen,
My second problem has been solved either I can modify PostUUT call back or put a message box in between the test steps.
But I am struggling with first problem, will it be difficult to use my own control and commanding the teststand through applicationmanager.Getcommand method. Because I have to look the state of the button in each and every process (like visible/text/disabled) as you have told like.
Is it possible for you to add properties to change a background image of the test stand UI button?
Basically I need only two properties
(Look at the Picture attached)
If it is possible, change the code (to have these properties) sends me as the dll.
Sorry for the inconvenience.
I need these things for the button alone not for every controls.
Please…...
Thanks and regards,
Srini
02-03-2006 04:50 AM
Sorry the picture attached with this message.
Regards,
Srini
02-03-2006 10:27 AM
Unfortunately, it is not possible to change the background image. However, you can use the event MouseDown if you wish to know when the button is clicked.
It is more difficult to use your own button, but if you look at the old 2.0 Style Operator Interfaces, it will show you the basics on how this type of control was done.
Hope this helps!
Allen P.
NI