PtTrend

Dear All,

Is there anyone who can provide me an example of how to use the PtTrend
widget in photon 2.0 ?

Thanks a lot.


,
(o o)
---------------------------oOO–(_)–OOo-----------------------------


| Edgar Dieperink | Home : +41-(0)21-828.20.11 |
| Rue du Fort 22 | Facsimile : +41-(0)21-828.20.19 |
| CH-1188 Gimel | Office : +41-(0)22-995.00.51 |
| Switzerland | e-mail : dieperie@iprolink.ch |
| | http : www.up-all-night.ch/~dieperie/ |

sure…

just give the widget a name, and then update it whenever you want to.
here’s a simple trend that i update with a sine wave every 50ms (by using a PtTimer
widget set to repeat at 50ms)

this is really hacky, but you get the idea. the more points you update at once
will determine how fast the trend moves… times the update rate of course.

#include <math.h>

#define NUMPOINTS 5
short int data[NUMPOINTS+1];
int counter=0;
int direction = 1;
int max = 32000;

int
uptrend( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )

{
PtArg_t arg[3];
int x;
double tmp;

widget = widget, apinfo = apinfo, cbinfo = cbinfo;

for ( x=0; x < NUMPOINTS; x++ ) {
counter += direction;
if ( abs(counter) > max )
direction = -direction;
tmp = (double)counter/100.0;
data[x] = (int)(sin(tmp) * max);
}

PtSetArg(&arg[0], Pt_ARG_TREND_DATA, &data, NUMPOINTS);
PtSetResources( ABW_trend1, 1, arg );

return( Pt_CONTINUE );

}


Edgar Dieperink <dieperie@iprolink.ch> wrote:

Dear All,

Is there anyone who can provide me an example of how to use the PtTrend
widget in photon 2.0 ?

Thanks a lot.


,
(o o)
---------------------------oOO–(_)–OOo-----------------------------


| Edgar Dieperink | Home : +41-(0)21-828.20.11 |
| Rue du Fort 22 | Facsimile : +41-(0)21-828.20.19 |
| CH-1188 Gimel | Office : +41-(0)22-995.00.51 |
| Switzerland | e-mail : > dieperie@iprolink.ch > |
| | http : > www.up-all-night.ch/~dieperie/ > |


Randy Martin randy@qnx.com
Manager of FAE Group, North America
QNX Software Systems www.qnx.com
175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
Tel: 613-591-0931 Fax: 613-591-3579

Hi,
I’ll be putting together a system to run QNX RTP 6.1…

Any suggestions on hardware that works best with QNX?

Good 2D video is important - lots of PtTrend type data and double buffered
2D animations.

I’m leaning towards the ATI Radeon card as drivers for it seem to be well
supported is this true.

Any better suggestions? What about a motherboard/bios/processor etc. Any
set up in particular less likely to have problems?

Thanks and regards,

Steve