[hamradio-commits] [chirp] 03/19: Imported Upstream version 0.3.1
Iain R. Learmonth
irl at moszumanska.debian.org
Sun Nov 1 16:02:42 UTC 2015
This is an automated email from the git hooks/post-receive script.
irl pushed a commit to branch master
in repository chirp.
commit 717fcf5fd76d3c672c609f336c80a675a548c4c6
Author: Bdale Garbee <bdale at gag.com>
Date: Wed Aug 7 22:37:45 2013 -0600
Imported Upstream version 0.3.1
---
PKG-INFO | 2 +-
chirp/__init__.py | 2 +-
chirp/ft817.py | 2 +-
chirp/import_logic.py | 16 ++++++++++------
chirp/platform.py | 10 +++++++++-
chirp/thd72.py | 7 +++++--
chirp/vx6.py | 6 ++++--
chirp/vx8.py | 1 +
chirpui/clone.py | 4 ++--
chirpui/mainapp.py | 6 +++++-
chirpui/memedit.py | 45 +++++++++++++++++++++++++++++++++++----------
chirpui/shiftdialog.py | 7 ++++---
12 files changed, 78 insertions(+), 30 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 96f5a6d..be04fdb 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: chirp
-Version: 0.3.0
+Version: 0.3.1
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
diff --git a/chirp/__init__.py b/chirp/__init__.py
index 8bd6d99..645552e 100644
--- a/chirp/__init__.py
+++ b/chirp/__init__.py
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-CHIRP_VERSION="0.3.0"
+CHIRP_VERSION="0.3.1"
import os
import sys
diff --git a/chirp/ft817.py b/chirp/ft817.py
index 0fb3502..7f877e9 100644
--- a/chirp/ft817.py
+++ b/chirp/ft817.py
@@ -1115,7 +1115,7 @@ class FT817NDUSRadio(FT817Radio):
def get_settings(self):
top = FT817Radio.get_settings(self)
- basic = getattr(top, "basic")
+ basic = top["basic"]
rs = RadioSetting("emergency", "Emergency",
RadioSettingValueBoolean(self._memobj.settings.emergency))
basic.append(rs)
diff --git a/chirp/import_logic.py b/chirp/import_logic.py
index a445e9b..e52283a 100644
--- a/chirp/import_logic.py
+++ b/chirp/import_logic.py
@@ -37,7 +37,8 @@ def ensure_has_calls(radio, memory):
ulist_changed = True
break
if not ulist_changed:
- raise ImportError("No room to add callsign %s" % memory.dv_urcall)
+ raise errors.RadioError("No room to add callsign %s" %
+ memory.dv_urcall)
rlist_add = []
if memory.dv_rpt1call and memory.dv_rpt1call not in rlist:
@@ -59,7 +60,7 @@ def ensure_has_calls(radio, memory):
if ulist_changed:
radio.set_urcall_list(ulist)
if rlist_changed:
- radio.set_repeater_cal_list(rlist)
+ radio.set_repeater_call_list(rlist)
# Filter the name according to the destination's rules
def _import_name(dst_radio, _srcrf, mem):
@@ -123,8 +124,8 @@ def _import_dtcs(dst_radio, srcrf, mem):
def _guess_mode_by_frequency(freq):
ranges = [
- (0, 135, "AM"),
- (136, 9999, "FM"),
+ (0, 136000000, "AM"),
+ (136000000, 9999000000, "FM"),
]
for lo, hi, mode in ranges:
@@ -142,7 +143,10 @@ def _import_mode(dst_radio, srcrf, mem):
# frequency
if mem.mode == "Auto" and mem.mode not in dstrf.valid_modes:
- mem.mode = _guess_mode_by_frequency(mem.freq)
+ mode = _guess_mode_by_frequency(mem.freq)
+ if mode not in dstrf.valid_modes:
+ raise DestNotCompatible("Destination does not support %s" % mode)
+ mem.mode = mode
def _make_offset_with_split(rxfreq, txfreq):
offset = txfreq - rxfreq
@@ -163,7 +167,7 @@ def _import_duplex(dst_radio, srcrf, mem):
# Enforce maximum offset
ranges = [
- ( 0, 500000000, 7000000),
+ ( 0, 500000000, 15000000),
(500000000, 3000000000, 50000000),
]
for lo, hi, limit in ranges:
diff --git a/chirp/platform.py b/chirp/platform.py
index 882d898..da346a4 100644
--- a/chirp/platform.py
+++ b/chirp/platform.py
@@ -326,7 +326,15 @@ class Win32Platform(Platform):
os.system("explorer %s" % path)
def list_serial_ports(self):
- return [port for port, name, url in comports()]
+ def cmp(a, b):
+ try:
+ return int(a[3:]) - int(b[3:])
+ except:
+ return 0
+
+ ports = [port for port, name, url in comports()]
+ ports.sort(cmp=cmp)
+ return ports
def gui_open_file(self, start_dir=None, types=[]):
import win32gui
diff --git a/chirp/thd72.py b/chirp/thd72.py
index 2f63e59..0d80adc 100644
--- a/chirp/thd72.py
+++ b/chirp/thd72.py
@@ -66,8 +66,7 @@ struct {
struct {
u8 disabled:7,
unknown0:1;
- u8 unknown1:7,
- skip:1;
+ u8 skip;
} flag[1032];
#seekto 0x1500;
@@ -244,6 +243,10 @@ class THD72Radio(chirp_common.CloneModeRadio):
self._memobj.wx_name[number].name = name[:8]
self.add_dirty_block(self._memobj.wx_name[number])
+ def get_raw_memory(self, number):
+ return repr(self._memobj.memory[number]) + \
+ repr(self._memobj.flag[(number)])
+
def get_memory(self, number):
if isinstance(number, str):
try:
diff --git a/chirp/vx6.py b/chirp/vx6.py
index fbf0287..b4764db 100644
--- a/chirp/vx6.py
+++ b/chirp/vx6.py
@@ -141,7 +141,8 @@ class VX6Radio(yaesu_clone.YaesuCloneModeRadio):
return rf
def get_raw_memory(self, number):
- return repr(self._memobj.memory[number-1])
+ return repr(self._memobj.memory[number-1]) + \
+ repr(self._memobj.flags[(number-1)/2])
def get_memory(self, number):
_mem = self._memobj.memory[number-1]
@@ -197,7 +198,8 @@ class VX6Radio(yaesu_clone.YaesuCloneModeRadio):
valid = _flag["%s_valid" % nibble]
# initialize new channel to safe defaults
- if not mem.empty and not used:
+ if not mem.empty and not valid:
+ _flag["%s_valid" % nibble] = True
_mem.unknown11 = 0
_mem.step_changed = 0
_mem.cpu_shifted = 0
diff --git a/chirp/vx8.py b/chirp/vx8.py
index 5c28cda..67791f5 100644
--- a/chirp/vx8.py
+++ b/chirp/vx8.py
@@ -266,6 +266,7 @@ class VX8Radio(yaesu_clone.YaesuCloneModeRadio):
flag.valid = False
return
flag.used = not mem.empty
+ flag.valid = flag.used
if mem.empty:
return
diff --git a/chirpui/clone.py b/chirpui/clone.py
index 70db9ac..0786e1e 100644
--- a/chirpui/clone.py
+++ b/chirpui/clone.py
@@ -57,9 +57,9 @@ class CloneSettingsDialog(gtk.Dialog):
elif ports:
port = ports[0]
if not port in ports:
- ports.append(port)
+ ports.insert(0, port)
- return miscwidgets.make_choice(sorted(ports), True, port)
+ return miscwidgets.make_choice(ports, True, port)
def __make_model(self):
return miscwidgets.make_choice([], False)
diff --git a/chirpui/mainapp.py b/chirpui/mainapp.py
index 27c4b3c..e3b2eb1 100644
--- a/chirpui/mainapp.py
+++ b/chirpui/mainapp.py
@@ -1128,7 +1128,11 @@ If you think that it is valid, you can select a radio model below to force an op
def do_hide_unused(self, action):
eset = self.get_current_editorset()
- eset.editors["memedit"].set_hide_unused(action.get_active())
+ if eset is None:
+ conf = config.get("memedit")
+ conf.set_bool("hide_unused", action.get_active())
+ else:
+ eset.editors["memedit"].set_hide_unused(action.get_active())
def do_clearq(self):
eset = self.get_current_editorset()
diff --git a/chirpui/memedit.py b/chirpui/memedit.py
index c598624..5764ee0 100644
--- a/chirpui/memedit.py
+++ b/chirpui/memedit.py
@@ -202,40 +202,56 @@ class MemoryEditor(common.Editor):
return new
def _get_cols_to_hide(self, iter):
- tmode, duplex = self.store.get(iter,
- self.col(_("Tone Mode")),
- self.col(_("Duplex")))
+ tmode, duplex, cmode = self.store.get(iter,
+ self.col(_("Tone Mode")),
+ self.col(_("Duplex")),
+ self.col(_("Cross Mode")))
hide = []
+ txmode, rxmode = cmode.split("->")
if tmode == "Tone":
hide += [self.col(_("ToneSql")),
self.col(_("DTCS Code")),
self.col(_("DTCS Rx Code")),
- self.col(_("DTCS Pol"))]
+ self.col(_("DTCS Pol")),
+ self.col(_("Cross Mode"))]
elif tmode == "TSQL":
if self._features.has_ctone:
hide += [self.col(_("Tone"))]
hide += [self.col(_("DTCS Code")),
self.col(_("DTCS Rx Code")),
- self.col(_("DTCS Pol"))]
+ self.col(_("DTCS Pol")),
+ self.col(_("Cross Mode"))]
elif tmode == "DTCS":
- if self._features.has_rx_dtcs:
- hide += [self.col(_("DTCS Code"))]
-
hide += [self.col(_("Tone")),
- self.col(_("ToneSql"))]
+ self.col(_("ToneSql")),
+ self.col(_("Cross Mode")),
+ self.col(_("DTCS Rx Code"))]
elif tmode == "" or tmode == "(None)":
hide += [self.col(_("Tone")),
self.col(_("ToneSql")),
self.col(_("DTCS Code")),
self.col(_("DTCS Rx Code")),
- self.col(_("DTCS Pol"))]
+ self.col(_("DTCS Pol")),
+ self.col(_("Cross Mode"))]
+ elif tmode == "Cross":
+ if txmode != "Tone":
+ hide += [self.col(_("Tone"))]
+ if txmode != "DTCS":
+ hide += [self.col(_("DTCS Code"))]
+ if rxmode != "Tone":
+ hide += [self.col(_("ToneSql"))]
+ if rxmode != "DTCS":
+ hide += [self.col(_("DTCS Rx Code"))]
+ if "DTCS" not in cmode:
+ hide += [self.col(_("DTCS Pol"))]
if duplex == "" or duplex == "(None)":
hide += [self.col(_("Offset"))]
+
return hide
def maybe_hide_cols(self, iter):
@@ -757,6 +773,12 @@ class MemoryEditor(common.Editor):
a.set_sensitive(istwo)
ag.add_action(a)
+ if issingle:
+ iter = store.get_iter(paths[0])
+ cur_pos, = store.get(iter, self.col(_("Loc")))
+ if cur_pos == self._features.memory_bounds[1]:
+ ag.get_action("delete_s").set_sensitive(False)
+
uim = gtk.UIManager()
uim.insert_action_group(ag, 0)
uim.add_ui_from_string(menu_xml)
@@ -1284,6 +1306,9 @@ class MemoryEditor(common.Editor):
return
for mem in mem_list:
+ if mem.empty:
+ iter = self.store.iter_next(iter)
+ continue
loc, filled = store.get(iter,
self.col(_("Loc")), self.col("_filled"))
if filled and not always:
diff --git a/chirpui/shiftdialog.py b/chirpui/shiftdialog.py
index 10554d3..f35802e 100644
--- a/chirpui/shiftdialog.py
+++ b/chirpui/shiftdialog.py
@@ -70,7 +70,7 @@ class ShiftDialog(gtk.Dialog):
return int(count)
- def _get_mems_until_hole(self, start):
+ def _get_mems_until_hole(self, start, endokay=False):
mems = []
llimit, ulimit = self.rthread.radio.get_features().memory_bounds
@@ -89,7 +89,7 @@ class ShiftDialog(gtk.Dialog):
mems.append(mem)
pos += 1
- if pos > ulimit:
+ if pos > ulimit and not endokay:
raise errors.InvalidMemoryLocation(_("No space to insert a row"))
print "Found a hole: %i" % pos
@@ -110,7 +110,8 @@ class ShiftDialog(gtk.Dialog):
return 0
def _delete_hole(self, start):
- mems = self._get_mems_until_hole(start+1)
+ mems = self._get_mems_until_hole(start+1, endokay=True)
+
if mems:
count = self._shift_memories(-1, mems)
self.rthread.radio.erase_memory(count+start)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/chirp.git
More information about the pkg-hamradio-commits
mailing list