Rot # | Manufacturer | Model | Version | Status | Macro Name |
---|---|---|---|---|---|
0 | ROT_MODEL_NONE | ||||
1 | Hamlib | Dummy | 0.2 | Beta | ROT_MODEL_DUMMY |
2 | Hamlib | NET rotctl | 0.3 | Beta | ROT_MODEL_NETROTCTL |
201 | Hamlib | EasycommI | 0.4 | Beta | ROT_MODEL_EASYCOMM1 |
202 | Hamlib | EasycommII | 0.4 | Beta | ROT_MODEL_EASYCOMM2 |
203 | ROT_MODEL_TRAKBOX | ||||
204 | Hamlib | EasycommIII | 0.4 | Alpha | ROT_MODEL_EASYCOMM3 |
301 | XQ2FOD | Fodtrack | 0.2 | Stable | ROT_MODEL_FODTRACK |
401 | Idiom Press | Rotor-EZ | 2010-02-14 | Beta | ROT_MODEL_ROTOREZ |
402 | Idiom Press | RotorCard | 2010-02-14 | Untested | ROT_MODEL_ROTORCARD |
403 | Hy-Gain | DCU-1/DCU-1X | 2010-08-23 | Untested | ROT_MODEL_DCU |
404 | DF9GR | ERC | 2010-08-23b | Alpha | ROT_MODEL_ERC |
405 | Green Heron | RT-21 | 2014-09-14 | Alpha | ROT_MODEL_RT21 |
501 | SARtek | SARtek-1 | 0.2 | Untested | ROT_MODEL_SARTEK1 |
601 | Yaesu | GS-232A | 0.3 | Beta | ROT_MODEL_GS232A |
602 | Yaesu/Kenpro | GS-232 | 0.1 | Beta | ROT_MODEL_GS232 |
603 | Yaesu | GS-232B | 0.2 | Beta | ROT_MODEL_GS232B |
604 | F1TE | GS232/F1TE Tracker | 0.1 | Beta | ROT_MODEL_F1TETRACKER |
701 | WA6UFQ | PcRotor | 0.1 | Untested | ROT_MODEL_PCROTOR |
801 | Heathkit | HD 1780 Intellirotor | 0.1 | Beta | ROT_MODEL_HD1780 |
901 | SPID | Rot2Prog | 1.0 | Stable | ROT_MODEL_SPID_ROT2PROG |
902 | SPID | Rot1Prog | 1.0 | Stable | ROT_MODEL_SPID_ROT1PROG |
903 | SPID | MD-01/02 (ROT2 mode) | 1.0 | Stable | ROT_MODEL_SPID_MD01_ROT2PROG |
1001 | M2 | RC2800 | 0.1.1 | Beta | ROT_MODEL_RC2800 |
1101 | EA4TX | ARS RCI AZ&EL | 0.1 | Beta | ROT_MODEL_RCI_AZEL |
1102 | EA4TX | ARS RCI AZ | 0.1 | Beta | ROT_MODEL_RCI_AZ |
1201 | AMSAT | IF-100 | 0.1 | Untested | ROT_MODEL_IF100 |
1301 | LA7LKA | ts7400 | 0.1 | Beta | ROT_MODEL_TS7400 |
1401 | Celestron | NexStar | 0.1 | Untested | ROT_MODEL_NEXSTAR |
1501 | DG9OAA | Ether6 (via ethernet) | 0.1 | Beta | ROT_MODEL_ETHER6 |
1601 | CNCTRK | CNCTRK | 0.1 | Untested | ROT_MODEL_CNCTRK |
1701 | Prosistel | Prosistel D | 0.3 | Beta | ROT_MODEL_PROSISTEL |
1801 | Meade | LX200 | 0.1 | Alpha | ROT_MODEL_MEADE |
Created
March 2, 2020 13:16
-
-
Save kerel-fs/2354ff9c082cd3c1594afc38c67bc32a to your computer and use it in GitHub Desktop.
Python script for listing all Hamlib Rotator Models (using markdown-syntax tables)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# list_rotator_models.py - List all available rotator models in Hamlib | |
# Copyright (C) 2020 Fabian P. Schmidt | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public | |
# License as published by the Free Software Foundation; either | |
# version 2.1 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 Lesser General Public License for more details. | |
# | |
# You should have received a copy of the GNU Lesser General Public | |
# License along with this library; if not, write to the Free Software | |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | |
# MA 02110-1301 USA | |
import Hamlib | |
STATUS_CODES = {0: 'Alpha', 1: 'Untested', 2: 'Beta', 3: 'Stable', '': ''} | |
def rot_get_models(): | |
""" | |
Return a list of all Hamlib rotator models | |
:rtype: list of dict | |
""" | |
Hamlib.rot_load_all_backends() | |
models = [] | |
for macro_name in dir(Hamlib): | |
if not macro_name.startswith('ROT_MODEL'): | |
continue | |
model_id = getattr(Hamlib, macro_name) | |
model = {'id': model_id, 'macro_name': macro_name} | |
# Try to get more information via Rotator Capabilities | |
rot_caps = Hamlib.rot_get_caps(model_id) | |
for key in ['mfg_name', 'model_name', 'version', 'status']: | |
try: | |
model[key] = getattr(rot_caps, key) | |
except AttributeError: | |
model[key] = '' | |
models.append(model) | |
return models | |
def rot_print_models_table(models): | |
""" | |
Print all rotator models from the provided list. | |
:param: Input list of rotator models | |
""" | |
print(f'|{"Rot #":6s} ' | |
f'| {"Manufacturer":12s} ' | |
f'| {"Model":21s} ' | |
f'| {"Version":11s} ' | |
f'| {"Status":8s} ' | |
f'| {"Macro Name":28s} |') | |
print('|-------' | |
'|--------------' | |
'|-----------------------' | |
'|-------------' | |
'|----------' | |
'|------------------------------|') | |
for model in sorted(models, key=lambda m: m['id']): | |
print('| ' | |
f'{model["id"]:5d} | ' | |
f'{model["mfg_name"]:12s} | ' | |
f'{model["model_name"]:21s} | ' | |
f'{model["version"]:11s} | ' | |
f'{STATUS_CODES[model["status"]]:8s} | ' | |
f'{model["macro_name"]:28s} |') | |
if __name__ == '__main__': | |
models = rot_get_models() | |
rot_print_models_table(models) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment