Commit a5dbeb18 authored by Jenda's avatar Jenda

scanner sorter

parent 8805b304
......@@ -2,7 +2,7 @@
freq=100000
floor=0.2
sql=0.3
cron=* 22 * * *
cron=* 23 * * *
cronlen=60
randscan=no
stickactivity=True
......@@ -11,10 +11,10 @@ stickactivity=True
freq=99700
bw=64
continue=30
pipe=/home/jenda/tmp/kukuruku/client/modes/wfm.py -r 0.44
;pipe=/home/jenda/tmp/kukuruku/client/modes/wfm.py -r 0.44
[Channel2]
freq=99300
bw=64
continue=30
pipe=/home/jenda/tmp/kukuruku/client/modes/wfm.py -r 0.44
;pipe=/home/jenda/tmp/kukuruku/client/modes/wfm.py -r 0.44
......@@ -57,7 +57,6 @@ def usage():
ppm = 0
device = ""
rate = 2048000
confdir = None
try:
......@@ -81,15 +80,16 @@ for opt, arg in opts:
if not confdir:
usage()
(fd_r,fd_w) = os.pipe()
sdr = top_block(device, rate, 0, 10, fd_w)
l = util.logger()
l.setloglevel("DBG")
(fd_r,fd_w) = os.pipe()
scanner = KukurukuScanner.scanner(l, confdir)
sdr = top_block(device, scanner.conf.rate, 0, 10, fd_w)
file_r = os.fdopen(fd_r, "rb")
t = threading.Thread(target=scanner.work, args = (sdr,file_r))
......
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import subprocess
import time
from ConfReader import ConfReader, read_modes
conf = ConfReader(os.getenv('HOME') + '/.kukuruku/gui')
modes = read_modes(os.getenv('HOME') + '/.kukuruku/modes')
archdir = "archive"
if not os.path.isdir(archdir):
os.mkdir(archdir)
filenames = os.listdir(".")
for filename in filenames:
if filename[-6:] != ".cfile":
continue
p = filename.split("-")
if len(p) != 8:
continue
p2 = p[7].split(".")
rate = float(p2[0])
while True:
print("Filename: %s | bandwidth %ik"%(filename, rate/1000))
for i in range(0, len(modes)):
print("%i) demod with %s"%(i, modes[modes.keys()[i]].name))
print("d_) delete")
print("a_) archive")
print("_n) ignore once")
print("_s) ignore by sorter")
print("_h) ignore by scanner")
c = raw_input('Choice: __ [optional comment]')
if c.isdigit():
modename = modes.keys()[int(c)]
resample = float(rate) / modes[modename].rate
if rate != modes[modename].rate and not modes[modename].resample:
print("Channel samplerate %i must be an integer multiple of module samplerate %i!"%(samplerate, modes[mode].rate))
continue
program = modes[modename].program.replace("_MODEPATH_", conf.modepath)
if rate != modes[modename].rate:
print("resample ratio = %f"%resample)
program += " -r %f"%resample
process = subprocess.Popen(["cat " + filename + " | " + program], shell=True)
elif len(c) >= 2:
if c[0] == "d":
os.remove(filename)
elif c[0] == "a":
os.remane(filename, archdir + "/" + filename)
if c[1] == "s":
pass
elif c[1] == "h":
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment