From 416f852861d2e00be1ca5983ea33271ba4157282 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 15 Apr 2018 10:20:13 +0200 Subject: [PATCH] ATV modulator: Web API: fixed video settings display in the GUI --- plugins/channeltx/modatv/atvmodgui.cpp | 4 ++++ swagger/sdrangel/examples/tx_test.py | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index 107e5832e..eb34ff478 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -744,6 +744,10 @@ void ATVModGUI::displaySettings() ui->overlayText->setText(m_settings.m_overlayText); ui->overlayTextShow->setChecked(m_settings.m_showOverlayText); + ui->playCamera->setChecked(m_settings.m_cameraPlay); + ui->playVideo->setChecked(m_settings.m_videoPlay); + ui->playLoop->setChecked(m_settings.m_videoPlayLoop); + blockApplySettings(false); } diff --git a/swagger/sdrangel/examples/tx_test.py b/swagger/sdrangel/examples/tx_test.py index 3a1e45390..ea317d9ee 100644 --- a/swagger/sdrangel/examples/tx_test.py +++ b/swagger/sdrangel/examples/tx_test.py @@ -28,6 +28,9 @@ def getInputOptions(): parser.add_option("-l", "--log2-interp", dest="log2_interp", help="log2 of interpolation factor", metavar="RATE", type="int") parser.add_option("-A", "--antenna-path", dest="antenna_path", help="antenna path number", metavar="NUMBER", type="int") parser.add_option("-c", "--create", dest="create", help="create a new device set", metavar="CREATE", action="store_true", default=False) + parser.add_option("--ppm", dest="lo_ppm", help="LO correction in ppm", metavar="FILENAME", type="float", default=0) + parser.add_option("--image", dest="image_file", help="image file for ATV modulator (sends image)", metavar="FILENAME", type="string") + parser.add_option("--video", dest="video_file", help="video file for ATV modulator (sends video)", metavar="FILENAME", type="string") (options, args) = parser.parse_args() @@ -127,7 +130,7 @@ def setupDevice(options): settings["limeSdrOutputSettings"]["lpfFIRBW"] = 100000 settings["limeSdrOutputSettings"]["lpfFIREnable"] = 1 elif options.device_hwid == "HackRF": - settings['hackRFOutputSettings']['LOppmTenths'] = -51 + settings['hackRFOutputSettings']['LOppmTenths'] = round(options.lo_ppm*10) settings['hackRFOutputSettings']['centerFrequency'] = options.device_freq*1000 settings['hackRFOutputSettings']['devSampleRate'] = options.sample_rate settings['hackRFOutputSettings']['lnaExt'] = 0 @@ -171,9 +174,19 @@ def setupChannel(options): settings["ATVModSettings"]["inputFrequencyOffset"] = options.channel_freq settings["ATVModSettings"]["rfBandwidth"] = 30000 settings["ATVModSettings"]["forceDecimator"] = 1 # This is to engage filter - settings["ATVModSettings"]["imageFileName"] = "/home/f4exb/sdrangel/lena_4.3.png" + + if options.image_file is not None: + settings["ATVModSettings"]["imageFileName"] = options.image_file + settings["ATVModSettings"]["atvModInput"] = 6 # m_atvModulation + elif options.video_file is not None: + settings["ATVModSettings"]["videoFileName"] = options.video_file + settings["ATVModSettings"]["atvModInput"] = 7 # ATVModInputVideo + settings["ATVModSettings"]["videoPlayLoop"] = 1 + settings["ATVModSettings"]["videoPlay"] = 1 + else: + settings["ATVModSettings"]["atvModInput"] = 1 # ATVModInputHBars + settings["ATVModSettings"]["atvStd"] = 5 # ATVStdHSkip - settings["ATVModSettings"]["atvModInput"] = 6 # ATVModInputImage settings["ATVModSettings"]["atvModulation"] = 1 # ATVModulationFM settings["ATVModSettings"]["fps"] = 2 settings["ATVModSettings"]["nbLines"] = 90