|
楼主 |
发表于 2005-7-6 12:40:26
|
显示全部楼层
[quote:ca5fe15269="danath"]父进程的画图依赖于子进程的操作A吗, 加些printf看看父进程运行到了什么地步.[/quote]
父进程所有的都能做,就是这里
void tppaintForm::paintEvent(QPaintEvent *)
{
paint = new QPainter;
int x1, y1, x2, y2;
paint->begin(this);
paint->setBrush(QBrush(yellow, CrossPattern));
paint->drawRect(40,20,350,320);
paint->drawLine ( 210, 20, 210, 340 );//xmiddleline
paint->drawLine ( 40, 60, 385, 60 );//11
paint->drawLine ( 40, 130, 385, 130 );//10.5
paint->drawLine ( 40, 200, 385, 200 );//10
paint->drawLine ( 40, 270, 385, 270 );//9.5
signal(SIGUSR1, throutput); //这里帮定了一个信号Y,可是,对于重载函数throutput,见下面
pause();
}
tppaintForm::tppaintForm()
{
setGeometry(100,100,400,400);
setCaption( tr( "Throuput Plot" ) );
.............
}
void throutput(int sig)
{
qtthrput=read(thrpipe[0],thrbuffer,BUFSIZ);
printf("!!!!!!!!!!!Read %d bytes:%s\n",qtthrput,thrbuffer);
*thput=atof(thrbuffer);
printf("*^_^*ao is %d,bo is %d\n",a0,b0);
printf("@@@@@thput is %d\n",*thput);
int a= qblock/320 ; // count blocknum;
int xstep= 350/a ;
int c=a0+xstep;
int d = 340-(int)(0.014*((*thput)-90000));
printf("d is %d\n",d);////这个也看到了
paint->drawLine ( a0, b0, c, d );//就这个图没有画,其他都有完成
a0=c;
b0=d;
printf("end end end !!!\n");//这个也看到了
} |
|