2012-02-06 16:44:09 +01:00
|
|
|
/*
|
2013-05-29 18:43:35 +02:00
|
|
|
* This file is part of the Owl Positioning System (OwlPS) project.
|
|
|
|
* It is subject to the copyright notice and license terms in the
|
|
|
|
* COPYRIGHT.t2t file found in the top-level directory of this
|
|
|
|
* distribution and at
|
2016-11-03 05:10:34 +01:00
|
|
|
* https://code.lm7.fr/mcy/owlps/src/master/COPYRIGHT.t2t
|
2013-05-29 18:43:35 +02:00
|
|
|
* No part of the OwlPS Project, including this file, may be copied,
|
|
|
|
* modified, propagated, or distributed except according to the terms
|
|
|
|
* contained in the COPYRIGHT.t2t file; the COPYRIGHT.t2t file must be
|
|
|
|
* distributed along with this file, either separately or by replacing
|
2013-06-22 23:30:17 +02:00
|
|
|
* this notice by the COPYRIGHT.t2t file's contents.
|
2012-11-03 14:52:33 +01:00
|
|
|
*
|
|
|
|
***********************************************************************
|
|
|
|
*
|
2012-02-06 17:17:25 +01:00
|
|
|
* This is the main source file of OwlPS Positioner, the program that
|
2012-02-06 16:44:09 +01:00
|
|
|
* computes the position of the mobile terminals.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-02-11 09:46:40 +01:00
|
|
|
#include "userinterface.hh"
|
2013-06-12 20:03:40 +02:00
|
|
|
#include "configuration.hh"
|
2010-04-02 15:49:22 +02:00
|
|
|
#include "inputdatareader.hh"
|
2010-03-08 11:38:25 +01:00
|
|
|
#include "stock.hh"
|
|
|
|
#include "positioning.hh"
|
2009-05-29 14:31:10 +02:00
|
|
|
|
2011-03-29 16:00:37 +02:00
|
|
|
#include <owlps.h>
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2011-03-29 18:30:00 +02:00
|
|
|
#include <csignal>
|
|
|
|
|
2011-03-29 16:00:37 +02:00
|
|
|
using namespace std ;
|
|
|
|
|
2009-05-29 17:02:20 +02:00
|
|
|
|
2013-06-17 21:54:42 +02:00
|
|
|
int main(const int argc, const char **const argv)
|
2010-02-11 09:46:40 +01:00
|
|
|
{
|
2013-05-15 21:46:13 +02:00
|
|
|
owl_run = true ;
|
2011-08-24 11:41:07 +02:00
|
|
|
|
2011-03-29 16:00:37 +02:00
|
|
|
/* Read options & configuration */
|
2010-04-02 15:49:22 +02:00
|
|
|
delete new UserInterface(argc, argv) ;
|
2011-03-29 16:00:37 +02:00
|
|
|
|
2011-08-24 11:41:07 +02:00
|
|
|
if (owl_run)
|
|
|
|
{
|
|
|
|
/* Read input data */
|
|
|
|
delete new InputDataReader() ;
|
|
|
|
|
|
|
|
/* Set up signal handlers */
|
|
|
|
struct sigaction action ;
|
|
|
|
action.sa_flags = 0 ;
|
|
|
|
sigemptyset(&action.sa_mask) ;
|
|
|
|
action.sa_handler = owl_sigint_handler ;
|
2014-05-13 23:50:53 +02:00
|
|
|
sigaction(SIGINT, &action, nullptr) ;
|
2011-08-24 11:41:07 +02:00
|
|
|
action.sa_handler = owl_sigterm_handler ;
|
2014-05-13 23:50:53 +02:00
|
|
|
sigaction(SIGTERM, &action, nullptr) ;
|
2011-08-24 11:41:07 +02:00
|
|
|
|
|
|
|
/* Run! */
|
|
|
|
Positioning positioning ;
|
|
|
|
|
|
|
|
/* Clean */
|
|
|
|
Stock::clear() ;
|
|
|
|
}
|
2011-03-29 16:00:37 +02:00
|
|
|
|
2013-06-12 20:03:40 +02:00
|
|
|
if (Configuration::is_configured("verbose"))
|
|
|
|
cerr << argv[0] << ": exiting." << endl ;
|
|
|
|
|
2010-02-11 09:46:40 +01:00
|
|
|
return 0 ;
|
2009-05-29 14:31:10 +02:00
|
|
|
}
|