void changeAUXType(uint8_t num){ if(num != auxNumber && screenNumber == RACE_SCREEN){ fillRect(300, 140, 179, 135, backgroundColor); textMode(); textTransparent(foregroundColor); textEnlarge(1); textSetCursor(330, 140); switch(num) { // Battery Voltage case 0: textWrite("BAT V"); raceScreenItems[6].data = &pdmDataItems[VBAT_RAIL_IDX]; raceScreenItems[6].info.x += 30; break; // Lambda case 1: textWrite("LAMBDA"); raceScreenItems[6].data = &motecDataItems[LAMBDA_IDX]; break; // RPM case 2: textWrite("RPM"); raceScreenItems[6].data = &motecDataItems[ENG_RPM_IDX]; raceScreenItems[6].info.x -= 30; break; } textEnlarge(0); graphicsMode(); auxNumber = num; } }
/* * draws text on screen */ void text_draw(text *txt) { fillRect(txt->x,txt->y,txt->bgWidth,txt->bgHeight,txt->bgColor); textMode(); textEnlarge(txt->size); textSetCursor(txt->x,txt->y); textTransparent(txt->color); textWrite(txt->label); graphicsMode(); }
/* * draws the text on screen with a new value appended to the end */ void text_drawVal(text *txt, char *str) { fillRect(txt->x,txt->y,txt->bgWidth,txt->bgHeight,txt->bgColor); textMode(); textEnlarge(0); textSetCursor(txt->x,txt->y); textTransparent(txt->color); textWrite(str); graphicsMode(); }
// Error Handling Stuff void displayNoErrors(void){ // Reset error area fillRect(0,200,WIDTH,HEIGHT-200,backgroundColor); drawChevron(30, 210, 30, 50, foregroundColor, backgroundColor); textMode(); textSetCursor(100, 210); textTransparent(RA8875_BLACK); textEnlarge(1); textWrite("Illini Motorsports"); graphicsMode(); }
SAWYER_EXPORT void PodFormatter::text(std::ostream &out, const std::string &s) { BOOST_FOREACH (char ch, escape(s)) { if ('\n'==ch) { out <<ch; atBeginningOfLine_ = true; } else if (atBeginningOfLine_) { if (textMode()==PROSE && (' '==ch || '\t'==ch)) { // toss white space at beginning of prose lines } else if (textMode()==NONPROSE) { // make sure non-prose lines start with white space (we use tab so that tabs embedded in the rest of // the line still line up nicely in case a human needs to look at the POD output). out <<"\t" <<ch; atBeginningOfLine_ = false; } else { out <<ch; atBeginningOfLine_ = false; } } else { out <<ch; } } }
// Helper function for drawing labels and such on a new screen void initScreen(uint8_t num){ switch(num){ case RACE_SCREEN: textMode(); textEnlarge(1); textTransparent(foregroundColor); textSetCursor(7, 40); textWrite("OIL TEMP"); textSetCursor(0, 160); textWrite("OIL PRESS"); textSetCursor(360, 40); textWrite("WTR TMP"); textSetCursor(370,160); textWrite("BAT V"); textSetCursor(200,160); textWrite("LAMBDA"); textEnlarge(0); graphicsMode(); break; case PDM_DRAW_SCREEN: textMode(); textTransparent(foregroundColor); textSetCursor(10,10); textWrite("IGN DRW"); textSetCursor(85, 10); textWrite("INJ DRW"); textSetCursor(160, 10); textWrite("FUEL DRW"); textSetCursor(235, 10); textWrite("ECU DRW"); textSetCursor(310, 10); textWrite("WTR DRW"); textSetCursor(385, 10); textWrite("FAN DRW"); textSetCursor(10, 60); textWrite("AUX DRW"); textSetCursor(85, 60); textWrite("PDLU DRW"); textSetCursor(160,60); textWrite("PDLD DRW"); textSetCursor(235, 60); textWrite("ABS DRW"); textSetCursor(310, 60); textWrite("BAT DRW"); textSetCursor(385, 60); textWrite("STR DRW"); textSetCursor(10,110); textWrite("IGN CUT"); textSetCursor(85, 110); textWrite("INJ CUT"); textSetCursor(160, 110); textWrite("FUEL CUT"); textSetCursor(235, 110); textWrite("ECU CUT"); textSetCursor(310, 110); textWrite("WTR CUT"); textSetCursor(385, 110); textWrite("FAN CUT"); textSetCursor(10, 160); textWrite("AUX CUT"); textSetCursor(85, 160); textWrite("PDLU CUT"); textSetCursor(160,160); textWrite("PDLD CUT"); textSetCursor(235, 160); textWrite("ABS CUT"); textSetCursor(310, 160); textWrite("BAT CUT"); textSetCursor(160, 210); textWrite("FUEL PCT"); textSetCursor(235, 210); textWrite("FAN PCT"); textSetCursor(310, 210); textWrite("WTR PCT"); textSetCursor(385, 210); textWrite("ECU PCT"); textEnlarge(2); textSetCursor(10, 210); textWrite("PDM"); textEnlarge(0); graphicsMode(); break; case LAMBDA_SCREEN: textMode(); textTransparent(foregroundColor); textSetCursor(10,10); textEnlarge(0); graphicsMode(); break; case THROTTLE_SCREEN: textMode(); textTransparent(foregroundColor); graphicsMode(); break; /* case PDM_DRAW_SCREEN: textMode(); textTransparent(foregroundColor); textSetCursor(10,10); textWrite("IGN DRW"); textSetCursor(85, 10); textWrite("INJ DRW"); textSetCursor(160, 10); textWrite("FUEL DRW"); textSetCursor(235, 10); textWrite("ECU DRW"); textSetCursor(310, 10); textWrite("WTR DRW"); textSetCursor(385, 10); textWrite("FAN DRW"); graphicsMode(); //Horizontal Lines drawLine(80, 30, 0, 200, foregroundColor); drawLine(155, 30, 0, 200, foregroundColor); drawLine(230, 30, 0, 200, foregroundColor); drawLine(305, 30, 0, 200, foregroundColor); drawLine(380, 30, 0, 200, foregroundColor); //Vertical Lines drawLine(10, 30, 0, 200, foregroundColor); drawLine(10, 30, 0, 200, foregroundColor); drawLine(10, 30, 0, 200, foregroundColor); drawLine(10, 30, 0, 200, foregroundColor); drawLine(10, 30, 0, 200, foregroundColor); break; */ case PDM_CUT_SCREEN: textMode(); textTransparent(foregroundColor); textSetCursor(10,30); textWrite("PDM TEMP"); textSetCursor(85, 30); textWrite("IC TEMP"); textSetCursor(160, 30); textWrite("BAT VOLT"); textSetCursor(235, 30); textWrite("12V VOLT"); textSetCursor(310, 30); textWrite("5V5 VOLT"); textSetCursor(385, 30); textWrite("5V VOLT"); textSetCursor(10, 80); textWrite("3V3 VOLT"); textSetCursor(85, 80); textWrite("IGN CUT"); textSetCursor(160,80); textWrite("INJ CUT"); textSetCursor(235, 80); textWrite("FUEL NCUT"); textSetCursor(310, 80); textWrite("ECU NCUT"); textSetCursor(385, 80); textWrite("WTR NCUT"); textSetCursor(10, 130); textWrite("FAN NCUT"); textSetCursor(85, 130); textWrite("AUX CUT"); textSetCursor(160, 130); textWrite("PDLU CUT"); textSetCursor(235, 130); textWrite("PDLU CUT"); textSetCursor(310,130); textWrite("5V5 CUT"); textSetCursor(385, 130); textWrite("BAT CUT"); textSetCursor(10, 180); textWrite("STR0 CUT"); textSetCursor(85, 180); textWrite("BRK F"); textSetCursor(160, 180); textWrite("BRK R"); graphicsMode(); break; case MOTEC_SCREEN: textMode(); textTransparent(foregroundColor); graphicsMode(); break; case END_RACE_SCREEN: textMode(); textTransparent(foregroundColor); graphicsMode(); break; case CHASSIS_SCREEN: textMode(); textTransparent(foregroundColor); graphicsMode(); break; case BRAKE_SCREEN: textMode(); textTransparent(foregroundColor); textEnlarge(1); textSetCursor(20, 235); textWrite("BRK F"); textSetCursor(360, 235); textWrite("BRK R"); textSetCursor(20,60); textWrite("MIN F:"); textSetCursor(20,100); textWrite("MAX F:"); textSetCursor(300,60); textWrite("MIN R:"); textSetCursor(300,100); textWrite("MAX R:"); graphicsMode(); textEnlarge(0); break; case IMU_SCREEN: //to be determined textMode(); textTransparent(foregroundColor); textSetCursor(364, 85); textWrite("LATERAL"); textSetCursor(207, 213); textWrite("LONGITUDINAL"); textEnlarge(0); graphicsMode(); break; } }
// Helper function for drawing labels and such on a new screen void initScreen(uint8_t num){ switch(num){ case RACE_SCREEN: textMode(); textEnlarge(1); textTransparent(foregroundColor); textSetCursor(0, 40); textWrite("OIL TEMP"); textSetCursor(0, 140); textWrite("OIL PRESS"); textSetCursor(330, 40); textWrite("WTR TMP"); textSetCursor(330,140); textWrite("BAT V"); textEnlarge(0); graphicsMode(); break; case PDM_DRAW_SCREEN: textMode(); textTransparent(foregroundColor); textSetCursor(10,30); textWrite("IGN DRW"); textSetCursor(85, 30); textWrite("INJ DRW"); textSetCursor(160, 30); textWrite("FUEL DRW"); textSetCursor(235, 30); textWrite("ECU DRW"); textSetCursor(310, 30); textWrite("WTR DRW"); textSetCursor(385, 30); textWrite("FAN DRW"); textSetCursor(10, 80); textWrite("AUX DRW"); textSetCursor(85, 80); textWrite("PDLU DRW"); textSetCursor(160,80); textWrite("PDLD DRW"); textSetCursor(235, 80); textWrite("5V5 DRW"); textSetCursor(310, 80); textWrite("BAT DRW"); textSetCursor(385, 80); textWrite("FUEL P CUT"); textSetCursor(10, 130); textWrite("ECU PCUT"); textSetCursor(85, 130); textWrite("WTR PCUT"); textSetCursor(160, 130); textWrite("FAN PCUT"); textSetCursor(10, 180); textWrite("STR0 DRW"); textSetCursor(100, 180); textWrite("STR1 DRW"); textSetCursor(190, 180); textWrite("STR2 DRW"); textSetCursor(280, 180); textWrite("STR DRW"); textSetCursor(370, 180); textWrite("TOT DRW"); graphicsMode(); break; case PDM_CUT_SCREEN: textMode(); textTransparent(foregroundColor); textSetCursor(10,30); textWrite("PDM TEMP"); textSetCursor(85, 30); textWrite("IC TEMP"); textSetCursor(160, 30); textWrite("BAT VOLT"); textSetCursor(235, 30); textWrite("12V VOLT"); textSetCursor(310, 30); textWrite("5V5 VOLT"); textSetCursor(385, 30); textWrite("5V VOLT"); textSetCursor(10, 80); textWrite("3V3 VOLT"); textSetCursor(85, 80); textWrite("IGN CUT"); textSetCursor(160,80); textWrite("INJ CUT"); textSetCursor(235, 80); textWrite("FUEL NCUT"); textSetCursor(310, 80); textWrite("ECU NCUT"); textSetCursor(385, 80); textWrite("WTR NCUT"); textSetCursor(10, 130); textWrite("FAN NCUT"); textSetCursor(85, 130); textWrite("AUX CUT"); textSetCursor(160, 130); textWrite("PDLU CUT"); textSetCursor(235, 130); textWrite("PDLU CUT"); textSetCursor(310,130); textWrite("5V5 CUT"); textSetCursor(385, 130); textWrite("BAT CUT"); textSetCursor(10, 180); textWrite("STR0 CUT"); textSetCursor(85, 180); textWrite("BRK F"); textSetCursor(160, 180); textWrite("BRK R"); graphicsMode(); break; case MOTEC_SCREEN: textMode(); textTransparent(foregroundColor); graphicsMode(); break; case END_RACE_SCREEN: textMode(); textTransparent(foregroundColor); graphicsMode(); break; case CHASSIS_SCREEN: textMode(); textTransparent(foregroundColor); graphicsMode(); break; case BRAKE_SCREEN: textMode(); textTransparent(foregroundColor); textEnlarge(1); textSetCursor(20, 235); textWrite("BRK F"); textSetCursor(360, 235); textWrite("BRK R"); textSetCursor(20,60); textWrite("MIN F:"); textSetCursor(20,100); textWrite("MAX F:"); textSetCursor(300,60); textWrite("MIN R:"); textSetCursor(300,100); textWrite("MAX R:"); graphicsMode(); textEnlarge(0); break; } }