⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmiaoc.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:

        /* nm test only  set the default  */
        //		    data->aocInfo.acm=125;
        //		    strcpy ((char *)data->aocInfo.cur, "DM");
        //		    strcpy ((char *)data->aocInfo.ppu, "1.5");
        /* nm test only  set the default  */

        sprintf(buf, "ACM: %ld", data->aocInfo.acm); 
        TRACE_EVENT(buf);
        sprintf(buf, "PPU:%s", data->aocInfo.ppu); 
        TRACE_EVENT(buf);
        sprintf(buf, "CUR:%s", data->aocInfo.cur); 
        TRACE_EVENT(buf);


        if( (strlen((char*)data->aocInfo.ppu) EQ 0) && data->aocInfo.acm NEQ '\0' )
        {
            //show only the units ACM
            sprintf(line3, "%ld", data->aocInfo.acm);    
            TRACE_EVENT ("get only :ACM ; PPU ==0 and ACM!=0");

        }
        if( (strlen((char*)data->aocInfo.ppu) NEQ 0) && data->aocInfo.acm NEQ '\0' )
        {

            service_calculate (win, (char*)line3, data->aocInfo.acm);

            TRACE_EVENT ("calculate ACM * PPU; PPU !=0 and ACM!=0");
        }

        if( data->aocInfo.acm EQ '\0' )
            strcpy ((char *)line3, "0");
        display_info.TextId3=TxtTotalCharge;

        if( strlen(line3)<3 )  //for gudy dialog hu binhao 2002-2-27
        {
            strcat(line3,"  ");
        }
        display_info.TextString3        = line3;

        display_info.KeyEvents          = KEY_CLEAR | KEY_RIGHT| KEY_HUP;
        display_info.LeftSoftKey        = '\0';
        display_info.RightSoftKey       = TxtSoftBack;
        display_info.Time               = FOREVER;
        display_info.Identifier         = SERVICES_AOC_STATISTICS;

        display_info.Callback           = (T_VOID_FUNC)service_dialog_cb;
        /*
         * Call Info Screen
         */
        info_dialog (win, &display_info);

        break;

    case PIN_REQUEST_FOR_RATE:
        //save the status
        data->Identifier = SERVICES_ENTER_CURRENCY;

        //PIN2 is requested to change the Rate
        pin2_check (data->service_win);
        //service_destroy(data->service_win); //xsf remarked it 2003.04.09

        break;

    case PIN_REQUEST_FOR_LIMIT_CHANGE:

        //PIN2 is requested to change the Rate
        pin2_check (data->service_win);

        //save the status
        data->Identifier = SERVICES_LIMIT_CHANGE;
        //service_destroy(data->service_win); //xsf remarked it 2003.04.09
        break;

    case PIN_REQUEST_FOR_LIMIT_CANCEL:

        //PIN2 is requested to change the Rate
        pin2_check (data->service_win);

        //save the status
        data->Identifier = SERVICES_LIMIT_CANCEL;
        //service_destroy(data->service_win); //xsf remarked it 2003.04.09
        break;
    case PIN_REQUEST_FOR_RATE_CANCEL: //WUFIE ADD
        pin2_check(data->service_win);
        data->Identifier=SERVICES_RATE_CANCEL;
        //service_destroy(data->service_win); //xsf remarked it 2003.04.09
        break;
    case PIN_REQUEST_FOR_RESET_CHARGE:
        //save the status
        data->Identifier = SERVICES_RESET_CHARGE;

        //PIN2 is requested to change the Rate
        pin2_check (data->service_win);
        //service_destroy(data->service_win); //xsf remarked it 2003.04.09

        break;


        //it calls from MMI PINS
    case PIN2_OK:
        TRACE_EVENT("PIN2_OK");

        switch( data->Identifier )
        {
        case SERVICES_ENTER_CURRENCY:

            //pin was ok, open now the editor for entering the currency
            SEND_EVENT (win, data->Identifier, 0, 0);
            break;
        case SERVICES_LIMIT_CHANGE:

            //pin was ok, open now the editor for entering the currency
            SEND_EVENT (win, data->Identifier, 0, 0);
            break;
        case SERVICES_LIMIT_CANCEL:

            //pin was ok, open now the editor for entering the currency
            SEND_EVENT (win, data->Identifier, 0, 0);
            break;
        case SERVICES_RESET_CHARGE:

            //pin was ok, open now the editor for entering the currency
            SEND_EVENT (win, data->Identifier, 0, 0);
            break;
        case SERVICES_RATE_CANCEL: //WUFEI ADD
            SEND_EVENT(win,data->Identifier,0,0);
            break;


        }
        break;

    case  PIN2_ABORT:
        dialog_info_init(&display_info);//gdy add
        display_info.TextId       = TxtFailed;
        display_info.KeyEvents      = KEY_CLEAR | KEY_RIGHT | KEY_LEFT | KEY_HUP;
        display_info.LeftSoftKey    = '\0';
        display_info.RightSoftKey   = '\0';
        display_info.TextString     = '\0';
        display_info.TextString2    = line;
        display_info.TextId2      = '\0';
        display_info.Time       = TWO_SECS;
        display_info.Identifier     = event;

        display_info.Callback     = (T_VOID_FUNC)service_dialog_cb;
        /*
         * Call Info Screen
         */
        info_dialog (win, &display_info);

        break;
        //begin xsf add for pin2 check of 费用上限 2003.04.09
    case PIN2_CHECK_ABORT:
        service_destroy(data->service_win); //xsf remarked it 2003.04.09
        break;
        //end xsf add for pin2 check of 费用上限 2003.04.09
    case SERVICES_ENTER_CURRENCY:


        //save the status
        data->Identifier = SERVICES_ENTER_CURRENCY;


        //PUCT (currency and price per unit) is requested 
        result = cm_get_aoc_value(CM_AOC_PUCT, &data->aocInfo);    

        sprintf(buf, "result %d", result); 
        TRACE_EVENT(buf);


        //fill up editor-sttribut with default
        service_loadEditDefault (&editor_data);


        //clear the editor-buffer
        memset(data->edt_Buf,'\0',sizeof(data->edt_Buf));

        // let to show the current currency, before the user change it */
        memcpy(data->edt_Buf, data->aocInfo.cur, MAX_ENTER_CURRENCY);

        for( i=0; i< MAX_ENTER_CURRENCY-1; i++ )
        {
            if( data->edt_Buf[i] EQ 0x80 OR data->edt_Buf[i] EQ 0xFF )
                data->edt_Buf[i] = '\0';
        }


        editor_attr_init_fullscr(&editor_data.editor_attr,1,TxtEnterCurrency,
                                 (char *)data->edt_Buf,9,edtCurBar1);  //hbh 200304-10



        //editor_data.editor_attr.text	= data->edt_Buf;  /* buffer to be edited */
        //editor_data.editor_attr.size	= MAX_ENTER_CURRENCY;/* limit to 3 letters */
        editor_data.LeftSoftKey         = TxtSoftOK;        
        editor_data.RightSoftKey        = TxtDelete;
        //editor_data.TextId				= TxtEnterCurrency;
        editor_data.Identifier          = data->Identifier;  
        //editor_data.mode				= ALPHA_MODE;
        editor_data.mode                = TEXTINPUT_MODE;  /* 2003/12/04 sunsj modify */
        editor_data.InputMode           = PINYIN_INPUT_MODE;   /* 2003/12/04 sunsj set default input mode */
        editor_data.AlternateLeftSoftKey = TxtNull;
        editor_data.min_enter           = 1;
        editor_data.destroyEditor       = 0;


		/* 2003/12/15 sunsj initialize editor */
        /* create the dialog handler */
        //data->edt_win=editor_start(data->service_win, &editor_data);  /* start the editor */ 
		data->edt_win = text_input(data->service_win, &editor_data);        break;



    case SERVICES_ONE_UNIT:
        if( data->edt_win )
        {
            editor_destroy(data->edt_win);
            data->edt_win=NULL;
        }
        //save the status
        data->Identifier = SERVICES_ONE_UNIT;
        memset(&editor_data,'\0',sizeof(editor_data));  //hbh 2003-4-10
        //fill up editor-sttribut with default
        service_loadEditDefault (&editor_data);

        //clear the editor-buffer
        memset(data->edt_Buf,'\0',sizeof(data->edt_Buf));

        /* let to show the current price per unit, before the user change it */
        memcpy(data->edt_Buf, data->aocInfo.ppu, sizeof(data->aocInfo.ppu));



        for( i=0; i< MAX_ENTER_UNIT-1; i++ )
        {
            if( data->edt_Buf[i] EQ 0x80 OR data->edt_Buf[i] EQ 0xFF )
                data->edt_Buf[i] = '\0';
        }

        editor_attr_init_fullscr(&editor_data.editor_attr,1,Txt1Unit,
                                 (char *)data->edt_Buf,9,edtCurBar1);  //hbh 200304-10

        //editor_data.editor_attr.text	= data->edt_Buf;  /* buffer to be edited */
        //editor_data.editor_attr.size	= MAX_ENTER_UNIT;/* limit to 5 numerics */
        editor_data.LeftSoftKey         = TxtSoftOK;        
        editor_data.RightSoftKey        = TxtDelete;
        //editor_data.TextId				= Txt1Unit;
        editor_data.Identifier          = data->Identifier;  
        editor_data.mode                = SHUZI_MODE;  //hbh 2003-4-9
        editor_data.AlternateLeftSoftKey     = TxtNull;
        editor_data.min_enter           = 1;
        editor_data.destroyEditor           =0;         

        /* create the dialog handler */
        data->edt_win=editor_start(data->service_win, &editor_data);  /* start the editor */ 
        break;


    case SERVICES_RATE_CHANGED:
        dialog_info_init(&display_info);//gdy add

        display_info.KeyEvents          = KEY_CLEAR | KEY_RIGHT | KEY_LEFT | KEY_HUP;
        display_info.LeftSoftKey        = '\0';
        display_info.RightSoftKey       = '\0';
        if( FFS_flashData.language==0 )
        {
            display_info.TextString         = "\x80\x90\x1a\x8b\xdd\x8d\x39\x73\x87\x00\x00";//WUFEI Modify 0812 original value is 0
            display_info.TextString2        = "\x80\x5D\xF1\x65\x39\x53\xD8\x00\x00";//WUFEI Modify 0812 orignal value is 0
        }
        else
        {
            display_info.TextString         = "Rate";
            display_info.TextString2        = "Changed";//wufei modified 0827
        }
        display_info.TextId             = '\0';//WUFEI Modify 0812 original value is TxtRate
        display_info.TextId2            = '\0';//WUFEI Modify 0812 original value is TxtChanged
        display_info.Time               = FOREVER;
        display_info.Identifier         = event;
        display_info.iconindex          =REMIND_COMPLETE; //hubh 2003-4-9

        display_info.Callback           = (T_VOID_FUNC)service_dialog_cb;
        /*
         * Call Info Screen
         */
        info_dialog (win, &display_info);
        break;

    case SERVICES_LIMIT_VIEW:
        dialog_info_init(&display_info);//gdy add
        memset(line,'\0',sizeof(line));

        cm_get_aoc_value(CM_AOC_ACMMAX,&data->aocInfo);  /* Get the ACM MAX     */
        cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo);    /* Get currency and price per unit */



        /* nm test only  set the default  */
        //    data->aocInfo.acm_max=100;
        //    data->aocInfo.acm=1;
        //    strcpy ((char *)data->aocInfo.cur, "DM");
        //    strcpy ((char *)data->aocInfo.ppu, "1.5");
        /* nm test only  set the default  */


        sprintf(buf, "ACMMAX: %ld", data->aocInfo.acm_max); 
        TRACE_EVENT(buf);
        sprintf(buf, "ACM: %ld", data->aocInfo.acm); 
        TRACE_EVENT(buf);
        sprintf(buf, "PPU:%s", data->aocInfo.ppu); 
        TRACE_EVENT(buf);
        sprintf(buf, "CUR:%s", data->aocInfo.cur); 
        TRACE_EVENT(buf);



        if( (strlen((char*)data->aocInfo.ppu) EQ 0) && data->aocInfo.acm_max NEQ '\0' )
        {
            sprintf(line, "%ld", data->aocInfo.acm_max);     /* Show only ACMmax  */
            TRACE_EVENT ("get only :ACMMAX ; PPU ==0 and ACMMAX!=0");
        }
        if( (strlen((char*)data->aocInfo.ppu) NEQ 0) && data->aocInfo.acm_max NEQ '\0' )
        {
            service_calculate (win, (char*)line, data->aocInfo.acm_max);

            TRACE_EVENT ("calculate ACMMAX * PPU; PPU !=0 and ACMMAX!=0");
        }

        for( i=0; i< MAX_LINE; i++ )
        {
            if( line[i] EQ 0x80 OR line[i] EQ 0xFF )
                line[i] = '\0';
        }
        if( strlen(line)<3 )  //for gudy dialog hu binhao 2002-2-27
        {
            strcat(line,"  ");

        }

        if( data->aocInfo.acm_max NEQ '\0' )
        {
            display_info.TextId       = '\0';//WUFEI MODIFIED 0812 Orignal value is TxtLimitEQ
            display_info.TextId2      = '\0';
            if( FFS_flashData.language==0 )
                display_info.TextString   = "\x80\x96\x50\x5E\xA6\x00\x00";//WUFEI MODIFIED 0812 Orignal value is 0
            else
                display_info.TextString   ="Limit=";//wufei modified 0827
            display_info.TextString2  = line;
        }
        else
        {
            display_info.TextId       = '\0';//WUFEI MODIFIED 0812 Orignal value is TxtNo
            display_info.TextId2      = '\0';//WUFEI MODIFIED 0812 Orignal value is TxtLimit
            if( FFS_flashData.language==0 )
            {
                display_info.TextString   = "\x80\x8d\x39\x75\x28\x4e\x0a\x96\x50\x00\x00";//WUFEI Modified 0812 orignal value is 0
                display_info.TextString2  = "\x80\x65\xe0\x00\x00";//WUFEI Modified 0812 orignal value is 0
            }
            else
            {
                display_info.TextString   = "Limit";
                display_info.TextString2  = "No"; //wufei modified 0827
            }

        }

        display_info.KeyEvents          = KEY_CLEAR | KEY_RIGHT |KEY_HUP;
        display_info.LeftSoftKey        = '\0';
        display_info.RightSoftKey       = TxtSoftBack;  //hu binhao 2003-2-17
        display_info.Time               = FOREVER;  ;
        display_info.Identifier         = event;
        display_info.iconindex              =REMIND_NORECORD;  //hu binhao 2003-2-17

        display_info.Callback           = (T_VOID_FUNC)service_dialog_cb;
        /*
         * Call Info Screen
         */
        info_dialog (win, &display_info);

        break;

    case SERVICES_LIMIT_CHANGE:

        //fill up editor-sttribut with default
        service_loadEditDefault (&editor_data);

        //clear the editor-buffer
        memset(data->edt_Buf,'\0',sizeof(data->edt_Buf));
        editor_attr_init_fullscr(&editor_data.editor_attr,1,TxtEnterLimit,
                                 (char *)data->edt_Buf,9,edtCurBar1);  //hbh 200304-10


        editor_data.editor_attr.text    = data->edt_Buf;  /* buffer to be edited */
        //editor_data.editor_attr.size	= MAX_ENTER_LIMIT; /* limit to 6 terms of units */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -