コード例 #1
0
void TripleChannelRaycaster::initContext(GLContextData& contextData) const
	{
	/* Create a new data item: */
	DataItem* dataItem=new DataItem;
	contextData.addDataItem(this,dataItem);
	
	/* Initialize the data item: */
	initDataItem(dataItem);
	
	try
		{
		/* Load and compile the vertex program: */
		std::string vertexShaderName=VISUALIZER_SHADERDIR;
		vertexShaderName.append("/TripleChannelRaycaster.vs");
		dataItem->shader.compileVertexShader(vertexShaderName.c_str());
		std::string fragmentShaderName=VISUALIZER_SHADERDIR;
		fragmentShaderName.append("/TripleChannelRaycaster.fs");
		dataItem->shader.compileFragmentShader(fragmentShaderName.c_str());
		dataItem->shader.linkShader();
		
		/* Initialize the raycasting shader: */
		initShader(dataItem);
		}
	catch(std::runtime_error err)
		{
		/* Print an error message, but continue: */
		std::cerr<<"TripleChannelRaycaster::initContext: Caught exception "<<err.what()<<std::endl;
		}
	}
コード例 #2
0
void TripleChannelRaycaster::initContext(GLContextData& contextData) const
	{
	/* Create a new data item: */
	DataItem* dataItem=new DataItem;
	contextData.addDataItem(this,dataItem);
	
	/* Initialize the data item: */
	initDataItem(dataItem);
	
	/* Load and compile the vertex program: */
	std::string vertexShaderName=VISUALIZER_SHADERDIR;
	vertexShaderName.append("/TripleChannelRaycaster.vs");
	dataItem->shader.compileVertexShader(vertexShaderName.c_str());
	std::string fragmentShaderName=VISUALIZER_SHADERDIR;
	fragmentShaderName.append("/TripleChannelRaycaster.fs");
	dataItem->shader.compileFragmentShader(fragmentShaderName.c_str());
	dataItem->shader.linkShader();
	
	/* Initialize the raycasting shader: */
	initShader(dataItem);
	}
コード例 #3
0
ファイル: FSAE_LCD.c プロジェクト: mass/illini-motorsports
// Initialize all the data streams
// This fn must be run before CAN is initialized
void initDataItems(void){
  uint16_t i;

  // Set default initialization for PDM data items
  for(i=0;i<PDM_DATAITEM_SIZE;i++){
    initDataItem(&pdmDataItems[i],200,200,2,1);
    pdmDataItems[i].thresholdDir = 1;
  }
  for(i=FUEL_CUT_IDX;i<ECU_CUT_P_IDX;i++){
    setDataItemDigits(&pdmDataItems[i], 3, 0);
  }
  pdmDataItems[VBAT_RAIL_IDX].warnThreshold = 12.5;
  pdmDataItems[VBAT_RAIL_IDX].errThreshold = 12;
  pdmDataItems[VBAT_RAIL_IDX].thresholdDir = 0;
  pdmDataItems[VBAT_RAIL_IDX].decDigits = 2;

  // Customized PDM dataitem initialization
  pdmDataItems[STR_DRAW_IDX].wholeDigits = 3;

  // Set default initialization for GCM data items
  for(i=0;i<GCM_DATAITEM_SIZE;i++){
    initDataItem(&gcmDataItems[i],0,0,1,0);
  }

  // Customized GCM dataitem initialization
  gcmDataItems[GEAR_VOLT_IDX].decDigits = 2;
  gcmDataItems[GEAR_VOLT_IDX].wholeDigits = 2;
  gcmDataItems[FORCE_IDX].decDigits = 2;
  gcmDataItems[FORCE_IDX].wholeDigits = 2;

  // Set default initializations for Motec data items
  for(i=0;i<MOTEC_DATAITEM_SIZE;i++) {
    initDataItem(&motecDataItems[i],0,0,2,1);
  }

  // Customized Motec dataitem initialization
  setDataItemDigits(&motecDataItems[ENG_RPM_IDX], 5, 0);
  setDataItemDigits(&motecDataItems[THROTTLE_POS_IDX], 3, 0);
  setDataItemDigits(&motecDataItems[OIL_PRES_IDX], 1, 2);
  setDataItemDigits(&motecDataItems[OIL_TEMP_IDX], 3, 0);
  setDataItemDigits(&motecDataItems[LAMBDA_IDX], 1, 3);
  setDataItemDigits(&motecDataItems[MANIFOLD_PRES_IDX], 1, 2);
  setDataItemDigits(&motecDataItems[MANIFOLD_TEMP_IDX], 3, 0);
  setDataItemDigits(&motecDataItems[ENG_TEMP_IDX], 3, 0);
  setDataItemDigits(&motecDataItems[VOLT_ECU_IDX], 2, 2);
  setDataItemDigits(&motecDataItems[AMBIENT_PRES_IDX], 1, 2);
  setDataItemDigits(&motecDataItems[FUEL_PRES_IDX], 1, 2);
  setDataItemDigits(&motecDataItems[FUEL_TEMP_IDX], 3, 0);
  setDataItemDigits(&motecDataItems[RUN_TIME_IDX], 4, 0);
  setDataItemDigits(&motecDataItems[FUEL_INJ_DUTY_IDX], 3, 1);
  setDataItemDigits(&motecDataItems[FUEL_TRIM_IDX], 3, 1);
  motecDataItems[LAMBDA_IDX].warnThreshold = 1.1;
  motecDataItems[LAMBDA_IDX].errThreshold = 1.3;
  motecDataItems[LAMBDA_IDX].thresholdDir = 1;
  motecDataItems[OIL_PRES_IDX].warnThreshold = 1.2;
  motecDataItems[OIL_PRES_IDX].errThreshold = 1.2;
  motecDataItems[OIL_TEMP_IDX].thresholdDir = 1;
  motecDataItems[OIL_TEMP_IDX].warnThreshold = 120;
  motecDataItems[OIL_TEMP_IDX].errThreshold = 140;
  motecDataItems[ENG_TEMP_IDX].thresholdDir = 1;
  motecDataItems[ENG_TEMP_IDX].warnThreshold = 100;
  motecDataItems[ENG_TEMP_IDX].errThreshold = 110;
  motecDataItems[ENG_RPM_IDX].warnThreshold = 12000;
  motecDataItems[ENG_RPM_IDX].errThreshold = 13000;
  motecDataItems[ENG_RPM_IDX].thresholdDir = 1;
  motecDataItems[LAMBDA_IDX].warnThreshold = 1.1;
  motecDataItems[LAMBDA_IDX].errThreshold = 1.2;
  motecDataItems[LAMBDA_IDX].thresholdDir = 1;

  // Tire temps
  for(i=0;i<TIRETEMP_DATAITEM_SIZE;i++) {
    initDataItem(&tireTempDataItems[i],0,0,2,1);
  }

  // SPM
  for(i=0;i<SPM_DATAITEM_SIZE;i++) {
    initDataItem(&spmDataItems[i],0,0,2,1);
  }

  //Switches and Rotaries
  for(i=0;i<3;i++) {
    initDataItem(&wheelDataItems[i],0,0,2,1);
  }
  for(i=3;i<WHEEL_DATAITEM_SIZE;i++) {
    initDataItem(&wheelDataItems[i],0,0,1,0);
  }
  
  //IMU g readings
  for(i = 0; i < IMU_DATAITEM_SIZE; i++)
  {
      initDataItem(&imuDataItems[i], 0, 0, 1, 2);
  }
/*
  // Special array declerations
  fanSw[0] = &wheelDataItems[SW_FAN_IDX];
  fanSw[1] = &pdmDataItems[FAN_ENABLITY_IDX];
  fuelSw[0] = &wheelDataItems[SW_FUEL_IDX];
  fuelSw[1] = &pdmDataItems[FUEL_ENABLITY_IDX];
  wtrSw[0] = &wheelDataItems[SW_WTR_IDX];
  wtrSw[1] = &pdmDataItems[WTR_ENABLITY_IDX];
  shiftLights[0] = &motecDataItems[ENG_RPM_IDX];
  shiftLights[1] = &gcmDataItems[GEAR_IDX];
  gForce[0] = &imuDataItems[LATERAL_G_IDX];
  gForce[1] = &imuDataItems[LONGITUDINAL_G_IDX];
 */
}
コード例 #4
0
// Initializes all the screen and screenitem variables in all
// the screens that might be displayed
void initAllScreens(void){
	// Initialize colors
	backgroundColor = RA8875_WHITE;
	foregroundColor = RA8875_BLACK;
	initNightMode(switches[3].value);

	// All Screens Stuff
	allScreens[GENERAL_SCREEN] = &generalScreen;
	generalScreen.items = generalItems;
	generalScreen.len = 6;
	initScreenItem(&generalItems[0], 20, 30, 15, redrawRotary, &rotary[0]);
	initScreenItem(&generalItems[1], 20, 30, 15, redrawRotary, &rotary[1]);
	initScreenItem(&generalItems[2], 20, 30, 15, redrawRotary, &rotary[2]);
	initScreenItem(&generalItems[3], 20, 30, 15, redrawFanSw, &switches[0]);
	initScreenItem(&generalItems[4], 20, 30, 15, redrawFUELPumpSw, &switches[1]);
	initScreenItem(&generalItems[5], 20, 30, 15, redrawWTRPumpSw, &switches[2]);

	// Race Screen Stuff
	allScreens[RACE_SCREEN] = &raceScreen;
	raceScreen.items = raceScreenItems;
	raceScreen.len = 8;
	initScreenItem(&raceScreenItems[0], 120, 20, 15, redrawFanSw, *fanSw);
	initScreenItem(&raceScreenItems[1], 240, 20, 15, redrawFUELPumpSw,*fuelSw);
	initScreenItem(&raceScreenItems[2], 360, 20, 15, redrawWTRPumpSw, *wtrSw);
	initScreenItem(&raceScreenItems[3], 20, 70, 30, redrawDigit, &oilTemp);
	initScreenItem(&raceScreenItems[4], 330, 70, 30, redrawDigit, &waterTemp);
	initScreenItem(&raceScreenItems[5], 20, 190, 30, redrawDigit, &oilPress);
	initScreenItem(&raceScreenItems[6], 330, 180, 30, redrawDigit, &batVoltage);
	initScreenItem(&raceScreenItems[7], 170, 50, 100, redrawGearPos, &gearPos);

	// PDM stuff
	allScreens[PDM_DRAW_SCREEN] = &pdmDrawScreen;
	pdmDrawScreen.items = pdmDrawItems;
	pdmDrawScreen.len = 20;
	initScreenItem(&pdmDrawItems[1], 10, 50, 15, redrawDigit, &pdmIGNdraw);
	initScreenItem(&pdmDrawItems[2], 85, 50, 15, redrawDigit, &pdmINJdraw);
	initScreenItem(&pdmDrawItems[3], 160, 50, 15, redrawDigit, &pdmFUELdraw);
	initScreenItem(&pdmDrawItems[4], 235, 50, 15, redrawDigit, &pdmECUdraw);
	initScreenItem(&pdmDrawItems[5], 310, 50, 15, redrawDigit, &pdmWTRdraw);
	initScreenItem(&pdmDrawItems[6], 385, 50, 15, redrawDigit, &pdmFANdraw);
	initScreenItem(&pdmDrawItems[7], 10, 100, 15, redrawDigit, &pdmAUXdraw);
	initScreenItem(&pdmDrawItems[8], 85, 100, 15, redrawDigit, &pdmPDLUdraw);
	initScreenItem(&pdmDrawItems[9], 160, 100, 15, redrawDigit, &pdmPDLDdraw);
	initScreenItem(&pdmDrawItems[10], 235, 100, 15, redrawDigit, &pdm5v5draw);
	initScreenItem(&pdmDrawItems[11], 310, 100, 15, redrawDigit, &pdmBATdraw);
	initScreenItem(&pdmDrawItems[16], 385, 100, 15, redrawDigit, &pdmFUELPcut);
	initScreenItem(&pdmDrawItems[17], 10, 150, 15, redrawDigit, &pdmECUPcut);
	initScreenItem(&pdmDrawItems[18], 85, 150, 15, redrawDigit, &pdmWTRPcut);
	initScreenItem(&pdmDrawItems[19], 160, 150, 15, redrawDigit, &pdmFANPcut);
	initScreenItem(&pdmDrawItems[12], 10, 200, 15, redrawDigit, &pdmSTR0draw);
	initScreenItem(&pdmDrawItems[13], 100, 200, 15, redrawDigit, &pdmSTR1draw);
	initScreenItem(&pdmDrawItems[14], 190, 200, 15, redrawDigit, &pdmSTR2draw);
	initScreenItem(&pdmDrawItems[15], 280, 200, 15, redrawDigit, &pdmSTRdraw);
	initScreenItem(&pdmDrawItems[0], 370, 200, 15, redrawDigit, &pdmCurrentDraw);


	allScreens[PDM_CUT_SCREEN] = &pdmCutScreen;
	pdmCutScreen.items = pdmCutItems;
	pdmCutScreen.len = 21;
	initScreenItem(&pdmCutItems[0], 10, 50, 15, redrawDigit, &pdmTemp);
	initScreenItem(&pdmCutItems[1], 85, 50, 15, redrawDigit, &pdmICTemp);
	initScreenItem(&pdmCutItems[4], 310, 50, 15, redrawDigit, &pdm5v5);
	initScreenItem(&pdmCutItems[5], 385, 50, 15, redrawDigit, &pdm5v);
	initScreenItem(&pdmCutItems[6], 10, 100, 15, redrawDigit, &pdm3v3);
	initScreenItem(&pdmCutItems[7], 85, 100, 15, redrawDigit, &pdmIGNcut);
	initScreenItem(&pdmCutItems[8], 160, 100, 15, redrawDigit, &pdmINJcut);
	initScreenItem(&pdmCutItems[9], 235, 100, 15, redrawDigit, &pdmFUELNcut);
	pdmECUNcut.decDigits = 1;
	pdmECUNcut.wholeDigits = 2;
	initScreenItem(&pdmCutItems[10], 160, 50, 15, redrawDigit, &pdmECUNcut);
	//initScreenItem(&pdmCutItems[11], 385, 100, 15, redrawDigit, &pdmWTRNcut);
	initScreenItem(&pdmCutItems[12], 10, 150, 15, redrawDigit, &pdmFANNcut);
	initScreenItem(&pdmCutItems[13], 85, 150, 15, redrawDigit, &pdmAUXcut);
	initScreenItem(&pdmCutItems[14], 160, 150, 15, redrawDigit, &pdmPDLUcut);
	initScreenItem(&pdmCutItems[15], 235, 150, 15, redrawDigit, &pdmPDLDcut);
	initScreenItem(&pdmCutItems[16], 310, 150, 15, redrawDigit, &pdm5v5cut);
	initScreenItem(&pdmCutItems[17], 385, 150, 15, redrawDigit, &pdmBATcut);
	initScreenItem(&pdmCutItems[18], 10, 200, 15, redrawDigit, &pdmSTR0cut);
	//initScreenItem(&pdmCutItems[19], 85, 200, 15, redrawDigit, &pdmSTR1cut);
	//initScreenItem(&pdmCutItems[20], 160, 200, 15, redrawDigit, &pdmSTR2cut);
    
    //brake pressure 
    initScreenItem(&pdmCutItems[19], 85, 200, 15, redrawDigit,&brakePressFront);
    initScreenItem(&pdmCutItems[20], 160, 200, 15, redrawDigit, &brakePressRear);
    
	initScreenItem(&pdmCutItems[2], 235, 200, 15, redrawDigit, &pdmVBat);
	initScreenItem(&pdmCutItems[3], 330, 200, 15, redrawDigit, &pdm12v);


	// MoTec Stuff
	allScreens[MOTEC_SCREEN] = &motecScreen;
	motecScreen.items = motecItems;
	motecScreen.len = 30;
	initScreenItem(&motecItems[0], 10, 30, 20, redrawDigit, &rpm);
	initScreenItem(&motecItems[1], 10, 30, 20, redrawDigit, &throtPos);
	initScreenItem(&motecItems[2], 10, 30, 20, redrawDigit, &oilPress);
	initScreenItem(&motecItems[3], 10, 30, 20, redrawDigit, &oilTemp);
	initScreenItem(&motecItems[4], 10, 30, 20, redrawDigit, &waterTemp);
	initScreenItem(&motecItems[5], 10, 30, 20, redrawDigit, &lambda);
	initScreenItem(&motecItems[6], 10, 30, 20, redrawDigit, &manifoldPress);
	initScreenItem(&motecItems[7], 10, 30, 20, redrawDigit, &batVoltage);
	initScreenItem(&motecItems[8], 10, 30, 20, redrawDigit, &wheelSpeedFL);
	initScreenItem(&motecItems[9], 10, 30, 20, redrawDigit, &wheelSpeedFR);
	initScreenItem(&motecItems[10], 10, 30, 20, redrawDigit, &wheelSpeedRL);
	initScreenItem(&motecItems[11], 10, 30, 20, redrawDigit, &wheelSpeedRR);
	initScreenItem(&motecItems[12], 10, 30, 20, redrawDigit, &gpsLat);
	initScreenItem(&motecItems[13], 10, 30, 20, redrawDigit, &gpsLong);
	initScreenItem(&motecItems[14], 10, 30, 20, redrawDigit, &groundSpeed);
	initScreenItem(&motecItems[15], 10, 30, 20, redrawDigit, &driveSpeed);
	initScreenItem(&motecItems[16], 10, 30, 20, redrawDigit, &gpsSpeed);
	initScreenItem(&motecItems[17], 10, 30, 20, redrawDigit, &manifoldTemp);
	initScreenItem(&motecItems[18], 10, 30, 20, redrawDigit, &ambientTemp);
	initScreenItem(&motecItems[19], 10, 30, 20, redrawDigit, &ambientPress);
	initScreenItem(&motecItems[20], 10, 30, 20, redrawDigit, &fuelTemp);
	initScreenItem(&motecItems[21], 10, 30, 20, redrawDigit, &fuelPress);
	initScreenItem(&motecItems[22], 10, 30, 20, redrawDigit, &lambda1);
	initScreenItem(&motecItems[23], 10, 30, 20, redrawDigit, &lambda2);
	initScreenItem(&motecItems[24], 10, 30, 20, redrawDigit, &lambda3);
	initScreenItem(&motecItems[25], 10, 30, 20, redrawDigit, &lambda4);
	initScreenItem(&motecItems[26], 10, 30, 20, redrawDigit, &lcEnablity);
	initScreenItem(&motecItems[27], 10, 30, 20, redrawDigit, &fuelConsum);
	initScreenItem(&motecItems[28], 10, 30, 20, redrawDigit, &gpsAltitude);
	initScreenItem(&motecItems[29], 10, 30, 20, redrawDigit, &gpsTime);
	initScreenItem(&motecItems[30], 10, 30, 20, redrawDigit, &fuelInjDuty);
	initScreenItem(&motecItems[31], 10, 30, 20, redrawDigit, &fuelTrim);

	// End Race Screen
	allScreens[END_RACE_SCREEN] = &endRaceScreen;
	endRaceScreen.items = endRaceItems;
	endRaceScreen.len = 9;
	initScreenItem(&endRaceItems[0], 10, 30, 20, redrawDigit, &endLogNum);
	initScreenItem(&endRaceItems[1], 10, 30, 20, redrawDigit, &endNumLaps);
	initScreenItem(&endRaceItems[2], 10, 30, 20, redrawDigit, &endFastLap);
	initScreenItem(&endRaceItems[3], 10, 30, 20, redrawDigit, &endTireTempFL);
	initScreenItem(&endRaceItems[4], 10, 30, 20, redrawDigit, &endTireTempFR);
	initScreenItem(&endRaceItems[5], 10, 30, 20, redrawDigit, &endTireTempRL);
	initScreenItem(&endRaceItems[6], 10, 30, 20, redrawDigit, &endTireTempRR);
	initScreenItem(&endRaceItems[3], 10, 30, 20, redrawTireTemp, &endTireTempFL);
	initScreenItem(&endRaceItems[4], 10, 30, 20, redrawTireTemp, &endTireTempFR);
	initScreenItem(&endRaceItems[5], 10, 30, 20, redrawTireTemp, &endTireTempRL);
	initScreenItem(&endRaceItems[6], 10, 30, 20, redrawTireTemp, &endTireTempRR);
	initScreenItem(&endRaceItems[7], 10, 30, 20, redrawDigit, &endAmbientTemp);
	initScreenItem(&endRaceItems[8], 10, 30, 20, redrawDigit, &endFuelConsum);

	allScreens[CHASSIS_SCREEN] = &chassisScreen;
	chassisScreen.items = chassisItems;
	chassisScreen.len = 20;
	initScreenItem(&chassisItems[0], 10, 30, 20, redrawDigit, &ttFL);
	initScreenItem(&chassisItems[0], 10, 30, 20, redrawDigit, &ttFR);
	initScreenItem(&chassisItems[0], 10, 30, 20, redrawDigit, &ttRL);
	initScreenItem(&chassisItems[0], 10, 30, 20, redrawDigit, &ttRR);
	initScreenItem(&chassisItems[0], 10, 30, 20, redrawTireTemp, ttFLA);
	initScreenItem(&chassisItems[0], 10, 30, 20, redrawTireTemp, ttFRA);
	initScreenItem(&chassisItems[0], 10, 30, 20, redrawTireTemp, ttRLA);
	initScreenItem(&chassisItems[0], 10, 30, 20, redrawTireTemp, ttRRA);
    
    //brake screen
    allScreens[BRAKE_SCREEN] = &brakeScreen;
    brakeScreen.items = brakeItems;
    brakeScreen.len = 8;
    initScreenItem(&brakeItems[0], 20, 180, 30, redrawDigit, &brakePressFront);
    initScreenItem(&brakeItems[1], 360, 180, 30, redrawDigit, &brakePressRear);
    initScreenItem(&brakeItems[2], 80, 60, 20, redrawDigit, &brakeMinFront);
    initScreenItem(&brakeItems[3], 80, 100, 20, redrawDigit, &brakeMaxFront);
    initScreenItem(&brakeItems[4],360, 60, 20, redrawDigit, &brakeMinRear);
    initScreenItem(&brakeItems[5], 360, 100, 20, redrawDigit, &brakeMaxRear);
    initScreenItem(&brakeItems[6], 190, 40, 20, redrawBrakeBar, &brakePressFront);
    initScreenItem(&brakeItems[7], 250, 40, 20, redrawBrakeBar, &brakePressRear);
    

	// Lap Time Stuff
	lapTimeHead = 0;
	numLaps = 0;
	int i;
	for(i=0;i<20;i++){
		initDataItem(&(lapTimeBuffer[i]),0,0,1000,2,1);
		lapTimeBuffer[i].value = -1;
	}

	// error Stuff
	errBufferHead = 0;
	errBufferTail = 0;
	for(i=0;i<20;i++){
		errBuffer[i].errText = 0x0;
		errBuffer[i].item = 0x0;
		errBuffer[i].priority = 0;
	}
}
コード例 #5
0
// Initialize all the data streams
// This fn must be run before CAN is initialized
void initDataItems(void){
	// Motec Vars
	// Refresh Intervals
	// All Temp Channels - 500
	initDataItem(&rpm,0,0,MIN_REFRESH,5,0);
	initDataItem(&throtPos,0,0,MIN_REFRESH,3,1);
	initDataItem(&oilPress,0,0,MIN_REFRESH,1,2);
	initDataItem(&oilTemp,0,0,MIN_REFRESH,3,0);
	initDataItem(&waterTemp,0,0,MIN_REFRESH,3,0);
	initDataItem(&lambda,0,0,MIN_REFRESH,1,3);
	initDataItem(&manifoldPress,0,0,MIN_REFRESH,1,2);
	initDataItem(&batVoltage,0,0,MIN_REFRESH,2,2);
	initDataItem(&wheelSpeedFL,0,0,MIN_REFRESH,2,1);
	initDataItem(&wheelSpeedFR,0,0,MIN_REFRESH,2,1);
	initDataItem(&wheelSpeedRL,0,0,MIN_REFRESH,2,1);
	initDataItem(&wheelSpeedRR,0,0,MIN_REFRESH,2,1);
	initDataItem(&gpsLong,0,0,MIN_REFRESH,2,1); // Don't need
	initDataItem(&gpsLat,0,0,MIN_REFRESH,2,1); // Don't need
	initDataItem(&groundSpeed,0,0,MIN_REFRESH,2,1);
	initDataItem(&driveSpeed,0,0,MIN_REFRESH,2,1);
	initDataItem(&gpsSpeed,0,0,MIN_REFRESH,2,1);
	initDataItem(&manifoldTemp,0,0,MIN_REFRESH,3,0);
	initDataItem(&ambientTemp,0,0,MIN_REFRESH,3,0);
	initDataItem(&ambientPress,0,0,MIN_REFRESH,1,2);
	initDataItem(&fuelTemp,0,0,MIN_REFRESH,3,0);
	initDataItem(&fuelPress,0,0,MIN_REFRESH,1,2);
	initDataItem(&lambda1,0,0,MIN_REFRESH,1,3);
	initDataItem(&lambda2,0,0,MIN_REFRESH,1,3);
	initDataItem(&lambda3,0,0,MIN_REFRESH,1,3);
	initDataItem(&lambda4,0,0,MIN_REFRESH,1,3);
	initDataItem(&lcEnablity,0,0,MIN_REFRESH,1,0);
	initDataItem(&fuelConsum,0,0,MIN_REFRESH,2,1);
	initDataItem(&gpsAltitude,0,0,MIN_REFRESH,2,1); // ?
	initDataItem(&gpsTime,0,0,MIN_REFRESH,2,1); // ?
	initDataItem(&runTime,0,0,MIN_REFRESH,4,0);
	initDataItem(&fuelInjDuty,0,0,MIN_REFRESH,3,1);
	initDataItem(&fuelTrim,0,0,MIN_REFRESH,3,1);

	// Tire Temps
	initDataItem(&ttFLA[0],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFLA[1],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFLA[2],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFLA[3],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFL,0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFRA[0],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFRA[1],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFRA[2],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFRA[3],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttFR,0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRLA[0],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRLA[1],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRLA[2],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRLA[3],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRL,0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRRA[0],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRRA[1],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRRA[2],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRRA[3],0,0,MIN_REFRESH,2,1);
	initDataItem(&ttRR,0,0,MIN_REFRESH,2,1);

	// Paddle Shifting
	initDataItem(&paddleTemp,0,0,MIN_REFRESH,2,1);
	initDataItem(&gearPos,0,0,MIN_REFRESH,1,0);
	initDataItem(&neutQueue,0,0,MIN_REFRESH,1,0);
	initDataItem(&upQueue,0,0,MIN_REFRESH,1,0);
	initDataItem(&downQueue,0,0,MIN_REFRESH,1,0);
	initDataItem(&gearVoltage,0,0,MIN_REFRESH,1,2);

	// PDM
	initDataItem(&pdmTemp,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmICTemp,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmCurrentDraw,0,0,MIN_REFRESH,3,1);
	initDataItem(&pdmVBat,0,0,MIN_REFRESH,2,2);
	initDataItem(&pdm12v,0,0,MIN_REFRESH,2,2);
	initDataItem(&pdm5v5,0,0,MIN_REFRESH,1,2);
	initDataItem(&pdm5v,0,0,MIN_REFRESH,1,2);
	initDataItem(&pdm3v3,0,0,MIN_REFRESH,1,2);
	// Draw (^str) - 2,2
	// Cut (^str)) - 3,1
	initDataItem(&pdmIGNdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmIGNcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmINJdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmINJcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmFUELdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmFUELNcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmFUELPcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmECUdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmECUNcut,0,0,MIN_REFRESH,0,1);
	initDataItem(&pdmECUPcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmWTRdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmWTRNcut,0,0,MIN_REFRESH,0,1);
	initDataItem(&pdmWTRPcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmFANdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmFANNcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmFANPcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmAUXdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmAUXcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmPDLUdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmPDLUcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmPDLDdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmPDLDcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdm5v5draw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdm5v5cut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmBATdraw,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmBATcut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmSTR0draw,0,0,MIN_REFRESH,3,1);
	initDataItem(&pdmSTR0cut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmSTR1draw,0,0,MIN_REFRESH,3,1);
	initDataItem(&pdmSTR1cut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmSTR2draw,0,0,MIN_REFRESH,3,1);
	initDataItem(&pdmSTR2cut,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmSTRdraw,0,0,MIN_REFRESH,3,1);

	// PDM Bitmaps
	initDataItem(&STRenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&BVBATenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&B5V5enabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&PDLDenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&PDLUenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&AUXenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&FANenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&WTRenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&ECUenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&FUELenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&INJenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&IGNenabl,0,0,MIN_REFRESH,1,0);
	initDataItem(&STR2pm,0,0,MIN_REFRESH,1,0);
	initDataItem(&STR1pm,0,0,MIN_REFRESH,1,0);
	initDataItem(&STR0pm,0,0,MIN_REFRESH,1,0);
	initDataItem(&BVBATpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&B5V5pm,0,0,MIN_REFRESH,1,0);
	initDataItem(&PDLDpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&PDLUpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&AUXpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&FANpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&WTRpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&ECUpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&FUELpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&INJpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&IGNpm,0,0,MIN_REFRESH,1,0);
	initDataItem(&KILLpdmSw,0,0,MIN_REFRESH,1,0);
	initDataItem(&ACT_DNpdmSw,0,0,MIN_REFRESH,1,0);
	initDataItem(&ACT_UPpdmSw,0,0,MIN_REFRESH,1,0);
	initDataItem(&ONpdmSw,0,0,MIN_REFRESH,1,0);
	initDataItem(&STRpdmSw,0,0,MIN_REFRESH,1,0);

	// Rear Analog Hub
	initDataItem(&susPosRR,0,0,MIN_REFRESH,2,1);
	initDataItem(&susPosRL,0,0,MIN_REFRESH,2,1);
	initDataItem(&engOutput,0,0,MIN_REFRESH,2,1);
	initDataItem(&battCurrent,0,0,MIN_REFRESH,2,1);
	initDataItem(&radInputTemp,0,0,MIN_REFRESH,2,1);
	initDataItem(&radOutputTemp,0,0,MIN_REFRESH,2,1);
	initDataItem(&swirlTemp,0,0,MIN_REFRESH,2,1);
	initDataItem(&swirlPress,0,0,MIN_REFRESH,2,1);

	// Front Analog Hub
	initDataItem(&susPosFR,0,0,MIN_REFRESH,2,1);
	initDataItem(&susPosFL,0,0,MIN_REFRESH,2,1);
	initDataItem(&brakePressFront,0,0,MIN_REFRESH,2,1);
	initDataItem(&brakePressRear,0,0,MIN_REFRESH,2,1);
	initDataItem(&steeringAngle,0,0,MIN_REFRESH,2,1);
	initDataItem(&accelPedalPos0,0,0,MIN_REFRESH,2,1);
	initDataItem(&accelPedalPos1,0,0,MIN_REFRESH,2,1);
	// Uptimes
	// uptimes - 4,0
	initDataItem(&paddleUptime,0,0,MIN_REFRESH,2,1);
	initDataItem(&loggerUptime,0,0,MIN_REFRESH,2,1);
	initDataItem(&swUptime,0,0,MIN_REFRESH,2,1);
	initDataItem(&pdmUptime,0,0,MIN_REFRESH,2,1);
    initDataItem(&brakeMinFront,0,0,MIN_REFRESH,2,1);
    initDataItem(&brakeMaxFront,0,0,MIN_REFRESH,2,1);
    initDataItem(&brakeMinRear,0,0,MIN_REFRESH,2,1);
    initDataItem(&brakeMaxRear,0,0,MIN_REFRESH,2,1);
    brakeMinFront.value = 100;
    brakeMinRear.value = 100;
    
	// EndRace
	initDataItem(&endLogNum,0,0,1000,2,1);
	initDataItem(&endNumLaps,0,0,1000,2,1);
	initDataItem(&endFastLap,0,0,1000,2,1);
	initDataItem(&endTireTempFL,0,0,1000,2,1);
	initDataItem(&endTireTempFR,0,0,1000,2,1);
	initDataItem(&endTireTempRL,0,0,1000,2,1);
	initDataItem(&endTireTempRR,0,0,1000,2,1);
	initDataItem(&endAmbientTemp,0,0,1000,2,1);
	initDataItem(&endFuelConsum,0,0,1000,2,1);

	//Switches and Rotaries
	initDataItem(&rotary[0],0,0,MIN_REFRESH,1,0);
	initDataItem(&rotary[1],0,0,MIN_REFRESH,1,0);
	initDataItem(&rotary[2],0,0,MIN_REFRESH,1,0);
	initDataItem(&tRotary[0],0,0,MIN_REFRESH,1,0);
	initDataItem(&tRotary[1],0,0,MIN_REFRESH,1,0);
	initDataItem(&tRotary[2],0,0,MIN_REFRESH,1,0);
	initDataItem(&switches[0],0,0,MIN_REFRESH,1,0);
	initDataItem(&switches[1],0,0,MIN_REFRESH,1,0);
	initDataItem(&switches[2],0,0,MIN_REFRESH,1,0);
	initDataItem(&switches[3],0,0,MIN_REFRESH,1,0);
	initDataItem(&momentaries[0],0,0,MIN_REFRESH,1,0);
	initDataItem(&momentaries[1],0,0,MIN_REFRESH,1,0);
	initDataItem(&momentaries[2],0,0,MIN_REFRESH,1,0);
	initDataItem(&momentaries[3],0,0,MIN_REFRESH,1,0);

	fanSw[0] = &switches[0];
	fanSw[1] = &FANenabl;
	fuelSw[0] = &switches[1];
	fuelSw[1] = &FUELenabl;
	wtrSw[0] = &switches[2];
	wtrSw[1] = &WTRenabl;
}