mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 21:20:31 -05:00 
			
		
		
		
	Airspy input: implemeted WEB API (2)
This commit is contained in:
		
							parent
							
								
									3203a5511d
								
							
						
					
					
						commit
						83c0935e41
					
				@ -1681,6 +1681,21 @@ bool WebAPIRequestMapper::validateDeviceSettings(
 | 
				
			|||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    else if ((*deviceHwType == "Airspy") && (deviceSettings.getTx() == 0))
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (jsonObject.contains("airspySettings") && jsonObject["airspySettings"].isObject())
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            QJsonObject airspySettingsJsonObject = jsonObject["airspySettings"].toObject();
 | 
				
			||||||
 | 
					            deviceSettingsKeys = airspySettingsJsonObject.keys();
 | 
				
			||||||
 | 
					            deviceSettings.setAirspySettings(new SWGSDRangel::SWGAirspySettings());
 | 
				
			||||||
 | 
					            deviceSettings.getAirspySettings()->fromJsonObject(airspySettingsJsonObject);
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    else if ((*deviceHwType == "AirspyHF") && (deviceSettings.getTx() == 0))
 | 
					    else if ((*deviceHwType == "AirspyHF") && (deviceSettings.getTx() == 0))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (jsonObject.contains("airspyHFSettings") && jsonObject["airspyHFSettings"].isObject())
 | 
					        if (jsonObject.contains("airspyHFSettings") && jsonObject["airspyHFSettings"].isObject())
 | 
				
			||||||
 | 
				
			|||||||
@ -97,7 +97,19 @@ def setupDevice(deviceset_url, options):
 | 
				
			|||||||
        if settings is None:
 | 
					        if settings is None:
 | 
				
			||||||
            exit(-1)
 | 
					            exit(-1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if options.device_hwid == "AirspyHF":
 | 
					        if options.device_hwid == "Airspy":
 | 
				
			||||||
 | 
					            settings["airspySettings"]["centerFrequency"] = options.device_freq*1000
 | 
				
			||||||
 | 
					            settings["airspySettings"]["devSampleRateIndex"] = 1
 | 
				
			||||||
 | 
					            settings['airspySettings']['log2Decim'] = options.log2_decim
 | 
				
			||||||
 | 
					            settings['airspySettings']['fcPos'] = options.fc_pos
 | 
				
			||||||
 | 
					            settings['airspySettings']['dcBlock'] = options.fc_pos == 2
 | 
				
			||||||
 | 
					            settings['airspySettings']['iqImbalance'] = options.fc_pos == 2
 | 
				
			||||||
 | 
					            settings['airspySettings']['lnaGain'] = 14
 | 
				
			||||||
 | 
					            settings['airspySettings']['mixerGain'] = 15
 | 
				
			||||||
 | 
					            settings['airspySettings']['vgaGain'] = 4
 | 
				
			||||||
 | 
					            settings['airspySettings']['lnaAGC'] = 1
 | 
				
			||||||
 | 
					            settings['airspySettings']['mixerAGC'] = 1
 | 
				
			||||||
 | 
					        elif options.device_hwid == "AirspyHF":
 | 
				
			||||||
            if options.device_freq > 30000:
 | 
					            if options.device_freq > 30000:
 | 
				
			||||||
                settings["airspyHFSettings"]["bandIndex"] = 1
 | 
					                settings["airspyHFSettings"]["bandIndex"] = 1
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user