File: decoderWids.h

package info (click to toggle)
twpsk 2.1-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 944 kB
  • ctags: 1,477
  • sloc: cpp: 9,057; makefile: 187; sh: 4
file content (161 lines) | stat: -rw-r--r-- 3,473 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/* twpsk:  PSK31 for Linux with a Lesstif interface
 * Copyright (C) 1999 Ted Williams WA0EIR 
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 * USA.
 *
 * Version: 2.1 - Aug 2002
 */

#ifndef SECQSOWIDS_H
#define SECQSOWIDS_H

#include "GUI.h"
#include "twpskScope.h"

class DecoderWid {
   private:
      int i;
      int rxScrollFlag;
      int hasfocus;
      Arg args[30];
      char str[64];
      Scope dscope;
      float curfreq;
      int ch;

      Widget dialogShell;
      Widget   mainForm;
      Widget     rxTextSW;
      Widget       rxScrollBar;
      Widget       rxText;
      Widget   bottomForm;
      Widget     scopeDA;
      Widget   rxFreqCombo;
      Widget   pbForm;
      Widget      swapBtn, closeBtn;
      Widget AFCwid, DCDwid, QPSKwid;
      Widget modeForm;
      Widget clrRxPopup;
      XmString xs[5];


 public:

   void setCh (int c)
   {
      ch = c;
   }

   int getCh ()
   {
      return ch;
   }

   void setFreqFocus(int v)
   {
      hasfocus=v;
   }

   Widget getRxText ()
   {
      return rxText;
   }

   void setRxScrollFlag(int f)
   {
      rxScrollFlag = f;
   }

   int getRxScrollFlag ()
   {
      return (rxScrollFlag);
   }

   Boolean getQPSK()
   {
      Boolean value;
      XtVaGetValues(QPSKwid, XmNset, &value, NULL);
      return value;
   }

   void setQPSK(Boolean value)
   {
      XtVaSetValues(QPSKwid, XmNset, value, NULL);
   }

   int getAFC()
   {
      int value;
      XtVaGetValues(AFCwid, XmNset, &value, NULL);
      return value;
   }

   void setAFC(Boolean value)
   {
      XtVaSetValues(AFCwid, XmNset, value, NULL);
   }

   /* unused */
   void setControls(Boolean QPSK, int LSB, int AFC)
   {
      setQPSK(QPSK);
      //setLSB(LSB);
      setAFC(AFC);
   }


   void setFreq(float freq)
   {
      curfreq = freq;
      //fprintf(stderr,"dw: set: %f\n",freq);
      sprintf(str, "%4.1f", freq);
      XmTextFieldSetString (rxfreqwid, str);
      commControl(commChannel, COMM_FREQ, (int)(freq*100));
      }

   float getFreq()
   {
      String str;
      XtVaGetValues (rxfreqwid, XmNvalue, &str, NULL);  /* Get the freq */
      float f = atof(str);                        /* convert to a float */
      //fprintf(stderr,"dw: get: %f\n",f);
      return f;
   }

   DecoderWid()
   {
      visible=0;
      hasfocus=0;
   }

   Widget rxfreqwid, rxUpArrow, rxDownArrow;
   int visible;
   int commChannel;
   static Widget shell;
   void move(int x, int y);
   Scope& getScope() { return dscope; };
   Widget getTextWid() { return rxText; };
   Widget getMainWid() { return dialogShell; };
   Widget getSwapBtn() { return swapBtn; }
   void buildWidgets(Widget shell, AppRes *appRes, int chan);
   void updateDisplay(float freq, int DCD, int IMD);
};


#define MAX_DECODERS 3
extern DecoderWid decoderWids[MAX_DECODERS];

#endif