ns-3 PLC model
|
00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright (c) 2012 University of British Columbia, Vancouver 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation; 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Author: Alexander Schloegl <alexander.schloegl@gmx.de> 00019 */ 00020 00021 #ifndef PLC_TIME_H_ 00022 #define PLC_TIME_H_ 00023 00024 #include <ns3/nstime.h> 00025 #include "plc-defs.h" 00026 00027 namespace ns3 { 00028 00029 class PLC_Time 00030 { 00031 public: 00032 00033 static void SetTimeModel(double mainsFreq, Time tSymbol); 00034 static void SetTimeModel(double mainsFreq, size_t timeslots, Time tSymbol); 00035 static Time GetMainsPeriod(void) { return g_period; } 00036 static size_t GetNumTimeslots(void) { return g_timeslots; } 00037 static Timeslot GetTimeslot(Time t); 00038 static double GetResolutionS(void) { return g_resolution_s; } 00039 static double GetPeriodS(void) { return g_period_s; } 00040 00041 private: 00042 static double g_mainsFreq; 00043 static size_t g_timeslots; 00044 static Time g_period; 00045 static Time g_resolution; 00046 static double g_resolution_s; 00047 static double g_period_s; 00048 }; 00049 00050 } 00051 00052 #endif /* PLC_TIME_H_ */