diff --git a/script/blah2.bash b/script/blah2.bash index 09e91d3..34451aa 100755 --- a/script/blah2.bash +++ b/script/blah2.bash @@ -10,6 +10,7 @@ DIFF_TIMESTAMP=$(($CURR_TIMESTAMP-$TIMESTAMP)) if [[ "$FIRST_CHAR" != "{" ]] || [[ $DIFF_TIMESTAMP -gt 60 ]]; then docker compose -f /opt/blah2/docker-compose.yml down + kill -9 $(pgrep -f "sdrplay_apiService") systemctl restart sdrplay.service docker compose -f /opt/blah2/docker-compose.yml up -d echo "Successfully restarted blah2" diff --git a/src/capture/rspduo/RspDuo.cpp b/src/capture/rspduo/RspDuo.cpp index 9b6551a..57cc029 100644 --- a/src/capture/rspduo/RspDuo.cpp +++ b/src/capture/rspduo/RspDuo.cpp @@ -13,7 +13,6 @@ // class static constants const double RspDuo::MAX_FREQUENCY_NR = 2000000000; -const uint8_t RspDuo::DEF_DECIMATION_NR = 1; const int RspDuo::DEF_AGC_BANDWIDTH_NR = 50; // default agc bandwidth const int RspDuo::MIN_AGC_SET_POINT_NR = -72; // min agc set point const int RspDuo::DEF_AGC_SET_POINT_NR = -60; // default agc set point @@ -51,7 +50,35 @@ RspDuo::RspDuo(std::string _type, uint32_t _fc, uint32_t _fs, std::string _path, bool *_saveIq) : Source(_type, _fc, _fs, _path, _saveIq) { - nDecimation = DEF_DECIMATION_NR; + if (fs == 2000000) + { + nDecimation = 1; + } + else if (fs == 1000000) + { + nDecimation = 2; + } + else if (fs == 500000) + { + nDecimation = 4; + } + else if (fs == 250000) + { + nDecimation = 8; + } + else if (fs == 125000) + { + nDecimation = 16; + } + else if (fs == 62500) + { + nDecimation = 32; + } + else + { + std::cout << "Error: RspDuo can only have decimation 1, 2, 4, 8, 16, 32"; + exit(1); + } usb_bulk_fg = false; agc_bandwidth_nr = DEF_AGC_BANDWIDTH_NR; agc_set_point_nr = DEF_AGC_SET_POINT_NR; diff --git a/src/capture/rspduo/RspDuo.h b/src/capture/rspduo/RspDuo.h index 204dbfc..164e601 100644 --- a/src/capture/rspduo/RspDuo.h +++ b/src/capture/rspduo/RspDuo.h @@ -50,8 +50,6 @@ private: /// @brief Maximum frequency (Hz). static const double MAX_FREQUENCY_NR; - /// @brief Default decimation. - static const uint8_t DEF_DECIMATION_NR; /// @brief Default AGC bandwidth. static const int DEF_AGC_BANDWIDTH_NR; /// @brief Minimum AGC set point.