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 "satellite-helper.h"
26 
27 #include <ns3/log.h>
28 #include <ns3/object.h>
29 #include <ns3/type-id.h>
30 
31 #include <stdint.h>
32 #include <string>
33 #include <vector>
34 
35 namespace ns3
36 {
37 
43 class SatCnoHelper : public Object
44 {
45  public:
49  typedef struct
50  {
51  Ptr<Node> node;
52  bool isGw;
53  bool constant;
55  std::string pathToFile;
56  double cno;
58 
63  static TypeId GetTypeId(void);
64 
69  TypeId GetInstanceTypeId(void) const;
70 
74  SatCnoHelper();
75 
80  SatCnoHelper(Ptr<SatHelper> satHelper);
81 
85  virtual ~SatCnoHelper()
86  {
87  }
88 
92  void UseTracesForDefault(bool useTraces);
93 
100  void SetGwNodeCno(Ptr<Node> node, SatEnums::ChannelType_t channel, double cno);
101 
108  void SetUtNodeCno(Ptr<Node> node, SatEnums::ChannelType_t channel, double cno);
109 
116  void SetGwNodeCno(uint32_t nodeId, SatEnums::ChannelType_t channel, double cno);
117 
124  void SetUtNodeCno(uint32_t nodeId, SatEnums::ChannelType_t channel, double cno);
125 
132  void SetGwNodeCno(NodeContainer nodes, SatEnums::ChannelType_t channel, double cno);
133 
140  void SetUtNodeCno(NodeContainer nodes, SatEnums::ChannelType_t channel, double cno);
141 
148  void SetGwNodeCnoFile(Ptr<Node> node, SatEnums::ChannelType_t channel, std::string path);
149 
156  void SetUtNodeCnoFile(Ptr<Node> node, SatEnums::ChannelType_t channel, std::string path);
157 
164  void SetGwNodeCnoFile(uint32_t nodeId, SatEnums::ChannelType_t channel, std::string path);
165 
172  void SetUtNodeCnoFile(uint32_t nodeId, SatEnums::ChannelType_t channel, std::string path);
173 
174  private:
179  Ptr<SatHelper> m_satHelper;
180 
185 
189  std::vector<cnoCustomParams_s> m_customCno;
190 
195  void ApplyConfiguration();
196 
202  bool CheckDuplicate(Ptr<Node> node, SatEnums::ChannelType_t channel);
203 };
204 
205 } // namespace ns3
206 
207 #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.