void QMultiScope::refresh(timeref_t t) { qss.endtime = t; if(isbox){ forall(&QScope::refresh,t); //for(int hw=0;hw<TOTALCHANS;hw++) // dynamic_cast<QScope*>(graphptrs[hw])->refresh(t); addSpikes(); dynamic_cast<QScope*>(allgraphs)->refresh_together(t); } else{ dynamic_cast<QScope*>(allgraphs)->erasetrace(); dynamic_cast<QScope*>(allgraphs)->refresh_all(t); } dumpme(); }
void QScope::mouseDoubleClickEvent(QMouseEvent *qme) { if (qme->state() & Qt::ControlButton) dumpme(); else QGraph::mouseDoubleClickEvent(qme); }
int main (void) { dumpme(); return 0; }
double move(int ramflag, int course, double p_time, double speed) { double angle; double x, y, dx, dy; int ix, iy; double bigger; int n; int i; double dist; double sectsize; double xn; double evtime; ix = iy = 0; #ifdef xTRACE if (Trace) printf("move: ramflag %d course %d time %.2f speed %.2f\n", ramflag, course, p_time, speed); #endif sectsize = NSECTS; /* initialize delta factors for move */ angle = course * 0.0174532925; if (damaged(SINS)) angle += Param.navigcrud[1] * (franf() - 0.5); else if (Ship.sinsbad) angle += Param.navigcrud[0] * (franf() - 0.5); dx = -cos(angle); dy = sin(angle); bigger = fabs(dx); dist = fabs(dy); if (dist > bigger) bigger = dist; dx /= bigger; dy /= bigger; /* check for long range tractor beams */ /**** TEMPORARY CODE == DEBUGGING ****/ evtime = Now.eventptr[E_LRTB]->date - Now.date; #ifdef xTRACE if (Trace) printf("E.ep = %p, ->evcode = %d, ->date = %.2f, evtime = %.2f\n", (void *)Now.eventptr[E_LRTB], Now.eventptr[E_LRTB]->evcode, Now.eventptr[E_LRTB]->date, evtime); #endif if (p_time > evtime && Etc.nkling < 3) { /* then we got a LRTB */ evtime += 0.005; p_time = evtime; } else evtime = -1.0e50; dist = p_time * speed; /* move within quadrant */ Sect[Ship.sectx][Ship.secty] = EMPTY; x = Ship.sectx + 0.5; y = Ship.secty + 0.5; xn = NSECTS * dist * bigger; n = xn + 0.5; #ifdef xTRACE if (Trace) printf("dx = %.2f, dy = %.2f, xn = %.2f, n = %d\n", dx, dy, xn, n); #endif Move.free = 0; for (i = 0; i < n; i++) { ix = (x += dx); iy = (y += dy); #ifdef xTRACE if (Trace) printf("ix = %d, x = %.2f, iy = %d, y = %.2f\n", ix, x, iy, y); #endif if (x < 0.0 || y < 0.0 || x >= sectsize || y >= sectsize) { /* enter new quadrant */ dx = Ship.quadx * NSECTS + Ship.sectx + dx * xn; dy = Ship.quady * NSECTS + Ship.secty + dy * xn; if (dx < 0.0) ix = -1; else ix = dx + 0.5; if (dy < 0.0) iy = -1; else iy = dy + 0.5; #ifdef xTRACE if (Trace) printf("New quad: ix = %d, iy = %d\n", ix, iy); #endif Ship.sectx = x; Ship.secty = y; compkldist(0); Move.newquad = 2; attack(0); checkcond(); Ship.quadx = ix / NSECTS; Ship.quady = iy / NSECTS; Ship.sectx = ix % NSECTS; Ship.secty = iy % NSECTS; if (ix < 0 || Ship.quadx >= NQUADS || iy < 0 || Ship.quady >= NQUADS) { if (!damaged(COMPUTER)) { dumpme(0); } else lose(L_NEGENB); } initquad(0); n = 0; break; } if (Sect[ix][iy] != EMPTY) { /* we just hit something */ if (!damaged(COMPUTER) && ramflag <= 0) { ix = x - dx; iy = y - dy; printf("Computer reports navigation error; %s stopped at %d,%d\n", Ship.shipname, ix, iy); Ship.energy -= Param.stopengy * speed; break; } /* test for a black hole */ if (Sect[ix][iy] == HOLE) { /* get dumped elsewhere in the galaxy */ dumpme(1); initquad(0); n = 0; break; } ram(ix, iy); break; } } if (n > 0) { dx = Ship.sectx - ix; dy = Ship.secty - iy; dist = sqrt(dx * dx + dy * dy) / NSECTS; p_time = dist / speed; if (evtime > p_time) p_time = evtime; /* spring the LRTB trap */ Ship.sectx = ix; Ship.secty = iy; } Sect[Ship.sectx][Ship.secty] = Ship.ship; compkldist(0); return (p_time); }