Skip to content

Commit 5eadf0f

Browse files
authored
Fix RST after rig mode change (Tlf#473)
it was logging 599 for SSB
1 parent bf70155 commit 5eadf0f

7 files changed

Lines changed: 28 additions & 21 deletions

File tree

src/change_rst.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ void rst_reset(void) {
8484

8585
/* initialize 'my_rst' and 'his_rst' */
8686
void rst_set_strings() {
87+
if (no_rst) {
88+
return;
89+
}
90+
8791
memcpy(recvd_rst, g_ptr_array_index(rst_recv.array, rst_recv.index), 2);
8892
memcpy(sent_rst, g_ptr_array_index(rst_sent.array, rst_sent.index), 2);
8993
if (trxmode != SSBMODE) {

src/changepars.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "audio.h"
3535
#include "cqww_simulator.h"
3636
#include "changepars.h"
37+
#include "change_rst.h"
3738
#include "clear_display.h"
3839
#include "dxcc.h"
3940
#include "editlog.h"
@@ -107,6 +108,7 @@ static void change_autosend() {
107108
void set_trxmode_internally(int mode) {
108109

109110
trxmode = mode;
111+
rst_set_strings();
110112

111113
if (trxmode == CWMODE) {
112114
if (cwkeyer == MFJ1278_KEYER) {

src/clear_display.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,8 @@ void clear_display(void) {
173173
qsonr_to_str(qsonrstr, qsonum);
174174
mvaddstr(12, 23, qsonrstr);
175175

176-
if (no_rst) {
177-
mvaddstr(12, 44, " ");
178-
mvaddstr(12, 49, " ");
179-
} else {
180-
rst_set_strings();
181-
mvaddstr(12, 44, sent_rst);
182-
mvaddstr(12, 49, recvd_rst);
183-
}
176+
rst_set_strings();
177+
update_line_rst();
184178

185179
if (searchflg)
186180
searchlog();

src/keyer.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "sendbuf.h"
3939
#include "speedupndown.h"
4040
#include "stoptx.h"
41+
#include "time_update.h"
4142
#include "tlf.h"
4243
#include "tlf_panel.h"
4344
#include "ui_utils.h"
@@ -149,9 +150,7 @@ int handle_common_key(int key) {
149150

150151
rst_sent_up();
151152

152-
if (!no_rst)
153-
mvaddstr(12, 44, sent_rst);
154-
mvaddstr(12, 29, current_qso.call);
153+
update_line_rst();
155154

156155
} else { // change cw speed
157156
speedup();
@@ -181,9 +180,7 @@ int handle_common_key(int key) {
181180

182181
rst_sent_down();
183182

184-
if (!no_rst)
185-
mvaddstr(12, 44, sent_rst);
186-
mvaddstr(12, 29, current_qso.call);
183+
update_line_rst();
187184

188185
} else {
189186

src/log_to_disk.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "score.h"
4141
#include "store_qso.h"
4242
#include "setcontest.h"
43+
#include "time_update.h"
4344
#include "tlf_curses.h"
4445
#include "ui_utils.h"
4546
#include "cleanup.h"
@@ -159,13 +160,7 @@ void log_to_disk(int from_lan) {
159160

160161
mvaddstr(12, 23, qsonrstr);
161162

162-
if (no_rst) {
163-
mvaddstr(12, 44, " ");
164-
mvaddstr(12, 49, " ");
165-
} else {
166-
mvaddstr(12, 44, sent_rst);
167-
mvaddstr(12, 49, recvd_rst);
168-
}
163+
update_line_rst();
169164

170165
sync();
171166

src/time_update.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ void update_line(const char *timestr) {
8080
mvaddstr(12, 7, timestr);
8181
}
8282

83+
void update_line_rst() {
84+
85+
attron(COLOR_PAIR(C_WINDOW) | A_STANDOUT);
86+
87+
if (no_rst) {
88+
mvaddstr(12, 44, " ");
89+
mvaddstr(12, 49, " ");
90+
} else {
91+
mvaddstr(12, 44, sent_rst);
92+
mvaddstr(12, 49, recvd_rst);
93+
}
94+
}
95+
8396
const char *FREQ_DISPLAY_FORMAT = " %s: %7.1f";
8497

8598
bool force_show_freq = false;
@@ -128,6 +141,7 @@ void time_update(void) {
128141
if (trxmode != old_trxmode) {
129142
old_trxmode = trxmode;
130143
update_line(time_buf);
144+
update_line_rst();
131145
}
132146

133147
if (force_show_freq) {

src/time_update.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
extern bool force_show_freq;
2727

2828
void update_line(const char *timebuf);
29+
void update_line_rst();
2930
void time_update(void);
3031

3132
#endif /* TIME_UPDATE_H */

0 commit comments

Comments
 (0)