Skip to content

Commit

Permalink
fixed dxcluster spot life and minimum s-meter set to S0, also added a…
Browse files Browse the repository at this point in the history
… white vline for beacons
  • Loading branch information
mcogoni committed Feb 15, 2022
1 parent ae0a6f5 commit 2c2a9ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion supersdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@
if math.fabs(rssi_last)>math.fabs(rssi_smooth):
rssi_smooth -= 1.5 if kiwi_snd.radio_mode=="CW" else 0.5 # s-meter decay rate
else:
rssi_smooth = (rssi_last+rssi_smooth)/2 # attack rate
rssi_smooth = (rssi_smooth + rssi_last)/2 # attack rate

if fl.s_meter_show_flag:
smeter_surface = disp.s_meter_draw(rssi_smooth, kiwi_snd.thresh)
Expand Down
16 changes: 9 additions & 7 deletions utils_supersdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def bytearray2str(b):
from mod_pywebsocket.stream import StreamOptions
from mod_pywebsocket._stream_base import ConnectionTerminatedException

VERSION = "v3.0beta"
VERSION = "v3.1"

TENMHZ = 10000 # frequency threshold for auto mode (USB/LSB) switch
CW_PITCH = 0.6 # CW offset from carrier in kHz
Expand Down Expand Up @@ -205,7 +205,7 @@ def connect(self):
connected = True
# self.sock.settimeout(0.1)
self.send(self.mycall)
self.time_to_live = 1200 # seconds for a spot to live
self.time_to_live = self.SPOT_TTL_BASETIME*5 # seconds for a spot to live
self.last_update = datetime.utcnow()
self.last_cleanup = datetime.utcnow()

Expand Down Expand Up @@ -1141,7 +1141,7 @@ def update_textsurfaces(self, surface_, radio_mode, rssi, mouse, wf_width, kiwi_
if not fl.s_meter_show_flag:
s_value = (kiwi_snd.rssi+120)//6 # signal in S units of 6dB
if s_value<=9:
s_value = "S"+str(int(s_value))
s_value = "S"+str(max(0,int(s_value)))
else:
s_value = "S9+"+str(int((s_value-9)*6))+"dB"
ts_dict["smeter"] = (GREEN, s_value, (20,self.V_POS_TEXT), "big", False)
Expand Down Expand Up @@ -1353,10 +1353,11 @@ def _coords_from_angle(angle, s_meter_radius_):
def plot_spectrum(self, sdrdisplay, kiwi_wf, t_avg=15, col=YELLOW, filled=False):
spectrum_surf = pygame.Surface((kiwi_wf.WF_BINS, self.SPECTRUM_HEIGHT))
pixarr = pygame.PixelArray(spectrum_surf)
wf_dyn_range = kiwi_wf.wf_max_db-kiwi_wf.wf_min_db
min_wf_10 = int(kiwi_wf.wf_min_db/10)*10
max_wf_10 = int(kiwi_wf.wf_max_db/10)*10
subdiv_list = [self.SPECTRUM_HEIGHT-1-int((v-kiwi_wf.wf_min_db)/wf_dyn_range * self.SPECTRUM_HEIGHT) for v in range(min_wf_10, max_wf_10, 10)]
if not kiwi_wf.wf_auto_scaling:
wf_dyn_range = kiwi_wf.wf_max_db-kiwi_wf.wf_min_db
min_wf_10 = int(kiwi_wf.wf_min_db/10)*10
max_wf_10 = int(kiwi_wf.wf_max_db/10)*10
subdiv_list = [self.SPECTRUM_HEIGHT-1-int((v-kiwi_wf.wf_min_db)/wf_dyn_range * self.SPECTRUM_HEIGHT) for v in range(min_wf_10, max_wf_10, 10)]

for x, v in enumerate(np.nanmean(kiwi_wf.wf_data.T[:,:t_avg], axis=1)):
y = self.SPECTRUM_HEIGHT-1-int(v/255 * self.SPECTRUM_HEIGHT)
Expand Down Expand Up @@ -1456,6 +1457,7 @@ def plot_beacons(self, surface_, beacon_project, kiwi_wf):
if x>fontsize*str_len/2 and x<self.DISPLAY_WIDTH-10:
old_fbin = f_bin
render_(surface_, ((x*kiwi_wf.BINS2PIXEL_RATIO-str_len*fontsize/2-10), y), ts[1], rotation=0, fgcolor=ts[0], bgcolor=(20,20,20))
pygame.draw.line(surface_, WHITE, (f_bin*kiwi_wf.BINS2PIXEL_RATIO, self.TUNEBAR_Y), (f_bin*kiwi_wf.BINS2PIXEL_RATIO, y), 1)


def splash_screen(self, sdrdisplay):
Expand Down

0 comments on commit 2c2a9ba

Please sign in to comment.