mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-30 20:40:20 -04:00 
			
		
		
		
	LimeSDR support: ready
This commit is contained in:
		
							parent
							
								
									05f7065515
								
							
						
					
					
						commit
						7d61557204
					
				| @ -243,6 +243,12 @@ int LimeSDRInput::getLPIndex(float lpfBW) const | |||||||
|     return (int) ((lpfBW - range.min) / range.step); |     return (int) ((lpfBW - range.min) / range.step); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | float LimeSDRInput::getLPValue(int index) const | ||||||
|  | { | ||||||
|  |     lms_range_t range = m_deviceShared.m_deviceParams->m_lpfRangeRx; | ||||||
|  |     return range.min + index * range.step; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| uint32_t LimeSDRInput::getHWLog2Decim() const | uint32_t LimeSDRInput::getHWLog2Decim() const | ||||||
| { | { | ||||||
|     return m_deviceShared.m_deviceParams->m_log2OvSRRx; |     return m_deviceShared.m_deviceParams->m_log2OvSRRx; | ||||||
| @ -262,9 +268,9 @@ bool LimeSDRInput::handleMessage(const Message& message) | |||||||
| 
 | 
 | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|     else if (MsgSetReferenceLimeSDR::match(message)) |     else if (MsgSetReferenceConfig::match(message)) | ||||||
|     { |     { | ||||||
|         MsgSetReferenceLimeSDR& conf = (MsgSetReferenceLimeSDR&) message; |         MsgSetReferenceConfig& conf = (MsgSetReferenceConfig&) message; | ||||||
|         qDebug() << "LimeSDRInput::handleMessage: MsgSetReferenceLimeSDR"; |         qDebug() << "LimeSDRInput::handleMessage: MsgSetReferenceLimeSDR"; | ||||||
|         m_settings = conf.getSettings(); |         m_settings = conf.getSettings(); | ||||||
|         return true; |         return true; | ||||||
|  | |||||||
| @ -51,21 +51,21 @@ public: | |||||||
|         { } |         { } | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     class MsgSetReferenceLimeSDR : public Message { |     class MsgSetReferenceConfig : public Message { | ||||||
|         MESSAGE_CLASS_DECLARATION |         MESSAGE_CLASS_DECLARATION | ||||||
| 
 | 
 | ||||||
|     public: |     public: | ||||||
|         const LimeSDRInputSettings& getSettings() const { return m_settings; } |         const LimeSDRInputSettings& getSettings() const { return m_settings; } | ||||||
| 
 | 
 | ||||||
|         static MsgSetReferenceLimeSDR* create(const LimeSDRInputSettings& settings) |         static MsgSetReferenceConfig* create(const LimeSDRInputSettings& settings) | ||||||
|         { |         { | ||||||
|             return new MsgSetReferenceLimeSDR(settings); |             return new MsgSetReferenceConfig(settings); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|     private: |     private: | ||||||
|         LimeSDRInputSettings m_settings; |         LimeSDRInputSettings m_settings; | ||||||
| 
 | 
 | ||||||
|         MsgSetReferenceLimeSDR(const LimeSDRInputSettings& settings) : |         MsgSetReferenceConfig(const LimeSDRInputSettings& settings) : | ||||||
|             Message(), |             Message(), | ||||||
|             m_settings(settings) |             m_settings(settings) | ||||||
|         { } |         { } | ||||||
| @ -114,6 +114,7 @@ public: | |||||||
|     void getSRRange(float& minF, float& maxF, float& stepF) const; |     void getSRRange(float& minF, float& maxF, float& stepF) const; | ||||||
|     void getLPRange(float& minF, float& maxF, float& stepF) const; |     void getLPRange(float& minF, float& maxF, float& stepF) const; | ||||||
|     int getLPIndex(float lpfBW) const; |     int getLPIndex(float lpfBW) const; | ||||||
|  |     float getLPValue(int index) const; | ||||||
|     uint32_t getHWLog2Decim() const; |     uint32_t getHWLog2Decim() const; | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|  | |||||||
| @ -174,7 +174,7 @@ void LimeSDRInputGUI::handleMessagesToGUI() | |||||||
|             displaySettings(); |             displaySettings(); | ||||||
|             blockApplySettings(false); |             blockApplySettings(false); | ||||||
| 
 | 
 | ||||||
|             LimeSDRInput::MsgSetReferenceLimeSDR* message = LimeSDRInput::MsgSetReferenceLimeSDR::create(m_settings); |             LimeSDRInput::MsgSetReferenceConfig* message = LimeSDRInput::MsgSetReferenceConfig::create(m_settings); | ||||||
|             m_sampleSource->getInputMessageQueue()->push(message); |             m_sampleSource->getInputMessageQueue()->push(message); | ||||||
| 
 | 
 | ||||||
|             delete message; |             delete message; | ||||||
| @ -263,60 +263,94 @@ void LimeSDRInputGUI::blockApplySettings(bool block) | |||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_startStop_toggled(bool checked) | void LimeSDRInputGUI::on_startStop_toggled(bool checked) | ||||||
| { | { | ||||||
| 
 |     if (checked) | ||||||
|  |     { | ||||||
|  |         if (m_deviceAPI->initAcquisition()) | ||||||
|  |         { | ||||||
|  |             m_deviceAPI->startAcquisition(); | ||||||
|  |             DSPEngine::instance()->startAudioOutput(); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |         m_deviceAPI->stopAcquisition(); | ||||||
|  |         DSPEngine::instance()->stopAudioOutput(); | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_record_toggled(bool checked) | void LimeSDRInputGUI::on_record_toggled(bool checked) | ||||||
| { | { | ||||||
| 
 |     if (checked) | ||||||
|  |     { | ||||||
|  |         ui->record->setStyleSheet("QToolButton { background-color : red; }"); | ||||||
|  |         m_fileSink->startRecording(); | ||||||
|  |     } | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |         ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); | ||||||
|  |         m_fileSink->stopRecording(); | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_centerFrequency_changed(quint64 value) | void LimeSDRInputGUI::on_centerFrequency_changed(quint64 value) | ||||||
| { | { | ||||||
| 
 |     m_settings.m_centerFrequency = value * 1000; | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_dcOffset_toggled(bool checked) | void LimeSDRInputGUI::on_dcOffset_toggled(bool checked) | ||||||
| { | { | ||||||
| 
 |     m_settings.m_dcBlock = checked; | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_iqImbalance_toggled(bool checked) | void LimeSDRInputGUI::on_iqImbalance_toggled(bool checked) | ||||||
| { | { | ||||||
| 
 |     m_settings.m_iqCorrection = checked; | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_sampleRate_changed(quint64 value) | void LimeSDRInputGUI::on_sampleRate_changed(quint64 value) | ||||||
| { | { | ||||||
| 
 |     m_settings.m_devSampleRate = value; | ||||||
| } |     sendSettings();} | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index) | void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index) | ||||||
| { | { | ||||||
| 
 |     if ((index <0) || (index > 5)) | ||||||
|  |         return; | ||||||
|  |     m_settings.m_log2HardDecim = index; | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_swDecim_currentIndexChanged(int index) | void LimeSDRInputGUI::on_swDecim_currentIndexChanged(int index) | ||||||
| { | { | ||||||
| 
 |     if ((index <0) || (index > 5)) | ||||||
|  |         return; | ||||||
|  |     m_settings.m_log2SoftDecim = index; | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_lpf_valueChanged(int value) | void LimeSDRInputGUI::on_lpf_valueChanged(int value) | ||||||
| { | { | ||||||
| 
 |     m_settings.m_lpfBW = m_limeSDRInput->getLPValue(value); | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_lpFIREnable_toggled(bool checked) | void LimeSDRInputGUI::on_lpFIREnable_toggled(bool checked) | ||||||
| { | { | ||||||
| 
 |     m_settings.m_lpfFIREnable = checked; | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_lpFIR_changed(quint64 value) | void LimeSDRInputGUI::on_lpFIR_changed(quint64 value) | ||||||
| { | { | ||||||
| 
 |     m_settings.m_lpfFIRBW = value; | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LimeSDRInputGUI::on_gain_valueChanged(int value) | void LimeSDRInputGUI::on_gain_valueChanged(int value) | ||||||
| { | { | ||||||
| 
 |     m_settings.m_gain = value; | ||||||
|  |     sendSettings(); | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user