NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Button clicked flashes but must click again for action

It's been a little while, but the issue still exists.

Using TestStand 3.0, CVI 7.0, XP.

I found this code in tsutil.c which has comments that appear to be addressing the problem area.
For some reason, a programmer wanted to ignore the first click on a tab, and added code to do so.

I tried to comment out the first three lines under case EVENT_TAB_CHANGED:
I created a new obj file and copied it to the various directories. I rebuilt modelsupport2 which includes tsutil.
I don't know what other project modules should be re-built. Thus far, the problem hasn't been solved.

As per the comments below, the user is trying to click on a button on different tab than the last mouse click;
the button control (e.g. Test UUT) flickers, but does nothing.

Am I in the right area? What else uses tsutil and needs to be rebuilt to solve this issue? Is there a
similar workaround somewhere else in the TS code that I must modify?


static int CVICALLBACK TS_ExprCtrl_PanelCallback (int panel, int event, void *callbackData, int eventData1, int eventData2)
{
int error = 0;
int activePanel;
int activeCtrl;
TS_ExprCtrl * exprCtrl;
TS_ExprCtrl_Flags flags = (TS_ExprCtrl_Flags)callbackData;


switch (event)
{
case EVENT_LOST_FOCUS:
case EVENT_GOT_FOCUS:
// controls do not get focus events when their panels gain or lose activation. Thus we need to check explicitly
activePanel = GetActivePanel();
if (activePanel > 0)
activeCtrl = GetActiveCtrl(activePanel);
else
activeCtrl = -1;

// This originally only visited the panel that got the event. However, apparently you can click on a parent and get a focus
// event without any event going to the previously active child?
errChk( TS_ExprCtrl_UpdatePanelFocusStateForGivenActiveCtrl(panel, TRUE, activePanel, activeCtrl));
break;
case EVENT_TAB_CHANGED:
if (!(flags & kTS_ExprCtrl_UseNormalTabCtrlActivation))
DisableFirstCtrlActivationParentTabCtrl(panel); // force any easytab ctrls to never active a control when switching tabs
else
{
// When you click on an inactive tab, EasyTab might make the first control in the tab active or it might make the tab itself active
// depending on whether a control in the previous tab was active. If makes the control active, it also makes the tab panel active.
// This causes the control to draw. Since we haven't gotten a focus event yet, it has the non-focus display value in it.
// We then get a focus event we then draw the focus display value. Thus the control flickers.
// To fix this, when we get the EVENT_TAB_CHANGED event, we pretend like the control has the focus
// so that it is set to its focus display value. We then post a deferred callback to recheck the focus.
// If easytab sets the control to have the focus and activates the panel, the correct value is already displayed
// and our callback will not change it. If easytab does not activate the panel then our callback will
// set the display value back to non-focus value before the screen is redrawn.

if (eventData1 == panel)
{
int activeCtrl;

if (ActivateFirstCtrl(panel))
{
activeCtrl = GetActiveCtrl(panel);

if (activeCtrl > 0)
{
if (GetChainedCallbackData (panel, activeCtrl, kTS_ExprCtrl_Id, (void **)&exprCtrl) >= 0)
errChk( TS_ExprCtrl_UpdateFocusStateForGivenActiveCtrl(exprCtrl, panel, activeCtrl));
}
}

PostDeferredCallToThread(CheckFocusNow, (void *)panel, CurrThreadId ());
}
}
break;
}

Error:
return 0;
}
0 Kudos
Message 1 of 9
(3,981 Views)
Hi

Can you please post how to exactly reproduce your problem.

ie What are the exact steps where do you click, what do you open etc.

Start with
1. Open CVI full OI
.
.
.

Regards
Anand Jain
National Instruments
0 Kudos
Message 2 of 9
(3,967 Views)
I am running the TestStand 3.0 Full-Featured CVI operator Interface. This is a user modified version (perhaps something I've done has exaserbated the inherent problem).

After Loading a sequence file, run it once.
Click on the List Bar to switch back to the sequence view.
Click on the Test UUT button -- it flickers, but nothing happens.
The user waits, wondering when his test will run.
Click on the Test UUT button a second time -- this time the enter serial number box appears and the run proceeds.
Click somewhere else on the panel, perhaps using a custom feature or in response to a step generated popup.
The sequence stops at a breakpoint.
Click on the Resume button or the Terminate button-- it flickers, but nothing happens.
Click on the Resume button a second time and the sequence proceeds.
0 Kudos
Message 3 of 9
(3,963 Views)
Hi

I tried the shipping CVI OI and did not see any problem using the steps described in your post.

Can you try the shipping version and see if the problem occurs.
If it does not occur can you try to strip down your version to find out what change you made
which causes the problem.

Else contact support and they will be able to help you narrow down the problem

Regards
Anand Jain
National Instruments
0 Kudos
Message 4 of 9
(3,953 Views)
The problem has existed for some time. I don't have time to strip out hundreds of pages of code one line at a time.

The comments in this section of tsutil code indicate that the problem area is here. I need to know what to link the fix with or how to edit the active-x controler for the sequence viw and execution view panels. I don't want to recreate all the functionality of these panels. I just don't want to "DisableFirstCtrlActivationParentTabCtrl(panel); // force any easytab ctrls to never active a control when switching tabs".
0 Kudos
Message 5 of 9
(3,939 Views)
Hi Bob,

Could you attach you CVI OI here, so that we can try to replicate this issue on our side. Hopefully then it'll be easier to break down the problem.

Thanks
SIjinK
National Instruments
0 Kudos
Message 6 of 9
(3,927 Views)
The project currently takes up 792 MB. Which files do you want to look at? I'd prefer to email rather than post in the open.
0 Kudos
Message 7 of 9
(3,923 Views)
Hi Bob,

I just wanted your modified CVI Operator Interface so that I can replicate the list bar issue. I don't really need any of your sequences, I could use one of the example sequences instead.

You can however place your Operator Interface on our FTP site ftp://ftp.ni.com/incoming. These documents on this site can only be accessed by Narional Instruments employees.

Regards

SijinK
National Instruments
0 Kudos
Message 8 of 9
(3,909 Views)
After much fiddling, I've found a solution.

To solve this problem, I had to place the following two lines in two subroutines.

errChk( SetActiveCtrl(gMainWindow.fileTab, FILETAB_PATHINDICATOR));
errChk( SetActivePanel(gMainWindow.fileTab));

They were required in

HRESULT CVICALLBACK ListBar_OnCurPageChanged(CAObjHandle caServerObjHandle, void *caCallbackData, long currentPage)

and

HRESULT CVICALLBACK OnSequenceFileViewMgrSeqFileChanged (CAObjHandle caServerObjHandle, void *caCallbackData, TSUIObj_SequenceFile newFile)
0 Kudos
Message 9 of 9
(3,849 Views)