From: Nate B. <n0...@us...> - 2012-06-28 23:12:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 334e845d4f0c36e5176412eb4804d09275f750c6 (commit) via cd1f0cbb5f3ab3d9ecbbdab8855e9b35cad1008e (commit) from 531d45192fd40b93460d0ece438f03d686c1791e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 334e845d4f0c36e5176412eb4804d09275f750c6 Author: Nate Bargmann <n0...@n0...> Date: Fri Jun 15 18:31:35 2012 -0500 Test for PB width < 0, normal PB, or +- limits Use the absolute value of any negative value that may be passed in via the width parameter to set_mode. If RIG_PASSBAND_NORMAL is passed in, call rig_passband_normal() to determine the normal width for the mode before setting the bandwidth. The width parameter is tested against wide and narrow filter values and set to the returned values as upper and lower limits if width falls out of those bounds. (cherry picked from commit bb6c6493e18082e74d358e210ec12e09a8b33ea3) diff --git a/kenwood/k3.c b/kenwood/k3.c index d56bdb5..68894c8 100644 --- a/kenwood/k3.c +++ b/kenwood/k3.c @@ -93,7 +93,7 @@ const struct rig_caps k3_caps = { .rig_model = RIG_MODEL_K3, .model_name = "K3/KX3", .mfg_name = "Elecraft", - .version = "20111122", + .version = "20120615", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -161,6 +161,7 @@ const struct rig_caps k3_caps = { }, /* mode/filter list, remember: order matters! */ + /* Values are arbitrary based on common K3 filter options. */ .filters = { {RIG_MODE_SSB, kHz(2.7)}, {RIG_MODE_SSB, kHz(2.8)}, @@ -367,6 +368,21 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) * width string value must be padded with leading '0' to equal four * characters. */ + + /* passband widths vary by mode so gather lower and upper limits */ + pbwidth_t pb_nar = rig_passband_narrow(rig, mode); + pbwidth_t pb_wid = rig_passband_wide(rig, mode); + + if (width < 0) + width = labs(width); + + if (width == RIG_PASSBAND_NORMAL) + width = rig_passband_normal(rig, mode); + else if (width < pb_nar) + width = pb_nar; + else if (width > pb_wid) + width = pb_wid; + sprintf(cmd_s, "BW%04ld", width / 10); err = kenwood_simple_cmd(rig, cmd_s); if (err != RIG_OK) commit cd1f0cbb5f3ab3d9ecbbdab8855e9b35cad1008e Author: Nate Bargmann <n0...@n0...> Date: Fri Jun 15 18:30:57 2012 -0500 Test for passband width < 0 or normal passband Use the absolute value of any negative value that may be passed in via the width parameter to set_mode. If RIG_PASSBAND_NORMAL is passed in, call rig_passband_normal() to determine the normal width for the mode before selecting the correct filter (needs testing). (cherry picked from commit 94ea3ced4c8d736ebc3205e3b055156386fc2f3c) diff --git a/kenwood/k2.c b/kenwood/k2.c index 0f39567..f24b212 100644 --- a/kenwood/k2.c +++ b/kenwood/k2.c @@ -104,7 +104,7 @@ const struct rig_caps k2_caps = { .rig_model = RIG_MODEL_K2, .model_name = "K2", .mfg_name = "Elecraft", - .version = "20110603", + .version = "20120615", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -298,11 +298,17 @@ int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return -RIG_EINVAL; } + if (width < 0) + width = labs(width); + /* Step through the filter list looking for the best match * for the passed in width. The choice is to select the filter * that is wide enough for the width without being too narrow * if possible. */ + if (width == RIG_PASSBAND_NORMAL) + width = rig_passband_normal(rig, mode); + if (width > flt->filt_list[0].width || ((flt->filt_list[0].width >= width) && (width > flt->filt_list[1].width))) { width = flt->filt_list[0].width; ----------------------------------------------------------------------- Summary of changes: kenwood/k2.c | 8 +++++++- kenwood/k3.c | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |