MOOS 0.2375
|
00001 00002 // 00003 // MOOS - Mission Oriented Operating Suite 00004 // 00005 // A suit of Applications and Libraries for Mobile Robotics Research 00006 // Copyright (C) 2001-2005 Massachusetts Institute of Technology and 00007 // Oxford University. 00008 // 00009 // This software was written by Paul Newman at MIT 2001-2002 and Oxford 00010 // University 2003-2005. email: pnewman@robots.ox.ac.uk. 00011 // 00012 // This file is part of a MOOS Utility Component. 00013 // 00014 // This program is free software; you can redistribute it and/or 00015 // modify it under the terms of the GNU General Public License as 00016 // published by the Free Software Foundation; either version 2 of the 00017 // License, or (at your option) any later version. 00018 // 00019 // This program is distributed in the hope that it will be useful, 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00022 // General Public License for more details. 00023 // 00024 // You should have received a copy of the GNU General Public License 00025 // along with this program; if not, write to the Free Software 00026 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00027 // 02111-1307, USA. 00028 // 00030 00031 00032 // SimVehicle.cpp: implementation of the CSimVehicle class. 00033 // 00035 #ifdef _WIN32 00036 #pragma warning(disable : 4786) 00037 #endif 00038 00039 00040 00041 #include "AcousticNode.h" 00042 #include "AcousticTransceiver.h" 00043 #include "AcousticResponder.h" 00044 #include "SimVehicle.h" 00045 00047 // Construction/Destruction 00049 CSimVehicle::CSimVehicle() 00050 { 00051 CAcousticTransceiver * pTcvr = new CAcousticTransceiver; 00052 pTcvr->SetParams(m_pParams); 00053 m_AcousticNodes.push_front(pTcvr); 00054 pTcvr->SetParent(this); 00055 pTcvr->SetName("Tcvr1"); 00056 00057 CAcousticResponder * pTpdr = new CAcousticResponder; 00058 pTpdr->SetParams(m_pParams); 00059 m_AcousticNodes.push_front(pTpdr); 00060 pTpdr->SetParent(this); 00061 pTpdr->SetName("Tpdr1"); 00062 00063 } 00064 00065 bool CSimVehicle::ConfigureResponder(bool bEnable,AcousticChannel eRx,AcousticChannel eTx,double dfTAT) 00066 { 00067 ACOUSTIC_NODE_LIST::iterator p; 00068 for(p = m_AcousticNodes.begin();p!=m_AcousticNodes.end();p++) 00069 { 00070 if((*p)->GetName()=="Tpdr1") 00071 { 00072 (*p)->Enable(bEnable); 00073 (*p)->SetRxChan(eRx); 00074 (*p)->SetTxChan(eTx); 00075 ((CAcousticResponder*)(*p))->SetTAT(dfTAT); 00076 return true; 00077 } 00078 } 00079 00080 return false; 00081 } 00082 00083 00084 CSimVehicle::~CSimVehicle() 00085 { 00086 00087 } 00088 00089 00090 00091 00092 00093