Added support for use of "Standard" locations for writable files.
This allows writable files to be located in the "correct"
location for each platform rather than in the directory of
the executable which, in general, is not recommended or
allowed in some cases.
A preprocessor macro WSJT_STANDARD_FILE_LOCATIONS is used to
switch be tween old and new functionality, currently it is on
by default. It can be turned off by defining it to a false
value (0) or more simply with cmake-gui setting the option
with the same name. JTAlert can only work with the old
non-standard file locations until Laurie VK3AMA chooses to
support the new file locations.
Even if the above is not enabled; the QSettings file is
written to a user specific location so it will be shared by
all instances of the program (i.e. across upgrades). See
below for multiple concurrent instance support changes.
Added a command line parser module for Fortran.
Added 'lib/options.f90' to facilitate more complex argument
passing to jt9 to cover explicit file locations.
Changed the way multiple concurrent instances are handled.
This is to allow the program to be run multiple times from
the same installation directory.
A new wsjtx command line optional argument is available "-r"
or "--rig" which enables multiple concurrent instance
support. The parameter of the new option is a unique name
signifying a rig or equivalent. The name is used as the
shared memory segment key and in window titles. The name is
also used to access unique settings files and writable data
files like ALL.TXT and log files. No attempt has been made
to share these files between concurrent instances.
If "-r" or "--rig" is used without a parameter it still
enables multiple concurrent instance support for that
instance. All instances must use a unique parameter, one of
which may be empty.
The rig name is appended the
QCoreApplication::applicationName() for convenient usage like
window titles.
Set non Qt locale to "C".
This ensures that C library functions give consistent results
whatever the system locale is set to. QApplication follows
the system locale as before. Thus using QApplication and its
descendants like widgets and QString for all user visible
formating will give correct l10n and using C/C++ library will
give consistent formatting across locales.
Added top level C++ exception handling to main.cpp.
Because the new transceiver framework uses exceptions
internally, the main function now handles any exceptions that
aren't caught.
Retired devsetup, replaced with Configuration.
Configuration is a class that encapsulates most of the
configuration behavior. Because rig configuration is so
closely coupled with rig operation, Configuration serves as a
proxy for access to the rig control functions. See
Configuration.hpp for more details of the Configuration
interface.
Menu changes.
Various checkable menu actions moved from main menu to the
Configuration dialog. The whole settings menu has been
retired with the single "Settings..." action moved to the
file menu for consistency on Mac where it appears as
"Preferences" in line with Mac guidelines.
New data models for data used by the application.
ADIF amateur band parameters, free text message macros, spot
working frequencies and, station information (station
descriptions and transverter offsets per band) each implement
the QAbstractItemModel interface allowing them to be used
directly with Qt view widgets (Bands.hpp, FrequencyList.hpp
and, StationList.hpp). Configuration manages maintenance of
an instance of all but the former of the above models. The
ADIF band model is owned by Configuration but requires no
user maintenance as it is immutable.
Band combo box gets more functionality.
This widget is now an editable QComboBox with some extra
input capabilities.
The popup list is still the list of spot working frequencies,
now showing the actual frequency decorated with the band
name. This allows multiple spot frequencies on a band if
required.
The line edit allows direct frequency entry in mega-Hertz
with a completer built in to suggest the available spot
working frequencies. It also allows band name entry where
the first available spot working frequency is selected.
Recognized band names are those that are defined by the ADIF
specification and can be found in in the implementation of
the ADIF bands model (Bands.cpp).
If an out of band frequency is chosen, the line edit shows a
warning red background and the text "OOB". Out of band is
only defined by the ADIF band limits which in general are
wider than any entities regulations.
Qt 5.2 now supports default audio i/p and o/p devices.
These devices are placeholders for whatever the user defines
as the default device. Because of this they need special
treatment as the actual device used is chosen at open time
behind the scenes.
Close-down behavior is simplified.
The close-down semantics were broken such that some objects
were not being shut down cleanly, this required amendments to
facilitate correct close down of threads.
User font selection added to Configuration UI.
Buttons to set the application font and the font for the band
and Rx frequency activity widgets have been added to the
Configuration UI to replace the file based font size control.
Free text macros now selected directly.
The free text line edit widgets are now editable combo boxes
that have the current free text macro definitions as their
popup list. The old context menu to do this has been
retired.
Astronomical data window dynamically formatted and has font a chooser.
This window is now autonomous, has its own font chooser and,
dynamically resizes to cover the contents.
Double click to Tx enabled now has its own widget in the status bar.
QDir used for portable path and file name handling throughout.
The "Monitor", "Decode", "Enable Tx" and, "Tune" buttons are now
checkable.
Being checkable allows these buttons control their own state
and rendering.
Calls to PSK Reporter interface simplified.
In mainwindow.cpp the calls to this interface are
rationalized to just 3 locations.
Manipulation of ALL.TXT simplified.
Moved, where possible, to common functions.
Elevated frequency types to be Qt types.
Frequency and FrequencyDelta defined as Qt types in their
meta-type system (Radio.hpp). They are integral types for
maximum accuracy.
Re-factored rig control calls in mainwindow.cpp.
The new Configuration proxy access to rig control required
many changes (mostly simplifications) to the MainWindow rig
control code. Some common code has been gathered in member
functions like qsy(), monitor(), band_changed() and
auto_tx_mode().
Rig control enhancements.
The rig control for clients interface is declared as an
abstract interface (See Transceiver.hpp). Concrete
implementations of this interface are provided for the Hamlib
rig control library, DX Lab Suite Commander via a TCP/IP
command channel, Ham Radio Deluxe also via a TCP/IP command
channel and, OmniRig via its Windows COM server interface.
Concrete Transceiver implementations are expected to be moved
to a separate thread after construction since many operations
are blocking and not suitable for running in a GUI thread.
To facilitate this all instantiation of concrete Transceiver
instances are handled by Configuration using a factory class
(TransceiverFactory) for configuration parameter based
instantiation.
Various common functionality shared by different rig
interface implementations are factored out into helper base
classes that implement or delegate parts of the Transceiver
interface. They are TransceiverBase which caches state to
minimize expensive rig commands, it also maps the Transceiver
interface into a more convenient form for implementation
(template methods). PollingTransceiver that provides a state
polling mechanism that only reports actual changes.
EmulateSplitTransceiver that provides split operation by
QSYing on PTT state changes.
EmulateSplitTransceiver can be used with any implementation
as it follows the GoF Decorator pattern and can wrap any
Transceiver implementation.
OmniRigTransceiver is derived directly from TransceiverBase
since it doesn't require polling due to its asynchronous
nature. OmniRigTransceiver is only built on Windows as it is
a COM server client. To build it you must first install the
OmniRig client on the development machine
(http://www.dxatlas.com/omnirig/).
DXLabSuiteCommanderTransceiver derives from
PollingTransceiver since it is a synchronous communications
channel. No third party library is required for this
interface.
HRDTransceiver also derives from PollingTransceiver. The HRD
interface library has been reverse engineered to provide
functionality with all available versions of HRD. No third
party libraries are required.
HamlibTransceiver likewise derives from PollingTransceiver
since the Hamlib asynchronous interface is non-functional.
Although this class will interface with the release version
of Hamlib (1.2.15.3); for correct operation on most rigs it
needs to run with the latest master branch code of Hamlib.
During development many changes to Hamlib have been submitted
and accepted, hence this requirement. Hamlib source can be
obtained from git://git.code.sf.net/p/hamlib/code and at the
time of writing he master branch was at SHA 6e4432.
The Hamlib interface directly calls the "C" interface and the
modified rigclass.{h,cpp} files have been retired.
There is a rig type selection of "None" which may be used for
non-CAT rigs, this is actually a connection to the dummy
Hamlib device.
PollingTransvceiver derives from TransceiverBase and
TransceiverBase derives from the Transceiver interface.
Each interface implementation offers some possibility of PTT
control via a different serial port than the CAT port. We
also support PTT control directly via a second serial port.
This is done by delegating to a dummy Hamlib instance which
is only used for PTT control. This means that
DXLabSuiteCommanderTransceiver, HRDTransceiver and
OmniRigTransceiver always wrap a dummy HamlibTransceiver
instance. The factory class TransceiverFactory manages all
these constructional complexities.
Serial port selection combo boxes are now editable with a
manually entered value being saved to the settings file.
This allows a non-standard port device to be used without
having to edit the settings file manually.
For TCP/IP network CAT interfaces; the network address and
port may be specified allowing the target device to be
located on a different machine from the one running wsjtx if
required. The default used when the address field is left
blank is the correct one for normal usage on the local host.
Selecting a polling interval of zero is no longer possible,
this is because the rig control capability can no longer
support one way connection. This is in line with most other
CAT control software.
In the Configuration dialog there are options to select split
mode control by the software and mode control by the
software. For the former "None", "Rig" and "Fake it" are
available, for the latter "None", "USB" and, "Data" are
available. Because tone generation is implicitly linked to
split mode operation; it is no longer possible to have the
software in split mode and the rig not or vice versa. This
may mean some rigs cannot be used in split mode and therefore
not in dual JT65+JT9 until issues with CAT control with that
rig are resolved. Single mode with VOX keying and no CAT
control are still possible so even the most basic transceiver
setup is supported as before.
Configuration now supports a frequency offset suitable for
transverter operation. The station details model
(StationList.hpp) includes a column to store an offset for
each band if required.
CMake build script improvements.
The CMakeLists.txt from the 'lib' directory has been retired
with its contents merged into the top level CMakeLists.txt.
Install target support has been greatly improved with the
Release build configuration now building a fully standalone
installation on Mac and Windows. The Debug configuration
still builds an installation that has environment
dependencies for external libraries, which is desirable for
testing and debugging.
Package target support is largely complete for Mac, Windows
and, Linux, it should be possible to build release installers
directly from CMake/CPack.
Cmake FindXXXX.cmake modules have been added to improve the
location of fftw-3 and Hamlib packages.
Version numbers are now stored in Versions.cmake and work in
concert with automatic svn revision lookup during build. The
version string becomes 'rlocal'± if there are any uncommitted
changes in the build source tree.
Moved resource like files to Qt resources.
Because location of resource files (when they cannot go into
the installation directory because of packaging rules) is
hard to standardize. I have used the Qt resource system for
all ancillary data files. Some like kvasd.dat are dumped out
to the temp (working directory) because they are accessed by
an external program, others like the audio samples are copied
out so they appear in the data directory under the default
save directory.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3929 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-03-26 09:21:00 -04:00
|
|
|
#include "OmniRigTransceiver.hpp"
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
#include <objbase.h>
|
|
|
|
|
|
|
|
#include "moc_OmniRigTransceiver.cpp"
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
auto constexpr OmniRig_transceiver_one_name = "OmniRig Rig 1";
|
|
|
|
auto constexpr OmniRig_transceiver_two_name = "OmniRig Rig 2";
|
|
|
|
}
|
|
|
|
|
|
|
|
auto OmniRigTransceiver::map_mode (OmniRig::RigParamX param) -> MODE
|
|
|
|
{
|
|
|
|
if (param & OmniRig::PM_CW_U)
|
|
|
|
{
|
|
|
|
return CW_R;
|
|
|
|
}
|
|
|
|
else if (param & OmniRig::PM_CW_L)
|
|
|
|
{
|
|
|
|
return CW;
|
|
|
|
}
|
|
|
|
else if (param & OmniRig::PM_SSB_U)
|
|
|
|
{
|
|
|
|
return USB;
|
|
|
|
}
|
|
|
|
else if (param & OmniRig::PM_SSB_L)
|
|
|
|
{
|
|
|
|
return LSB;
|
|
|
|
}
|
|
|
|
else if (param & OmniRig::PM_DIG_U)
|
|
|
|
{
|
|
|
|
return DIG_U;
|
|
|
|
}
|
|
|
|
else if (param & OmniRig::PM_DIG_L)
|
|
|
|
{
|
|
|
|
return DIG_L;
|
|
|
|
}
|
|
|
|
else if (param & OmniRig::PM_AM)
|
|
|
|
{
|
|
|
|
return AM;
|
|
|
|
}
|
|
|
|
else if (param & OmniRig::PM_FM)
|
|
|
|
{
|
|
|
|
return FM;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRig map_mode unrecognized mode";
|
|
|
|
#endif
|
|
|
|
|
2014-04-16 10:59:00 -04:00
|
|
|
throw error {tr ("OmniRig: unrecognized mode")};
|
Added support for use of "Standard" locations for writable files.
This allows writable files to be located in the "correct"
location for each platform rather than in the directory of
the executable which, in general, is not recommended or
allowed in some cases.
A preprocessor macro WSJT_STANDARD_FILE_LOCATIONS is used to
switch be tween old and new functionality, currently it is on
by default. It can be turned off by defining it to a false
value (0) or more simply with cmake-gui setting the option
with the same name. JTAlert can only work with the old
non-standard file locations until Laurie VK3AMA chooses to
support the new file locations.
Even if the above is not enabled; the QSettings file is
written to a user specific location so it will be shared by
all instances of the program (i.e. across upgrades). See
below for multiple concurrent instance support changes.
Added a command line parser module for Fortran.
Added 'lib/options.f90' to facilitate more complex argument
passing to jt9 to cover explicit file locations.
Changed the way multiple concurrent instances are handled.
This is to allow the program to be run multiple times from
the same installation directory.
A new wsjtx command line optional argument is available "-r"
or "--rig" which enables multiple concurrent instance
support. The parameter of the new option is a unique name
signifying a rig or equivalent. The name is used as the
shared memory segment key and in window titles. The name is
also used to access unique settings files and writable data
files like ALL.TXT and log files. No attempt has been made
to share these files between concurrent instances.
If "-r" or "--rig" is used without a parameter it still
enables multiple concurrent instance support for that
instance. All instances must use a unique parameter, one of
which may be empty.
The rig name is appended the
QCoreApplication::applicationName() for convenient usage like
window titles.
Set non Qt locale to "C".
This ensures that C library functions give consistent results
whatever the system locale is set to. QApplication follows
the system locale as before. Thus using QApplication and its
descendants like widgets and QString for all user visible
formating will give correct l10n and using C/C++ library will
give consistent formatting across locales.
Added top level C++ exception handling to main.cpp.
Because the new transceiver framework uses exceptions
internally, the main function now handles any exceptions that
aren't caught.
Retired devsetup, replaced with Configuration.
Configuration is a class that encapsulates most of the
configuration behavior. Because rig configuration is so
closely coupled with rig operation, Configuration serves as a
proxy for access to the rig control functions. See
Configuration.hpp for more details of the Configuration
interface.
Menu changes.
Various checkable menu actions moved from main menu to the
Configuration dialog. The whole settings menu has been
retired with the single "Settings..." action moved to the
file menu for consistency on Mac where it appears as
"Preferences" in line with Mac guidelines.
New data models for data used by the application.
ADIF amateur band parameters, free text message macros, spot
working frequencies and, station information (station
descriptions and transverter offsets per band) each implement
the QAbstractItemModel interface allowing them to be used
directly with Qt view widgets (Bands.hpp, FrequencyList.hpp
and, StationList.hpp). Configuration manages maintenance of
an instance of all but the former of the above models. The
ADIF band model is owned by Configuration but requires no
user maintenance as it is immutable.
Band combo box gets more functionality.
This widget is now an editable QComboBox with some extra
input capabilities.
The popup list is still the list of spot working frequencies,
now showing the actual frequency decorated with the band
name. This allows multiple spot frequencies on a band if
required.
The line edit allows direct frequency entry in mega-Hertz
with a completer built in to suggest the available spot
working frequencies. It also allows band name entry where
the first available spot working frequency is selected.
Recognized band names are those that are defined by the ADIF
specification and can be found in in the implementation of
the ADIF bands model (Bands.cpp).
If an out of band frequency is chosen, the line edit shows a
warning red background and the text "OOB". Out of band is
only defined by the ADIF band limits which in general are
wider than any entities regulations.
Qt 5.2 now supports default audio i/p and o/p devices.
These devices are placeholders for whatever the user defines
as the default device. Because of this they need special
treatment as the actual device used is chosen at open time
behind the scenes.
Close-down behavior is simplified.
The close-down semantics were broken such that some objects
were not being shut down cleanly, this required amendments to
facilitate correct close down of threads.
User font selection added to Configuration UI.
Buttons to set the application font and the font for the band
and Rx frequency activity widgets have been added to the
Configuration UI to replace the file based font size control.
Free text macros now selected directly.
The free text line edit widgets are now editable combo boxes
that have the current free text macro definitions as their
popup list. The old context menu to do this has been
retired.
Astronomical data window dynamically formatted and has font a chooser.
This window is now autonomous, has its own font chooser and,
dynamically resizes to cover the contents.
Double click to Tx enabled now has its own widget in the status bar.
QDir used for portable path and file name handling throughout.
The "Monitor", "Decode", "Enable Tx" and, "Tune" buttons are now
checkable.
Being checkable allows these buttons control their own state
and rendering.
Calls to PSK Reporter interface simplified.
In mainwindow.cpp the calls to this interface are
rationalized to just 3 locations.
Manipulation of ALL.TXT simplified.
Moved, where possible, to common functions.
Elevated frequency types to be Qt types.
Frequency and FrequencyDelta defined as Qt types in their
meta-type system (Radio.hpp). They are integral types for
maximum accuracy.
Re-factored rig control calls in mainwindow.cpp.
The new Configuration proxy access to rig control required
many changes (mostly simplifications) to the MainWindow rig
control code. Some common code has been gathered in member
functions like qsy(), monitor(), band_changed() and
auto_tx_mode().
Rig control enhancements.
The rig control for clients interface is declared as an
abstract interface (See Transceiver.hpp). Concrete
implementations of this interface are provided for the Hamlib
rig control library, DX Lab Suite Commander via a TCP/IP
command channel, Ham Radio Deluxe also via a TCP/IP command
channel and, OmniRig via its Windows COM server interface.
Concrete Transceiver implementations are expected to be moved
to a separate thread after construction since many operations
are blocking and not suitable for running in a GUI thread.
To facilitate this all instantiation of concrete Transceiver
instances are handled by Configuration using a factory class
(TransceiverFactory) for configuration parameter based
instantiation.
Various common functionality shared by different rig
interface implementations are factored out into helper base
classes that implement or delegate parts of the Transceiver
interface. They are TransceiverBase which caches state to
minimize expensive rig commands, it also maps the Transceiver
interface into a more convenient form for implementation
(template methods). PollingTransceiver that provides a state
polling mechanism that only reports actual changes.
EmulateSplitTransceiver that provides split operation by
QSYing on PTT state changes.
EmulateSplitTransceiver can be used with any implementation
as it follows the GoF Decorator pattern and can wrap any
Transceiver implementation.
OmniRigTransceiver is derived directly from TransceiverBase
since it doesn't require polling due to its asynchronous
nature. OmniRigTransceiver is only built on Windows as it is
a COM server client. To build it you must first install the
OmniRig client on the development machine
(http://www.dxatlas.com/omnirig/).
DXLabSuiteCommanderTransceiver derives from
PollingTransceiver since it is a synchronous communications
channel. No third party library is required for this
interface.
HRDTransceiver also derives from PollingTransceiver. The HRD
interface library has been reverse engineered to provide
functionality with all available versions of HRD. No third
party libraries are required.
HamlibTransceiver likewise derives from PollingTransceiver
since the Hamlib asynchronous interface is non-functional.
Although this class will interface with the release version
of Hamlib (1.2.15.3); for correct operation on most rigs it
needs to run with the latest master branch code of Hamlib.
During development many changes to Hamlib have been submitted
and accepted, hence this requirement. Hamlib source can be
obtained from git://git.code.sf.net/p/hamlib/code and at the
time of writing he master branch was at SHA 6e4432.
The Hamlib interface directly calls the "C" interface and the
modified rigclass.{h,cpp} files have been retired.
There is a rig type selection of "None" which may be used for
non-CAT rigs, this is actually a connection to the dummy
Hamlib device.
PollingTransvceiver derives from TransceiverBase and
TransceiverBase derives from the Transceiver interface.
Each interface implementation offers some possibility of PTT
control via a different serial port than the CAT port. We
also support PTT control directly via a second serial port.
This is done by delegating to a dummy Hamlib instance which
is only used for PTT control. This means that
DXLabSuiteCommanderTransceiver, HRDTransceiver and
OmniRigTransceiver always wrap a dummy HamlibTransceiver
instance. The factory class TransceiverFactory manages all
these constructional complexities.
Serial port selection combo boxes are now editable with a
manually entered value being saved to the settings file.
This allows a non-standard port device to be used without
having to edit the settings file manually.
For TCP/IP network CAT interfaces; the network address and
port may be specified allowing the target device to be
located on a different machine from the one running wsjtx if
required. The default used when the address field is left
blank is the correct one for normal usage on the local host.
Selecting a polling interval of zero is no longer possible,
this is because the rig control capability can no longer
support one way connection. This is in line with most other
CAT control software.
In the Configuration dialog there are options to select split
mode control by the software and mode control by the
software. For the former "None", "Rig" and "Fake it" are
available, for the latter "None", "USB" and, "Data" are
available. Because tone generation is implicitly linked to
split mode operation; it is no longer possible to have the
software in split mode and the rig not or vice versa. This
may mean some rigs cannot be used in split mode and therefore
not in dual JT65+JT9 until issues with CAT control with that
rig are resolved. Single mode with VOX keying and no CAT
control are still possible so even the most basic transceiver
setup is supported as before.
Configuration now supports a frequency offset suitable for
transverter operation. The station details model
(StationList.hpp) includes a column to store an offset for
each band if required.
CMake build script improvements.
The CMakeLists.txt from the 'lib' directory has been retired
with its contents merged into the top level CMakeLists.txt.
Install target support has been greatly improved with the
Release build configuration now building a fully standalone
installation on Mac and Windows. The Debug configuration
still builds an installation that has environment
dependencies for external libraries, which is desirable for
testing and debugging.
Package target support is largely complete for Mac, Windows
and, Linux, it should be possible to build release installers
directly from CMake/CPack.
Cmake FindXXXX.cmake modules have been added to improve the
location of fftw-3 and Hamlib packages.
Version numbers are now stored in Versions.cmake and work in
concert with automatic svn revision lookup during build. The
version string becomes 'rlocal'± if there are any uncommitted
changes in the build source tree.
Moved resource like files to Qt resources.
Because location of resource files (when they cannot go into
the installation directory because of packaging rules) is
hard to standardize. I have used the Qt resource system for
all ancillary data files. Some like kvasd.dat are dumped out
to the temp (working directory) because they are accessed by
an external program, others like the audio samples are copied
out so they appear in the data directory under the default
save directory.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3929 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-03-26 09:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
OmniRig::RigParamX OmniRigTransceiver::map_mode (MODE mode)
|
|
|
|
{
|
|
|
|
switch (mode)
|
|
|
|
{
|
|
|
|
case AM: return OmniRig::PM_AM;
|
|
|
|
case CW: return OmniRig::PM_CW_L;
|
|
|
|
case CW_R: return OmniRig::PM_CW_U;
|
|
|
|
case USB: return OmniRig::PM_SSB_U;
|
|
|
|
case LSB: return OmniRig::PM_SSB_L;
|
|
|
|
case FSK: return OmniRig::PM_DIG_L;
|
|
|
|
case FSK_R: return OmniRig::PM_DIG_U;
|
|
|
|
case DIG_L: return OmniRig::PM_DIG_L;
|
|
|
|
case DIG_U: return OmniRig::PM_DIG_U;
|
|
|
|
case FM: return OmniRig::PM_FM;
|
|
|
|
case DIG_FM: return OmniRig::PM_FM;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return OmniRig::PM_SSB_U; // quieten compiler grumble
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::register_transceivers (TransceiverFactory::Transceivers * registry, int id1, int id2)
|
|
|
|
{
|
|
|
|
(*registry)[OmniRig_transceiver_one_name] = TransceiverFactory::Capabilities {
|
|
|
|
id1
|
|
|
|
, TransceiverFactory::Capabilities::none // COM isn't serial or network
|
|
|
|
, true // does PTT
|
|
|
|
, false // doesn't select mic/data (use OmniRig config file)
|
|
|
|
, true // can remote control RTS nd DTR
|
|
|
|
, true // asynchronous interface
|
|
|
|
};
|
|
|
|
(*registry)[OmniRig_transceiver_two_name] = TransceiverFactory::Capabilities {
|
|
|
|
id2
|
|
|
|
, TransceiverFactory::Capabilities::none // COM isn't serial or network
|
|
|
|
, true // does PTT
|
|
|
|
, false // doesn't select mic/data (use OmniRig config file)
|
|
|
|
, true // can remote control RTS nd DTR
|
|
|
|
, true // asynchronous interface
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
OmniRigTransceiver::OmniRigTransceiver (std::unique_ptr<TransceiverBase> wrapped, RigNumber n, TransceiverFactory::PTTMethod ptt_type, QString const& ptt_port)
|
|
|
|
: wrapped_ {std::move (wrapped)}
|
|
|
|
, use_for_ptt_ {TransceiverFactory::PTT_method_CAT == ptt_type || ("CAT" == ptt_port && (TransceiverFactory::PTT_method_RTS == ptt_type || TransceiverFactory::PTT_method_DTR == ptt_type))}
|
|
|
|
, ptt_type_ {ptt_type}
|
|
|
|
, startup_poll_countdown_ {2}
|
|
|
|
, rig_number_ {n}
|
|
|
|
, readable_params_ {0}
|
|
|
|
, writable_params_ {0}
|
|
|
|
, send_update_signal_ {false}
|
|
|
|
, reversed_ {false}
|
|
|
|
, starting_ {false}
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
OmniRigTransceiver::~OmniRigTransceiver ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::do_start ()
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_start";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
wrapped_->start ();
|
|
|
|
|
|
|
|
CoInitializeEx (nullptr, 0 /*COINIT_APARTMENTTHREADED*/); // required because Qt only does this for GUI thread
|
|
|
|
|
|
|
|
omni_rig_.reset (new OmniRig::OmniRigX {this});
|
|
|
|
if (omni_rig_->isNull ())
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_start: failed to start COM server";
|
|
|
|
#endif
|
|
|
|
|
2014-04-16 10:59:00 -04:00
|
|
|
throw error {tr ("Failed to start OmniRig COM server")};
|
Added support for use of "Standard" locations for writable files.
This allows writable files to be located in the "correct"
location for each platform rather than in the directory of
the executable which, in general, is not recommended or
allowed in some cases.
A preprocessor macro WSJT_STANDARD_FILE_LOCATIONS is used to
switch be tween old and new functionality, currently it is on
by default. It can be turned off by defining it to a false
value (0) or more simply with cmake-gui setting the option
with the same name. JTAlert can only work with the old
non-standard file locations until Laurie VK3AMA chooses to
support the new file locations.
Even if the above is not enabled; the QSettings file is
written to a user specific location so it will be shared by
all instances of the program (i.e. across upgrades). See
below for multiple concurrent instance support changes.
Added a command line parser module for Fortran.
Added 'lib/options.f90' to facilitate more complex argument
passing to jt9 to cover explicit file locations.
Changed the way multiple concurrent instances are handled.
This is to allow the program to be run multiple times from
the same installation directory.
A new wsjtx command line optional argument is available "-r"
or "--rig" which enables multiple concurrent instance
support. The parameter of the new option is a unique name
signifying a rig or equivalent. The name is used as the
shared memory segment key and in window titles. The name is
also used to access unique settings files and writable data
files like ALL.TXT and log files. No attempt has been made
to share these files between concurrent instances.
If "-r" or "--rig" is used without a parameter it still
enables multiple concurrent instance support for that
instance. All instances must use a unique parameter, one of
which may be empty.
The rig name is appended the
QCoreApplication::applicationName() for convenient usage like
window titles.
Set non Qt locale to "C".
This ensures that C library functions give consistent results
whatever the system locale is set to. QApplication follows
the system locale as before. Thus using QApplication and its
descendants like widgets and QString for all user visible
formating will give correct l10n and using C/C++ library will
give consistent formatting across locales.
Added top level C++ exception handling to main.cpp.
Because the new transceiver framework uses exceptions
internally, the main function now handles any exceptions that
aren't caught.
Retired devsetup, replaced with Configuration.
Configuration is a class that encapsulates most of the
configuration behavior. Because rig configuration is so
closely coupled with rig operation, Configuration serves as a
proxy for access to the rig control functions. See
Configuration.hpp for more details of the Configuration
interface.
Menu changes.
Various checkable menu actions moved from main menu to the
Configuration dialog. The whole settings menu has been
retired with the single "Settings..." action moved to the
file menu for consistency on Mac where it appears as
"Preferences" in line with Mac guidelines.
New data models for data used by the application.
ADIF amateur band parameters, free text message macros, spot
working frequencies and, station information (station
descriptions and transverter offsets per band) each implement
the QAbstractItemModel interface allowing them to be used
directly with Qt view widgets (Bands.hpp, FrequencyList.hpp
and, StationList.hpp). Configuration manages maintenance of
an instance of all but the former of the above models. The
ADIF band model is owned by Configuration but requires no
user maintenance as it is immutable.
Band combo box gets more functionality.
This widget is now an editable QComboBox with some extra
input capabilities.
The popup list is still the list of spot working frequencies,
now showing the actual frequency decorated with the band
name. This allows multiple spot frequencies on a band if
required.
The line edit allows direct frequency entry in mega-Hertz
with a completer built in to suggest the available spot
working frequencies. It also allows band name entry where
the first available spot working frequency is selected.
Recognized band names are those that are defined by the ADIF
specification and can be found in in the implementation of
the ADIF bands model (Bands.cpp).
If an out of band frequency is chosen, the line edit shows a
warning red background and the text "OOB". Out of band is
only defined by the ADIF band limits which in general are
wider than any entities regulations.
Qt 5.2 now supports default audio i/p and o/p devices.
These devices are placeholders for whatever the user defines
as the default device. Because of this they need special
treatment as the actual device used is chosen at open time
behind the scenes.
Close-down behavior is simplified.
The close-down semantics were broken such that some objects
were not being shut down cleanly, this required amendments to
facilitate correct close down of threads.
User font selection added to Configuration UI.
Buttons to set the application font and the font for the band
and Rx frequency activity widgets have been added to the
Configuration UI to replace the file based font size control.
Free text macros now selected directly.
The free text line edit widgets are now editable combo boxes
that have the current free text macro definitions as their
popup list. The old context menu to do this has been
retired.
Astronomical data window dynamically formatted and has font a chooser.
This window is now autonomous, has its own font chooser and,
dynamically resizes to cover the contents.
Double click to Tx enabled now has its own widget in the status bar.
QDir used for portable path and file name handling throughout.
The "Monitor", "Decode", "Enable Tx" and, "Tune" buttons are now
checkable.
Being checkable allows these buttons control their own state
and rendering.
Calls to PSK Reporter interface simplified.
In mainwindow.cpp the calls to this interface are
rationalized to just 3 locations.
Manipulation of ALL.TXT simplified.
Moved, where possible, to common functions.
Elevated frequency types to be Qt types.
Frequency and FrequencyDelta defined as Qt types in their
meta-type system (Radio.hpp). They are integral types for
maximum accuracy.
Re-factored rig control calls in mainwindow.cpp.
The new Configuration proxy access to rig control required
many changes (mostly simplifications) to the MainWindow rig
control code. Some common code has been gathered in member
functions like qsy(), monitor(), band_changed() and
auto_tx_mode().
Rig control enhancements.
The rig control for clients interface is declared as an
abstract interface (See Transceiver.hpp). Concrete
implementations of this interface are provided for the Hamlib
rig control library, DX Lab Suite Commander via a TCP/IP
command channel, Ham Radio Deluxe also via a TCP/IP command
channel and, OmniRig via its Windows COM server interface.
Concrete Transceiver implementations are expected to be moved
to a separate thread after construction since many operations
are blocking and not suitable for running in a GUI thread.
To facilitate this all instantiation of concrete Transceiver
instances are handled by Configuration using a factory class
(TransceiverFactory) for configuration parameter based
instantiation.
Various common functionality shared by different rig
interface implementations are factored out into helper base
classes that implement or delegate parts of the Transceiver
interface. They are TransceiverBase which caches state to
minimize expensive rig commands, it also maps the Transceiver
interface into a more convenient form for implementation
(template methods). PollingTransceiver that provides a state
polling mechanism that only reports actual changes.
EmulateSplitTransceiver that provides split operation by
QSYing on PTT state changes.
EmulateSplitTransceiver can be used with any implementation
as it follows the GoF Decorator pattern and can wrap any
Transceiver implementation.
OmniRigTransceiver is derived directly from TransceiverBase
since it doesn't require polling due to its asynchronous
nature. OmniRigTransceiver is only built on Windows as it is
a COM server client. To build it you must first install the
OmniRig client on the development machine
(http://www.dxatlas.com/omnirig/).
DXLabSuiteCommanderTransceiver derives from
PollingTransceiver since it is a synchronous communications
channel. No third party library is required for this
interface.
HRDTransceiver also derives from PollingTransceiver. The HRD
interface library has been reverse engineered to provide
functionality with all available versions of HRD. No third
party libraries are required.
HamlibTransceiver likewise derives from PollingTransceiver
since the Hamlib asynchronous interface is non-functional.
Although this class will interface with the release version
of Hamlib (1.2.15.3); for correct operation on most rigs it
needs to run with the latest master branch code of Hamlib.
During development many changes to Hamlib have been submitted
and accepted, hence this requirement. Hamlib source can be
obtained from git://git.code.sf.net/p/hamlib/code and at the
time of writing he master branch was at SHA 6e4432.
The Hamlib interface directly calls the "C" interface and the
modified rigclass.{h,cpp} files have been retired.
There is a rig type selection of "None" which may be used for
non-CAT rigs, this is actually a connection to the dummy
Hamlib device.
PollingTransvceiver derives from TransceiverBase and
TransceiverBase derives from the Transceiver interface.
Each interface implementation offers some possibility of PTT
control via a different serial port than the CAT port. We
also support PTT control directly via a second serial port.
This is done by delegating to a dummy Hamlib instance which
is only used for PTT control. This means that
DXLabSuiteCommanderTransceiver, HRDTransceiver and
OmniRigTransceiver always wrap a dummy HamlibTransceiver
instance. The factory class TransceiverFactory manages all
these constructional complexities.
Serial port selection combo boxes are now editable with a
manually entered value being saved to the settings file.
This allows a non-standard port device to be used without
having to edit the settings file manually.
For TCP/IP network CAT interfaces; the network address and
port may be specified allowing the target device to be
located on a different machine from the one running wsjtx if
required. The default used when the address field is left
blank is the correct one for normal usage on the local host.
Selecting a polling interval of zero is no longer possible,
this is because the rig control capability can no longer
support one way connection. This is in line with most other
CAT control software.
In the Configuration dialog there are options to select split
mode control by the software and mode control by the
software. For the former "None", "Rig" and "Fake it" are
available, for the latter "None", "USB" and, "Data" are
available. Because tone generation is implicitly linked to
split mode operation; it is no longer possible to have the
software in split mode and the rig not or vice versa. This
may mean some rigs cannot be used in split mode and therefore
not in dual JT65+JT9 until issues with CAT control with that
rig are resolved. Single mode with VOX keying and no CAT
control are still possible so even the most basic transceiver
setup is supported as before.
Configuration now supports a frequency offset suitable for
transverter operation. The station details model
(StationList.hpp) includes a column to store an offset for
each band if required.
CMake build script improvements.
The CMakeLists.txt from the 'lib' directory has been retired
with its contents merged into the top level CMakeLists.txt.
Install target support has been greatly improved with the
Release build configuration now building a fully standalone
installation on Mac and Windows. The Debug configuration
still builds an installation that has environment
dependencies for external libraries, which is desirable for
testing and debugging.
Package target support is largely complete for Mac, Windows
and, Linux, it should be possible to build release installers
directly from CMake/CPack.
Cmake FindXXXX.cmake modules have been added to improve the
location of fftw-3 and Hamlib packages.
Version numbers are now stored in Versions.cmake and work in
concert with automatic svn revision lookup during build. The
version string becomes 'rlocal'± if there are any uncommitted
changes in the build source tree.
Moved resource like files to Qt resources.
Because location of resource files (when they cannot go into
the installation directory because of packaging rules) is
hard to standardize. I have used the Qt resource system for
all ancillary data files. Some like kvasd.dat are dumped out
to the temp (working directory) because they are accessed by
an external program, others like the audio samples are copied
out so they appear in the data directory under the default
save directory.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3929 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-03-26 09:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// COM/OLE exceptions get signalled
|
|
|
|
connect (&*omni_rig_, SIGNAL (exception (int, QString, QString, QString)), this, SLOT (handle_COM_exception (int, QString, QString, QString)));
|
|
|
|
|
|
|
|
// IOmniRigXEvent interface signals
|
|
|
|
connect (&*omni_rig_, SIGNAL (VisibleChange ()), this, SLOT (handle_visible_change ()));
|
|
|
|
connect (&*omni_rig_, SIGNAL (RigTypeChange (int)), this, SLOT (handle_rig_type_change (int)));
|
|
|
|
connect (&*omni_rig_, SIGNAL (StatusChange (int)), this, SLOT (handle_status_change (int)));
|
|
|
|
connect (&*omni_rig_, SIGNAL (ParamsChange (int, int)), this, SLOT (handle_params_change (int, int)));
|
|
|
|
connect (&*omni_rig_
|
|
|
|
, SIGNAL (CustomReply (int, QVariant const&, QVariant const&))
|
|
|
|
, this, SLOT (handle_custom_reply (int, QVariant const&, QVariant const&)));
|
|
|
|
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug ()
|
|
|
|
<< "OmniRig s/w version:" << QString::number (omni_rig_->SoftwareVersion ()).toLocal8Bit ()
|
|
|
|
<< "i/f version:" << QString::number (omni_rig_->InterfaceVersion ()).toLocal8Bit ()
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// fetch the interface of the RigX CoClass and instantiate a proxy object
|
|
|
|
switch (rig_number_)
|
|
|
|
{
|
|
|
|
case One: rig_.reset (new OmniRig::RigX (omni_rig_->Rig1 ())); break;
|
|
|
|
case Two: rig_.reset (new OmniRig::RigX (omni_rig_->Rig2 ())); break;
|
|
|
|
}
|
|
|
|
|
|
|
|
Q_ASSERT (rig_);
|
|
|
|
Q_ASSERT (!rig_->isNull ());
|
|
|
|
|
|
|
|
if (use_for_ptt_ && (TransceiverFactory::PTT_method_DTR == ptt_type_ || TransceiverFactory::PTT_method_RTS == ptt_type_))
|
|
|
|
{
|
|
|
|
// fetch the interface for the serial port if we need it for PTT
|
|
|
|
port_.reset (new OmniRig::PortBits (rig_->PortBits ()));
|
|
|
|
|
|
|
|
Q_ASSERT (port_);
|
|
|
|
Q_ASSERT (!port_->isNull ());
|
|
|
|
|
|
|
|
// if (!port_->Lock ()) // try to take exclusive use of the OmniRig serial port for PTT
|
|
|
|
// {
|
2014-04-16 10:59:00 -04:00
|
|
|
// throw error {tr ("Failed to get exclusive use of %1" from OmniRig").arg (ptt_type)};
|
Added support for use of "Standard" locations for writable files.
This allows writable files to be located in the "correct"
location for each platform rather than in the directory of
the executable which, in general, is not recommended or
allowed in some cases.
A preprocessor macro WSJT_STANDARD_FILE_LOCATIONS is used to
switch be tween old and new functionality, currently it is on
by default. It can be turned off by defining it to a false
value (0) or more simply with cmake-gui setting the option
with the same name. JTAlert can only work with the old
non-standard file locations until Laurie VK3AMA chooses to
support the new file locations.
Even if the above is not enabled; the QSettings file is
written to a user specific location so it will be shared by
all instances of the program (i.e. across upgrades). See
below for multiple concurrent instance support changes.
Added a command line parser module for Fortran.
Added 'lib/options.f90' to facilitate more complex argument
passing to jt9 to cover explicit file locations.
Changed the way multiple concurrent instances are handled.
This is to allow the program to be run multiple times from
the same installation directory.
A new wsjtx command line optional argument is available "-r"
or "--rig" which enables multiple concurrent instance
support. The parameter of the new option is a unique name
signifying a rig or equivalent. The name is used as the
shared memory segment key and in window titles. The name is
also used to access unique settings files and writable data
files like ALL.TXT and log files. No attempt has been made
to share these files between concurrent instances.
If "-r" or "--rig" is used without a parameter it still
enables multiple concurrent instance support for that
instance. All instances must use a unique parameter, one of
which may be empty.
The rig name is appended the
QCoreApplication::applicationName() for convenient usage like
window titles.
Set non Qt locale to "C".
This ensures that C library functions give consistent results
whatever the system locale is set to. QApplication follows
the system locale as before. Thus using QApplication and its
descendants like widgets and QString for all user visible
formating will give correct l10n and using C/C++ library will
give consistent formatting across locales.
Added top level C++ exception handling to main.cpp.
Because the new transceiver framework uses exceptions
internally, the main function now handles any exceptions that
aren't caught.
Retired devsetup, replaced with Configuration.
Configuration is a class that encapsulates most of the
configuration behavior. Because rig configuration is so
closely coupled with rig operation, Configuration serves as a
proxy for access to the rig control functions. See
Configuration.hpp for more details of the Configuration
interface.
Menu changes.
Various checkable menu actions moved from main menu to the
Configuration dialog. The whole settings menu has been
retired with the single "Settings..." action moved to the
file menu for consistency on Mac where it appears as
"Preferences" in line with Mac guidelines.
New data models for data used by the application.
ADIF amateur band parameters, free text message macros, spot
working frequencies and, station information (station
descriptions and transverter offsets per band) each implement
the QAbstractItemModel interface allowing them to be used
directly with Qt view widgets (Bands.hpp, FrequencyList.hpp
and, StationList.hpp). Configuration manages maintenance of
an instance of all but the former of the above models. The
ADIF band model is owned by Configuration but requires no
user maintenance as it is immutable.
Band combo box gets more functionality.
This widget is now an editable QComboBox with some extra
input capabilities.
The popup list is still the list of spot working frequencies,
now showing the actual frequency decorated with the band
name. This allows multiple spot frequencies on a band if
required.
The line edit allows direct frequency entry in mega-Hertz
with a completer built in to suggest the available spot
working frequencies. It also allows band name entry where
the first available spot working frequency is selected.
Recognized band names are those that are defined by the ADIF
specification and can be found in in the implementation of
the ADIF bands model (Bands.cpp).
If an out of band frequency is chosen, the line edit shows a
warning red background and the text "OOB". Out of band is
only defined by the ADIF band limits which in general are
wider than any entities regulations.
Qt 5.2 now supports default audio i/p and o/p devices.
These devices are placeholders for whatever the user defines
as the default device. Because of this they need special
treatment as the actual device used is chosen at open time
behind the scenes.
Close-down behavior is simplified.
The close-down semantics were broken such that some objects
were not being shut down cleanly, this required amendments to
facilitate correct close down of threads.
User font selection added to Configuration UI.
Buttons to set the application font and the font for the band
and Rx frequency activity widgets have been added to the
Configuration UI to replace the file based font size control.
Free text macros now selected directly.
The free text line edit widgets are now editable combo boxes
that have the current free text macro definitions as their
popup list. The old context menu to do this has been
retired.
Astronomical data window dynamically formatted and has font a chooser.
This window is now autonomous, has its own font chooser and,
dynamically resizes to cover the contents.
Double click to Tx enabled now has its own widget in the status bar.
QDir used for portable path and file name handling throughout.
The "Monitor", "Decode", "Enable Tx" and, "Tune" buttons are now
checkable.
Being checkable allows these buttons control their own state
and rendering.
Calls to PSK Reporter interface simplified.
In mainwindow.cpp the calls to this interface are
rationalized to just 3 locations.
Manipulation of ALL.TXT simplified.
Moved, where possible, to common functions.
Elevated frequency types to be Qt types.
Frequency and FrequencyDelta defined as Qt types in their
meta-type system (Radio.hpp). They are integral types for
maximum accuracy.
Re-factored rig control calls in mainwindow.cpp.
The new Configuration proxy access to rig control required
many changes (mostly simplifications) to the MainWindow rig
control code. Some common code has been gathered in member
functions like qsy(), monitor(), band_changed() and
auto_tx_mode().
Rig control enhancements.
The rig control for clients interface is declared as an
abstract interface (See Transceiver.hpp). Concrete
implementations of this interface are provided for the Hamlib
rig control library, DX Lab Suite Commander via a TCP/IP
command channel, Ham Radio Deluxe also via a TCP/IP command
channel and, OmniRig via its Windows COM server interface.
Concrete Transceiver implementations are expected to be moved
to a separate thread after construction since many operations
are blocking and not suitable for running in a GUI thread.
To facilitate this all instantiation of concrete Transceiver
instances are handled by Configuration using a factory class
(TransceiverFactory) for configuration parameter based
instantiation.
Various common functionality shared by different rig
interface implementations are factored out into helper base
classes that implement or delegate parts of the Transceiver
interface. They are TransceiverBase which caches state to
minimize expensive rig commands, it also maps the Transceiver
interface into a more convenient form for implementation
(template methods). PollingTransceiver that provides a state
polling mechanism that only reports actual changes.
EmulateSplitTransceiver that provides split operation by
QSYing on PTT state changes.
EmulateSplitTransceiver can be used with any implementation
as it follows the GoF Decorator pattern and can wrap any
Transceiver implementation.
OmniRigTransceiver is derived directly from TransceiverBase
since it doesn't require polling due to its asynchronous
nature. OmniRigTransceiver is only built on Windows as it is
a COM server client. To build it you must first install the
OmniRig client on the development machine
(http://www.dxatlas.com/omnirig/).
DXLabSuiteCommanderTransceiver derives from
PollingTransceiver since it is a synchronous communications
channel. No third party library is required for this
interface.
HRDTransceiver also derives from PollingTransceiver. The HRD
interface library has been reverse engineered to provide
functionality with all available versions of HRD. No third
party libraries are required.
HamlibTransceiver likewise derives from PollingTransceiver
since the Hamlib asynchronous interface is non-functional.
Although this class will interface with the release version
of Hamlib (1.2.15.3); for correct operation on most rigs it
needs to run with the latest master branch code of Hamlib.
During development many changes to Hamlib have been submitted
and accepted, hence this requirement. Hamlib source can be
obtained from git://git.code.sf.net/p/hamlib/code and at the
time of writing he master branch was at SHA 6e4432.
The Hamlib interface directly calls the "C" interface and the
modified rigclass.{h,cpp} files have been retired.
There is a rig type selection of "None" which may be used for
non-CAT rigs, this is actually a connection to the dummy
Hamlib device.
PollingTransvceiver derives from TransceiverBase and
TransceiverBase derives from the Transceiver interface.
Each interface implementation offers some possibility of PTT
control via a different serial port than the CAT port. We
also support PTT control directly via a second serial port.
This is done by delegating to a dummy Hamlib instance which
is only used for PTT control. This means that
DXLabSuiteCommanderTransceiver, HRDTransceiver and
OmniRigTransceiver always wrap a dummy HamlibTransceiver
instance. The factory class TransceiverFactory manages all
these constructional complexities.
Serial port selection combo boxes are now editable with a
manually entered value being saved to the settings file.
This allows a non-standard port device to be used without
having to edit the settings file manually.
For TCP/IP network CAT interfaces; the network address and
port may be specified allowing the target device to be
located on a different machine from the one running wsjtx if
required. The default used when the address field is left
blank is the correct one for normal usage on the local host.
Selecting a polling interval of zero is no longer possible,
this is because the rig control capability can no longer
support one way connection. This is in line with most other
CAT control software.
In the Configuration dialog there are options to select split
mode control by the software and mode control by the
software. For the former "None", "Rig" and "Fake it" are
available, for the latter "None", "USB" and, "Data" are
available. Because tone generation is implicitly linked to
split mode operation; it is no longer possible to have the
software in split mode and the rig not or vice versa. This
may mean some rigs cannot be used in split mode and therefore
not in dual JT65+JT9 until issues with CAT control with that
rig are resolved. Single mode with VOX keying and no CAT
control are still possible so even the most basic transceiver
setup is supported as before.
Configuration now supports a frequency offset suitable for
transverter operation. The station details model
(StationList.hpp) includes a column to store an offset for
each band if required.
CMake build script improvements.
The CMakeLists.txt from the 'lib' directory has been retired
with its contents merged into the top level CMakeLists.txt.
Install target support has been greatly improved with the
Release build configuration now building a fully standalone
installation on Mac and Windows. The Debug configuration
still builds an installation that has environment
dependencies for external libraries, which is desirable for
testing and debugging.
Package target support is largely complete for Mac, Windows
and, Linux, it should be possible to build release installers
directly from CMake/CPack.
Cmake FindXXXX.cmake modules have been added to improve the
location of fftw-3 and Hamlib packages.
Version numbers are now stored in Versions.cmake and work in
concert with automatic svn revision lookup during build. The
version string becomes 'rlocal'± if there are any uncommitted
changes in the build source tree.
Moved resource like files to Qt resources.
Because location of resource files (when they cannot go into
the installation directory because of packaging rules) is
hard to standardize. I have used the Qt resource system for
all ancillary data files. Some like kvasd.dat are dumped out
to the temp (working directory) because they are accessed by
an external program, others like the audio samples are copied
out so they appear in the data directory under the default
save directory.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3929 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-03-26 09:21:00 -04:00
|
|
|
// }
|
|
|
|
|
|
|
|
// start off so we don't accidentally key the radio
|
|
|
|
if (TransceiverFactory::PTT_method_DTR == ptt_type_)
|
|
|
|
{
|
|
|
|
port_->SetDtr (false);
|
|
|
|
}
|
|
|
|
else // RTS
|
|
|
|
{
|
|
|
|
port_->SetRts (false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
readable_params_ = rig_->ReadableParams ();
|
|
|
|
writable_params_ = rig_->WriteableParams ();
|
|
|
|
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug ()
|
|
|
|
<< QString ("OmniRig initial rig type: %1 readable params = 0x%2 writable params = 0x%3 for rig %4")
|
|
|
|
.arg (rig_->RigType ())
|
|
|
|
.arg (readable_params_, 8, 16, QChar ('0'))
|
|
|
|
.arg (writable_params_, 8, 16, QChar ('0'))
|
|
|
|
.arg (rig_number_).toLocal8Bit ()
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
starting_ = true;
|
|
|
|
QTimer::singleShot (5000, this, SLOT (startup_check ()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::do_stop ()
|
|
|
|
{
|
|
|
|
if (port_)
|
|
|
|
{
|
|
|
|
// port_->Unlock (); // release serial port
|
|
|
|
port_->clear ();
|
|
|
|
}
|
|
|
|
|
|
|
|
rig_->clear ();
|
|
|
|
|
|
|
|
omni_rig_->clear ();
|
|
|
|
|
|
|
|
CoUninitialize ();
|
|
|
|
|
|
|
|
wrapped_->stop ();
|
|
|
|
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_stop";
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::startup_check ()
|
|
|
|
{
|
|
|
|
if (starting_)
|
|
|
|
{
|
|
|
|
if (--startup_poll_countdown_)
|
|
|
|
{
|
|
|
|
init_rig ();
|
|
|
|
QTimer::singleShot (5000, this, SLOT (startup_check ()));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
startup_poll_countdown_ = 2;
|
|
|
|
|
|
|
|
// signal that we haven't seen anything from OmniRig
|
|
|
|
offline ("OmniRig initialisation timeout");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::init_rig ()
|
|
|
|
{
|
|
|
|
if (writable_params_ & OmniRig::PM_VFOA)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::init_rig: set VFO A";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rig_->SetVfo (OmniRig::PM_VFOA);
|
|
|
|
if (writable_params_ & OmniRig::PM_SPLITOFF)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::init_rig: set SPLIT off";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rig_->SetSplit (OmniRig::PM_SPLITOFF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (writable_params_ & OmniRig::PM_VFOAA)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::init_rig: set VFO A and SPLIT off";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rig_->SetVfo (OmniRig::PM_VFOAA);
|
|
|
|
}
|
|
|
|
|
|
|
|
reversed_ = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::do_sync (bool force_signal)
|
|
|
|
{
|
|
|
|
// nothing much we can do here, we just have to let OmniRig do its
|
|
|
|
// stuff and its first poll should send us and update that will
|
|
|
|
// trigger a update signal from us. Any attempt to query OmniRig
|
|
|
|
// leads to a whole mess of trouble since its internal state is
|
|
|
|
// garbage until it has done its first rig poll.
|
|
|
|
send_update_signal_ = force_signal;
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::handle_COM_exception (int code, QString source, QString desc, QString help)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::handle_COM_exception:" << QString::number (code) + " at " + source + ": " + desc + " (" + help + ')';
|
|
|
|
#endif
|
|
|
|
|
2014-04-16 11:02:35 -04:00
|
|
|
throw error {tr ("OmniRig COM/OLE error: %1 at %2: %3 (%4)").arg (QString::number (code)).arg (source). arg (desc). arg (help)};
|
Added support for use of "Standard" locations for writable files.
This allows writable files to be located in the "correct"
location for each platform rather than in the directory of
the executable which, in general, is not recommended or
allowed in some cases.
A preprocessor macro WSJT_STANDARD_FILE_LOCATIONS is used to
switch be tween old and new functionality, currently it is on
by default. It can be turned off by defining it to a false
value (0) or more simply with cmake-gui setting the option
with the same name. JTAlert can only work with the old
non-standard file locations until Laurie VK3AMA chooses to
support the new file locations.
Even if the above is not enabled; the QSettings file is
written to a user specific location so it will be shared by
all instances of the program (i.e. across upgrades). See
below for multiple concurrent instance support changes.
Added a command line parser module for Fortran.
Added 'lib/options.f90' to facilitate more complex argument
passing to jt9 to cover explicit file locations.
Changed the way multiple concurrent instances are handled.
This is to allow the program to be run multiple times from
the same installation directory.
A new wsjtx command line optional argument is available "-r"
or "--rig" which enables multiple concurrent instance
support. The parameter of the new option is a unique name
signifying a rig or equivalent. The name is used as the
shared memory segment key and in window titles. The name is
also used to access unique settings files and writable data
files like ALL.TXT and log files. No attempt has been made
to share these files between concurrent instances.
If "-r" or "--rig" is used without a parameter it still
enables multiple concurrent instance support for that
instance. All instances must use a unique parameter, one of
which may be empty.
The rig name is appended the
QCoreApplication::applicationName() for convenient usage like
window titles.
Set non Qt locale to "C".
This ensures that C library functions give consistent results
whatever the system locale is set to. QApplication follows
the system locale as before. Thus using QApplication and its
descendants like widgets and QString for all user visible
formating will give correct l10n and using C/C++ library will
give consistent formatting across locales.
Added top level C++ exception handling to main.cpp.
Because the new transceiver framework uses exceptions
internally, the main function now handles any exceptions that
aren't caught.
Retired devsetup, replaced with Configuration.
Configuration is a class that encapsulates most of the
configuration behavior. Because rig configuration is so
closely coupled with rig operation, Configuration serves as a
proxy for access to the rig control functions. See
Configuration.hpp for more details of the Configuration
interface.
Menu changes.
Various checkable menu actions moved from main menu to the
Configuration dialog. The whole settings menu has been
retired with the single "Settings..." action moved to the
file menu for consistency on Mac where it appears as
"Preferences" in line with Mac guidelines.
New data models for data used by the application.
ADIF amateur band parameters, free text message macros, spot
working frequencies and, station information (station
descriptions and transverter offsets per band) each implement
the QAbstractItemModel interface allowing them to be used
directly with Qt view widgets (Bands.hpp, FrequencyList.hpp
and, StationList.hpp). Configuration manages maintenance of
an instance of all but the former of the above models. The
ADIF band model is owned by Configuration but requires no
user maintenance as it is immutable.
Band combo box gets more functionality.
This widget is now an editable QComboBox with some extra
input capabilities.
The popup list is still the list of spot working frequencies,
now showing the actual frequency decorated with the band
name. This allows multiple spot frequencies on a band if
required.
The line edit allows direct frequency entry in mega-Hertz
with a completer built in to suggest the available spot
working frequencies. It also allows band name entry where
the first available spot working frequency is selected.
Recognized band names are those that are defined by the ADIF
specification and can be found in in the implementation of
the ADIF bands model (Bands.cpp).
If an out of band frequency is chosen, the line edit shows a
warning red background and the text "OOB". Out of band is
only defined by the ADIF band limits which in general are
wider than any entities regulations.
Qt 5.2 now supports default audio i/p and o/p devices.
These devices are placeholders for whatever the user defines
as the default device. Because of this they need special
treatment as the actual device used is chosen at open time
behind the scenes.
Close-down behavior is simplified.
The close-down semantics were broken such that some objects
were not being shut down cleanly, this required amendments to
facilitate correct close down of threads.
User font selection added to Configuration UI.
Buttons to set the application font and the font for the band
and Rx frequency activity widgets have been added to the
Configuration UI to replace the file based font size control.
Free text macros now selected directly.
The free text line edit widgets are now editable combo boxes
that have the current free text macro definitions as their
popup list. The old context menu to do this has been
retired.
Astronomical data window dynamically formatted and has font a chooser.
This window is now autonomous, has its own font chooser and,
dynamically resizes to cover the contents.
Double click to Tx enabled now has its own widget in the status bar.
QDir used for portable path and file name handling throughout.
The "Monitor", "Decode", "Enable Tx" and, "Tune" buttons are now
checkable.
Being checkable allows these buttons control their own state
and rendering.
Calls to PSK Reporter interface simplified.
In mainwindow.cpp the calls to this interface are
rationalized to just 3 locations.
Manipulation of ALL.TXT simplified.
Moved, where possible, to common functions.
Elevated frequency types to be Qt types.
Frequency and FrequencyDelta defined as Qt types in their
meta-type system (Radio.hpp). They are integral types for
maximum accuracy.
Re-factored rig control calls in mainwindow.cpp.
The new Configuration proxy access to rig control required
many changes (mostly simplifications) to the MainWindow rig
control code. Some common code has been gathered in member
functions like qsy(), monitor(), band_changed() and
auto_tx_mode().
Rig control enhancements.
The rig control for clients interface is declared as an
abstract interface (See Transceiver.hpp). Concrete
implementations of this interface are provided for the Hamlib
rig control library, DX Lab Suite Commander via a TCP/IP
command channel, Ham Radio Deluxe also via a TCP/IP command
channel and, OmniRig via its Windows COM server interface.
Concrete Transceiver implementations are expected to be moved
to a separate thread after construction since many operations
are blocking and not suitable for running in a GUI thread.
To facilitate this all instantiation of concrete Transceiver
instances are handled by Configuration using a factory class
(TransceiverFactory) for configuration parameter based
instantiation.
Various common functionality shared by different rig
interface implementations are factored out into helper base
classes that implement or delegate parts of the Transceiver
interface. They are TransceiverBase which caches state to
minimize expensive rig commands, it also maps the Transceiver
interface into a more convenient form for implementation
(template methods). PollingTransceiver that provides a state
polling mechanism that only reports actual changes.
EmulateSplitTransceiver that provides split operation by
QSYing on PTT state changes.
EmulateSplitTransceiver can be used with any implementation
as it follows the GoF Decorator pattern and can wrap any
Transceiver implementation.
OmniRigTransceiver is derived directly from TransceiverBase
since it doesn't require polling due to its asynchronous
nature. OmniRigTransceiver is only built on Windows as it is
a COM server client. To build it you must first install the
OmniRig client on the development machine
(http://www.dxatlas.com/omnirig/).
DXLabSuiteCommanderTransceiver derives from
PollingTransceiver since it is a synchronous communications
channel. No third party library is required for this
interface.
HRDTransceiver also derives from PollingTransceiver. The HRD
interface library has been reverse engineered to provide
functionality with all available versions of HRD. No third
party libraries are required.
HamlibTransceiver likewise derives from PollingTransceiver
since the Hamlib asynchronous interface is non-functional.
Although this class will interface with the release version
of Hamlib (1.2.15.3); for correct operation on most rigs it
needs to run with the latest master branch code of Hamlib.
During development many changes to Hamlib have been submitted
and accepted, hence this requirement. Hamlib source can be
obtained from git://git.code.sf.net/p/hamlib/code and at the
time of writing he master branch was at SHA 6e4432.
The Hamlib interface directly calls the "C" interface and the
modified rigclass.{h,cpp} files have been retired.
There is a rig type selection of "None" which may be used for
non-CAT rigs, this is actually a connection to the dummy
Hamlib device.
PollingTransvceiver derives from TransceiverBase and
TransceiverBase derives from the Transceiver interface.
Each interface implementation offers some possibility of PTT
control via a different serial port than the CAT port. We
also support PTT control directly via a second serial port.
This is done by delegating to a dummy Hamlib instance which
is only used for PTT control. This means that
DXLabSuiteCommanderTransceiver, HRDTransceiver and
OmniRigTransceiver always wrap a dummy HamlibTransceiver
instance. The factory class TransceiverFactory manages all
these constructional complexities.
Serial port selection combo boxes are now editable with a
manually entered value being saved to the settings file.
This allows a non-standard port device to be used without
having to edit the settings file manually.
For TCP/IP network CAT interfaces; the network address and
port may be specified allowing the target device to be
located on a different machine from the one running wsjtx if
required. The default used when the address field is left
blank is the correct one for normal usage on the local host.
Selecting a polling interval of zero is no longer possible,
this is because the rig control capability can no longer
support one way connection. This is in line with most other
CAT control software.
In the Configuration dialog there are options to select split
mode control by the software and mode control by the
software. For the former "None", "Rig" and "Fake it" are
available, for the latter "None", "USB" and, "Data" are
available. Because tone generation is implicitly linked to
split mode operation; it is no longer possible to have the
software in split mode and the rig not or vice versa. This
may mean some rigs cannot be used in split mode and therefore
not in dual JT65+JT9 until issues with CAT control with that
rig are resolved. Single mode with VOX keying and no CAT
control are still possible so even the most basic transceiver
setup is supported as before.
Configuration now supports a frequency offset suitable for
transverter operation. The station details model
(StationList.hpp) includes a column to store an offset for
each band if required.
CMake build script improvements.
The CMakeLists.txt from the 'lib' directory has been retired
with its contents merged into the top level CMakeLists.txt.
Install target support has been greatly improved with the
Release build configuration now building a fully standalone
installation on Mac and Windows. The Debug configuration
still builds an installation that has environment
dependencies for external libraries, which is desirable for
testing and debugging.
Package target support is largely complete for Mac, Windows
and, Linux, it should be possible to build release installers
directly from CMake/CPack.
Cmake FindXXXX.cmake modules have been added to improve the
location of fftw-3 and Hamlib packages.
Version numbers are now stored in Versions.cmake and work in
concert with automatic svn revision lookup during build. The
version string becomes 'rlocal'± if there are any uncommitted
changes in the build source tree.
Moved resource like files to Qt resources.
Because location of resource files (when they cannot go into
the installation directory because of packaging rules) is
hard to standardize. I have used the Qt resource system for
all ancillary data files. Some like kvasd.dat are dumped out
to the temp (working directory) because they are accessed by
an external program, others like the audio samples are copied
out so they appear in the data directory under the default
save directory.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3929 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-03-26 09:21:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::handle_visible_change ()
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRig visibility change: visibility =" << omni_rig_->DialogVisible ();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::handle_rig_type_change (int rig_number)
|
|
|
|
{
|
|
|
|
if (rig_number_ == rig_number)
|
|
|
|
{
|
|
|
|
readable_params_ = rig_->ReadableParams ();
|
|
|
|
writable_params_ = rig_->WriteableParams ();
|
|
|
|
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug ()
|
|
|
|
<< QString ("OmniRig rig type change to: %1 readable params = 0x%2 writable params = 0x%3 for rig %4")
|
|
|
|
.arg (rig_->RigType ())
|
|
|
|
.arg (readable_params_, 8, 16, QChar ('0'))
|
|
|
|
.arg (writable_params_, 8, 16, QChar ('0'))
|
|
|
|
.arg (rig_number).toLocal8Bit ()
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
offline ("OmniRig rig changed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::handle_status_change (int rig_number)
|
|
|
|
{
|
|
|
|
if (rig_number_ == rig_number)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug ()
|
|
|
|
<< QString ("OmniRig status change: new status for rig %1 =").arg (rig_number).toLocal8Bit () << rig_->StatusStr ().toLocal8Bit ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (OmniRig::ST_ONLINE != rig_->Status ())
|
|
|
|
{
|
|
|
|
offline ("OmniRig rig went offline");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
starting_ = false;
|
|
|
|
|
|
|
|
TransceiverState old_state {state ()};
|
|
|
|
init_rig ();
|
|
|
|
|
|
|
|
if (old_state != state () || send_update_signal_)
|
|
|
|
{
|
|
|
|
update_complete ();
|
|
|
|
send_update_signal_ = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::handle_params_change (int rig_number, int params)
|
|
|
|
{
|
|
|
|
if (rig_number_ == rig_number)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug ()
|
|
|
|
<< QString ("OmniRig params change: params = 0x%1 for rig %2")
|
|
|
|
.arg (params, 8, 16, QChar ('0'))
|
|
|
|
.arg (rig_number).toLocal8Bit ()
|
|
|
|
<< "state before:" << state ()
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
starting_ = false;
|
|
|
|
|
|
|
|
TransceiverState old_state {state ()};
|
|
|
|
auto need_frequency = false;
|
|
|
|
|
|
|
|
// state_.online = true; // sometimes we don't get an initial
|
|
|
|
// // OmniRig::ST_ONLINE status change
|
|
|
|
// // event
|
|
|
|
|
|
|
|
if (params & OmniRig::PM_VFOAA)
|
|
|
|
{
|
|
|
|
update_split (false);
|
|
|
|
reversed_ = false;
|
|
|
|
update_rx_frequency (rig_->FreqA ());
|
|
|
|
update_other_frequency (rig_->FreqB ());
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_VFOAB)
|
|
|
|
{
|
|
|
|
update_split (true);
|
|
|
|
reversed_ = false;
|
|
|
|
update_rx_frequency (rig_->FreqA ());
|
|
|
|
update_other_frequency (rig_->FreqB ());
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_VFOBA)
|
|
|
|
{
|
|
|
|
update_split (true);
|
|
|
|
reversed_ = true;
|
|
|
|
update_other_frequency (rig_->FreqA ());
|
|
|
|
update_rx_frequency (rig_->FreqB ());
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_VFOBB)
|
|
|
|
{
|
|
|
|
update_split (false);
|
|
|
|
reversed_ = true;
|
|
|
|
update_other_frequency (rig_->FreqA ());
|
|
|
|
update_rx_frequency (rig_->FreqB ());
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_VFOA)
|
|
|
|
{
|
|
|
|
reversed_ = false;
|
|
|
|
need_frequency = true;
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_VFOB)
|
|
|
|
{
|
|
|
|
reversed_ = true;
|
|
|
|
need_frequency = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (params & OmniRig::PM_FREQ)
|
|
|
|
{
|
|
|
|
need_frequency = true;
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_FREQA)
|
|
|
|
{
|
|
|
|
if (reversed_)
|
|
|
|
{
|
|
|
|
update_other_frequency (rig_->FreqA ());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
update_rx_frequency (rig_->FreqA ());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_FREQB)
|
|
|
|
{
|
|
|
|
if (reversed_)
|
|
|
|
{
|
|
|
|
update_rx_frequency (rig_->FreqB ());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
update_other_frequency (rig_->FreqB ());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (need_frequency)
|
|
|
|
{
|
|
|
|
if (readable_params_ & OmniRig::PM_FREQA)
|
|
|
|
{
|
|
|
|
if (reversed_)
|
|
|
|
{
|
|
|
|
update_other_frequency (rig_->FreqA ());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
update_rx_frequency (rig_->FreqA ());
|
|
|
|
}
|
|
|
|
need_frequency = false;
|
|
|
|
}
|
|
|
|
if (readable_params_ & OmniRig::PM_FREQB)
|
|
|
|
{
|
|
|
|
if (reversed_)
|
|
|
|
{
|
|
|
|
update_rx_frequency (rig_->FreqB ());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
update_other_frequency (rig_->FreqB ());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (need_frequency && (readable_params_ & OmniRig::PM_FREQ))
|
|
|
|
{
|
|
|
|
update_rx_frequency (rig_->Freq ());
|
|
|
|
}
|
|
|
|
|
|
|
|
if (params & OmniRig::PM_PITCH)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_RITOFFSET)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_RIT0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_VFOEQUAL)
|
|
|
|
{
|
|
|
|
auto f = readable_params_ & OmniRig::PM_FREQA ? rig_->FreqA () : rig_->Freq ();
|
|
|
|
update_rx_frequency (f);
|
|
|
|
update_other_frequency (f);
|
|
|
|
update_mode (map_mode (rig_->Mode ()));
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_VFOSWAP)
|
|
|
|
{
|
|
|
|
auto temp = state ().tx_frequency ();
|
|
|
|
update_other_frequency (state ().frequency ());
|
|
|
|
update_rx_frequency (temp);
|
|
|
|
update_mode (map_mode (rig_->Mode ()));
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_SPLITON)
|
|
|
|
{
|
|
|
|
update_split (true);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_SPLITOFF)
|
|
|
|
{
|
|
|
|
update_split (false);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_RITON)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_RITOFF)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_XITON)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_XITOFF)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_RX)
|
|
|
|
{
|
|
|
|
update_PTT (false);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_TX)
|
|
|
|
{
|
|
|
|
update_PTT ();
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_CW_U)
|
|
|
|
{
|
|
|
|
update_mode (CW_R);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_CW_L)
|
|
|
|
{
|
|
|
|
update_mode (CW);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_SSB_U)
|
|
|
|
{
|
|
|
|
update_mode (USB);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_SSB_L)
|
|
|
|
{
|
|
|
|
update_mode (LSB);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_DIG_U)
|
|
|
|
{
|
|
|
|
update_mode (DIG_U);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_DIG_L)
|
|
|
|
{
|
|
|
|
update_mode (DIG_L);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_AM)
|
|
|
|
{
|
|
|
|
update_mode (AM);
|
|
|
|
}
|
|
|
|
if (params & OmniRig::PM_FM)
|
|
|
|
{
|
|
|
|
update_mode (FM);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (old_state != state () || send_update_signal_)
|
|
|
|
{
|
|
|
|
update_complete ();
|
|
|
|
send_update_signal_ = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug ()
|
|
|
|
<< "OmniRig params change: state after:" << state ()
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::handle_custom_reply (int rig_number, QVariant const& command, QVariant const& reply)
|
|
|
|
{
|
|
|
|
(void)command;
|
|
|
|
(void)reply;
|
|
|
|
|
|
|
|
if (rig_number_ == rig_number)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug ()
|
|
|
|
<< "OmniRig custom command" << command.toString ().toLocal8Bit ()
|
|
|
|
<< "with reply" << reply.toString ().toLocal8Bit ()
|
|
|
|
<< QString ("for rig %1").arg (rig_number).toLocal8Bit ()
|
|
|
|
;
|
|
|
|
|
|
|
|
qDebug () << "OmniRig rig number:" << rig_number_ << ':' << state ();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::do_ptt (bool on)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_ptt:" << on << state ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (use_for_ptt_ && TransceiverFactory::PTT_method_CAT == ptt_type_)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_ptt: set PTT";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rig_->SetTx (on ? OmniRig::PM_TX : OmniRig::PM_RX);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (port_)
|
|
|
|
{
|
|
|
|
if (TransceiverFactory::PTT_method_RTS == ptt_type_)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_ptt: set RTS";
|
|
|
|
#endif
|
|
|
|
port_->SetRts (on);
|
|
|
|
}
|
|
|
|
else // "DTR"
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_ptt: set DTR";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
port_->SetDtr (on);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_ptt: set PTT using basic transceiver";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
wrapped_->ptt (on);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (state ().ptt () != on)
|
|
|
|
{
|
|
|
|
update_PTT (on);
|
2014-09-24 13:25:55 -04:00
|
|
|
|
|
|
|
// no need for this as currently update_PTT() does it for us
|
|
|
|
// update_complete ();
|
Added support for use of "Standard" locations for writable files.
This allows writable files to be located in the "correct"
location for each platform rather than in the directory of
the executable which, in general, is not recommended or
allowed in some cases.
A preprocessor macro WSJT_STANDARD_FILE_LOCATIONS is used to
switch be tween old and new functionality, currently it is on
by default. It can be turned off by defining it to a false
value (0) or more simply with cmake-gui setting the option
with the same name. JTAlert can only work with the old
non-standard file locations until Laurie VK3AMA chooses to
support the new file locations.
Even if the above is not enabled; the QSettings file is
written to a user specific location so it will be shared by
all instances of the program (i.e. across upgrades). See
below for multiple concurrent instance support changes.
Added a command line parser module for Fortran.
Added 'lib/options.f90' to facilitate more complex argument
passing to jt9 to cover explicit file locations.
Changed the way multiple concurrent instances are handled.
This is to allow the program to be run multiple times from
the same installation directory.
A new wsjtx command line optional argument is available "-r"
or "--rig" which enables multiple concurrent instance
support. The parameter of the new option is a unique name
signifying a rig or equivalent. The name is used as the
shared memory segment key and in window titles. The name is
also used to access unique settings files and writable data
files like ALL.TXT and log files. No attempt has been made
to share these files between concurrent instances.
If "-r" or "--rig" is used without a parameter it still
enables multiple concurrent instance support for that
instance. All instances must use a unique parameter, one of
which may be empty.
The rig name is appended the
QCoreApplication::applicationName() for convenient usage like
window titles.
Set non Qt locale to "C".
This ensures that C library functions give consistent results
whatever the system locale is set to. QApplication follows
the system locale as before. Thus using QApplication and its
descendants like widgets and QString for all user visible
formating will give correct l10n and using C/C++ library will
give consistent formatting across locales.
Added top level C++ exception handling to main.cpp.
Because the new transceiver framework uses exceptions
internally, the main function now handles any exceptions that
aren't caught.
Retired devsetup, replaced with Configuration.
Configuration is a class that encapsulates most of the
configuration behavior. Because rig configuration is so
closely coupled with rig operation, Configuration serves as a
proxy for access to the rig control functions. See
Configuration.hpp for more details of the Configuration
interface.
Menu changes.
Various checkable menu actions moved from main menu to the
Configuration dialog. The whole settings menu has been
retired with the single "Settings..." action moved to the
file menu for consistency on Mac where it appears as
"Preferences" in line with Mac guidelines.
New data models for data used by the application.
ADIF amateur band parameters, free text message macros, spot
working frequencies and, station information (station
descriptions and transverter offsets per band) each implement
the QAbstractItemModel interface allowing them to be used
directly with Qt view widgets (Bands.hpp, FrequencyList.hpp
and, StationList.hpp). Configuration manages maintenance of
an instance of all but the former of the above models. The
ADIF band model is owned by Configuration but requires no
user maintenance as it is immutable.
Band combo box gets more functionality.
This widget is now an editable QComboBox with some extra
input capabilities.
The popup list is still the list of spot working frequencies,
now showing the actual frequency decorated with the band
name. This allows multiple spot frequencies on a band if
required.
The line edit allows direct frequency entry in mega-Hertz
with a completer built in to suggest the available spot
working frequencies. It also allows band name entry where
the first available spot working frequency is selected.
Recognized band names are those that are defined by the ADIF
specification and can be found in in the implementation of
the ADIF bands model (Bands.cpp).
If an out of band frequency is chosen, the line edit shows a
warning red background and the text "OOB". Out of band is
only defined by the ADIF band limits which in general are
wider than any entities regulations.
Qt 5.2 now supports default audio i/p and o/p devices.
These devices are placeholders for whatever the user defines
as the default device. Because of this they need special
treatment as the actual device used is chosen at open time
behind the scenes.
Close-down behavior is simplified.
The close-down semantics were broken such that some objects
were not being shut down cleanly, this required amendments to
facilitate correct close down of threads.
User font selection added to Configuration UI.
Buttons to set the application font and the font for the band
and Rx frequency activity widgets have been added to the
Configuration UI to replace the file based font size control.
Free text macros now selected directly.
The free text line edit widgets are now editable combo boxes
that have the current free text macro definitions as their
popup list. The old context menu to do this has been
retired.
Astronomical data window dynamically formatted and has font a chooser.
This window is now autonomous, has its own font chooser and,
dynamically resizes to cover the contents.
Double click to Tx enabled now has its own widget in the status bar.
QDir used for portable path and file name handling throughout.
The "Monitor", "Decode", "Enable Tx" and, "Tune" buttons are now
checkable.
Being checkable allows these buttons control their own state
and rendering.
Calls to PSK Reporter interface simplified.
In mainwindow.cpp the calls to this interface are
rationalized to just 3 locations.
Manipulation of ALL.TXT simplified.
Moved, where possible, to common functions.
Elevated frequency types to be Qt types.
Frequency and FrequencyDelta defined as Qt types in their
meta-type system (Radio.hpp). They are integral types for
maximum accuracy.
Re-factored rig control calls in mainwindow.cpp.
The new Configuration proxy access to rig control required
many changes (mostly simplifications) to the MainWindow rig
control code. Some common code has been gathered in member
functions like qsy(), monitor(), band_changed() and
auto_tx_mode().
Rig control enhancements.
The rig control for clients interface is declared as an
abstract interface (See Transceiver.hpp). Concrete
implementations of this interface are provided for the Hamlib
rig control library, DX Lab Suite Commander via a TCP/IP
command channel, Ham Radio Deluxe also via a TCP/IP command
channel and, OmniRig via its Windows COM server interface.
Concrete Transceiver implementations are expected to be moved
to a separate thread after construction since many operations
are blocking and not suitable for running in a GUI thread.
To facilitate this all instantiation of concrete Transceiver
instances are handled by Configuration using a factory class
(TransceiverFactory) for configuration parameter based
instantiation.
Various common functionality shared by different rig
interface implementations are factored out into helper base
classes that implement or delegate parts of the Transceiver
interface. They are TransceiverBase which caches state to
minimize expensive rig commands, it also maps the Transceiver
interface into a more convenient form for implementation
(template methods). PollingTransceiver that provides a state
polling mechanism that only reports actual changes.
EmulateSplitTransceiver that provides split operation by
QSYing on PTT state changes.
EmulateSplitTransceiver can be used with any implementation
as it follows the GoF Decorator pattern and can wrap any
Transceiver implementation.
OmniRigTransceiver is derived directly from TransceiverBase
since it doesn't require polling due to its asynchronous
nature. OmniRigTransceiver is only built on Windows as it is
a COM server client. To build it you must first install the
OmniRig client on the development machine
(http://www.dxatlas.com/omnirig/).
DXLabSuiteCommanderTransceiver derives from
PollingTransceiver since it is a synchronous communications
channel. No third party library is required for this
interface.
HRDTransceiver also derives from PollingTransceiver. The HRD
interface library has been reverse engineered to provide
functionality with all available versions of HRD. No third
party libraries are required.
HamlibTransceiver likewise derives from PollingTransceiver
since the Hamlib asynchronous interface is non-functional.
Although this class will interface with the release version
of Hamlib (1.2.15.3); for correct operation on most rigs it
needs to run with the latest master branch code of Hamlib.
During development many changes to Hamlib have been submitted
and accepted, hence this requirement. Hamlib source can be
obtained from git://git.code.sf.net/p/hamlib/code and at the
time of writing he master branch was at SHA 6e4432.
The Hamlib interface directly calls the "C" interface and the
modified rigclass.{h,cpp} files have been retired.
There is a rig type selection of "None" which may be used for
non-CAT rigs, this is actually a connection to the dummy
Hamlib device.
PollingTransvceiver derives from TransceiverBase and
TransceiverBase derives from the Transceiver interface.
Each interface implementation offers some possibility of PTT
control via a different serial port than the CAT port. We
also support PTT control directly via a second serial port.
This is done by delegating to a dummy Hamlib instance which
is only used for PTT control. This means that
DXLabSuiteCommanderTransceiver, HRDTransceiver and
OmniRigTransceiver always wrap a dummy HamlibTransceiver
instance. The factory class TransceiverFactory manages all
these constructional complexities.
Serial port selection combo boxes are now editable with a
manually entered value being saved to the settings file.
This allows a non-standard port device to be used without
having to edit the settings file manually.
For TCP/IP network CAT interfaces; the network address and
port may be specified allowing the target device to be
located on a different machine from the one running wsjtx if
required. The default used when the address field is left
blank is the correct one for normal usage on the local host.
Selecting a polling interval of zero is no longer possible,
this is because the rig control capability can no longer
support one way connection. This is in line with most other
CAT control software.
In the Configuration dialog there are options to select split
mode control by the software and mode control by the
software. For the former "None", "Rig" and "Fake it" are
available, for the latter "None", "USB" and, "Data" are
available. Because tone generation is implicitly linked to
split mode operation; it is no longer possible to have the
software in split mode and the rig not or vice versa. This
may mean some rigs cannot be used in split mode and therefore
not in dual JT65+JT9 until issues with CAT control with that
rig are resolved. Single mode with VOX keying and no CAT
control are still possible so even the most basic transceiver
setup is supported as before.
Configuration now supports a frequency offset suitable for
transverter operation. The station details model
(StationList.hpp) includes a column to store an offset for
each band if required.
CMake build script improvements.
The CMakeLists.txt from the 'lib' directory has been retired
with its contents merged into the top level CMakeLists.txt.
Install target support has been greatly improved with the
Release build configuration now building a fully standalone
installation on Mac and Windows. The Debug configuration
still builds an installation that has environment
dependencies for external libraries, which is desirable for
testing and debugging.
Package target support is largely complete for Mac, Windows
and, Linux, it should be possible to build release installers
directly from CMake/CPack.
Cmake FindXXXX.cmake modules have been added to improve the
location of fftw-3 and Hamlib packages.
Version numbers are now stored in Versions.cmake and work in
concert with automatic svn revision lookup during build. The
version string becomes 'rlocal'± if there are any uncommitted
changes in the build source tree.
Moved resource like files to Qt resources.
Because location of resource files (when they cannot go into
the installation directory because of packaging rules) is
hard to standardize. I have used the Qt resource system for
all ancillary data files. Some like kvasd.dat are dumped out
to the temp (working directory) because they are accessed by
an external program, others like the audio samples are copied
out so they appear in the data directory under the default
save directory.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3929 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-03-26 09:21:00 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::do_frequency (Frequency f)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_frequency:" << f << state ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (OmniRig::PM_FREQ & writable_params_)
|
|
|
|
{
|
|
|
|
rig_->SetFreq (f);
|
|
|
|
update_rx_frequency (f);
|
|
|
|
}
|
|
|
|
else if (reversed_ && (OmniRig::PM_FREQB & writable_params_))
|
|
|
|
{
|
|
|
|
rig_->SetFreqB (f);
|
|
|
|
update_rx_frequency (f);
|
|
|
|
}
|
|
|
|
else if (!reversed_ && (OmniRig::PM_FREQA & writable_params_))
|
|
|
|
{
|
|
|
|
rig_->SetFreqA (f);
|
|
|
|
update_rx_frequency (f);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-04-16 10:59:00 -04:00
|
|
|
throw error {tr ("OmniRig: don't know how to set rig frequency")};
|
Added support for use of "Standard" locations for writable files.
This allows writable files to be located in the "correct"
location for each platform rather than in the directory of
the executable which, in general, is not recommended or
allowed in some cases.
A preprocessor macro WSJT_STANDARD_FILE_LOCATIONS is used to
switch be tween old and new functionality, currently it is on
by default. It can be turned off by defining it to a false
value (0) or more simply with cmake-gui setting the option
with the same name. JTAlert can only work with the old
non-standard file locations until Laurie VK3AMA chooses to
support the new file locations.
Even if the above is not enabled; the QSettings file is
written to a user specific location so it will be shared by
all instances of the program (i.e. across upgrades). See
below for multiple concurrent instance support changes.
Added a command line parser module for Fortran.
Added 'lib/options.f90' to facilitate more complex argument
passing to jt9 to cover explicit file locations.
Changed the way multiple concurrent instances are handled.
This is to allow the program to be run multiple times from
the same installation directory.
A new wsjtx command line optional argument is available "-r"
or "--rig" which enables multiple concurrent instance
support. The parameter of the new option is a unique name
signifying a rig or equivalent. The name is used as the
shared memory segment key and in window titles. The name is
also used to access unique settings files and writable data
files like ALL.TXT and log files. No attempt has been made
to share these files between concurrent instances.
If "-r" or "--rig" is used without a parameter it still
enables multiple concurrent instance support for that
instance. All instances must use a unique parameter, one of
which may be empty.
The rig name is appended the
QCoreApplication::applicationName() for convenient usage like
window titles.
Set non Qt locale to "C".
This ensures that C library functions give consistent results
whatever the system locale is set to. QApplication follows
the system locale as before. Thus using QApplication and its
descendants like widgets and QString for all user visible
formating will give correct l10n and using C/C++ library will
give consistent formatting across locales.
Added top level C++ exception handling to main.cpp.
Because the new transceiver framework uses exceptions
internally, the main function now handles any exceptions that
aren't caught.
Retired devsetup, replaced with Configuration.
Configuration is a class that encapsulates most of the
configuration behavior. Because rig configuration is so
closely coupled with rig operation, Configuration serves as a
proxy for access to the rig control functions. See
Configuration.hpp for more details of the Configuration
interface.
Menu changes.
Various checkable menu actions moved from main menu to the
Configuration dialog. The whole settings menu has been
retired with the single "Settings..." action moved to the
file menu for consistency on Mac where it appears as
"Preferences" in line with Mac guidelines.
New data models for data used by the application.
ADIF amateur band parameters, free text message macros, spot
working frequencies and, station information (station
descriptions and transverter offsets per band) each implement
the QAbstractItemModel interface allowing them to be used
directly with Qt view widgets (Bands.hpp, FrequencyList.hpp
and, StationList.hpp). Configuration manages maintenance of
an instance of all but the former of the above models. The
ADIF band model is owned by Configuration but requires no
user maintenance as it is immutable.
Band combo box gets more functionality.
This widget is now an editable QComboBox with some extra
input capabilities.
The popup list is still the list of spot working frequencies,
now showing the actual frequency decorated with the band
name. This allows multiple spot frequencies on a band if
required.
The line edit allows direct frequency entry in mega-Hertz
with a completer built in to suggest the available spot
working frequencies. It also allows band name entry where
the first available spot working frequency is selected.
Recognized band names are those that are defined by the ADIF
specification and can be found in in the implementation of
the ADIF bands model (Bands.cpp).
If an out of band frequency is chosen, the line edit shows a
warning red background and the text "OOB". Out of band is
only defined by the ADIF band limits which in general are
wider than any entities regulations.
Qt 5.2 now supports default audio i/p and o/p devices.
These devices are placeholders for whatever the user defines
as the default device. Because of this they need special
treatment as the actual device used is chosen at open time
behind the scenes.
Close-down behavior is simplified.
The close-down semantics were broken such that some objects
were not being shut down cleanly, this required amendments to
facilitate correct close down of threads.
User font selection added to Configuration UI.
Buttons to set the application font and the font for the band
and Rx frequency activity widgets have been added to the
Configuration UI to replace the file based font size control.
Free text macros now selected directly.
The free text line edit widgets are now editable combo boxes
that have the current free text macro definitions as their
popup list. The old context menu to do this has been
retired.
Astronomical data window dynamically formatted and has font a chooser.
This window is now autonomous, has its own font chooser and,
dynamically resizes to cover the contents.
Double click to Tx enabled now has its own widget in the status bar.
QDir used for portable path and file name handling throughout.
The "Monitor", "Decode", "Enable Tx" and, "Tune" buttons are now
checkable.
Being checkable allows these buttons control their own state
and rendering.
Calls to PSK Reporter interface simplified.
In mainwindow.cpp the calls to this interface are
rationalized to just 3 locations.
Manipulation of ALL.TXT simplified.
Moved, where possible, to common functions.
Elevated frequency types to be Qt types.
Frequency and FrequencyDelta defined as Qt types in their
meta-type system (Radio.hpp). They are integral types for
maximum accuracy.
Re-factored rig control calls in mainwindow.cpp.
The new Configuration proxy access to rig control required
many changes (mostly simplifications) to the MainWindow rig
control code. Some common code has been gathered in member
functions like qsy(), monitor(), band_changed() and
auto_tx_mode().
Rig control enhancements.
The rig control for clients interface is declared as an
abstract interface (See Transceiver.hpp). Concrete
implementations of this interface are provided for the Hamlib
rig control library, DX Lab Suite Commander via a TCP/IP
command channel, Ham Radio Deluxe also via a TCP/IP command
channel and, OmniRig via its Windows COM server interface.
Concrete Transceiver implementations are expected to be moved
to a separate thread after construction since many operations
are blocking and not suitable for running in a GUI thread.
To facilitate this all instantiation of concrete Transceiver
instances are handled by Configuration using a factory class
(TransceiverFactory) for configuration parameter based
instantiation.
Various common functionality shared by different rig
interface implementations are factored out into helper base
classes that implement or delegate parts of the Transceiver
interface. They are TransceiverBase which caches state to
minimize expensive rig commands, it also maps the Transceiver
interface into a more convenient form for implementation
(template methods). PollingTransceiver that provides a state
polling mechanism that only reports actual changes.
EmulateSplitTransceiver that provides split operation by
QSYing on PTT state changes.
EmulateSplitTransceiver can be used with any implementation
as it follows the GoF Decorator pattern and can wrap any
Transceiver implementation.
OmniRigTransceiver is derived directly from TransceiverBase
since it doesn't require polling due to its asynchronous
nature. OmniRigTransceiver is only built on Windows as it is
a COM server client. To build it you must first install the
OmniRig client on the development machine
(http://www.dxatlas.com/omnirig/).
DXLabSuiteCommanderTransceiver derives from
PollingTransceiver since it is a synchronous communications
channel. No third party library is required for this
interface.
HRDTransceiver also derives from PollingTransceiver. The HRD
interface library has been reverse engineered to provide
functionality with all available versions of HRD. No third
party libraries are required.
HamlibTransceiver likewise derives from PollingTransceiver
since the Hamlib asynchronous interface is non-functional.
Although this class will interface with the release version
of Hamlib (1.2.15.3); for correct operation on most rigs it
needs to run with the latest master branch code of Hamlib.
During development many changes to Hamlib have been submitted
and accepted, hence this requirement. Hamlib source can be
obtained from git://git.code.sf.net/p/hamlib/code and at the
time of writing he master branch was at SHA 6e4432.
The Hamlib interface directly calls the "C" interface and the
modified rigclass.{h,cpp} files have been retired.
There is a rig type selection of "None" which may be used for
non-CAT rigs, this is actually a connection to the dummy
Hamlib device.
PollingTransvceiver derives from TransceiverBase and
TransceiverBase derives from the Transceiver interface.
Each interface implementation offers some possibility of PTT
control via a different serial port than the CAT port. We
also support PTT control directly via a second serial port.
This is done by delegating to a dummy Hamlib instance which
is only used for PTT control. This means that
DXLabSuiteCommanderTransceiver, HRDTransceiver and
OmniRigTransceiver always wrap a dummy HamlibTransceiver
instance. The factory class TransceiverFactory manages all
these constructional complexities.
Serial port selection combo boxes are now editable with a
manually entered value being saved to the settings file.
This allows a non-standard port device to be used without
having to edit the settings file manually.
For TCP/IP network CAT interfaces; the network address and
port may be specified allowing the target device to be
located on a different machine from the one running wsjtx if
required. The default used when the address field is left
blank is the correct one for normal usage on the local host.
Selecting a polling interval of zero is no longer possible,
this is because the rig control capability can no longer
support one way connection. This is in line with most other
CAT control software.
In the Configuration dialog there are options to select split
mode control by the software and mode control by the
software. For the former "None", "Rig" and "Fake it" are
available, for the latter "None", "USB" and, "Data" are
available. Because tone generation is implicitly linked to
split mode operation; it is no longer possible to have the
software in split mode and the rig not or vice versa. This
may mean some rigs cannot be used in split mode and therefore
not in dual JT65+JT9 until issues with CAT control with that
rig are resolved. Single mode with VOX keying and no CAT
control are still possible so even the most basic transceiver
setup is supported as before.
Configuration now supports a frequency offset suitable for
transverter operation. The station details model
(StationList.hpp) includes a column to store an offset for
each band if required.
CMake build script improvements.
The CMakeLists.txt from the 'lib' directory has been retired
with its contents merged into the top level CMakeLists.txt.
Install target support has been greatly improved with the
Release build configuration now building a fully standalone
installation on Mac and Windows. The Debug configuration
still builds an installation that has environment
dependencies for external libraries, which is desirable for
testing and debugging.
Package target support is largely complete for Mac, Windows
and, Linux, it should be possible to build release installers
directly from CMake/CPack.
Cmake FindXXXX.cmake modules have been added to improve the
location of fftw-3 and Hamlib packages.
Version numbers are now stored in Versions.cmake and work in
concert with automatic svn revision lookup during build. The
version string becomes 'rlocal'± if there are any uncommitted
changes in the build source tree.
Moved resource like files to Qt resources.
Because location of resource files (when they cannot go into
the installation directory because of packaging rules) is
hard to standardize. I have used the Qt resource system for
all ancillary data files. Some like kvasd.dat are dumped out
to the temp (working directory) because they are accessed by
an external program, others like the audio samples are copied
out so they appear in the data directory under the default
save directory.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3929 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-03-26 09:21:00 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::do_tx_frequency (Frequency tx, bool /* rationalise_mode */)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_tx_frequency:" << tx << state ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
bool split {tx != 0};
|
|
|
|
|
|
|
|
if (split)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_tx_frequency: set SPLIT mode on";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rig_->SetSplitMode (state ().frequency (), tx);
|
|
|
|
update_other_frequency (tx);
|
|
|
|
update_split (true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_tx_frequency: set SPLIT mode off";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rig_->SetSimplexMode (state ().frequency ());
|
|
|
|
update_split (false);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool notify {false};
|
|
|
|
|
|
|
|
if (readable_params_ & OmniRig::PM_FREQ || !(readable_params_ & (OmniRig::PM_FREQA | OmniRig::PM_FREQB)))
|
|
|
|
{
|
|
|
|
update_other_frequency (tx); // async updates won't return this
|
|
|
|
// so just store it and hope
|
|
|
|
// operator doesn't change the
|
|
|
|
// "back" VFO on rig
|
|
|
|
notify = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!((OmniRig::PM_VFOAB | OmniRig::PM_VFOBA | OmniRig::PM_SPLITON) & readable_params_))
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_tx_frequency: setting SPLIT manually";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
update_split (split); // we can't read it so just set and
|
|
|
|
// hope op doesn't change it
|
|
|
|
notify = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (notify)
|
|
|
|
{
|
|
|
|
update_complete ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OmniRigTransceiver::do_mode (MODE mode, bool /* rationalise */)
|
|
|
|
{
|
|
|
|
#if WSJT_TRACE_CAT
|
|
|
|
qDebug () << "OmniRigTransceiver::do_mode:" << mode << state ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// TODO: G4WJS OmniRig doesn't seem to have any capability of tracking/setting VFO B mode
|
|
|
|
|
|
|
|
auto mapped = map_mode (mode);
|
|
|
|
|
|
|
|
if (mapped & writable_params_)
|
|
|
|
{
|
|
|
|
rig_->SetMode (mapped);
|
|
|
|
update_mode (mode);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
offline ("OmniRig invalid mode");
|
|
|
|
}
|
|
|
|
}
|