1 // ----------------------------------------------------------------------------
2 // norig.cxx
3 //
4 // Copyright (C) 2016
5 //		Dave Freese, W1HKJ
6 //
7 // This file is part of fldigi.
8 //
9 // Fldigi is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // Fldigi is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with fldigi.  If not, see <http://www.gnu.org/licenses/>.
21 // ----------------------------------------------------------------------------
22 
23 #include <config.h>
24 
25 #include <ctime>
26 #include <sys/time.h>
27 #include <iostream>
28 #include <list>
29 #include <vector>
30 #include <string>
31 
32 #ifdef RIGCATTEST
33 	#include "rigCAT.h"
34 #else
35 	#include "fl_digi.h"
36 	#include "misc.h"
37 	#include "configuration.h"
38 #endif
39 
40 #include "rigsupport.h"
41 #include "rigxml.h"
42 #include "trx.h"
43 #include "serial.h"
44 #include "rigio.h"
45 #include "debug.h"
46 #include "threads.h"
47 #include "qrunner.h"
48 #include "confdialog.h"
49 #include "status.h"
50 
51 //----------------------------------------------------------------------
52 // functions used when no xcvr control is in use
53 //----------------------------------------------------------------------
54 
noCAT_getfreq()55 long long noCAT_getfreq() {
56 	return progStatus.noCATfreq;
57 }
58 
noCAT_setfreq(long long f)59 void noCAT_setfreq(long long f)
60 {
61 	progStatus.noCATfreq = f;
62 	wf->rfcarrier(f);
63 }
64 
noCAT_getmode()65 std::string noCAT_getmode()
66 {
67 	return progStatus.noCATmode;
68 }
69 
noCAT_setmode(const std::string & md)70 void noCAT_setmode(const std::string &md)
71 {
72 	progStatus.noCATmode = md;
73 	if (ModeIsLSB(md))
74 		wf->USB(false);
75 	else
76 		wf->USB(true);
77 }
78 
noCAT_getwidth()79 std::string noCAT_getwidth()
80 {
81 	return progStatus.noCATwidth;
82 }
83 
noCAT_setwidth(const std::string & w)84 void noCAT_setwidth(const std::string &w)
85 {
86 	progStatus.noCATwidth = w;
87 	show_bw(w);
88 }
89 
noCAT_setPTT(bool val)90 void noCAT_setPTT(bool val)
91 {
92 	rigio.SetPTT(val); // always execute the h/w ptt if enabled
93 }
94 
noCAT_init()95 void noCAT_init()
96 {
97 	qso_setFreq(progStatus.noCATfreq);
98 	wf->rfcarrier(progStatus.noCATfreq);
99 	init_NoRig_RigDialog();
100 
101 	qso_opMODE->value(progStatus.noCATmode.c_str());
102 
103 	chkUSEHAMLIB->value(0);
104 	chkUSEHAMLIB->redraw();
105 	btnInitHAMLIB->labelcolor(FL_BLACK);
106 	btnInitHAMLIB->redraw_label();
107 
108 	chkUSERIGCAT->value(0);
109 	chkUSERIGCAT->redraw();
110 	btnInitRIGCAT->labelcolor(FL_BLACK);
111 	btnInitRIGCAT->redraw_label();
112 
113 	return;
114 }
115 
116