void ShowUPStatusbar() { printf("[%s,%d] trace...\n",__FUNCTION__,__LINE__); if(ecrObj.ecrOn) return; Setcolor(Color_white,Color_ezblue); CTOS_LCDGSetBox(0,0,320,18,d_LCD_FILL_0); ShowNetWorkTypeStatus(); // ShowECRStatus(); // ShowInternetStatus(); ShowDataTime(); ShowBatteryStatus(); ShowUnUploadCount(); ShowAPVersion(); Setcolor(Color_ezblue,Color_black); printf("[%s,%d] trace...\n",__FUNCTION__,__LINE__); }
void ShowAPVersion() { BYTE VerStr[8+1]; Setcolor(Color_ezblue,Color_yellow); sprintf(VerStr,"V%s",gAPVER); CTOS_LCDGTextOut(320-(9*7),240-18-18,VerStr,d_FONT_9x18,FALSE); Setcolor(Color_ezblue,Color_black); }
void ShowUnUploadCount() { Setcolor(Color_ezblue,Color_yellow); BYTE VerStr[8+1]; int iUNUPLOADCOUNT= CheckUnuploadTxCount(); sprintf(VerStr,"%d",iUNUPLOADCOUNT); CTOS_LCDGTextOut(0,240-18-18,VerStr,d_FONT_9x18,FALSE); Setcolor(Color_ezblue,Color_black); }
void Print::PrintColor() { if (!m_HeroColor.empty()) { Setcolor(Color(HERO)); while (!m_HeroColor.empty()) { Gotoxy(m_HeroColor.back().x, m_HeroColor.back().y + 1); _putch(m_ScreenBuffer[m_HeroColor.back().y][m_HeroColor.back().x]); _putch(m_ScreenBuffer[m_HeroColor.back().y][m_HeroColor.back().x + 1]); m_HeroColor.pop_back(); } } if (!m_SopeColor.empty()) { Setcolor(Color(SCORP)); while (!m_SopeColor.empty()) { Gotoxy(m_SopeColor.back().x, m_SopeColor.back().y + 1); _putch(m_ScreenBuffer[m_SopeColor.back().y][m_SopeColor.back().x]); m_SopeColor.pop_back(); } } if (!m_HitColor.empty()) { Setcolor(Color(HIT)); while (!m_HitColor.empty()) { Gotoxy(m_HitColor.back().x, m_HitColor.back().y + 1); _putch(m_ScreenBuffer[m_HitColor.back().y][m_HitColor.back().x]); _putch(m_ScreenBuffer[m_HitColor.back().y][m_HitColor.back().x + 1]); m_HitColor.pop_back(); } } if (!m_DeathColor.empty()) { Setcolor(Color(DEATH)); while (!m_DeathColor.empty()) { Gotoxy(m_DeathColor.back().x, m_DeathColor.back().y + 1); _putch(m_ScreenBuffer[m_DeathColor.back().y][m_DeathColor.back().x]); _putch(m_ScreenBuffer[m_DeathColor.back().y][m_DeathColor.back().x + 1]); m_DeathColor.pop_back(); } } Sleep(20 / (1 + lowSpecMode)); }
void Display_Title(void) //プログラムタイトル表示を関数化 040928 { Cls(); Setcolor(CYAN,BLACK); printf(" Weight Bearing Control Program\n"); printf(" Copyright All Reserved by Fujie Lab. 2005\n\n"); Restore(); }
void Getpalette(short *palette) { short loop; for(loop=0;loop<15;loop++) { palette[loop]=Setcolor(loop,-1); } }
void Print::Init() { int x, y; for (y = 0; y <= PLAY_LINES; y++) { for (x = 0; x < CONSOLE_COLS; x++) m_ScreenBuffer[y][x] = ' '; m_ScreenBuffer[y][x] = '\0'; } Setcolor(Color(SCREEN)); }
void WaitRemoveCard(STR *Line1,STR *Line2) { int iret; ShowLine(0,32,Med_Font_Size,Line1,TRUE); ShowLine(0,40+32,Med_Font_Size,Line2,TRUE); Setcolor(Color_black,Color_red); do { iret=inPPR_ReadCardNumber(); if(iret!=0x9000) return ; CTOS_Beep(); } while(1); }
void ShowDataTime() { BYTE Date[64+1]; BYTE time[64+1]; BYTE VerStr[7+1]; CTOS_RTC SetRTC; USHORT ret = CTOS_RTCGet(&SetRTC); if(ret==0) { // CTOS_LCDForeGndColor(d_LCD_BLACK); Setcolor(Color_ezblue,Color_yellow); // CTOS_LCDGSetBox(0,0,320,18,d_LCD_FILL_0); // sprintf(Date,"%04d/%02d/%02d %02d:%02d V%s",SetRTC.bYear + 2000,SetRTC.bMonth,SetRTC.bDay,SetRTC.bHour,SetRTC.bMinute,gAPVER); sprintf(Date,"%04d/%02d/%02d",SetRTC.bYear+2000,SetRTC.bMonth,SetRTC.bDay); sprintf(time,"%02d:%02d",SetRTC.bHour,SetRTC.bMinute); if(gConfig.DEVICE.READER.bREADERSTATUS==READERSTATUS_LOCK) { Setcolor(Color_ezblue,Color_red); CTOS_LCDGTextOut(0,18+7,"讀卡機故障!!",0x2424,FALSE); } else if(MechineStatus & Status_SignOnFail) { Setcolor(Color_ezblue,Color_red); CTOS_LCDGTextOut(0,18+7,"請先執行登入",0x2424,FALSE); } else if(MechineStatus & Status_FLASH_ERROR) { Setcolor(Color_ezblue,Color_red); CTOS_LCDGTextOut(0,18+7,"記憶體故障請報修",0x1e1e,FALSE); } else { Setcolor(Color_ezblue,Color_yellow); CTOS_LCDGTextOut(180-90,18+7,time,0x2424,FALSE); } Setcolor(Color_white,Color_black); CTOS_LCDGTextOut(135,0,Date,d_FONT_9x18,FALSE); } }
void Print::PrintBottom() { Gotoxy(0, PLAY_LINES + 2); Setcolor(Color(BOTTOM)); printf("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); if (hero.empty()) { Setcolor(Color(STATUS_BAR)); printf("\t\t\t\t 확인: Enter Key or Z key \t\t 취소: ESC key or X key \t\t\t\t\t"); printf("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); } else { Setcolor(Color(HP_BAR)); hero[PLAYER_1]->HpStatus(); printf(" "); if (playerNum > 1) hero[PLAYER_2]->HpStatus(); else printf(" \t\t 공격 : Z key 조준 : X key \t\t\t"); Setcolor(Color(MP_BAR)); hero[PLAYER_1]->MpStatus(); printf(" "); if (playerNum > 1) hero[PLAYER_2]->MpStatus(); else printf(" \t\t 스킬1: X -> Z 스킬2: X -> C \t\t\t"); } Setcolor(Color(BOTTOM)); printf("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); Setcolor(Color(SCREEN)); }
int InitTank() { int ii; /* initialiser cookie */ InitCookie(); /* sauvegarder palette des couleurs */ for ( ii = 0; ii < 16; ii++ ) SavPalette[ii] = Setcolor(ii,-1); /* aller en basse resolution */ SavRez = Getrez(); if ( SavRez > 1 ) return (1); /* mise en place des ecrans de travail */ _SavLogScreen = (char *)Logbase(); _SavPhyScreen = (char *)Physbase(); _Screens[0] = (char *)malloc(32256L); _Screens[1] = (char *)malloc(32256L); if ( _Screens[0] == 0 || _Screens[1] == 0L ) return (2); _Screens[0] = _ShowScreen = (char *)((long)(_Screens[0] + 255) & 0xFFFFFF00L); _Screens[1] = _HideScreen = (char *)((long)(_Screens[1] + 255) & 0xFFFFFF00L); MemClear(_Screens[0],32000L); MemClear(_Screens[1],32000L); Setpalette(BlackPalette); if ( ShipSetUp(0) == 0 ) return (2); if ( MiscSetUp() == 0 ) return (2); if ( StarSetUp() == 0 ) return (2); if ( AstSetUp() == 0 ) return (2); if ( ExplSetUp() == 0 ) return (2); Setscreen(_Screens[0],_Screens[0],0); TTSpl = ((Cookies.snd & 2) != 0); SplOn._proc = _SplOnProc[ TTSpl ]; SplOff._proc = _SplOffProc[ TTSpl ]; NStars = (Cookies.cpu > 10) ? 32 : 16; return (0); }
void Velocity_Display(int ch) //周波数応答(モータ) { double RPS; M[ch].Counter = Count_Read(ch); RPS = (M[ch].Counter-M[ch].Counter_Past)/(2000.0*Reduction_Ratio)/(Samp_Cycle/1000.0); M[ch].Velocity = RPS*5.0; M[ch].RPM = RPS*60.0; Gotoxy(0,20); Setcolor(GREEN,BLACK); printf(" ch%d Velocity :%8.3f[mm/sec] %8.3f[rpm]\n",ch, M[ch].Velocity,M[ch].RPM); Restore(); M[ch].Counter_Past = M[ch].Counter; }
void Bmscr::Cls( int mode ) { // screen setting reset // int i; // Font initalize // SetFont( "", 18, 0 ); //Sysfont(0); // object initalize // ResetHSPObject(); tapstat = 0; tapinvalid = 0; cur_obj = NULL; // text setting initalize // cx=0;cy=0; Setcolor(0,0,0); // vals initalize // textspeed=0; ox=64;oy=32;py=0; gx=32;gy=32;gmode=0; objstyle = 00; for(i=0;i<BMSCR_SAVEPOS_MAX;i++) { savepos[i] = 0; } // CEL initalize // SetCelDivideSize( 0, 0, 0, 0 ); // all update // fl_udraw = fl_dispw; // Update HGI/O // if ( wid == 0 ) { hgio_screen( (BMSCR *)this ); } // Multi-Touch Reset resetMTouch(); }
void Print::PrintTop() { Gotoxy(0, 0); Setcolor(Color(TOP_BAR)); if (hero.empty()) printf("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); else { if (playerNum == 1) printf(" \t Stage%4d \t\t\t ENTER: 다음 라운드 ESC: 처음으로 \t\t\t\t 남은 생명: %d \t ", gameStage, hero[PLAYER_1]->HavingHeart()); else printf(" \t Stage%4d \t\t\t ENTER: 다음 라운드 ESC: 처음으로 \t\t\t 1P 생명: %d 2P 생명: %d ", gameStage, hero[PLAYER_1]->HavingHeart(), hero[PLAYER_2]->HavingHeart()); } }
//*** センサ総合 ********************************************************* void Sensors_Display(void) { int ch; Gotoxy(0,6); Setcolor(GREEN,BLACK); Counters_Read(); for(ch=1; ch<=Channel; ch++){ printf(" ch%d Counter :%8.3f[mm] (%6d[pulse])\n",ch ,M[ch].Counter/2000.0*5.0/Reduction_Ratio ,M[ch].Counter); } //カウンタ×4逓倍 for(ch=1; ch<=Channel; ch++){ M[ch].Force = AD_Read(ch)/2047.0*1000.0; printf(" ch%d Load : %6d (%6.3f[N])\n", ch, AD_Read(ch), M[ch].Force); } printf("\n"); Restore(); }
///// メニュー関連関数 ///////////////////////////////////////////////////////// void Main_Menu(void) { int Flag=1; int KeyInput; while(Flag){ Cls(); Display_Title(); Setcolor(CYAN,BLACK); printf(" <Select Menu>\n\n"); Restore(); Sensors_Display(); printf(" 1) Sensors Check \n"); printf(" 2) DA Value Check \n"); printf(" 3) Velocity Check \n"); printf(" 4) Velocity Step Response \n"); printf(" 5) Constant Force Control\n"); printf(" 6) Constant Force Control(default)\n"); // printf(" 7) Constant Force Control(range)\n"); printf("\n"); printf(" i) Initialize AD Value\n"); printf("\n"); printf(" s> Back to QNX\n\n"); printf(" >>"); KeyInput = Char_Stdin(); switch(KeyInput){ case '1': Sensors_Check(); break; case '2': DA_Value_Check(); break; case '3': Velocity_Check(); break; case '4': Velocity_Step(); break; case '5': Force_Const(); break; case '6': Force_Const_2(); break; case '7': BWS_and_Compliance(); break; case 'i': AD_Initialize(); break; case 's': printf("\nBack to Qnx\n"); Flag=0; break; default:printf("You Typed Invalid Command!!\n"); break; } } }
void Bmscr::SetHSVColor( int hval, int sval, int vval ) { // hsvによる色指定 // h(0-191)/s(0-255)/v(0-255) // int h,s,v; int save_r, save_g, save_b; int t,i,v1,v2,v3; int mv=8160; // 255*32 int mp=4080; // 255*16 // overflow check // v = vval & 255; s = sval & 255; // /8 // hsv -> rgb 変換 // h = hval % 192; i = h/32; t = h % 32; v1 = (v*(mv-s*32) +mp)/mv; v2 = (v*(mv-s*t) +mp)/mv; v3 = (v*(mv-s*(32-t))+mp)/mv; switch(i){ case 0: case 6: save_r=v; save_g=v3; save_b=v1; break; case 1: save_r=v2; save_g=v; save_b=v1; break; case 2: save_r=v1; save_g=v; save_b=v3; break; case 3: save_r=v1; save_g=v2; save_b=v; break; case 4: save_r=v3; save_g=v1; save_b=v; break; case 5: save_r=v; save_g=v1; save_b=v2; break; } Setcolor( save_r, save_g, save_b ); }
/* * Set up screen for VT52. * This is called by os_askfile to restore the screen to the normal * state, so it shouldn't allocate data structures. */ vt_setup() { int i; /* * Get rid of the mouse */ graf_mouse(M_OFF, NULL); /* * Get desktop resolution. If monochrome, note the fact so that * we can make sure our color choices get set correctly later on. * If low resolution, change to medium resolution automagically. * * If any other resolution, don't do anything different, and hope * things work out OK. */ drez = Getrez(); if (drez == 0) Setscreen(-1L, -1L, 1); if (drez != 2) { /* * Get desktop palette. */ for (i = 0; i < 16; i++) dpalette[i] = Setcolor(i, -1); /* * Set our palette. */ Setpalette(palette); /* * Tell the rest of the system what good colors * are for various things. */ sdesc_color = colbyte(osWHITE, osBLUE); ldesc_color = colbyte(osBLACK, osWHITE); debug_color = colbyte(osBRIGHTWHITE, osBLACK); text_color = colbyte(osWHITE, osBLACK); text_bold_color = colbyte(osBRIGHTWHITE, osBLACK); text_normal_color = text_color; } else { /* * Monochrome -- note different color name constants */ sdesc_color = colbyte(osmREVERSE, osmREVERSE); ldesc_color = colbyte(osmREVERSE, osmREVERSE); debug_color = colbyte(osmNORMAL, osmNORMAL); text_color = colbyte(osmNORMAL, osmNORMAL); text_bold_color = colbyte(osmREVERSE, osmREVERSE); text_normal_color = text_color; } /* * Set default text color */ vt_color(text_color); /* * Clear the screen, set to no-wrap mode, and enable cursor. * Also, set drawing colors to normal. */ Cconws("\033E\033w\033e"); X = 0; Y = 0; /* * Make the cursor not blink. */ Cursconf(2, 0); }