From 2c2a9ba0569ca199a034fe9fdf1046370b788dca Mon Sep 17 00:00:00 2001 From: Marco Cogoni Date: Tue, 15 Feb 2022 14:47:38 +0100 Subject: [PATCH] fixed dxcluster spot life and minimum s-meter set to S0, also added a white vline for beacons --- supersdr.py | 2 +- utils_supersdr.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/supersdr.py b/supersdr.py index d976664..b0aa35f 100755 --- a/supersdr.py +++ b/supersdr.py @@ -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) diff --git a/utils_supersdr.py b/utils_supersdr.py index 4276a75..7ee2677 100644 --- a/utils_supersdr.py +++ b/utils_supersdr.py @@ -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 @@ -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() @@ -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) @@ -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) @@ -1456,6 +1457,7 @@ def plot_beacons(self, surface_, beacon_project, kiwi_wf): if x>fontsize*str_len/2 and x