wqMerge branch 'dev' of ssh://192.168.0.2/z1/development/sdrangel into dev

This commit is contained in:
f4exb 2018-03-23 19:28:07 +01:00
commit f387ae884c
5 changed files with 35 additions and 22 deletions

View File

@ -297,7 +297,6 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
ui->setupUi(this); ui->setupUi(this);
ui->screenTV->setColor(true); ui->screenTV->setColor(true);
ui->screenTV->resizeTVScreen(200,200); ui->screenTV->resizeTVScreen(200,200);
ui->screenTV->setRenderImmediate(true);
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));

View File

@ -83,6 +83,7 @@ void ScopeVisXY::feed(const SampleVector::const_iterator& cbegin, const SampleVe
drawGraticule(); drawGraticule();
m_tvScreen->renderImage(0); m_tvScreen->renderImage(0);
m_tvScreen->update();
usleep(5000); usleep(5000);
m_tvScreen->resetImage(m_alphaReset); m_tvScreen->resetImage(m_alphaReset);
m_pixelCount = 0; m_pixelCount = 0;

View File

@ -38,7 +38,6 @@ TVScreen::TVScreen(bool blnColor, QWidget* parent) :
m_blnConfigChanged = false; m_blnConfigChanged = false;
m_blnDataChanged = false; m_blnDataChanged = false;
m_blnGLContextInitialized = false; m_blnGLContextInitialized = false;
m_blnRenderImmediate = false;
//Par défaut //Par défaut
m_intAskedCols = TV_COLS; m_intAskedCols = TV_COLS;
@ -71,10 +70,6 @@ void TVScreen::renderImage(unsigned char * objData)
{ {
m_chrLastData = objData; m_chrLastData = objData;
m_blnDataChanged = true; m_blnDataChanged = true;
if (m_blnRenderImmediate) {
update();
}
} }
void TVScreen::resetImage() void TVScreen::resetImage()

View File

@ -55,7 +55,6 @@ public:
bool selectRow(int intLine); bool selectRow(int intLine);
bool setDataColor(int intCol, int intRed, int intGreen, int intBlue); bool setDataColor(int intCol, int intRed, int intGreen, int intBlue);
bool setDataColor(int intCol, int intRed, int intGreen, int intBlue, int intAlpha); bool setDataColor(int intCol, int intRed, int intGreen, int intBlue, int intAlpha);
void setRenderImmediate(bool blnRenderImmediate) { m_blnRenderImmediate = blnRenderImmediate; }
void setAlphaBlend(bool blnAlphaBlend) { m_objGLShaderArray.setAlphaBlend(blnAlphaBlend); } void setAlphaBlend(bool blnAlphaBlend) { m_objGLShaderArray.setAlphaBlend(blnAlphaBlend); }
void setAlphaReset() { m_objGLShaderArray.setAlphaReset(); } void setAlphaReset() { m_objGLShaderArray.setAlphaReset(); }
@ -80,7 +79,6 @@ private:
QMutex m_objMutex; QMutex m_objMutex;
bool m_blnDataChanged; bool m_blnDataChanged;
bool m_blnConfigChanged; bool m_blnConfigChanged;
bool m_blnRenderImmediate;
GLShaderTVArray m_objGLShaderArray; GLShaderTVArray m_objGLShaderArray;

View File

@ -13,6 +13,7 @@
import requests, json, traceback, sys import requests, json, traceback, sys
from optparse import OptionParser from optparse import OptionParser
import time import time
import datetime
import numpy as np import numpy as np
base_url = "http://127.0.0.1:8091/sdrangel" base_url = "http://127.0.0.1:8091/sdrangel"
@ -64,7 +65,10 @@ def getInputOptions():
parser.add_option("--sq", dest="squelch_db", help="Squelsch threshold in dB", metavar="DECIBEL", type="float", default=-50.0) parser.add_option("--sq", dest="squelch_db", help="Squelsch threshold in dB", metavar="DECIBEL", type="float", default=-50.0)
parser.add_option("--sq-gate", dest="squelch_gate", help="Squelsch gate in ms", metavar="MILLISECONDS", type="int", default=50) parser.add_option("--sq-gate", dest="squelch_gate", help="Squelsch gate in ms", metavar="MILLISECONDS", type="int", default=50)
parser.add_option("--re-run", dest="rerun", help="re run with given parameters without setting up device and channels", metavar="BOOLEAN", action="store_true", default=False) parser.add_option("--re-run", dest="rerun", help="re run with given parameters without setting up device and channels", metavar="BOOLEAN", action="store_true", default=False)
parser.add_option("-x", "--excl-list", dest="excl_fstr", help="frequencies (in Hz) exclusion comma separated list", metavar="LIST", type="string") parser.add_option("-x", "--excl-list", dest="excl_fstr", help="frequencies (in Hz) exclusion comma separated list", metavar="LIST", type="string")
parser.add_option("--excl-tol", dest="excl_tol", help="match tolerance interval (in Hz) for exclusion frequencies", metavar="FREQUENCY", type="float", default=10.0)
parser.add_option("-v", "--verbosity", dest="verbosity", help="verbosity level", metavar="LEVEL_INT", type="int", default = 0)
parser.add_option("-L", "--delay", dest="delay", help="delay in number of settling time periods before resuming scan", metavar="NUMBER", type="int", default = 1)
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
@ -74,13 +78,17 @@ def getInputOptions():
if options.excl_fstr is not None: if options.excl_fstr is not None:
excl_flist_str = options.excl_fstr.split(',') excl_flist_str = options.excl_fstr.split(',')
try: try:
options.excl_flist = list(map(int, excl_flist_str)) options.excl_flist = list(map(lambda x:round(float(x)/options.excl_tol), excl_flist_str))
print(options.excl_flist)
except ValueError: except ValueError:
print("Invalid exclusion frequencies list: %s" % options.excl_fstr) print("Invalid exclusion frequencies list: %s" % options.excl_fstr)
options.excl_flist = [] options.excl_flist = []
else: else:
options.excl_flist = [] options.excl_flist = []
if options.verbosity > 2:
options.verbosity = 2
return options return options
# ====================================================================== # ======================================================================
@ -97,7 +105,7 @@ def setupDevice(scan_control, options):
settings["airspyHFSettings"]["centerFrequency"] = scan_control.device_start_freq settings["airspyHFSettings"]["centerFrequency"] = scan_control.device_start_freq
settings["airspyHFSettings"]["devSampleRateIndex"] = 0 settings["airspyHFSettings"]["devSampleRateIndex"] = 0
settings['airspyHFSettings']['log2Decim'] = options.log2_decim settings['airspyHFSettings']['log2Decim'] = options.log2_decim
settings['airspyHFSettings']['loPpmCorrection'] = int(options.lo_ppm * 10) # in tenths of PPM settings['airspyHFSettings']['LOppmTenths'] = int(options.lo_ppm * 10) # in tenths of PPM
elif options.device_hwid == "LimeSDR": elif options.device_hwid == "LimeSDR":
settings["limeSdrInputSettings"]["antennaPath"] = 0 settings["limeSdrInputSettings"]["antennaPath"] = 0
settings["limeSdrInputSettings"]["devSampleRate"] = scan_control.device_sample_rate settings["limeSdrInputSettings"]["devSampleRate"] = scan_control.device_sample_rate
@ -187,7 +195,7 @@ def setupChannels(scan_control, options):
i += 1 i += 1
# ====================================================================== # ======================================================================
def checkScanning(fc, options): def checkScanning(fc, options, display_message):
reports = callAPI(deviceset_url + "/channels/report", "GET", None, None, "Get channels report") reports = callAPI(deviceset_url + "/channels/report", "GET", None, None, "Get channels report")
if reports is None: if reports is None:
exit(-1) exit(-1)
@ -198,8 +206,10 @@ def checkScanning(fc, options):
if reportKey in channel["report"]: if reportKey in channel["report"]:
if channel["report"][reportKey]["squelch"] == 1: if channel["report"][reportKey]["squelch"] == 1:
f_channel = channel["deltaFrequency"]+fc f_channel = channel["deltaFrequency"]+fc
if round(f_channel) not in options.excl_flist: f_frac = round(f_channel/options.excl_tol)
print("Stopped at %d Hz" % f_channel) if f_frac not in options.excl_flist:
if display_message: # display message only when stopping for the first time
print("%s Stopped at %d Hz" % (datetime.datetime.now().strftime("%H:%M:%S"),f_frac*options.excl_tol))
return False # stop scanning return False # stop scanning
return True # continue scanning return True # continue scanning
@ -293,21 +303,31 @@ def main():
fc = scan_control.device_start_freq fc = scan_control.device_start_freq
global verbosity global verbosity
verbosity = 0 verbosity = options.verbosity
print("Move center to %d Hz" % fc) print("Move center to %d Hz" % fc)
changeDeviceFrequency(fc, options) changeDeviceFrequency(fc, options)
try: try:
scanning = False
resume_delay = 0
while True: while True:
time.sleep(options.settling_time) time.sleep(options.settling_time)
if checkScanning(fc, options): # shall we move on ? scanning = checkScanning(fc, options, scanning and resume_delay == 0) # shall we move on ?
fc += scan_control.device_step_freq if scanning:
if fc > scan_control.device_stop_freq: if resume_delay > 0:
fc = scan_control.device_start_freq resume_delay -= 1
print("New pass") else:
print("Move center to %d Hz" % fc) fc += scan_control.device_step_freq
changeDeviceFrequency(fc, options) if fc > scan_control.device_stop_freq:
fc = scan_control.device_start_freq
if verbosity > 0:
print("New pass")
if verbosity > 0:
print("Move center to %d Hz" % fc)
changeDeviceFrequency(fc, options)
else:
resume_delay = options.delay
except KeyboardInterrupt: except KeyboardInterrupt:
print("Terminated by user") print("Terminated by user")
pass pass