cpusimple.cc
来自「基于Oment++的无线传感器网络仿真」· CC 代码 · 共 40 行
CC
40 行
#include "CommonIncludes.h"#include "CPUSimple.h"Define_Module_Like( CPUSimple, CPUModule );CPUSimple::CPUSimple(const char *name, cModule *parentModule, unsigned stacksize) : CPUBase(name, parentModule, stacksize){// printf("\n\t CPUSimple");}void CPUSimple::initialize(){ //printf("\n\t In CPUSimple:initialize.");// ev << "\n\t In CPUSimple:initialize."; cModule *pNode = parentModule(); pCoOrdinator = pNode->submodule("CoOrdinator"); if (NULL == pCoOrdinator) { printf("\n\t In CPUSimple: CoOrdinatorModule not found."); } // Fill the PowerRating Table according to the State double dPowerRating = par("PowerRating"); SetPowerRating(INITIALIZED, dPowerRating); // Register the current state with the Battery bool bSuccess = RegisterWithBattery(); if(true == bSuccess) SetState(INITIALIZED);}void CPUSimple::handleMessage(cMessage *cMsg){ //printf("\n\t In CPUSimple::handleMessage"); ev << "\n\t In CPUSimple::handleMessage";}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?