From e99416456afd4aa8bde42016826f9a345291cbf3 Mon Sep 17 00:00:00 2001 From: Matthew Poletiek Date: Tue, 8 Dec 2020 21:03:16 -0600 Subject: Initial Commit --- share/chirp.desktop | 13 +++ share/chirp.icns | Bin 0 -> 80528 bytes share/chirp.ico | Bin 0 -> 119911 bytes share/chirp.png | Bin 0 -> 9687 bytes share/chirp.svg | 224 +++++++++++++++++++++++++++++++++++++++++ share/chirpw.1 | 46 +++++++++ share/contrib/chirp.rnc | 28 ++++++ share/contrib/chirp.rng | 58 +++++++++++ share/contrib/chirp_banks.rnc | 3 + share/contrib/chirp_banks.rng | 11 ++ share/contrib/chirp_memory.rnc | 64 ++++++++++++ share/contrib/chirp_memory.rng | 193 +++++++++++++++++++++++++++++++++++ share/make_supported.py | 178 ++++++++++++++++++++++++++++++++ 13 files changed, 818 insertions(+) create mode 100644 share/chirp.desktop create mode 100644 share/chirp.icns create mode 100755 share/chirp.ico create mode 100644 share/chirp.png create mode 100644 share/chirp.svg create mode 100644 share/chirpw.1 create mode 100644 share/contrib/chirp.rnc create mode 100644 share/contrib/chirp.rng create mode 100644 share/contrib/chirp_banks.rnc create mode 100644 share/contrib/chirp_banks.rng create mode 100644 share/contrib/chirp_memory.rnc create mode 100644 share/contrib/chirp_memory.rng create mode 100755 share/make_supported.py (limited to 'share') diff --git a/share/chirp.desktop b/share/chirp.desktop new file mode 100644 index 0000000..966e2a0 --- /dev/null +++ b/share/chirp.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=CHIRP +GenericName=Radio Programming Tool +Comment=Program amateur radios +Icon=chirp +Exec=chirpw %F +Terminal=false +MimeType=inode/directory +Categories=Utility;HamRadio +Keywords=Hamradio;Programming;Handheld;Radio;Amateur;Programmer +StartupNotify=true diff --git a/share/chirp.icns b/share/chirp.icns new file mode 100644 index 0000000..2ac96be Binary files /dev/null and b/share/chirp.icns differ diff --git a/share/chirp.ico b/share/chirp.ico new file mode 100755 index 0000000..4006ff9 Binary files /dev/null and b/share/chirp.ico differ diff --git a/share/chirp.png b/share/chirp.png new file mode 100644 index 0000000..fe57c1a Binary files /dev/null and b/share/chirp.png differ diff --git a/share/chirp.svg b/share/chirp.svg new file mode 100644 index 0000000..38d0d05 --- /dev/null +++ b/share/chirp.svg @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + c h i r p + + + + + + + + diff --git a/share/chirpw.1 b/share/chirpw.1 new file mode 100644 index 0000000..ba9b9e8 --- /dev/null +++ b/share/chirpw.1 @@ -0,0 +1,46 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH CHIRP 1 "February 12, 2011" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +chirpw \- A tool for programming two-way radio equipment +.SH SYNOPSIS +.B chirpw +.RI [ options ] +.br +.SH DESCRIPTION +This manual page documents briefly the +.B chirpw +command. +.PP +\fBchirpw\fP is a tool for programming two-way radio equipment +It provides a generic user interface to the programming data and +process that can drive many radio models under the hood. +.SH OPTIONS +This program follows the usual GNU command line syntax, with long +options starting with two dashes (`--'). +A summary of options is included below. +.TP +.B \-\-help +Show summary of options. +.TP +.B \-\-profile +Enable Profiling. +.SH AUTHOR +chirpw was written by Dan Smith. +.PP +This manual page was written by Dan Smith (with help from Steve Conklin), +for the Debian project (and may be used by others). diff --git a/share/contrib/chirp.rnc b/share/contrib/chirp.rnc new file mode 100644 index 0000000..6ea2715 --- /dev/null +++ b/share/contrib/chirp.rnc @@ -0,0 +1,28 @@ +# +# CHIRP XML Schema +# Copyright 2008 Dan Smith +# + +include "chirp_memory.rnc" +include "chirp_banks.rnc" + +start = radio + +radio = element radio { + attribute version { chirpSchemaVersionType }?, + comment?, + memories, + banks +} + +comment = element comment { xsd:string }? + +memories = element memories { + element memory { memoryType }* +} + +banks = element banks { + element bank { bankType }* +} + +chirpSchemaVersionType = xsd:string { pattern = "[0-9][0-9]*.[0-9][0-9]*.[0-9]{1,4}" } diff --git a/share/contrib/chirp.rng b/share/contrib/chirp.rng new file mode 100644 index 0000000..d6020e5 --- /dev/null +++ b/share/contrib/chirp.rng @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [0-9][0-9]*.[0-9][0-9]*.[0-9]{1,4} + + + diff --git a/share/contrib/chirp_banks.rnc b/share/contrib/chirp_banks.rnc new file mode 100644 index 0000000..d832539 --- /dev/null +++ b/share/contrib/chirp_banks.rnc @@ -0,0 +1,3 @@ +bankType = + attribute id { xsd:nonNegativeInteger }, + attribute label { xsd:string } diff --git a/share/contrib/chirp_banks.rng b/share/contrib/chirp_banks.rng new file mode 100644 index 0000000..fa25081 --- /dev/null +++ b/share/contrib/chirp_banks.rng @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/share/contrib/chirp_memory.rnc b/share/contrib/chirp_memory.rnc new file mode 100644 index 0000000..ad7ee2e --- /dev/null +++ b/share/contrib/chirp_memory.rnc @@ -0,0 +1,64 @@ +memoryType = + attribute location { xsd:nonNegativeInteger }?, + shortName, + longName?, + frequency, + SquelchList, + squelchSetting?, + duplex, + offset, + mode, + tuningStep, + skip?, + bank?, + dv? + +shortName = element shortName { xsd:string { pattern = "[A-Z0-9/ >\-]{0,6}" } } + +frequencyType = + attribute units { "Hz" | "kHz" | "MHz" | "GHz" }, + xsd:decimal + +longName = element longName { xsd:string { pattern = "[.A-Za-z0-9/ >\-]{0,16}" } } + +frequency = element frequency { frequencyType } + +SquelchList = + element squelch { squelchType }?, + element squelch { squelchType }?, + element squelch { squelchType }? + +squelchType = + element tone { xsd:decimal { minInclusive = "67.0" maxInclusive = "254.1" } }?, # could also use enumeration + element code { xsd:positiveInteger }?, + element polarity { xsd:string { pattern = "[RN]{2}" } }?, + attribute id { text }?, + attribute type { text }? + +offset = element offset { frequencyType } + +tuningStep = element tuningStep { frequencyType } + +squelchSetting = element squelchSetting { xsd:string } + +duplex = element duplex { "positive" | "negative" | "none" } + +mode = element mode { "FM" | "NFM" | "WFM" | "AM" | "NAM" | "DV" } + +dv = element dv { + element urcall { callsignType }, + element rpt1call { callsignType }, + element rpt2call { callsignType }, + element digitalCode { digitalCodeType }? +} + +callsignType = xsd:string { pattern = "[A-Z0-9/ ]*" } + +digitalCodeType = xsd:integer { minInclusive = "0" } + +skip = element skip { "S" | "P" | "" } + +bank = element bank { + attribute bankId { xsd:nonNegativeInteger }, + attribute bankIndex { xsd:nonNegativeInteger }? +} diff --git a/share/contrib/chirp_memory.rng b/share/contrib/chirp_memory.rng new file mode 100644 index 0000000..0d88eac --- /dev/null +++ b/share/contrib/chirp_memory.rng @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [A-Z0-9/ >\-]{0,6} + + + + + + + Hz + kHz + MHz + GHz + + + + + + + + [.A-Za-z0-9/ >\-]{0,16} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 67.0 + 254.1 + + + + + + + + + + + + + [RN]{2} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + positive + negative + none + + + + + + + FM + NFM + WFM + AM + NAM + DV + + + + + + + + + + + + + + + + + + + + + + + + [A-Z0-9/ ]* + + + + + 0 + + + + + + S + P + + + + + + + + + + + + + + + + + diff --git a/share/make_supported.py b/share/make_supported.py new file mode 100755 index 0000000..67ecebd --- /dev/null +++ b/share/make_supported.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python + +import sys +import serial + +sys.path.insert(0, ".") +sys.path.insert(0, "..") + +tmp = sys.stdout +sys.stdout = sys.stderr +from chirp import * +from chirp.drivers import * +sys.stdout = tmp + +RF = chirp_common.RadioFeatures() +KEYS = [x for x in sorted(RF.__dict__.keys()) + if "_" in x and not x.startswith("_")] + +RADIO_TYPES = { + 'Clone': chirp_common.CloneModeRadio, + 'File': chirp_common.FileBackedRadio, + 'Live': chirp_common.LiveRadio, +} + + +counter = 0 + +def radio_type(radio): + for k, v in RADIO_TYPES.items(): + if isinstance(radio, v): + return k + return "" + + +def supported_row(radio): + global counter + counter += 1 + odd = counter % 2 + + row = '' % (odd and "odd" or "even", + radio.VENDOR, + radio.MODEL, + radio.VARIANT) + row += "%s %s %s\n" % ( + 'row%04i' % counter, + 'row%04i' % counter, + radio.VENDOR, radio.MODEL, radio.VARIANT) + rf = radio.get_features() + for key in KEYS: + value = rf.__dict__[key] + if key == "valid_bands": + value = ["%s-%s MHz" % (chirp_common.format_freq(x), + chirp_common.format_freq(y)) + for x, y in value] + + if key in ["valid_bands", "valid_modes", "valid_power_levels", + "valid_tuning_steps"]: + try: + value = ", ".join([str(x) for x in value + if not str(x).startswith("?")]) + except Exception, e: + raise + + if key == "memory_bounds": + value = "%i-%i" % value + + if key == "requires_call_lists": + if "DV" not in rf.valid_modes: + value = None + elif value: + value = "Required" + else: + value = "Optional" + + if value is None: + row += 'N/A' % key + elif isinstance(value, bool): + row += '%s' % \ + (key, + value, + value and "Yes" or "No") + else: + row += '%s' % (key, value) + row += '%s' % radio_type(radio) + row += "\n" + return row + + +def header_row(): + row = "" + row += "Radio\n" + for key in KEYS: + Key = key.split("_", 1)[1].title().replace("_", " ") + row += '%s' % (RF.get_doc(key), Key) + row += 'Type\n' + row += "\n" + return row + + +dest = sys.stdout +if len(sys.argv) > 1: + dest = open(sys.argv[1], 'w') + + +def output(string): + dest.write(string + '\n') + + +output(""" + + +""") + +models = {"Icom": [], + "Kenwood": [], + "Yaesu": [], + "Alinco": [], + "Baofeng": [], + "z_Other": [], + } + +models = [] + +exclude = [directory.DRV_TO_RADIO["Icom_7200"]] + +for radio in directory.DRV_TO_RADIO.values(): + if radio in exclude: + continue + + models.append(radio) + for alias in radio.ALIASES: + class DynamicRadioAlias(radio): + VENDOR = alias.VENDOR + MODEL = alias.MODEL + VARIANT = alias.VARIANT + models.append(DynamicRadioAlias) + + +def get_key(rc): + return '%s %s %s' % (rc.VENDOR, rc.MODEL, rc.VARIANT) + +for radio in sorted(models, cmp=lambda a, b: get_key(a) < get_key(b) and -1 or 1): + if counter % 10 == 0: + output(header_row()) + _radio = radio(None) + if _radio.get_features().has_sub_devices: + for __radio in _radio.get_sub_devices(): + output(supported_row(__radio)) + else: + output(supported_row(_radio)) -- cgit v1.2.3