Skip to content

Commit

Permalink
New options to run application
Browse files Browse the repository at this point in the history
  • Loading branch information
marprz committed Sep 18, 2015
1 parent fffa6fc commit 324b3a2
Showing 1 changed file with 30 additions and 11 deletions.
41 changes: 30 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
#include <iostream>
#include <unistd.h>
#include <string>

#include "Reader.h"

void processSignalData();
void processSignalData( std::string, std::string, std::string );

int main( int argc, char* argv[] )
{
Stations mStations;
Reader reader;
bool test = false;
int c = getopt( argc, argv, "d:" );
switch( c ){
case 'd':
reader.loadFromDirectory( optarg );
processSignalData();
break;
default:
std::cout << "Missing path to the directory! Use parameter -d." << std::endl;
return -1;
std::string statInput = "";//beacon222.sat";
std::string statOutput = "output";//stats222.txt";
std::string dir;
int c;
bool isDirectoryKnown = false;
while( ( c = getopt( argc, argv, "d:i:o:" ) ) != -1 )
{
switch( c ){
case 'i':
statInput = std::string( optarg );
std::cout << "Selected input: " << statInput << std::endl;
break;
case 'o':
statOutput = std::string( optarg );
std::cout << "Selected output: " << statOutput << std::endl;
break;
case 'd':
isDirectoryKnown = true;
reader.loadFromDirectory( optarg );
dir = std::string( optarg );
processSignalData( statInput, statOutput, dir ); //.substr(dir.length()-16, 14 ) );
break;
default:
std::cout << "Missing path to the directory! Use parameter -d." << std::endl;
return -1;
}
}
if( !isDirectoryKnown )
std::cout << "Directory with .gsd files unknown!" << std::endl;
return 0;
}

0 comments on commit 324b3a2

Please sign in to comment.