kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Notch
* Added xcvr notch filter adjust from waterfall
- Meta-Left-Click sets notch
- Meta-Right-Click clears notch
- Meta key is Windows key
pull/2/head
rodzic
d1defa3f68
commit
bd1445041d
|
|
@ -1022,8 +1022,8 @@ void remove_windows()
|
|||
|
||||
void cb_wMain(Fl_Widget*, void*)
|
||||
{
|
||||
bool ret = false;
|
||||
#ifdef __APPLE__
|
||||
bool ret = false;
|
||||
if (((Fl::event_state() & FL_COMMAND) == FL_COMMAND) && (Fl::event_key() == 'q'))
|
||||
ret = clean_exit(true);
|
||||
else
|
||||
|
|
@ -6431,4 +6431,13 @@ void set_rtty_bw(float bw)
|
|||
sldrRTTYbandwidth->do_callback();
|
||||
}
|
||||
|
||||
int notch_frequency = 0;
|
||||
void notch_on(int freq)
|
||||
{
|
||||
notch_frequency = freq;
|
||||
}
|
||||
|
||||
void notch_off()
|
||||
{
|
||||
notch_frequency = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,6 +306,11 @@ extern void sync_cw_parameters();
|
|||
|
||||
extern void open_recv_folder(const char *fname);
|
||||
|
||||
// set notch parameter on flrig
|
||||
extern int notch_frequency;
|
||||
extern void notch_on(int);
|
||||
extern void notch_off();
|
||||
|
||||
// thread terminators
|
||||
extern void ADIF_RW_close(void);
|
||||
extern void EQSL_close(void);
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ public:
|
|||
void movetocenter();
|
||||
void carrier(int cf);
|
||||
int carrier();
|
||||
inline void makeNotch_(int notch_frequency);
|
||||
inline void makeMarker_(int width, const RGB* color, int freq, const RGB* clrMin, RGB* clrM, const RGB* clrMax);
|
||||
void makeMarker();
|
||||
void process_analog(double *sig, int len);
|
||||
|
|
@ -221,6 +222,7 @@ private:
|
|||
RGB *markerimage;
|
||||
RGB RGBmarker;
|
||||
RGB RGBcursor;
|
||||
RGBI RGBInotch;
|
||||
double *fftout;
|
||||
double *fftwindow;
|
||||
uchar *scaleimage;
|
||||
|
|
|
|||
|
|
@ -1633,6 +1633,41 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class Rig_get_notch : public xmlrpc_c::method
|
||||
{
|
||||
public:
|
||||
Rig_get_notch()
|
||||
{
|
||||
_signature = "s:n";
|
||||
_help = "Reports a notch filter frequency based on WF action";
|
||||
}
|
||||
void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval)
|
||||
{
|
||||
*retval = xmlrpc_c::value_int(notch_frequency);
|
||||
}
|
||||
};
|
||||
|
||||
class Rig_set_notch : public xmlrpc_c::method
|
||||
{
|
||||
public:
|
||||
Rig_set_notch()
|
||||
{
|
||||
_signature = "n:i";
|
||||
_help = "Sets the notch filter position on WF";
|
||||
}
|
||||
static void set_notch(int freq)
|
||||
{
|
||||
notch_frequency = freq;
|
||||
}
|
||||
void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval)
|
||||
{
|
||||
XMLRPC_LOCK;
|
||||
int notch = notch_frequency;
|
||||
REQ(set_notch, params.getInt(0));
|
||||
*retval = xmlrpc_c::value_int(notch);
|
||||
}
|
||||
};
|
||||
|
||||
static int rig_control_counter;
|
||||
|
||||
static void set_rig_control(bool xmlrpc)
|
||||
|
|
@ -2736,6 +2771,8 @@ struct Wefax_send_file : public xmlrpc_c::method
|
|||
ELEM_(Rig_set_bandwidth, "rig.set_bandwidth") \
|
||||
ELEM_(Rig_get_bandwidth, "rig.get_bandwidth") \
|
||||
ELEM_(Rig_get_bandwidths, "rig.get_bandwidths") \
|
||||
ELEM_(Rig_get_notch, "rig.get_notch") \
|
||||
ELEM_(Rig_set_notch, "rig.set_notch") \
|
||||
ELEM_(Rig_take_control, "rig.take_control") \
|
||||
ELEM_(Rig_release_control, "rig.release_control") \
|
||||
\
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ static RGB RGByellow = {254,254,0};
|
|||
//static RGB RGBdkgreen = {0,128,0};
|
||||
//static RGB RGBblue = {0,0,255};
|
||||
static RGB RGBred = {254,0,0};
|
||||
//static RGB RGBwhite = {254,254,254};
|
||||
static RGB RGBwhite = {254,254,254};
|
||||
//static RGB RGBblack = {0,0,0};
|
||||
//static RGB RGBmagenta = {196,0,196};
|
||||
//static RGB RGBblack = {0,0,0};
|
||||
|
|
@ -152,6 +152,10 @@ WFdisp::WFdisp (int x0, int y0, int w0, int h0, char *lbl) :
|
|||
bandwidth = 32;
|
||||
RGBmarker = RGBred;
|
||||
RGBcursor = RGByellow;
|
||||
RGBInotch.I = 0;
|
||||
RGBInotch.R = RGBwhite.R;
|
||||
RGBInotch.G = RGBwhite.G;
|
||||
RGBInotch.B = RGBwhite.B;
|
||||
mode = WATERFALL;
|
||||
centercarrier = false;
|
||||
overload = false;
|
||||
|
|
@ -781,7 +785,6 @@ void WFdisp::drawMarker() {
|
|||
step * RGBsize, RGBwidth);
|
||||
}
|
||||
|
||||
|
||||
void WFdisp::update_waterfall() {
|
||||
// transfer the fft history data into the WF image
|
||||
short int *p1, *p2;
|
||||
|
|
@ -880,6 +883,18 @@ void WFdisp::update_waterfall() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// draw notch
|
||||
if ((notch_frequency > 1) && (notch_frequency < progdefaults.HighFreqCutoff - 1)) {
|
||||
RGBI *notch = fft_img + (notch_frequency - offset) / step;
|
||||
int dash = 0;
|
||||
for (int y = 0; y < image_height; y++) {
|
||||
dash = (dash + 1) % 6;
|
||||
if (dash == 0 || dash == 1 || dash == 2)
|
||||
*(notch-1) = *notch = *(notch+1) = RGBInotch;
|
||||
notch += disp_width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WFdisp::drawcolorWF() {
|
||||
|
|
@ -1029,6 +1044,18 @@ void WFdisp::drawspectrum() {
|
|||
}
|
||||
}
|
||||
|
||||
// draw notch
|
||||
if ((notch_frequency > 1) && (notch_frequency < progdefaults.HighFreqCutoff - 1)) {
|
||||
uchar *notch = pixmap + (notch_frequency - offset) / step;
|
||||
int dash = 0;
|
||||
for (int y = 0; y < image_height; y++) {
|
||||
dash = (dash + 1) % 6;
|
||||
if (dash == 0 || dash == 1 || dash == 2)
|
||||
*(notch-1) = *notch = *(notch+1) = 255;
|
||||
notch += IMAGE_WIDTH/step;
|
||||
}
|
||||
}
|
||||
|
||||
fl_color(FL_BLACK);
|
||||
fl_rectf(x(), y(), w(), WFSCALE + WFMARKER + WFTEXT + image_height);
|
||||
|
||||
|
|
@ -1054,7 +1081,7 @@ void WFdisp::draw() {
|
|||
checkWidth();
|
||||
switch (mode) {
|
||||
case SPECTRUM :
|
||||
drawspectrum();
|
||||
drawspectrum();
|
||||
drawMarker();
|
||||
break;
|
||||
case SCOPE :
|
||||
|
|
@ -1062,10 +1089,10 @@ void WFdisp::draw() {
|
|||
break;
|
||||
case WATERFALL :
|
||||
default:
|
||||
if (dispcolor)
|
||||
drawcolorWF();
|
||||
else
|
||||
drawgrayWF();
|
||||
if (dispcolor)
|
||||
drawcolorWF();
|
||||
else
|
||||
drawgrayWF();
|
||||
drawMarker();
|
||||
}
|
||||
}
|
||||
|
|
@ -1859,6 +1886,13 @@ int WFdisp::handle(int event)
|
|||
}
|
||||
goto lrclick;
|
||||
case FL_LEFT_MOUSE:
|
||||
if ((Fl::event_state() & (FL_ALT | FL_CTRL)) == (FL_ALT | FL_CTRL)) {
|
||||
if (notch_frequency)
|
||||
notch_off();
|
||||
else
|
||||
notch_on(cursorFreq(xpos));
|
||||
return 1;
|
||||
}
|
||||
if (event == FL_PUSH) {
|
||||
push = ypos;
|
||||
pxpos = xpos;
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue