63 p->
Painter->setPen(QPen(QPen::black,0));
71 p->
Painter->setBrush(QColor(192, 192, 192));
72 p->
Painter->setPen(QColor(152, 152, 152));
78 Points.setPoints(3, x, (y+dy)>>1, dx, y, dx, dy);
79 p->
Painter->drawConvexPolygon(Points);
80 p->
Painter->setPen(QColor(224, 224, 224));
81 p->
Painter->drawLine(x, (y+dy)>>1, dx, y);
85 p->
Painter->setPen(QColor(152, 152, 152));
88 Points.setPoints(3, x, (y+dy)>>1, x-dx, y, x-dx, dy);
89 p->
Painter->drawConvexPolygon(Points);
90 p->
Painter->setPen(QColor(208, 208, 208));
91 p->
Painter->drawLine(x-dx, y, x, (y+dy)>>1);
92 p->
Painter->setPen(QColor(224, 224, 224));
93 p->
Painter->drawLine(x-dx, y, x-dx, dy);
95 p->
Painter->setBrush(QBrush(Qt::NoBrush));
100 p->
Painter->setPen(QPen(QPen::darkGray,3));
102 p->
Painter->setPen(QPen(QPen::darkRed,2));
119 int tHeight = metrics.lineSpacing();
121 int colWidth=0,
x=4, y, xStart = 0, z;
125 int invisibleCount = 0;
127 if(
y2 < (tHeight + 8))
129 y =
y2 - tHeight - 6;
133 Lines.append(
new Line(0,
y2, 0, 0, QPen(QPen::black,0)));
135 Lines.append(
new Line(0, 0,
x2, 0, QPen(QPen::black,0)));
136 Lines.append(
new Line(0, y+2,
x2, y+2, QPen(QPen::black,0)));
144 Str = QObject::tr(
"no variables");
158 Str = QObject::tr(
"no data");
160 if(colWidth < 0)
return 0;
171 if(g->
Var.right(2) ==
".X") {
182 int TimeStepWidth = colWidth * metrics.width(
"X") + 8;
183 if(TimeStepWidth < 40)
188 if(!firstGraph->
cPointsX.isEmpty()) {
190 if(firstGraph->
cPointsX.count() > 1) {
191 Str = QObject::tr(
"wrong dependency");
204 if(colWidth < 0)
return 1;
211 if(y < tHeight)
break;
214 if(colWidth < 0)
return 1;
220 Lines.append(
new Line(
x-6,
y2,
x-6, 0, QPen(QPen::black,0)));
241 colWidth = metrics.width(Str);
242 if(
x+colWidth+2 >=
x2)
break;
245 Lines.append(
new Line(
x+5, y,
x+5, y-3, QPen(QPen::black,0)));
261 Lines.append(
new Line(4, 6, 4, -7, QPen(QPen::red,2)));
262 Lines.append(
new Line(1, 0, 4, -7, QPen(QPen::red,2)));
263 Lines.append(
new Line(7, 0, 4, -7, QPen(QPen::red,2)));
271 Str = QObject::tr(
"no data");
273 if(colWidth < 0)
goto funcEnd;
280 Str = QObject::tr(
"wrong dependency");
282 if(colWidth < 0)
goto funcEnd;
290 case 1: Pen.setStyle(Qt::DashLine);
break;
291 case 2: Pen.setStyle(Qt::DotLine);
break;
295 if(g->
Var.right(2) !=
".X") {
298 z = g->
cPointsX.getFirst()->count - z;
299 yNow = 1 + ((tHeight - 6) >> 1);
301 Lines.append(
new Line(
x+2, y-tHeight+5,
x, y-yNow, Pen));
303 if(
x+TimeStepWidth >=
x2)
break;
304 Lines.append(
new Line(
x+2, y-1,
x+TimeStepWidth-2, y-1, Pen));
305 Lines.append(
new Line(
x+2, y-tHeight+5,
x+TimeStepWidth-2, y-tHeight+5, Pen));
309 Texts.append(
new Text(
x+3, y,QString::number(*px)));
313 QString::number(
sqrt((*px)*(*px) + (*(px+1))*(*(px+1))))));
317 Lines.append(
new Line(
x-2, y-tHeight+5,
x+2, y-1, Pen));
318 Lines.append(
new Line(
x+2, y-tHeight+5,
x-2, y-1, Pen));
327 pcx += z * (strlen(pcx)+1);
329 if(strlen(pcx) < 2) {
333 if(z > 0) yLast += 2;
334 switch(*(pcx-yLast)) {
342 yLast = 1 + ((tHeight - 6) >> 1);
345 z = g->
cPointsX.getFirst()->count - z;
356 yNow = 1 + ((tHeight - 6) >> 1);
360 Lines.append(
new Line(
x, y-yLast,
x, y-yNow, Pen));
361 if(
x+TimeStepWidth >=
x2)
break;
362 if((*pcx & 254) ==
'0')
363 Lines.append(
new Line(
x, y-yNow,
x+TimeStepWidth, y-yNow, Pen));
365 Texts.append(
new Text(
x+(TimeStepWidth>>1)-3, y, QString(pcx)));
366 Lines.append(
new Line(
x+3, y-1,
x+TimeStepWidth-3, y-1, Pen));
367 Lines.append(
new Line(
x+3, y-tHeight+5,
x+TimeStepWidth-3, y-tHeight+5, Pen));
369 Lines.append(
new Line(
x, y-yNow,
x+3, y-tHeight+5, Pen));
370 Lines.append(
new Line(
x+TimeStepWidth-3, y-1,
x+TimeStepWidth, y-yNow, Pen));
371 Lines.append(
new Line(
x+TimeStepWidth-3, y-tHeight+5,
x+TimeStepWidth, y-yNow, Pen));
382 z = g->
cPointsX.getFirst()->count - z;
383 yNow = 1 + ((tHeight - 6) >> 1);
385 Lines.append(
new Line(
x+2, y-tHeight+5,
x, y-yNow, Pen));
387 if(
x+TimeStepWidth >=
x2)
break;
388 Lines.append(
new Line(
x+2, y-1,
x+TimeStepWidth-2, y-1, Pen));
389 Lines.append(
new Line(
x+2, y-tHeight+5,
x+TimeStepWidth-2, y-tHeight+5, Pen));
394 pcx += strlen(pcx) + 1;
395 Lines.append(
new Line(
x-2, y-tHeight+5,
x+2, y-1, Pen));
396 Lines.append(
new Line(
x+2, y-tHeight+5,
x-2, y-1, Pen));
405 if(invisibleCount > 0) {
416 if(NumLeft < 0) NumLeft = 0;
417 y = NumAll - NumLeft - z;
445 if(
y1 <= 0)
return 0;
449 if(clickPos > (
cx+
x2-20)) {
503 Name = QObject::tr(
"Timing Diagram");
504 BitmapFile = (
char *)
"timing";