1 /*
2  * Tlf - contest logging program for amateur radio operators
3  * Copyright (C) 2015 Ervin Hegedus <airween@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19 
20 
21 #ifndef QTCVARS_H
22 #define QTCVARS_H
23 
24 #include "globalvars.h"
25 
26 #define QTC_SENT_LOG	"QTC_sent.log"
27 #define QTC_RECV_LOG	"QTC_recv.log"
28 #define QTC_META_LOG	"QTC_meta.log"
29 
30 #define QTC_LINES 10
31 #define QTC_RY_LINE_NR 12
32 
33 #define RECV 1		// QTC RECV direction
34 #define SEND 2		// QTC SEND direction
35 #define QTC_CAP 4	// QTC CAPABLE station
36 #define QTC_LATER 8	// QTC LATER
37 #define QTC_NO 16	// NO QTC for/from this station
38 
39 #define QTC_CALL_SIZE 15
40 
41 typedef struct {
42     int qsoline;	// qsos[INDEX]
43     int flag;	// flag to mark for send
44     int saved;	// indicates QTC has saved
45     int sent;	// indicates QTC has sent at least once
46     char qtc[25]; // QTC line by concatenated fields
47     char senttime[16];  // sent time: YY-Mon-dd HH:MM\0
48 } t_qtcline;
49 
50 typedef struct {
51     int serial;	// qtc serial
52     int count;	// nr of qtc line in block
53     int marked;	// nr of marked to send
54     int totalsent; // nr of sent qtc's
55     char callsign[QTC_CALL_SIZE];  // current callsign; helps to detect if QSO has dropped
56     t_qtcline qtclines[QTC_LINES];
57 } t_qtclist;
58 
59 typedef struct {
60     int status;	// received, failed, nothing
61     char time[5];	// time of qso
62     char callsign[QTC_CALL_SIZE]; // callsign
63     char serial[5]; // qso serial
64     int confirmed; // qtc had confirmed
65     char receivedtime[16]; // received time: YY-Mon-dd HH:MM\0
66 } t_qtcrecline;
67 
68 typedef struct {
69     int serial;
70     int count;
71     int confirmed;
72     int sentcfmall;
73     char callsign[QTC_CALL_SIZE];
74     t_qtcrecline qtclines[QTC_LINES];
75 } t_qtcreclist;
76 
77 typedef struct {
78     char content[50];
79     int attr;		// meta attr: 0 => not nopied, 1 => copied
80 } t_qtc_ry_line;
81 
82 extern int next_qtc_qso;		// the next non-sent QSO, which can
83 					// be send next as QTC
84 extern int qsoflags_for_qtc[MAX_QSOS];	// array of flag to log lines of QSOs
85 					// for QTC's;  this is an array of
86 					// flags, which marks when a QSO
87 					// sent as QTC
88 extern int qtcdirection;		// 1: RECV, 2: SEND, 3: BOTH
89 extern t_qtclist qtclist;		// the QTC list to send
90 extern t_qtcreclist qtcreclist;		// the QTC list which received
91 extern int nr_qtcsent;			// number of sent QTC blocks; this used
92 					// at the QTC header, eg. 23/10 - here the 23
93 					// is the value of this variable
94 extern t_qtc_ry_line qtc_ry_lines[QTC_RY_LINE_NR];	// when QTC is set,
95 					// and mode is RTTY, then the modem
96 					// lines stored this array
97 extern int qtc_ry_currline;		// current line of QTC RTTY modem
98 extern int qtc_ry_capture;		// enable or disable QTC RTTY capturing
99 extern int qtc_ry_copied;		// stores the number of copied lines i
100 					// from QTC RTTY terminal to QTC window
101 
102 extern int qtcrec_record;		// do we record the received QTCs
103 extern char qtcrec_record_command[2][50]; 	// command to start recording
104 extern char qtcrec_record_command_shutdown[50]; // coomand to stop recording
105 
106 /* arras of CW/Digimode messages for QTC receive and send */
107 extern char qtc_recv_msgs[12][80];
108 extern char qtc_send_msgs[12][80];
109 /* arras of SSB fiel names for QTC receive and send */
110 extern char qtc_phrecv_message[14][80];
111 extern char qtc_phsend_message[14][80];
112 
113 extern char qtc_cap_calls[40];
114 extern int qtc_auto_filltime;		// set QTC auto filltime; when DX sent first
115 					// QTC line, the first two digits will be copied to others
116 extern int qtc_recv_lazy;		// ignore check of received QTC lines
117 #endif /* end of include guard: QTCVARS_H */
118