Exemplo n.º 1
0
void dispatch()
/* Set up a connection to database and dispatch control
 * based on hgpDo type var. */
{
struct sqlConnection *conn = sqlConnect(visiDb);
if (cartVarExists(cart, hgpDoThumbnails))
    doThumbnails(conn);
else if (cartVarExists(cart, hgpDoImage))
    doImage(conn);
else if (cartVarExists(cart, hgpDoProbe))
    doProbe(conn);
else if (cartVarExists(cart, hgpDoControls))
    doControls(conn);
else if (cartVarExists(cart, hgpDoId))
    doId(conn);
#ifdef SOON
else if (cartVarExists(cart, hgpDoConfig))
    configPage(conn);
#endif /* SOON */
else if (cartVarExists(cart, hgpDoSearch))
    doDefault(conn, TRUE);
else
    {
    char *oldListSpec = hashFindVal(oldCart, hgpListSpec);
    char *newListSpec = cartOptionalString(cart, hgpListSpec);
    boolean isNew = differentStringNullOk(oldListSpec, newListSpec);
    doDefault(conn, isNew);
    }
cartRemovePrefix(cart, hgpDoPrefix);
}
Exemplo n.º 2
0
void robot_class::TeleopPeriodic()
{
    //double infaredDistance = (double)((robot->shoot->infared->GetVoltage()))/**18.777777777777777)*/;
    updateRegistry.update();
    driveT -> pressurize();
    driveT -> drive();
    doControls();
}
Exemplo n.º 3
0
// Main
int main() {
	// initial settings, will change to user interactive / eeprom
	ctx.settings.mode = 3;
	ctx.settings.maxCtrlWatts = 75000;
	ctx.settings.maxWatts = 75000;
	ctx.settings.minTemp = 60;
	ctx.settings.maxTemp = 300;
	ctx.settings.tcrValue = 0.00092;

	ctx.settings.tT = 248;
	ctx.settings.tW = 56000;

	ctx.settings.lockRes = false;
	ctx.settings.flip = false;
	ctx.settings.stealth = false;
	ctx.settings.lock = false;
	ctx.settings.timeout = 10;

	// init timers
	uint8_t timeTimer;
	timeTimer = Timer_CreateTimer(1, 1, incrementTime, 1);
	uint8_t loopTimer;
	loopTimer = Timer_CreateTimer(FPS, 1, readyLoop, 1);

	// init atomizer
	Atomizer_SetErrorLock(true);

	// main loop, rest is event handling
	while(1) {
		loop = 0;
		// collect runtime data
		collectData();

		// do controls
		doControls();

		if(ctx.state.firing) {
			displayFiring();
		} else {
			if(ctx.state.idleTimer < 20) {
				switch(ctx.settings.mode) {
					case 0: // settings
						displaySettings();
						break;
					case 1: // vw
						displayVW();
						break;
					case 2: // bp
						displayBP();
						break;
					case 3: // tc
						displayTC();
						break;
				}
			} else {
				// switch to low power mode
				Display_Clear();
				Display_Update();
				sleep();
			}
		}

		// waste time until loop refresh timer is ready
		while(loop == 0) {}
	}

	return 0;
}