Added call to Abort_ARQ when double ESC pressed (panic)
  Added supporting code in modem class.
pull/2/head
David Freese 2010-09-02 20:23:49 -05:00
rodzic 6b78f2fc05
commit 7b483df0a1
7 zmienionych plików z 35 dodań i 19 usunięć

Wyświetl plik

@ -135,6 +135,8 @@
#include "speak.h"
#include "flmisc.h"
#include "arq_io.h"
using namespace std;
bool bWF_only = false;
@ -5157,9 +5159,11 @@ void abort_tx()
if (trx_state == STATE_TUNE) {
btnTune->value(0);
btnTune->do_callback();
return;
}
else if (trx_state == STATE_TX)
if (trx_state == STATE_TX) {
trx_start_modem(active_modem);
}
}
void qsy(long long rfc, int fmid)

Wyświetl plik

@ -120,6 +120,7 @@ public:
void videoText();
void set_stopflag(bool b) { stopflag = b;};
bool get_stopflag() { return stopflag; };
unsigned get_cap(void) { return cap; }
enum { CAP_AFC = 1 << 0, CAP_AFC_SR = 1 << 1, CAP_REV = 1 << 2,

Wyświetl plik

@ -385,7 +385,7 @@ bool WRAP_auto_arqRx()
ifstream autofile(sAutoFile.c_str());
if(autofile) {
arqtext = "";
txstring.clear();
time(&start_time);
while (!autofile.eof()) {
memset(mailline,0,1000);
@ -404,7 +404,7 @@ bool WRAP_auto_arqRx()
std::remove (sAutoFile.c_str());
if (!txstring.empty()) {
arqtext.append("\n....start\n");
arqtext = "\n....start\n";
arqtext.append(txstring);
arqtext.append("\n......end\n");
pText = 0;
@ -709,15 +709,18 @@ void arq_close(void)
char arq_get_char()
{
char c = 0x03;
char c = 0;
pthread_mutex_lock (&arq_mutex);
if (!arqtext.empty() && (pText != arqtext.length())) {
c = arqtext[pText++];
} else {
arqtext.clear();
pText = 0;
bSend0x06 = true;
arq_text_available = false;
if (arq_text_available) {
if (pText != arqtext.length())
c = arqtext[pText++];
else {
arqtext.clear();
pText = 0;
bSend0x06 = true;
arq_text_available = false;
c = 0x03;
}
}
pthread_mutex_unlock (&arq_mutex);
return c;

Wyświetl plik

@ -274,6 +274,7 @@ void mt63::restart()
if (err)
fprintf(stderr, "mt63_rxinit: init failed\n");
InpLevel->Preset(64.0, 0.75);
stopflag = false;
}
void mt63::init()

Wyświetl plik

@ -152,6 +152,7 @@ void modem::init()
#endif
} else
set_freq(wf->Carrier());
stopflag = false;
}
void modem::set_freq(double freq)

Wyświetl plik

@ -1108,12 +1108,12 @@ void xmtrcv_cb(Fl_Widget *w, void *vi)
btnTune->do_callback();
}
else {
active_modem->set_stopflag(true);
TransmitText->clear();
if (arq_text_available)
AbortARQ();
if (progStatus.timer)
progStatus.timer = 0;
active_modem->set_stopflag(true);
}
}
restoreFocus();

Wyświetl plik

@ -64,6 +64,7 @@
#include "logsupport.h"
#include "status.h"
#include "gettext.h"
#include "arq_io.h"
#include "debug.h"
@ -833,15 +834,20 @@ int FTextTX::handle_key(int key)
static time_t t[2] = { 0, 0 };
static unsigned char i = 0;
if (t[i] == time(&t[!i])) { // two presses in a second: abort transmission
menu_cb(TX_MENU_ABORT);
if (trx_state == STATE_TX)
menu_cb(TX_MENU_ABORT);
t[i = !i] = 0;
return 1;
}
i = !i;
}
clear();
active_modem->set_stopflag(true);
stopMacroTimer();
if (trx_state == STATE_TX && active_modem->get_stopflag() == false) {
clear();
if (arq_text_available)
AbortARQ();
active_modem->set_stopflag(true);
stopMacroTimer();
}
return 1;
case 't': // transmit for C-t
if (trx_state == STATE_RX && Fl::event_state() & FL_CTRL) {
@ -1045,9 +1051,9 @@ void FTextTX::menu_cb(size_t item)
start_tx();
break;
case TX_MENU_ABORT:
#ifndef NDEBUG
put_status("Don't panic!", 1.0);
#endif
char panic[200];
snprintf(panic, sizeof(panic), "*** Don't panic *** %s", progdefaults.myName.c_str());
put_status(panic, 5.0);
abort_tx();
break;
case TX_MENU_RX: