PtPannelGroup not always working

This one has me baffled. I’m running 6.2.1B PE.

I have a PhAB application that’s almost a year old and has been working
for almost a year. On the base window there is a PtPannelGroup. It contains
four pannels. The pannels can be selected by clicking on the tabs or by hot
keys. And everything essentialls works, I swear !

If type an , , , or it calls my changeView_CB() which then
calls
PtSetResource( ABW_panelGroup, Pt_ARG_PG_CURRENT_INDEX, current_view, 0 );

Next, or if I click on a tab, it is supposed to call my changePannel_CB().
Under certain cirsumstances that doesn’t happen.

Here’s the freaky park. This only happens on the first pannel group AND it
only happens when a piece of data acquisition hardware is not present on
the computer under test.

Some other gory details: 1) The DAQ hardware is not even accessed in this
thread. 2) The thread that does try to access the DAQ knows successfully
how to deal with this circumstance. It’s been doing it for a while. It
sets a global switch and terminates. This happens within the first 6 lines
of the thread, so I am certain that there are no resources being locked.

I really can’t see how it has any thing to do with the DAQ hardware, aside
from the painfully obvious fact that if the hardware is plugged in it works
and if it is not plugged in it doesn’t work.

I don’t understand why this is only affecting the first pannel group under
these circumstances. The 4 pannels display different kinds of graphical
information, either from real-time DAQ data or from a saved logged file.

When it fails, my changePannel_CB() is NOT being called, even though my
changeView_CB() does get called on a kot key. When I attempt to change
pannels to the first one and it fails, I can see the first tab changhe color,
but the rest of the pannel does not change.

Like I said, I am baffled. I don’t even know what to look for next. Is
there some way I can dump the hung program and see why/where it is hung?

David Latter <DLatter@hollandco.com> wrote:

This one has me baffled. I’m running 6.2.1B PE.

I have a PhAB application that’s almost a year old and has been working
for almost a year. On the base window there is a PtPannelGroup. It contains
four pannels. The pannels can be selected by clicking on the tabs or by hot
keys. And everything essentialls works, I swear !

If type an , , , or it calls my changeView_CB() which then
calls
PtSetResource( ABW_panelGroup, Pt_ARG_PG_CURRENT_INDEX, current_view, 0 );

Next, or if I click on a tab, it is supposed to call my changePannel_CB().
Under certain cirsumstances that doesn’t happen.

Here’s the freaky park. This only happens on the first pannel group AND it
only happens when a piece of data acquisition hardware is not present on
the computer under test.

Some other gory details: 1) The DAQ hardware is not even accessed in this
thread. 2) The thread that does try to access the DAQ knows successfully
how to deal with this circumstance. It’s been doing it for a while. It
sets a global switch and terminates. This happens within the first 6 lines
of the thread, so I am certain that there are no resources being locked.

I really can’t see how it has any thing to do with the DAQ hardware, aside
from the painfully obvious fact that if the hardware is plugged in it works
and if it is not plugged in it doesn’t work.

I don’t understand why this is only affecting the first pannel group under
these circumstances. The 4 pannels display different kinds of graphical
information, either from real-time DAQ data or from a saved logged file.

When it fails, my changePannel_CB() is NOT being called, even though my
changeView_CB() does get called on a kot key. When I attempt to change
pannels to the first one and it fails, I can see the first tab changhe color,
but the rest of the pannel does not change.

Like I said, I am baffled. I don’t even know what to look for next. Is
there some way I can dump the hung program and see why/where it is hung?

One more thing. I found the System Information utility and was able to
examine my process. It appear to be running ready in thread 1. The EIP
shows: B0329409. I have the link map I can’t equate this address
to my program.

This post was to big to include the link map. Tell me where I can send it
and I’ll send it along. It’s about 3000 lines.

More information.

My changePannel_CB() IS being called. It’s just not having any effect.
I also have a print just before this function ends, and that is being
executed too!

So again, why is the tab being changed, but not the pannel?
And why am I now run looping?

David Latter <DLatter@hollandco.com> wrote:

More information.

My changePannel_CB() IS being called. It’s just not having any effect.
I also have a print just before this function ends, and that is being
executed too!

So again, why is the tab being changed, but not the pannel?
And why am I now run looping?

I feel like I’m talking to myself.

If the tab on the pannel is changing, why isn’t hte rest of the pannel?

Can I do anything with the EIP that I just reported in the last post?

You make reference to threads, in your posting, are you calling PtEnter
and PtLeave correctly? Maybe you are blocking on a PtEnter because
another porting of the code has not called PtLeave.

I’m a little confused to the problem that you are trying to bring to
light here. Does it switch tabs correctly, no matter what if you use
the hot keys?

What does your callback changePannel_CB look like? Do you have any
regions up that do any blocking or processing of events? Does anything
in the pane require data from an external source such as the hard drive?

Thanks,
Rodney



David Latter wrote:

This one has me baffled. I’m running 6.2.1B PE.

I have a PhAB application that’s almost a year old and has been working
for almost a year. On the base window there is a PtPannelGroup. It contains
four pannels. The pannels can be selected by clicking on the tabs or by hot
keys. And everything essentialls works, I swear !

If type an , , , or it calls my changeView_CB() which then
calls
PtSetResource( ABW_panelGroup, Pt_ARG_PG_CURRENT_INDEX, current_view, 0 );

Next, or if I click on a tab, it is supposed to call my changePannel_CB().
Under certain cirsumstances that doesn’t happen.

Here’s the freaky park. This only happens on the first pannel group AND it
only happens when a piece of data acquisition hardware is not present on
the computer under test.

Some other gory details: 1) The DAQ hardware is not even accessed in this
thread. 2) The thread that does try to access the DAQ knows successfully
how to deal with this circumstance. It’s been doing it for a while. It
sets a global switch and terminates. This happens within the first 6 lines
of the thread, so I am certain that there are no resources being locked.

I really can’t see how it has any thing to do with the DAQ hardware, aside
from the painfully obvious fact that if the hardware is plugged in it works
and if it is not plugged in it doesn’t work.

I don’t understand why this is only affecting the first pannel group under
these circumstances. The 4 pannels display different kinds of graphical
information, either from real-time DAQ data or from a saved logged file.

When it fails, my changePannel_CB() is NOT being called, even though my
changeView_CB() does get called on a kot key. When I attempt to change
pannels to the first one and it fails, I can see the first tab changhe color,
but the rest of the pannel does not change.

Like I said, I am baffled. I don’t even know what to look for next. Is
there some way I can dump the hung program and see why/where it is hung?

Yes there are threads. The main thread is the only one that deals with
Photon. There is also a communications thread (TCP/IP) and a data
acquisition thread A/D & DIO. Both of these threads simply write data to
a global buffer. There is no PtEnter/PtLeave calls or any other
synchronization calls of any kind.

The behaviour is the same regardless of clicking on a tab or hitting a hot
key (the callback is the same). The tab changes color but the OScontainer
inside the PannelGroup is not being rendered. The panel stays blank.

Rodney Dowdall <rdowdall@qnx.com> wrote:
RD > You make reference to threads, in your posting, are you calling PtEnter
RD > and PtLeave correctly? Maybe you are blocking on a PtEnter because
RD > another porting of the code has not called PtLeave.

RD > I’m a little confused to the problem that you are trying to bring to
RD > light here. Does it switch tabs correctly, no matter what if you use
RD > the hot keys?

RD > What does your callback changePannel_CB look like? Do you have any
RD > regions up that do any blocking or processing of events? Does anything
RD > in the pane require data from an external source such as the hard drive?

RD > Thanks,
RD > Rodney



RD > David Latter wrote:

This one has me baffled. I’m running 6.2.1B PE.

I have a PhAB application that’s almost a year old and has been working
for almost a year. On the base window there is a PtPannelGroup. It contains
four pannels. The pannels can be selected by clicking on the tabs or by hot
keys. And everything essentialls works, I swear !

If type an , , , or it calls my changeView_CB() which then
calls
PtSetResource( ABW_panelGroup, Pt_ARG_PG_CURRENT_INDEX, current_view, 0 );

Next, or if I click on a tab, it is supposed to call my changePannel_CB().
Under certain cirsumstances that doesn’t happen.

Here’s the freaky park. This only happens on the first pannel group AND it
only happens when a piece of data acquisition hardware is not present on
the computer under test.

Some other gory details: 1) The DAQ hardware is not even accessed in this
thread. 2) The thread that does try to access the DAQ knows successfully
how to deal with this circumstance. It’s been doing it for a while. It
sets a global switch and terminates. This happens within the first 6 lines
of the thread, so I am certain that there are no resources being locked.

I really can’t see how it has any thing to do with the DAQ hardware, aside
from the painfully obvious fact that if the hardware is plugged in it works
and if it is not plugged in it doesn’t work.

I don’t understand why this is only affecting the first pannel group under
these circumstances. The 4 pannels display different kinds of graphical
information, either from real-time DAQ data or from a saved logged file.

When it fails, my changePannel_CB() is NOT being called, even though my
changeView_CB() does get called on a kot key. When I attempt to change
pannels to the first one and it fails, I can see the first tab changhe color,
but the rest of the pannel does not change.

Like I said, I am baffled. I don’t even know what to look for next. Is
there some way I can dump the hung program and see why/where it is hung?

Hello Dave

What is the changeview_CB callback registered as ( I.E., Pt_CB_ACTIVATE
)? What is the changePanel_CB callback registered as?

Thanks,
Rodney


Dave Letter wrote:

Yes there are threads. The main thread is the only one that deals with
Photon. There is also a communications thread (TCP/IP) and a data
acquisition thread A/D & DIO. Both of these threads simply write data to
a global buffer. There is no PtEnter/PtLeave calls or any other
synchronization calls of any kind.

The behaviour is the same regardless of clicking on a tab or hitting a hot
key (the callback is the same). The tab changes color but the OScontainer
inside the PannelGroup is not being rendered. The panel stays blank.

Rodney Dowdall <> rdowdall@qnx.com> > wrote:
RD > You make reference to threads, in your posting, are you calling PtEnter
RD > and PtLeave correctly? Maybe you are blocking on a PtEnter because
RD > another porting of the code has not called PtLeave.

RD > I’m a little confused to the problem that you are trying to bring to
RD > light here. Does it switch tabs correctly, no matter what if you use
RD > the hot keys?

RD > What does your callback changePannel_CB look like? Do you have any
RD > regions up that do any blocking or processing of events? Does anything
RD > in the pane require data from an external source such as the hard drive?

RD > Thanks,
RD > Rodney



RD > David Latter wrote:

This one has me baffled. I’m running 6.2.1B PE.

I have a PhAB application that’s almost a year old and has been working
for almost a year. On the base window there is a PtPannelGroup. It contains
four pannels. The pannels can be selected by clicking on the tabs or by hot
keys. And everything essentialls works, I swear !

If type an , , , or it calls my changeView_CB() which then
calls
PtSetResource( ABW_panelGroup, Pt_ARG_PG_CURRENT_INDEX, current_view, 0 );

Next, or if I click on a tab, it is supposed to call my changePannel_CB().
Under certain cirsumstances that doesn’t happen.

Here’s the freaky park. This only happens on the first pannel group AND it
only happens when a piece of data acquisition hardware is not present on
the computer under test.

Some other gory details: 1) The DAQ hardware is not even accessed in this
thread. 2) The thread that does try to access the DAQ knows successfully
how to deal with this circumstance. It’s been doing it for a while. It
sets a global switch and terminates. This happens within the first 6 lines
of the thread, so I am certain that there are no resources being locked.

I really can’t see how it has any thing to do with the DAQ hardware, aside
from the painfully obvious fact that if the hardware is plugged in it works
and if it is not plugged in it doesn’t work.

I don’t understand why this is only affecting the first pannel group under
these circumstances. The 4 pannels display different kinds of graphical
information, either from real-time DAQ data or from a saved logged file.

When it fails, my changePannel_CB() is NOT being called, even though my
changeView_CB() does get called on a kot key. When I attempt to change
pannels to the first one and it fails, I can see the first tab changhe color,
but the rest of the pannel does not change.

Like I said, I am baffled. I don’t even know what to look for next. Is
there some way I can dump the hung program and see why/where it is hung?

Rodney Dowdall <rdowdall@qnx.com> wrote:
RD > Hello Dave

RD > What is the changeview_CB callback registered as ( I.E., Pt_CB_ACTIVATE
RD > )? What is the changePanel_CB callback registered as?

RD > Thanks,
RD > Rodney


I just rechecked the code and PhAB. The PtPanelGroup widget has a Panel
Switching callback (changePanelCB), a Realized callback (changePanelCB)
and 4 HotKey callbacks (all changeViewCB).

Here is their code:

// this is called when someone clicks on a folder tab
int changePannelCB ( PtWidget_t *widget, ApInfo_t *, PtCallbackInfo_t cbinfo )
{
// this can be called from Realized or Panel Switch callbacks
// check witch it is
if( cbinfo->reason == Pt_CB_PG_PANEL_SWITCHING )
{
current_view = CURRENT_VIEW( ((PtPanelGroupCallback_t
)(cbinfo->cbdata))->new_panel_index );
}
else
{
// first being realized
uint16_t * panel_index;
PtGetResource( widget, Pt_ARG_PG_CURRENT_INDEX, &panel_index, 0 );
current_view = CURRENT_VIEW( *panel_index );
}

return Pt_CONTINUE;
}


// this is called when someone types , , , etc.
int changeView_CB ( PtWidget_t *, ApInfo_t *, PtCallbackInfo_t *cbinfo )
{
// figure out which key was pressed
PtHotkeyCallback_t hkcb = (PtHotkeyCallback_t)(cbinfo->cbdata);
switch( hkcb->key_sym_cap )
{
case Pk_F1:
current_view = APES_SCREEN;
break;
case Pk_F2:
current_view = TRENDS_SCREEN;
break;
case Pk_F3:
current_view = LACS_SCREEN;
break;
case Pk_F4:
current_view = CONFIG_SCREEN;
break;
default:
break;
}

PtSetResource( ABW_panelGroup, Pt_ARG_PG_CURRENT_INDEX, current_view, 0 );

return Pt_CONTINUE;
}


current_view is a global enum.

enum CURRENT_VIEW
{
APES_SCREEN,
TRENDS_SCREEN,
LACS_SCREEN,
CONFIG_SCREEN
} current_view;

Rodney Dowdall <rdowdall@qnx.com> wrote:
RD > Hello Dave

RD > What is the changeview_CB callback registered as ( I.E., Pt_CB_ACTIVATE
RD > )? What is the changePanel_CB callback registered as?

RD > Thanks,
RD > Rodney


Also remember, when all hardware is present the program works flawlessly.
Even when the DAQ board isn’t present panels 2, 3 & 4 all work. Just panel
doesn’t.

The tab changes color but the OScontainer isn’t rendered.

Hello Dave

Would it be possible for you to send me a sample app that demonstrates
this problem?

Thanks,
Rodney


Dave Latter wrote:

Rodney Dowdall <> rdowdall@qnx.com> > wrote:
RD > Hello Dave

RD > What is the changeview_CB callback registered as ( I.E., Pt_CB_ACTIVATE
RD > )? What is the changePanel_CB callback registered as?

RD > Thanks,
RD > Rodney


Also remember, when all hardware is present the program works flawlessly.
Even when the DAQ board isn’t present panels 2, 3 & 4 all work. Just panel
doesn’t.

The tab changes color but the OScontainer isn’t rendered.