📄 radiosimple.cc
字号:
#include "CommonIncludes.h"#include "RadioSimple.h"Define_Module_Like( RadioSimple, RadioModule )RadioSimple::RadioSimple(const char *name, cModule *parentModule, unsigned stacksize) : RadioBase(name, parentModule, stacksize){// printf("\n\t RadioSimple");}void RadioSimple::initialize(){ //printf("\n\t In RadioSimple:initialize."); //ev << "\n\t In RadioSimple:initialize."; cModule *pNode = parentModule(); pCoOrdinator = pNode->submodule("CoOrdinator"); if (NULL == pCoOrdinator) { printf("\n\t In RadioSimple: CoOrdinatorModule not found."); return; } // Fill the PowerRating Table according to the State double dPowerRating = par("PowerRating"); double tx = par("txCur"); double rx = par("rxCur"); double idle = par("idleCur"); SetPowerRating(INITIALIZED, dPowerRating); SetPowerRating(TRANSMIT,tx); SetPowerRating(RECEIVE,rx); SetPowerRating(IDLE,idle); //printf("\n\t In RadioSimple txCur= %f ,rxCur= %f, idle= %f \n\n",tx,rx,idle); // Register the current state with the Battery bool bSuccess = RegisterWithBattery(); if(true == bSuccess) SetState(INITIALIZED);}void RadioSimple::handleMessage(cMessage *cMsg){ //printf("\n\t In RadioSimple::handleMessage"); //ev << "\n\t In RadioSimple::handleMessage";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -