void UI_Out_800_600_Draw_LoginFrom_GUI ( void ) { //重绘区域 Draw_InputDataArea_GUI ( ) ; //绘制登录区域 Draw_Object ( gui_Login_USR_Panel ) ; Draw_Object ( gui_Login_USR ) ; set_Text(gui_Login_USR,""); Draw_Object ( gui_Login_PWD_Panel ) ; Draw_Object ( gui_Login_PWD ) ; set_Text(gui_Login_PWD,""); }
void UI_Out_800_600_Show_BigFont(int nEditAt, short sVal,BOOL Flag) { char cVal [ 200 ] ; memset ( cVal , 0x00 , 200 ) ; switch ( nEditAt ) { case 0 ://车型 sprintf ( cVal , "%d" , sVal ) ; set_Text ( gui_car , cVal ) ; break ; case 1 ://车种 break ; case 2 ://金额 sprintf ( cVal , "%d" , sVal ) ; set_Text ( gui_PassCharge , cVal ) ; break ; } }
//--------------------------------------------------------------------------- int CClock::onTimer() { char c[20]; u64 t; int h,m,s; t = osGetTime() / 1000; s = t % 86400; h = s / 3600; s -= h * 3600; m = s / 60; s -= m * 60; sprintf(c,"%02d:%02d.%02d",h,m,s); set_Text(c); top->Invalidate(); return 0; }
/***************************************** *标题信息 *****************************************/ void UI_Out_800_600_Set_From_Title(char* szTitle) { set_Text ( gui_title , szTitle ) ; } char Now_Car_Type [ 50 ] ; void UI_Out_800_600_ShowOperatorInfo(char *pszInfo) { set_Text ( gui_OperateInfo , pszInfo ) ; } void UI_Out_800_600_Show_Edit(int nEditAt, char *pszInfo) { char temp [ 50 ] ; int i ; switch ( nEditAt ) { case 0 ://车型 set_Text ( gui_car , pszInfo ) ; sprintf(UI_OUT_800_600_gui_car,"%s",pszInfo); break ; case 1 ://车种 set_Text ( gui_carType ,pszInfo) ; sprintf(UI_OUT_800_600_gui_carType,"%s",pszInfo); break ; case 2 ://金额 set_Text ( gui_PassCharge , pszInfo ) ; sprintf(UI_OUT_800_600_gui_PassCharge,"%s",pszInfo); break ; case 3 : set_Text ( gui_Payment , pszInfo ) ; sprintf(UI_OUT_800_600_gui_Payment,"%s",pszInfo); break ; case 9 : set_Text ( gui_Information , pszInfo ) ; break ; case 4 : set_Text ( gui_WorkMode2 , pszInfo ) ; break ; case 50 : set_Text ( gui_Login_USR , pszInfo ) ; break ; case 51 : for ( i = 0 ; i < strlen ( pszInfo ) ; i++ ) { temp [ i ] = '*' ; } temp [ strlen ( GetG_Password ( ) ) ] = '\0' ; set_Text ( gui_Login_PWD , temp ) ; break ; case 60 : set_Text ( gui_QK_QKD , pszInfo ) ; break ; case 61 : set_Text ( gui_QK_QK , pszInfo ) ; break ; case 70 : set_Text ( gui_YH_YHK , pszInfo ) ; break ; } } void UI_Out_800_600_Show_BigFont(int nEditAt, short sVal,BOOL Flag) { char cVal [ 200 ] ; memset ( cVal , 0x00 , 200 ) ; switch ( nEditAt ) { case 0 ://车型 sprintf ( cVal , "%d" , sVal ) ; set_Text ( gui_car , cVal ) ; sprintf ( UI_OUT_800_600_gui_car , "%s" , cVal ) ; break ; case 1 ://车种 break ; case 2 ://金额 sprintf ( cVal , "%d" , sVal ) ; set_Text ( gui_PassCharge , cVal ) ; sprintf ( UI_OUT_800_600_gui_PassCharge , "%s" , cVal ) ; switch(GetWeightCarClass()) { case WeightCarClassTruckISNotUseWeight: set_Text ( gui_carTypeBJ ,"(转换货车)") ; break; case WeightCarClassTruckSpecialVehicles: set_Text ( gui_carTypeBJ ,"(特种车辆)") ; break; case WeightCarClassBIGTruckVehicles: set_Text ( gui_carTypeBJ ,"(大件运输车)") ; break; default: set_Text ( gui_carTypeBJ ,"") ; break; } break ; } } void UI_Out_800_600_SetHistory(void) { char temp[20]; if(strcmp(UI_OUT_800_600_gui_car,"?")==0||UI_OUT_800_600_gui_carType[0]==0||UI_OUT_800_600_gui_PassCharge[0]==0||UI_OUT_800_600_gui_Payment[0]==0) { return; } set_Text(gui_CarNoInfo,UI_OUT_800_600_gui_car); set_Text(gui_RorwardEnterInfo,UI_OUT_800_600_gui_carType); set_Text(gui_ForwardChargeInfo,UI_OUT_800_600_gui_PassCharge); set_Text(gui_ForwardPaymentInfo,UI_OUT_800_600_gui_Payment); sprintf(temp,"%d",Get_Total_Traffic()); set_Text(gui_PassCarNum,temp); sprintf(temp,"%02d-%02.2f",GetHistoryAxlesNum(),(float)GetHistoryWeight()/1000); set_Text(gui_WeightInfo,temp); } void UI_Out_800_600_ClearHistory(void) { char temp[20]; UI_OUT_800_600_gui_car[0]=0; UI_OUT_800_600_gui_carType[0]=0; UI_OUT_800_600_gui_PassCharge[0]=0; UI_OUT_800_600_gui_Payment[0]=0; SetHistoryAxlesNum(0); SetHistoryWeight(0); set_Text(gui_CarNoInfo,UI_OUT_800_600_gui_car); set_Text(gui_RorwardEnterInfo,UI_OUT_800_600_gui_carType); set_Text(gui_ForwardChargeInfo,UI_OUT_800_600_gui_PassCharge); set_Text(gui_ForwardPaymentInfo,UI_OUT_800_600_gui_Payment); sprintf(temp,"%d",Get_Total_Traffic()); set_Text(gui_PassCarNum,temp); sprintf(temp,"%02d-%02.2f",GetHistoryAxlesNum(),(float)GetHistoryWeight()/1000); set_Text(gui_WeightInfo,temp); } void UI_Out_800_600_ShowTime_MMI(char * szInfo ) { set_Text ( gui_NowTime , szInfo ) ; } void UI_Out_800_600_ShowLoginTime_MMI(char * szInfo) { set_Text ( gui_LoginTime , szInfo ) ; } ///***************************************** // *报警信息 // *****************************************/ void AlarmInformationText ( char color , char * information ) { if ( 'G' == color ) { gui_Event->background.color = GLOAB_BACK_COLOR ; } else if ( 'R' == color ) { gui_Event->background.color = REDALARM_COLOR ; } else if ( 'B' == color ) { gui_Event->background.color = KAXIANG_BACK_COLOR ; } gui_Event->text.color = ALARMBOXTEXTCOLOR ; set_Text ( gui_Event , information ) ; }
//--------------------------------------------------------------------------- int CConsoleWindow::printf(char *fmt,...) { va_list argptr; int len; char *s; len = text ? text_len : 0; s = (char *)malloc(len + 1024); if(!s) return -1; memset(s,0,len+1024); if(text) strcpy(s,text); va_start(argptr, fmt); vsprintf(&s[len],fmt, argptr); va_end(argptr); set_Text(s); free(s); return 0; }
void UI_Out_800_600_SetHistory(void) { char temp[20]; if(strcmp(UI_OUT_800_600_gui_car,"?")==0||UI_OUT_800_600_gui_carType[0]==0||UI_OUT_800_600_gui_PassCharge[0]==0||UI_OUT_800_600_gui_Payment[0]==0) { return; } set_Text(gui_CarNoInfo,UI_OUT_800_600_gui_car); set_Text(gui_RorwardEnterInfo,UI_OUT_800_600_gui_carType); set_Text(gui_ForwardChargeInfo,UI_OUT_800_600_gui_PassCharge); set_Text(gui_ForwardPaymentInfo,UI_OUT_800_600_gui_Payment); sprintf(temp,"%d",Get_Total_Traffic()); set_Text(gui_PassCarNum,temp); sprintf(temp,"%02d-%02.2f",GetHistoryAxlesNum(),(float)GetHistoryWeight()/1000); set_Text(gui_WeightInfo,temp); }
void UI_Out_800_600_ClearHistory(void) { char temp[20]; UI_OUT_800_600_gui_car[0]=0; UI_OUT_800_600_gui_carType[0]=0; UI_OUT_800_600_gui_PassCharge[0]=0; UI_OUT_800_600_gui_Payment[0]=0; SetHistoryAxlesNum(0); SetHistoryWeight(0); set_Text(gui_CarNoInfo,UI_OUT_800_600_gui_car); set_Text(gui_RorwardEnterInfo,UI_OUT_800_600_gui_carType); set_Text(gui_ForwardChargeInfo,UI_OUT_800_600_gui_PassCharge); set_Text(gui_ForwardPaymentInfo,UI_OUT_800_600_gui_Payment); sprintf(temp,"%d",Get_Total_Traffic()); set_Text(gui_PassCarNum,temp); sprintf(temp,"%02d-%02.2f",GetHistoryAxlesNum(),(float)GetHistoryWeight()/1000); set_Text(gui_WeightInfo,temp); }
void UI_Out_800_600_Show_BigFont(int nEditAt, short sVal,BOOL Flag) { char cVal [ 200 ] ; memset ( cVal , 0x00 , 200 ) ; switch ( nEditAt ) { case 0 ://车型 sprintf ( cVal , "%d" , sVal ) ; set_Text ( gui_car , cVal ) ; sprintf ( UI_OUT_800_600_gui_car , "%s" , cVal ) ; break ; case 1 ://车种 break ; case 2 ://金额 sprintf ( cVal , "%d" , sVal ) ; set_Text ( gui_PassCharge , cVal ) ; sprintf ( UI_OUT_800_600_gui_PassCharge , "%s" , cVal ) ; switch(GetWeightCarClass()) { case WeightCarClassTruckISNotUseWeight: set_Text ( gui_carTypeBJ ,"(转换货车)") ; break; case WeightCarClassTruckSpecialVehicles: set_Text ( gui_carTypeBJ ,"(特种车辆)") ; break; case WeightCarClassBIGTruckVehicles: set_Text ( gui_carTypeBJ ,"(大件运输车)") ; break; default: set_Text ( gui_carTypeBJ ,"") ; break; } break ; } }
void UI_Out_800_600_Show_Edit(int nEditAt, char *pszInfo) { char temp [ 50 ] ; int i ; switch ( nEditAt ) { case 0 ://车型 set_Text ( gui_car , pszInfo ) ; sprintf(UI_OUT_800_600_gui_car,"%s",pszInfo); break ; case 1 ://车种 set_Text ( gui_carType ,pszInfo) ; sprintf(UI_OUT_800_600_gui_carType,"%s",pszInfo); break ; case 2 ://金额 set_Text ( gui_PassCharge , pszInfo ) ; sprintf(UI_OUT_800_600_gui_PassCharge,"%s",pszInfo); break ; case 3 : set_Text ( gui_Payment , pszInfo ) ; sprintf(UI_OUT_800_600_gui_Payment,"%s",pszInfo); break ; case 9 : set_Text ( gui_Information , pszInfo ) ; break ; case 4 : set_Text ( gui_WorkMode2 , pszInfo ) ; break ; case 50 : set_Text ( gui_Login_USR , pszInfo ) ; break ; case 51 : for ( i = 0 ; i < strlen ( pszInfo ) ; i++ ) { temp [ i ] = '*' ; } temp [ strlen ( GetG_Password ( ) ) ] = '\0' ; set_Text ( gui_Login_PWD , temp ) ; break ; case 60 : set_Text ( gui_QK_QKD , pszInfo ) ; break ; case 61 : set_Text ( gui_QK_QK , pszInfo ) ; break ; case 70 : set_Text ( gui_YH_YHK , pszInfo ) ; break ; } }
void Draw_CarAxle_GUI(void) { LogCDev(LOG_INFOR,"刷新称重界面 开始"); HWND hWnd = UI_Out_800_600_Get_From_Handl ( ) ; int carnum = Car_GetNum(); int i,j,caraxlenum,height; char anstr[20],awstr[20],temp[20]; int count = 19; UI_Object gui_car,gui_axle,gui_w,gui_t; height = 15; init_Object(&gui_car); gui_car.hWnd = hWnd; gui_car.parent = gui_ArrivedCarWeightInfo; gui_car.width = gui_ArrivedCarWeightInfo->width-(gui_ArrivedCarWeightInfo->padding+gui_ArrivedCarWeightInfo->border.width)*2; gui_car.background.color = gui_ArrivedCarWeightInfo->background.color; int g1,g3; g1=25; g3=37; init_Object(&gui_axle); gui_axle.hWnd = hWnd; gui_axle.parent = &gui_car; gui_axle.width = g1; gui_axle.background.color = gui_car.background.color; gui_axle.border.width = 0; gui_axle.height = height; gui_axle.text.size=10; init_Object(&gui_t); gui_t.hWnd = hWnd; gui_t.parent = &gui_car; gui_t.width = gui_car.width - (gui_car.padding+gui_car.border.width)*2-g1-g3; gui_t.x = g1; gui_t.background.color = gui_car.background.color; gui_t.border.width = 0; gui_t.height = height; gui_t.text.size=10; init_Object(&gui_w); gui_w.hWnd = hWnd; gui_w.parent = &gui_car; gui_w.width = g3; gui_w.x = gui_axle.width+gui_t.width; gui_w.background.color = gui_car.background.color; gui_w.border.width = 0; gui_w.height = height; gui_w.text.size=10; int y=0,y1=0;; Draw_Object(gui_ArrivedCarWeightInfo); echo("carnum=%d",carnum); for(i=0;i<carnum+1&&count;i++) { if(i==carnum) { caraxlenum = TempCar_GetCarAxlesNum(); gui_axle.background.color = GLOAB_BACK_COLOR; gui_t.background.color = GLOAB_BACK_COLOR; gui_w.background.color = GLOAB_BACK_COLOR; } else { caraxlenum = Car_GetCarAxlesNum(i); } echo("caraxlenum=%d",caraxlenum); if(caraxlenum>0) { gui_car.height = (caraxlenum<=count?caraxlenum:count)*height+gui_car.padding*2; gui_car.y = y; y += gui_car.height; Draw_Object(&gui_car); echo("Draw_Car"); y1=0; for(j=0;j<caraxlenum&&count;j++) { gui_axle.y = y1; gui_t.y = y1; gui_w.y = y1; y1 += height; if(j==0) { sprintf(anstr,"%02d",i==carnum?TempCar_GetCarAxlesNum():Car_GetCarAxlesNum(i)); gui_axle.text.info = anstr; } else { gui_axle.text.info = ""; } switch(i==carnum?TempCar_GetCarAxlesType(j):Car_GetCarAxlesType(i, j)) { case 1: gui_t.background.image = &axlet1; break; case 2: gui_t.background.image = &axlet2; break; case 3: gui_t.background.image = &axlet3; break; default: gui_t.background.image = &axlet1; break; } sprintf(awstr,"%0.2f",((float)(i==carnum?TempCar_GetCarAxlesWeight(j):Car_GetCarAxlesWeight(i, j)))/1000); gui_w.text.info = awstr; Draw_Object(&gui_axle); Draw_Object(&gui_t); Draw_Object(&gui_w); count --; echo("CarAxlesNum:%d;CarAxlesType:%d;CarAxlesWeight:%d;CarAxlesSpace:%d;" ,i==carnum?TempCar_GetCarAxlesNum():Car_GetCarAxlesNum(i) ,i==carnum?TempCar_GetCarAxlesType(j):Car_GetCarAxlesType(i, j) ,i==carnum?TempCar_GetCarAxlesWeight(j):Car_GetCarAxlesWeight(i, j) ,i==carnum?TempCar_GetCarAxlesWeight(j):Car_GetCarAxlesSpace(i,j)); LogCDev(LOG_INFOR,"刷新称重界面 %s %d N:%d;T:%d;W:%d;S:%d;" ,i==carnum?"零时车":"正式车" ,i==carnum?99:i ,i==carnum?TempCar_GetCarAxlesNum():Car_GetCarAxlesNum(i) ,i==carnum?TempCar_GetCarAxlesType(j):Car_GetCarAxlesType(i, j) ,i==carnum?TempCar_GetCarAxlesWeight(j):Car_GetCarAxlesWeight(i, j) ,i==carnum?TempCar_GetCarAxlesWeight(j):Car_GetCarAxlesSpace(i,j)); } } } sprintf(temp,"%02d-%02.2f",Car_GetCarAxlesNum(0),(float)Car_GetCarWeight(0)/1000); set_Text(gui_CurrentWeightInfo,temp); LogCDev(LOG_INFOR,"刷新称重界面 结束"); }
/***************************************** *标题信息 *****************************************/ void UI_Out_800_600_Set_From_Title(char* szTitle) { set_Text ( gui_title , szTitle ) ; }
void UI_Out_800_600_ShowOperatorInfo(char *pszInfo) { set_Text ( gui_OperateInfo , pszInfo ) ; }
void UI_Out_800_600_Set_ZaoLing(char *temp) { set_Text(gui_ZhaoLing,temp); }
void UI_Out_800_600_Show_Input_Text(char * Text) { set_Text(gui_YH_YHK,Text); }
void UI_Out_800_600_Set_Pwd(char *UserNumber) { set_Text(gui_Login_PWD,UserNumber); }
void UI_Out_800_600_Set_ShiShou(char *temp) { set_Text(gui_ShiShou,temp); }
void UI_Out_800_600_Set_UserNumber(char *UserNumber) { set_Text(gui_Login_USR,UserNumber); }
void UI_Out_800_600_ShowLoginTime_MMI(char * szInfo) { set_Text ( gui_LoginTime , szInfo ) ; }
void UI_Out_800_600_ShowTime_MMI(char * szInfo ) { set_Text ( gui_CurrentTime , szInfo ) ; }
void UI_Out_800_600_Show_Info_ByColor(char *pszInfo, unsigned int bc,unsigned int tc) { gui_Event->background.color = bc ; gui_Event->text.color = tc ; set_Text ( gui_Information , pszInfo ) ; }
void UI_Out_800_600_ClearAbateChargeEditC(void) { set_Text ( gui_PassCharge , "" ) ; }