Example #1
0
void Lottery::fillRemainingTeams() {
	int p = AMOUNT;

	for (int i = 0; i < MAX_LOTTERY_TEAMS; i++) {
		if (getPick(lotteryTeams[i].getName()) == 0) {
			setPick(lotteryTeams[i].getName(), p);
			p++;
		}
	}
}
Example #2
0
void edit_tf(g_ctl * ctl, tf * f, defs * d)
{
	/* We add a quick hack in making the filter option on/off with key 'F' */
	float ax, ay, aux;
	char op;
	int filterneed = 0;
	int gravity = 1;

	strcpy(ctl->title, "** timeplot type Q to return to main menu **");
	strcpy(ctl->xlabel, "Time (s)");
	strcpy(ctl->ylabel, "Amp.");

	pdefs *pick = d->pickRules[(int)getConfigAsNumber(config, NAME_PICK, DEFAULT_PICK)];

	switch (d->alig) {
	case (ALIGO):
	case (ALIGA): {
		float AMark = pickR(pick, f->current->head);
		ctl->xmin = AMark - d->prephase;
		ctl->xmax = AMark + d->postphase;
		break;
	}
	case (ALIGF): {
		float FMark = pickD(pick, f->current->head);
		ctl->xmin = FMark - d->prephase;
		ctl->xmax = FMark + d->postphase;
		break;
	}
	}

	while (op != 'Q') {
		if (filterneed == 1) {
			if (d->filter)
				filtertf(f, d);
			filterneed = 0;
		}

		timedraw(ctl, f, d, gravity);
		cpgband(7, 0, 0.0, 0.0, &ax, &ay, &op);
		op = toupper(op);

		switch (op) {
		case 'G': {
			gravity = !gravity;
			break;
		}

		case 'Z':
		case 'Y': {
			setPick(pick, f->current->head, (gravity) ? minmaxrefine(f, d, ax, 2.) : ax);
			d->needsave = 1;
			break;
		}

		case 'A': {
			aux = ax;
			cpgband(7, 0, 0.0, 0.0, &ax, &ay, &op);
			if (aux < ax) {
				ctl->xmin = aux;
				ctl->xmax = ax;
			} else {
				ctl->xmin = hdu_getSecondsFromNPTS(f->current->head, 0);
				ctl->xmax = hdu_getSecondsFromNPTS(f->current->head, f->current->head->npts);
			}
			break;
		}

		case 'F': {
			d->filter = !d->filter;
			filterneed = 1;
			break;
		}

		case 'D': {
			setPick(pick, f->current->head, SAC_HEADER_FLOAT_UNDEFINED);
			d->needsave = 1;
			break;
		}

		case 'L': {
			d->lp = lerfloat("Enter Low-Pass filter frequency (Hz):");
			filterneed = 1;
			break;
		}

		case 'H': {
			d->hp = lerfloat("Enter High-Pass filter frequency (Hz):");
			filterneed = 1;
			break;
		}
		}
	}
}