void Form_ADChannel_Draw(LPWindow pWindow) { uint16 i; LPControl lpControl; //清除显存 EraseBuffer(); //禁止绘图 SetRedraw(FALSE); //禁止刷屏 EnableScreenFlush(FALSE); //设置视图 SetGdiView(pWindow->nViewPosX, pWindow->nViewPosY, pWindow->nViewSizeX, pWindow->nViewSizeY); EnableGdiView(TRUE); // sprintf(sZero_Value,"%d",fZero_Value); // // sprintf(sCali_Title,"%s",sScale_Title); // DrawGbText("重量标定", 112, 88); // DrawGbText("按确定键开始标定,否则请返回", 42, 110); DrawGbText("AD通道1",5,44); DrawGbText("AD通道2",5,66); DrawGbText("AD通道3",5,88); DrawGbText("AD通道4",5,110); snprintf(sADChannel_Title, 23, "通道的AD值 SCS-ZC-%d", (Get_System_Mode() + 1)); DrawGbText(sADChannel_Title, 5, 21); DrawHoriLine(0, 40, 240); DrawHoriLine(0, 62, 240); DrawHoriLine(0, 84, 240); DrawHoriLine(0, 106, 240); DrawHoriLine(0, 127, 240); DrawVertLine(60, 40, 88); // DrawVertLine(140, 40, 44); //绘制控件 for(i = 0; i < pWindow->nNbControls; i++) { lpControl = *(pWindow->pLPControls + i); if(lpControl->state & CTRL_VISABLE) { lpControl->DrawFunc(lpControl); } } //使能刷屏 EnableScreenFlush(TRUE); //刷屏 FlushScreen(); //使能绘图 SetRedraw(TRUE); }
void Form_DateSet_Draw(LPWindow pWindow) { uint16 i; LPControl lpControl; //Çå³ýÏÔ´æ EraseBuffer(); //½ûÖ¹»æͼ SetRedraw(FALSE); //½ûֹˢÆÁ EnableScreenFlush(FALSE); //ÉèÖÃÊÓͼ SetGdiView(pWindow->nViewPosX, pWindow->nViewPosY, pWindow->nViewSizeX, pWindow->nViewSizeY); EnableGdiView(TRUE); DrawGbText("ÈÕÆÚ", 0, 25); DrawHoriLine(0, 25+16, 240); DrawHoriLine(0, 25+18, 240); //»æÖƿؼþ for(i = 0; i < pWindow->nNbControls; i++) { lpControl = *(pWindow->pLPControls + i); if(lpControl->state & CTRL_VISABLE) { if(lpControl->state & CTRL_FOCUS) { DrawImage(Img_Up, lpControl->x, lpControl->y-13, 12, 12); DrawImage(Img_Down, lpControl->x, lpControl->y+15, 12, 12); //DrawGbText("¡ø", lpControl->x, lpControl->y-14); //DrawGbText("¡ø", lpControl->x, lpControl->y+15); InvertColor(); } lpControl->DrawFunc(lpControl); if(lpControl->state & CTRL_FOCUS) { InvertColor(); } } } DrawGbText("-", 52, 60); DrawGbText("-", 74, 60); //ʹÄÜË¢ÆÁ EnableScreenFlush(TRUE); //Ë¢ÆÁ FlushScreen(); //ʹÄÜ»æͼ SetRedraw(TRUE); }
void Finish() { if (markers.empty()) return; FlushScreen(); markers.append().Set(NULL); for (unsigned i = 0; markers[i + 1].text != NULL; ++i) { const Marker &start = markers[i]; const Marker &end = markers[i + 1]; LogFormat("StopWatch '%s': clock=%lu cpu=%lu", start.text, (unsigned long)(end.clock - start.clock), (unsigned long)(end.cpu - start.cpu)); } const Marker &start = markers.front(); const Marker &end = markers.back(); LogFormat("StopWatch total: clock=%lu cpu=%lu", (unsigned long)(end.clock - start.clock), (unsigned long)(end.cpu - start.cpu)); markers.clear(); }
void Form_NetSet_Draw(LPWindow pWindow) { uint16 i; LPControl lpControl; //清除显存 EraseBuffer(); //禁止绘图 SetRedraw(FALSE); //禁止刷屏 EnableScreenFlush(FALSE); //设置视图 SetGdiView(pWindow->nViewPosX, pWindow->nViewPosY, pWindow->nViewSizeX, pWindow->nViewSizeY); EnableGdiView(TRUE); //绘制控件 for(i = 0; i < pWindow->nNbControls; i++) { lpControl = *(pWindow->pLPControls + i); if(lpControl->state & CTRL_VISABLE) { lpControl->DrawFunc(lpControl); } } //使能刷屏 EnableScreenFlush(TRUE); //刷屏 FlushScreen(); //使能绘图 SetRedraw(TRUE); }
void Form_Warning_Draw(LPWindow pWindow) { uint16 i; LPControl lpControl; //Çå³ýÏÔ´æ EraseBuffer(); //½ûÖ¹»æͼ SetRedraw(FALSE); //½ûֹˢÆÁ EnableScreenFlush(FALSE); //ÉèÖÃÊÓͼ SetGdiView(pWindow->nViewPosX, pWindow->nViewPosY, pWindow->nViewSizeX, pWindow->nViewSizeY); EnableGdiView(TRUE); //»æÖƿؼþ for(i = 0; i < pWindow->nNbControls; i++) { lpControl = *(pWindow->pLPControls + i); if(lpControl->state & CTRL_VISABLE) { lpControl->DrawFunc(lpControl); } } //ʹÄÜË¢ÆÁ EnableScreenFlush(TRUE); //Ë¢ÆÁ FlushScreen(); //ʹÄÜ»æͼ SetRedraw(TRUE); }
void Mark(const char *text) { FlushScreen(); markers.append().Set(text); }
void MsgBoxDlgDraw(LPWindow pWindow) { uint16 i; int16 nStrSize; LPControl lpControl; //½ûÖ¹»æͼ SetRedraw(FALSE); //½ûֹˢÆÁ EnableScreenFlush(FALSE); //ÉèÖÃÊÓͼ SetGdiView(pWindow->nViewPosX, pWindow->nViewPosY, pWindow->nViewSizeX, pWindow->nViewSizeY); EnableGdiView(TRUE); //Çå³ýÏÔ´æ EraseRect(0, 0, pWindow->nViewSizeX, pWindow->nViewSizeY); //»æÖÆ´°¿ÚÃû³Æ if(m_pTitle != NULL) { nStrSize = strlen((char*)m_pTitle); if(nStrSize > 0) { DrawGbText((char*)m_pTitle, 2, 2); } } //½ûÖ¹»æͼ //SetRedraw(FALSE); //½ûֹˢÆÁ //EnableScreenFlush(FALSE); //»æÖƿؼþ for(i = 0; i < pWindow->nNbControls; i++) { lpControl = *(pWindow->pLPControls + i); if((lpControl->state & CTRL_VISABLE) != 0) { lpControl->DrawFunc(lpControl); } } //»´°Ìå±ß¿ò DrawRect(0, 0, pWindow->nViewSizeX - 1, pWindow->nViewSizeY - 1); DrawHoriLine(1, pWindow->nViewSizeY - 1, pWindow->nViewSizeX); DrawVertLine(pWindow->nViewSizeX - 1, 1, pWindow->nViewSizeY); //»·Ö¸ôÏß DrawHoriLine(1, 18, pWindow->nViewSizeX); //ʹÄÜË¢ÆÁ EnableScreenFlush(TRUE); //Ë¢ÆÁ FlushScreen(); //ʹÄÜ»æͼ SetRedraw(TRUE); }