Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Config.cpp
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #include "cheetah/emulator/Config.h"
25 #include "panda/ConfigFile.h"
26 
27 
28 namespace ska {
29 namespace cheetah {
30 namespace emulator {
31 
32 Config::Config()
33  : cheetah::utils::Config("emulator")
34  , _endpoint_config("client")
35 {
36  _endpoint_config.address(ska::panda::IpAddress(34345, "127.0.0.1"));
37  add(_generators_config);
38  add(_ska_low_config);
39  add(_endpoint_config);
40  add(_server_config);
41 }
42 
43 Config::~Config()
44 {
45 }
46 
47 panda::Engine& Config::engine() const
48 {
49  return _server_config.engine();
50 }
51 
52 void Config::add_options(OptionsDescriptionEasyInit& add_options)
53 {
54  add_options
55  ("channels", boost::program_options::value<std::size_t>(&_number_of_channels)->default_value(7776), "the number of channels to generate")
56  ("generator", boost::program_options::value<std::string>(&_generator), "select the data generator to use in the emulation");
57 }
58 
59 Config::EndPointType Config::fixed_end_point() const
60 {
61  return _endpoint_config.address().end_point<EndPointType>();;
62 }
63 
64 void Config::fixed_address(panda::IpAddress const& address)
65 {
66  _endpoint_config.address(address);
67 }
68 
69 cheetah::generators::Config const& Config::generators_config() const
70 {
71  return _generators_config;
72 }
73 
74 cheetah::rcpt_low::PacketGeneratorConfig const& Config::ska_low_config() const
75 {
76  return _ska_low_config;
77 }
78 
79 panda::ServerConfig const& Config::server_config() const
80 {
81  return _server_config;
82 }
83 
84 std::size_t Config::number_of_channels() const
85 {
86  return _number_of_channels;
87 }
88 
89 void Config::number_of_channels(std::size_t n)
90 {
91  _number_of_channels = n;
92 }
93 
94 std::string const& Config::generator() const
95 {
96  return _generator;
97 }
98 
99 } // namespace emulator
100 } // namespace cheetah
101 } // namespace ska
Generator Configuration file.
Definition: Config.h:46
Some limits and constants for FLDO.
Definition: Brdz.h:35
Configuration for the packet generator to the time seperation of the packets.