Loading...
Searching...
No Matches
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
35namespace ns3
36{
37
43class SatCnoHelper : public Object
44{
45 public:
49 typedef struct
50 {
51 Ptr<Node> node;
52 bool isGw;
55 std::string pathToFile;
56 double cno;
58
63 static TypeId GetTypeId(void);
64
69
74 SatCnoHelper(Ptr<SatHelper> satHelper);
75
79 virtual ~SatCnoHelper()
80 {
81 }
82
86 void UseTracesForDefault(bool useTraces);
87
94 void SetGwNodeCno(Ptr<Node> node, SatEnums::ChannelType_t channel, double cno);
95
102 void SetUtNodeCno(Ptr<Node> node, SatEnums::ChannelType_t channel, double cno);
103
110 void SetGwNodeCno(uint32_t nodeId, SatEnums::ChannelType_t channel, double cno);
111
118 void SetUtNodeCno(uint32_t nodeId, SatEnums::ChannelType_t channel, double cno);
119
126 void SetGwNodeCno(NodeContainer nodes, SatEnums::ChannelType_t channel, double cno);
127
134 void SetUtNodeCno(NodeContainer nodes, SatEnums::ChannelType_t channel, double cno);
135
142 void SetGwNodeCnoFile(Ptr<Node> node, SatEnums::ChannelType_t channel, std::string path);
143
150 void SetUtNodeCnoFile(Ptr<Node> node, SatEnums::ChannelType_t channel, std::string path);
151
158 void SetGwNodeCnoFile(uint32_t nodeId, SatEnums::ChannelType_t channel, std::string path);
159
166 void SetUtNodeCnoFile(uint32_t nodeId, SatEnums::ChannelType_t channel, std::string path);
167
168 private:
172
173 Ptr<SatHelper> m_satHelper;
174
179
183 std::vector<cnoCustomParams_s> m_customCno;
184
189 void ApplyConfiguration();
190
196 bool CheckDuplicate(Ptr<Node> node, SatEnums::ChannelType_t channel);
197};
198
199} // namespace ns3
200
201#endif /* __SATELLITE_CNO_HELPER_H__ */
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.
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.