satellite-cno-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd
4  * Copyright (c) 2020 CNES
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Bastien Tauran <bastien.tauran@viveris.fr>
20  */
21 
22 #ifndef __SATELLITE_CNO_HELPER_H__
23 #define __SATELLITE_CNO_HELPER_H__
24 
25 #include <ns3/log.h>
26 #include <ns3/object.h>
27 #include <ns3/satellite-helper.h>
28 #include <ns3/type-id.h>
29 
30 namespace ns3
31 {
32 
38 class SatCnoHelper : public Object
39 {
40  public:
44  typedef struct
45  {
46  Ptr<Node> node;
47  bool isGw;
48  bool constant;
50  std::string pathToFile;
51  double cno;
53 
58  static TypeId GetTypeId(void);
59 
64  TypeId GetInstanceTypeId(void) const;
65 
69  SatCnoHelper();
70 
75  SatCnoHelper(Ptr<SatHelper> satHelper);
76 
80  virtual ~SatCnoHelper()
81  {
82  }
83 
87  void UseTracesForDefault(bool useTraces);
88 
95  void SetGwNodeCno(Ptr<Node> node, SatEnums::ChannelType_t channel, double cno);
96 
103  void SetUtNodeCno(Ptr<Node> node, SatEnums::ChannelType_t channel, double cno);
104 
111  void SetGwNodeCno(uint32_t nodeId, SatEnums::ChannelType_t channel, double cno);
112 
119  void SetUtNodeCno(uint32_t nodeId, SatEnums::ChannelType_t channel, double cno);
120 
127  void SetGwNodeCno(NodeContainer nodes, SatEnums::ChannelType_t channel, double cno);
128 
135  void SetUtNodeCno(NodeContainer nodes, SatEnums::ChannelType_t channel, double cno);
136 
143  void SetGwNodeCnoFile(Ptr<Node> node, SatEnums::ChannelType_t channel, std::string path);
144 
151  void SetUtNodeCnoFile(Ptr<Node> node, SatEnums::ChannelType_t channel, std::string path);
152 
159  void SetGwNodeCnoFile(uint32_t nodeId, SatEnums::ChannelType_t channel, std::string path);
160 
167  void SetUtNodeCnoFile(uint32_t nodeId, SatEnums::ChannelType_t channel, std::string path);
168 
169  private:
174  Ptr<SatHelper> m_satHelper;
175 
180 
184  std::vector<cnoCustomParams_s> m_customCno;
185 
190  void ApplyConfiguration();
191 
197  bool CheckDuplicate(Ptr<Node> node, SatEnums::ChannelType_t channel);
198 };
199 
200 } // namespace ns3
201 
202 #endif /* __SATELLITE_CNO_HELPER_H__ */
This helper allows to set customs C/N0 values for some GW or UT nodes.
void ApplyConfiguration()
Apply configuration to all the satellite channels Needs to be done after node creation.
void SetGwNodeCnoFile(Ptr< Node > node, SatEnums::ChannelType_t channel, std::string path)
Set a constant C/N0 for one GW node and one channel direction.
static TypeId GetTypeId(void)
Get the type ID.
bool m_useTraces
Use C/N0 input traces instead of power calculation from antenna gain.
std::vector< cnoCustomParams_s > m_customCno
Array storing manual C/N0 updates (constant or custom file)
void UseTracesForDefault(bool useTraces)
Set m_useTraces attribute.
void SetUtNodeCnoFile(Ptr< Node > node, SatEnums::ChannelType_t channel, std::string path)
Set a constant C/N0 for one UT node and one channel direction.
virtual ~SatCnoHelper()
Destructor for SatCnoHelper.
void SetGwNodeCno(Ptr< Node > node, SatEnums::ChannelType_t channel, double cno)
Set a constant C/N0 for one GW node and one channel direction.
bool CheckDuplicate(Ptr< Node > node, SatEnums::ChannelType_t channel)
Verify if a node has already been set.
TypeId GetInstanceTypeId(void) const
Get the type ID of object instance.
void SetUtNodeCno(Ptr< Node > node, SatEnums::ChannelType_t channel, double cno)
Set a constant C/N0 for one UT node and one channel direction.
Ptr< SatHelper > m_satHelper
Pointer to the SatHelper objet.
SatCnoHelper()
Default constructor.
ChannelType_t
Types of channel.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the custom C/N0 for some nodes.