• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GrStringDrawCentered函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GrStringDrawCentered函数的典型用法代码示例。如果您正苦于以下问题:C++ GrStringDrawCentered函数的具体用法?C++ GrStringDrawCentered怎么用?C++ GrStringDrawCentered使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GrStringDrawCentered函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DisplayIntStatus

//*****************************************************************************
//
// Display the interrupt state on the display.  The currently active and pending
// interrupts are displayed.
//
//*****************************************************************************
void
DisplayIntStatus(void)
{
    uint32_t ui32Temp;
    char pcBuffer[6];

    //
    // Display the currently active interrupts.
    //
    ui32Temp = HWREG(NVIC_ACTIVE0);
    pcBuffer[0] = ' ';
    pcBuffer[1] = (ui32Temp & 1) ? '1' : ' ';
    pcBuffer[2] = (ui32Temp & 2) ? '2' : ' ';
    pcBuffer[3] = (ui32Temp & 4) ? '3' : ' ';
    pcBuffer[4] = ' ';
    pcBuffer[5] = '\0';
    GrStringDrawCentered(&g_sContext, pcBuffer, -1, 130, 150, 1);

    //
    // Display the currently pending interrupts.
    //
    ui32Temp = HWREG(NVIC_PEND0);
    pcBuffer[1] = (ui32Temp & 1) ? '1' : ' ';
    pcBuffer[2] = (ui32Temp & 2) ? '2' : ' ';
    pcBuffer[3] = (ui32Temp & 4) ? '3' : ' ';
    GrStringDrawCentered(&g_sContext, pcBuffer, -1, 270, 150, 1);

    //
    // Flush the display.
    //
    GrFlush(&g_sContext);
}
开发者ID:nguyenvuhung,项目名称:TivaWare_C_Series-2.1.2.111,代码行数:38,代码来源:interrupts.c


示例2: WatchdogTouchCallback

//*****************************************************************************
//
// The touch screen driver calls this function to report all state changes.
//
//*****************************************************************************
static long
WatchdogTouchCallback(unsigned long ulMessage, long lX,  long lY)
{
    //
    // If the screen is tapped, we will receive a PTR_DOWN then a PTR_UP
    // message. We pick one (pretty much at random) to use as the trigger to
    // stop feeding the watchdog.
    //
    if(ulMessage == WIDGET_MSG_PTR_UP)
    {
        //
        // Let the user know that the tap has been registered and that the
        // watchdog is being starved.
        //
        GrContextFontSet(&g_sContext, g_pFontCmss20);
        GrStringDrawCentered(&g_sContext, "Watchdog is not being fed!", -1,
                             GrContextDpyWidthGet(&g_sContext) / 2 ,
                             (GrContextDpyHeightGet(&g_sContext) / 2), 1);
        GrContextFontSet(&g_sContext, g_pFontCmss14);
        GrStringDrawCentered(&g_sContext,
                             "           System will reset shortly.           ",
                             -1, GrContextDpyWidthGet(&g_sContext) / 2 ,
                             (GrContextDpyHeightGet(&g_sContext) / 2) + 20, 1);

        //
        // Set the flag that tells the interrupt handler not to clear the
        // watchdog interrupt.
        //
        g_bFeedWatchdog = false;
    }

    return(0);
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:38,代码来源:watchdog.c


示例3: drawGridTime

static void drawGridTime(tContext *pContext)
{
  char buf[20];
  uint8_t time[3];
  time[0] = workout_time % 60;
  time[1] = (workout_time / 60 ) % 60;
  time[2] = workout_time / 3600;

  GrContextForegroundSet(pContext, ClrBlack);
  switch(window_readconfig()->sports_grid)
  {
  case GRID_3:
    GrContextFontSet(pContext, (tFont*)&g_sFontExIcon16);
    GrStringDraw(pContext, "i", 1, 10, 15, 0);
    GrContextFontSet(pContext, &g_sFontGothic18);
    GrStringDraw(pContext, datapoints[0].name, -1, 28, 15, 0);
    GrContextFontSet(pContext, &g_sFontGothic28b);
    sprintf(buf, "%02d:%02d:%02d", time[2], time[1], time[0]);
    GrStringDrawCentered(pContext, buf, -1, LCD_WIDTH/2, 50, 0);
    break;
  case GRID_4:
  case GRID_5:
    GrContextFontSet(pContext, &g_sFontGothic28b);
    sprintf(buf, "%02d:%02d:%02d", time[2], time[1], time[0]);
    GrStringDrawCentered(pContext, buf, -1, LCD_WIDTH/2, 18, 0);
    break;
  }
}
开发者ID:Echoskope,项目名称:KreyosFirmware,代码行数:28,代码来源:sportswatch.c


示例4: SelectButtonPressed

//*****************************************************************************
//
// This function is called when the select button is pressed.
//
//*****************************************************************************
static int32_t
SelectButtonPressed(void)
{
    //
    // Find the X center of the display
    //
    int32_t i32CenterX = GrContextDpyWidthGet(&g_sContext) / 2;

    //
    // Let the user know that the button has been pressed and that the
    // watchdog is being starved.
    //
    GrStringDrawCentered(&g_sContext, "Starving", -1, i32CenterX, 14, 1);
    GrStringDrawCentered(&g_sContext, "Watchdog", -1, i32CenterX, 24, 1);
    GrStringDrawCentered(&g_sContext, "System", -1, i32CenterX, 36, 1);
    GrStringDrawCentered(&g_sContext, "   will   ", -1, i32CenterX, 46, 1);
    GrStringDrawCentered(&g_sContext, "reset ...", -1, i32CenterX, 56, 1);

    //
    // Set the flag that tells the interrupt handler not to clear the
    // watchdog interrupt.
    //
    g_bFeedWatchdog = false;

    return(0);
}
开发者ID:RoboEvangelist,项目名称:TivaWare_C_Series-2.1.0.12573,代码行数:31,代码来源:watchdog.c


示例5: Timer1IntHandler

void Timer1IntHandler(void)
{
	//debugled(10);
    ROM_TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);

    //debugled(3);
    int angle=0;
    if(max2>0 && max1>0 && abs(maxi1-maxi2)<PULSE_SAMPLE)
    {
    //float dt=abs(maxi1-maxi2)/SAMPLING_FREQUENCY;
    //angle=asin(dt*lambda/distance)*180/3.1412;
    angle=abs(maxi1-maxi2);
    }
    //debugled(3);
    acount++;
    //rcount=0;
    //ROM_IntMasterDisable();

	snprintf(text,sizeof(text),"%3ld,%3ld",rcount,g_ulADCCount);


    GrContextForegroundSet(&sDisplayContext, ClrDarkBlue);
    GrRectFill(&sDisplayContext, &sRect1);
    GrContextForegroundSet(&sDisplayContext, ClrWhite);
    //GrRectDraw(&sDisplayContext, &sRect1);
    GrContextFontSet(&sDisplayContext, g_pFontCm12);
    GrStringDrawCentered(&sDisplayContext,text, -1,
                         GrContextDpyWidthGet(&sDisplayContext) / 2, 10, 0);

    GrContextForegroundSet(&sDisplayContext, ClrDarkBlue);
    GrRectFill(&sDisplayContext, &sRect2);
    GrContextForegroundSet(&sDisplayContext, ClrWhite);
    sprintf(text,"%4d,%4d",buffer_increment,rem);
    GrContextFontSet(&sDisplayContext, g_pFontCm12/*g_pFontFixed6x8*/);
    GrStringDrawCentered(&sDisplayContext, text, -1,
                         GrContextDpyWidthGet(&sDisplayContext) / 2,
                         ((GrContextDpyHeightGet(&sDisplayContext) - 24) / 2) + 24,
                         0);
//    GrFlush(&sDisplayContext);
    max1=0;
    max2=0;
    res=0;
    res1=0;
    maxi1=0;
    maxi2=0;
    buffer_index=0;
    for(i=0;i<buffer_size;i++)
    {
    	buffer[0][i]=0;
    	buffer[1][i]=0;
    }
    i=0;
    j=0;
    ind2=buffer_index-buffer_increment+1;




}
开发者ID:pi19404,项目名称:Embedded,代码行数:59,代码来源:acquire.c


示例6: PrintSettings_DateTime_NotAllowed

void PrintSettings_DateTime_NotAllowed(tContext *context) {
    GrStringDrawCentered(context, "Cannot edit", AUTO_STRING_LENGTH, 47, 27, OPAQUE_TEXT);
    GrStringDrawCentered(context, "while insulin", AUTO_STRING_LENGTH, 47, 38, OPAQUE_TEXT);
    GrStringDrawCentered(context, "delivery is", AUTO_STRING_LENGTH, 47, 49, OPAQUE_TEXT);
    GrStringDrawCentered(context, "in progress", AUTO_STRING_LENGTH, 47, 60, OPAQUE_TEXT);

    LoadMiddleButton( context , "OK");
}
开发者ID:GevenM,项目名称:giip,代码行数:8,代码来源:PrintSettings_DateTimeNotAllowed.c


示例7: DrawToggle

//*****************************************************************************
//
// Draws a toggle button.
//
//*****************************************************************************
void
DrawToggle(const tButtonToggle *psButton, bool bOn)
{
    tRectangle sRect;
    int16_t i16X, i16Y;

    //
    // Copy the data out of the bounds of the button.
    //
    sRect = psButton->sRectButton;

    GrContextForegroundSet(&g_sContext, ClrLightGrey);
    GrRectFill(&g_sContext, &psButton->sRectContainer);

    //
    // Copy the data out of the bounds of the button.
    //
    sRect = psButton->sRectButton;

    GrContextForegroundSet(&g_sContext, ClrDarkGray);
    GrRectFill(&g_sContext, &psButton->sRectButton);

    if(bOn) {
        sRect.i16XMin += 2;
        sRect.i16YMin += 2;
        sRect.i16XMax -= 15;
        sRect.i16YMax -= 2;
    } else {
        sRect.i16XMin += 15;
        sRect.i16YMin += 2;
        sRect.i16XMax -= 2;
        sRect.i16YMax -= 2;
    }
    GrContextForegroundSet(&g_sContext, ClrLightGrey);
    GrRectFill(&g_sContext, &sRect);

    GrContextFontSet(&g_sContext, &g_sFontCm16);
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrContextBackgroundSet(&g_sContext, ClrLightGrey);

    i16X = sRect.i16XMin + ((sRect.i16XMax - sRect.i16XMin) / 2);
    i16Y = sRect.i16YMin + ((sRect.i16YMax - sRect.i16YMin) / 2);

    if(bOn) {
        GrStringDrawCentered(&g_sContext, psButton->pcOn, -1, i16X, i16Y,
                             true);
    } else {
        GrStringDrawCentered(&g_sContext, psButton->pcOff, -1, i16X, i16Y,
                             true);
    }

    if(psButton->pcLabel) {
        GrStringDraw(&g_sContext, psButton->pcLabel, -1,
                     psButton->sRectButton.i16XMax + 2,
                     psButton->sRectButton.i16YMin + 6,
                     true);
    }
}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:63,代码来源:screen.c


示例8: WatchdogTouchCallback

//*****************************************************************************
//
// The touch screen driver calls this function to report all state changes.
//
//*****************************************************************************
static int32_t
WatchdogTouchCallback(uint32_t ui32Message, int32_t i32X, int32_t i32Y)
{
    //
    // If the screen is tapped, we will receive a PTR_DOWN then a PTR_UP
    // message.  Use PTR_UP as the trigger to stop feeding the watchdog.
    //
    if(ui32Message == WIDGET_MSG_PTR_UP)
    {
        //
        // See if the left or right side of the screen was touched.
        //
        if(i32X <= (GrContextDpyWidthGet(&g_sContext) / 2))
        {
            //
            // Let the user know that the tap has been registered and that the
            // watchdog0 is being starved.
            //
            GrContextFontSet(&g_sContext, g_psFontCmss20);
            GrContextForegroundSet(&g_sContext, ClrRed);
            GrStringDrawCentered(&g_sContext,
                                 "Watchdog 0 starved, reset shortly", -1,
                                 GrContextDpyWidthGet(&g_sContext) / 2 ,
                                 (GrContextDpyHeightGet(&g_sContext) / 2) + 40,
                                 1);
            GrContextForegroundSet(&g_sContext, ClrWhite);

            //
            // Set the flag that tells the interrupt handler not to clear the
            // watchdog0 interrupt.
            //
            g_bFeedWatchdog0 = false;
        }
        else
        {
            //
            // Let the user know that the tap has been registered and that the
            // watchdog1 is being starved.
            //
            GrContextFontSet(&g_sContext, g_psFontCmss20);
            GrContextForegroundSet(&g_sContext, ClrRed);
            GrStringDrawCentered(&g_sContext,
                                 "Watchdog 1 starved, reset shortly", -1,
                                 GrContextDpyWidthGet(&g_sContext) / 2 ,
                                 (GrContextDpyHeightGet(&g_sContext) / 2) + 60,
                                 1);
            GrContextForegroundSet(&g_sContext, ClrWhite);

            //
            // Set the flag that tells the interrupt handler not to clear the
            // watchdog1 interrupt.
            //
            g_bFeedWatchdog1 = false;
        }
    }

    return(0);
}
开发者ID:bli19,项目名称:unesp_mdt,代码行数:63,代码来源:watchdog.c


示例9: CenteredStringWithShadow

//*****************************************************************************
//
// Draw a string with a white drop shadow at a give position on the display.
//
//*****************************************************************************
void
CenteredStringWithShadow(const tFont *pFont, char *pcString, short sX, short sY,
                         tBoolean bOpaque)
{
    GrContextFontSet(&g_sScreenContext, pFont);
    GrContextForegroundSet(&g_sScreenContext, SHADOW_COLOR);
    GrStringDrawCentered(&g_sScreenContext, pcString, -1, sX+1, sY+1, bOpaque);
    GrContextForegroundSet(&g_sScreenContext, HIGHLIGHT_COLOR);
    GrStringDrawCentered(&g_sScreenContext, pcString, -1, sX, sY, false);
}
开发者ID:VENGEL,项目名称:StellarisWare,代码行数:15,代码来源:blox_screen.c


示例10: PrintBolusCreateNotAllowed

void PrintBolusCreateNotAllowed( tContext *context ){

	 // Draw top and bottom banner and buttons
	LoadLeftButton( context , "BACK");

	// Menu options
	GrStringDrawCentered(context, "Bolus Preset", AUTO_STRING_LENGTH, 47, 31, OPAQUE_TEXT);
	GrStringDrawCentered(context, "Creation", AUTO_STRING_LENGTH, 47, 44, OPAQUE_TEXT);
	GrStringDrawCentered(context, "not Allowed", AUTO_STRING_LENGTH, 47, 57, OPAQUE_TEXT);

}
开发者ID:GevenM,项目名称:giip,代码行数:11,代码来源:PrintBolus_CreateNotAllowed.c


示例11: PrintNoBasProf

void PrintNoBasProf(tContext *context){
    // Draw top and bottom banner and buttons
	LoadLeftButton( context , "BACK");
	//LoadMiddleButton("SEL");
	//LoadRightButton("");


	// Menu options
	GrStringDrawCentered(context, "No Basal", AUTO_STRING_LENGTH, 47, 31, OPAQUE_TEXT);
	GrStringDrawCentered(context, "Profile", AUTO_STRING_LENGTH, 47, 44, OPAQUE_TEXT);
	GrStringDrawCentered(context, "Available", AUTO_STRING_LENGTH, 47, 57, OPAQUE_TEXT);
}
开发者ID:GevenM,项目名称:giip,代码行数:12,代码来源:PrintBasal_NoBasProf.c


示例12: fs_init

//*****************************************************************************
//
// Initialize the file system.
//
//*****************************************************************************
void
fs_init(void)
{
    FRESULT fresult;
    DIR g_sDirObject;

    //
    // Initialze the flag to indicate that we are disabled.
    //
    g_bFatFsEnabled = false;

    //
    // Initialize and mount the Fat File System.
    //
    fresult = f_mount(0, &g_sFatFs);
    if(fresult != FR_OK)
    {
        return;
    }

    //
    // Open the root directory for access.
    //
    fresult = f_opendir(&g_sDirObject, "/");

    //
    // Flag and display which file system we are using.
    //
    GrStringDrawCentered(&g_sContext, "Web Server Using", -1,
                         GrContextDpyWidthGet(&g_sContext) / 2, 180, false);
    if(fresult == FR_OK)
    {
        //
        // Indicate and display that we are using the SD file system.
        //
        g_bFatFsEnabled = true;
        GrStringDrawCentered(&g_sContext, "SDCard File System", -1,
                             GrContextDpyWidthGet(&g_sContext) / 2, 200,
                             false);
    }
    else
    {
        //
        // Indicate and display that we are using the internal file system.
        //
        g_bFatFsEnabled = false;
        GrStringDrawCentered(&g_sContext, "Internal File System", -1,
                             GrContextDpyWidthGet(&g_sContext) / 2, 200,
                             false);
    }
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:56,代码来源:lmi_fs.c


示例13: SafeRTOSErrorHook

//*****************************************************************************
//
// This hook is called by SafeRTOS when an error is detected.
//
//*****************************************************************************
static void
SafeRTOSErrorHook(xTaskHandle xHandleOfTaskWithError,
                  signed portCHAR *pcNameOfTaskWithError,
                  portBASE_TYPE xErrorCode)
{
    tContext sContext;

    //
    // A fatal SafeRTOS error was detected, so display an error message.
    //
    GrContextInit(&sContext, &g_sKitronix320x240x16_SSD2119);
    GrContextForegroundSet(&sContext, ClrRed);
    GrContextBackgroundSet(&sContext, ClrBlack);
    GrContextFontSet(&sContext, g_pFontCm20);
    GrStringDrawCentered(&sContext, "Fatal SafeRTOS error!", -1,
                         GrContextDpyWidthGet(&sContext) / 2,
                         (((GrContextDpyHeightGet(&sContext) - 24) / 2) +
                          24), 1);

    //
    // This function can not return, so loop forever.  Interrupts are disabled
    // on entry to this function, so no processor interrupts will interrupt
    // this loop.
    //
    while(1)
    {
    }
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:33,代码来源:safertos_demo.c


示例14: DisplayStatus

/******************************************************************************
*																			  *
* \brief  Shows the status string on the color STN display.                   *
*																			  *
* \param psContext is a pointer to the graphics context representing the      *
*        display.                                                             *
*																		      *
* \param pcStatus is a pointer to the string to be shown.                     *
*																		      *
* \return none.                                                               *
*                                                                             *
******************************************************************************/
void DisplayStatus(tContext *psContext, char *pcStatus)
{
    tRectangle rectLine;
    int lY;

    /* Calculate the Y coordinate of the top left of the character cell
       for our line of text.
    */
    lY = (GrContextDpyHeightGet(psContext) / 8) -
         (GrFontHeightGet(TEXT_FONT) / 2);

    /* Determine the bounding rectangle for this line of text. We add 4 pixels
       to the height just to ensure that we clear a couple of pixels above and
       below the line of text.
    */
    rectLine.sXMin = 0;
    rectLine.sXMax = GrContextDpyWidthGet(psContext) - 1;
    rectLine.sYMin = lY;
    rectLine.sYMax = lY + GrFontHeightGet(TEXT_FONT) + 3;

    /* Clear the line with black. */
    
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(psContext, &rectLine);
    
    /* Draw the new status string */
    
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrStringDrawCentered(psContext, pcStatus, -1,
                         GrContextDpyWidthGet(psContext) / 2,
                         GrContextDpyHeightGet(psContext) / 8 , false);
}
开发者ID:OS-Project,项目名称:Divers,代码行数:44,代码来源:usb_dev_serial.c


示例15: vApplicationStackOverflowHook

//*****************************************************************************
//
// This hook is called by FreeRTOS when an stack overflow error is detected.
//
//*****************************************************************************
void
vApplicationStackOverflowHook(xTaskHandle *pxTask, signed char *pcTaskName)
{
    tContext sContext;

    //
    // A fatal FreeRTOS error was detected, so display an error message.
    //
    GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119);
    GrContextForegroundSet(&sContext, ClrRed);
    GrContextBackgroundSet(&sContext, ClrBlack);
    GrContextFontSet(&sContext, g_psFontCm20);
    GrStringDrawCentered(&sContext, "Fatal FreeRTOS error!", -1,
                         GrContextDpyWidthGet(&sContext) / 2,
                         (((GrContextDpyHeightGet(&sContext) - 24) / 2) +
                          24), 1);

    //
    // This function can not return, so loop forever.  Interrupts are disabled
    // on entry to this function, so no processor interrupts will interrupt
    // this loop.
    //
    while(1)
    {
    }
}
开发者ID:RevaReva,项目名称:tiva-c,代码行数:31,代码来源:freertos_demo.c


示例16: DisplayStatus

//*****************************************************************************
//
// Shows the status string on the color STN display.
//
// \param psContext is a pointer to the graphics context representing the
// display.
// \param pcStatus is a pointer to the string to be shown.
//
// This implementation assumes we are using a 6 pixel wide font, giving us
// space for 16 characters across the display.
//
//*****************************************************************************
void
DisplayStatus(tContext *psContext, char *pcStatus)
{
    tRectangle sRectLine;

    //
    // Determine the bounding rectangle for this line of text.
    //
    sRectLine.i16XMin = 0;
    sRectLine.i16XMax = GrContextDpyWidthGet(psContext) - 1;
    sRectLine.i16YMin = GrContextDpyHeightGet(psContext) - (TEXT_HEIGHT + 2);
    sRectLine.i16YMax = sRectLine.i16YMin + GrFontHeightGet(TEXT_FONT) + 1;

    //
    // Clear the line with black.
    //
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(psContext, &sRectLine);

    //
    // Draw the new status string
    //
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrStringDrawCentered(psContext, pcStatus, -1,
                         GrContextDpyWidthGet(psContext) / 2,
                         sRectLine.i16YMin + (TEXT_HEIGHT / 2), false);
}
开发者ID:PhamVanNhi,项目名称:ECE5770,代码行数:39,代码来源:usb_dev_serial.c


示例17: UpdateStatus

//*****************************************************************************
//
// Display a status string on the LCD and also transmit it via the serial port.
//
//*****************************************************************************
void
UpdateStatus(char *pcStatus)
{
    tRectangle sRect;

    //
    // Dump that status string to the serial port.
    //
    UARTprintf("%s\n", pcStatus);

    //
    // Clear any previous status message.
    //
    sRect.i16XMin = 0;
    sRect.i16XMax = GrContextDpyWidthGet(&g_sContext) - 1;
    sRect.i16YMin = STATUS_Y - 16;
    sRect.i16YMax = STATUS_Y + 16;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &sRect);

    //
    // Display the new status string.
    //
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrStringDrawCentered(&g_sContext, pcStatus, -1,
                         GrContextDpyWidthGet(&g_sContext) / 2, STATUS_Y, 0);
}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:33,代码来源:enet_uip.c


示例18: onDraw

static void onDraw(tContext *pContext)
{
  char buf[30];
  GrContextForegroundSet(pContext, ClrBlack);
#if defined(PRODUCT_W002) || defined(PRODUCT_W004)
	GrRectFill(pContext, &client_clip);
#else  
  GrRectFill(pContext, &fullscreen_clip);
#endif
  GrContextForegroundSet(pContext, ClrWhite);

  if (state == WALK)
  {
#if defined(PRODUCT_W002) || defined(PRODUCT_W004)
    sprintf(buf, "%d", ped_get_steps());
    drawItem(pContext, 0, ICON_STEPS, "Step Taken", buf);
    
    sprintf(buf, "%02d:%02d", ped_get_time() / 60, ped_get_time() % 60);
    drawItem(pContext, 1, ICON_TIME, "Walk Time", buf);

    uint16_t cals = ped_get_calorie() / 100 / 1000;
    sprintf(buf, "%d", cals);
    drawItem(pContext, 2, ICON_CALORIES, "Calories", buf);
    
    uint16_t dist = ped_get_distance() / 100;
    sprintf(buf, "%dm", dist);
    drawItem(pContext, 3, ICON_DISTANCE, "Distance", buf);    
    
#else  	
    sprintf(buf, "%d", ped_get_steps());
    drawItem(pContext, 0, ICON_STEPS, "Steps", buf);

    uint16_t cals = ped_get_calorie() / 100 / 1000;
    sprintf(buf, "%d", cals);
    drawItem(pContext, 1, ICON_CALORIES, "Calories", buf);

    uint16_t dist = ped_get_distance() / 100;
    sprintf(buf, "%dm", dist);
    drawItem(pContext, 2, ICON_DISTANCE, "Distance", buf);

    sprintf(buf, "%02d:%02d", ped_get_time() / 60, ped_get_time() % 60);
    drawItem(pContext, 3, ICON_TIME, "Active", buf);
#endif
    // draw progress
#if defined(PRODUCT_W002) || defined(PRODUCT_W004)
#else
    uint16_t goal = window_readconfig()->goal_steps;
    uint32_t steps = ped_get_steps();

    if (steps < goal)
      window_progress(pContext, 5 + 4 * LINEMARGIN, steps * 100 / goal);
    else
      window_progress(pContext, 5 + 4 * LINEMARGIN, 100);
    sprintf(buf, "%d%% of %d", (uint16_t)(steps * 100 / goal), goal);
    GrContextForegroundSet(pContext, ClrWhite);
    GrStringDrawCentered(pContext, buf, -1, LCD_WIDTH/2, 148, 0);
#endif    
  }
}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:59,代码来源:today.c


示例19: UpdateStatus

//*****************************************************************************
//
// This function updates the status area of the screen.  It uses the current
// state of the application to print the status area.
//
//*****************************************************************************
void
UpdateStatus(char *pcString)
{
    //
    // Write the current state to the bottom of screen.
    //
    GrStringDrawCentered(&g_sContext, pcString, -1, 160, 78, true);
}
开发者ID:bli19,项目名称:unesp_mdt,代码行数:14,代码来源:usb_dev_msc.c


示例20: DisplayStatus

//*****************************************************************************
//
// Shows the status string on the display.
//
// \param psContext is a pointer to the graphics context representing the
// display.
// \param pi8Status is a pointer to the string to be shown.
//
//*****************************************************************************
void
DisplayStatus(tContext *psContext, char *pcStatus)
{
    //
    // Clear the line with black.
    //
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrStringDrawCentered(psContext, "                ", -1,
                         GrContextDpyWidthGet(psContext) / 2, 16, true);

    //
    // Draw the new status string
    //
    DEBUG_PRINT("%s\n", pcStatus);
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrStringDrawCentered(psContext, pcStatus, -1,
                         GrContextDpyWidthGet(psContext) / 2, 16, true);
}
开发者ID:PhamVanNhi,项目名称:ECE5770,代码行数:27,代码来源:usb_dev_bulk.c



注:本文中的GrStringDrawCentered函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GrText函数代码示例发布时间:2022-05-30
下一篇:
C++ GrStringDraw函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap