diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-11-11 22:01:36 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-11-11 22:01:36 +0100 |
commit | 5bf73ca209108e2ce8f3919d453050d957212779 (patch) | |
tree | 8db7f8c9372e2d80caca1ed5dc38626433118876 /pointcloud.cpp | |
parent | 134a1d2029bfc9a93903fdf8ff9ac3adde87f0a5 (diff) | |
download | odr-dpd-5bf73ca209108e2ce8f3919d453050d957212779.tar.gz odr-dpd-5bf73ca209108e2ce8f3919d453050d957212779.tar.bz2 odr-dpd-5bf73ca209108e2ce8f3919d453050d957212779.zip |
Fix correlation, add keys for usrp gain
Diffstat (limited to 'pointcloud.cpp')
-rw-r--r-- | pointcloud.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/pointcloud.cpp b/pointcloud.cpp index 417c31c..7c92d16 100644 --- a/pointcloud.cpp +++ b/pointcloud.cpp @@ -96,9 +96,10 @@ void PointCloud::push_samples(std::pair<std::vector<complexf>, std::vector<compl double arg_tx = std::arg(tx[i]); // Phase is colour - p.r = p.g = p.b = 255; + p.r = p.b = 255; + p.g = 64; if (arg_rx > arg_tx) { - int corr = 255 - 10 * (arg_rx - arg_tx); + int corr = 255 - 20 * (arg_rx - arg_tx); if (corr < 0) { corr = 0; @@ -107,7 +108,7 @@ void PointCloud::push_samples(std::pair<std::vector<complexf>, std::vector<compl p.r = corr; } else { - int corr = 255 - 10 * (arg_tx - arg_rx); + int corr = 255 - 20 * (arg_tx - arg_rx); if (corr < 0) { corr = 0; @@ -124,7 +125,7 @@ void PointCloud::push_samples(std::pair<std::vector<complexf>, std::vector<compl } } -void PointCloud::handle_event() +std::string PointCloud::handle_event() { SDL_Event event; while (SDL_PollEvent(&event)) @@ -133,8 +134,14 @@ void PointCloud::handle_event() case SDL_QUIT: throw sdl_quit(); break; + case SDL_KEYDOWN: + std::string key(SDL_GetKeyName(event.key.keysym.sym)); + return key; + break; } } + + return std::string(); } void PointCloud::draw() |