mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 13:00:26 -04:00 
			
		
		
		
	Fix #1559. Update protocol before calling setAzimuthElevation
This commit is contained in:
		
							parent
							
								
									5bfd42ab80
								
							
						
					
					
						commit
						a4beb0e0d5
					
				| @ -139,6 +139,13 @@ void GS232ControllerWorker::applySettings(const GS232ControllerSettings& setting | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     // Must update m_settings before calling setAzimuthElevation, so m_settings.m_protocol is correct
 | ||||||
|  |     if (force) { | ||||||
|  |         m_settings = settings; | ||||||
|  |     } else { | ||||||
|  |         m_settings.applySettings(settingsKeys, settings); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     if (m_device != nullptr) |     if (m_device != nullptr) | ||||||
|     { |     { | ||||||
|         // Apply offset then clamp
 |         // Apply offset then clamp
 | ||||||
| @ -159,12 +166,6 @@ void GS232ControllerWorker::applySettings(const GS232ControllerSettings& setting | |||||||
|             setAzimuth(azimuth); |             setAzimuth(azimuth); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
|     if (force) { |  | ||||||
|         m_settings = settings; |  | ||||||
|     } else { |  | ||||||
|         m_settings.applySettings(settingsKeys, settings); |  | ||||||
|     } |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| QIODevice *GS232ControllerWorker::openSerialPort(const GS232ControllerSettings& settings) | QIODevice *GS232ControllerWorker::openSerialPort(const GS232ControllerSettings& settings) | ||||||
| @ -271,7 +272,9 @@ void GS232ControllerWorker::setAzimuthElevation(float azimuth, float elevation) | |||||||
|             qDebug() << "GS232ControllerWorker::setAzimuthElevation: Not sent, waiting for status reply"; |             qDebug() << "GS232ControllerWorker::setAzimuthElevation: Not sent, waiting for status reply"; | ||||||
|             m_spidSetOutstanding = true; |             m_spidSetOutstanding = true; | ||||||
|         } |         } | ||||||
|     } else { |     } | ||||||
|  |     else | ||||||
|  |     { | ||||||
|         QString cmd = QString("P %1 %2\n").arg(azimuth).arg(elevation); |         QString cmd = QString("P %1 %2\n").arg(azimuth).arg(elevation); | ||||||
|         QByteArray data = cmd.toLatin1(); |         QByteArray data = cmd.toLatin1(); | ||||||
|         m_device->write(data); |         m_device->write(data); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user