bool QEpicsAcqLocal::setControlLine(const char* scan, int ctl_idx, const QString &varName, double first, double last, double increment) { acqScan_t *scp; acqControl_t *ctlp; scp = lookup_acqScan(scan, master); if( scp == NULL) // scan doesn't exist? return 0; ctlp = setupControlLine( scp, ctl_idx); tryCopy( &ctlp->controlPV, varName); trySet( &ctlp->startVal, first); trySet( &ctlp->deltaVal, increment); trySet( &ctlp->finalVal, last); return 0; }
bool Lock::isSet() { if( trySet( )) { unset(); return false; } return true; }
/** (private to doBombs) * sets all the squares next to a bomb to triggered * WARNING: beware of wraparound! The board is only 256 blocks across, * so triggering -1,-1 will affect 256,256 */ static void detonate(Uint8 x, Uint8 y) { trySet(x-1, y-1); trySet(x , y-1); trySet(x+1, y-1); trySet(x-1, y ); level->field[x][y] = BT_TRIGGERED; trySet(x+1, y ); trySet(x-1, y+1); trySet(x , y+1); trySet(x+1, y+1); }