Skip to content
Snippets Groups Projects
Commit abe644a5 authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Fixed indentation

parent c3ca509c
No related branches found
No related tags found
No related merge requests found
...@@ -30,16 +30,11 @@ void launchSpectrometer(std::string const &output_type, key_t input_key, std::st ...@@ -30,16 +30,11 @@ void launchSpectrometer(std::string const &output_type, key_t input_key, std::st
{ {
MultiLog log("edd::GatedSpectrometer"); MultiLog log("edd::GatedSpectrometer");
DadaClientBase client(input_key, log); DadaClientBase client(input_key, log);
//client.cuda_register_memory();
std::size_t buffer_bytes = client.data_buffer_size(); std::size_t buffer_bytes = client.data_buffer_size();
std::cout << "Running with output_type: " << output_type << std::endl; std::cout << "Running with output_type: " << output_type << std::endl;
if (output_type == "file") if (output_type == "file")
{ {
SimpleFileWriter sink(filename); SimpleFileWriter sink(filename);
effelsberg::edd::GatedSpectrometer<decltype(sink), T> spectrometer( effelsberg::edd::GatedSpectrometer<decltype(sink), T> spectrometer(
buffer_bytes, nSideChannels, selectedSideChannel, selectedBit, buffer_bytes, nSideChannels, selectedSideChannel, selectedBit,
...@@ -64,11 +59,10 @@ void launchSpectrometer(std::string const &output_type, key_t input_key, std::st ...@@ -64,11 +59,10 @@ void launchSpectrometer(std::string const &output_type, key_t input_key, std::st
{ {
throw std::runtime_error("Unknown oputput-type"); throw std::runtime_error("Unknown oputput-type");
} }
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
try { try {
key_t input_key; key_t input_key;
...@@ -88,6 +82,7 @@ int main(int argc, char **argv) { ...@@ -88,6 +82,7 @@ int main(int argc, char **argv) {
std::string filename(buffer); std::string filename(buffer);
std::string output_type = "file"; std::string output_type = "file";
unsigned int output_bit_depth; unsigned int output_bit_depth;
/** Define and parse the program options /** Define and parse the program options
*/ */
namespace po = boost::program_options; namespace po = boost::program_options;
...@@ -189,32 +184,23 @@ int main(int argc, char **argv) { ...@@ -189,32 +184,23 @@ int main(int argc, char **argv) {
return ERROR_IN_COMMAND_LINE; return ERROR_IN_COMMAND_LINE;
} }
/**
* All the application code goes here
*/
if (output_bit_depth == 8) if (output_bit_depth == 8)
{ {
launchSpectrometer<int8_t>(output_type, input_key, filename, nSideChannels, selectedSideChannel, selectedBit, speadHeapSize, launchSpectrometer<int8_t>(output_type, input_key, filename,
fft_length, naccumulate, nSideChannels, selectedSideChannel, selectedBit, speadHeapSize,
nbits, input_level, output_level); fft_length, naccumulate, nbits, input_level, output_level);
} }
else if (output_bit_depth == 32) else if (output_bit_depth == 32)
{ {
launchSpectrometer<float>(output_type, input_key, filename, nSideChannels, selectedSideChannel, selectedBit, speadHeapSize, launchSpectrometer<float>(output_type, input_key, filename,
fft_length, naccumulate, nSideChannels, selectedSideChannel, selectedBit, speadHeapSize,
nbits, input_level, output_level); fft_length, naccumulate, nbits, input_level, output_level);
} }
else else
{ {
throw po::validation_error(po::validation_error::invalid_option_value, "Output bit depth must be 8 or 32"); throw po::validation_error(po::validation_error::invalid_option_value, "Output bit depth must be 8 or 32");
} }
/**
* End of application code
*/
} catch (std::exception &e) { } catch (std::exception &e) {
std::cerr << "Unhandled Exception reached the top of main: " << e.what() std::cerr << "Unhandled Exception reached the top of main: " << e.what()
<< ", application will now exit" << std::endl; << ", application will now exit" << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment