User Manual, Developers Guide and API Documentation

Base.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #include <WNS/ldk/FUNConfigCreator.hpp>
00029 
00030 #include <LTE/timing/events/Base.hpp>
00031 #include <LTE/timing/TimingScheduler.hpp>
00032 #include <LTE/macr/PhyUser.hpp>
00033 
00034 using namespace lte::timing;
00035 using namespace lte::timing::events;
00036 
00037 events::Base::Base(wns::ldk::fun::FUN* _fun, const wns::pyconfig::View& config) :
00038     HasModeName(config),
00039     duration(config.get<simTimeType>("duration")),
00040     rxTxSetter(_fun->findFriend<lte::macr::IRxTxSettable*>(modeBase+separator+"phyUser")),
00041     timer(NULL),
00042     fun(_fun),
00043     logger(config.get("logger"))
00044 {
00045 }
00046 
00047 void
00048 events::Base::setTimer(lte::timing::TimingScheduler* _timer)
00049 {
00050     timer = _timer;
00051 }
00052 
00053 void
00054 events::Base::setStateRxTx(lte::macr::IRxTxSettable::StateRxTx stateRxTx)
00055 {
00056     assure(timer, "Timer has not been set in Event!");
00057     if (timer->duplex == lte::timing::DuplexSchemes::FDD())
00058     {
00059         rxTxSetter->setStateRxTx(lte::macr::IRxTxSettable::BothRxTx);
00060         MESSAGE_SINGLE(NORMAL, logger, "setState=FDD");
00061     }else if (timer->duplex == lte::timing::DuplexSchemes::TDD())
00062         rxTxSetter->setStateRxTx(stateRxTx);
00063     else
00064         assure(0, "undefined duplex mode");
00065 }
00066 
00067 
00068 
00069 
00070 

Generated on Sun May 27 03:31:48 2012 for openWNS by  doxygen 1.5.5