Dual CANbus monitor and instrumentation cluster supporting ILI9341 display controller
Dependencies: SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed
Fork of CANary by
Diff: displayModes.cpp
- Revision:
- 67:2022fce701d0
- Parent:
- 65:821fc79cd7fe
- Child:
- 68:10f7d7dbae19
diff -r 821fc79cd7fe -r 2022fce701d0 displayModes.cpp --- a/displayModes.cpp Wed Apr 10 15:08:38 2013 +0000 +++ b/displayModes.cpp Thu Apr 11 18:52:12 2013 +0000 @@ -359,6 +359,49 @@ } //---------------- +// gg - index +void showIndex(bool force, bool showButtons){ + + if(force){ + tt.foreground(White); + tt.background(Navy); + //tt.set_font((unsigned char*) Arial12x12_prop); // select the font + + tt.cls(); + + // add the buttons to GoTo to other screens + + tt.foreground(Yellow); + tt.background(DarkCyan); + tt.set_font((unsigned char*) Arial12x12); + + // top row + showButton(0,0," GoTo"," Main",4,4); + showButton(1,0," GoTo"," Brake",4,4); + showButton(2,0," GoTo"," EFF",4,4); + showButton(3,0," GoTo"," DTE",4,4); + // middle row + showButton(0,1," GoTo","CP Data",4,4); + showButton(1,1," GoTo","CP Hist",4,4); + showButton(2,1," GoTo","CP Bars",4,4); + // bottom (not Nav) row + showButton(0,2," GoTo"," Config",4,4); + showButton(1,2," GoTo","Playback",4,4); + showButton(2,2," GoTo","Set Time",4,4); + + showCP=false; + } + + if(sMode==1&&showButtons){ + tt.foreground(Yellow); + tt.background(DarkCyan); + tt.set_font((unsigned char*) Arial12x12); + + // do nothing here? + } +} + +//---------------- // gg - cpbars void cpBarPlot(bool force, bool showButtons){ short unsigned max, min, jv, i, bd; @@ -894,6 +937,9 @@ case cpBarScreen: // gg - cpbars cpBarPlot(changed||showCP,(display==whichTouched)); break; + case indexScreen: + showIndex(changed,(display==whichTouched)); + break; default: if (changed){ tt.background(Black); @@ -911,10 +957,11 @@ tt.set_font((unsigned char*) Arial12x12); showButton(0,tNavRow," <-Prev","",4,4); // gg - 4x4 + // col 1 see below + showButton(2,tNavRow," Go To"," Index",4,4); // gg - index showButton(3,tNavRow," Next->","",4,4); // gg - move next - - showButton(2,tNavRow," Go To"," Main",4,4); // gg - index + // col 1 in Nav row switch (dMode[display]) { case offScreen: sprintf(sTemp2," Off"); @@ -941,7 +988,7 @@ sprintf(sTemp2,"DeltaMon"); break; case cpScreen: - sprintf(sTemp2,"Cell Pair"); + sprintf(sTemp2,"CP Data"); break; case config1Screen: sprintf(sTemp2," Config"); @@ -958,6 +1005,9 @@ case cpBarScreen: // gg - cpbars sprintf(sTemp2,"CP Bars"); break; + case indexScreen: // gg - index + sprintf(sTemp2," Index"); + break; } showButton(1,tNavRow," Select",sTemp2,4,4);