📄 pgrate.c
字号:
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This software is copyrighted by and is the sole property of
* VIA Networking Technologies, Inc. This software may only be used
* in accordance with the corresponding license agreement. Any unauthorized
* use, duplication, transmission, distribution, or disclosure of this
* software is expressly forbidden.
*
* This software is provided by VIA Networking Technologies, Inc. "as is"
* and any express or implied warranties, including, but not limited to, the
* implied warranties of merchantability and fitness for a particular purpose
* are disclaimed. In no event shall VIA Networking Technologies, Inc.
* be liable for any direct, indirect, incidental, special, exemplary, or
* consequential damages.
*
*
* File: ratedef.c
*
* Purpose:
*
* Author: Jenda Jao
*
* Date: 02 / 08, 2003
*
* Functions:
*
* Revision History:
*
*/
#include "engine.h"
#include "eng_act.h"
#include "allpages.h"
#include "pgrate.h"
#include "pigencfg.h"
#include "gen_act.h"
#include "pidef.h"
#include "pirate.h"
#include "piportmp.h"
#include "pimsg.h"
// assign fix label
DIRECT_MEMTYPE_CODE char strRateCfgTitle[] = "Port InRate OutRate";
DIRECT_MEMTYPE_CODE SFixLabel aSFixLabelRateCfg[] = {
{{2,31}, g_strRateCfg, 0},
{{3,31}, "=", 17},
{{6,13}, strRateCfgTitle, 0},
{{6,43}, strRateCfgTitle, 0},
{{7,13}, "-", 23},
{{7,43}, "-", 23},
{{24,2}, g_strHelpMsg, 0},
};
DIRECT_MEMTYPE_CODE SVarLabel aSVarLabelRateCfg[] = {
{{ 8,13}, &g_SIListboxLogPortName, "", ITEM_LISTBOX, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, UI_SWITCH_MEGA_PORT_NUM/2, 30},
};
// assign var item
DIRECT_MEMTYPE_CODE SItemNum aSIDecRate[] = {
{g_pSRatePageCfg->abyRate, 1, 2, 2},
{g_pSRatePageCfg->abyRate+1, 1, 2, 2},
};
DIRECT_MEMTYPE_CODE SItem aSItemRateCfg[] = {
{{8,21}, aSIDecRate , "Rate Unit: 1Mbps, 0: disabled.", ITEM_DECNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, UI_SWITCH_MEGA_PORT_NUM/2, 30},
{{8,29}, aSIDecRate+1, "", ITEM_DECNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, UI_SWITCH_MEGA_PORT_NUM/2, 30},
};
// action
DIRECT_MEMTYPE_CODE SActItem aSActionRateCfg[] = {
{{22, 12}, g_strActionQuit, PAACT_bQuit},
{{22, 22}, g_strActionEdit, PAACT_bEdit},
{{22, 32}, g_strActionSave, PARATE_bSaveRateCfg},
};
// assign page
DIRECT_MEMTYPE_CODE SPage g_SPageRateCfg = {
aSFixLabelRateCfg, 7,
aSVarLabelRateCfg, 1,
aSItemRateCfg, 2,
aSActionRateCfg, 3,
PARATE_bLoadRateCfg
};
////////////////////////////////////////////////////////////////////////
// load config
BOOL PARATE_bLoadRateCfg(void) DIRECT_FUNTYPE_REENT
{
PIRATE_vInitPage(g_pSRatePageCfg);
g_byTotalLineNum = g_byMegaLogIdNum;
return DONT_RELOAD_PAGE;
}
// save config
BOOL PARATE_bSaveRateCfg(void) DIRECT_FUNTYPE_REENT
{
PIMSG_vPutSavingMsg();
PIRATE_vSavePage(g_pSRatePageCfg);
PIMSG_vPutMsgThenPause(OP_OK);
g_bDataDirty = 0;
return DONT_RELOAD_PAGE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -