mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-27 11:00:31 -04:00 
			
		
		
		
	LimeSDR input: handle NCO for self
This commit is contained in:
		
							parent
							
								
									4534695bab
								
							
						
					
					
						commit
						35f51bcdb2
					
				| @ -666,6 +666,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc | ||||
|                     m_settings.m_ncoFrequency)) | ||||
|             { | ||||
|                 doCalibration = true; | ||||
|                 forwardChangeOwnDSP = true; | ||||
|                 qDebug("LimeSDRInput::applySettings: %sd and set NCO to %d Hz", | ||||
|                         m_settings.m_ncoEnable ? "enable" : "disable", | ||||
|                         m_settings.m_ncoFrequency); | ||||
| @ -802,9 +803,10 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc | ||||
|         const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies(); | ||||
|         std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin(); | ||||
|         int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim); | ||||
|         int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0; | ||||
| 
 | ||||
|         // send to self first
 | ||||
|         DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency); | ||||
|         DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency + ncoShift); | ||||
|         m_deviceAPI->getDeviceInputMessageQueue()->push(notif); | ||||
| 
 | ||||
|         // send to source buddies
 | ||||
| @ -841,9 +843,10 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc | ||||
|         const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies(); | ||||
|         std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin(); | ||||
|         int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim); | ||||
|         int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0; | ||||
| 
 | ||||
|         // send to self first
 | ||||
|         DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency); | ||||
|         DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency + ncoShift); | ||||
|         m_deviceAPI->getDeviceInputMessageQueue()->push(notif); | ||||
| 
 | ||||
|         // send to source buddies
 | ||||
| @ -863,7 +866,8 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc | ||||
|         qDebug("LimeSDRInput::applySettings: forward change to self only"); | ||||
| 
 | ||||
|         int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim); | ||||
|         DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency); | ||||
|         int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0; | ||||
|         DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency + ncoShift); | ||||
|         m_deviceAPI->getDeviceInputMessageQueue()->push(notif); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -250,6 +250,11 @@ void LimeSDRInputGUI::displaySettings() | ||||
|     ui->gain->setValue(m_settings.m_gain); | ||||
|     ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain)); | ||||
| 
 | ||||
|     setNCODisplay(); | ||||
| } | ||||
| 
 | ||||
| void LimeSDRInputGUI::setNCODisplay() | ||||
| { | ||||
|     int ncoHalfRange = (m_settings.m_devSampleRate * (1<<(m_settings.m_log2HardDecim)))/2; | ||||
|     ui->ncoFrequency->setValueRange(7, | ||||
|             (m_settings.m_centerFrequency - ncoHalfRange)/1000, | ||||
| @ -353,6 +358,7 @@ void LimeSDRInputGUI::on_record_toggled(bool checked) | ||||
| void LimeSDRInputGUI::on_centerFrequency_changed(quint64 value) | ||||
| { | ||||
|     m_settings.m_centerFrequency = value * 1000; | ||||
|     setNCODisplay(); | ||||
|     sendSettings(); | ||||
| } | ||||
| 
 | ||||
| @ -391,6 +397,7 @@ void LimeSDRInputGUI::on_iqImbalance_toggled(bool checked) | ||||
| void LimeSDRInputGUI::on_sampleRate_changed(quint64 value) | ||||
| { | ||||
|     m_settings.m_devSampleRate = value; | ||||
|     setNCODisplay(); | ||||
|     sendSettings();} | ||||
| 
 | ||||
| void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index) | ||||
| @ -398,6 +405,7 @@ void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index) | ||||
|     if ((index <0) || (index > 5)) | ||||
|         return; | ||||
|     m_settings.m_log2HardDecim = index; | ||||
|     setNCODisplay(); | ||||
|     sendSettings(); | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -64,6 +64,7 @@ private: | ||||
|     int m_statusCounter; | ||||
| 
 | ||||
|     void displaySettings(); | ||||
|     void setNCODisplay(); | ||||
|     void sendSettings(); | ||||
|     void updateSampleRateAndFrequency(); | ||||
|     void blockApplySettings(bool block); | ||||
|  | ||||
| @ -147,7 +147,7 @@ | ||||
|         <enum>Qt::StrongFocus</enum> | ||||
|        </property> | ||||
|        <property name="toolTip"> | ||||
|         <string>Tuner center frequency in kHz</string> | ||||
|         <string>Main center frequency in kHz</string> | ||||
|        </property> | ||||
|       </widget> | ||||
|      </item> | ||||
| @ -326,6 +326,9 @@ | ||||
|          <height>16777215</height> | ||||
|         </size> | ||||
|        </property> | ||||
|        <property name="toolTip"> | ||||
|         <string>TSP hardware decimation factor</string> | ||||
|        </property> | ||||
|        <property name="currentIndex"> | ||||
|         <number>2</number> | ||||
|        </property> | ||||
| @ -380,7 +383,7 @@ | ||||
|         </size> | ||||
|        </property> | ||||
|        <property name="toolTip"> | ||||
|         <string>Decimation factor</string> | ||||
|         <string>Software decimation factor</string> | ||||
|        </property> | ||||
|        <property name="currentIndex"> | ||||
|         <number>0</number> | ||||
| @ -463,6 +466,9 @@ | ||||
|          <pointsize>12</pointsize> | ||||
|         </font> | ||||
|        </property> | ||||
|        <property name="toolTip"> | ||||
|         <string>Device to host sample rate</string> | ||||
|        </property> | ||||
|       </widget> | ||||
|      </item> | ||||
|      <item> | ||||
| @ -517,7 +523,7 @@ | ||||
|         </font> | ||||
|        </property> | ||||
|        <property name="toolTip"> | ||||
|         <string>Analog lowpass filers bandwidth (kHz)</string> | ||||
|         <string>Analog lowpass filer bandwidth (kHz)</string> | ||||
|        </property> | ||||
|       </widget> | ||||
|      </item> | ||||
| @ -544,7 +550,7 @@ | ||||
|      <item> | ||||
|       <widget class="ButtonSwitch" name="lpFIREnable"> | ||||
|        <property name="toolTip"> | ||||
|         <string>Enable or disable the digital FIR lowpass filters</string> | ||||
|         <string>Enable or disable TSP digital FIR lowpass filters</string> | ||||
|        </property> | ||||
|        <property name="text"> | ||||
|         <string>FIR</string> | ||||
| @ -672,6 +678,9 @@ | ||||
|          <height>24</height> | ||||
|         </size> | ||||
|        </property> | ||||
|        <property name="toolTip"> | ||||
|         <string>Green when stream is reporting data</string> | ||||
|        </property> | ||||
|        <property name="text"> | ||||
|         <string/> | ||||
|        </property> | ||||
| @ -779,7 +788,7 @@ | ||||
|         </font> | ||||
|        </property> | ||||
|        <property name="toolTip"> | ||||
|         <string>FIFO status</string> | ||||
|         <string>FIFO fill status</string> | ||||
|        </property> | ||||
|        <property name="styleSheet"> | ||||
|         <string notr="true">QProgressBar{border: 2px solid rgb(79, 79, 79); text-align: center;} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user