Add files via upload

1.1.0
PianetaRadio 2022-03-12 20:30:51 +01:00 zatwierdzone przez GitHub
rodzic 511eea4fa0
commit a42384c896
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
37 zmienionych plików z 11688 dodań i 0 usunięć

53
CatRadio.pro 100644
Wyświetl plik

@ -0,0 +1,53 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
dialogconfig.cpp \
dialogsetup.cpp \
guidata.cpp \
main.cpp \
mainwindow.cpp \
rigcommand.cpp \
rigdaemon.cpp \
rigdata.cpp \
smeter.cpp \
submeter.cpp \
vfodisplay.cpp
HEADERS += \
dialogconfig.h \
dialogsetup.h \
guidata.h \
mainwindow.h \
rigcommand.h \
rigdaemon.h \
rigdata.h \
smeter.h \
submeter.h \
vfodisplay.h
FORMS += \
dialogconfig.ui \
dialogsetup.ui \
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
LIBS += -L$$PWD/hamlib/ -lhamlib
INCLUDEPATH += $$PWD/hamlib
VERSION = 1.0.0
RC_ICONS = catradio.ico
QMAKE_LFLAGS += -no-pie

425
CatRadio.pro.user 100644
Wyświetl plik

@ -0,0 +1,425 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 5.0.1, 2022-02-15T23:49:28. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{3eda28a5-2ae6-4f98-9ee1-3326cb54ce82}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
<value type="QString">-fno-delayed-template-parsing</value>
</valuelist>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
<value type="QString" key="ClangCodeModel.WarningConfigId">Builtin.BuildSystem</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">4</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.1.3 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.1.3 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.613.win64_mingw81_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\Johnny\Documents\QT\build-CatRadio-Desktop_Qt_6_1_3_MinGW_64_bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_6_1_3_MinGW_64_bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\Johnny\Documents\QT\build-CatRadio-Desktop_Qt_6_1_3_MinGW_64_bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_6_1_3_MinGW_64_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\Johnny\Documents\QT\build-CatRadio-Desktop_Qt_6_1_3_MinGW_64_bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_6_1_3_MinGW_64_bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
<value type="int" key="SeparateDebugInfo">0</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Johnny/Documents/QT/CatRadio/CatRadio.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/Johnny/Documents/QT/CatRadio/CatRadio.pro</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_6_1_3_MinGW_64_bit-Release</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.1</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.15.2 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.15.2 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5152.win32_mingw81_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\Johnny\Documents\QT\build-CatRadio-Desktop_Qt_5_15_2_MinGW_32_bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_5_15_2_MinGW_32_bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\Johnny\Documents\QT\build-CatRadio-Desktop_Qt_5_15_2_MinGW_32_bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_5_15_2_MinGW_32_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\Johnny\Documents\QT\build-CatRadio-Desktop_Qt_5_15_2_MinGW_32_bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_5_15_2_MinGW_32_bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
<value type="int" key="SeparateDebugInfo">0</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Johnny/Documents/QT/CatRadio/CatRadio.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/Johnny/Documents/QT/CatRadio/CatRadio.pro</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">2</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

14
ChangeLog.txt 100644
Wyświetl plik

@ -0,0 +1,14 @@
CatRadio
1.1.0
+ AF Gain and Squelch slider
+ Tab with CW and FM functions
* SWR meter with log scale
* CI-V Address entry in hex
* Bug: RF Gain slider now correctly updated
* Bug: noise filters init settings now correctly updated
* Cosmetic adjustement to fit the font for different SO compiler
1.0.0
First release

BIN
catradio.ico 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 10 KiB

BIN
catradio.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 2.7 KiB

117
dialogconfig.cpp 100644
Wyświetl plik

@ -0,0 +1,117 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "dialogconfig.h"
#include "ui_dialogconfig.h"
#include <QSettings>
#include <QFile>
#include <QTextStream>
#include "rigdata.h"
#include <hamlib/rig.h>
extern rigConnect rigCom;
QString rigListFile = "rig.lst"; //Text file containing the list of rig supported by hamlib
QFile file(rigListFile);
DialogConfig::DialogConfig(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogConfig)
{
ui->setupUi(this);
//* rigModel comboBox
if (!file.exists()) //Create file rig.lst if not exists
{
file.open(QIODevice::ReadWrite);
rig_load_all_backends(); //Load all backends information
rig_list_foreach(printRigList, NULL); //Create the rig list
}
else file.open(QIODevice::ReadOnly); //Open file rig.lst and populate the combobox
file.seek(0);
ui->comboBox_rigModel->clear();
while(!file.atEnd())
{
QString line = file.readLine();
ui->comboBox_rigModel->addItem(line.trimmed());
}
file.close();
//* serialSpeed comboBox
ui->comboBox_serialSpeed->clear();
ui->comboBox_serialSpeed->addItem("4800");
ui->comboBox_serialSpeed->addItem("9600");
ui->comboBox_serialSpeed->addItem("19200");
ui->comboBox_serialSpeed->addItem("38400");
ui->comboBox_serialSpeed->addItem("57600");
ui->comboBox_serialSpeed->addItem("115200");
//* Update values in the GUI
ui->comboBox_rigModel->setCurrentIndex(ui->comboBox_rigModel->findText(QString::number(rigCom.rigModel),Qt::MatchStartsWith));
ui->lineEdit_RigPath->setText(rigCom.rigPort);
ui->comboBox_serialSpeed->setCurrentText(QString::number(rigCom.serialSpeed));
if (rigCom.civAddr) ui->lineEdit_civAddr->setText(QString::number(rigCom.civAddr,16));
ui->spinBox_RefreshRate->setValue(rigCom.rigRefresh);
ui->checkBox_fullPoll->setChecked(rigCom.fullPoll);
}
DialogConfig::~DialogConfig()
{
delete ui;
}
void DialogConfig::on_buttonBox_accepted()
{
bool civAddrConv;
//* Read settings from GUI
QString rigModel = ui->comboBox_rigModel->currentText();
QRegularExpression regexp("[0-9]+");
QRegularExpressionMatch rigNumber = regexp.match(rigModel);
rigCom.rigModel = rigNumber.captured(0).toInt();
rigCom.rigPort = ui->lineEdit_RigPath->text();
rigCom.serialSpeed = ui->comboBox_serialSpeed->currentText().toInt();
rigCom.civAddr = ui->lineEdit_civAddr->text().toInt(&civAddrConv,16);
rigCom.rigRefresh = ui->spinBox_RefreshRate->value();
rigCom.fullPoll = ui->checkBox_fullPoll->isChecked();
//* Save settings in config.ini
QSettings configFile(QString("config.ini"), QSettings::IniFormat);
configFile.setValue("rigModel", rigCom.rigModel);
configFile.setValue("rigPort", ui->lineEdit_RigPath->text());
configFile.setValue("serialSpeed", ui->comboBox_serialSpeed->currentText());
configFile.setValue("civAddress", ui->lineEdit_civAddr->text().toInt(&civAddrConv,16));
configFile.setValue("rigRefresh", ui->spinBox_RefreshRate->value());
configFile.setValue("fullPolling", ui->checkBox_fullPoll->isChecked());
}
int printRigList(const struct rig_caps *rigCaps, void *data) //Load rig list from hamlib and save into file rig.lst
{
if (data) return 0;
QTextStream stream(&file);
stream << rigCaps->rig_model << " " << rigCaps->mfg_name << " " << rigCaps->model_name << "\n";
return 1;
}

46
dialogconfig.h 100644
Wyświetl plik

@ -0,0 +1,46 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef DIALOGCONFIG_H
#define DIALOGCONFIG_H
#include <QDialog>
namespace Ui {
class DialogConfig;
}
class DialogConfig : public QDialog
{
Q_OBJECT
public:
explicit DialogConfig(QWidget *parent = nullptr);
~DialogConfig();
private slots:
void on_buttonBox_accepted();
private:
Ui::DialogConfig *ui;
};
int printRigList(const struct rig_caps *rigCaps, void *data);
#endif // DIALOGCONFIG_H

192
dialogconfig.ui 100644
Wyświetl plik

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogConfig</class>
<widget class="QDialog" name="DialogConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Config</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_RigModel">
<property name="text">
<string>Model</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_rigModel"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_RigPath">
<property name="text">
<string>Path</string>
</property>
<property name="buddy">
<cstring>lineEdit_RigPath</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_RigPath">
<property name="toolTip">
<string>e.g. COM2 or /dev/ttyUSB1</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_serialSpeed">
<property name="text">
<string>Speed</string>
</property>
<property name="buddy">
<cstring>comboBox_serialSpeed</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_serialSpeed"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_RefreshRate">
<property name="text">
<string>Refresh Rate</string>
</property>
<property name="buddy">
<cstring>spinBox_RefreshRate</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox_RefreshRate">
<property name="minimum">
<number>50</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="singleStep">
<number>50</number>
</property>
<property name="value">
<number>200</number>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Options</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>11</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,1">
<property name="spacing">
<number>7</number>
</property>
<item>
<widget class="QLabel" name="label_civAddr">
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="text">
<string>Icom CI-V</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_civAddr">
<property name="toolTip">
<string>hex, Icom only</string>
</property>
<property name="statusTip">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>h</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBox_fullPoll">
<property name="text">
<string>Full polling</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>lineEdit_RigPath</tabstop>
<tabstop>comboBox_serialSpeed</tabstop>
<tabstop>spinBox_RefreshRate</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogConfig</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogConfig</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

43
dialogsetup.cpp 100644
Wyświetl plik

@ -0,0 +1,43 @@
#include "dialogsetup.h"
#include "ui_dialogsetup.h"
#include "guidata.h"
#include <QSettings>
#include <QFile>
extern guiConfig guiConf;
DialogSetup::DialogSetup(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogSetup)
{
ui->setupUi(this);
if (guiConf.vfoDisplayMode) ui->radioButton_vfoDispMode_UD->setChecked(true);
}
DialogSetup::~DialogSetup()
{
delete ui;
}
void DialogSetup::on_radioButton_vfoDispMode_LR_toggled(bool checked)
{
if (checked) guiConf.vfoDisplayMode=0;
}
void DialogSetup::on_radioButton_vfoDispMode_UD_toggled(bool checked)
{
if (checked) guiConf.vfoDisplayMode=1;
}
void DialogSetup::on_buttonBox_accepted()
{
//* Save settings in config.ini
QSettings configFile(QString("config.ini"), QSettings::IniFormat);
configFile.setValue("vfoDisplayMode", guiConf.vfoDisplayMode);
}

31
dialogsetup.h 100644
Wyświetl plik

@ -0,0 +1,31 @@
#ifndef DIALOGSETUP_H
#define DIALOGSETUP_H
#include <QDialog>
namespace Ui {
class DialogSetup;
}
class DialogSetup : public QDialog
{
Q_OBJECT
public:
explicit DialogSetup(QWidget *parent = nullptr);
~DialogSetup();
private slots:
void on_radioButton_vfoDispMode_LR_toggled(bool checked);
void on_radioButton_vfoDispMode_UD_toggled(bool checked);
void on_buttonBox_accepted();
private:
Ui::DialogSetup *ui;
};
#endif // DIALOGSETUP_H

103
dialogsetup.ui 100644
Wyświetl plik

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogSetup</class>
<widget class="QDialog" name="DialogSetup">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Setup</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_vfoDisplayMode">
<property name="title">
<string>VFO Display Mode</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="radioButton_vfoDispMode_LR">
<property name="text">
<string>Left/Right buttons</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_vfoDispMode_UD">
<property name="text">
<string>Up/Down click</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogSetup</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogSetup</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

22
guidata.cpp 100644
Wyświetl plik

@ -0,0 +1,22 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "guidata.h"
guiConfig guiConf;

10
guidata.h 100644
Wyświetl plik

@ -0,0 +1,10 @@
#ifndef GUIDATA_H
#define GUIDATA_H
#endif // GUIDATA_H
typedef struct {
int vfoDisplayMode; //0: use Left/Right mouse button, 1: click digit up or down
} guiConfig;

446
hamlib/amplifier.h 100644
Wyświetl plik

@ -0,0 +1,446 @@
/*
* Hamlib Interface - Amplifier API header
* Copyright (c) 2000-2005 by Stephane Fillod
*
*
* This library 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 library 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
*
*/
#ifndef _AMPLIFIER_H
#define _AMPLIFIER_H 1
#include <hamlib/rig.h>
#include <hamlib/amplist.h>
/**
* \addtogroup amplifier
* @{
*/
/**
* \brief Hamlib amplifier data structures.
*
* \file amplifier.h
*
* This file contains the data structures and declarations for the Hamlib
* amplifier Application Programming Interface (API).
*
* See the amplifier.c file for details on the amplifier API functions.
*/
__BEGIN_DECLS
/* Forward struct references */
struct amp;
struct amp_state;
/**
* \brief Main amplifier handle type definition.
*
* \typedef typedef struct amp AMP
*
* The #AMP handle is returned by amp_init() and is passed as a parameter to
* every amplifier specific API call.
*
* amp_cleanup() must be called when this handle is no longer needed.
*/
typedef struct amp AMP;
/**
* \brief Type definition for
* <a href="https://en.wikipedia.org/wiki/Standing_wave_ratio" >SWR (Standing Wave Ratio)</a>.
*
* \typedef typedef float swr_t
*
* The \a swr_t type is used as a parameter for the amp_get_swr() function.
*
* The unit of \a swr_t is 1.0 to the maximum value reported by the amplifier's
* internal antenna system tuner, i.e.
* <a href="http://www.arrl.org/transmatch-antenna-tuner" >transmatch</a>,
* representing the ratio of 1.0:1 to Maximum:1.
*/
typedef float swr_t;
/**
* \brief Type definition for the
* <a href="http://www.arrl.org/transmatch-antenna-tuner" >transmatch</a>
* tuning values of
* <a href="https://en.wikipedia.org/wiki/Capacitance" >capacitance</a>
* and
* <a href="https://en.wikipedia.org/wiki/Inductance" >inductance</a>.
*
* \typedef typedef float tune_value_t
*
* The \a tune_value_t type is used as a parameter for amp_get_level().
*
* The unit of \a tune_value_t is
* <a href="https://en.wikipedia.org/wiki/Farad" >picoFarads (pF)</a>
* or
* <a href="https://en.wikipedia.org/wiki/Henry_(unit)" >nanoHenrys (nH)</a>.
*/
typedef int tune_value_t;
/**
* \brief The token in the netampctl protocol for returning an error condition code.
*/
#define NETAMPCTL_RET "RPRT "
//! @cond Doxygen_Suppress
typedef enum
{
AMP_RESET_MEM, // erase tuner memory
AMP_RESET_FAULT, // reset any fault
AMP_RESET_AMP // for kpa1500
} amp_reset_t;
//! @endcond
/**
* \brief Amplifier type flags
*/
typedef enum
{
AMP_FLAG_1 = (1 << 1), /*!< TBD */
AMP_FLAG_2 = (1 << 2) /*!< TBD */
} amp_type_t;
//! @cond Doxygen_Suppress
// TBD AMP_TYPE
#define AMP_TYPE_MASK (AMP_FLAG_1|AMP_FLAG_2)
#define AMP_TYPE_OTHER 0
#define AMP_TYPE_1 AMP_FLAG_1
#define AMP_TYPE_2 AMP_FLAG_2
#define AMP_TYPE_ALL (AMP_FLAG_1|AMP_FLAG_2)
//! @endcond
//! @cond Doxygen_Suppress
enum amp_level_e
{
AMP_LEVEL_NONE = 0, /*!< '' -- No Level. */
AMP_LEVEL_SWR = (1 << 0), /*!< \c SWR 1.0 or greater. */
AMP_LEVEL_NH = (1 << 1), /*!< \c Tune setting in nanohenries. */
AMP_LEVEL_PF = (1 << 2), /*!< \c Tune setting in picofarads. */
AMP_LEVEL_PWR_INPUT = (1 << 3), /*!< \c Power reading from amplifier. */
AMP_LEVEL_PWR_FWD = (1 << 4), /*!< \c Power reading forward. */
AMP_LEVEL_PWR_REFLECTED = (1 << 5), /*!< \c Power reading reverse. */
AMP_LEVEL_PWR_PEAK = (1 << 6), /*!< \c Power reading peak. */
AMP_LEVEL_FAULT = (1 << 7) /*!< \c Fault code. */
};
//! @endcond
//! @cond Doxygen_Suppress
#define AMP_LEVEL_FLOAT_LIST (AMP_LEVEL_SWR)
#define AMP_LEVEL_STRING_LIST (AMP_LEVEL_FAULT)
#define AMP_LEVEL_IS_FLOAT(l) ((l)&AMP_LEVEL_FLOAT_LIST)
#define AMP_LEVEL_IS_STRING(l) ((l)&AMP_LEVEL_STRING_LIST)
//! @endcond
/* Basic amp type, can store some useful info about different amplifiers. Each
* lib must be able to populate this structure, so we can make useful
* enquiries about capabilities.
*/
//! @cond Doxygen_Suppress
#define AMP_MODEL(arg) .amp_model=arg,.macro_name=#arg
//! @endcond
/**
* \brief Amplifier capabilities.
*
* \struct amp_caps
*
* The main idea of this struct is that it will be defined by the backend
* amplifier driver and will remain read-only for the application. Fields
* that need to be modifiable by the application are copied into the
* amp_state structure, which is the private memory area of the #AMP instance.
*
* This way you can have several amplifiers running within the same
* application, sharing the amp_caps structure of the backend, while keeping
* their own customized data.
*
* \b Note: Don't move fields around and only add new fields at the end of the
* amp_caps structure. Shared libraries and DLLs depend on a constant
* structure to maintain compatibility.
*/
struct amp_caps
{
amp_model_t amp_model; /*!< Amplifier model as defined in amplist.h. */
const char *model_name; /*!< Model name, e.g. MM-5k. */
const char *mfg_name; /*!< Manufacturer, e.g. Moonbeam. */
const char *version; /*!< Driver version, typically in YYYYMMDD.x format. */
const char *copyright; /*!< Copyright info (should be LGPL). */
enum rig_status_e status; /*!< Driver status. */
int amp_type; /*!< Amplifier type. */
enum rig_port_e port_type; /*!< Type of communication port (serial, ethernet, etc.). */
int serial_rate_min; /*!< Minimal serial speed. */
int serial_rate_max; /*!< Maximal serial speed. */
int serial_data_bits; /*!< Number of data bits. */
int serial_stop_bits; /*!< Number of stop bits. */
enum serial_parity_e serial_parity; /*!< Parity. */
enum serial_handshake_e serial_handshake; /*!< Handshake. */
int write_delay; /*!< Write delay. */
int post_write_delay; /*!< Post-write delay. */
int timeout; /*!< Timeout. */
int retry; /*!< Number of retries if a command fails. */
const struct confparams *cfgparams; /*!< Configuration parameters. */
const rig_ptr_t priv; /*!< Private data. */
const char *amp_model_macro_name; /*!< Model macro name. */
setting_t has_get_level; /*!< List of get levels. */
setting_t has_set_level; /*!< List of set levels. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
/*
* Amp Admin API
*
*/
int (*amp_init)(AMP *amp); /*!< Pointer to backend implementation of ::amp_init(). */
int (*amp_cleanup)(AMP *amp); /*!< Pointer to backend implementation of ::amp_cleanup(). */
int (*amp_open)(AMP *amp); /*!< Pointer to backend implementation of ::amp_open(). */
int (*amp_close)(AMP *amp); /*!< Pointer to backend implementation of ::amp_close(). */
int (*set_freq)(AMP *amp, freq_t val); /*!< Pointer to backend implementation of ::amp_set_freq(). */
int (*get_freq)(AMP *amp, freq_t *val); /*!< Pointer to backend implementation of ::amp_get_freq(). */
int (*set_conf)(AMP *amp, token_t token, const char *val); /*!< Pointer to backend implementation of ::amp_set_conf(). */
int (*get_conf)(AMP *amp, token_t token, char *val); /*!< Pointer to backend implementation of ::amp_get_conf(). */
/*
* General API commands, from most primitive to least.. :()
* List Set/Get functions pairs
*/
int (*reset)(AMP *amp, amp_reset_t reset); /*!< Pointer to backend implementation of ::amp_reset(). */
int (*get_level)(AMP *amp, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_level(). */
int (*get_ext_level)(AMP *amp, token_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_ext_level(). */
int (*set_powerstat)(AMP *amp, powerstat_t status); /*!< Pointer to backend implementation of ::amp_set_powerstat(). */
int (*get_powerstat)(AMP *amp, powerstat_t *status); /*!< Pointer to backend implementation of ::amp_get_powerstat(). */
/* get firmware info, etc. */
const char *(*get_info)(AMP *amp); /*!< Pointer to backend implementation of ::amp_get_info(). */
//! @cond Doxygen_Suppress
setting_t levels;
unsigned ext_levels;
//! @endcond
const struct confparams *extlevels; /*!< Extension levels list. \sa extamp.c */
const struct confparams *extparms; /*!< Extension parameters list. \sa extamp.c */
const char *macro_name; /*!< Amplifier model macro name. */
};
/**
* \brief Amplifier state structure.
*
* \struct amp_state
*
* This structure contains live data, as well as a copy of capability fields
* that may be updated, i.e. customized while the #AMP handle is instantiated.
*
* It is fine to move fields around, as this kind of struct should not be
* initialized like amp_caps are.
*/
struct amp_state
{
/*
* overridable fields
*/
/*
* non overridable fields, internal use
*/
hamlib_port_t ampport; /*!< Amplifier port (internal use). */
int comm_state; /*!< Comm port state, opened/closed. */
rig_ptr_t priv; /*!< Pointer to private amplifier state data. */
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
setting_t has_get_level; /*!< List of get levels. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
};
/**
* \brief Master amplifier structure.
*
* \struct amp
*
* Master amplifier data structure acting as the #AMP handle for the
* controlled amplifier. A pointer to this structure is returned by the
* amp_init() API function and is passed as a parameter to every amplifier
* specific API call.
*
* \sa amp_init(), amp_caps, amp_state
*/
struct amp
{
struct amp_caps *caps; /*!< Amplifier caps. */
struct amp_state state; /*!< Amplifier state. */
};
//! @cond Doxygen_Suppress
/* --------------- API function prototypes -----------------*/
extern HAMLIB_EXPORT(AMP *)
amp_init HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_open HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_close HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_cleanup HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_set_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
amp_get_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
char *val));
extern HAMLIB_EXPORT(int)
amp_set_powerstat HAMLIB_PARAMS((AMP *amp,
powerstat_t status));
extern HAMLIB_EXPORT(int)
amp_get_powerstat HAMLIB_PARAMS((AMP *amp,
powerstat_t *status));
/*
* General API commands, from most primitive to least.. )
* List Set/Get functions pairs
*/
extern HAMLIB_EXPORT(int)
amp_get_freq HAMLIB_PARAMS((AMP *amp,
freq_t *freq));
extern HAMLIB_EXPORT(int)
amp_set_freq HAMLIB_PARAMS((AMP *amp,
freq_t freq));
extern HAMLIB_EXPORT(int)
amp_reset HAMLIB_PARAMS((AMP *amp,
amp_reset_t reset));
extern HAMLIB_EXPORT(const char *)
amp_get_info HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_get_level HAMLIB_PARAMS((AMP *amp, setting_t level, value_t *val));
extern HAMLIB_EXPORT(int)
amp_register HAMLIB_PARAMS((const struct amp_caps *caps));
extern HAMLIB_EXPORT(int)
amp_unregister HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct amp_caps *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
amp_load_backend HAMLIB_PARAMS((const char *be_name));
extern HAMLIB_EXPORT(int)
amp_check_backend HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_load_all_backends HAMLIB_PARAMS((void));
extern HAMLIB_EXPORT(amp_model_t)
amp_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
extern HAMLIB_EXPORT(int)
amp_token_foreach HAMLIB_PARAMS((AMP *amp,
int (*cfunc)(const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
amp_confparam_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(token_t)
amp_token_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(const struct amp_caps *)
amp_get_caps HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(setting_t)
amp_has_get_level HAMLIB_PARAMS((AMP *amp,
setting_t level));
extern HAMLIB_EXPORT(const struct confparams *)
amp_ext_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(int)
amp_get_ext_level HAMLIB_PARAMS((AMP *amp,
token_t token,
value_t *val));
extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t);
extern HAMLIB_EXPORT(const struct confparams *)
rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));
extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s);
extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t);
//! @endcond
/**
* \brief Convenience macro for generating debugging messages.
*
* \def amp_debug
*
* This is an alias of the rig_debug() function call and is used in the same
* manner.
*/
#define amp_debug rig_debug
__END_DECLS
#endif /* _AMPLIFIER_H */
/** @} */

120
hamlib/amplist.h 100644
Wyświetl plik

@ -0,0 +1,120 @@
/*
* Hamlib Interface - list of known amplifiers
* Copyright (c) 2000-2011 by Stephane Fillod
* Copyright (c) 2000-2002 by Frank Singleton
* Copyright (C) 2019 by Michael Black W9MDB. Derived from rotlist.h
*
*
* This library 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 library 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
*
*/
#ifndef _AMPLIST_H
#define _AMPLIST_H 1
//! @cond Doxygen_Suppress
#define AMP_MAKE_MODEL(a,b) ((a)*100+(b))
#define AMP_BACKEND_NUM(a) ((a)/100)
//! @endcond
/**
* \addtogroup amplifier
* @{
*/
/**
* \brief Hamlib amplifier model definitions.
*
* \file amplist.h
*
* This file contains amplifier model definitions for the Hamlib amplifier
* Application Programming Interface (API). Each distinct amplifier type has
* a unique model number (ID) and is used by Hamlib to identify and
* distinguish between the different hardware drivers. The exact model
* numbers can be acquired using the macros in this file. To obtain a list of
* supported amplifier branches, one can use the statically defined
* AMP_BACKEND_LIST macro (defined in configure.ac). To obtain a full list of
* supported amplifiers (including each model in every branch), the
* foreach_opened_amp() API function can be used.
*
* The model number, or ID, is used to tell Hamlib which amplifier the client
* wishes to use which is done with the amp_init() API call.
*/
/**
* \brief A macro that returns the model number for an unknown model.
*
* \def AMP_MODEL_NONE
*
* The none backend, as the name suggests, does nothing. It is mainly for
* internal use.
*/
#define AMP_MODEL_NONE 0
/**
* \brief A macro that returns the model number for the DUMMY backend.
*
* \def AMP_MODEL_DUMMY
*
* The DUMMY backend, as the name suggests, is a backend which performs no
* hardware operations and always behaves as one would expect. It can be
* thought of as a hardware simulator and is very useful for testing client
* applications.
*/
/**
* \brief A macro that returns the model number for the NETAMPCTL backend.
*
* \def AMP_MODEL_NETAMPCTL
*
* The NETAMPCTL backend allows use of the `ampctld` daemon through the normal
* Hamlib API.
*/
//! @cond Doxygen_Suppress
#define AMP_DUMMY 0
#define AMP_BACKEND_DUMMY "dummy"
//! @endcond
#define AMP_MODEL_DUMMY AMP_MAKE_MODEL(AMP_DUMMY, 1)
#define AMP_MODEL_NETAMPCTL AMP_MAKE_MODEL(AMP_DUMMY, 2)
/**
* \brief A macro that returns the model number of the KPA1500 backend.
*
* \def AMP_MODEL_ELECRAFT_KPA1500
*
* The KPA1500 backend can be used with amplifiers that support the Elecraft
* KPA-1500 protocol.
*/
//! @cond Doxygen_Suppress
#define AMP_ELECRAFT 2
#define AMP_BACKEND_ELECRAFT "elecraft"
//! @endcond
#define AMP_MODEL_ELECRAFT_KPA1500 AMP_MAKE_MODEL(AMP_ELECRAFT, 1)
//#define AMP_MODEL_ELECRAFT_KPA500 AMP_MAKE_MODEL(AMP_ELECRAFT, 2)
/**
* \brief Convenience type definition for an amplifier model.
*
* \typedef typedef int amp_model_t
*/
typedef int amp_model_t;
#endif /* _AMPLIST_H */
/** @} */

Plik binarny nie jest wyświetlany.

3196
hamlib/rig.h 100644

Plik diff jest za duży Load Diff

90
hamlib/rig_dll.h 100644
Wyświetl plik

@ -0,0 +1,90 @@
/*
* Hamlib Win32 DLL build definitions
* Copyright (c) 2001-2009 by Stephane Fillod
*
*
* This library 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 library 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
*
*/
/*
* Provide definitions to compile in Windows
* using C-friendly options, e.g.
*
* HAMLIB_API -> __cdecl
* HAMLIB_EXPORT, HAMLIB_EXPORT_VAR -> __declspec(dllexport)
* BACKEND_EXPORT, BACKEND_EXPORT_VAR -> __declspec(dllexport)
*
* No effect in non-Windows environments.
*/
#if defined(_WIN32) && !defined(__CYGWIN__)
# undef HAMLIB_IMPEXP
# undef HAMLIB_CPP_IMPEXP
# undef HAMLIB_API
# undef HAMLIB_EXPORT
# undef HAMLIB_EXPORT_VAR
# undef BACKEND_EXPORT
# undef BACKEND_EXPORT_VAR
# undef HAMLIB_DLL_IMPORT
# undef HAMLIB_DLL_EXPORT
# if defined (__BORLANDC__)
# define HAMLIB_DLL_IMPORT __import
# define HAMLIB_DLL_EXPORT __export
# else
# define HAMLIB_DLL_IMPORT __declspec(dllimport)
# define HAMLIB_DLL_EXPORT __declspec(dllexport)
# endif
# ifdef DLL_EXPORT
/* HAMLIB_API may be set to __stdcall for VB, .. */
# define HAMLIB_API __cdecl
# ifdef IN_HAMLIB
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT
# define HAMLIB_IMPEXP HAMLIB_DLL_EXPORT
# else
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_IMPORT
# define HAMLIB_IMPEXP HAMLIB_DLL_IMPORT
# endif
# else
/* static build, only export the backend entry points for lt_dlsym */
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT
# endif
#endif
/* Take care of non-cygwin platforms */
#if !defined(HAMLIB_IMPEXP)
# define HAMLIB_IMPEXP
#endif
#if !defined(HAMLIB_CPP_IMPEXP)
# define HAMLIB_CPP_IMPEXP
#endif
#if !defined(HAMLIB_API)
# define HAMLIB_API
#endif
#if !defined(HAMLIB_EXPORT)
# define HAMLIB_EXPORT(type) HAMLIB_IMPEXP type HAMLIB_API
#endif
#if !defined(HAMLIB_EXPORT_VAR)
# define HAMLIB_EXPORT_VAR(type) HAMLIB_IMPEXP type
#endif
#if !defined(BACKEND_EXPORT)
# define BACKEND_EXPORT(type) HAMLIB_CPP_IMPEXP type HAMLIB_API
#endif
#if !defined(BACKEND_EXPORT_VAR)
# define BACKEND_EXPORT_VAR(type) HAMLIB_CPP_IMPEXP type
#endif

662
hamlib/riglist.h 100644
Wyświetl plik

@ -0,0 +1,662 @@
/*
* Hamlib Interface - list of known rigs
* Copyright (c) 2000-2003 by Frank Singleton
* Copyright (c) 2000-2015 by Stephane Fillod
*
*
* This library 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 library 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
*
*/
#ifndef _RIGLIST_H
#define _RIGLIST_H 1
//! @cond Doxygen_Suppress
// The rig model number is designed to fit in a 32-bit int
// As of 2020-02-18 we have 33 backends defined
// With a max of 1000 models per backend we get total a model number range of 1001-33001
// This MAX was 100 prior to 2020-02-18 and Icom was close to running out of the 100 range
#define MAX_MODELS_PER_BACKEND 1000
#define RIG_MAKE_MODEL(a,b) ((a)*MAX_MODELS_PER_BACKEND+(b))
#define RIG_BACKEND_NUM(a) ((a)/MAX_MODELS_PER_BACKEND)
/*! \file riglist.h
* \brief Hamlib rig(radio) model definitions.
*
* This file contains rig model definitions for the Hamlib rig API. Each
* distinct rig type has a unique model number (ID) and is used by hamlib to
* identify and distinguish between the different hardware drivers. The
* exact model numbers can be acquired using the macros in this file. To
* obtain a list of supported rig branches, one can use the statically
* defined RIG_BACKEND_LIST macro. To obtain a full list of supported rig
* (including each model in every branch), the foreach_opened_rig() API
* function can be used.
*
* The model number, or ID, is used to tell hamlib, which rig the client
* whishes to use. It is done with the rig_init() API call.
*/
#define RIG_MODEL_NONE 0
/*! \def RIG_MODEL_DUMMY
* \brief A macro that returns the model number for the dummy backend.
*
* The dummy backend, as the name suggests, is a backend which performs no
* hardware operations and always behaves as one would expect. It can be
* thought of as a hardware simulator and is very useful for testing client
* applications.
*
* It has also been expanded to provide support to "virtual" type of rigs
* such as the network rig control backend and W1HKJ's Flrig application.
*/
#define RIG_DUMMY 0
#define RIG_BACKEND_DUMMY "dummy"
#define RIG_MODEL_DUMMY RIG_MAKE_MODEL(RIG_DUMMY, 1)
#define RIG_MODEL_NETRIGCTL RIG_MAKE_MODEL(RIG_DUMMY, 2)
#define RIG_MODEL_ARMSTRONG RIG_MAKE_MODEL(RIG_DUMMY, 3)
#define RIG_MODEL_FLRIG RIG_MAKE_MODEL(RIG_DUMMY, 4)
#define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5)
#define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6)
#define RIG_MODEL_TCI1X RIG_MAKE_MODEL(RIG_DUMMY, 7)
/*
* Yaesu
*/
#define RIG_YAESU 1
#define RIG_BACKEND_YAESU "yaesu"
#define RIG_MODEL_FT847 RIG_MAKE_MODEL(RIG_YAESU, 1)
#define RIG_MODEL_FT1000 RIG_MAKE_MODEL(RIG_YAESU, 2)
#define RIG_MODEL_FT1000D RIG_MAKE_MODEL(RIG_YAESU, 3)
#define RIG_MODEL_FT1000MPMKV RIG_MAKE_MODEL(RIG_YAESU, 4)
#define RIG_MODEL_FT747 RIG_MAKE_MODEL(RIG_YAESU, 5)
#define RIG_MODEL_FT757 RIG_MAKE_MODEL(RIG_YAESU, 6)
#define RIG_MODEL_FT757GXII RIG_MAKE_MODEL(RIG_YAESU, 7)
#define RIG_MODEL_FT575 RIG_MAKE_MODEL(RIG_YAESU, 8)
#define RIG_MODEL_FT767 RIG_MAKE_MODEL(RIG_YAESU, 9)
#define RIG_MODEL_FT736R RIG_MAKE_MODEL(RIG_YAESU, 10)
#define RIG_MODEL_FT840 RIG_MAKE_MODEL(RIG_YAESU, 11)
#define RIG_MODEL_FT820 RIG_MAKE_MODEL(RIG_YAESU, 12)
#define RIG_MODEL_FT900 RIG_MAKE_MODEL(RIG_YAESU, 13)
#define RIG_MODEL_FT920 RIG_MAKE_MODEL(RIG_YAESU, 14)
#define RIG_MODEL_FT890 RIG_MAKE_MODEL(RIG_YAESU, 15)
#define RIG_MODEL_FT990 RIG_MAKE_MODEL(RIG_YAESU, 16)
#define RIG_MODEL_FRG100 RIG_MAKE_MODEL(RIG_YAESU, 17)
#define RIG_MODEL_FRG9600 RIG_MAKE_MODEL(RIG_YAESU, 18)
#define RIG_MODEL_FRG8800 RIG_MAKE_MODEL(RIG_YAESU, 19)
#define RIG_MODEL_FT817 RIG_MAKE_MODEL(RIG_YAESU, 20)
#define RIG_MODEL_FT100 RIG_MAKE_MODEL(RIG_YAESU, 21)
#define RIG_MODEL_FT857 RIG_MAKE_MODEL(RIG_YAESU, 22)
#define RIG_MODEL_FT897 RIG_MAKE_MODEL(RIG_YAESU, 23)
#define RIG_MODEL_FT1000MP RIG_MAKE_MODEL(RIG_YAESU, 24)
#define RIG_MODEL_FT1000MPMKVFLD RIG_MAKE_MODEL(RIG_YAESU, 25)
#define RIG_MODEL_VR5000 RIG_MAKE_MODEL(RIG_YAESU, 26)
#define RIG_MODEL_FT450 RIG_MAKE_MODEL(RIG_YAESU, 27)
#define RIG_MODEL_FT950 RIG_MAKE_MODEL(RIG_YAESU, 28)
#define RIG_MODEL_FT2000 RIG_MAKE_MODEL(RIG_YAESU, 29)
#define RIG_MODEL_FT9000 RIG_MAKE_MODEL(RIG_YAESU, 30)
#define RIG_MODEL_FT980 RIG_MAKE_MODEL(RIG_YAESU, 31)
#define RIG_MODEL_FTDX5000 RIG_MAKE_MODEL(RIG_YAESU, 32)
#define RIG_MODEL_VX1700 RIG_MAKE_MODEL(RIG_YAESU, 33)
#define RIG_MODEL_FTDX1200 RIG_MAKE_MODEL(RIG_YAESU, 34)
#define RIG_MODEL_FT991 RIG_MAKE_MODEL(RIG_YAESU, 35)
#define RIG_MODEL_FT891 RIG_MAKE_MODEL(RIG_YAESU, 36)
#define RIG_MODEL_FTDX3000 RIG_MAKE_MODEL(RIG_YAESU, 37)
#define RIG_MODEL_FT847UNI RIG_MAKE_MODEL(RIG_YAESU, 38)
#define RIG_MODEL_FT600 RIG_MAKE_MODEL(RIG_YAESU, 39)
#define RIG_MODEL_FTDX101D RIG_MAKE_MODEL(RIG_YAESU, 40)
#define RIG_MODEL_FT818 RIG_MAKE_MODEL(RIG_YAESU, 41)
#define RIG_MODEL_FTDX10 RIG_MAKE_MODEL(RIG_YAESU, 42)
#define RIG_MODEL_FT897D RIG_MAKE_MODEL(RIG_YAESU, 43)
#define RIG_MODEL_FTDX101MP RIG_MAKE_MODEL(RIG_YAESU, 44)
#define RIG_MODEL_MCHFQRP RIG_MAKE_MODEL(RIG_YAESU, 45)
/*
* Kenwood
*/
#define RIG_KENWOOD 2
#define RIG_BACKEND_KENWOOD "kenwood"
#define RIG_MODEL_TS50 RIG_MAKE_MODEL(RIG_KENWOOD, 1)
#define RIG_MODEL_TS440 RIG_MAKE_MODEL(RIG_KENWOOD, 2)
#define RIG_MODEL_TS450S RIG_MAKE_MODEL(RIG_KENWOOD, 3)
#define RIG_MODEL_TS570D RIG_MAKE_MODEL(RIG_KENWOOD, 4)
#define RIG_MODEL_TS690S RIG_MAKE_MODEL(RIG_KENWOOD, 5)
#define RIG_MODEL_TS711 RIG_MAKE_MODEL(RIG_KENWOOD, 6)
#define RIG_MODEL_TS790 RIG_MAKE_MODEL(RIG_KENWOOD, 7)
#define RIG_MODEL_TS811 RIG_MAKE_MODEL(RIG_KENWOOD, 8)
#define RIG_MODEL_TS850 RIG_MAKE_MODEL(RIG_KENWOOD, 9)
#define RIG_MODEL_TS870S RIG_MAKE_MODEL(RIG_KENWOOD, 10)
#define RIG_MODEL_TS940 RIG_MAKE_MODEL(RIG_KENWOOD, 11)
#define RIG_MODEL_TS950S RIG_MAKE_MODEL(RIG_KENWOOD, 12)
#define RIG_MODEL_TS950SDX RIG_MAKE_MODEL(RIG_KENWOOD, 13)
#define RIG_MODEL_TS2000 RIG_MAKE_MODEL(RIG_KENWOOD, 14)
#define RIG_MODEL_R5000 RIG_MAKE_MODEL(RIG_KENWOOD, 15)
#define RIG_MODEL_TS570S RIG_MAKE_MODEL(RIG_KENWOOD, 16)
#define RIG_MODEL_THD7A RIG_MAKE_MODEL(RIG_KENWOOD, 17)
#define RIG_MODEL_THD7AG RIG_MAKE_MODEL(RIG_KENWOOD, 18)
#define RIG_MODEL_THF6A RIG_MAKE_MODEL(RIG_KENWOOD, 19)
#define RIG_MODEL_THF7E RIG_MAKE_MODEL(RIG_KENWOOD, 20)
#define RIG_MODEL_K2 RIG_MAKE_MODEL(RIG_KENWOOD, 21)
#define RIG_MODEL_TS930 RIG_MAKE_MODEL(RIG_KENWOOD, 22)
#define RIG_MODEL_THG71 RIG_MAKE_MODEL(RIG_KENWOOD, 23)
#define RIG_MODEL_TS680S RIG_MAKE_MODEL(RIG_KENWOOD, 24)
#define RIG_MODEL_TS140S RIG_MAKE_MODEL(RIG_KENWOOD, 25)
#define RIG_MODEL_TMD700 RIG_MAKE_MODEL(RIG_KENWOOD, 26)
#define RIG_MODEL_TMV7 RIG_MAKE_MODEL(RIG_KENWOOD, 27)
#define RIG_MODEL_TS480 RIG_MAKE_MODEL(RIG_KENWOOD, 28)
#define RIG_MODEL_K3 RIG_MAKE_MODEL(RIG_KENWOOD, 29)
#define RIG_MODEL_TRC80 RIG_MAKE_MODEL(RIG_KENWOOD, 30)
#define RIG_MODEL_TS590S RIG_MAKE_MODEL(RIG_KENWOOD, 31)
#define RIG_MODEL_TRANSFOX RIG_MAKE_MODEL(RIG_KENWOOD, 32) /* SigFox Transfox */
#define RIG_MODEL_THD72A RIG_MAKE_MODEL(RIG_KENWOOD, 33)
#define RIG_MODEL_TMD710 RIG_MAKE_MODEL(RIG_KENWOOD, 34)
#define RIG_MODEL_TMV71 RIG_MAKE_MODEL(RIG_KENWOOD, 35)
#define RIG_MODEL_F6K RIG_MAKE_MODEL(RIG_KENWOOD, 36) /* Flex 6000 Series */
#define RIG_MODEL_TS590SG RIG_MAKE_MODEL(RIG_KENWOOD, 37)
#define RIG_MODEL_XG3 RIG_MAKE_MODEL(RIG_KENWOOD, 38) /* Elecraft XG-3 signal generator */
#define RIG_MODEL_TS990S RIG_MAKE_MODEL(RIG_KENWOOD, 39)
#define RIG_MODEL_HPSDR RIG_MAKE_MODEL(RIG_KENWOOD, 40) /* OpenHPSDR, PiHPSDR */
#define RIG_MODEL_TS890S RIG_MAKE_MODEL(RIG_KENWOOD, 41)
#define RIG_MODEL_THD74 RIG_MAKE_MODEL(RIG_KENWOOD, 42)
#define RIG_MODEL_K3S RIG_MAKE_MODEL(RIG_KENWOOD, 43)
#define RIG_MODEL_KX2 RIG_MAKE_MODEL(RIG_KENWOOD, 44)
#define RIG_MODEL_KX3 RIG_MAKE_MODEL(RIG_KENWOOD, 45)
#define RIG_MODEL_PT8000A RIG_MAKE_MODEL(RIG_KENWOOD, 46)
#define RIG_MODEL_K4 RIG_MAKE_MODEL(RIG_KENWOOD, 47)
#define RIG_MODEL_POWERSDR RIG_MAKE_MODEL(RIG_KENWOOD, 48)
#define RIG_MODEL_MALACHITE RIG_MAKE_MODEL(RIG_KENWOOD, 49)
/*
* Icom
*/
#define RIG_ICOM 3
#define RIG_BACKEND_ICOM "icom"
#define RIG_MODEL_IC1271 RIG_MAKE_MODEL(RIG_ICOM, 1)
#define RIG_MODEL_IC1275 RIG_MAKE_MODEL(RIG_ICOM, 2)
#define RIG_MODEL_IC271 RIG_MAKE_MODEL(RIG_ICOM, 3)
#define RIG_MODEL_IC275 RIG_MAKE_MODEL(RIG_ICOM, 4)
#define RIG_MODEL_IC375 RIG_MAKE_MODEL(RIG_ICOM, 5)
#define RIG_MODEL_IC471 RIG_MAKE_MODEL(RIG_ICOM, 6)
#define RIG_MODEL_IC475 RIG_MAKE_MODEL(RIG_ICOM, 7)
#define RIG_MODEL_IC575 RIG_MAKE_MODEL(RIG_ICOM, 8)
#define RIG_MODEL_IC706 RIG_MAKE_MODEL(RIG_ICOM, 9)
#define RIG_MODEL_IC706MKII RIG_MAKE_MODEL(RIG_ICOM, 10)
#define RIG_MODEL_IC706MKIIG RIG_MAKE_MODEL(RIG_ICOM, 11)
#define RIG_MODEL_IC707 RIG_MAKE_MODEL(RIG_ICOM, 12)
#define RIG_MODEL_IC718 RIG_MAKE_MODEL(RIG_ICOM, 13)
#define RIG_MODEL_IC725 RIG_MAKE_MODEL(RIG_ICOM, 14)
#define RIG_MODEL_IC726 RIG_MAKE_MODEL(RIG_ICOM, 15)
#define RIG_MODEL_IC728 RIG_MAKE_MODEL(RIG_ICOM, 16)
#define RIG_MODEL_IC729 RIG_MAKE_MODEL(RIG_ICOM, 17)
#define RIG_MODEL_IC731 RIG_MAKE_MODEL(RIG_ICOM, 18)
#define RIG_MODEL_IC735 RIG_MAKE_MODEL(RIG_ICOM, 19)
#define RIG_MODEL_IC736 RIG_MAKE_MODEL(RIG_ICOM, 20)
#define RIG_MODEL_IC737 RIG_MAKE_MODEL(RIG_ICOM, 21)
#define RIG_MODEL_IC738 RIG_MAKE_MODEL(RIG_ICOM, 22)
#define RIG_MODEL_IC746 RIG_MAKE_MODEL(RIG_ICOM, 23)
#define RIG_MODEL_IC751 RIG_MAKE_MODEL(RIG_ICOM, 24)
#define RIG_MODEL_IC751A RIG_MAKE_MODEL(RIG_ICOM, 25)
#define RIG_MODEL_IC756 RIG_MAKE_MODEL(RIG_ICOM, 26)
#define RIG_MODEL_IC756PRO RIG_MAKE_MODEL(RIG_ICOM, 27)
#define RIG_MODEL_IC761 RIG_MAKE_MODEL(RIG_ICOM, 28)
#define RIG_MODEL_IC765 RIG_MAKE_MODEL(RIG_ICOM, 29)
#define RIG_MODEL_IC775 RIG_MAKE_MODEL(RIG_ICOM, 30)
#define RIG_MODEL_IC781 RIG_MAKE_MODEL(RIG_ICOM, 31)
#define RIG_MODEL_IC820 RIG_MAKE_MODEL(RIG_ICOM, 32)
//#define RIG_MODEL_IC821 RIG_MAKE_MODEL(RIG_ICOM, 33) // not implemented and can be reused
#define RIG_MODEL_IC821H RIG_MAKE_MODEL(RIG_ICOM, 34)
#define RIG_MODEL_IC970 RIG_MAKE_MODEL(RIG_ICOM, 35)
#define RIG_MODEL_ICR10 RIG_MAKE_MODEL(RIG_ICOM, 36)
#define RIG_MODEL_ICR71 RIG_MAKE_MODEL(RIG_ICOM, 37)
#define RIG_MODEL_ICR72 RIG_MAKE_MODEL(RIG_ICOM, 38)
#define RIG_MODEL_ICR75 RIG_MAKE_MODEL(RIG_ICOM, 39)
#define RIG_MODEL_ICR7000 RIG_MAKE_MODEL(RIG_ICOM, 40)
#define RIG_MODEL_ICR7100 RIG_MAKE_MODEL(RIG_ICOM, 41)
#define RIG_MODEL_ICR8500 RIG_MAKE_MODEL(RIG_ICOM, 42)
#define RIG_MODEL_ICR9000 RIG_MAKE_MODEL(RIG_ICOM, 43)
#define RIG_MODEL_IC910 RIG_MAKE_MODEL(RIG_ICOM, 44)
#define RIG_MODEL_IC78 RIG_MAKE_MODEL(RIG_ICOM, 45)
#define RIG_MODEL_IC746PRO RIG_MAKE_MODEL(RIG_ICOM, 46)
#define RIG_MODEL_IC756PROII RIG_MAKE_MODEL(RIG_ICOM, 47) /* 48-53 defined below */
#define RIG_MODEL_ICID1 RIG_MAKE_MODEL(RIG_ICOM, 54)
#define RIG_MODEL_IC703 RIG_MAKE_MODEL(RIG_ICOM, 55)
#define RIG_MODEL_IC7800 RIG_MAKE_MODEL(RIG_ICOM, 56)
#define RIG_MODEL_IC756PROIII RIG_MAKE_MODEL(RIG_ICOM, 57)
#define RIG_MODEL_ICR20 RIG_MAKE_MODEL(RIG_ICOM, 58) /* 59 defined below */
#define RIG_MODEL_IC7000 RIG_MAKE_MODEL(RIG_ICOM, 60)
#define RIG_MODEL_IC7200 RIG_MAKE_MODEL(RIG_ICOM, 61)
#define RIG_MODEL_IC7700 RIG_MAKE_MODEL(RIG_ICOM, 62)
#define RIG_MODEL_IC7600 RIG_MAKE_MODEL(RIG_ICOM, 63) /* 64 defined below */
#define RIG_MODEL_IC92D RIG_MAKE_MODEL(RIG_ICOM, 65)
#define RIG_MODEL_ICR9500 RIG_MAKE_MODEL(RIG_ICOM, 66)
#define RIG_MODEL_IC7410 RIG_MAKE_MODEL(RIG_ICOM, 67)
#define RIG_MODEL_IC9100 RIG_MAKE_MODEL(RIG_ICOM, 68)
#define RIG_MODEL_ICRX7 RIG_MAKE_MODEL(RIG_ICOM, 69)
#define RIG_MODEL_IC7100 RIG_MAKE_MODEL(RIG_ICOM, 70)
#define RIG_MODEL_ID5100 RIG_MAKE_MODEL(RIG_ICOM, 71)
#define RIG_MODEL_IC2730 RIG_MAKE_MODEL(RIG_ICOM, 72)
#define RIG_MODEL_IC7300 RIG_MAKE_MODEL(RIG_ICOM, 73)
#define RIG_MODEL_PERSEUS RIG_MAKE_MODEL(RIG_ICOM, 74)
#define RIG_MODEL_IC785x RIG_MAKE_MODEL(RIG_ICOM, 75)
#define RIG_MODEL_X108G RIG_MAKE_MODEL(RIG_ICOM, 76) /* Xiegu X108 */
#define RIG_MODEL_ICR6 RIG_MAKE_MODEL(RIG_ICOM, 77)
#define RIG_MODEL_IC7610 RIG_MAKE_MODEL(RIG_ICOM, 78)
#define RIG_MODEL_ICR8600 RIG_MAKE_MODEL(RIG_ICOM, 79)
#define RIG_MODEL_ICR30 RIG_MAKE_MODEL(RIG_ICOM, 80)
#define RIG_MODEL_IC9700 RIG_MAKE_MODEL(RIG_ICOM, 81)
#define RIG_MODEL_ID4100 RIG_MAKE_MODEL(RIG_ICOM, 82)
#define RIG_MODEL_ID31 RIG_MAKE_MODEL(RIG_ICOM, 83)
#define RIG_MODEL_ID51 RIG_MAKE_MODEL(RIG_ICOM, 84)
#define RIG_MODEL_IC705 RIG_MAKE_MODEL(RIG_ICOM, 85)
/* next one is 86 */
/*
* Optoelectronics (CI-V)
*/
#define RIG_MODEL_MINISCOUT RIG_MAKE_MODEL(RIG_ICOM, 48)
#define RIG_MODEL_XPLORER RIG_MAKE_MODEL(RIG_ICOM, 49)
#define RIG_MODEL_OS535 RIG_MAKE_MODEL(RIG_ICOM, 52)
#define RIG_MODEL_OS456 RIG_MAKE_MODEL(RIG_ICOM, 53)
/*
* TenTec (CI-V)
*/
#define RIG_MODEL_OMNIVI RIG_MAKE_MODEL(RIG_ICOM, 50)
#define RIG_MODEL_OMNIVIP RIG_MAKE_MODEL(RIG_ICOM, 51) /* OMNI-VI+ */
#define RIG_MODEL_PARAGON2 RIG_MAKE_MODEL(RIG_ICOM, 59)
#define RIG_MODEL_DELTAII RIG_MAKE_MODEL(RIG_ICOM, 64)
/*
* Icom PCR
*/
#define RIG_PCR 4
#define RIG_BACKEND_PCR "pcr"
#define RIG_MODEL_PCR1000 RIG_MAKE_MODEL(RIG_PCR, 1)
#define RIG_MODEL_PCR100 RIG_MAKE_MODEL(RIG_PCR, 2)
#define RIG_MODEL_PCR1500 RIG_MAKE_MODEL(RIG_PCR, 3)
#define RIG_MODEL_PCR2500 RIG_MAKE_MODEL(RIG_PCR, 4)
/*
* AOR
*/
#define RIG_AOR 5
#define RIG_BACKEND_AOR "aor"
#define RIG_MODEL_AR8200 RIG_MAKE_MODEL(RIG_AOR, 1)
#define RIG_MODEL_AR8000 RIG_MAKE_MODEL(RIG_AOR, 2)
#define RIG_MODEL_AR7030 RIG_MAKE_MODEL(RIG_AOR, 3)
#define RIG_MODEL_AR5000 RIG_MAKE_MODEL(RIG_AOR, 4)
#define RIG_MODEL_AR3030 RIG_MAKE_MODEL(RIG_AOR, 5)
#define RIG_MODEL_AR3000A RIG_MAKE_MODEL(RIG_AOR, 6)
#define RIG_MODEL_AR3000 RIG_MAKE_MODEL(RIG_AOR, 7)
#define RIG_MODEL_AR2700 RIG_MAKE_MODEL(RIG_AOR, 8)
#define RIG_MODEL_AR2500 RIG_MAKE_MODEL(RIG_AOR, 9)
#define RIG_MODEL_AR16 RIG_MAKE_MODEL(RIG_AOR, 10)
#define RIG_MODEL_SDU5500 RIG_MAKE_MODEL(RIG_AOR, 11)
#define RIG_MODEL_SDU5000 RIG_MAKE_MODEL(RIG_AOR, 12)
#define RIG_MODEL_AR8600 RIG_MAKE_MODEL(RIG_AOR, 13)
#define RIG_MODEL_AR5000A RIG_MAKE_MODEL(RIG_AOR, 14)
#define RIG_MODEL_AR7030P RIG_MAKE_MODEL(RIG_AOR, 15)
#define RIG_MODEL_SR2200 RIG_MAKE_MODEL(RIG_AOR, 16)
/*
* JRC
*/
#define RIG_JRC 6
#define RIG_BACKEND_JRC "jrc"
#define RIG_MODEL_JST145 RIG_MAKE_MODEL(RIG_JRC, 1)
#define RIG_MODEL_JST245 RIG_MAKE_MODEL(RIG_JRC, 2)
#define RIG_MODEL_CMH530 RIG_MAKE_MODEL(RIG_JRC, 3)
#define RIG_MODEL_NRD345 RIG_MAKE_MODEL(RIG_JRC, 4)
#define RIG_MODEL_NRD525 RIG_MAKE_MODEL(RIG_JRC, 5)
#define RIG_MODEL_NRD535 RIG_MAKE_MODEL(RIG_JRC, 6)
#define RIG_MODEL_NRD545 RIG_MAKE_MODEL(RIG_JRC, 7)
/*
* Radio Shack
* Actually, they might be either Icom or Uniden. TBC --SF
*/
#define RIG_RADIOSHACK 7
#define RIG_BACKEND_RADIOSHACK "radioshack"
#define RIG_MODEL_RS64 RIG_MAKE_MODEL(RIG_RADIOSHACK, 1) /* PRO-64 */
#define RIG_MODEL_RS2005 RIG_MAKE_MODEL(RIG_RADIOSHACK, 2) /* w/ OptoElectronics OS456 Board */
#define RIG_MODEL_RS2006 RIG_MAKE_MODEL(RIG_RADIOSHACK, 3) /* w/ OptoElectronics OS456 Board */
#define RIG_MODEL_RS2035 RIG_MAKE_MODEL(RIG_RADIOSHACK, 4) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2042 RIG_MAKE_MODEL(RIG_RADIOSHACK, 5) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2041 RIG_MAKE_MODEL(RIG_RADIOSHACK, 6) /* PRO-2041 */
/*
* Uniden
*/
#define RIG_UNIDEN 8
#define RIG_BACKEND_UNIDEN "uniden"
#define RIG_MODEL_BC780 RIG_MAKE_MODEL(RIG_UNIDEN, 1) /* Uniden BC780 - Trunk Tracker "Desktop Radio" */
#define RIG_MODEL_BC245 RIG_MAKE_MODEL(RIG_UNIDEN, 2)
#define RIG_MODEL_BC895 RIG_MAKE_MODEL(RIG_UNIDEN, 3)
#define RIG_MODEL_PRO2052 RIG_MAKE_MODEL(RIG_UNIDEN, 4) /* Radio Shack PRO-2052 */
#define RIG_MODEL_BC235 RIG_MAKE_MODEL(RIG_UNIDEN, 5)
#define RIG_MODEL_BC250 RIG_MAKE_MODEL(RIG_UNIDEN, 6)
#define RIG_MODEL_BC785 RIG_MAKE_MODEL(RIG_UNIDEN, 7)
#define RIG_MODEL_BC786 RIG_MAKE_MODEL(RIG_UNIDEN, 8)
#define RIG_MODEL_BCT8 RIG_MAKE_MODEL(RIG_UNIDEN, 9)
#define RIG_MODEL_BCD396T RIG_MAKE_MODEL(RIG_UNIDEN, 10)
#define RIG_MODEL_BCD996T RIG_MAKE_MODEL(RIG_UNIDEN, 11)
#define RIG_MODEL_BC898 RIG_MAKE_MODEL(RIG_UNIDEN, 12)
/*
* Drake
*/
#define RIG_DRAKE 9
#define RIG_BACKEND_DRAKE "drake"
#define RIG_MODEL_DKR8 RIG_MAKE_MODEL(RIG_DRAKE, 1)
#define RIG_MODEL_DKR8A RIG_MAKE_MODEL(RIG_DRAKE, 2)
#define RIG_MODEL_DKR8B RIG_MAKE_MODEL(RIG_DRAKE, 3)
/*
* Lowe
*/
#define RIG_LOWE 10
#define RIG_BACKEND_LOWE "lowe"
#define RIG_MODEL_HF150 RIG_MAKE_MODEL(RIG_LOWE, 1)
#define RIG_MODEL_HF225 RIG_MAKE_MODEL(RIG_LOWE, 2)
#define RIG_MODEL_HF250 RIG_MAKE_MODEL(RIG_LOWE, 3)
#define RIG_MODEL_HF235 RIG_MAKE_MODEL(RIG_LOWE, 4)
/*
* Racal
*/
#define RIG_RACAL 11
#define RIG_BACKEND_RACAL "racal"
#define RIG_MODEL_RA3790 RIG_MAKE_MODEL(RIG_RACAL, 1)
#define RIG_MODEL_RA3720 RIG_MAKE_MODEL(RIG_RACAL, 2)
#define RIG_MODEL_RA6790 RIG_MAKE_MODEL(RIG_RACAL, 3)
#define RIG_MODEL_RA3710 RIG_MAKE_MODEL(RIG_RACAL, 4)
#define RIG_MODEL_RA3702 RIG_MAKE_MODEL(RIG_RACAL, 5)
/*
* Watkins-Johnson
*/
#define RIG_WJ 12
#define RIG_BACKEND_WJ "wj"
#define RIG_MODEL_HF1000 RIG_MAKE_MODEL(RIG_WJ, 1)
#define RIG_MODEL_HF1000A RIG_MAKE_MODEL(RIG_WJ, 2)
#define RIG_MODEL_WJ8711 RIG_MAKE_MODEL(RIG_WJ, 3)
#define RIG_MODEL_WJ8888 RIG_MAKE_MODEL(RIG_WJ, 4)
/*
* Rohde & Schwarz--ek
*/
#define RIG_EK 13
#define RIG_BACKEND_EK "ek"
#define RIG_MODEL_ESM500 RIG_MAKE_MODEL(RIG_EK, 1)
#define RIG_MODEL_EK890 RIG_MAKE_MODEL(RIG_EK, 2)
#define RIG_MODEL_EK891 RIG_MAKE_MODEL(RIG_EK, 3)
#define RIG_MODEL_EK895 RIG_MAKE_MODEL(RIG_EK, 4)
#define RIG_MODEL_EK070 RIG_MAKE_MODEL(RIG_EK, 5)
/*
* Skanti
*/
#define RIG_SKANTI 14
#define RIG_BACKEND_SKANTI "skanti"
#define RIG_MODEL_TRP7000 RIG_MAKE_MODEL(RIG_SKANTI, 1)
#define RIG_MODEL_TRP8000 RIG_MAKE_MODEL(RIG_SKANTI, 2)
#define RIG_MODEL_TRP9000 RIG_MAKE_MODEL(RIG_SKANTI, 3)
#define RIG_MODEL_TRP8255 RIG_MAKE_MODEL(RIG_SKANTI, 4)
/*
* WiNRADiO/LinRADiO
*/
#define RIG_WINRADIO 15
#define RIG_BACKEND_WINRADIO "winradio"
#define RIG_MODEL_WR1000 RIG_MAKE_MODEL(RIG_WINRADIO, 1)
#define RIG_MODEL_WR1500 RIG_MAKE_MODEL(RIG_WINRADIO, 2)
#define RIG_MODEL_WR1550 RIG_MAKE_MODEL(RIG_WINRADIO, 3)
#define RIG_MODEL_WR3100 RIG_MAKE_MODEL(RIG_WINRADIO, 4)
#define RIG_MODEL_WR3150 RIG_MAKE_MODEL(RIG_WINRADIO, 5)
#define RIG_MODEL_WR3500 RIG_MAKE_MODEL(RIG_WINRADIO, 6)
#define RIG_MODEL_WR3700 RIG_MAKE_MODEL(RIG_WINRADIO, 7)
#define RIG_MODEL_G303 RIG_MAKE_MODEL(RIG_WINRADIO, 8)
#define RIG_MODEL_G313 RIG_MAKE_MODEL(RIG_WINRADIO, 9)
#define RIG_MODEL_G305 RIG_MAKE_MODEL(RIG_WINRADIO, 10)
#define RIG_MODEL_G315 RIG_MAKE_MODEL(RIG_WINRADIO, 11)
/*
* Ten Tec
*/
#define RIG_TENTEC 16
#define RIG_BACKEND_TENTEC "tentec"
#define RIG_MODEL_TT550 RIG_MAKE_MODEL(RIG_TENTEC, 1) /* Pegasus */
#define RIG_MODEL_TT538 RIG_MAKE_MODEL(RIG_TENTEC, 2) /* Jupiter */
#define RIG_MODEL_RX320 RIG_MAKE_MODEL(RIG_TENTEC, 3)
#define RIG_MODEL_RX340 RIG_MAKE_MODEL(RIG_TENTEC, 4)
#define RIG_MODEL_RX350 RIG_MAKE_MODEL(RIG_TENTEC, 5)
#define RIG_MODEL_TT526 RIG_MAKE_MODEL(RIG_TENTEC, 6) /* 6N2 */
#define RIG_MODEL_TT516 RIG_MAKE_MODEL(RIG_TENTEC, 7) /* Argonaut V */
#define RIG_MODEL_TT565 RIG_MAKE_MODEL(RIG_TENTEC, 8) /* Orion */
#define RIG_MODEL_TT585 RIG_MAKE_MODEL(RIG_TENTEC, 9) /* Paragon */
#define RIG_MODEL_TT588 RIG_MAKE_MODEL(RIG_TENTEC, 11) /* Omni-VII */
#define RIG_MODEL_RX331 RIG_MAKE_MODEL(RIG_TENTEC, 12)
#define RIG_MODEL_TT599 RIG_MAKE_MODEL(RIG_TENTEC, 13) /* Eagle */
/*
* Alinco
*/
#define RIG_ALINCO 17
#define RIG_BACKEND_ALINCO "alinco"
#define RIG_MODEL_DX77 RIG_MAKE_MODEL(RIG_ALINCO, 1)
#define RIG_MODEL_DXSR8 RIG_MAKE_MODEL(RIG_ALINCO, 2)
/*
* Kachina
*/
#define RIG_KACHINA 18
#define RIG_BACKEND_KACHINA "kachina"
#define RIG_MODEL_505DSP RIG_MAKE_MODEL(RIG_KACHINA, 1)
/*
* Gnuradio backend
*/
#define RIG_GNURADIO 20
#define RIG_BACKEND_GNURADIO "gnuradio"
#define RIG_MODEL_GNURADIO RIG_MAKE_MODEL(RIG_GNURADIO, 1) /* dev model, Chirp source */
#define RIG_MODEL_MC4020 RIG_MAKE_MODEL(RIG_GNURADIO, 2) /* MC4020 */
#define RIG_MODEL_GRAUDIO RIG_MAKE_MODEL(RIG_GNURADIO, 3) /* Sound card source */
#define RIG_MODEL_GRAUDIOIQ RIG_MAKE_MODEL(RIG_GNURADIO, 4) /* I&Q stereo sound card source */
#define RIG_MODEL_USRP_G RIG_MAKE_MODEL(RIG_GNURADIO, 5) /* Universal Software Radio Peripheral */
/*
* Microtune tuners
*/
#define RIG_MICROTUNE 21
#define RIG_BACKEND_MICROTUNE "microtune"
#define RIG_MODEL_MICROTUNE_4937 RIG_MAKE_MODEL(RIG_MICROTUNE, 1) /* eval board */
#define RIG_MODEL_MICROTUNE_4702 RIG_MAKE_MODEL(RIG_MICROTUNE, 2) /* Alan's */
#define RIG_MODEL_MICROTUNE_4707 RIG_MAKE_MODEL(RIG_MICROTUNE, 3)
/*
* TAPR
*/
#define RIG_TAPR 22
#define RIG_BACKEND_TAPR "tapr"
#define RIG_MODEL_DSP10 RIG_MAKE_MODEL(RIG_TAPR, 1)
/*
* Flex-radio
*/
#define RIG_FLEXRADIO 23
#define RIG_BACKEND_FLEXRADIO "flexradio"
#define RIG_MODEL_SDR1000 RIG_MAKE_MODEL(RIG_FLEXRADIO, 1)
#define RIG_MODEL_SDR1000RFE RIG_MAKE_MODEL(RIG_FLEXRADIO, 2)
#define RIG_MODEL_DTTSP RIG_MAKE_MODEL(RIG_FLEXRADIO, 3)
#define RIG_MODEL_DTTSP_UDP RIG_MAKE_MODEL(RIG_FLEXRADIO, 4)
/*
* VEB Funkwerk Köpenick RFT
*/
#define RIG_RFT 24
#define RIG_BACKEND_RFT "rft"
#define RIG_MODEL_EKD500 RIG_MAKE_MODEL(RIG_RFT, 1)
/*
* Various kits
*/
#define RIG_KIT 25
#define RIG_BACKEND_KIT "kit"
#define RIG_MODEL_ELEKTOR304 RIG_MAKE_MODEL(RIG_KIT, 1)
#define RIG_MODEL_DRT1 RIG_MAKE_MODEL(RIG_KIT, 2)
#define RIG_MODEL_DWT RIG_MAKE_MODEL(RIG_KIT, 3)
#define RIG_MODEL_USRP0 RIG_MAKE_MODEL(RIG_KIT, 4) /* prototype */
#define RIG_MODEL_USRP RIG_MAKE_MODEL(RIG_KIT, 5)
#define RIG_MODEL_DDS60 RIG_MAKE_MODEL(RIG_KIT, 6)
#define RIG_MODEL_ELEKTOR507 RIG_MAKE_MODEL(RIG_KIT, 7) /* Elektor SDR USB */
#define RIG_MODEL_MINIVNA RIG_MAKE_MODEL(RIG_KIT, 8)
#define RIG_MODEL_SI570AVRUSB RIG_MAKE_MODEL(RIG_KIT, 9) /* SoftRock Si570 AVR */
#define RIG_MODEL_PMSDR RIG_MAKE_MODEL(RIG_KIT, 10)
#define RIG_MODEL_SI570PICUSB RIG_MAKE_MODEL(RIG_KIT, 11) /* SoftRock Si570 PIC */
#define RIG_MODEL_FIFISDR RIG_MAKE_MODEL(RIG_KIT, 12) /* FiFi-SDR USB */
#define RIG_MODEL_FUNCUBEDONGLE RIG_MAKE_MODEL(RIG_KIT, 13) /* FunCUBE Dongle */
#define RIG_MODEL_HIQSDR RIG_MAKE_MODEL(RIG_KIT, 14) /* HiQSDR */
#define RIG_MODEL_FASDR RIG_MAKE_MODEL(RIG_KIT,15) /* Funkamateur Sdr */
#define RIG_MODEL_SI570PEABERRY1 RIG_MAKE_MODEL(RIG_KIT, 16) /* Peaberry V1 */
#define RIG_MODEL_SI570PEABERRY2 RIG_MAKE_MODEL(RIG_KIT, 17) /* Peaberry V2 */
#define RIG_MODEL_FUNCUBEDONGLEPLUS RIG_MAKE_MODEL(RIG_KIT, 18) /* FunCUBE Dongle Pro+ */
#define RIG_MODEL_RSHFIQ RIG_MAKE_MODEL(RIG_KIT, 19) /* RS-HFIQ */
/*
* SW/FM/TV tuner cards supported by Video4Linux,*BSD, ..
*/
#define RIG_TUNER 26
#define RIG_BACKEND_TUNER "tuner"
#define RIG_MODEL_V4L RIG_MAKE_MODEL(RIG_TUNER, 1)
#define RIG_MODEL_V4L2 RIG_MAKE_MODEL(RIG_TUNER, 2)
/*
* Rohde & Schwarz--rs
*/
#define RIG_RS 27
#define RIG_BACKEND_RS "rs"
#define RIG_MODEL_ESMC RIG_MAKE_MODEL(RIG_RS, 1)
#define RIG_MODEL_EB200 RIG_MAKE_MODEL(RIG_RS, 2)
#define RIG_MODEL_XK2100 RIG_MAKE_MODEL(RIG_RS, 3)
/*
* Phillips/Simoco PRM80
*/
#define RIG_PRM80 28
#define RIG_BACKEND_PRM80 "prm80"
#define RIG_MODEL_PRM8060 RIG_MAKE_MODEL(RIG_PRM80, 1)
#define RIG_MODEL_PRM8070 RIG_MAKE_MODEL(RIG_PRM80, 2)
/*
* ADAT by HB9CBU
*
* ADDED: frgo (DG1SBG), 2012-01-01
*/
#define RIG_ADAT 29
#define RIG_BACKEND_ADAT "adat"
#define RIG_MODEL_ADT_200A RIG_MAKE_MODEL(RIG_ADAT, 1)
/*
* ICOM Marine
*/
#define RIG_ICMARINE 30
#define RIG_BACKEND_ICMARINE "icmarine"
#define RIG_MODEL_IC_M700PRO RIG_MAKE_MODEL(RIG_ICMARINE, 1)
#define RIG_MODEL_IC_M802 RIG_MAKE_MODEL(RIG_ICMARINE, 2)
#define RIG_MODEL_IC_M710 RIG_MAKE_MODEL(RIG_ICMARINE, 3)
#define RIG_MODEL_IC_M803 RIG_MAKE_MODEL(RIG_ICMARINE, 4)
/*
* Dorji transceiver modules
*/
#define RIG_DORJI 31
#define RIG_BACKEND_DORJI "dorji"
#define RIG_MODEL_DORJI_DRA818V RIG_MAKE_MODEL(RIG_DORJI, 1)
#define RIG_MODEL_DORJI_DRA818U RIG_MAKE_MODEL(RIG_DORJI, 2)
/*
* Barrett
*/
#define RIG_BARRETT 32
#define RIG_BACKEND_BARRETT "barrett"
#define RIG_MODEL_BARRETT_2050 RIG_MAKE_MODEL(RIG_BARRETT, 1)
#define RIG_MODEL_BARRETT_950 RIG_MAKE_MODEL(RIG_BARRETT, 2)
/*
* Elad
*/
#define RIG_ELAD 33
#define RIG_BACKEND_ELAD "elad"
#define RIG_MODEL_ELAD_FDM_DUO RIG_MAKE_MODEL(RIG_ELAD, 1)
//! @endcond
/*
* TODO:
RIG_MODEL_KWZ30, KNEISNER +DOERING
RIG_MODEL_E1800, DASA-Telefunken
etc.
*/
/*! \typedef typedef int rig_model_t
\brief Convenience type definition for rig model.
*/
typedef uint32_t rig_model_t;
/*
* struct rig_backend_list {
* rig_model_t model;
* const char *backend;
* } rig_backend_list[] = RIG_LIST;
*
* TODO:
*
{ RIG_RADIOSHACK, RIG_BACKEND_RADIOSHACK }, \
*/
#endif /* _RIGLIST_H */

805
hamlib/rotator.h 100644
Wyświetl plik

@ -0,0 +1,805 @@
/*
* Hamlib Interface - Rotator API header
* Copyright (c) 2000-2005 by Stephane Fillod
*
*
* This library 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 library 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
*
*/
#ifndef _ROTATOR_H
#define _ROTATOR_H 1
#include <hamlib/rig.h>
#include <hamlib/rotlist.h>
/**
* \addtogroup rotator
* @{
*/
/**
* \file rotator.h
* \brief Hamlib rotator data structures.
*
* This file contains the data structures and declarations for the Hamlib
* rotator Application Programming Interface (API).
*
* See the rotator.c file for more details on the rotator API functions.
*/
__BEGIN_DECLS
/* Forward struct references */
struct rot;
struct rot_state;
/**
* \typedef typedef struct s_rot ROT
* \brief Main rotator handle type definition.
*
* The #ROT handle is returned by rot_init() and is passed as a parameter to
* every rotator specific API call.
*
* rot_cleanup() must be called when this handle is no longer needed.
*/
typedef struct s_rot ROT;
/**
* \typedef typedef float elevation_t
* \brief Type definition for elevation.
*
* The \a elevation_t type is used as parameter for the rot_set_position() and
* rot_get_position() functions.
*
* Unless specified otherwise, the unit of \a elevation_t is decimal degrees.
*/
typedef float elevation_t;
/**
* \typedef typedef float azimuth_t
* \brief Type definition for azimuth.
*
* The \a azimuth_t type is used as parameter for the rot_set_position() and
* rot_get_position() functions.
*
* Unless specified otherwise, the unit of \a azimuth_t is decimal degrees.
*/
typedef float azimuth_t;
/**
* \brief The token in the netrotctl protocol for returning an error condition code.
*/
#define NETROTCTL_RET "RPRT "
/**
* \def ROT_RESET_ALL
* \brief A macro that returns the flag for the \b reset operation.
*
* \sa rot_reset(), rot_reset_t
*/
#define ROT_RESET_ALL 1
/**
* \typedef typedef int rot_reset_t
* \brief Type definition for rotator reset.
*
* The \a rot_reset_t type is used as parameter for the rot_reset() API
* function.
*/
typedef int rot_reset_t;
/**
* \brief Rotator type flags for bitmasks.
*/
typedef enum {
ROT_FLAG_AZIMUTH = (1 << 1), /*!< Azimuth */
ROT_FLAG_ELEVATION = (1 << 2) /*!< Elevation */
} rot_type_t;
//! @cond Doxygen_Suppress
/* So far only used in ests/dumpcaps_rot.c. */
#define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
//! @endcond
/**
* \def ROT_TYPE_OTHER
* \brief Other type of rotator.
* \def ROT_TYPE_AZIMUTH
* \brief Azimuth only rotator.
* \def ROT_TYPE_ELEVATION
* \brief Elevation only rotator.
* \def ROT_TYPE_AZEL
* \brief Combination azimuth/elevation rotator.
*/
#define ROT_TYPE_OTHER 0
#define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
#define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
#define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
/**
* \def ROT_MOVE_UP
* \brief A macro that returns the flag for the \b UP direction.
*
* This macro defines the value of the \b UP direction which can be
* used with the rot_move() function.
*
* \sa rot_move(), ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
* ROT_MOVE_RIGHT, ROT_MOVE_CW
*/
#define ROT_MOVE_UP (1<<1)
/**
* \def ROT_MOVE_DOWN
* \brief A macro that returns the flag for the \b DOWN direction.
*
* This macro defines the value of the \b DOWN direction which can be
* used with the rot_move() function.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_LEFT, ROT_MOVE_CCW, ROT_MOVE_RIGHT,
* ROT_MOVE_CW
*/
#define ROT_MOVE_DOWN (1<<2)
/**
* \def ROT_MOVE_LEFT
* \brief A macro that returns the flag for the \b LEFT direction.
*
* This macro defines the value of the \b LEFT direction which can be
* used with the rot_move function.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_CCW, ROT_MOVE_RIGHT,
* ROT_MOVE_CW
*/
#define ROT_MOVE_LEFT (1<<3)
/**
* \def ROT_MOVE_CCW
* \brief A macro that returns the flag for the \b counterclockwise direction.
*
* This macro defines the value of the \b counterclockwise direction which
* can be used with the rot_move() function. This value is equivalent to
* ROT_MOVE_LEFT.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_RIGHT,
* ROT_MOVE_CW
*/
#define ROT_MOVE_CCW ROT_MOVE_LEFT
/**
* \def ROT_MOVE_RIGHT
* \brief A macro that returns the flag for the \b RIGHT direction.
*
* This macro defines the value of the \b RIGHT direction which can be used
* with the rot_move() function.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
* ROT_MOVE_CW
*/
#define ROT_MOVE_RIGHT (1<<4)
/**
* \def ROT_MOVE_CW
* \brief A macro that returns the flag for the \b clockwise direction.
*
* This macro defines the value of the \b clockwise direction which can be
* used with the rot_move() function. This value is equivalent to
* ROT_MOVE_RIGHT.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
* ROT_MOVE_RIGHT
*/
#define ROT_MOVE_CW ROT_MOVE_RIGHT
/**
* \brief Rotator status flags
*/
typedef enum {
ROT_STATUS_NONE = 0, /*!< '' -- No status. */
ROT_STATUS_BUSY = (1 << 0), /*!< Rotator is busy, not accepting commands. */
ROT_STATUS_MOVING = (1 << 1), /*!< Rotator is currently moving (direction type not specified). */
ROT_STATUS_MOVING_AZ = (1 << 2), /*!< Azimuth rotator is currently moving (direction not specified). */
ROT_STATUS_MOVING_LEFT = (1 << 3), /*!< Azimuth rotator is currently moving left. */
ROT_STATUS_MOVING_RIGHT = (1 << 4), /*!< Azimuth rotator is currently moving right. */
ROT_STATUS_MOVING_EL = (1 << 5), /*!< Elevation rotator is currently moving (direction not specified). */
ROT_STATUS_MOVING_UP = (1 << 6), /*!< Elevation rotator is currently moving up. */
ROT_STATUS_MOVING_DOWN = (1 << 7), /*!< Elevation rotator is currently moving down. */
ROT_STATUS_LIMIT_UP = (1 << 8), /*!< The elevation rotator has reached its limit to move up. */
ROT_STATUS_LIMIT_DOWN = (1 << 9), /*!< The elevation rotator has reached its limit to move down.*/
ROT_STATUS_LIMIT_LEFT = (1 << 10), /*!< The azimuth rotator has reached its limit to move left (CCW). */
ROT_STATUS_LIMIT_RIGHT = (1 << 11), /*!< The azimuth rotator has reached its limit to move right (CW). */
ROT_STATUS_OVERLAP_UP = (1 << 12), /*!< The elevation rotator has rotated up past 360 degrees. */
ROT_STATUS_OVERLAP_DOWN = (1 << 13), /*!< The elevation rotator has rotated down past 0 degrees. */
ROT_STATUS_OVERLAP_LEFT = (1 << 14), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees. */
ROT_STATUS_OVERLAP_RIGHT = (1 << 16), /*!< The azimuth rotator has rotated right (CW) past 360 degrees. */
} rot_status_t;
//! @cond Doxygen_Suppress
/* So far only used in tests/sprintflst.c. */
#define ROT_STATUS_N(n) (1u<<(n))
//! @endcond
/**
* \brief Macro for not changing the rotator speed with move() function.
*/
#define ROT_SPEED_NOCHANGE (-1)
/**
* \brief Rotator Level Settings.
*
* Various operating levels supported by a rotator.
*
* \c STRING used in the \c rotctl and \c rotctld utilities.
*
* \sa rot_parse_level(), rot_strlevel()
*/
enum rot_level_e {
ROT_LEVEL_NONE = 0, /*!< '' -- No Level. */
ROT_LEVEL_SPEED = (1 << 0), /*!< \c SPEED -- Rotation speed, arg int (default range 1-100 if not specified). */
ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63), /*!< **Future use**, last level. */
};
//! @cond Doxygen_Suppress
#define ROT_LEVEL_FLOAT_LIST (0)
#define ROT_LEVEL_READONLY_LIST (0)
#define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
#define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
//! @endcond
/** @cond Doxygen_Suppress
* FIXME: The following needs more explanation about how STRING relates
* to this macro.
* @endcond
*/
/**
* \brief Rotator Parameters
*
* Parameters are settings that are not related to core rotator functionality,
* i.e. antenna rotation.
*
* \c STRING used in the \c rotctl and \c rotctld utilities.
*
* \sa rot_parse_parm(), rot_strparm()
*/
enum rot_parm_e {
ROT_PARM_NONE = 0, /*!< '' -- No Parm */
};
//! @cond Doxygen_Suppress
#define ROT_PARM_FLOAT_LIST (0)
#define ROT_PARM_READONLY_LIST (0)
#define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
#define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
//! @endcond
/** @cond Doxygen_Suppress
* FIXME: The following needs more explanation about how STRING relates
* to these macros.
* @endcond
*/
/**
* \brief Rotator Function Settings.
*
* Various operating functions supported by a rotator.
*
* \c STRING used in the \c rotctl and \c rotctld utilities.
*
* \sa rot_parse_func(), rot_strfunc()
*/
#define ROT_FUNC_NONE 0 /*!< '' -- No Function */
#ifndef SWIGLUAHIDE
/* Hide the top 32 bits from the old Lua binding as they can't be represented */
#define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63) /*!< **Future use**, ROT_FUNC items. */
/* 63 is this highest bit number that can be used */
#endif
/* Basic rot type, can store some useful info about different rotators. Each
* lib must be able to populate this structure, so we can make useful
* enquiries about capabilities.
*/
/**
* \struct rot_caps
* \brief Rotator capability data structure.
*
* The main idea of this structure is that it will be defined by the backend
* rotator driver, and will remain read-only for the application. Fields that
* need to be modifiable by the application are copied into the rot_state
* structure, which is the private memory area of the #ROT instance.
*
* This way, you can have several rotators running within the same
* application, sharing the rot_caps structure of the backend, while keeping
* their own customized data.
*
* \b Note: Don't move fields around and only add new fields at the end of the
* rot_caps structure. Shared libraries and DLLs depend on a constant
* structure to maintain compatibility.
*/
struct rot_caps {
rot_model_t rot_model; /*!< Rotator model as defined in rotlist.h. */
const char *model_name; /*!< Model name, e.g. TT-360. */
const char *mfg_name; /*!< Manufacturer, e.g. Tower Torquer. */
const char *version; /*!< Driver version, typically in YYYYMMDD.x format. */
const char *copyright; /*!< Copyright info (should be LGPL). */
enum rig_status_e status; /*!< Driver status. */
int rot_type; /*!< Rotator type. */
enum rig_port_e port_type; /*!< Type of communication port (serial, ethernet, etc.). */
int serial_rate_min; /*!< Minimal serial speed. */
int serial_rate_max; /*!< Maximal serial speed. */
int serial_data_bits; /*!< Number of data bits. */
int serial_stop_bits; /*!< Number of stop bits. */
enum serial_parity_e serial_parity; /*!< Parity. */
enum serial_handshake_e serial_handshake; /*!< Handshake. */
int write_delay; /*!< Write delay. */
int post_write_delay; /*!< Post-write delay. */
int timeout; /*!< Timeout. */
int retry; /*!< Number of retries if command fails. */
setting_t has_get_func; /*!< List of get functions. */
setting_t has_set_func; /*!< List of set functions. */
setting_t has_get_level; /*!< List of get levels. */
setting_t has_set_level; /*!< List of set levels. */
setting_t has_get_parm; /*!< List of get parameters. */
setting_t has_set_parm; /*!< List of set parameters. */
rot_status_t has_status; /*!< Supported status flags. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity (i.e. steps). */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity (i.e. steps). */
const struct confparams *extparms; /*!< Extension parameters list, \sa rot_ext.c. */
const struct confparams *extlevels; /*!< Extension levels list, \sa rot_ext.c. */
const struct confparams *extfuncs; /*!< Extension functions list, \sa rot_ext.c. */
int *ext_tokens; /*!< Extension token list. */
/*
* Movement range, az is relative to North
* negative values allowed for overlap
*/
azimuth_t min_az; /*!< Lower limit for azimuth (relative to North). */
azimuth_t max_az; /*!< Upper limit for azimuth (relative to North). */
elevation_t
min_el; /*!< Lower limit for elevation. */
elevation_t
max_el; /*!< Upper limit for elevation. */
const struct confparams *cfgparams; /*!< Configuration parameters. */
const rig_ptr_t priv; /*!< Private data. */
/*
* Rot Admin API
*
*/
int (*rot_init)(ROT *rot); /*!< Pointer to backend implementation of ::rot_init(). */
int (*rot_cleanup)(ROT *rot); /*!< Pointer to backend implementation of ::rot_cleanup(). */
int (*rot_open)(ROT *rot); /*!< Pointer to backend implementation of ::rot_open(). */
int (*rot_close)(ROT *rot); /*!< Pointer to backend implementation of ::rot_close(). */
int (*set_conf)(ROT *rot, token_t token, const char *val); /*!< Pointer to backend implementation of ::rot_set_conf(). */
int (*get_conf)(ROT *rot, token_t token, char *val); /*!< Pointer to backend implementation of ::rot_get_conf(). */
/*
* General API commands, from most primitive to least.. :()
* List Set/Get functions pairs
*/
int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation); /*!< Pointer to backend implementation of ::rot_set_position(). */
int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation); /*!< Pointer to backend implementation of ::rot_get_position(). */
int (*stop)(ROT *rot); /*!< Pointer to backend implementation of ::rot_stop(). */
int (*park)(ROT *rot); /*!< Pointer to backend implementation of ::rot_park(). */
int (*reset)(ROT *rot, rot_reset_t reset); /*!< Pointer to backend implementation of ::rot_reset(). */
int (*move)(ROT *rot, int direction, int speed); /*!< Pointer to backend implementation of ::rot_move(). */
/* get firmware info, etc. */
const char * (*get_info)(ROT *rot); /*!< Pointer to backend implementation of ::rot_get_info(). */
int (*set_level)(ROT *rot, setting_t level, value_t val); /*!< Pointer to backend implementation of ::rot_set_level(). */
int (*get_level)(ROT *rot, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::rot_get_level(). */
int (*set_func)(ROT *rot, setting_t func, int status); /*!< Pointer to backend implementation of ::rot_set_func(). */
int (*get_func)(ROT *rot, setting_t func, int *status); /*!< Pointer to backend implementation of ::rot_get_func(). */
int (*set_parm)(ROT *rot, setting_t parm, value_t val); /*!< Pointer to backend implementation of ::rot_set_parm(). */
int (*get_parm)(ROT *rot, setting_t parm, value_t *val); /*!< Pointer to backend implementation of ::rot_get_parm(). */
int (*set_ext_level)(ROT *rot, token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_level(). */
int (*get_ext_level)(ROT *rot, token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_level(). */
int (*set_ext_func)(ROT *rot, token_t token, int status); /*!< Pointer to backend implementation of ::rot_set_ext_func(). */
int (*get_ext_func)(ROT *rot, token_t token, int *status); /*!< Pointer to backend implementation of ::rot_get_ext_func(). */
int (*set_ext_parm)(ROT *rot, token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_parm(). */
int (*get_ext_parm)(ROT *rot, token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_parm(). */
int (*get_status)(ROT *rot, rot_status_t *status); /*!< Pointer to backend implementation of ::rot_get_status(). */
const char *macro_name; /*!< Rotator model macro name. */
};
//! @cond Doxygen_Suppress
#define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
//! @endcond
/**
* \struct rot_state
* \brief Rotator state structure
*
* This structure contains live data, as well as a copy of capability fields
* that may be updated, i.e. customized while the #ROT handle is instantiated.
*
* It is fine to move fields around, as this kind of structure should not be
* initialized like rot_caps are.
*/
struct rot_state {
/*
* overridable fields
*/
azimuth_t min_az; /*!< Lower limit for azimuth (overridable). */
azimuth_t max_az; /*!< Upper limit for azimuth (overridable). */
elevation_t min_el; /*!< Lower limit for elevation (overridable). */
elevation_t max_el; /*!< Upper limit for elevation (overridable). */
int south_zero; /*!< South is zero degrees. */
azimuth_t az_offset; /*!< Offset to be applied to azimuth. */
elevation_t el_offset; /*!< Offset to be applied to elevation. */
setting_t has_get_func; /*!< List of get functions. */
setting_t has_set_func; /*!< List of set functions. */
setting_t has_get_level; /*!< List of get levels. */
setting_t has_set_level; /*!< List of set levels. */
setting_t has_get_parm; /*!< List of get parameters. */
setting_t has_set_parm; /*!< List of set parameters. */
rot_status_t has_status; /*!< Supported status flags. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
/*
* non overridable fields, internal use
*/
hamlib_port_t rotport; /*!< Rotator port (internal use). */
hamlib_port_t rotport2; /*!< 2nd Rotator port (internal use). */
int comm_state; /*!< Comm port state, i.e. opened or closed. */
rig_ptr_t priv; /*!< Pointer to private rotator state data. */
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
int current_speed; /*!< Current speed 1-100, to be used when no change to speed is requested. */
/* etc... */
};
/**
* \struct s_rot
* \brief Master rotator structure.
*
* This is the master data structure acting as the #ROT handle for the
* controlled rotator. A pointer to this structure is returned by the
* rot_init() API function and is passed as a parameter to every rotator
* specific API call.
*
* \sa rot_init(), rot_caps, rot_state
*/
struct s_rot {
struct rot_caps *caps; /*!< Rotator caps. */
struct rot_state state; /*!< Rotator state. */
};
//! @cond Doxygen_Suppress
/* --------------- API function prototypes -----------------*/
extern HAMLIB_EXPORT(ROT *)
rot_init HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_open HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_close HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_cleanup HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_set_conf HAMLIB_PARAMS((ROT *rot,
token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
rot_get_conf HAMLIB_PARAMS((ROT *rot,
token_t token,
char *val));
/*
* General API commands, from most primitive to least.. )
* List Set/Get functions pairs
*/
extern HAMLIB_EXPORT(int)
rot_set_position HAMLIB_PARAMS((ROT *rot,
azimuth_t azimuth,
elevation_t elevation));
extern HAMLIB_EXPORT(int)
rot_get_position HAMLIB_PARAMS((ROT *rot,
azimuth_t *azimuth,
elevation_t *elevation));
extern HAMLIB_EXPORT(int)
rot_stop HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_park HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_reset HAMLIB_PARAMS((ROT *rot,
rot_reset_t reset));
extern HAMLIB_EXPORT(int)
rot_move HAMLIB_PARAMS((ROT *rot,
int direction,
int speed));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_level HAMLIB_PARAMS((ROT *rot,
setting_t level));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_level HAMLIB_PARAMS((ROT *rot,
setting_t level));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_parm HAMLIB_PARAMS((ROT *rot,
setting_t parm));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_parm HAMLIB_PARAMS((ROT *rot,
setting_t parm));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_func HAMLIB_PARAMS((ROT *rot,
setting_t func));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_func HAMLIB_PARAMS((ROT *rot,
setting_t func));
extern HAMLIB_EXPORT(int)
rot_set_func HAMLIB_PARAMS((ROT *rot,
setting_t func,
int status));
extern HAMLIB_EXPORT(int)
rot_get_func HAMLIB_PARAMS((ROT *rot,
setting_t func,
int *status));
extern HAMLIB_EXPORT(int)
rot_set_level HAMLIB_PARAMS((ROT *rig,
setting_t level,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_level HAMLIB_PARAMS((ROT *rig,
setting_t level,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_parm HAMLIB_PARAMS((ROT *rig,
setting_t parm,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_parm HAMLIB_PARAMS((ROT *rig,
setting_t parm,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
token_t token,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
token_t token,
int status));
extern HAMLIB_EXPORT(int)
rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
token_t token,
int *status));
extern HAMLIB_EXPORT(int)
rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
token_t token,
value_t *val));
extern HAMLIB_EXPORT(const char *)
rot_get_info HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_get_status HAMLIB_PARAMS((ROT *rot,
rot_status_t *status));
extern HAMLIB_EXPORT(int)
rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
extern HAMLIB_EXPORT(int)
rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_load_backend HAMLIB_PARAMS((const char *be_name));
extern HAMLIB_EXPORT(int)
rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_load_all_backends HAMLIB_PARAMS((void));
extern HAMLIB_EXPORT(rot_model_t)
rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
extern HAMLIB_EXPORT(int)
rot_token_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(token_t)
rot_token_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(int)
rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(const struct confparams *)
rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
token_t token));
extern HAMLIB_EXPORT(token_t)
rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(const struct rot_caps *)
rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
qrb HAMLIB_PARAMS((double lon1,
double lat1,
double lon2,
double lat2,
double *distance,
double *azimuth));
extern HAMLIB_EXPORT(double)
distance_long_path HAMLIB_PARAMS((double distance));
extern HAMLIB_EXPORT(double)
azimuth_long_path HAMLIB_PARAMS((double azimuth));
extern HAMLIB_EXPORT(int)
longlat2locator HAMLIB_PARAMS((double longitude,
double latitude,
char *locator_res,
int pair_count));
extern HAMLIB_EXPORT(int)
locator2longlat HAMLIB_PARAMS((double *longitude,
double *latitude,
const char *locator));
extern HAMLIB_EXPORT(double)
dms2dec HAMLIB_PARAMS((int degrees,
int minutes,
double seconds,
int sw));
extern HAMLIB_EXPORT(int)
dec2dms HAMLIB_PARAMS((double dec,
int *degrees,
int *minutes,
double *seconds,
int *sw));
extern HAMLIB_EXPORT(int)
dec2dmmm HAMLIB_PARAMS((double dec,
int *degrees,
double *minutes,
int *sw));
extern HAMLIB_EXPORT(double)
dmmm2dec HAMLIB_PARAMS((int degrees,
double minutes,
double seconds,
int sw));
extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s);
extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s);
extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s);
extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t);
//! @endcond
/**
* \def rot_debug
* \brief Convenience macro for generating debugging messages.
*
* This is an alias of the rig_debug() function call and is used in the same
* manner.
*/
#define rot_debug rig_debug
__END_DECLS
#endif /* _ROTATOR_H */
/** @} */

637
hamlib/rotlist.h 100644
Wyświetl plik

@ -0,0 +1,637 @@
/*
* Hamlib Interface - list of known rotators
* Copyright (c) 2000-2011 by Stephane Fillod
* Copyright (c) 2000-2002 by Frank Singleton
*
*
* This library 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 library 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
*
*/
#ifndef _ROTLIST_H
#define _ROTLIST_H 1
//! @cond Doxygen_Suppress
#define ROT_MAKE_MODEL(a,b) ((a)*100+(b))
#define ROT_BACKEND_NUM(a) ((a)/100)
//! @endcond
/**
* \addtogroup rotator
* @{
*/
/**
* \file rotlist.h
* \brief Hamlib rotator model definitions.
*
* This file contains rotator model definitions for the Hamlib rotator
* Application Programming Interface (API). Each distinct rotator type has a
* unique model number (ID) and is used by Hamlib to identify and distinguish
* between the different hardware drivers. The exact model numbers can be
* acquired using the macros in this file. To obtain a list of supported
* rotator branches, one can use the statically defined ROT_BACKEND_LIST macro
* (defined in configure.ac). To obtain a full list of supported rotators
* (including each model in every branch), the foreach_opened_rot() API
* function can be used.
*
* The model number, or ID, is used to tell Hamlib which rotator the client
* wishes to use which is done with the rot_init() API call.
*/
/**
* \def ROT_MODEL_NONE
* \brief A macro that returns the model number for an unknown model.
*
* The none backend, as the name suggests, does nothing. It is mainly for
* internal use.
*/
#define ROT_MODEL_NONE 0
/**
* \brief A macro that returns the model number for the DUMMY backend.
*
* \def ROT_MODEL_DUMMY
*
* The DUMMY backend, as the name suggests, is a backend which performs
* no hardware operations and always behaves as one would expect. It can
* be thought of as a hardware simulator and is very useful for testing
* client applications.
*/
/**
* \brief A macro that returns the model number for the NETROTCTL backend.
*
* \def ROT_MODEL_NETROTCTL
*
* The NETROTCTL backend allows use of the `rotctld` daemon through the normal
* Hamlib API.
*/
//! @cond Doxygen_Suppress
#define ROT_DUMMY 0
#define ROT_BACKEND_DUMMY "dummy"
//! @endcond
#define ROT_MODEL_DUMMY ROT_MAKE_MODEL(ROT_DUMMY, 1)
#define ROT_MODEL_NETROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 2)
/**
* \brief A macro that returns the model number of the EASYCOMM 1 backend.
*
* \def ROT_MODEL_EASYCOMM1
*
* The EASYCOMM1 backend can be used with rotators that support the EASYCOMM
* I Standard.
*/
/**
* \brief A macro that returns the model number of the EASYCOMM 2 backend.
*
* \def ROT_MODEL_EASYCOMM2
*
* The EASYCOMM2 backend can be used with rotators that support the EASYCOMM
* II Standard.
*/
/**
* \brief A macro that returns the model number of the EASYCOMM 3 backend.
*
* \def ROT_MODEL_EASYCOMM3
*
* The EASYCOMM3 backend can be used with rotators that support the EASYCOMM
* III Standard.
*/
//! @cond Doxygen_Suppress
#define ROT_EASYCOMM 2
#define ROT_BACKEND_EASYCOMM "easycomm"
//! @endcond
#define ROT_MODEL_EASYCOMM1 ROT_MAKE_MODEL(ROT_EASYCOMM, 1)
#define ROT_MODEL_EASYCOMM2 ROT_MAKE_MODEL(ROT_EASYCOMM, 2)
#define ROT_MODEL_EASYCOMM3 ROT_MAKE_MODEL(ROT_EASYCOMM, 4)
/**
* \brief A macro that returns the model number of the FODTRACK backend.
*
* \def ROT_MODEL_FODTRACK
*
* The FODTRACK backend can be used with rotators that support the FODTRACK
* Standard.
*/
//! @cond Doxygen_Suppress
#define ROT_FODTRACK 3
#define ROT_BACKEND_FODTRACK "fodtrack"
//! @endcond
#define ROT_MODEL_FODTRACK ROT_MAKE_MODEL(ROT_FODTRACK, 1)
/**
* \brief A macro that returns the model number of the ROTOREZ backend.
*
* \def ROT_MODEL_ROTOREZ
*
* The ROTOREZ backend can be used with Hy-Gain rotators that support the
* extended DCU command set by the Idiom Press Rotor-EZ board.
*/
/**
* \brief A macro that returns the model number of the ROTORCARD backend.
*
* \def ROT_MODEL_ROTORCARD
*
* The ROTORCARD backend can be used with Yaesu rotators that support the
* extended DCU command set by the Idiom Press Rotor Card board.
*/
/**
* \brief A macro that returns the model number of the DCU backend.
*
* \def ROT_MODEL_DCU
*
* The DCU backend can be used with rotators that support the DCU command set
* by Hy-Gain (currently the DCU-1).
*/
/**
* \brief A macro that returns the model number of the ERC backend.
*
* \def ROT_MODEL_ERC
*
* The ERC backend can be used with rotators that support the DCU command set
* by DF9GR (currently the ERC).
*/
/**
* \brief A macro that returns the model number of the RT21 backend.
*
* \def ROT_MODEL_RT21
*
* The RT21 backend can be used with rotators that support the DCU command set
* by Green Heron (currently the RT-21).
*/
//! @cond Doxygen_Suppress
#define ROT_ROTOREZ 4
#define ROT_BACKEND_ROTOREZ "rotorez"
//! @endcond
#define ROT_MODEL_ROTOREZ ROT_MAKE_MODEL(ROT_ROTOREZ, 1)
#define ROT_MODEL_ROTORCARD ROT_MAKE_MODEL(ROT_ROTOREZ, 2)
#define ROT_MODEL_DCU ROT_MAKE_MODEL(ROT_ROTOREZ, 3)
#define ROT_MODEL_ERC ROT_MAKE_MODEL(ROT_ROTOREZ, 4)
#define ROT_MODEL_RT21 ROT_MAKE_MODEL(ROT_ROTOREZ, 5)
/**
* \brief A macro that returns the model number of the SARTEK1 backend.
*
* \def ROT_MODEL_SARTEK1
*
* The SARTEK1 backend can be used with rotators that support the SARtek
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_SARTEK 5
#define ROT_BACKEND_SARTEK "sartek"
//! @endcond
#define ROT_MODEL_SARTEK1 ROT_MAKE_MODEL(ROT_SARTEK, 1)
/**
* \brief A macro that returns the model number of the GS232A backend.
*
* \def ROT_MODEL_GS232A
*
* The GS232A backend can be used with rotators that support the GS-232A
* protocol.
*/
/**
* \brief A macro that returns the model number of the GS232 backend.
*
* \def ROT_MODEL_GS232_GENERIC
*
* The GS232_GENERIC backend can be used with rotators that support the
* generic (even if not coded correctly) GS-232 protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B backend.
*
* \def ROT_MODEL_GS232B
*
* The GS232B backend can be used with rotators that support the GS232B
* protocol.
*/
/**
* \brief A macro that returns the model number of the F1TETRACKER backend.
*
* \def ROT_MODEL_F1TETRACKER
*
* The F1TETRACKER backend can be used with rotators that support the F1TE
* Tracker protocol.
*/
/**
* \brief A macro that returns the model number of the GS23 backend.
*
* \def ROT_MODEL_GS23
*
* The GS23 backend can be used with rotators that support the GS-23 protocol.
*/
/**
* \brief A macro that returns the model number of the GS232 backend.
*
* \def ROT_MODEL_GS232
*
* The GS232 backend can be used with rotators that support the GS-232
* protocol.
*/
/**
* \brief A macro that returns the model number of the LVB backend.
*
* \def ROT_MODEL_LVB
*
* The LVB backend can be used with rotators that support the G6LVB AMSAT LVB
* Tracker GS-232 based protocol.
*/
/**
* \brief A macro that returns the model number of the ST2 backend.
*
* \def ROT_MODEL_ST2
*
* The ST2 backend can be used with rotators that support the Fox Delta ST2
* GS-232 based protocol.
*/
/**
* \brief A macro that returns the model number of the GS232A_AZ Azimuth backend.
*
* \def ROT_MODEL_GS232A_AZ
*
* The GS232A_AZ backend can be used with azimuth rotators that support the
* GS-232A protocol.
*/
/**
* \brief A macro that returns the model number of the GS232A_EL Elevation backend.
*
* \def ROT_MODEL_GS232A_EL
*
* The GS232A_EL backend can be used with elevation rotators that support the
* GS-232A protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B_AZ Azimuth backend.
*
* \def ROT_MODEL_GS232B_AZ
*
* The GS232B_AZ backend can be used with azimuth rotators that support the
* GS-232B protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B_EL Elevation backend.
*
* \def ROT_MODEL_GS232B_EL
*
* The GS232B_EL backend can be used with elevation rotators that support the
* GS-232B protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_GS232A 6
#define ROT_BACKEND_GS232A "gs232a"
//! @endcond
#define ROT_MODEL_GS232A ROT_MAKE_MODEL(ROT_GS232A, 1)
#define ROT_MODEL_GS232_GENERIC ROT_MAKE_MODEL(ROT_GS232A, 2) /* GENERIC */
#define ROT_MODEL_GS232B ROT_MAKE_MODEL(ROT_GS232A, 3)
#define ROT_MODEL_F1TETRACKER ROT_MAKE_MODEL(ROT_GS232A, 4)
#define ROT_MODEL_GS23 ROT_MAKE_MODEL(ROT_GS232A, 5)
#define ROT_MODEL_GS232 ROT_MAKE_MODEL(ROT_GS232A, 6) /* Not A or B */
#define ROT_MODEL_LVB ROT_MAKE_MODEL(ROT_GS232A, 7)
#define ROT_MODEL_ST2 ROT_MAKE_MODEL(ROT_GS232A, 8)
#define ROT_MODEL_GS232A_AZ ROT_MAKE_MODEL(ROT_GS232A, 9)
#define ROT_MODEL_GS232A_EL ROT_MAKE_MODEL(ROT_GS232A, 10)
#define ROT_MODEL_GS232B_AZ ROT_MAKE_MODEL(ROT_GS232A, 11)
#define ROT_MODEL_GS232B_EL ROT_MAKE_MODEL(ROT_GS232A, 12)
/**
* \brief A macro that returns the model number of the PCROTOR backend.
*
* \def ROT_MODEL_PCROTOR
*
* The PCROTOR backend is a member of the kit backend group that can be used
* with home brewed rotators.
*/
//! @cond Doxygen_Suppress
#define ROT_KIT 7
#define ROT_BACKEND_KIT "kit"
//! @endcond
#define ROT_MODEL_PCROTOR ROT_MAKE_MODEL(ROT_KIT, 1)
/**
* \brief A macro that returns the model number of the HD1780 backend.
*
* \def ROT_MODEL_HD1780
*
* The HD1780 backend can be used with rotators that support the Heathkit
* HD-1780 protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_HEATHKIT 8
#define ROT_BACKEND_HEATHKIT "heathkit"
//! @endcond
#define ROT_MODEL_HD1780 ROT_MAKE_MODEL(ROT_HEATHKIT, 1)
/**
* \brief A macro that returns the model number of the ROT2PROG backend.
*
* \def ROT_MODEL_SPID_ROT2PROG
*
* The SPID_ROT2PROG backend can be used with rotators that support the SPID
* azimuth and elevation protocol.
*/
/**
* \brief A macro that returns the model number of the ROT1PROG backend.
*
* \def ROT_MODEL_SPID_ROT1PROG
*
* The SPID_ROT1PROG backend can be used with rotators that support the SPID
* azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the SPID_MD01_ROT2PROG backend.
*
* \def ROT_MODEL_SPID_MD01_ROT2PROG
*
* The SPID_MD01_ROT2PROG backend can be used with rotators that support the
* extended SPID ROT2PROG azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_SPID 9
#define ROT_BACKEND_SPID "spid"
//! @endcond
#define ROT_MODEL_SPID_ROT2PROG ROT_MAKE_MODEL(ROT_SPID, 1)
#define ROT_MODEL_SPID_ROT1PROG ROT_MAKE_MODEL(ROT_SPID, 2)
#define ROT_MODEL_SPID_MD01_ROT2PROG ROT_MAKE_MODEL(ROT_SPID, 3)
/**
* \brief A macro that returns the model number of the RC2800 backend.
*
* \def ROT_MODEL_RC2800
*
* The RC2800 backend can be used with rotators that support the M2 (M
* Squared) RC2800 protocol.
*/
/**
* \brief A macro that returns the model number of the RC2800_EARLY_AZ
* backend.
*
* \def ROT_MODEL_RC2800_EARLY_AZ
*
* The RC2800_EARLY_AZ backend can be used with rotators that support the M2
* (M Squared) RC2800 early azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the RC2800_EARLY_AZEL
* backend.
*
* \def ROT_MODEL_RC2800_EARLY_AZEL
*
* The RC2800_EARLY_AZEL backend can be used with rotators that support the M2
* (M Squared) RC2800 early azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_M2 10
#define ROT_BACKEND_M2 "m2"
//! @endcond
#define ROT_MODEL_RC2800 ROT_MAKE_MODEL(ROT_M2, 1)
#define ROT_MODEL_RC2800_EARLY_AZ ROT_MAKE_MODEL(ROT_M2, 2)
#define ROT_MODEL_RC2800_EARLY_AZEL ROT_MAKE_MODEL(ROT_M2, 3)
/**
* \brief A macro that returns the model number of the RCI_AZEL backend.
*
* \def ROT_MODEL_RCI_AZEL
*
* The RCI_AZEL backend can be used with rotators that support the ARS azimuth
* and elevation protocol.
*/
/**
* \brief A macro that returns the model number of the RCI_AZ backend.
*
* \def ROT_MODEL_RCI_AZ
*
* The RCI_AZ backend can be used with rotators that support the ARS azimuth
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_ARS 11
#define ROT_BACKEND_ARS "ars"
//! @endcond
#define ROT_MODEL_RCI_AZEL ROT_MAKE_MODEL(ROT_ARS, 1)
#define ROT_MODEL_RCI_AZ ROT_MAKE_MODEL(ROT_ARS, 2)
/**
* \brief A macro that returns the model number of the IF100 backend.
*
* \def ROT_MODEL_IF100
*
* The IF100 backend can be used with rotators that support the AMSAT IF-100
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_AMSAT 12
#define ROT_BACKEND_AMSAT "amsat"
//! @endcond
#define ROT_MODEL_IF100 ROT_MAKE_MODEL(ROT_AMSAT, 1)
/**
* \brief A macro that returns the model number of the TS7400 backend.
*
* \def ROT_MODEL_TS7400
*
* The TS7400 backend supports an embedded ARM board using the TS-7400 Linux
* board. More information is at https://www.embeddedarm.com
*/
//! @cond Doxygen_Suppress
#define ROT_TS7400 13
#define ROT_BACKEND_TS7400 "ts7400"
//! @endcond
#define ROT_MODEL_TS7400 ROT_MAKE_MODEL(ROT_TS7400, 1)
/**
* \brief A macro that returns the model number of the NEXSTAR backend.
*
* \def ROT_MODEL_NEXSTAR
*
* The NEXSTAR backend can be used with rotators that support the Celestron
* NexStar protocol and alike.
*/
//! @cond Doxygen_Suppress
#define ROT_CELESTRON 14
#define ROT_BACKEND_CELESTRON "celestron"
//! @endcond
#define ROT_MODEL_NEXSTAR ROT_MAKE_MODEL(ROT_CELESTRON, 1)
/**
* \brief A macro that returns the model number of the ETHER6 backend.
*
* \def ROT_MODEL_ETHER6
*
* The ETHER6 backend can be used with rotators that support the Ether6
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_ETHER6 15
#define ROT_BACKEND_ETHER6 "ether6"
//! @endcond
#define ROT_MODEL_ETHER6 ROT_MAKE_MODEL(ROT_ETHER6, 1)
/**
* \brief A macro that returns the model number of the CNCTRK backend.
*
* \def ROT_MODEL_CNCTRK
*
* The CNCTRK backend can be used with rotators that support the LinuxCNC
* running Axis GUI interface.
*/
//! @cond Doxygen_Suppress
#define ROT_CNCTRK 16
#define ROT_BACKEND_CNCTRK "cnctrk"
//! @endcond
#define ROT_MODEL_CNCTRK ROT_MAKE_MODEL(ROT_CNCTRK, 1)
/**
* \brief A macro that returns the model number of the PROSISTEL_D_AZ backend.
*
* \def ROT_MODEL_PROSISTEL_D_AZ
*
* The PROSISTEL_D_AZ backend can be used with rotators that support the Prosistel
* azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the PROSISTEL_D_EL backend.
*
* \def ROT_MODEL_PROSISTEL_D_EL
*
* The PROSISTEL_D_EL backend can be used with rotators that support the Prosistel
* elevation protocol.
*/
/**
* \brief A macro that returns the model number of the
* PROSISTEL_COMBI_TRACK_AZEL backend.
*
* \def ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL
*
* The PROSISTEL_AZEL_COMBI_TRACK_AZEL backend can be used with rotators that
* support the Prosistel combination azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_PROSISTEL 17
#define ROT_BACKEND_PROSISTEL "prosistel"
//! @endcond
#define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1)
#define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2)
#define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3)
/**
* \brief A macro that returns the model number of the MEADE backend.
*
* \def ROT_MODEL_MEADE
*
* The MEADE backend can be used with Meade telescope rotators like the
* DS-2000.
*/
//! @cond Doxygen_Suppress
#define ROT_MEADE 18
#define ROT_BACKEND_MEADE "meade"
//! @endcond
#define ROT_MODEL_MEADE ROT_MAKE_MODEL(ROT_MEADE, 1)
/**
* \brief A macro that returns the model number of the IOPTRON backend.
*
* \def ROT_MODEL_IOPTRON
*
* The IOPTRON backend can be used with IOPTRON telescope mounts.
*/
//! @cond Doxygen_Suppress
#define ROT_IOPTRON 19
#define ROT_BACKEND_IOPTRON "ioptron"
//! @endcond
#define ROT_MODEL_IOPTRON ROT_MAKE_MODEL(ROT_IOPTRON, 1)
/**
* \brief A macro that returns the model number of the INDI backend.
*
* \def ROT_MODEL_INDI
*
* The INDI backend can be used with rotators that support the INDI interface.
*/
//! @cond Doxygen_Suppress
#define ROT_INDI 20
#define ROT_BACKEND_INDI "indi"
//! @endcond
#define ROT_MODEL_INDI ROT_MAKE_MODEL(ROT_INDI, 1)
/**
* \brief A macro that returns the model number of the SATEL backend.
*
* \def ROT_MODEL_SATEL
*
* The SATEL backend can be used with rotators that support the VE5FP
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_SATEL 21
#define ROT_BACKEND_SATEL "satel"
//! @endcond
#define ROT_MODEL_SATEL ROT_MAKE_MODEL(ROT_SATEL, 1)
/**
* \brief A macro that returns the model number of the RADANT backend.
*
* \def ROT_MODEL_RADANT
*
* The RADANT backend can be used with rotators that support the MS232
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_RADANT 22
#define ROT_BACKEND_RADANT "radant"
//! @endcond
#define ROT_MODEL_RADANT ROT_MAKE_MODEL(ROT_RADANT, 1)
#define ROT_ANDROIDSENSOR 23
#define ROT_BACKEND_ANDROIDSENSOR "androidsensor"
#define ROT_MODEL_ANDROIDSENSOR ROT_MAKE_MODEL(ROT_ANDROIDSENSOR, 1)
/**
* \brief Convenience type definition for a rotator model.
*
* \typedef typedef int rot_model_t
*/
typedef int rot_model_t;
#endif /* _ROTLIST_H */
/** @} */

43
main.cpp 100644
Wyświetl plik

@ -0,0 +1,43 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "mainwindow.h"
#include <QApplication>
#include <QFile>
#include <QString>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
/*
QFile file("./CatRadio.qss"); //open qss file
//if(!file.open(QFile::ReadOnly))
file.open(QFile::ReadOnly);
QString styleSheet (file.readAll());
file.close();
a.setStyleSheet(styleSheet); //setup stylesheet
*/
w.show();
return a.exec();
}

1014
mainwindow.cpp 100644

Plik diff jest za duży Load Diff

167
mainwindow.h 100644
Wyświetl plik

@ -0,0 +1,167 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#define RELEASE_DATE __DATE__
#define VERSION_MAJ 1
#define VERSION_MIN 1
#define VERSION_MIC 0
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
public slots:
void guiUpdate();
void on_rigDaemonResultReady(); //Slot for rigDaemon resultReady
void on_vfoDisplayValueChanged(int value); //Slot for vfoDisplay valueChanged
signals:
private slots:
void on_pushButton_Connect_toggled(bool checked);
void on_pushButton_Power_toggled(bool checked);
void on_pushButton_PTT_toggled(bool checked);
void on_pushButton_Split_toggled(bool checked);
void on_pushButton_AB_clicked();
void on_pushButton_AeqB_clicked();
void on_dial_valueChanged(int value);
void on_comboBox_Mode_activated(int index);
void on_comboBox_ModeSub_activated(int index);
void on_pushButton_Fast_toggled(bool checked);
void on_pushButton_Band160_clicked();
void on_pushButton_Band80_clicked();
void on_pushButton_Band60_clicked();
void on_pushButton_Band40_clicked();
void on_pushButton_Band30_clicked();
void on_pushButton_Band20_clicked();
void on_pushButton_Band17_clicked();
void on_pushButton_Band15_clicked();
void on_pushButton_Band12_clicked();
void on_pushButton_Band10_clicked();
void on_pushButton_Band6_clicked();
void on_pushButton_Tune_clicked();
void on_radioButton_Tuner_toggled(bool checked);
void on_pushButton_BandDown_clicked();
void on_pushButton_BandUp_clicked();
void on_pushButton_QSplit_clicked();
void on_action_Connection_triggered();
void on_comboBox_BW_activated(int index);
void on_checkBox_NAR_toggled(bool checked);
void on_checkBox_BKIN_toggled(bool checked);
void on_comboBox_AGC_activated(int index);
void on_comboBox_Att_activated(int index);
void on_comboBox_Preamp_activated(int index);
void on_comboBox_Ant_activated(int index);
void on_action_AboutCatRadio_triggered();
void on_checkBox_NB_toggled(bool checked);
void on_checkBox_NR_toggled(bool checked);
void on_checkBox_NF_toggled(bool checked);
void on_comboBox_Meter_activated(int index);
void on_spinBox_NR_valueChanged(int arg1);
void on_horizontalSlider_IFshift_valueChanged(int value);
void on_pushButton_Band2_clicked();
void on_pushButton_Band70_clicked();
void on_pushButton_BandGen_clicked();
void on_action_Setup_triggered();
void on_action_CatRadioHomepage_triggered();
void on_action_AboutQT_triggered();
void on_action_AboutHamLib_triggered();
void on_verticalSlider_AFGain_valueChanged(int value);
void on_verticalSlider_Squelch_valueChanged(int value);
void on_verticalSlider_RFpower_valueChanged(int value);
void on_verticalSlider_RFgain_valueChanged(int value);
void on_spinBox_WPM_valueChanged(int arg1);
void on_checkBox_APF_toggled(bool checked);
void on_radioButton_RPTshiftSimplex_toggled(bool checked);
void on_radioButton_RPTshiftMinus_toggled(bool checked);
void on_radioButton_RPTshiftPlus_toggled(bool checked);
void on_comboBox_toneType_activated(int index);
void on_comboBox_toneFreq_activated(int index);
private:
Ui::MainWindow *ui;
QTimer *timer;
void guiInit();
void setSubMeter();
};
#endif // MAINWINDOW_H

1580
mainwindow.ui 100644

Plik diff jest za duży Load Diff

153
rigcommand.cpp 100644
Wyświetl plik

@ -0,0 +1,153 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "rigcommand.h"
#include "rigdata.h"
#include <rig.h> //Hamlib
#include <QDebug>
extern rigSettings rigGet;
extern rigSettings rigSet;
extern rigCommand rigCmd;
extern rigCommand rigCap;
void set_band (int band)
{
freq_t freq;
switch (band)
{
case 160: freq = 1840000; break;
case 80: freq = 3600000; break;
case 60: freq = 5355000; break;
case 40: freq = 7100000; break;
case 30: freq = 10130000; break;
case 20: freq = 14100000; break;
case 17: freq = 18120000; break;
case 15: freq = 21150000; break;
case 12: freq = 24940000; break;
case 10: freq = 28320000; break;
case 6: freq = 50150000; break;
case 2: freq = 144300000; break;
case 70: freq = 432200000; break;
default: freq = rigSet.freqMain; break;
}
rigSet.freqMain = freq;
rigCmd.freqMain = 1;
rigCmd.bandChange = 1;
}
void quick_split ()
{
if (rigGet.vfoMain == RIG_VFO_A)
{
rigSet.freqSub = rigGet.freqMain + 5000;
//rigSet.modeSub = rigGet.modeMain;
rigCmd.freqSub = 1;
//rigCmd.modeSub = 1;
}
else
{
rigSet.freqMain = rigGet.freqSub + 5000;
rigCmd.freqMain = 1;
}
rigCmd.split = 1;
}
agc_level_e levelagcvalue (int agcValue)
{
agc_level_e agcLevel;
switch (agcValue)
{
case 0: agcLevel = RIG_AGC_OFF; break;
case 1: agcLevel = RIG_AGC_SUPERFAST; break;
case 2: agcLevel = RIG_AGC_FAST; break;
case 3: agcLevel = RIG_AGC_SLOW; break;
case 4: agcLevel = RIG_AGC_USER; break;
case 5: agcLevel = RIG_AGC_MEDIUM; break;
case 6: agcLevel = RIG_AGC_AUTO; break;
default: agcLevel = RIG_AGC_AUTO; break;
}
return agcLevel;
}
agc_level_e levelagcstr (QString agcString)
{
agc_level_e agcLevel;
if (agcString == "OFF") agcLevel = RIG_AGC_OFF;
else if (agcString == "SUPERFAST") agcLevel = RIG_AGC_SUPERFAST;
else if (agcString == "FAST") agcLevel = RIG_AGC_FAST;
else if (agcString == "SLOW") agcLevel = RIG_AGC_SLOW;
else if (agcString == "USER") agcLevel = RIG_AGC_USER;
else if (agcString == "MEDIUM") agcLevel = RIG_AGC_MEDIUM;
else agcLevel = RIG_AGC_AUTO;
return agcLevel;
}
value_t valueagclevel (agc_level_e agcLevel)
{
value_t value;
if (agcLevel == RIG_AGC_OFF) value.i = 0;
else if (agcLevel == RIG_AGC_SUPERFAST) value.i = 1;
else if (agcLevel == RIG_AGC_FAST) value.i = 2;
else if (agcLevel == RIG_AGC_SLOW) value.i = 3;
else if (agcLevel == RIG_AGC_USER) value.i = 4;
else if (agcLevel == RIG_AGC_MEDIUM) value.i = 5;
else value.i = 6; //RIG_AGC_AUTO
return value;
}
ant_t antstr (QString antString)
{
ant_t ant;
if (antString == "NONE") ant = RIG_ANT_NONE;
else if (antString == "ANT1") ant = RIG_ANT_1;
else if (antString == "ANT2") ant = RIG_ANT_2;
else if (antString == "ANT3") ant = RIG_ANT_3;
else if (antString == "ANT4") ant = RIG_ANT_4;
else if (antString == "ANT5") ant = RIG_ANT_5;
else if (antString == "UNK") ant = RIG_ANT_UNKNOWN;
else if (antString == "CURR") ant = RIG_ANT_CURR;
else ant = RIG_ANT_UNKNOWN;
return ant;
}
unsigned levelmeterstr (QString meterString)
{
unsigned levelMeter;
if (meterString == "SWR") levelMeter = RIG_LEVEL_SWR;
else if (meterString == "COMP") levelMeter = RIG_LEVEL_COMP;
else if (meterString == "ALC") levelMeter = RIG_LEVEL_ALC;
//...
else levelMeter = RIG_METER_NONE;
return levelMeter;
}

36
rigcommand.h 100644
Wyświetl plik

@ -0,0 +1,36 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef RIGCOMMAND_H
#define RIGCOMMAND_H
#endif // RIGCOMMAND_H
#include <QString>
#include <rig.h>
void set_band (int band);
void quick_split ();
agc_level_e levelagcvalue (int agcValue);
agc_level_e levelagcstr (QString agcString);
value_t valueagclevel (agc_level_e agcLevel);
ant_t antstr (QString antString);
unsigned levelmeterstr (QString meterString);

593
rigdaemon.cpp 100644
Wyświetl plik

@ -0,0 +1,593 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "rigdaemon.h"
#include "rigdata.h"
#include "rigcommand.h"
#include <QThread>
#include <QDebug>
#include <QMessageBox>
#include <rig.h>
RIG *my_rig;
extern rigConnect rigCom;
extern rigSettings rigGet;
extern rigSettings rigSet;
extern rigCommand rigCmd;
extern rigCommand rigCap;
int commandPriority = 0;
RigDaemon::RigDaemon(QObject *parent) : QObject(parent)
{
}
int RigDaemon::rigConnect()
{
int retcode;
my_rig = rig_init(rigCom.rigModel); //Allocate rig handle
if (!my_rig) //Wrong Rig number
{
QMessageBox msgBox; //Show error MessageBox
msgBox.setWindowTitle("Warning");
msgBox.setText("Rig model error");
msgBox.setIcon(QMessageBox::Warning);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return -1; //RIG_EINVAL, Invalid parameter
}
else
{
if (rigCom.rigModel == 2) //Rigctld
{
//myport.type.rig = RIG_PORT_NETWORK;
strncpy(my_rig->state.rigport.pathname, rigCom.rigPort.toLatin1(), HAMLIB_FILPATHLEN - 1);
//strncpy(my_rig->state.rigport.pathname, RIG_FILE, HAMLIB_FILPATHLEN - 1);
}
else
{
//myport.type.rig = RIG_PORT_SERIAL;
strncpy(my_rig->state.rigport.pathname, rigCom.rigPort.toLatin1(), HAMLIB_FILPATHLEN - 1);
my_rig->state.rigport.parm.serial.rate = rigCom.serialSpeed;
if (rigCom.civAddr) //CI-V address Icom
{
std::string civaddrS = std::to_string(rigCom.civAddr); //Convert int to string
char const *civaddr = civaddrS.c_str(); //Convert string to char*
rig_set_conf(my_rig, rig_token_lookup(my_rig, "civaddr"), civaddr);
}
}
retcode = rig_open(my_rig);
if (retcode != RIG_OK) return retcode; //Rig not connected
else //Rig connected
{
rig_get_powerstat(my_rig, &rigGet.onoff);
return 0;
}
}
}
void RigDaemon::rigUpdate()
{
int retcode;
value_t retvalue;
//***** Priority Command execution *****
//* PTT
if (rigCmd.ptt)
{
retcode = rig_set_ptt(my_rig, RIG_VFO_CURR, rigSet.ptt);
if (retcode == RIG_OK) rigGet.ptt = rigSet.ptt;
rigCmd.ptt = 0;
}
//* VFO
if (rigCmd.freqMain) //VFO Main
{
retcode = rig_set_freq(my_rig, RIG_VFO_CURR, rigSet.freqMain);
if (retcode == RIG_OK) rigGet.freqMain = rigSet.freqMain;
rigCmd.freqMain = 0;
rigCmd.rangeList = 1;
}
else if (rigCmd.freqSub) //VFO Sub
{
retcode = rig_set_freq(my_rig, rigGet.vfoSub, rigSet.freqSub);
if (retcode == RIG_OK) rigGet.freqSub = rigSet.freqSub;
rigCmd.freqSub = 0;
}
//***** Priority Poll execution *****
else
{
freq_t retfreq;
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //get VFO Main
if (retcode == RIG_OK) rigGet.freqMain = retfreq;
//if (my_rig->caps->targetable_vfo) //get VFO Sub if targetable
//{
retcode = rig_get_freq(my_rig, rigGet.vfoSub, &retfreq);
if (retcode == RIG_OK) rigGet.freqSub = retfreq;
//}
//* PTT
ptt_t retptt;
retcode = rig_get_ptt(my_rig, RIG_VFO_CURR, &retptt);
if (retcode == RIG_OK) rigGet.ptt = retptt;
//* Meter
if (rigGet.ptt==1)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_RFPOWER_METER, &rigGet.powerMeter);
rig_get_level(my_rig, RIG_VFO_CURR, rigSet.meter, &rigGet.subMeter);
}
else
{
retcode = rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_STRENGTH, &retvalue);
if (retcode == RIG_OK) rigGet.sMeter = retvalue;
}
//***** Command execution *****
if (!rigGet.ptt)
{
//* Mode
if (rigCmd.mode && rigSet.mode != RIG_MODE_NONE) //VFO Main
{
retcode = rig_set_mode(my_rig, RIG_VFO_CURR, rigSet.mode, RIG_PASSBAND_NOCHANGE);
if (retcode == RIG_OK)
{
rigCmd.bwidthList = 1; //Update BWidth list
commandPriority = 0;
//rig_get_mode(my_rig, RIG_VFO_CURR, &rigGet.mode, &rigGet.bwidth); //Get BW
}
rigCmd.mode = 0;
}
if (rigCmd.modeSub && rigCap.modeSub && rigSet.modeSub != RIG_MODE_NONE) //VFO Sub
{
retcode = rig_set_mode(my_rig, rigGet.vfoSub, rigSet.mode, RIG_PASSBAND_NOCHANGE);
if (retcode == RIG_OK)
{
}
rigCmd.modeSub = 0;
}
//* BandWidth
if (rigCmd.bwidth)
{
retcode = rig_set_mode(my_rig, RIG_VFO_CURR, rigGet.mode, rigSet.bwidth);
if (retcode == RIG_OK) rigGet.bwidth = rigSet.bwidth;
rigCmd.bwidth = 0;
}
//* Split
if (rigCmd.split)
{
retcode = rig_set_split_vfo(my_rig, RIG_VFO_RX, rigSet.split, RIG_VFO_TX);
if (retcode == RIG_OK) rigGet.split = rigSet.split;
rigCmd.split = 0;
}
//* VFO Exchange
if (rigCmd.vfoXchange)
{
int tempMode = rigGet.mode;
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_XCHG);
if (retcode == RIG_OK)
{
if (rigCap.modeSub == 0) rigGet.modeSub = tempMode;
commandPriority = 0;
}
rigCmd.vfoXchange = 0;
rigCmd.bwidthList = 1;
}
//* VFO Copy
if (rigCmd.vfoCopy)
{
rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_CPY);
rigCmd.vfoCopy = 0;
if (rigCap.modeSub == 0) rigGet.modeSub = rigGet.mode;
}
//* Band Up
if (rigCmd.bandUp)
{
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_BAND_UP);
if (retcode == RIG_OK) commandPriority = 0;
rigCmd.bandUp = 0;
rigCmd.bwidthList = 1;
}
//* Band Down
if (rigCmd.bandDown)
{
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_BAND_DOWN);
if (retcode == RIG_OK) commandPriority = 0;
rigCmd.bandDown = 0;
rigCmd.bwidthList = 1;
}
//* Band change
if (rigCmd.bandChange)
{
commandPriority = 0;
rigCmd.bwidthList = 1;
}
//* Tune
if (rigCmd.tune)
{
rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_TUNE);
rigCmd.tune = 0;
}
//* Antenna
if (rigCmd.ant)
{
retcode = rig_set_ant(my_rig, RIG_VFO_CURR, rigSet.ant, retvalue);
if (retcode == RIG_OK) rigGet.ant = rigSet.ant;
rigCmd.ant = 0;
}
//* AGC
if (rigCmd.agc)
{
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_AGC, valueagclevel(rigSet.agc));
if (retcode == RIG_OK) rigGet.agc = rigSet.agc;
rigCmd.agc = 0;
}
//* Attenuator
if (rigCmd.att)
{
retvalue.i = rigSet.att;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_ATT, retvalue);
if (retcode == RIG_OK) rigGet.att = rigSet.att;
rigCmd.att = 0;
}
//* Preamp
if (rigCmd.pre)
{
retvalue.i = rigSet.pre;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_PREAMP, retvalue);
if (retcode == RIG_OK) rigGet.pre = rigSet.pre;
rigCmd.pre = 0;
}
//* RF gain
if (rigCmd.rfGain)
{
retvalue.f = rigSet.rfGain;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_RF, retvalue);
if (retcode == RIG_OK) rigGet.rfGain = rigSet.rfGain;
rigCmd.rfGain = 0;
}
//* AF Gain
if (rigCmd.afGain)
{
retvalue.f = rigSet.afGain;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_AF, retvalue);
if (retcode == RIG_OK) rigGet.afGain = rigSet.afGain;
rigCmd.afGain = 0;
}
//* Squelch
if (rigCmd.squelch)
{
retvalue.f = rigSet.squelch;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_SQL, retvalue);
if (retcode == RIG_OK) rigGet.squelch = rigSet.squelch;
rigCmd.squelch = 0;
}
//* NB noise blanker
if (rigCmd.noiseBlanker)
{
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_NB, rigSet.noiseBlanker);
if (retcode == RIG_OK) rigGet.noiseBlanker = rigSet.noiseBlanker;
rigCmd.noiseBlanker = 0;
}
//* NR noise reduction
if (rigCmd.noiseReduction)
{
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_NR, rigSet.noiseReduction);
if (retcode == RIG_OK) rigGet.noiseReduction = rigSet.noiseReduction;
rigCmd.noiseReduction = 0;
}
if (rigCmd.noiseReductionLevel)
{
retvalue.i = rigSet.noiseReductionLevel;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_NR, retvalue);
if (retcode == RIG_OK) rigGet.noiseReductionLevel = rigSet.noiseReductionLevel;
rigCmd.noiseReductionLevel = 0;
}
//* NF notch filter
if (rigCmd.notchFilter)
{
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_ANF, rigSet.notchFilter);
if (retcode == RIG_OK) rigGet.notchFilter = rigSet.notchFilter;
rigCmd.notchFilter = 0;
}
//* IF Shift
if (rigCmd.ifShift)
{
retvalue.i = rigSet.ifShift;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_IF, retvalue);
if (retcode == RIG_OK) rigGet.ifShift = rigSet.ifShift;
rigCmd.ifShift = 0;
}
//** CW
//* CW break-in
if (rigCmd.bkin)
{
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_FBKIN, rigSet.bkin);
if (retcode == RIG_OK) rigGet.bkin = rigSet.bkin;
rigCmd.bkin = 0;
}
//* CW Auto Peak Filter
if (rigCmd.apf)
{
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_APF, rigSet.apf);
if (retcode == RIG_OK) rigGet.apf = rigSet.apf;
rigCmd.apf = 0;
}
//* CW keyer speed
if (rigCmd.wpm)
{
retvalue.i = rigSet.wpm;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_KEYSPD, retvalue);
if (retcode == RIG_OK) rigGet.wpm = rigSet.wpm;
rigCmd.wpm = 0;
}
//** FM
//* Repeater shift
if (rigCmd.rptShift)
{
retcode = rig_set_rptr_shift(my_rig, RIG_VFO_CURR, rigSet.rptShift);
if (retcode == RIG_OK) rigGet.rptShift = rigSet.rptShift;
rigCmd.rptShift = 0;
}
//* Tone
if (rigCmd.tone)
{
switch (rigSet.toneType)
{
case 1:
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TBURST, true);
break;
case 2:
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TONE, true);
if (rigSet.tone) rig_set_ctcss_tone(my_rig, RIG_VFO_CURR, rigSet.tone);
else rig_get_ctcss_tone(my_rig, RIG_VFO_CURR, &rigSet.tone);
break;
case 3:
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TSQL, true);
if (rigSet.tone) rig_set_ctcss_tone(my_rig, RIG_VFO_CURR, rigSet.tone);
else rig_get_ctcss_tone(my_rig, RIG_VFO_CURR, &rigSet.tone);
break;
default:
rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TBURST, false);
rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TONE, false);
rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TSQL, false);
retcode = RIG_OK;
break;
}
if (retcode == RIG_OK)
{
rigGet.toneType = rigSet.toneType;
rigGet.tone = rigSet.tone;
}
rigCmd.tone = 0;
rigCmd.toneList = 1;
}
} //end if (!rigGet.ptt)
//* Tuner
if (rigCmd.tuner)
{
retcode = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TUNER, rigSet.tuner);
if (retcode == RIG_OK) rigGet.tuner = rigSet.tuner;
rigCmd.tune = 0;
}
//* RF power
if (rigCmd.rfPower)
{
retvalue.f = rigSet.rfPower;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_RFPOWER, retvalue);
if (retcode == RIG_OK) rigGet.rfPower = rigSet.rfPower;
rigCmd.rfPower = 0;
}
//***** Poll execution *****
//* Mode and BW
if ((commandPriority == 1 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_mode(my_rig, RIG_VFO_CURR, &rigGet.mode, &rigGet.bwidth);
if (rigGet.bwidth == rig_passband_narrow(my_rig, rigGet.mode)) rigGet.bwNarrow = 1;
else rigGet.bwNarrow = 0;
if (rigCap.modeSub)
{
retcode = rig_get_mode(my_rig, rigGet.vfoSub, &rigGet.modeSub, &rigGet.bwidthSub);
if (retcode != RIG_OK)
{
rigCap.modeSub = 0; //mode not targetable
rigGet.modeSub = RIG_MODE_NONE;
}
}
}
//* Split
if ((commandPriority == 2 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_split_vfo(my_rig, RIG_VFO_CURR, &rigGet.split, &rigGet.vfoTx);
//else rig_get_split(my_rig, RIG_VFO_CURR, &rigGet.split);
rig_get_vfo(my_rig, &rigGet.vfoMain);
}
//* Tuner
if ((commandPriority == 3 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0) rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TUNER, &rigGet.tuner);
//* Antenna
if ((commandPriority == 4 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0) rig_get_ant(my_rig, RIG_VFO_CURR, RIG_ANT_CURR, &retvalue, &rigGet.ant, &rigGet.antTx, &rigGet.antRx);
//* AGC
if ((commandPriority == 5 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_AGC, &retvalue);
rigGet.agc = levelagcvalue(retvalue.i);
}
//* Attenuator
if ((commandPriority == 6 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_ATT, &retvalue);
rigGet.att = retvalue.i;
}
//* Preamp
if ((commandPriority == 7 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_PREAMP, &retvalue);
rigGet.pre = retvalue.i;
}
//* RF power
if ((commandPriority == 8 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_RFPOWER, &retvalue);
rigGet.rfPower = retvalue.f;
}
//* RF gain
if ((commandPriority == 9 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_RF, &retvalue);
rigGet.rfGain = retvalue.f;
}
//* AF gain
if ((commandPriority == 10 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_AF, &retvalue);
rigGet.afGain = retvalue.f;
}
//* Squelch
if ((commandPriority == 11 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_SQL, &retvalue);
rigGet.squelch = retvalue.f;
}
//* NB noise blanker
if ((commandPriority == 12 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0) rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_NB, &rigGet.noiseBlanker);
//* NR noise reduction
if ((commandPriority == 13 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_NR, &rigGet.noiseReduction);
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_NR, &retvalue);
rigGet.noiseReductionLevel = retvalue.i;
}
//* NF notch filter
if ((commandPriority == 14 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0) rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_ANF, &rigGet.notchFilter);
//* IF Shift
if ((commandPriority == 15 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_IF, &retvalue);
rigGet.ifShift = retvalue.i;
}
//* CW
if ((commandPriority == 16 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0) //&& mode=CW
{
rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_FBKIN, &rigGet.bkin); //Break-in
rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_APF, &rigGet.apf); //Audio Peak Filter
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_KEYSPD, &retvalue); //Keyer speed WPM
rigGet.wpm = retvalue.i;
}
//* FM
if ((commandPriority == 17 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0) //&& mode=FM
{
rig_get_rptr_shift(my_rig, RIG_VFO_CURR, &rigGet.rptShift); //Repeater Shift
int status = false;
if (!status)
{
rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TBURST, &status); //1750 Hz Tone burst
if (status) rigGet.toneType = 1;
}
if (!status)
{
rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TONE, &status); //CTCSS Tone Tx
if (status) rigGet.toneType = 2;
}
if (!status)
{
rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_TSQL, &status); //CTCSS Tone Tx and Rx Squelch
if (status) rigGet.toneType = 3;
}
if (!status) rigGet.toneType = 0;
if (rigGet.toneType == 2 || rigGet.toneType == 3) rig_get_ctcss_tone(my_rig, RIG_VFO_CURR, &rigGet.tone);
else if (rigGet.toneType == 4 || rigGet.toneType == 5) rig_get_dcs_code(my_rig, RIG_VFO_CURR, &rigGet.tone);
if (rigGet.toneType && rigGet.tone == 0)
{
rigSet.toneType = 0;
rigCmd.tone = 1;
}
if (rigGet.toneType != rigSet.toneType) rigCmd.toneList = 1; //update tone list
//rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_CSQL, &status);
//rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_DSQL, &status);
}
commandPriority ++;
if (commandPriority == 18) commandPriority = 1;
}
emit resultReady();
}

42
rigdaemon.h 100644
Wyświetl plik

@ -0,0 +1,42 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef RIGDAEMON_H
#define RIGDAEMON_H
#include <QObject>
#include <rig.h>
class RigDaemon : public QObject
{
Q_OBJECT
public:
explicit RigDaemon(QObject *parent = nullptr);
int rigConnect();
public slots:
void rigUpdate();
signals:
void resultReady();
};
#endif // RIGDAEMON_H

26
rigdata.cpp 100644
Wyświetl plik

@ -0,0 +1,26 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "rigdata.h"
rigConnect rigCom;
rigSettings rigGet;
rigSettings rigSet;
rigCommand rigCmd;
rigCommand rigCap;

111
rigdata.h 100644
Wyświetl plik

@ -0,0 +1,111 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef RIGDATA_H
#define RIGDATA_H
#endif // RIGDATA_H
#include <rig.h> //Hamlib
#include <QString>
typedef struct {
unsigned rigModel; //Hamlib rig model
QString rigPort; //COM port or IP address
unsigned serialSpeed; //Serial port baud rate
int civAddr; //CI-V address (decimal, Icom radio)
unsigned rigRefresh; //GUI refresh interval (ms)
int connected; //connected flag
bool fullPoll; //full polling flag
} rigConnect;
typedef struct {
powerstat_t onoff; //on/off status
freq_t freqMain, freqSub; //Frequency
rmode_t mode, modeSub; //Mode
pbwidth_t bwidth, bwidthSub; //IF filter bandwidth
int bwNarrow; //IF narrow filter
vfo_t vfoMain, vfoSub; //VFO
vfo_t vfoTx;
split_t split; //Split
ptt_t ptt; //PTT
value_t sMeter; //Smeter signal strenght
value_t powerMeter; //RF power meter
value_t subMeter; //secondary meter
unsigned meter; //secondary meter type
float rfPower; //RF power output level
float rfGain; //RF gain rx
float afGain; //AF gain level
float squelch; //Squelch level
agc_level_e agc; //AGC level
int att; //Attenuator
int pre; //Preamplifier
ant_t ant, antTx, antRx; //Antenna
int rangeListTxIndex, rangeListRxIndex;
int tuner; //Tuner
int bkin; //CW Break-in
int wpm; //CW Keyer speed WPM
int apf; //Audio Peak Filter
int noiseBlanker;
int noiseReduction, noiseReductionLevel;
int notchFilter;
int ifShift;
rptr_shift_t rptShift; //Repeater shift
int toneType; //0 none, 1 burst 1750, 2 CTCSS, 3 CTCSS SQL, 4 DCS, 5 DCS SQL
tone_t tone; //CTCSS or DCS tone
} rigSettings;
typedef struct {
int onoff;
int freqMain, freqSub;
int mode, modeSub;
int bwidth;
int bwidthList;
int vfo;
int split;
int vfoXchange;
int vfoCopy;
int ptt;
int rfPower;
int rfGain;
int afGain;
int squelch;
int agc;
int att;
int pre;
int ant;
int tuner;
int tune;
int bandUp;
int bandDown;
int bandChange;
int bkin;
int wpm;
int apf;
int noiseBlanker;
int noiseReduction, noiseReductionLevel;
int notchFilter;
int ifShift;
int rptShift;
int tone;
int antList;
int rangeList;
int toneList;
} rigCommand;

319
smeter.cpp 100644
Wyświetl plik

@ -0,0 +1,319 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "smeter.h"
#include <QPainter>
#include <math.h>
SMeter::SMeter(QWidget *parent) : QWidget(parent)
{
lineColor = QColor(Qt::black);
bgColor = QColor(Qt::white);
progressColor = QColor(Qt::green);
//Default value
minValue = 0;
maxValue = 100;
gateValue = 80;
longStep = 20;
shortStep = 10;
precision = 0;
meterTx = 0;
currentValue = -54;
}
void SMeter::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
QFont font;
font = painter.font();
font.setPointSize(font.pointSize() - 2);
painter.setFont(font);
drawMeter(&painter);
drawProgress(&painter);
drawScaleSMeter(&painter);
drawScalePWRMeter(&painter);
}
void SMeter::drawMeter(QPainter *painter)
{
painter->save();
QPen pen(lineColor, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
painter->setPen(pen);
painter->setBrush(bgColor);
painter->drawRect(0, height()/3+2, width()-12, height()/3-4);
painter->restore();
}
void SMeter::drawProgress(QPainter *painter)
{
double max, min;
double gate;
painter->save();
painter->setPen(Qt::NoPen);
painter->setBrush(progressColor);
if (meterTx) //RF power meter
{
max = maxValue;
min = minValue;
gate = gateValue;
}
else //SMeter
{
max = 60;
min = -54;
gate = 0;
}
double length = width()-14;
double increment = length / (max - min);
double initX, initXX;
if (currentValue>gate)
{
initX = (gate - min) * increment;
QRect rect(1, height()/3+2+1, initX, height()/3-4-2);
painter->drawRect(rect);
//Red bar
initXX = (currentValue - gate) * increment;
QRect rect2(initX+1, height()/3+2+1, initXX, height()/3-4-2);
painter->setBrush(Qt::red);
painter->drawRect(rect2);
}
else
{
initX = (currentValue - min) * increment;
QRect rect(1, height()/3+2+1, initX, height()/3-4-2);
painter->drawRect(rect);
}
painter->restore();
}
void SMeter::drawScalePWRMeter(QPainter *painter)
{
painter->save();
painter->setPen(lineColor);
double initX = 0;
double initTopY = height()*2/3-2;
double length = width()-12;
double increment = length / (maxValue - minValue);
int longLineLen = 6;
int shortLineLen = 3;
QFontMetrics meterFont(painter->font());
double textHeight = meterFont.height();
//Draw scale and scale values based on range values Long lines
int stepNumber = (maxValue - minValue) / shortStep;
for (int i = 0; i <= stepNumber; i++)
{
double j = i * shortStep + minValue;
if (fmod(j,longStep) == 0)
{
if (j == minValue) //Do not draw the first value
{
QPointF textPot = QPointF(initX, initTopY + textHeight);
painter->drawText(textPot, "PO");
initX += increment * shortStep;
continue;
}
QPointF topPot = QPointF(initX, initTopY);
QPointF bottomPot = QPointF(initX, initTopY + longLineLen);
painter->drawLine(topPot, bottomPot);
QString strValue = QString("%1").arg(j, 0, 'f', precision);
double textWidth = fontMetrics().horizontalAdvance(strValue);
QPointF textPot = QPointF(initX - textWidth / 2, initTopY + textHeight + longLineLen - 2);
painter->drawText(textPot, strValue);
}
else
{
QPointF topPot = QPointF(initX, initTopY);
QPointF bottomPot = QPointF(initX, initTopY + shortLineLen);
painter->drawLine(topPot, bottomPot);
}
initX += increment * shortStep;
}
painter->restore();
}
void SMeter::drawScaleSMeter(QPainter *painter)
{
int minValue = -54; //Set min and max value according to Hamlib SMeter definition
int maxValue = 60;
int longLineLen = 6;
int shortLineLen = 3;
double initX = 0;
int sUnit = 0;
double initBottomY = height()/3+2;
double length = width()-12;
double increment = length / (maxValue - minValue);
QFontMetrics meterFont(painter->font());
double textHeight = meterFont.height();
painter->save();
painter->setPen(lineColor);
//Draw scale and scale values based on range values
int longStep = 12;
int shortStep = 6;
for (int i = minValue; i <= 0; i = i + shortStep) //S0 to S9
{
if (i == minValue)
{
QPointF textPot = QPointF(initX, initBottomY - 2);
painter->drawText(textPot, "S");
initX += increment * shortStep;
sUnit = sUnit + 1;
continue;
}
if (i % longStep == 0)
{
QPointF topPot = QPointF(initX, initBottomY);
QPointF bottomPot = QPointF(initX, initBottomY - longLineLen);
painter->drawLine(topPot, bottomPot);
QString strValue = QString::number(sUnit);
double textWidth = fontMetrics().horizontalAdvance(strValue);
QPointF textPot = QPointF(initX - textWidth / 2, initBottomY - textHeight / 2 - longLineLen + 2);
painter->drawText(textPot, strValue);
}
else
{
QPointF topPot = QPointF(initX, initBottomY);
QPointF bottomPot = QPointF(initX, initBottomY - shortLineLen);
painter->drawLine(topPot, bottomPot);
}
sUnit = sUnit + 1;
initX += increment * shortStep;
}
initX -= increment * shortStep;
shortStep = 10;
longStep = 20;
for (int i = 0; i <= maxValue; i = i + shortStep) //S9+ to S9+60
{
if (i % longStep == 0)
{
QPointF topPot = QPointF(initX, initBottomY);
QPointF bottomPot = QPointF(initX, initBottomY - longLineLen);
painter->drawLine(topPot, bottomPot);
if (i == 0) //Do not draw the first value
{
initX += increment * shortStep;
continue;
}
QString strValue = "+" + QString::number(i);
double textWidth = fontMetrics().horizontalAdvance(strValue);
QPointF textPot = QPointF(initX - textWidth / 2, initBottomY - textHeight / 2 - longLineLen + 2);
painter->drawText(textPot, strValue);
}
else
{
QPointF topPot = QPointF(initX, initBottomY);
QPointF bottomPot = QPointF(initX, initBottomY - shortLineLen);
painter->drawLine(topPot, bottomPot);
}
initX += increment * shortStep;
}
painter->restore();
}
void SMeter::setMinValue(double value)
{
minValue = value;
update();
}
void SMeter::setMaxValue(double value)
{
maxValue = value;
update();
}
void SMeter::setGateValue(double value)
{
gateValue = value;
}
void SMeter::setLongStep(double value)
{
longStep = value;
update();
}
void SMeter::setShortStep(double value)
{
shortStep = value;
update();
}
void SMeter::setPrecision(int value)
{
precision = value;
update();
}
void SMeter::setValue(double value)
{
currentValue = value;
update();
}
void SMeter::setValue(int value)
{
setValue(double(value));
}
void SMeter::setTx(bool Tx)
{
meterTx = Tx;
}

73
smeter.h 100644
Wyświetl plik

@ -0,0 +1,73 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef SMETER_H
#define SMETER_H
#include <QWidget>
class SMeter : public QWidget
{
Q_OBJECT
public:
explicit SMeter(QWidget *parent = nullptr);
public slots:
void setMinValue(double value);
void setMaxValue(double value);
void setGateValue(double value);
void setLongStep(double value);
void setShortStep(double value);
void setPrecision(int value);
void setValue(double value);
void setValue(int value);
void setTx(bool Tx);
protected:
void paintEvent(QPaintEvent *);
void drawMeter(QPainter *painter);
void drawProgress(QPainter *painter);
void drawScaleSMeter(QPainter *painter);
void drawScalePWRMeter(QPainter *painter);
private:
double minValue; //Minimum scale value
double maxValue; //Maximum scale value
double gateValue; //Gate value to bar color change
double longStep; //Long lines with equal steps
double shortStep; //Short lines with equal steps
int precision; //Precision, the last few decimal places
double value; //target value
double currentValue; //current value
bool meterTx; //Switch between SMeter or PowerMeter
QColor bgColor; //background color
QColor lineColor; //line color
QColor progressColor; //progress color
signals:
};
#endif // SMETER_H

257
submeter.cpp 100644
Wyświetl plik

@ -0,0 +1,257 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "submeter.h"
#include <QPainter>
#include <math.h>
#include <QDebug>
SubMeter::SubMeter(QWidget *parent) : QWidget(parent)
{
lineColor = QColor(Qt::black);
bgColor = QColor(Qt::white);
progressColor = QColor(Qt::green);
//Default value
minValue = 0;
maxValue = 10;
gateValue = 10;
longStep = 5;
shortStep = 1;
precision = 0;
meterSWR = 0;
currentValue = 0;
}
void SubMeter::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
QFont font;
font = painter.font();
font.setPointSize(font.pointSize() - 2);
painter.setFont(font);
drawMeter(&painter);
drawProgress(&painter);
drawScale(&painter);
}
void SubMeter::drawMeter(QPainter *painter)
{
painter->save();
QPen pen(lineColor, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
painter->setPen(pen);
painter->setBrush(bgColor);
painter->drawRect(0, height()/3+2, width()-12, height()/3-4);
painter->restore();
}
void SubMeter::drawProgress(QPainter *painter)
{
painter->save();
painter->setPen(Qt::NoPen);
painter->setBrush(progressColor);
double length = width()-14;
double increment;
double initX, initXX;
if (meterSWR) increment = length / (10 * log10(maxValue));
else increment = length / (maxValue - minValue);
if (currentValue>gateValue)
{
if (currentValue > maxValue) currentValue = maxValue; //Trim value if overload scale
if (meterSWR) initX = 10 * log10(gateValue) * increment;
else initX = (gateValue - minValue) * increment;
QRect rect(1, height()/3+2+1, initX, height()/3-4-2);
painter->drawRect(rect);
//Red bar
if (meterSWR)
{
if (currentValue > maxValue) currentValue = maxValue; //Trim value if overload scale
initXX = 10 * (log10(currentValue) - log10(gateValue)) * increment;
}
else
{
if (currentValue > maxValue) currentValue = maxValue; //Trim value if overload scale
initXX = (currentValue - gateValue) * increment;
}
QRect rect2(initX+1, height()/3+2+1, initXX+1, height()/3-4-2);
painter->setBrush(Qt::red);
painter->drawRect(rect2);
}
else
{
if (meterSWR) initX = 10 * log10(currentValue) * increment;
else initX = (currentValue - minValue) * increment;
QRect rect(1, height()/3+2+1, initX, height()/3-4-2);
painter->drawRect(rect);
}
painter->restore();
}
void SubMeter::drawScale(QPainter *painter)
{
painter->save();
painter->setPen(lineColor);
double initX = 0;
double initTopY = height()*2/3-2;
double length = width()-12;
double increment;
int longLineLen = 6;
int shortLineLen = 3;
QFontMetrics meterFont(painter->font());
double textHeight = meterFont.height();
if (meterSWR) increment = length / (10 * log10(maxValue));
else increment = length / (maxValue - minValue);
if (meterSWR) //Draw SWR meter with log scale
{
double j = 1.0;
for (int i = 0; i <= 10; i++) //1.0 to 2.0
{
QPointF topPot = QPointF(initX, initTopY);
QPointF bottomPot;
if (abs(j - 1.5) < 0.01 || abs(j - 2.0) < 0.01)
{
bottomPot = QPointF(initX, initTopY + longLineLen);
QString strValue = QString::number(j, 'f', 1);
double textWidth = fontMetrics().horizontalAdvance(strValue);
QPointF textPot = QPointF(initX - textWidth / 2, initTopY + textHeight + longLineLen - 2);
painter->drawText(textPot, strValue);
}
else bottomPot = QPointF(initX, initTopY + shortLineLen);
painter->drawLine(topPot, bottomPot);
j +=0.1;
initX = 10 * log10(j) * increment;
}
for (int i = 11; i <= 25; i++) //2.1 to 3.5
{
QPointF topPot = QPointF(initX, initTopY);
QPointF bottomPot;
if (abs(j - 2.5) < 0.01 || abs(j - 3.0) < 0.01 || abs(j - 3.5) < 0.01)
{
bottomPot = QPointF(initX, initTopY + longLineLen);
QString strValue = QString::number(j, 'f', 1);
double textWidth = fontMetrics().horizontalAdvance(strValue);
QPointF textPot = QPointF(initX - textWidth / 2, initTopY + textHeight + longLineLen - 2);
painter->drawText(textPot, strValue);
painter->drawLine(topPot, bottomPot);
}
j +=0.1;
initX = 10 * log10(j) * increment;
}
}
else //Draw scale and scale values based on range values
{
int stepNumber = (maxValue - minValue) / shortStep;
for (int i = 0; i <= stepNumber; i++)
{
double j = i * shortStep + minValue;
if (fmod(j,longStep) == 0)
{
if (j == minValue) //Do not draw the first value
{
initX += increment * shortStep;
continue;
}
QPointF topPot = QPointF(initX, initTopY);
QPointF bottomPot = QPointF(initX, initTopY + longLineLen);
painter->drawLine(topPot, bottomPot);
QString strValue = QString("%1").arg(j, 0, 'f', precision);
double textWidth = fontMetrics().horizontalAdvance(strValue);
QPointF textPot = QPointF(initX - textWidth / 2, initTopY + textHeight + longLineLen - 2);
painter->drawText(textPot, strValue);
}
else
{
QPointF topPot = QPointF(initX, initTopY);
QPointF bottomPot = QPointF(initX, initTopY + shortLineLen);
painter->drawLine(topPot, bottomPot);
}
initX += increment * shortStep;
}
}
painter->restore();
}
void SubMeter::setMinValue(double value)
{
minValue = value;
update();
}
void SubMeter::setMaxValue(double value)
{
maxValue = value;
update();
}
void SubMeter::setGateValue(double value)
{
gateValue = value;
}
void SubMeter::setLongStep(double value)
{
longStep = value;
update();
}
void SubMeter::setShortStep(double value)
{
shortStep = value;
update();
}
void SubMeter::setPrecision(int value)
{
precision = value;
update();
}
void SubMeter::setValue(double value)
{
currentValue = value;
update();
}
void SubMeter::setValue(int value)
{
setValue(double(value));
}
void SubMeter::setMeterSWR(bool swr)
{
meterSWR = swr;
}

71
submeter.h 100644
Wyświetl plik

@ -0,0 +1,71 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef SUBMETER_H
#define SUBMETER_H
#include <QWidget>
class SubMeter : public QWidget
{
Q_OBJECT
public:
explicit SubMeter(QWidget *parent = nullptr);
public slots:
void setMinValue(double value);
void setMaxValue(double value);
void setGateValue(double value);
void setLongStep(double value);
void setShortStep(double value);
void setPrecision(int value);
void setValue(double value);
void setValue(int value);
void setMeterSWR(bool swr);
protected:
void paintEvent(QPaintEvent *);
void drawMeter(QPainter *painter);
void drawProgress(QPainter *painter);
void drawScale(QPainter *painter);
private:
double minValue; //Minimum scale value
double maxValue; //Maximum scale value
double gateValue; //Gate value to bar color change
double longStep; //Long lines with equal steps
double shortStep; //Short lines with equal steps
int precision; //Precision, the last few decimal places
int meterSWR; //set for SWR meter
double value; //target value
double currentValue; //current value
QColor bgColor; //background color
QColor lineColor; //line color
QColor progressColor; //progress color
signals:
};
#endif // SUBMETER_H

154
vfodisplay.cpp 100644
Wyświetl plik

@ -0,0 +1,154 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#include "vfodisplay.h"
#include "guidata.h"
#include <QPainter>
#include <QInputEvent>
#include <QDebug>
#include <QtMath>
#include <math.h>
extern guiConfig guiConf;
vfoDisplay::vfoDisplay(QWidget *parent) : QWidget(parent)
{
lineColor = QColor(Qt::black);
bgColor = QColor(Qt::white);
textColor = QColor(Qt::black);
}
void vfoDisplay::paintEvent(QPaintEvent *)
{
//setMouseTracking(true);
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
QFont font;
font = painter.font();
font.setPointSize(height() - 18);
painter.setFont(font);
drawDisplay(&painter);
drawText(&painter);
}
void vfoDisplay::drawDisplay(QPainter *painter)
{
painter->save();
QPen pen(lineColor, 1, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin);
painter->setPen(pen);
painter->setBrush(bgColor);
painter->drawRect(1, 1, width()-3, height()-2);
painter->restore();
}
void vfoDisplay::drawText(QPainter *painter)
{
painter->save();
painter->setPen(textColor);
QFontMetrics meterFont(painter->font());
double textHeight = meterFont.ascent();
textWidth = meterFont.horizontalAdvance("0",-1);
QPointF textPot;
long val = currentValue;
for (int i = 1; i < 10; i++)
{
val = qFloor(val/10);
int d = val % 10;
if (i==2)
{
textPot = QPointF(width()-3-(textWidth+2)*i-4, textHeight);
painter->drawText(textPot, ".");
}
textPot = QPointF(width()-3-(textWidth+2)*i, textHeight);
if (val==0 && d==0) painter->drawText(textPot, " ");
else painter->drawText(textPot, QString::number(d));
}
painter->restore();
}
void vfoDisplay::setValue(unsigned long value)
{
currentValue = value;
update();
}
//* Tuning using mouse buttons
void vfoDisplay::mousePressEvent(QMouseEvent *event)
{
event->accept();
QPoint pointerPos = event->pos();
for (int i = 1; i < 10; i ++)
{
if (pointerPos.x() > (width()-3-(textWidth+2)*i+1) && pointerPos.x() < (width()-3-(textWidth+2)*(i-1)-1))
{
if (guiConf.vfoDisplayMode && event->button() == Qt::LeftButton) //Up/Down mode
{
if (pointerPos.y() < height()/2) currentValue = currentValue + pow(10,i); //Up
else if (currentValue - pow(10,i) > 0) currentValue = currentValue - pow(10,i); //Down
}
else if (!guiConf.vfoDisplayMode) //Left/Right mode
{
if (event->button() == Qt::LeftButton) currentValue = currentValue + pow(10,i); //LeftButton
else if (currentValue - pow(10,i) > 0) currentValue = currentValue - pow(10,i); //RightButton
}
break;
}
}
update();
emit on_valueChanged(currentValue);
}
//* Tuning using mouse wheel
void vfoDisplay::wheelEvent(QWheelEvent *event)
{
event->accept();
QPointF pointerPos = event->position();
for (int i = 1; i < 10; i ++)
{
if (pointerPos.x() > (width()-3-(textWidth+2)*i+1) && pointerPos.x() < (width()-3-(textWidth+2)*(i-1)-1))
{
if (event->angleDelta().y() > 0) currentValue = currentValue + pow(10,i); //Wheel up
else if (currentValue - pow(10,i) > 0) currentValue = currentValue - pow(10,i); //Wheel down
}
}
update();
emit on_valueChanged(currentValue);
}

37
vfodisplay.h 100644
Wyświetl plik

@ -0,0 +1,37 @@
#ifndef VFODISPLAY_H
#define VFODISPLAY_H
#include <QWidget>
class vfoDisplay : public QWidget
{
Q_OBJECT
public:
explicit vfoDisplay(QWidget *parent = nullptr);
public slots:
void setValue(unsigned long value);
signals:
void on_valueChanged(int value);
protected:
void paintEvent(QPaintEvent *);
void drawDisplay(QPainter *painter);
void drawText(QPainter *painter);
void mousePressEvent(QMouseEvent *event); //Mouse buttons
void wheelEvent(QWheelEvent *event); //Mouse wheel
private:
QColor bgColor; //background color
QColor lineColor; //line color
QColor textColor; //text color
unsigned long currentValue; //current frequency value (Hz)
unsigned long value; //target value
int textWidth; //number width
};
#endif // VFODISPLAY_H