Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
generator_main.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  */ // end group
38 
39 #include "cheetah/generators/GeneratorAppConfig.h"
40 #include "cheetah/generators/GeneratorApp.h"
41 #include "cheetah/generators/GeneratorFactory.h"
42 #include "panda/Log.h"
43 #include <memory>
44 
45 int main(int argc, char** argv) {
46 
47  ska::cheetah::generators::GeneratorAppConfig app_config("cheetah_generator", "genrate cheetah Beamformed Time-Frequecy data to a file");
48  int rv;
49  try {
50  ska::cheetah::generators::GeneratorFactory<uint8_t> generator_factory(app_config.generator_config());
51  app_config.set_generator_list(generator_factory.available());
52 
53  // parse command line options
54  if( (rv=app_config.parse(argc, argv)) ) return rv;
55 
56  // setup the app
57  ska::cheetah::generators::GeneratorApp<uint8_t> app(app_config, generator_factory);
58  app.exec();
59  }
60  catch(std::exception const& e) {
61  std::cerr << "Emulator: " << e.what() << std::endl;;
62  }
63  catch(...) {
64  std::cerr << "Emulator: unknown exception caught" << std::endl;
65  }
66  return 1;
67 }
construct a suitable generatro object
Definition: GeneratorApp.h:38
App to generate sigproc files using the various generators available.
Definition: GeneratorApp.h:46
Top level configuration for the generator app.