2012-02-06 16:44:09 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the Owl Positioning System (OwlPS).
|
|
|
|
* OwlPS is a project of the University of Franche-Comté
|
|
|
|
* (Université de Franche-Comté), France.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-02-11 09:46:40 +01:00
|
|
|
#include "userinterface.hh"
|
|
|
|
#include "configuration.hh"
|
|
|
|
|
2011-03-29 12:32:26 +02:00
|
|
|
#include <owlps.h>
|
|
|
|
|
2010-02-11 09:46:40 +01:00
|
|
|
#include <iostream>
|
|
|
|
#include <fstream>
|
|
|
|
#include <boost/program_options.hpp>
|
|
|
|
|
|
|
|
using namespace std ;
|
|
|
|
namespace po = boost::program_options ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *** Default value definitions *** */
|
|
|
|
|
2011-12-27 18:07:28 +01:00
|
|
|
/* General options */
|
2011-04-27 17:48:33 +02:00
|
|
|
#define DEFAULT_CONFIG_FILE_NAME \
|
2012-02-06 17:17:25 +01:00
|
|
|
"/usr/local/etc/owlps/owlps-positioner.conf"
|
2010-02-11 09:46:40 +01:00
|
|
|
|
2011-12-27 18:07:28 +01:00
|
|
|
/* Positioning options */
|
2012-03-02 10:54:34 +01:00
|
|
|
#define DEFAULT_SS_SIMILARITY "mean"
|
2011-12-27 18:07:28 +01:00
|
|
|
#define DEFAULT_MESHING_GRAIN 0.5
|
2012-01-09 10:31:12 +01:00
|
|
|
#define DEFAULT_Z_MESHING_GRAIN 1
|
2011-12-30 12:21:59 +01:00
|
|
|
#define DEFAULT_SMALLEST_SS -99
|
2011-12-27 18:07:28 +01:00
|
|
|
|
|
|
|
/* Output options */
|
2011-07-24 17:25:00 +02:00
|
|
|
#define DEFAULT_TCPEVAAL_HOST "127.0.0.1"
|
|
|
|
#define DEFAULT_TCPEVAAL_PORT 4444
|
|
|
|
|
2010-02-11 09:46:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* *** Constructors *** */
|
|
|
|
|
|
|
|
|
2010-03-05 17:24:18 +01:00
|
|
|
/**
|
|
|
|
* \em argc and \em argv are (normally) the ones passed to the main()
|
|
|
|
* function.
|
|
|
|
* @param argc Number of arguments passed to the program.
|
|
|
|
* @param argv Values of the arguments.
|
|
|
|
*/
|
2010-02-11 09:46:40 +01:00
|
|
|
UserInterface::UserInterface(const int argc, char **argv)
|
|
|
|
{
|
2010-03-05 17:24:18 +01:00
|
|
|
assert(argv) ;
|
2010-02-11 09:46:40 +01:00
|
|
|
cli_argument_values = argv ;
|
2010-03-05 17:24:18 +01:00
|
|
|
cli_argument_count = argc ;
|
2010-02-11 09:46:40 +01:00
|
|
|
|
2010-02-26 13:09:45 +01:00
|
|
|
try
|
|
|
|
{
|
|
|
|
cli_options = new po::options_description("General options") ;
|
|
|
|
file_options = new po::options_description("Parameters") ;
|
|
|
|
}
|
2011-05-11 10:29:17 +02:00
|
|
|
catch (bad_alloc &e)
|
2010-02-26 13:09:45 +01:00
|
|
|
{
|
|
|
|
throw ;
|
|
|
|
}
|
|
|
|
|
2010-02-11 09:46:40 +01:00
|
|
|
fill_options() ;
|
|
|
|
parse_options() ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UserInterface::~UserInterface()
|
|
|
|
{
|
|
|
|
delete cli_options ;
|
|
|
|
delete file_options ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *** Operations *** */
|
|
|
|
|
|
|
|
|
|
|
|
void UserInterface::fill_options()
|
|
|
|
{
|
|
|
|
fill_cli_options() ;
|
|
|
|
fill_file_options() ;
|
|
|
|
|
|
|
|
// File options are also accepted on the command line
|
|
|
|
cli_options->add(*file_options) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UserInterface::fill_cli_options()
|
|
|
|
{
|
|
|
|
cli_options->add_options()
|
2011-12-27 18:07:28 +01:00
|
|
|
("help,h",
|
|
|
|
"Print help.")
|
|
|
|
("version,V",
|
|
|
|
"Print version information.")
|
|
|
|
("config-file,f",
|
|
|
|
po::value<string>()->default_value(DEFAULT_CONFIG_FILE_NAME),
|
2011-04-13 00:10:49 +02:00
|
|
|
"Alternative configuration file.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("verbose,v",
|
|
|
|
"Verbose mode.")
|
2010-03-05 17:24:18 +01:00
|
|
|
; // End of options
|
2010-02-11 09:46:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UserInterface::fill_file_options()
|
|
|
|
{
|
2010-04-02 15:49:22 +02:00
|
|
|
fill_data_input_options() ;
|
2010-03-23 14:53:37 +01:00
|
|
|
fill_input_options() ;
|
|
|
|
fill_log_options() ;
|
|
|
|
fill_positioning_options() ;
|
|
|
|
fill_output_options() ;
|
2011-03-29 14:21:14 +02:00
|
|
|
fill_misc_options() ;
|
2010-03-23 14:53:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-04-02 15:49:22 +02:00
|
|
|
void UserInterface::fill_data_input_options()
|
|
|
|
{
|
|
|
|
po::options_description options("Data input options") ;
|
|
|
|
|
|
|
|
options.add_options()
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.ap-medium",
|
|
|
|
po::value< vector<string> >()->composing(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"Medium from which access points are read. You can specify this"
|
|
|
|
" option more than once. Allowed: CSV.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.ap-csv-file",
|
|
|
|
po::value<string>(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"CSV file to use for access points input (when"
|
|
|
|
" data-input.ap-medium = CSV).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.mobile-medium",
|
|
|
|
po::value< vector<string> >()->composing(),
|
2011-07-19 18:40:17 +02:00
|
|
|
"Medium from which mobiles are read. You can specify this"
|
|
|
|
" option more than once. Allowed: CSV.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.mobile-csv-file",
|
|
|
|
po::value<string>(),
|
2011-07-19 18:40:17 +02:00
|
|
|
"CSV file to use for mobiles input (when"
|
|
|
|
" data-input.mobile-medium = CSV).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.topology-medium",
|
|
|
|
po::value< vector<string> >()->composing(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"Medium from which topology (buildings, areas and waypoints) is"
|
|
|
|
" read. You can specify this option more than once. Allowed: CSV.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.areas-csv-file",
|
|
|
|
po::value<string>(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"CSV file to use for topology input (when"
|
|
|
|
" data-input.topology-medium = CSV).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.waypoints-csv-file",
|
|
|
|
po::value<string>(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"CSV file to use for waypoints input (when"
|
|
|
|
" data-input.topology-medium = CSV).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.reference-points-medium",
|
|
|
|
po::value< vector<string> >()->composing(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"Medium from which reference points are read. You can specify this"
|
|
|
|
" option more than once. Allowed: CSV.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("data-input.reference-points-csv-file",
|
|
|
|
po::value<string>(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"CSV file to use for reference points input (when"
|
|
|
|
" data-input.reference-points-medium = CSV).")
|
2010-04-02 15:49:22 +02:00
|
|
|
;
|
|
|
|
|
|
|
|
file_options->add(options) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-03-23 14:53:37 +01:00
|
|
|
void UserInterface::fill_input_options()
|
|
|
|
{
|
|
|
|
po::options_description options("Input options") ;
|
|
|
|
|
|
|
|
options.add_options()
|
2011-12-27 18:07:28 +01:00
|
|
|
("input.medium,I",
|
|
|
|
po::value<string>(),
|
2011-03-18 10:37:06 +01:00
|
|
|
"Medium from which requests are read. Allowed: CSV, UDP.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("input.csv-file",
|
|
|
|
po::value<string>(),
|
2010-02-16 16:19:39 +01:00
|
|
|
"CSV file to use for input (when input.medium = CSV).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("input.udp-port",
|
|
|
|
po::value<int>()->default_value(OWL_DEFAULT_AGGREGATION_PORT),
|
2011-03-18 10:37:06 +01:00
|
|
|
"Port on which the UDP socket listens (when input.medium = UDP).")
|
2010-03-23 14:53:37 +01:00
|
|
|
;
|
|
|
|
|
|
|
|
file_options->add(options) ;
|
|
|
|
}
|
|
|
|
|
2010-03-05 17:24:18 +01:00
|
|
|
|
2010-03-23 14:53:37 +01:00
|
|
|
void UserInterface::fill_log_options()
|
|
|
|
{
|
|
|
|
po::options_description options("Log options") ;
|
|
|
|
|
|
|
|
options.add_options()
|
2011-12-27 18:07:28 +01:00
|
|
|
("log.medium,L",
|
|
|
|
po::value< vector<string> >()->composing(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"Medium to which the requests will be logged. You can specify"
|
|
|
|
" this option more than once. Allowed: none, CSV. The `none`"
|
|
|
|
" value completely disables logging.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("log.csv-file",
|
|
|
|
po::value<string>(),
|
2010-02-16 16:19:39 +01:00
|
|
|
"CSV file to use for logging (when log.medium = CSV).")
|
2010-03-23 14:53:37 +01:00
|
|
|
;
|
|
|
|
|
|
|
|
file_options->add(options) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UserInterface::fill_positioning_options()
|
|
|
|
{
|
|
|
|
po::options_description options("Positioning options") ;
|
2010-03-05 17:24:18 +01:00
|
|
|
|
2010-03-23 14:53:37 +01:00
|
|
|
options.add_options()
|
2011-12-27 18:07:28 +01:00
|
|
|
("positioning.algorithm,a",
|
|
|
|
po::value< vector<string> >()->composing(),
|
2011-06-08 19:05:48 +02:00
|
|
|
"Algorithms used to compute positions. You can specify"
|
2011-12-27 18:07:28 +01:00
|
|
|
" this option more than once (but at least once). Allowed: Real,"
|
2011-12-30 13:43:01 +01:00
|
|
|
" FBCM, FRBHMBasic, InterlinkNetworks, NSS.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("positioning.accept-new-mobiles",
|
|
|
|
po::value<bool>()->default_value(false),
|
|
|
|
"When receiving requests, add unknown mobiles (mobiles which are not"
|
|
|
|
" declared in the mobiles' configuration file) to the mobiles' list.")
|
|
|
|
("positioning.accept-new-aps",
|
|
|
|
po::value<bool>()->default_value(false),
|
|
|
|
"When receiving requests, add unknown APs (APs which are not"
|
|
|
|
" declared in the APs' configuration file) to the APs' list"
|
|
|
|
" (default is false, for security purposes).")
|
|
|
|
("positioning.update-ap-coordinates-online",
|
|
|
|
po::value<bool>()->default_value(false),
|
|
|
|
"Allow AP's coordinates to be updated when a calibration request"
|
|
|
|
" with new coordinates is received from the AP (default is false,"
|
|
|
|
" for security purposes).")
|
|
|
|
("positioning.area-start",
|
|
|
|
po::value<string>(),
|
2011-07-30 14:21:37 +02:00
|
|
|
"Coordinates of the first point of the deployment area; this is"
|
2012-04-11 16:31:48 +02:00
|
|
|
" used to delimit the area in which the MinMax trilateration"
|
2011-07-30 14:21:37 +02:00
|
|
|
" method tests points and in which the reference points are"
|
|
|
|
" generated, if the corresponding options are activated"
|
|
|
|
" (string format: \"X;Y;Z\").")
|
2011-12-27 18:07:28 +01:00
|
|
|
("positioning.area-stop",
|
|
|
|
po::value<string>(),
|
2011-07-30 14:21:37 +02:00
|
|
|
"Coordinates of the last point of the deployment area"
|
|
|
|
" (string format: \"X;Y;Z\").")
|
2011-12-30 12:21:59 +01:00
|
|
|
("positioning.smallest-ss",
|
|
|
|
po::value<int>()->default_value(DEFAULT_SMALLEST_SS),
|
|
|
|
"Smallest possible value for a received signal strength, in dBm.")
|
2012-03-02 10:54:34 +01:00
|
|
|
("positioning.ss-similarity",
|
|
|
|
po::value<string>()->default_value(DEFAULT_SS_SIMILARITY),
|
|
|
|
"Algorithm to calculate the similarity, in the signal strength space,"
|
2012-03-06 12:27:15 +01:00
|
|
|
" between two measurements. Allowed: mean, interval, interval2.")
|
2011-07-22 11:29:30 +02:00
|
|
|
("positioning.generate-reference-points",
|
|
|
|
po::value<bool>()->default_value(false),
|
|
|
|
"Generate reference points from the (auto)calibration requests"
|
|
|
|
" received.")
|
2012-02-29 17:14:23 +01:00
|
|
|
("positioning.generate-single-packet-reference-points",
|
|
|
|
po::value<bool>()->default_value(true),
|
|
|
|
"Generate only one packet per reference point, instead of trying to"
|
|
|
|
" match the packets in the real requests.")
|
2011-07-29 16:14:39 +02:00
|
|
|
("positioning.generated-meshing-grain-x",
|
2011-12-27 18:07:28 +01:00
|
|
|
po::value<float>()->default_value(DEFAULT_MESHING_GRAIN),
|
2011-07-23 18:08:54 +02:00
|
|
|
"When generating reference points, this distance (in meters) will"
|
2011-07-29 16:14:39 +02:00
|
|
|
" separate each point to the next in X.")
|
|
|
|
("positioning.generated-meshing-grain-y",
|
2011-12-27 18:07:28 +01:00
|
|
|
po::value<float>()->default_value(DEFAULT_MESHING_GRAIN),
|
2011-07-29 16:14:39 +02:00
|
|
|
"When generating reference points, this distance (in meters) will"
|
|
|
|
" separate each point to the next in Y.")
|
2012-01-09 10:31:12 +01:00
|
|
|
("positioning.generated-meshing-grain-z",
|
|
|
|
po::value<float>()->default_value(DEFAULT_Z_MESHING_GRAIN),
|
|
|
|
"When generating reference points, this parameter represents the"
|
2012-05-02 17:29:26 +02:00
|
|
|
" number of the floor. Currently, each increment of Y is a new"
|
|
|
|
" floor (full 3-D coordinates are not supported yet).")
|
2011-06-17 16:02:19 +02:00
|
|
|
("positioning.accept-new-calibration-requests",
|
|
|
|
po::value<bool>()->default_value(false),
|
|
|
|
"Add the calibration requests received during the run-time to"
|
|
|
|
" the calibration requests' list; this is required for the"
|
|
|
|
" self-calibration. If unactivated, the calibration requests"
|
|
|
|
" are handled as positioning requests (default is unactivated,"
|
|
|
|
" for security purposes).")
|
2011-12-28 13:40:51 +01:00
|
|
|
("positioning.calibration-requests-timeout",
|
|
|
|
po::value<unsigned int>()->default_value(0),
|
|
|
|
"Maximum age of a calibration request before to delete it"
|
|
|
|
" (0 = unlimited).")
|
2011-07-23 11:44:04 +02:00
|
|
|
("positioning.position-calibration-requests",
|
|
|
|
po::value<bool>()->default_value(false),
|
|
|
|
"When accept-new-calibration-requests is activated, allow the"
|
|
|
|
" calibration requests to be positioned as normal requests."
|
|
|
|
" The default is to add them to the calibration requests' list"
|
|
|
|
" without position them.")
|
2011-12-30 13:43:01 +01:00
|
|
|
("positioning.nss.average-reference-points",
|
2011-06-29 16:45:36 +02:00
|
|
|
po::value<bool>()->default_value(false),
|
2011-12-30 13:43:01 +01:00
|
|
|
"With the NSS algorithm, for a given positioning request, average"
|
2011-12-27 18:07:28 +01:00
|
|
|
" all the calibration requests associated with a reference point"
|
2012-03-02 10:54:34 +01:00
|
|
|
" before to compute the SS similarity."
|
2011-12-27 18:07:28 +01:00
|
|
|
" The default is false, i.e the positioning request is compared"
|
|
|
|
" directly to each calibration request.")
|
2011-12-30 13:43:01 +01:00
|
|
|
("positioning.nss.ignore-ap-reference-points",
|
2011-07-19 19:05:38 +02:00
|
|
|
po::value<bool>()->default_value(false),
|
2011-12-30 13:43:01 +01:00
|
|
|
"With the NSS algorithm, try to avoid selecting the reference"
|
2011-12-27 18:07:28 +01:00
|
|
|
" points which are coordinates of an AP.")
|
2010-03-23 14:53:37 +01:00
|
|
|
;
|
2010-03-05 17:24:18 +01:00
|
|
|
|
2010-03-23 14:53:37 +01:00
|
|
|
file_options->add(options) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UserInterface::fill_output_options()
|
|
|
|
{
|
|
|
|
po::options_description options("Output options") ;
|
|
|
|
|
|
|
|
options.add_options()
|
2011-12-27 18:07:28 +01:00
|
|
|
("output.medium,O",
|
|
|
|
po::value< vector<string> >()->composing(),
|
|
|
|
"Medium to which the results will be written. You can specify"
|
2011-07-14 22:07:48 +02:00
|
|
|
" this option more than once."
|
2011-12-27 18:07:28 +01:00
|
|
|
" Allowed: Terminal, CSV, UDP, TCPEvAAL (EvAAL 2011 format)."
|
2011-07-14 22:07:48 +02:00
|
|
|
" If this option is absent, the results are printed on the terminal.")
|
2011-12-27 18:07:28 +01:00
|
|
|
("output.csv-file",
|
|
|
|
po::value<string>(),
|
2010-03-08 17:36:16 +01:00
|
|
|
"CSV file to use for output (when output.medium = CSV).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("output.udp-host",
|
|
|
|
po::value<string>(),
|
2011-04-05 11:22:28 +02:00
|
|
|
"Host to which the UDP data is sent (when output.medium = UDP).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("output.udp-port",
|
|
|
|
po::value<int>()->default_value(OWL_DEFAULT_RESULT_PORT),
|
2011-04-05 11:22:28 +02:00
|
|
|
"Port on which the UDP data is sent (when output.medium = UDP).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("output.tcpevaal-host",
|
|
|
|
po::value<string>()->default_value(DEFAULT_TCPEVAAL_HOST),
|
2011-07-24 17:25:00 +02:00
|
|
|
"Host to which the TCP data is sent (when output.medium = TCPEvAAL).")
|
2011-12-27 18:07:28 +01:00
|
|
|
("output.tcpevaal-port",
|
|
|
|
po::value<int>()->default_value(DEFAULT_TCPEVAAL_PORT),
|
2011-07-24 17:25:00 +02:00
|
|
|
"Port on which the TCP data is sent (when output.medium = TCPEvAAL).")
|
2010-03-23 14:53:37 +01:00
|
|
|
;
|
2010-03-05 17:24:18 +01:00
|
|
|
|
2010-03-23 14:53:37 +01:00
|
|
|
file_options->add(options) ;
|
2010-02-11 09:46:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-03-29 14:21:14 +02:00
|
|
|
void UserInterface::fill_misc_options()
|
|
|
|
{
|
|
|
|
po::options_description options("Miscellaneous options") ;
|
|
|
|
|
|
|
|
options.add_options()
|
2011-12-27 18:07:28 +01:00
|
|
|
("flush-output-files",
|
|
|
|
po::value<bool>()->default_value(true),
|
2011-03-29 14:21:14 +02:00
|
|
|
"Flush output text files after each line.")
|
|
|
|
;
|
|
|
|
|
|
|
|
file_options->add(options) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-11 09:46:40 +01:00
|
|
|
void UserInterface::parse_options()
|
|
|
|
{
|
|
|
|
parse_command_line() ;
|
2011-08-24 11:41:07 +02:00
|
|
|
print_information() ;
|
|
|
|
if (! owl_run)
|
|
|
|
return ;
|
2010-02-11 09:46:40 +01:00
|
|
|
|
|
|
|
parse_file() ;
|
|
|
|
|
|
|
|
po::notify(Configuration::getw_configuration()) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UserInterface::parse_command_line() const
|
|
|
|
{
|
|
|
|
po::store(po::parse_command_line(cli_argument_count,
|
|
|
|
cli_argument_values,
|
|
|
|
*cli_options),
|
|
|
|
Configuration::getw_configuration()) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-24 11:41:07 +02:00
|
|
|
/**
|
|
|
|
* If information is printed, owl_run is set to false, to indicate that
|
|
|
|
* the program should stop.
|
|
|
|
*/
|
|
|
|
void UserInterface::print_information() const
|
2010-02-11 09:46:40 +01:00
|
|
|
{
|
2011-04-13 00:10:49 +02:00
|
|
|
// Print version if requested
|
|
|
|
if (Configuration::is_configured("version"))
|
|
|
|
{
|
|
|
|
cout
|
2012-02-06 17:17:25 +01:00
|
|
|
<< "This is OwlPS Positioner, part of the Owl"
|
2011-04-13 00:10:49 +02:00
|
|
|
<< " Positioning System project.\nVersion: " <<
|
|
|
|
#ifdef OWLPS_VERSION
|
|
|
|
OWLPS_VERSION
|
|
|
|
#else // OWLPS_VERSION
|
|
|
|
"unknown version"
|
|
|
|
#endif // OWLPS_VERSION
|
|
|
|
<< ".\n" ;
|
2011-08-24 11:41:07 +02:00
|
|
|
owl_run = owl_false ; // Tell main() to exit
|
2011-04-13 00:10:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Print usage if requested
|
2010-02-11 09:46:40 +01:00
|
|
|
if (Configuration::is_configured("help"))
|
|
|
|
{
|
|
|
|
cout << *cli_options ;
|
2011-08-24 11:41:07 +02:00
|
|
|
owl_run = owl_false ; // Tell main() to exit
|
2010-02-11 09:46:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void UserInterface::parse_file() const
|
|
|
|
{
|
2010-03-08 11:38:25 +01:00
|
|
|
string config_file_name = Configuration::string_value("config-file") ;
|
2010-02-11 09:46:40 +01:00
|
|
|
ifstream config_file(config_file_name.c_str()) ;
|
|
|
|
|
|
|
|
if (! config_file)
|
|
|
|
{
|
|
|
|
cerr
|
2012-01-24 18:43:00 +01:00
|
|
|
<< "Warning! Error opening input configuration file \""
|
2010-02-11 09:46:40 +01:00
|
|
|
<< config_file_name
|
2012-01-24 18:43:00 +01:00
|
|
|
<< "\"! Using command line and default values..."
|
2010-02-11 09:46:40 +01:00
|
|
|
<< endl ;
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
|
|
|
po::store(po::parse_config_file(config_file, *file_options),
|
|
|
|
Configuration::getw_configuration()) ;
|
|
|
|
}
|