able to send data to eigerbe

tweaks on logging

added configuration_map, to flexibly pass options to the different receivers

some more fixes to method overloads

still very preliminary
This commit is contained in:
2014-09-17 15:56:27 +02:00
parent cfacc6ad6e
commit b427452f39
12 changed files with 352 additions and 117 deletions

View File

@ -5,19 +5,23 @@
#include <stdio.h>
#include <fstream>
#include <map>
#include "utilities.h"
using namespace std;
int read_config_file(string fname, int *tcpip_port_no){
int read_config_file(string fname, int *tcpip_port_no, map<string, string> * configuration_map ){
ifstream infile;
string sLine,sargname;
string sLine,sargname, sargvalue;
int iline = 0;
int success = slsReceiverDefs::OK;
infile.open(fname.c_str(), ios_base::in);
if (infile.is_open()) {
while(infile.good()){
@ -26,21 +30,25 @@ int read_config_file(string fname, int *tcpip_port_no){
//VERBOSE_PRINT(sLine);
if(sLine.find('#')!=string::npos){
//VERBOSE_PRINT( "Line is a comment ");
if(sLine.find('#') != string::npos)
continue;
}
else if(sLine.length()<2){
//VERBOSE_PRINT("Empty line ");
else if(sLine.length()<2)
continue;
}
else{
istringstream sstr(sLine);
//parameter name
if(sstr.good())
if(sstr.good()){
sstr >> sargname;
if (! sstr.good())
continue;
sstr >> sargvalue;
(*configuration_map)[sargname] = sargvalue;
}
//tcp port
if(sargname=="rx_tcpport"){
if(sstr.good()) {