kopia lustrzana https://gitlab.com/eliggett/wfview
commit
16f55b7a44
|
@ -1 +1,6 @@
|
|||
*.pro.user
|
||||
.vs
|
||||
.qmake.stash
|
||||
debug
|
||||
release
|
||||
ui_*
|
249
CHANGELOG
249
CHANGELOG
|
@ -1,6 +1,253 @@
|
|||
|
||||
# CHANGELOG
|
||||
|
||||
- 20210427
|
||||
|
||||
Minor changes to hide sat button until we have time to work on that
|
||||
feature.
|
||||
|
||||
Additional bands added, Airband, WFM
|
||||
|
||||
added 630/2200m for 705; probably like the 7300 hardly useable for TX though. Also added auomatic switching to the view pane after non-BSR bands are selected
|
||||
|
||||
added 630/2200m to 7300/7610/785x
|
||||
|
||||
derp: fixed main dial freq display for non-BSR 4m band; see also previous commit
|
||||
|
||||
fixed main dial freq display for non-BSR bands 60, 630, 2200m if such a band was selected in the band select menu
|
||||
|
||||
Minor change to set frequency, which was lacking "emit" at the start.
|
||||
|
||||
changed the modeSelectCombo-addItem sequence a bit to have modes grouped; CW and CW-R are now grouped, as well as RTTY/RTTY-R; AM and FM are grouped now
|
||||
|
||||
- 20210426
|
||||
|
||||
Well, that was fun. Color preferences now work, and colors can be
|
||||
modified from the preference file for custom plot colors.
|
||||
|
||||
The preference file now stores colors as unsigned int. To convert the
|
||||
colors in the file to standard AARRGGBB format (AA = Alpha channel), use
|
||||
python's hex() function. Maybe one day we will fix the qt bug and make
|
||||
this save in a better format.
|
||||
|
||||
Added dynamic band buttons. Fixed multiple bugs related to various
|
||||
differences in band stacking register addresses (for example, the GEN
|
||||
band on the 705 has a different address from the 7100 and the 7300).
|
||||
This code was only tested with the 9700.
|
||||
|
||||
started rough docs for the usermanual
|
||||
|
||||
- 20210425
|
||||
|
||||
More work on rigctld
|
||||
|
||||
Faster polling. Clarified in comments around line 309 in wfmain.cpp.
|
||||
|
||||
Added ability to read RIT status. Added RIT to initial rig query. Added
|
||||
|
||||
Added ability to read RIT status. Added RIT to initial rig query. Added
|
||||
variables to handle delayed command timing values. Fixed bug in
|
||||
frequency parsing code that had existed for some time. Changed tic marks
|
||||
on RIT knob because I wanted more of them. Bumped startup initial rig
|
||||
state queries to 100ms. May consider faster queries on startup since we
|
||||
are going to need more things queried on startup.
|
||||
|
||||
- 20210424
|
||||
|
||||
Receiver Incremental Tuning is in. The UI does not check the rig's
|
||||
initial state yet, but the functions are partially in rigCommander for
|
||||
that purpose.
|
||||
|
||||
|
||||
- 20210423
|
||||
|
||||
Found two missing defaults in switch cases inside rigcommander.cpp.
|
||||
|
||||
Modified rig power management to stop command ques (s-meter and others).
|
||||
Upon rig power up, the command queue is repurposed as a 3 second delay
|
||||
for bootup, and then, commands are issued to restore the spectrum
|
||||
display (if the wf checkbox was checked). I've made new functions,
|
||||
powerRigOff and powerRigOn, for these purposes.
|
||||
|
||||
work in progress on spectrum enable after power off/on.
|
||||
|
||||
powerOff should work now.
|
||||
|
||||
- 20210420
|
||||
|
||||
rigctl working (sort of) with WSJT-X
|
||||
|
||||
- 20210419 Initial commit of rigctld (doesn't currently do anything useful!)
|
||||
|
||||
|
||||
- 20210417 Adding a default position for the frequency indicator line.
|
||||
|
||||
Goodbye tracer
|
||||
|
||||
|
||||
- 20210416 added support info for prebuild-systems
|
||||
|
||||
|
||||
- 20210412 added airband, dPMR, lw/mw European and fast HF/70/23cm 1 MHz tuning steps
|
||||
|
||||
|
||||
- 20210411 Added ATU feature on 7610.
|
||||
|
||||
Now grabs scope state on startup. Found bug, did not fix, in the
|
||||
frequency parsing code. Worked aroud it by using doubles for now.
|
||||
|
||||
|
||||
- 20210410 Preamp and attenuator are now queried on startup. Additionally, the
|
||||
preamp is checked when the attenuator is changed, and the attenuator is
|
||||
checked with the preamp is changed. This helps the user understand if
|
||||
the rig allows only one or the other to be active (such as the IC-9700).
|
||||
|
||||
Added frequency line. Let's see how we like it.
|
||||
|
||||
Add some preliminary parts of getting the attenuator, preamp, and
|
||||
antenna selection on startup. UI not updated yet but getting there.
|
||||
|
||||
|
||||
- 20210409 Moved ATU controls to main tab.
|
||||
|
||||
Added waterfall theme combo box
|
||||
|
||||
Removed buttons from attenuator preamp UI controls.
|
||||
|
||||
Antenna selection might work, untested.
|
||||
|
||||
Preamp code is in. Can't read the current preamp state yet but we can
|
||||
set it. Nicer names for preamp and attenuator menu items.
|
||||
|
||||
|
||||
- 20210408 Preamp data is now tracked (but not used yet)
|
||||
re-added lost tooptip for SQ slider
|
||||
|
||||
|
||||
- 20210407 Minor disconnect in the getDTCS call
|
||||
|
||||
Attenuators are in! Please try them out!
|
||||
|
||||
|
||||
- 20210406 The repeater setup now disables elements for things your rig doesn't do.
|
||||
|
||||
We now query the repeater-related things on startup, such that the
|
||||
repeater UI is populated correctly.
|
||||
|
||||
We now have kHz as the assumed input format if there isn't a dot in the
|
||||
entry box. Enjoy that!
|
||||
|
||||
Minor change so that we track the selected tone to mode changes, keeping
|
||||
the radio in sync with the UI.
|
||||
|
||||
Tone, Tone Squelch, and D(T)CS seem to work as expected. Mode can be
|
||||
selected.
|
||||
|
||||
|
||||
- 20210405 removed 150 Hz CTCSS / NATO as it can't make that by itself
|
||||
|
||||
added 77.0 Hz tone to CTCSS
|
||||
|
||||
We can now read the repeater access mode and update the UI. What remains
|
||||
is to be able to set the mode.
|
||||
|
||||
Working read/write of Tone, TSQL, and DTCS tones/code. Some code is also
|
||||
present now to change the mode being used (tone, tsql, DTCS, or some
|
||||
combo of the two).
|
||||
|
||||
|
||||
- 20210404 Tone, TSQL, and DTCS code added, but not complete.
|
||||
|
||||
better tone mode names
|
||||
|
||||
Started work on the tone mode interface.
|
||||
|
||||
|
||||
- 20210401 Added placeholders for attenuator, preamp, and antenna selection UI
|
||||
controls.
|
||||
|
||||
Moved some repeater-related things out from rig commander and into a
|
||||
shared header.
|
||||
|
||||
|
||||
- 20210331 Adjusting signals and slots for repeater duplex.
|
||||
|
||||
Basic duplex code copied from wfmain to the new repeatersetup window.
|
||||
|
||||
|
||||
- 20210330 Added conditional to debug on serial data write size.
|
||||
|
||||
|
||||
- 20210329 Fix crash when radio is shutdown while wfview is connected.
|
||||
|
||||
|
||||
- 20210311 Add local volume control for UDP connections.
|
||||
|
||||
add volume control to audiohandler
|
||||
|
||||
Small fixes to UDP server
|
||||
|
||||
Add USB audio handling to UDP server
|
||||
|
||||
Changed frequency parameters to (mostly) unsigned 64-bit ints. This
|
||||
makes all the rounding code very simple and removes many annoying lines
|
||||
of code designed to handle errors induced by using doubles for the
|
||||
frequency.
|
||||
|
||||
- 20210310 audio resampling added / opus
|
||||
|
||||
updates on virtual serial port
|
||||
|
||||
fixed input combo boxes from growing
|
||||
|
||||
fixed 4:15 rollover/disconnect issue
|
||||
|
||||
- 20210304 Tuning steps! Still need to zero out those lower digits while scrolling
|
||||
if box is checked.
|
||||
|
||||
Fix spectrum peaks as well.
|
||||
|
||||
Fix spectrum 'flattening' with strong signal
|
||||
|
||||
Add separate mutex for udp/buffers.
|
||||
|
||||
supported rigs IC705, IC7300 (over USB, no sound), IC7610, IC785x
|
||||
|
||||
- 20210227 changed the way udp audio traffic is handled
|
||||
on both the TX and RX side.
|
||||
|
||||
- 20210226 Fixed minor bug where flock did not stop double-clicking on the
|
||||
spectrum.
|
||||
|
||||
S-meter ballistics:
|
||||
Turned up the speed. Once you see fast meters, there's no going back.
|
||||
Tested at 5ms without any issues, comitting at 10ms for now. Note that
|
||||
50ms in the first 'fixed' meter code is the same as 25ms now due to how
|
||||
the command queue is structured. So 10ms is only a bit faster than
|
||||
before.
|
||||
Fixed meter polling issue
|
||||
|
||||
- 20210224 fixed 785x lockup
|
||||
Added scale and dampening/averaging to s-meter
|
||||
|
||||
- 20210222 f-lock works now
|
||||
|
||||
- 20210221 added working s-meter
|
||||
added working power meter
|
||||
added visual studio 2019 solution (windows builds)
|
||||
changed packet handling, WIP
|
||||
rigtype stays in view on status bar
|
||||
added audio input gain slider
|
||||
|
||||
- 20210218
|
||||
added SQ slider
|
||||
added TX power slider
|
||||
added TX button
|
||||
added simplex/duplex/auto shifts
|
||||
added debug logging
|
||||
added TX and RX codec selections
|
||||
added RX audio buffer size slider
|
||||
started adding server setup
|
||||
|
||||
- 20210210 added control over LAN for rigs that support it
|
||||
has been tested on the 705, 7610, 785x, 9700.
|
||||
should work on 7700, 7800, other rigs.
|
||||
|
|
39
INSTALL.md
39
INSTALL.md
|
@ -51,8 +51,10 @@ sudo ./install.sh
|
|||
|
||||
### 4. You can now launch wfview, either from the terminal or from your desktop environment. If you encounter issues using the serial port, run the following command:
|
||||
~~~
|
||||
|
||||
if you are using the wireless 705 or any networked rig like the 7610, 7800, 785x, there is no need to use USB so below is not needed.
|
||||
|
||||
sudo chown $USER /dev/ttyUSB*
|
||||
~~~
|
||||
|
||||
Note, on most linux systems, you just need to add your user to the dialout group, which is persistent and more secure:
|
||||
|
||||
|
@ -61,34 +63,39 @@ sudo usermod -aG dialout $USER
|
|||
~~~
|
||||
(don't forget to log out and log in)
|
||||
|
||||
~~~
|
||||
|
||||
### opensuse install ###
|
||||
### opensuse/sles/tumbleweed install ###
|
||||
---
|
||||
|
||||
the following is a raw - only one time tested piece of information
|
||||
install wfview on suse 15.x sles 15.x or tumbleweed; this was done on a clean install/updated OS.
|
||||
|
||||
install suse 15.x (did this on a kde virtual machine leap 15.2)
|
||||
we need to add packages to be able to build the stuff.
|
||||
|
||||
qt5:
|
||||
|
||||
wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
|
||||
|
||||
- chmod +x qt-unified-linux-x64-online.run
|
||||
- sudo zypper in --type pattern devel_basis
|
||||
- sudo zypper in libQt5Widgets-devel libqt5-qtbase-common-devel libqt5-qtserialport-devel libQt5SerialPort5 qcustomplot-devel libqcustomplot2 libQt5PrintSupport-devel libqt5-qtmultimedia-devel
|
||||
|
||||
now get and install qt5:
|
||||
|
||||
- wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
|
||||
- chmod +x qt-unified-linux-x64-online.run
|
||||
|
||||
|
||||
- kdesu ./qt-unified-linux-x64-online.run
|
||||
- install base qt5 default qt5 desktop development
|
||||
|
||||
- sudo zypper in libQt5Widgets-devel libqt5-qtbase-common-devel libqt5-qtserialport-devel libQt5SerialPort5 qcustomplot-devel libqcustomplot2 libQt5PrintSupport-devel
|
||||
install Qt 5.15.2 for GCC for desktop application development
|
||||
|
||||
- mkdir src
|
||||
- cd src
|
||||
when done, create the place where to build:
|
||||
|
||||
in this case, use your homedir:
|
||||
|
||||
- mkdir -p ~/src/build && cd src
|
||||
- git clone https://gitlab.com/eliggett/wfview.git
|
||||
- cd ../
|
||||
- mkdir build
|
||||
- cd build
|
||||
- qmake-qt5 ../src/wfview/wvfiew.pro
|
||||
- qmake-qt5 ../wfview/wfview.pro
|
||||
- make -j
|
||||
- sudo ./install.sh
|
||||
|
||||
wfview is now installed in /usr/local/bin
|
||||
|
||||
---
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
# How to install wfview without building yourself on selected linux versions
|
||||
|
||||
|
||||
|
||||
We understand that downloading sources with git, selecting branches and building yourself may a bit daunting.
|
||||
In the future we may at some point start distributing packages and/or images like appimage, flatpack. snap.
|
||||
|
||||
|
||||
Instructions how to use this w/o building yourself. We are using a precompiled version that has been tested on a few
|
||||
different versions of linux in alphabetical order. Note that all are click-click-next-next-finish installs.
|
||||
|
||||
not supported:
|
||||
|
||||
centos7 -- no qt support
|
||||
debian 10 -- outdated
|
||||
devuan 3.1.1.1 -- outdated
|
||||
redhat7 -- no qt support
|
||||
|
||||
|
||||
~~~
|
||||
Debian 11 (Debian 10 is outdated)
|
||||
Fedora 33
|
||||
Fedora 34
|
||||
mint 20.1
|
||||
openSUSE 15.x
|
||||
openSUSE Tumbleweed
|
||||
SLES 15.x
|
||||
Ubuntu 20.04.2
|
||||
~~~
|
||||
|
||||
|
||||
### for all, the following is appicable:
|
||||
~~~
|
||||
mkdir -p ~/src/build
|
||||
cd ~/src/build
|
||||
wget https://wfview.org/downloads/latest.tar.gz (filepath/name tbd -- currently: mail roeland, pa3met for files)
|
||||
tar zxvf latest.tar.gz
|
||||
sudo ./install.sh
|
||||
~~~
|
||||
this will install the binary and a few other files to your system.
|
||||
|
||||
|
||||
Now for the system specifics; pick your version:
|
||||
|
||||
### Debian 11:
|
||||
~~~
|
||||
sudo apt install libqcustomplot2.0 libqt5multimedia5 libqt5serialport5
|
||||
sudo ln -s /usr/lib/x86_64-linux-gnu/libqcustomplot.so.2.0.1 /usr/lib/x86_64-linux-gnu/libqcustomplot.so.2
|
||||
start wfview
|
||||
~~~
|
||||
|
||||
### Fedora 33/34:
|
||||
~~~
|
||||
sudo dnf install qcustomplot-qt5 qt5-qtmultimedia qt5-qtserialport
|
||||
sudo ln -s /usr/lib64/libqcustomplot-qt5.so.2 /usr/lib64/libqcustomplot.so.2
|
||||
start wfview
|
||||
~~~
|
||||
|
||||
### Mint 20.1
|
||||
~~~
|
||||
apt install libqcustomplot2.0 libqt5multimedia5 libqt5serialport5
|
||||
sudo ln -s /usr/lib64/libqcustomplot-qt5.so.2 /usr/lib64/libqcustomplot.so.2
|
||||
start wfview
|
||||
~~~
|
||||
|
||||
### openSUSE/Tumbleweed/SLES:
|
||||
~~~
|
||||
sudo zypper in libqcustomplot2 libQt5SerialPort5
|
||||
start wfview
|
||||
~~~
|
||||
|
||||
### UBUNTU:
|
||||
~~~
|
||||
sudo apt install libqcustomplot2.0 libQt5Multimedia libqt5serialport5
|
||||
sudo ln -s /usr/lib/x86_64-linux-gnu/libqcustomplot.so.2.0.1 /usr/lib/x86_64-linux-gnu/libqcustomplot.so.2
|
||||
start wfview
|
||||
~~~
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
The Band tab:
|
||||
|
||||
The band tab reflects what bands the rig supports. It directly will
|
||||
switch the rig to that band and you will be switched back to the View tab
|
||||
|
||||
the bands offered follow generally what the rig's capabilities are.
|
||||
Some bands will either be RX only for some people (4m/60m/630m/2200m)
|
||||
|
||||
Band stacking gives you the opportunity to use the band stacking registers
|
||||
which is filled by the rig itself.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
I started to describe in text what all the controls are and what they
|
||||
actually are supposed to do. This is a very rough start of UI documentation
|
||||
and will beautify that of course. Initially want just to be sure that the
|
||||
definitions are right and everyone can edit/push it. So feel free.
|
||||
|
||||
Note that the markers that certainly are incomplete are marked TODO.
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
|
||||
|
||||
View:
|
||||
|
||||
|
||||
buttons
|
||||
|
||||
spectrum scope/waterfall:
|
||||
|
||||
spectrum mode
|
||||
|
||||
depending on the rig you can select:
|
||||
|
||||
center
|
||||
fixed
|
||||
scroll-center
|
||||
scroll-fixed
|
||||
|
||||
spectrum span
|
||||
|
||||
the spectrum span is active in center modes and you can select
|
||||
here the span you like, just as on the rig.
|
||||
|
||||
spectrum edge
|
||||
|
||||
here you can select the edge number as programmed in the rig.
|
||||
Most rigs will accept four edges.
|
||||
|
||||
|
||||
tofixed
|
||||
|
||||
clear peaks
|
||||
|
||||
here you can clear the peaks. Currently we only support persistent
|
||||
peaks and at some point we are changing that to be able to have it
|
||||
go away after 10 seconds, like the rig does.
|
||||
|
||||
enable/disable wf
|
||||
|
||||
on/off switch for the scope/waterfall
|
||||
|
||||
wf theme
|
||||
|
||||
Currently fixed selections how the scope and waterfall look like
|
||||
with colors. At som epoint we may add the ability to accept the
|
||||
RGB values like the rig does.
|
||||
|
||||
|
||||
|
||||
mode
|
||||
|
||||
|
||||
here you can select the mode used for tx and rx. To enable data mode there is
|
||||
a separate button to select.
|
||||
|
||||
|
||||
Data mode
|
||||
|
||||
switch the D mode on/off on the selected mode.
|
||||
|
||||
receive (and tx) filter
|
||||
|
||||
Select the predefined filter settings of the rig.
|
||||
Rigs also will change the TX width accordingly.
|
||||
|
||||
transmit/receive
|
||||
|
||||
this button alternates between TX and RX; Note that to
|
||||
enable TX, you need to do that first on the Settings tab
|
||||
|
||||
enable/disable atu
|
||||
|
||||
if your rig supports an internal ATU, you can enable
|
||||
disable it here. Note that we have not tested external
|
||||
ATU's yet. It may follow, it may not...
|
||||
|
||||
enable/disable rit
|
||||
|
||||
Enable the RIT function; currently no feedback on the rx shift.
|
||||
|
||||
tune
|
||||
|
||||
Button to initiate the ATU. Note that we have not tested external
|
||||
ATU's yet. It may follow, it may not...
|
||||
|
||||
|
||||
repeater setup (expand)
|
||||
|
||||
TODO
|
||||
|
||||
preamp
|
||||
|
||||
You can select the preamp mode(s). Some rigs can only accept
|
||||
preamp OR att.
|
||||
|
||||
attenuator
|
||||
|
||||
you can select the rig attenuator here. Some rigs can only accept
|
||||
preamp OR att.
|
||||
|
||||
|
||||
antenna selection
|
||||
|
||||
TODO
|
||||
|
||||
controls
|
||||
|
||||
main dial (there is no sub dial yet)
|
||||
|
||||
by turning the dial, or using mouse wheel or clicking on the scope
|
||||
you can change the current frequency. The step size is below the
|
||||
main dial and you can select most known stepsizes there.
|
||||
An Flock button will effectively lock the freq to prevent accidental
|
||||
mis clicking/rotating mouse actions.
|
||||
|
||||
|
||||
rit dial
|
||||
|
||||
the rit dial will effectively modify the offset in RX; useful on the VHF
|
||||
bands and up. Note that you need to switch on RIT for that
|
||||
You can use the mouse wheel to change the offset/shift.
|
||||
|
||||
rf gain
|
||||
|
||||
This slider controls the RF gain of the rig
|
||||
|
||||
af gain (defaults to 100%
|
||||
|
||||
This controls the AF Gain locally, defaults to 100% and does not
|
||||
increase/decrease the AF gain on the rig itself.
|
||||
(Else, a remotely controlled rig could make a lot of noise ;-))
|
||||
|
||||
sq
|
||||
|
||||
The squelch control
|
||||
|
||||
tx power
|
||||
|
||||
Control that sets the power in % with the same accuracy as the rig
|
||||
so if your rig is 50 Watt at 47%, this slider will too.
|
||||
|
||||
mic gain
|
||||
|
||||
The mic gain slider sets the modulation level on the rig.
|
||||
|
||||
scope reference level
|
||||
|
||||
The scope reference level can be set here and TODO because
|
||||
need to check if this follows per band or not.
|
||||
|
||||
|
||||
=============================
|
||||
Frequency
|
||||
|
||||
On this tab you can insert a free frequency in kHz.
|
||||
|
||||
examples:
|
||||
|
||||
7100 --> 7.1 kHz
|
||||
430. --> 430 MHz
|
||||
|
||||
e.g. the dot itself defines currently that you specify MHz.
|
||||
It will not accept anything beyond the dot. E.g. 430.125
|
||||
will end up doing nothing.
|
||||
|
||||
After entering, you will be switched back to the View tab.
|
||||
|
||||
STO/RCL: TODO
|
||||
|
||||
Settings
|
||||
|
||||
|
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,102 @@
|
|||
#ifndef AUDIOHANDLER_H
|
||||
#define AUDIOHANDLER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <QtMultimedia/QAudioOutput>
|
||||
#include <QMutexLocker>
|
||||
#include <QByteArray>
|
||||
#include <QtEndian>
|
||||
#include <QAudioFormat>
|
||||
#include <QAudioDeviceInfo>
|
||||
#include <QAudioOutput>
|
||||
#include <QAudioInput>
|
||||
#include <QIODevice>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <QTime>
|
||||
#include "resampler/speex_resampler.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
//#define BUFFER_SIZE (32*1024)
|
||||
|
||||
#define INTERNAL_SAMPLE_RATE 48000
|
||||
|
||||
struct audioPacket {
|
||||
quint32 seq;
|
||||
QTime time;
|
||||
quint16 sent;
|
||||
QByteArray datain;
|
||||
QByteArray dataout;
|
||||
};
|
||||
|
||||
|
||||
class audioHandler : public QIODevice
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
audioHandler(QObject* parent = 0);
|
||||
~audioHandler();
|
||||
|
||||
void getLatency();
|
||||
|
||||
bool setDevice(QAudioDeviceInfo deviceInfo);
|
||||
|
||||
void start();
|
||||
void flush();
|
||||
void stop();
|
||||
|
||||
qint64 readData(char* data, qint64 maxlen);
|
||||
qint64 writeData(const char* data, qint64 len);
|
||||
qint64 bytesAvailable() const;
|
||||
bool isSequential() const;
|
||||
void getNextAudioChunk(QByteArray &data);
|
||||
bool isChunkAvailable();
|
||||
public slots:
|
||||
bool init(const quint8 bits, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isulaw, const bool isinput, QString port, quint8 resampleQuality);
|
||||
void incomingAudio(const audioPacket data);
|
||||
void changeLatency(const quint16 newSize);
|
||||
|
||||
private slots:
|
||||
void notified();
|
||||
void stateChanged(QAudio::State state);
|
||||
void setVolume(unsigned char volume);
|
||||
|
||||
signals:
|
||||
void audioMessage(QString message);
|
||||
void sendLatency(quint16 newSize);
|
||||
void haveAudioData(const QByteArray& data);
|
||||
|
||||
|
||||
private:
|
||||
void reinit();
|
||||
|
||||
QMutex mutex;
|
||||
|
||||
bool isInitialized;
|
||||
QAudioOutput* audioOutput;
|
||||
QAudioInput* audioInput;
|
||||
bool isUlaw;
|
||||
quint16 latency;
|
||||
bool isInput; // Used to determine whether input or output audio
|
||||
int chunkSize;
|
||||
bool chunkAvailable;
|
||||
|
||||
quint32 lastSeq;
|
||||
|
||||
QAudioFormat format;
|
||||
QAudioDeviceInfo deviceInfo;
|
||||
quint16 radioSampleRate;
|
||||
quint8 radioSampleBits;
|
||||
quint8 radioChannels;
|
||||
QVector<audioPacket> audioBuffer;
|
||||
|
||||
SpeexResamplerState* resampler;
|
||||
unsigned int ratioNum;
|
||||
unsigned int ratioDen;
|
||||
};
|
||||
|
||||
#endif // AUDIOHANDLER_H
|
|
@ -0,0 +1,130 @@
|
|||
#include "calibrationwindow.h"
|
||||
#include "ui_calibrationwindow.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
calibrationWindow::calibrationWindow(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::calibrationWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->calCourseSlider->setDisabled(true);
|
||||
ui->calCourseSpinbox->setDisabled(true);
|
||||
|
||||
ui->calFineSlider->setDisabled(true);
|
||||
ui->calFineSpinbox->setDisabled(true);
|
||||
|
||||
}
|
||||
|
||||
calibrationWindow::~calibrationWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void calibrationWindow::handleCurrentFreq(double tunedFreq)
|
||||
{
|
||||
(void)tunedFreq;
|
||||
}
|
||||
|
||||
void calibrationWindow::handleSpectrumPeak(double peakFreq)
|
||||
{
|
||||
(void)peakFreq;
|
||||
}
|
||||
|
||||
void calibrationWindow::handleRefAdjustCourse(unsigned char value)
|
||||
{
|
||||
ui->calCourseSlider->setDisabled(false);
|
||||
ui->calCourseSpinbox->setDisabled(false);
|
||||
|
||||
ui->calCourseSlider->blockSignals(true);
|
||||
ui->calCourseSpinbox->blockSignals(true);
|
||||
|
||||
ui->calCourseSlider->setValue((int) value);
|
||||
ui->calCourseSpinbox->setValue((int) value);
|
||||
|
||||
ui->calCourseSlider->blockSignals(false);
|
||||
ui->calCourseSpinbox->blockSignals(false);
|
||||
}
|
||||
|
||||
void calibrationWindow::handleRefAdjustFine(unsigned char value)
|
||||
{
|
||||
ui->calFineSlider->setDisabled(false);
|
||||
ui->calFineSpinbox->setDisabled(false);
|
||||
|
||||
ui->calFineSlider->blockSignals(true);
|
||||
ui->calFineSpinbox->blockSignals(true);
|
||||
|
||||
ui->calFineSlider->setValue((int) value);
|
||||
ui->calFineSpinbox->setValue((int) value);
|
||||
|
||||
ui->calFineSlider->blockSignals(false);
|
||||
ui->calFineSpinbox->blockSignals(false);
|
||||
}
|
||||
|
||||
void calibrationWindow::on_calReadRigCalBtn_clicked()
|
||||
{
|
||||
emit requestRefAdjustCourse();
|
||||
emit requestRefAdjustFine();
|
||||
}
|
||||
|
||||
void calibrationWindow::on_calCourseSlider_valueChanged(int value)
|
||||
{
|
||||
ui->calCourseSpinbox->blockSignals(true);
|
||||
ui->calCourseSpinbox->setValue((int) value);
|
||||
ui->calCourseSpinbox->blockSignals(false);
|
||||
|
||||
emit setRefAdjustCourse((unsigned char) value);
|
||||
|
||||
}
|
||||
|
||||
void calibrationWindow::on_calFineSlider_valueChanged(int value)
|
||||
{
|
||||
ui->calFineSpinbox->blockSignals(true);
|
||||
ui->calFineSpinbox->setValue((int) value);
|
||||
ui->calFineSpinbox->blockSignals(false);
|
||||
|
||||
emit setRefAdjustFine((unsigned char) value);
|
||||
}
|
||||
|
||||
void calibrationWindow::on_calCourseSpinbox_valueChanged(int value)
|
||||
{
|
||||
// this one works with the up and down arrows,
|
||||
// however, if typing in a value, say "128",
|
||||
// this will get called three times with these values:
|
||||
// 1
|
||||
// 12
|
||||
// 128
|
||||
|
||||
//int value = ui->calFineSpinbox->value();
|
||||
|
||||
ui->calCourseSlider->blockSignals(true);
|
||||
ui->calCourseSlider->setValue(value);
|
||||
ui->calCourseSlider->blockSignals(false);
|
||||
|
||||
emit setRefAdjustCourse((unsigned char) value);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void calibrationWindow::on_calFineSpinbox_valueChanged(int value)
|
||||
{
|
||||
//int value = ui->calFineSpinbox->value();
|
||||
|
||||
ui->calFineSlider->blockSignals(true);
|
||||
ui->calFineSlider->setValue(value);
|
||||
ui->calFineSlider->blockSignals(false);
|
||||
|
||||
emit setRefAdjustFine((unsigned char) value);
|
||||
}
|
||||
|
||||
void calibrationWindow::on_calFineSpinbox_editingFinished()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void calibrationWindow::on_calCourseSpinbox_editingFinished()
|
||||
{
|
||||
// This function works well for typing in values
|
||||
// but the up and down arrows on the spinbox will not
|
||||
// trigger this function, until the enter key is pressed.
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef CALIBRATIONWINDOW_H
|
||||
#define CALIBRATIONWINDOW_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class calibrationWindow;
|
||||
}
|
||||
|
||||
class calibrationWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit calibrationWindow(QWidget *parent = 0);
|
||||
~calibrationWindow();
|
||||
|
||||
public slots:
|
||||
void handleSpectrumPeak(double peakFreq);
|
||||
void handleCurrentFreq(double tunedFreq);
|
||||
void handleRefAdjustCourse(unsigned char);
|
||||
void handleRefAdjustFine(unsigned char);
|
||||
|
||||
signals:
|
||||
void requestSpectrumPeak(double peakFreq);
|
||||
void requestCurrentFreq(double tunedFreq);
|
||||
void requestRefAdjustCourse();
|
||||
void requestRefAdjustFine();
|
||||
void setRefAdjustCourse(unsigned char);
|
||||
void setRefAdjustFine(unsigned char);
|
||||
|
||||
private slots:
|
||||
void on_calReadRigCalBtn_clicked();
|
||||
|
||||
void on_calCourseSlider_valueChanged(int value);
|
||||
|
||||
void on_calFineSlider_valueChanged(int value);
|
||||
|
||||
void on_calCourseSpinbox_valueChanged(int arg1);
|
||||
|
||||
void on_calFineSpinbox_valueChanged(int arg1);
|
||||
|
||||
void on_calFineSpinbox_editingFinished();
|
||||
|
||||
void on_calCourseSpinbox_editingFinished();
|
||||
|
||||
private:
|
||||
Ui::calibrationWindow *ui;
|
||||
};
|
||||
|
||||
#endif // CALIBRATIONWINDOW_H
|
|
@ -0,0 +1,252 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>calibrationWindow</class>
|
||||
<widget class="QDialog" name="calibrationWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Reference Adjustment</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>9</x>
|
||||
<y>9</y>
|
||||
<width>381</width>
|
||||
<height>281</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>IC-9700</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Reference Adjustment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Course</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Fine</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QSlider" name="calCourseSlider">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="calFineSlider">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="calCourseSpinbox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="calFineSpinbox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="calSaveSlotBtn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Save the calibration data to the indicated slot in the preference file. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="calLoadSlotBtn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Load the calibration data fromthe indicated slot in the preference file. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Slot:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>5</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="calReadRigCalBtn">
|
||||
<property name="text">
|
||||
<string>Read Current Rig Calibration</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
163
commhandler.cpp
163
commhandler.cpp
|
@ -1,4 +1,5 @@
|
|||
#include "commhandler.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
@ -22,14 +23,11 @@ commHandler::commHandler()
|
|||
|
||||
setupComm(); // basic parameters
|
||||
openPort();
|
||||
//qDebug() << "Serial buffer size: " << port->readBufferSize();
|
||||
//qDebug(logSerial()) << "Serial buffer size: " << port->readBufferSize();
|
||||
//port->setReadBufferSize(1024); // manually. 256 never saw any return from the radio. why...
|
||||
//qDebug() << "Serial buffer size: " << port->readBufferSize();
|
||||
|
||||
initializePt();
|
||||
//qDebug(logSerial()) << "Serial buffer size: " << port->readBufferSize();
|
||||
|
||||
connect(port, SIGNAL(readyRead()), this, SLOT(receiveDataIn()));
|
||||
connect(pseudoterm, SIGNAL(readyRead()), this, SLOT(receiveDataInPt()));
|
||||
}
|
||||
|
||||
commHandler::commHandler(QString portName, quint32 baudRate)
|
||||
|
@ -50,88 +48,19 @@ commHandler::commHandler(QString portName, quint32 baudRate)
|
|||
|
||||
setupComm(); // basic parameters
|
||||
openPort();
|
||||
// qDebug() << "Serial buffer size: " << port->readBufferSize();
|
||||
// qDebug(logSerial()) << "Serial buffer size: " << port->readBufferSize();
|
||||
//port->setReadBufferSize(1024); // manually. 256 never saw any return from the radio. why...
|
||||
//qDebug() << "Serial buffer size: " << port->readBufferSize();
|
||||
|
||||
|
||||
initializePt();
|
||||
//qDebug(logSerial()) << "Serial buffer size: " << port->readBufferSize();
|
||||
|
||||
connect(port, SIGNAL(readyRead()), this, SLOT(receiveDataIn()));
|
||||
connect(pseudoterm, SIGNAL(readyRead()), this, SLOT(receiveDataInPt())); // sometimes it seems the connection fails.
|
||||
|
||||
}
|
||||
|
||||
void commHandler::initializePt()
|
||||
{
|
||||
// qDebug() << "init pt";
|
||||
pseudoterm = new QSerialPort();
|
||||
setupPtComm();
|
||||
openPtPort();
|
||||
}
|
||||
|
||||
void commHandler::setupPtComm()
|
||||
{
|
||||
qDebug() << "Setting up Pseudo Term";
|
||||
pseudoterm->setPortName("/dev/ptmx");
|
||||
// pseudoterm->setBaudRate(baudrate);
|
||||
// pseudoterm->setStopBits(QSerialPort::OneStop);
|
||||
}
|
||||
|
||||
void commHandler::openPtPort()
|
||||
{
|
||||
// qDebug() << "opening pt port";
|
||||
bool success;
|
||||
char ptname[128];
|
||||
int sysResult=0;
|
||||
QString ptLinkCmd = "ln -s ";
|
||||
success = pseudoterm->open(QIODevice::ReadWrite);
|
||||
if(success)
|
||||
{
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
|
||||
qDebug() << "Opened pt device, attempting to grant pt status";
|
||||
ptfd = pseudoterm->handle();
|
||||
qDebug() << "ptfd: " << ptfd;
|
||||
if(grantpt(ptfd))
|
||||
{
|
||||
qDebug() << "Failed to grantpt";
|
||||
return;
|
||||
}
|
||||
if(unlockpt(ptfd))
|
||||
{
|
||||
qDebug() << "Failed to unlock pt";
|
||||
return;
|
||||
}
|
||||
// we're good!
|
||||
qDebug() << "Opened pseudoterminal.";
|
||||
qDebug() << "Slave name: " << ptsname(ptfd);
|
||||
|
||||
ptsname_r(ptfd, ptname, 128);
|
||||
ptDevSlave = QString::fromLocal8Bit(ptname);
|
||||
ptLinkCmd.append(ptDevSlave);
|
||||
ptLinkCmd.append(" /tmp/rig");
|
||||
sysResult = system("rm /tmp/rig");
|
||||
sysResult = system(ptLinkCmd.toStdString().c_str());
|
||||
if(sysResult)
|
||||
{
|
||||
qDebug() << "Received error from pseudo-terminal symlink command: code: [" << sysResult << "]" << " command: [" << ptLinkCmd << "]";
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
ptfd = 0;
|
||||
qDebug() << "Could not open pseudo-terminal.";
|
||||
}
|
||||
}
|
||||
|
||||
commHandler::~commHandler()
|
||||
{
|
||||
this->closePort();
|
||||
}
|
||||
|
||||
|
||||
void commHandler::setupComm()
|
||||
{
|
||||
serialError = false;
|
||||
|
@ -155,9 +84,12 @@ void commHandler::sendDataOut(const QByteArray &writeData)
|
|||
qint64 bytesWritten;
|
||||
|
||||
bytesWritten = port->write(writeData);
|
||||
qDebug() << "bytesWritten: " << bytesWritten << " length of byte array: " << writeData.length()\
|
||||
if(bytesWritten != (qint64)writeData.size())
|
||||
{
|
||||
qDebug(logSerial()) << "bytesWritten: " << bytesWritten << " length of byte array: " << writeData.length()\
|
||||
<< " size of byte array: " << writeData.size()\
|
||||
<< " Wrote all bytes? " << (bool) (bytesWritten == (qint64)writeData.size());
|
||||
}
|
||||
|
||||
#else
|
||||
port->write(writeData);
|
||||
|
@ -166,37 +98,6 @@ void commHandler::sendDataOut(const QByteArray &writeData)
|
|||
mutex.unlock();
|
||||
}
|
||||
|
||||
void commHandler::sendDataOutPt(const QByteArray &writeData)
|
||||
{
|
||||
ptMutex.lock();
|
||||
//printHex(writeData, false, true);
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
qint64 bytesWritten;
|
||||
bytesWritten = port->write(writeData);
|
||||
qDebug() << "pseudo-term bytesWritten: " << bytesWritten << " length of byte array: " << \
|
||||
writeData.length() << " size of byte array: " << writeData.size()\
|
||||
<< ", wrote all: " << (bool)(bytesWritten == (qint64)writeData.size());
|
||||
#else
|
||||
pseudoterm->write(writeData);
|
||||
#endif
|
||||
ptMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
void commHandler::receiveDataInPt()
|
||||
{
|
||||
// We received data from the pseudo-term.
|
||||
//qDebug() << "Sending data from pseudo-terminal to radio";
|
||||
// Send this data to the radio:
|
||||
//QByteArray ptdata = pseudoterm->readAll();
|
||||
// should check the data and rollback
|
||||
// for now though...
|
||||
//sendDataOut(ptdata);
|
||||
sendDataOut(pseudoterm->readAll());
|
||||
//qDebug() << "Returned from sendDataOut with pseudo-terminal send data.";
|
||||
}
|
||||
|
||||
void commHandler::receiveDataIn()
|
||||
{
|
||||
// connected to comm port data signal
|
||||
|
@ -214,35 +115,24 @@ void commHandler::receiveDataIn()
|
|||
// good!
|
||||
port->commitTransaction();
|
||||
emit haveDataFromPort(inPortData);
|
||||
if( (inPortData[2] == (char)0x00) || (inPortData[2] == (char)0xE0) || (inPortData[3] == (char)0xE0) )
|
||||
{
|
||||
// send to the pseudo port as well
|
||||
// index 2 is dest, 0xE1 is wfview, 0xE0 is assumed to be the other device.
|
||||
// Maybe change to "Not 0xE1"
|
||||
// 0xE1 = wfview
|
||||
// 0xE0 = pseudo-term host
|
||||
// 0x00 = broadcast to all
|
||||
//qDebug() << "Sending data from radio to pseudo-terminal";
|
||||
sendDataOutPt(inPortData);
|
||||
}
|
||||
|
||||
if(rolledBack)
|
||||
{
|
||||
// qDebug() << "Rolled back and was successfull. Length: " << inPortData.length();
|
||||
// qDebug(logSerial()) << "Rolled back and was successfull. Length: " << inPortData.length();
|
||||
//printHex(inPortData, false, true);
|
||||
rolledBack = false;
|
||||
}
|
||||
} else {
|
||||
// did not receive the entire thing so roll back:
|
||||
// qDebug() << "Rolling back transaction. End not detected. Lenth: " << inPortData.length();
|
||||
// qDebug(logSerial()) << "Rolling back transaction. End not detected. Lenth: " << inPortData.length();
|
||||
//printHex(inPortData, false, true);
|
||||
port->rollbackTransaction();
|
||||
rolledBack = true;
|
||||
}
|
||||
} else {
|
||||
port->commitTransaction(); // do not emit data, do not keep data.
|
||||
//qDebug() << "Warning: received data with invalid start. Dropping data.";
|
||||
//qDebug() << "THIS SHOULD ONLY HAPPEN ONCE!!";
|
||||
//qDebug(logSerial()) << "Warning: received data with invalid start. Dropping data.";
|
||||
//qDebug(logSerial()) << "THIS SHOULD ONLY HAPPEN ONCE!!";
|
||||
// THIS SHOULD ONLY HAPPEN ONCE!
|
||||
|
||||
// unrecoverable. We did not receive the start and must
|
||||
|
@ -262,40 +152,40 @@ void commHandler::openPort()
|
|||
if(success)
|
||||
{
|
||||
isConnected = true;
|
||||
//qDebug() << "Opened port!";
|
||||
qDebug(logSerial()) << "Opened port: " << portName;
|
||||
return;
|
||||
} else {
|
||||
// debug?
|
||||
qDebug() << "Could not open serial port " << portName << " , please restart.";
|
||||
qDebug(logSerial()) << "Could not open serial port " << portName << " , please restart.";
|
||||
isConnected = false;
|
||||
serialError = true;
|
||||
emit haveSerialPortError(portName, "Could not open port. Please restart.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void commHandler::closePort()
|
||||
{
|
||||
port->close();
|
||||
if(port)
|
||||
{
|
||||
port->close();
|
||||
delete port;
|
||||
}
|
||||
isConnected = false;
|
||||
}
|
||||
|
||||
void commHandler::debugThis()
|
||||
{
|
||||
// Do not use, function is for debug only and subject to change.
|
||||
qDebug() << "comm debug called.";
|
||||
qDebug(logSerial()) << "comm debug called.";
|
||||
|
||||
inPortData = port->readAll();
|
||||
emit haveDataFromPort(inPortData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void commHandler::printHex(const QByteArray &pdata, bool printVert, bool printHoriz)
|
||||
{
|
||||
qDebug() << "---- Begin hex dump -----:";
|
||||
qDebug(logSerial()) << "---- Begin hex dump -----:";
|
||||
QString sdata("DATA: ");
|
||||
QString index("INDEX: ");
|
||||
QStringList strings;
|
||||
|
@ -311,17 +201,16 @@ void commHandler::printHex(const QByteArray &pdata, bool printVert, bool printHo
|
|||
{
|
||||
for(int i=0; i < strings.length(); i++)
|
||||
{
|
||||
//sdata = QString(strings.at(i));
|
||||
qDebug() << strings.at(i);
|
||||
qDebug(logSerial()) << strings.at(i);
|
||||
}
|
||||
}
|
||||
|
||||
if(printHoriz)
|
||||
{
|
||||
qDebug() << index;
|
||||
qDebug() << sdata;
|
||||
qDebug(logSerial()) << index;
|
||||
qDebug(logSerial()) << sdata;
|
||||
}
|
||||
qDebug() << "----- End hex dump -----";
|
||||
qDebug(logSerial()) << "----- End hex dump -----";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ public:
|
|||
|
||||
private slots:
|
||||
void receiveDataIn(); // from physical port
|
||||
void receiveDataInPt(); // from pseudo-term
|
||||
void receiveDataFromUserToRig(const QByteArray &data);
|
||||
void debugThis();
|
||||
|
||||
|
@ -39,12 +38,7 @@ private:
|
|||
void openPort();
|
||||
void closePort();
|
||||
|
||||
void initializePt(); // like ch constructor
|
||||
void setupPtComm();
|
||||
void openPtPort();
|
||||
|
||||
void sendDataOut(const QByteArray &writeData); // out to radio
|
||||
void sendDataOutPt(const QByteArray &writeData); // out to pseudo-terminal
|
||||
void debugMe();
|
||||
void hexPrint();
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "freqmemory.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
// Copytight 2017-2020 Elliott H. Liggett
|
||||
|
||||
|
@ -60,6 +61,6 @@ void freqMemory::dumpMemory()
|
|||
{
|
||||
for(unsigned int p=0; p < numPresets; p++)
|
||||
{
|
||||
qDebug() << "Index: " << p << " freq: " << presets[p].frequency << " Mode: " << presets[p].mode << " isSet: " << presets[p].isSet;
|
||||
qDebug(logSystem()) << "Index: " << p << " freq: " << presets[p].frequency << " Mode: " << presets[p].mode << " isSet: " << presets[p].isSet;
|
||||
}
|
||||
}
|
||||
|
|
22
freqmemory.h
22
freqmemory.h
|
@ -9,16 +9,18 @@
|
|||
// modes << "FM" << "CW-R" << "RTTY-R" << "LSB-D" << "USB-D";
|
||||
|
||||
enum mode_kind {
|
||||
modeLSB=0,
|
||||
modeUSB,
|
||||
modeAM,
|
||||
modeCW,
|
||||
modeRTTY,
|
||||
modeFM,
|
||||
modeCW_R,
|
||||
modeRTTY_R,
|
||||
modeLSB_D,
|
||||
modeUSB_D
|
||||
modeLSB=0x00,
|
||||
modeUSB=0x01,
|
||||
modeAM=0x02,
|
||||
modeCW=0x03,
|
||||
modeRTTY=0x04,
|
||||
modeFM=0x05,
|
||||
modeCW_R=0x07,
|
||||
modeRTTY_R=0x08,
|
||||
modeLSB_D=0x80,
|
||||
modeUSB_D=0x81,
|
||||
modeDV=0x17,
|
||||
modeDD=0x27
|
||||
};
|
||||
|
||||
struct preset_kind {
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#include "logcategories.h"
|
||||
|
||||
Q_LOGGING_CATEGORY(logDebug, "Debug")
|
||||
Q_LOGGING_CATEGORY(logInfo, "Info")
|
||||
Q_LOGGING_CATEGORY(logWarning, "Warning")
|
||||
Q_LOGGING_CATEGORY(logCritical, "Critical")
|
||||
Q_LOGGING_CATEGORY(logSystem, "system")
|
||||
Q_LOGGING_CATEGORY(logSerial, "serial")
|
||||
Q_LOGGING_CATEGORY(logGui, "gui")
|
||||
Q_LOGGING_CATEGORY(logRig, "rig")
|
||||
Q_LOGGING_CATEGORY(logAudio, "audio")
|
||||
Q_LOGGING_CATEGORY(logUdp, "udp")
|
||||
Q_LOGGING_CATEGORY(logUdpServer, "udp.server")
|
||||
Q_LOGGING_CATEGORY(logRigCtlD, "rigctld")
|
||||
|
|
|
@ -3,9 +3,13 @@
|
|||
|
||||
#include <QLoggingCategory>
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(logDebug)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logInfo)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logWarning)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logCritical)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logSystem)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logSerial)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logGui)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logRig)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logAudio)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logUdp)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logUdpServer)
|
||||
Q_DECLARE_LOGGING_CATEGORY(logRigCtlD)
|
||||
|
||||
#endif // LOGCATEGORIES_H
|
||||
|
|
20
main.cpp
20
main.cpp
|
@ -1,6 +1,7 @@
|
|||
#include <QApplication>
|
||||
#include <iostream>
|
||||
#include "wfmain.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
// Copytight 2017-2021 Elliott H. Liggett
|
||||
|
||||
|
@ -15,8 +16,8 @@ int main(int argc, char *argv[])
|
|||
QApplication a(argc, argv);
|
||||
//a.setStyle( "Fusion" );
|
||||
|
||||
a.setOrganizationName("eliggett");
|
||||
a.setOrganizationDomain("nodomain");
|
||||
a.setOrganizationName("wfview");
|
||||
a.setOrganizationDomain("wfview.org");
|
||||
a.setApplicationName("wfview");
|
||||
|
||||
|
||||
|
@ -28,7 +29,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
QString currentArg;
|
||||
|
||||
const QString helpText = QString("Usage: -p --port /dev/port, -h --host remotehostname, -c --civ 0xAddr, -l --logfile filename.log"); // TODO...
|
||||
|
||||
const QString helpText = QString("\nUsage: -p --port /dev/port, -h --host remotehostname, -c --civ 0xAddr, -l --logfile filename.log\n"); // TODO...
|
||||
|
||||
for(int c=1; c<argc; c++)
|
||||
{
|
||||
|
@ -72,7 +74,8 @@ int main(int argc, char *argv[])
|
|||
} else {
|
||||
std::cout << "Unrecognized option: " << currentArg.toStdString();
|
||||
std::cout << helpText.toStdString();
|
||||
return -1;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -84,13 +87,13 @@ int main(int argc, char *argv[])
|
|||
// Set handler
|
||||
qInstallMessageHandler(messageHandler);
|
||||
|
||||
qDebug(logInfo()) << "Starting wfview";
|
||||
qInfo(logSystem()) << "Starting wfview";
|
||||
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
qDebug(logDebug()) << "SerialPortCL as set by parser: " << serialPortCL;
|
||||
qDebug(logDebug()) << "remote host as set by parser: " << hostCL;
|
||||
qDebug(logDebug()) << "CIV as set by parser: " << civCL;
|
||||
qInfo(logSystem()) << "SerialPortCL as set by parser: " << serialPortCL;
|
||||
qInfo(logSystem()) << "remote host as set by parser: " << hostCL;
|
||||
qInfo(logSystem()) << "CIV as set by parser: " << civCL;
|
||||
#endif
|
||||
a.setWheelScrollLines(1); // one line per wheel click
|
||||
wfmain w( serialPortCL, hostCL);
|
||||
|
@ -100,7 +103,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
|
||||
return a.exec();
|
||||
qDebug(logInfo()) << "wfview is finished";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,124 @@
|
|||
#include "meter.h"
|
||||
#include <QDebug>
|
||||
|
||||
meter::meter(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
//QPainter painter(this);
|
||||
|
||||
// Colors from qdarkstylesheet:
|
||||
// $COLOR_BACKGROUND_LIGHT: #505F69;
|
||||
// $COLOR_BACKGROUND_NORMAL: #32414B;
|
||||
// $COLOR_BACKGROUND_DARK: #19232D;
|
||||
// $COLOR_FOREGROUND_LIGHT: #F0F0F0; // grey
|
||||
// $COLOR_FOREGROUND_NORMAL: #AAAAAA; // grey
|
||||
// $COLOR_FOREGROUND_DARK: #787878; // grey
|
||||
// $COLOR_SELECTION_LIGHT: #148CD2;
|
||||
// $COLOR_SELECTION_NORMAL: #1464A0;
|
||||
// $COLOR_SELECTION_DARK: #14506E;
|
||||
|
||||
|
||||
// Colors I found that I liked from VFD images:
|
||||
// 3FB7CD
|
||||
// 3CA0DB
|
||||
//
|
||||
// Text in qdarkstylesheet seems to be #EFF0F1
|
||||
|
||||
currentColor.setNamedColor("#148CD2");
|
||||
currentColor = currentColor.darker();
|
||||
|
||||
peakColor.setNamedColor("#3CA0DB");
|
||||
peakColor = peakColor.lighter();
|
||||
|
||||
averageColor.setNamedColor("#3FB7CD");
|
||||
|
||||
lowTextColor.setNamedColor("#eff0f1");
|
||||
lowLineColor = lowTextColor;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void meter::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
// This next line sets up a canvis within the
|
||||
// space of the widget, and gives it corrdinates.
|
||||
// The end effect, is that the drawing functions will all
|
||||
// scale to the window size.
|
||||
|
||||
painter.setWindow(QRect(0, 0, 255+mstart, 50));
|
||||
drawScale(&painter);
|
||||
|
||||
// Current:
|
||||
painter.setPen(currentColor);
|
||||
painter.setBrush(currentColor);
|
||||
painter.drawRect(mstart,mheight,current,mstart);
|
||||
|
||||
// Average:
|
||||
painter.setPen(averageColor);
|
||||
painter.setBrush(averageColor);
|
||||
painter.drawRect(mstart+average-1,mheight,1,mstart);
|
||||
|
||||
// Peak:
|
||||
painter.setPen(peakColor);
|
||||
painter.setBrush(peakColor);
|
||||
if(peak > 120)
|
||||
{
|
||||
// 120 = +S9
|
||||
painter.setBrush(Qt::red);
|
||||
painter.setPen(Qt::red);
|
||||
}
|
||||
|
||||
painter.drawRect(mstart+peak-1,mheight,2,mstart);
|
||||
|
||||
}
|
||||
|
||||
void meter::setLevels(int current, int peak, int average)
|
||||
{
|
||||
this->current = current;
|
||||
this->peak = peak;
|
||||
this->average = average;
|
||||
this->update();
|
||||
}
|
||||
|
||||
void meter::updateDrawing(int num)
|
||||
{
|
||||
fontSize = num;
|
||||
length = num;
|
||||
}
|
||||
|
||||
|
||||
void meter::drawScale(QPainter *qp)
|
||||
{
|
||||
qp->setPen(lowTextColor);
|
||||
qp->setFont(QFont("Arial", fontSize));
|
||||
int i=mstart;
|
||||
// 13.3 DN per s-unit:
|
||||
int s=0;
|
||||
for(; i<mstart+120; i+=13)
|
||||
{
|
||||
qp->drawText(i,mstart, QString("%1").arg(s++) );
|
||||
}
|
||||
|
||||
// 2 DN per 1 dB now:
|
||||
// 20 DN per 10 dB
|
||||
// 40 DN per 20 dB
|
||||
|
||||
// Modify current scale position:
|
||||
s = 20;
|
||||
i+=20;
|
||||
|
||||
qp->setPen(Qt::red);
|
||||
|
||||
for(; i<mstart+255; i+=40)
|
||||
{
|
||||
qp->drawText(i,mstart, QString("+%1").arg(s) );
|
||||
s = s + 20;
|
||||
}
|
||||
|
||||
qp->setPen(lowLineColor);
|
||||
|
||||
qp->drawLine(mstart,12,130,12);
|
||||
qp->setPen(Qt::red);
|
||||
qp->drawLine(130,12,255,12);
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
#ifndef METER_H
|
||||
#define METER_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
|
||||
class meter : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit meter(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void paintEvent(QPaintEvent *);
|
||||
|
||||
void updateDrawing(int num);
|
||||
void setLevels(int current, int peak, int average);
|
||||
|
||||
|
||||
private:
|
||||
//QPainter painter;
|
||||
int fontSize = 5;
|
||||
int length=30;
|
||||
int current=0;
|
||||
int peak = 0;
|
||||
int average = 0;
|
||||
|
||||
int mstart = 10; // Starting point for S=0.
|
||||
int mheight = 14; // "thickness" of the meter block rectangle
|
||||
|
||||
void drawScale(QPainter *qp);
|
||||
|
||||
QColor currentColor;
|
||||
QColor averageColor;
|
||||
QColor peakColor;
|
||||
// S0-S9:
|
||||
QColor lowTextColor;
|
||||
QColor lowLineColor;
|
||||
// S9+:
|
||||
QColor highTextColor;
|
||||
QColor highLineColor;
|
||||
|
||||
};
|
||||
|
||||
#endif // METER_H
|
|
@ -0,0 +1,356 @@
|
|||
#ifndef PACKETTYPES_H
|
||||
#define PACKETTYPES_H
|
||||
#include <QObject>
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
// Fixed Size Packets
|
||||
#define CONTROL_SIZE 0x10
|
||||
#define WATCHDOG_SIZE 0x14
|
||||
#define PING_SIZE 0x15
|
||||
#define OPENCLOSE_SIZE 0x16
|
||||
#define RETRANSMIT_RANGE_SIZE 0x18
|
||||
#define TOKEN_SIZE 0x40
|
||||
#define STATUS_SIZE 0x50
|
||||
#define LOGIN_RESPONSE_SIZE 0x60
|
||||
#define LOGIN_SIZE 0x80
|
||||
#define CONNINFO_SIZE 0x90
|
||||
#define CAPABILITIES_SIZE 0xA8
|
||||
|
||||
// Variable size packets + payload
|
||||
#define CIV_SIZE 0x15
|
||||
#define AUDIO_SIZE 0x18
|
||||
#define DATA_SIZE 0x15
|
||||
|
||||
// 0x10 length control packet (connect/disconnect/idle.)
|
||||
typedef union control_packet {
|
||||
struct {
|
||||
quint32 len;
|
||||
quint16 type;
|
||||
quint16 seq;
|
||||
quint32 sentid;
|
||||
quint32 rcvdid;
|
||||
};
|
||||
char packet[CONTROL_SIZE];
|
||||
} *control_packet_t;
|
||||
|
||||
|
||||
// 0x14 length watchdog packet
|
||||
typedef union watchdog_packet {
|
||||
struct {
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
quint16 secondsa; // 0x10
|
||||
quint16 secondsb; // 0x12
|
||||
};
|
||||
char packet[WATCHDOG_SIZE];
|
||||
} *watchdog_packet_t;
|
||||
|
||||
|
||||
// 0x15 length ping packet
|
||||
// Also used for the slightly different civ header packet.
|
||||
typedef union ping_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
char reply; // 0x10
|
||||
union { // This contains differences between the send/receive packet
|
||||
struct { // Ping
|
||||
quint32 time; // 0x11
|
||||
};
|
||||
struct { // Send
|
||||
quint16 datalen; // 0x11
|
||||
quint16 sendseq; //0x13
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
char packet[PING_SIZE];
|
||||
} *ping_packet_t, * data_packet_t, data_packet;
|
||||
|
||||
// 0x16 length open/close packet
|
||||
typedef union openclose_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
quint16 data; // 0x10
|
||||
char unused; // 0x11
|
||||
quint16 sendseq; //0x13
|
||||
char magic; // 0x15
|
||||
|
||||
};
|
||||
char packet[OPENCLOSE_SIZE];
|
||||
} *startstop_packet_t;
|
||||
|
||||
|
||||
// 0x18 length audio packet
|
||||
typedef union audio_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
quint16 ident; // 0x10
|
||||
quint16 sendseq; // 0x12
|
||||
quint16 unused; // 0x14
|
||||
quint16 datalen; // 0x16
|
||||
};
|
||||
char packet[AUDIO_SIZE];
|
||||
} *audio_packet_t;
|
||||
|
||||
// 0x18 length retransmit_range packet
|
||||
typedef union retransmit_range_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
quint16 first; // 0x10
|
||||
quint16 second; // 0x12
|
||||
quint16 third; // 0x14
|
||||
quint16 fourth; // 0x16
|
||||
};
|
||||
char packet[RETRANSMIT_RANGE_SIZE];
|
||||
} *retransmit_range_packet_t;
|
||||
|
||||
|
||||
// 0x18 length txaudio packet
|
||||
/* tx[0] = static_cast<quint8>(tx.length() & 0xff);
|
||||
tx[1] = static_cast<quint8>(tx.length() >> 8 & 0xff);
|
||||
tx[18] = static_cast<quint8>(sendAudioSeq >> 8 & 0xff);
|
||||
tx[19] = static_cast<quint8>(sendAudioSeq & 0xff);
|
||||
tx[22] = static_cast<quint8>(partial.length() >> 8 & 0xff);
|
||||
tx[23] = static_cast<quint8>(partial.length() & 0xff);*/
|
||||
|
||||
|
||||
// 0x40 length token packet
|
||||
typedef union token_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
char unuseda[3]; // 0x10
|
||||
quint16 code; // 0x13
|
||||
quint16 res; // 0x15
|
||||
quint8 innerseq; // 0x17
|
||||
char unusedb; // 0x18
|
||||
char unusedc; // 0x19
|
||||
quint16 tokrequest; // 0x1a
|
||||
quint32 token; // 0x1c
|
||||
char unusedd[7]; // 0x20
|
||||
quint16 commoncap; // 0x27
|
||||
char unuseddd[2]; // 0x29
|
||||
char identa; // 0x2b
|
||||
quint32 identb; // 0x2c
|
||||
quint32 response; // 0x30
|
||||
char unusede[12]; // 0x34
|
||||
};
|
||||
char packet[TOKEN_SIZE];
|
||||
} *token_packet_t;
|
||||
|
||||
// 0x50 length login status packet
|
||||
typedef union status_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
char unuseda[3]; // 0x10
|
||||
quint16 code; // 0x13
|
||||
quint16 res; // 0x15
|
||||
quint8 innerseq; // 0x17
|
||||
char unusedb; // 0x18
|
||||
char unusedc; // 0x19
|
||||
quint16 tokrequest; // 0x1a
|
||||
quint32 token; // 0x1c
|
||||
char unusedd[6]; // 0x20
|
||||
quint16 unknown; // 0x26
|
||||
char unusede; // 0x28
|
||||
char unusedf[2]; // 0x29
|
||||
char identa; // 0x2b
|
||||
quint32 identb; // 0x2c
|
||||
quint32 error; // 0x30
|
||||
char unusedg[12]; // 0x34
|
||||
char disc; // 0x40
|
||||
char unusedh; // 0x41
|
||||
quint16 civport; // 0x42 // Sent bigendian
|
||||
quint16 unusedi; // 0x44 // Sent bigendian
|
||||
quint16 audioport; // 0x46 // Sent bigendian
|
||||
char unusedj[7]; // 0x49
|
||||
};
|
||||
char packet[STATUS_SIZE];
|
||||
} *status_packet_t;
|
||||
|
||||
// 0x60 length login status packet
|
||||
typedef union login_response_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
char unuseda[3]; // 0x10
|
||||
quint16 code; // 0x13
|
||||
quint16 res; // 0x15
|
||||
quint8 innerseq; // 0x17
|
||||
char unusedb; // 0x18
|
||||
char unusedc; // 0x19
|
||||
quint16 tokrequest; // 0x1a
|
||||
quint32 token; // 0x1c
|
||||
quint16 authstartid; // 0x20
|
||||
char unusedd[14]; // 0x22
|
||||
quint32 error; // 0x30
|
||||
char unusede[12]; // 0x34
|
||||
char connection[16]; // 0x40
|
||||
char unusedf[16]; // 0x50
|
||||
};
|
||||
char packet[LOGIN_RESPONSE_SIZE];
|
||||
} *login_response_packet_t;
|
||||
|
||||
// 0x80 length login packet
|
||||
typedef union login_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
char unuseda[3]; // 0x10
|
||||
quint16 code; // 0x13
|
||||
quint16 res; // 0x15
|
||||
quint8 innerseq; // 0x17
|
||||
char unusedaa; // 0x18;
|
||||
char unusedb; // 0x19
|
||||
quint16 tokrequest; // 0x1a
|
||||
quint32 token; // 0x1c
|
||||
char unusedc[32]; // 0x20
|
||||
char username[16]; // 0x40
|
||||
char password[16]; // 0x50
|
||||
char name[16]; // 0x60
|
||||
char unusedf[16]; // 0x70
|
||||
};
|
||||
char packet[LOGIN_SIZE];
|
||||
} *login_packet_t;
|
||||
|
||||
// 0x90 length conninfo and stream request packet
|
||||
typedef union conninfo_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
char unuseda[3]; // 0x10
|
||||
quint16 code; // 0x13
|
||||
quint16 res; // 0x15
|
||||
quint8 innerseq; // 0x17
|
||||
char unusedaa; // 0x18
|
||||
char unusedb; // 0x19
|
||||
quint16 tokrequest; // 0x1a
|
||||
quint32 token; // 0x1c
|
||||
quint16 authstartid; // 0x20
|
||||
char unusedd[5]; // 0x22
|
||||
quint32 commoncap; // 0x27
|
||||
char identa; // 0x2b
|
||||
quint32 identb; // 0x2c
|
||||
char unusedf[16]; // 0x30
|
||||
char name[16]; // 0x40
|
||||
char unusedg[16]; // 0x50
|
||||
union { // This contains differences between the send/receive packet
|
||||
struct { // Receive
|
||||
quint32 busy; // 0x60
|
||||
char computer[16]; // 0x64
|
||||
char unusedi[16]; // 0x74
|
||||
quint32 ipaddress; // 0x84
|
||||
char unusedj[8]; // 0x78
|
||||
};
|
||||
struct { // Send
|
||||
char username[16]; // 0x60
|
||||
char rxenable; // 0x70
|
||||
char txenable; // 0x71
|
||||
char rxcodec; // 0x72
|
||||
char txcodec; // 0x73
|
||||
quint32 rxsample; // 0x74
|
||||
quint32 txsample; // 0x78
|
||||
quint32 civport; // 0x7c
|
||||
quint32 audioport; // 0x80
|
||||
quint32 txbuffer; // 0x84
|
||||
quint8 convert; // 0x88
|
||||
char unusedl[7]; // 0x89
|
||||
};
|
||||
};
|
||||
};
|
||||
char packet[CONNINFO_SIZE];
|
||||
} *conninfo_packet_t;
|
||||
|
||||
// 0xA8 length capabilities packet
|
||||
typedef union capabilities_packet {
|
||||
struct
|
||||
{
|
||||
quint32 len; // 0x00
|
||||
quint16 type; // 0x04
|
||||
quint16 seq; // 0x06
|
||||
quint32 sentid; // 0x08
|
||||
quint32 rcvdid; // 0x0c
|
||||
char unuseda[3]; // 0x10
|
||||
quint16 code; // 0x13
|
||||
quint16 res; // 0x15
|
||||
quint8 innerseq; // 0x17
|
||||
char unusedb; // 0x18
|
||||
char unusedc; // 0x19
|
||||
quint16 tokrequest; // 0x1a
|
||||
quint32 token; // 0x1c
|
||||
char unusedd[33]; // 0x20
|
||||
char capa; // 0x41
|
||||
char unusede[7]; // 0x42
|
||||
quint16 commoncap; // 0x49
|
||||
char unused; // 0x4b
|
||||
char macaddress[6]; // 0x4c
|
||||
char name[32]; // 0x52
|
||||
char audio[32]; // 0x72
|
||||
quint16 conntype; // 0x92
|
||||
char civ; // 0x94
|
||||
quint16 rxsample; // 0x95
|
||||
quint16 txsample; // 0x97
|
||||
quint8 enablea; // 0x99
|
||||
quint8 enableb; // 0x9a
|
||||
quint8 enablec; // 0x9b
|
||||
quint32 baudrate; // 0x9c
|
||||
quint16 capf; // 0xa0
|
||||
char unusedi; // 0xa2
|
||||
quint16 capg; // 0xa3
|
||||
char unusedj[3]; // 0xa5
|
||||
};
|
||||
char packet[CAPABILITIES_SIZE];
|
||||
} *capabilities_packet_t;
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
#endif // PACKETTYPES_H
|
|
@ -0,0 +1,286 @@
|
|||
#include "pttyhandler.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
// Copyright 2017-2021 Elliott H. Liggett & Phil Taylor
|
||||
|
||||
pttyHandler::pttyHandler()
|
||||
{
|
||||
//constructor
|
||||
// grab baud rate and other comm port details
|
||||
// if they need to be changed later, please
|
||||
// destroy this and create a new one.
|
||||
port = new QSerialPort();
|
||||
|
||||
// TODO: The following should become arguments and/or functions
|
||||
// Add signal/slot everywhere for comm port setup.
|
||||
// Consider how to "re-setup" and how to save the state for next time.
|
||||
baudRate = 115200;
|
||||
stopBits = 1;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
portName = "COM20";
|
||||
#else
|
||||
portName = "/dev/ptmx";
|
||||
#endif
|
||||
setupPtty(); // basic parameters
|
||||
openPort();
|
||||
//qDebug(logSerial()) << "Serial buffer size: " << port->readBufferSize();
|
||||
//port->setReadBufferSize(1024); // manually. 256 never saw any return from the radio. why...
|
||||
//qDebug(logSerial()) << "Serial buffer size: " << port->readBufferSize();
|
||||
|
||||
connect(port, SIGNAL(readyRead()), this, SLOT(receiveDataIn()));
|
||||
}
|
||||
|
||||
pttyHandler::pttyHandler(QString portName, quint32 baudRate)
|
||||
{
|
||||
//constructor
|
||||
// grab baud rate and other comm port details
|
||||
// if they need to be changed later, please
|
||||
// destroy this and create a new one.
|
||||
|
||||
port = new QSerialPort();
|
||||
|
||||
this->portName = portName;
|
||||
this->baudRate = baudRate;
|
||||
|
||||
setupPtty(); // basic parameters
|
||||
openPort();
|
||||
|
||||
// TODO: The following should become arguments and/or functions
|
||||
// Add signal/slot everywhere for comm port setup.
|
||||
// Consider how to "re-setup" and how to save the state for next time.
|
||||
// qDebug(logSerial()) << "Serial buffer size: " << port->readBufferSize();
|
||||
//port->setReadBufferSize(1024); // manually. 256 never saw any return from the radio. why...
|
||||
//qDebug(logSerial()) << "Serial buffer size: " << port->readBufferSize();
|
||||
|
||||
connect(port, SIGNAL(readyRead()), this, SLOT(receiveDataIn()));
|
||||
}
|
||||
|
||||
void pttyHandler::setupPtty()
|
||||
{
|
||||
qDebug(logSerial()) << "Setting up Pseudo Term";
|
||||
serialError = false;
|
||||
port->setPortName(portName);
|
||||
#ifdef Q_OS_WIN
|
||||
port->setBaudRate(baudRate);
|
||||
port->setStopBits(QSerialPort::OneStop);// OneStop is other option
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void pttyHandler::openPort()
|
||||
{
|
||||
// qDebug(logSerial()) << "opening pt port";
|
||||
bool success;
|
||||
#ifndef Q_OS_WIN
|
||||
char ptname[128];
|
||||
int sysResult = 0;
|
||||
QString ptLinkCmd = "ln -s ";
|
||||
#endif
|
||||
success = port->open(QIODevice::ReadWrite);
|
||||
if (success)
|
||||
{
|
||||
#ifndef Q_OS_WIN
|
||||
|
||||
qDebug(logSerial()) << "Opened pt device, attempting to grant pt status";
|
||||
ptfd = port->handle();
|
||||
qDebug(logSerial()) << "ptfd: " << ptfd;
|
||||
if (grantpt(ptfd))
|
||||
{
|
||||
qDebug(logSerial()) << "Failed to grantpt";
|
||||
return;
|
||||
}
|
||||
if (unlockpt(ptfd))
|
||||
{
|
||||
qDebug(logSerial()) << "Failed to unlock pt";
|
||||
return;
|
||||
}
|
||||
// we're good!
|
||||
qDebug(logSerial()) << "Opened pseudoterminal.";
|
||||
qDebug(logSerial()) << "Slave name: " << ptsname(ptfd);
|
||||
|
||||
ptsname_r(ptfd, ptname, 128);
|
||||
ptDevSlave = QString::fromLocal8Bit(ptname);
|
||||
ptLinkCmd.append(ptDevSlave);
|
||||
ptLinkCmd.append(" /tmp/rig");
|
||||
sysResult = system("rm /tmp/rig");
|
||||
sysResult = system(ptLinkCmd.toStdString().c_str());
|
||||
if (sysResult)
|
||||
{
|
||||
qDebug(logSerial()) << "Received error from pseudo-terminal symlink command: code: [" << sysResult << "]" << " command: [" << ptLinkCmd << "]";
|
||||
}
|
||||
|
||||
isConnected = true;
|
||||
#endif
|
||||
|
||||
}
|
||||
else {
|
||||
ptfd = 0;
|
||||
qDebug(logSerial()) << "Could not open pseudo terminal port " << portName << " , please restart.";
|
||||
isConnected = false;
|
||||
serialError = true;
|
||||
emit haveSerialPortError(portName, "Could not open pseudo terminal port. Please restart.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
pttyHandler::~pttyHandler()
|
||||
{
|
||||
this->closePort();
|
||||
}
|
||||
|
||||
void pttyHandler::receiveDataFromRigToPtty(const QByteArray& data)
|
||||
{
|
||||
if ((unsigned char)data[2] != (unsigned char)0xE1 && (unsigned char)data[3] != (unsigned char)0xE1)
|
||||
{
|
||||
// send to the pseudo port as well
|
||||
// index 2 is dest, 0xE1 is wfview, 0xE0 is assumed to be the other device.
|
||||
// Changed to "Not 0xE1"
|
||||
// 0xE1 = wfview
|
||||
// 0xE0 = pseudo-term host
|
||||
// 0x00 = broadcast to all
|
||||
//qDebug(logSerial()) << "Sending data from radio to pseudo-terminal";
|
||||
sendDataOut(data);
|
||||
}
|
||||
}
|
||||
|
||||
void pttyHandler::sendDataOut(const QByteArray& writeData)
|
||||
{
|
||||
qint64 bytesWritten = 0;
|
||||
|
||||
//qDebug(logSerial()) << "Data to pseudo term:";
|
||||
//printHex(writeData, false, true);
|
||||
|
||||
mutex.lock();
|
||||
|
||||
bytesWritten = port->write(writeData);
|
||||
if (bytesWritten != writeData.length()) {
|
||||
qDebug(logSerial()) << "bytesWritten: " << bytesWritten << " length of byte array: " << writeData.length()\
|
||||
<< " size of byte array: " << writeData.size()\
|
||||
<< " Wrote all bytes? " << (bool)(bytesWritten == (qint64)writeData.size());
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
void pttyHandler::receiveDataIn()
|
||||
{
|
||||
// connected to comm port data signal
|
||||
|
||||
// Here we get a little specific to CIV radios
|
||||
// because we know what constitutes a valid "frame" of data.
|
||||
|
||||
// new code:
|
||||
port->startTransaction();
|
||||
inPortData = port->readAll();
|
||||
if (inPortData.startsWith("\xFE\xFE"))
|
||||
{
|
||||
if (inPortData.endsWith("\xFD"))
|
||||
{
|
||||
// good!
|
||||
port->commitTransaction();
|
||||
|
||||
// filter 1A 05 01 12/27 = C-IV transceive command before forwarding on.
|
||||
if (inPortData.contains(QByteArrayLiteral("\x1a\x05\x01\x12")) || inPortData.contains(QByteArrayLiteral("\x1a\x05\x01\x27")))
|
||||
{
|
||||
//qDebug(logSerial()) << "Filtered transceive command";
|
||||
//printHex(inPortData, false, true);
|
||||
QByteArray reply= QByteArrayLiteral("\xfe\xfe\x00\x00\xfb\xfd");
|
||||
reply[2] = inPortData[3];
|
||||
reply[3] = inPortData[2];
|
||||
sendDataOut(inPortData); // Echo command back
|
||||
sendDataOut(reply);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit haveDataFromPort(inPortData);
|
||||
//qDebug(logSerial()) << "Data from pseudo term:";
|
||||
//printHex(inPortData, false, true);
|
||||
}
|
||||
|
||||
if (rolledBack)
|
||||
{
|
||||
// qDebug(logSerial()) << "Rolled back and was successfull. Length: " << inPortData.length();
|
||||
//printHex(inPortData, false, true);
|
||||
rolledBack = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// did not receive the entire thing so roll back:
|
||||
// qDebug(logSerial()) << "Rolling back transaction. End not detected. Lenth: " << inPortData.length();
|
||||
//printHex(inPortData, false, true);
|
||||
port->rollbackTransaction();
|
||||
rolledBack = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
port->commitTransaction(); // do not emit data, do not keep data.
|
||||
//qDebug(logSerial()) << "Warning: received data with invalid start. Dropping data.";
|
||||
//qDebug(logSerial()) << "THIS SHOULD ONLY HAPPEN ONCE!!";
|
||||
// THIS SHOULD ONLY HAPPEN ONCE!
|
||||
|
||||
// unrecoverable. We did not receive the start and must
|
||||
// have missed it earlier because we did not roll back to
|
||||
// preserve the beginning.
|
||||
|
||||
//printHex(inPortData, false, true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void pttyHandler::closePort()
|
||||
{
|
||||
if (port)
|
||||
{
|
||||
port->close();
|
||||
delete port;
|
||||
}
|
||||
isConnected = false;
|
||||
}
|
||||
|
||||
|
||||
void pttyHandler::debugThis()
|
||||
{
|
||||
// Do not use, function is for debug only and subject to change.
|
||||
qDebug(logSerial()) << "comm debug called.";
|
||||
|
||||
inPortData = port->readAll();
|
||||
emit haveDataFromPort(inPortData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pttyHandler::printHex(const QByteArray& pdata, bool printVert, bool printHoriz)
|
||||
{
|
||||
qDebug(logSerial()) << "---- Begin hex dump -----:";
|
||||
QString sdata("DATA: ");
|
||||
QString index("INDEX: ");
|
||||
QStringList strings;
|
||||
|
||||
for (int i = 0; i < pdata.length(); i++)
|
||||
{
|
||||
strings << QString("[%1]: %2").arg(i, 8, 10, QChar('0')).arg((unsigned char)pdata[i], 2, 16, QChar('0'));
|
||||
sdata.append(QString("%1 ").arg((unsigned char)pdata[i], 2, 16, QChar('0')));
|
||||
index.append(QString("%1 ").arg(i, 2, 10, QChar('0')));
|
||||
}
|
||||
|
||||
if (printVert)
|
||||
{
|
||||
for (int i = 0; i < strings.length(); i++)
|
||||
{
|
||||
//sdata = QString(strings.at(i));
|
||||
qDebug(logSerial()) << strings.at(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (printHoriz)
|
||||
{
|
||||
qDebug(logSerial()) << index;
|
||||
qDebug(logSerial()) << sdata;
|
||||
}
|
||||
qDebug(logSerial()) << "----- End hex dump -----";
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef PTTYHANDLER_H
|
||||
#define PTTYHANDLER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <QMutex>
|
||||
#include <QDataStream>
|
||||
#include <QtSerialPort/QSerialPort>
|
||||
|
||||
// This class abstracts the comm port in a useful way and connects to
|
||||
// the command creator and command parser.
|
||||
|
||||
class pttyHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
pttyHandler();
|
||||
pttyHandler(QString portName, quint32 baudRate);
|
||||
bool serialError;
|
||||
|
||||
~pttyHandler();
|
||||
|
||||
private slots:
|
||||
void receiveDataIn(); // from physical port
|
||||
void receiveDataFromRigToPtty(const QByteArray& data);
|
||||
void debugThis();
|
||||
|
||||
signals:
|
||||
void haveTextMessage(QString message); // status, debug only
|
||||
void haveDataFromPort(QByteArray data); // emit this when we have data, connect to rigcommander
|
||||
void haveSerialPortError(const QString port, const QString error);
|
||||
void haveStatusUpdate(const QString text);
|
||||
|
||||
private:
|
||||
void setupPtty();
|
||||
void openPort();
|
||||
void closePort();
|
||||
|
||||
void sendDataOut(const QByteArray& writeData); // out to radio
|
||||
void debugMe();
|
||||
void hexPrint();
|
||||
|
||||
//QDataStream stream;
|
||||
QByteArray outPortData;
|
||||
QByteArray inPortData;
|
||||
|
||||
//QDataStream outStream;
|
||||
//QDataStream inStream;
|
||||
|
||||
unsigned char buffer[256];
|
||||
|
||||
QString portName;
|
||||
QSerialPort* port;
|
||||
qint32 baudRate;
|
||||
unsigned char stopBits;
|
||||
bool rolledBack;
|
||||
|
||||
int ptfd; // pseudo-terminal file desc.
|
||||
bool havePt;
|
||||
QString ptDevSlave;
|
||||
|
||||
bool isConnected; // port opened
|
||||
mutable QMutex mutex;
|
||||
void printHex(const QByteArray& pdata, bool printVert, bool printHoriz);
|
||||
|
||||
};
|
||||
|
||||
#endif // PTTYHANDLER_H
|
|
@ -0,0 +1,41 @@
|
|||
#include "qledlabel.h"
|
||||
#include <QDebug>
|
||||
|
||||
static const int SIZE = 16;
|
||||
static const QString greenSS = QString("color: white;border-radius: %1;background-color: qlineargradient(spread:pad, x1:0.145, y1:0.16, x2:1, y2:1, stop:0 rgba(20, 252, 7, 255), stop:1 rgba(25, 134, 5, 255));").arg(SIZE / 2);
|
||||
static const QString redSS = QString("color: white;border-radius: %1;background-color: qlineargradient(spread:pad, x1:0.145, y1:0.16, x2:0.92, y2:0.988636, stop:0 rgba(255, 12, 12, 255), stop:0.869347 rgba(103, 0, 0, 255));").arg(SIZE / 2);
|
||||
static const QString orangeSS = QString("color: white;border-radius: %1;background-color: qlineargradient(spread:pad, x1:0.232, y1:0.272, x2:0.98, y2:0.959773, stop:0 rgba(255, 113, 4, 255), stop:1 rgba(91, 41, 7, 255))").arg(SIZE / 2);
|
||||
static const QString blueSS = QString("color: white;border-radius: %1;background-color: qlineargradient(spread:pad, x1:0.04, y1:0.0565909, x2:0.799, y2:0.795, stop:0 rgba(203, 220, 255, 255), stop:0.41206 rgba(0, 115, 255, 255), stop:1 rgba(0, 49, 109, 255));").arg(SIZE / 2);
|
||||
|
||||
QLedLabel::QLedLabel(QWidget* parent) :
|
||||
QLabel(parent)
|
||||
{
|
||||
//Set to ok by default
|
||||
setState(StateOkBlue);
|
||||
setFixedSize(SIZE, SIZE);
|
||||
}
|
||||
|
||||
void QLedLabel::setState(State state)
|
||||
{
|
||||
qDebug() << "setState" << state;
|
||||
switch (state) {
|
||||
case StateOk:
|
||||
setStyleSheet(greenSS);
|
||||
break;
|
||||
case StateWarning:
|
||||
setStyleSheet(orangeSS);
|
||||
break;
|
||||
case StateError:
|
||||
setStyleSheet(redSS);
|
||||
break;
|
||||
case StateOkBlue:
|
||||
default:
|
||||
setStyleSheet(blueSS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void QLedLabel::setState(bool state)
|
||||
{
|
||||
setState(state ? StateOk : StateError);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef QLEDLABEL_H
|
||||
#define QLEDLABEL_H
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
class QLedLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QLedLabel(QWidget* parent = 0);
|
||||
|
||||
enum State {
|
||||
StateOk,
|
||||
StateOkBlue,
|
||||
StateWarning,
|
||||
StateError
|
||||
};
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void setState(State state);
|
||||
void setState(bool state);
|
||||
};
|
||||
|
||||
#endif // QLEDLABEL_H
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef REPEATERATTRIBUTES_H
|
||||
#define REPEATERATTRIBUTES_H
|
||||
#include <QMetaType>
|
||||
|
||||
enum duplexMode {
|
||||
dmSplitOff=0x00,
|
||||
dmSplitOn=0x01,
|
||||
dmSimplex=0x10,
|
||||
dmDupMinus=0x11,
|
||||
dmDupPlus=0x12,
|
||||
dmDupRPS=0x13,
|
||||
dmDupAutoOn=0x26,
|
||||
dmDupAutoOff=0x36
|
||||
};
|
||||
|
||||
// Here, T=tone, D=DCS, N=none
|
||||
// And the naming convention order is Transmit Receive
|
||||
enum rptAccessTxRx {
|
||||
ratrNN=0x00,
|
||||
ratrTN=0x01, // "TONE" (T only)
|
||||
ratrNT=0x02, // "TSQL" (R only)
|
||||
ratrDD=0x03, // "DTCS" (TR)
|
||||
ratrDN=0x06, // "DTCS(T)"
|
||||
ratrTD=0x07, // "TONE(T) / TSQL(R)"
|
||||
ratrDT=0x08, // "DTCS(T) / TSQL(R)"
|
||||
ratrTT=0x09 // "TONE(T) / TSQL(R)"
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(enum duplexMode)
|
||||
Q_DECLARE_METATYPE(enum rptAccessTxRx)
|
||||
|
||||
#endif // REPEATERATTRIBUTES_H
|
|
@ -0,0 +1,397 @@
|
|||
#include "repeatersetup.h"
|
||||
#include "ui_repeatersetup.h"
|
||||
|
||||
repeaterSetup::repeaterSetup(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::repeaterSetup)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// populate the CTCSS combo box:
|
||||
populateTones();
|
||||
|
||||
// populate the DCS combo box:
|
||||
populateDTCS();
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
ui->debugBtn->setVisible(true);
|
||||
ui->rptReadRigBtn->setVisible(true);
|
||||
#else
|
||||
ui->debugBtn->setVisible(false);
|
||||
ui->rptReadRigBtn->setVisible(false);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
repeaterSetup::~repeaterSetup()
|
||||
{
|
||||
// Trying this for more consistant destruction
|
||||
rig.inputs.clear();
|
||||
rig.preamps.clear();
|
||||
rig.attenuators.clear();
|
||||
rig.antennas.clear();
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void repeaterSetup::setRig(rigCapabilities inRig)
|
||||
{
|
||||
this->rig = inRig;
|
||||
haveRig = true;
|
||||
if(rig.hasCTCSS)
|
||||
{
|
||||
ui->rptToneCombo->setDisabled(false);
|
||||
ui->toneTone->setDisabled(false);
|
||||
ui->toneTSQL->setDisabled(false);
|
||||
} else {
|
||||
ui->rptToneCombo->setDisabled(true);
|
||||
ui->toneTone->setDisabled(true);
|
||||
ui->toneTSQL->setDisabled(true);
|
||||
}
|
||||
|
||||
if(rig.hasDTCS)
|
||||
{
|
||||
ui->rptDTCSCombo->setDisabled(false);
|
||||
ui->toneDTCS->setDisabled(false);
|
||||
ui->rptDTCSInvertRx->setDisabled(false);
|
||||
ui->rptDTCSInvertTx->setDisabled(false);
|
||||
} else {
|
||||
ui->rptDTCSCombo->setDisabled(true);
|
||||
ui->toneDTCS->setDisabled(true);
|
||||
ui->rptDTCSInvertRx->setDisabled(true);
|
||||
ui->rptDTCSInvertTx->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void repeaterSetup::populateTones()
|
||||
{
|
||||
ui->rptToneCombo->addItem("67.0", quint16(670));
|
||||
ui->rptToneCombo->addItem("69.3", quint16(693));
|
||||
ui->rptToneCombo->addItem("71.9", quint16(719));
|
||||
ui->rptToneCombo->addItem("74.4", quint16(744));
|
||||
ui->rptToneCombo->addItem("77.0", quint16(770));
|
||||
ui->rptToneCombo->addItem("79.7", quint16(797));
|
||||
ui->rptToneCombo->addItem("82.5", quint16(825));
|
||||
ui->rptToneCombo->addItem("85.4", quint16(854));
|
||||
ui->rptToneCombo->addItem("88.5", quint16(885));
|
||||
ui->rptToneCombo->addItem("91.5", quint16(915));
|
||||
ui->rptToneCombo->addItem("94.8", quint16(948));
|
||||
ui->rptToneCombo->addItem("97.4", quint16(974));
|
||||
ui->rptToneCombo->addItem("100.0", quint16(1000));
|
||||
ui->rptToneCombo->addItem("103.5", quint16(1035));
|
||||
ui->rptToneCombo->addItem("107.2", quint16(1072));
|
||||
ui->rptToneCombo->addItem("110.9", quint16(1109));
|
||||
ui->rptToneCombo->addItem("114.8", quint16(1148));
|
||||
ui->rptToneCombo->addItem("118.8", quint16(1188));
|
||||
ui->rptToneCombo->addItem("123.0", quint16(1230));
|
||||
ui->rptToneCombo->addItem("127.3", quint16(1273));
|
||||
ui->rptToneCombo->addItem("131.8", quint16(1318));
|
||||
ui->rptToneCombo->addItem("136.5", quint16(1365));
|
||||
ui->rptToneCombo->addItem("141.3", quint16(1413));
|
||||
ui->rptToneCombo->addItem("146.2", quint16(1462));
|
||||
ui->rptToneCombo->addItem("151.4", quint16(1514));
|
||||
ui->rptToneCombo->addItem("156.7", quint16(1567));
|
||||
ui->rptToneCombo->addItem("159.8", quint16(1598));
|
||||
ui->rptToneCombo->addItem("162.2", quint16(1622));
|
||||
ui->rptToneCombo->addItem("165.5", quint16(1655));
|
||||
ui->rptToneCombo->addItem("167.9", quint16(1679));
|
||||
ui->rptToneCombo->addItem("171.3", quint16(1713));
|
||||
ui->rptToneCombo->addItem("173.8", quint16(1738));
|
||||
ui->rptToneCombo->addItem("177.3", quint16(1773));
|
||||
ui->rptToneCombo->addItem("179.9", quint16(1799));
|
||||
ui->rptToneCombo->addItem("183.5", quint16(1835));
|
||||
ui->rptToneCombo->addItem("186.2", quint16(1862));
|
||||
ui->rptToneCombo->addItem("189.9", quint16(1899));
|
||||
ui->rptToneCombo->addItem("192.8", quint16(1928));
|
||||
ui->rptToneCombo->addItem("196.6", quint16(1966));
|
||||
ui->rptToneCombo->addItem("199.5", quint16(1995));
|
||||
ui->rptToneCombo->addItem("203.5", quint16(2035));
|
||||
ui->rptToneCombo->addItem("206.5", quint16(2065));
|
||||
ui->rptToneCombo->addItem("210.7", quint16(2107));
|
||||
ui->rptToneCombo->addItem("218.1", quint16(2181));
|
||||
ui->rptToneCombo->addItem("225.7", quint16(2257));
|
||||
ui->rptToneCombo->addItem("229.1", quint16(2291));
|
||||
ui->rptToneCombo->addItem("233.6", quint16(2336));
|
||||
ui->rptToneCombo->addItem("241.8", quint16(2418));
|
||||
ui->rptToneCombo->addItem("250.3", quint16(2503));
|
||||
ui->rptToneCombo->addItem("254.1", quint16(2541));
|
||||
}
|
||||
|
||||
void repeaterSetup::populateDTCS()
|
||||
{
|
||||
ui->rptDTCSCombo->addItem("023", quint16(23));
|
||||
ui->rptDTCSCombo->addItem("025", quint16(25));
|
||||
ui->rptDTCSCombo->addItem("026", quint16(26));
|
||||
ui->rptDTCSCombo->addItem("031", quint16(31));
|
||||
ui->rptDTCSCombo->addItem("032", quint16(32));
|
||||
ui->rptDTCSCombo->addItem("036", quint16(36));
|
||||
ui->rptDTCSCombo->addItem("043", quint16(43));
|
||||
ui->rptDTCSCombo->addItem("047", quint16(47));
|
||||
ui->rptDTCSCombo->addItem("051", quint16(51));
|
||||
ui->rptDTCSCombo->addItem("053", quint16(53));
|
||||
ui->rptDTCSCombo->addItem("054", quint16(54));
|
||||
ui->rptDTCSCombo->addItem("065", quint16(65));
|
||||
ui->rptDTCSCombo->addItem("071", quint16(71));
|
||||
ui->rptDTCSCombo->addItem("072", quint16(72));
|
||||
ui->rptDTCSCombo->addItem("073", quint16(73));
|
||||
ui->rptDTCSCombo->addItem("074", quint16(74));
|
||||
|
||||
ui->rptDTCSCombo->addItem("114", quint16(114));
|
||||
ui->rptDTCSCombo->addItem("115", quint16(115));
|
||||
ui->rptDTCSCombo->addItem("116", quint16(116));
|
||||
ui->rptDTCSCombo->addItem("122", quint16(122));
|
||||
ui->rptDTCSCombo->addItem("125", quint16(125));
|
||||
ui->rptDTCSCombo->addItem("131", quint16(131));
|
||||
ui->rptDTCSCombo->addItem("132", quint16(132));
|
||||
ui->rptDTCSCombo->addItem("134", quint16(134));
|
||||
ui->rptDTCSCombo->addItem("143", quint16(143));
|
||||
ui->rptDTCSCombo->addItem("145", quint16(145));
|
||||
ui->rptDTCSCombo->addItem("152", quint16(152));
|
||||
ui->rptDTCSCombo->addItem("155", quint16(155));
|
||||
ui->rptDTCSCombo->addItem("156", quint16(156));
|
||||
ui->rptDTCSCombo->addItem("162", quint16(162));
|
||||
ui->rptDTCSCombo->addItem("165", quint16(165));
|
||||
ui->rptDTCSCombo->addItem("172", quint16(172));
|
||||
ui->rptDTCSCombo->addItem("174", quint16(174));
|
||||
|
||||
ui->rptDTCSCombo->addItem("205", quint16(205));
|
||||
ui->rptDTCSCombo->addItem("212", quint16(212));
|
||||
ui->rptDTCSCombo->addItem("223", quint16(223));
|
||||
ui->rptDTCSCombo->addItem("225", quint16(225));
|
||||
ui->rptDTCSCombo->addItem("226", quint16(226));
|
||||
ui->rptDTCSCombo->addItem("243", quint16(243));
|
||||
ui->rptDTCSCombo->addItem("244", quint16(244));
|
||||
ui->rptDTCSCombo->addItem("245", quint16(245));
|
||||
ui->rptDTCSCombo->addItem("246", quint16(246));
|
||||
ui->rptDTCSCombo->addItem("251", quint16(251));
|
||||
ui->rptDTCSCombo->addItem("252", quint16(252));
|
||||
ui->rptDTCSCombo->addItem("255", quint16(255));
|
||||
ui->rptDTCSCombo->addItem("261", quint16(261));
|
||||
ui->rptDTCSCombo->addItem("263", quint16(263));
|
||||
ui->rptDTCSCombo->addItem("265", quint16(265));
|
||||
ui->rptDTCSCombo->addItem("266", quint16(266));
|
||||
ui->rptDTCSCombo->addItem("271", quint16(271));
|
||||
ui->rptDTCSCombo->addItem("274", quint16(274));
|
||||
|
||||
ui->rptDTCSCombo->addItem("306", quint16(306));
|
||||
ui->rptDTCSCombo->addItem("311", quint16(311));
|
||||
ui->rptDTCSCombo->addItem("315", quint16(315));
|
||||
ui->rptDTCSCombo->addItem("325", quint16(325));
|
||||
ui->rptDTCSCombo->addItem("331", quint16(331));
|
||||
ui->rptDTCSCombo->addItem("332", quint16(332));
|
||||
ui->rptDTCSCombo->addItem("343", quint16(343));
|
||||
ui->rptDTCSCombo->addItem("346", quint16(346));
|
||||
ui->rptDTCSCombo->addItem("351", quint16(351));
|
||||
ui->rptDTCSCombo->addItem("356", quint16(356));
|
||||
ui->rptDTCSCombo->addItem("364", quint16(364));
|
||||
ui->rptDTCSCombo->addItem("365", quint16(365));
|
||||
ui->rptDTCSCombo->addItem("371", quint16(371));
|
||||
|
||||
ui->rptDTCSCombo->addItem("411", quint16(411));
|
||||
ui->rptDTCSCombo->addItem("412", quint16(412));
|
||||
ui->rptDTCSCombo->addItem("413", quint16(413));
|
||||
ui->rptDTCSCombo->addItem("423", quint16(423));
|
||||
ui->rptDTCSCombo->addItem("431", quint16(431));
|
||||
ui->rptDTCSCombo->addItem("432", quint16(432));
|
||||
ui->rptDTCSCombo->addItem("445", quint16(445));
|
||||
ui->rptDTCSCombo->addItem("446", quint16(446));
|
||||
ui->rptDTCSCombo->addItem("452", quint16(452));
|
||||
ui->rptDTCSCombo->addItem("454", quint16(454));
|
||||
ui->rptDTCSCombo->addItem("455", quint16(455));
|
||||
ui->rptDTCSCombo->addItem("462", quint16(462));
|
||||
ui->rptDTCSCombo->addItem("464", quint16(464));
|
||||
ui->rptDTCSCombo->addItem("465", quint16(465));
|
||||
ui->rptDTCSCombo->addItem("466", quint16(466));
|
||||
|
||||
ui->rptDTCSCombo->addItem("503", quint16(503));
|
||||
ui->rptDTCSCombo->addItem("506", quint16(506));
|
||||
ui->rptDTCSCombo->addItem("516", quint16(516));
|
||||
ui->rptDTCSCombo->addItem("523", quint16(512));
|
||||
ui->rptDTCSCombo->addItem("526", quint16(526));
|
||||
ui->rptDTCSCombo->addItem("532", quint16(532));
|
||||
ui->rptDTCSCombo->addItem("546", quint16(546));
|
||||
ui->rptDTCSCombo->addItem("565", quint16(565));
|
||||
|
||||
ui->rptDTCSCombo->addItem("606", quint16(606));
|
||||
ui->rptDTCSCombo->addItem("612", quint16(612));
|
||||
ui->rptDTCSCombo->addItem("624", quint16(624));
|
||||
ui->rptDTCSCombo->addItem("627", quint16(627));
|
||||
ui->rptDTCSCombo->addItem("631", quint16(631));
|
||||
ui->rptDTCSCombo->addItem("632", quint16(632));
|
||||
ui->rptDTCSCombo->addItem("654", quint16(654));
|
||||
ui->rptDTCSCombo->addItem("662", quint16(662));
|
||||
ui->rptDTCSCombo->addItem("664", quint16(664));
|
||||
|
||||
ui->rptDTCSCombo->addItem("703", quint16(703));
|
||||
ui->rptDTCSCombo->addItem("712", quint16(712));
|
||||
ui->rptDTCSCombo->addItem("723", quint16(723));
|
||||
ui->rptDTCSCombo->addItem("731", quint16(731));
|
||||
ui->rptDTCSCombo->addItem("732", quint16(732));
|
||||
ui->rptDTCSCombo->addItem("734", quint16(734));
|
||||
ui->rptDTCSCombo->addItem("746", quint16(746));
|
||||
ui->rptDTCSCombo->addItem("754", quint16(754));
|
||||
}
|
||||
|
||||
void repeaterSetup::receiveDuplexMode(duplexMode dm)
|
||||
{
|
||||
currentdm = dm;
|
||||
switch(dm)
|
||||
{
|
||||
case dmSimplex:
|
||||
case dmSplitOff:
|
||||
ui->rptSimplexBtn->setChecked(true);
|
||||
break;
|
||||
case dmDupPlus:
|
||||
ui->rptDupPlusBtn->setChecked(true);
|
||||
break;
|
||||
case dmDupMinus:
|
||||
ui->rptDupMinusBtn->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void repeaterSetup::handleRptAccessMode(rptAccessTxRx tmode)
|
||||
{
|
||||
switch(tmode)
|
||||
{
|
||||
case ratrNN:
|
||||
ui->toneNone->setChecked(true);
|
||||
break;
|
||||
case ratrTT:
|
||||
ui->toneTSQL->setChecked(true);
|
||||
break;
|
||||
case ratrTN:
|
||||
ui->toneTone->setChecked(true);
|
||||
break;
|
||||
case ratrDD:
|
||||
ui->toneDTCS->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
(void)tmode;
|
||||
}
|
||||
|
||||
void repeaterSetup::handleTone(quint16 tone)
|
||||
{
|
||||
int tindex = ui->rptToneCombo->findData(tone);
|
||||
ui->rptToneCombo->setCurrentIndex(tindex);
|
||||
}
|
||||
|
||||
void repeaterSetup::handleTSQL(quint16 tsql)
|
||||
{
|
||||
// TODO: Consider a second combo box for the TSQL
|
||||
int tindex = ui->rptToneCombo->findData(tsql);
|
||||
ui->rptToneCombo->setCurrentIndex(tindex);
|
||||
}
|
||||
|
||||
void repeaterSetup::handleDTCS(quint16 dcode, bool tinv, bool rinv)
|
||||
{
|
||||
int dindex = ui->rptDTCSCombo->findData(dcode);
|
||||
ui->rptDTCSCombo->setCurrentIndex(dindex);
|
||||
ui->rptDTCSInvertTx->setChecked(tinv);
|
||||
ui->rptDTCSInvertRx->setChecked(rinv);
|
||||
}
|
||||
|
||||
void repeaterSetup::on_rptSimplexBtn_clicked()
|
||||
{
|
||||
// Simplex
|
||||
emit setDuplexMode(dmDupAutoOff);
|
||||
emit setDuplexMode(dmSimplex);
|
||||
}
|
||||
|
||||
void repeaterSetup::on_rptDupPlusBtn_clicked()
|
||||
{
|
||||
// DUP+
|
||||
emit setDuplexMode(dmDupAutoOff);
|
||||
emit setDuplexMode(dmDupPlus);
|
||||
}
|
||||
|
||||
void repeaterSetup::on_rptDupMinusBtn_clicked()
|
||||
{
|
||||
// DUP-
|
||||
emit setDuplexMode(dmDupAutoOff);
|
||||
emit setDuplexMode(dmDupMinus);
|
||||
}
|
||||
|
||||
void repeaterSetup::on_rptAutoBtn_clicked()
|
||||
{
|
||||
// Auto Rptr (enable this feature)
|
||||
// TODO: Hide an AutoOff button somewhere for non-US users
|
||||
emit setDuplexMode(dmDupAutoOn);
|
||||
}
|
||||
|
||||
void repeaterSetup::on_rptReadRigBtn_clicked()
|
||||
{
|
||||
emit getDuplexMode();
|
||||
}
|
||||
|
||||
void repeaterSetup::on_rptToneCombo_activated(int tindex)
|
||||
{
|
||||
quint16 tone=0;
|
||||
tone = (quint16)ui->rptToneCombo->itemData(tindex).toUInt();
|
||||
if(ui->toneTone->isChecked())
|
||||
{
|
||||
emit setTone(tone);
|
||||
} else if (ui->toneTSQL->isChecked()) {
|
||||
emit setTSQL(tone);
|
||||
}
|
||||
}
|
||||
|
||||
void repeaterSetup::on_rptDTCSCombo_activated(int index)
|
||||
{
|
||||
quint16 dcode=0;
|
||||
bool tinv = ui->rptDTCSInvertTx->isChecked();
|
||||
bool rinv = ui->rptDTCSInvertRx->isChecked();
|
||||
dcode = (quint16)ui->rptDTCSCombo->itemData(index).toUInt();
|
||||
emit setDTCS(dcode, tinv, rinv);
|
||||
}
|
||||
|
||||
void repeaterSetup::on_toneNone_clicked()
|
||||
{
|
||||
rptAccessTxRx rm;
|
||||
rm = ratrNN;
|
||||
emit setRptAccessMode(rm);
|
||||
}
|
||||
|
||||
void repeaterSetup::on_toneTone_clicked()
|
||||
{
|
||||
rptAccessTxRx rm;
|
||||
rm = ratrTN;
|
||||
emit setRptAccessMode(rm);
|
||||
emit setTone((quint16)ui->rptToneCombo->currentData().toUInt());
|
||||
}
|
||||
|
||||
void repeaterSetup::on_toneTSQL_clicked()
|
||||
{
|
||||
rptAccessTxRx rm;
|
||||
rm = ratrTT;
|
||||
emit setRptAccessMode(rm);
|
||||
emit setTSQL((quint16)ui->rptToneCombo->currentData().toUInt());
|
||||
}
|
||||
|
||||
void repeaterSetup::on_toneDTCS_clicked()
|
||||
{
|
||||
rptAccessTxRx rm;
|
||||
quint16 dcode=0;
|
||||
|
||||
rm = ratrDD;
|
||||
emit setRptAccessMode(rm);
|
||||
|
||||
bool tinv = ui->rptDTCSInvertTx->isChecked();
|
||||
bool rinv = ui->rptDTCSInvertRx->isChecked();
|
||||
dcode = (quint16)ui->rptDTCSCombo->currentData().toUInt();
|
||||
emit setDTCS(dcode, tinv, rinv);
|
||||
}
|
||||
|
||||
void repeaterSetup::on_debugBtn_clicked()
|
||||
{
|
||||
// TODO: Move these four commands to wfview's startup command list (place at the end)
|
||||
//emit getTone();
|
||||
//emit getTSQL();
|
||||
//emit getDTCS();
|
||||
emit getRptAccessMode();
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
#ifndef REPEATERSETUP_H
|
||||
#define REPEATERSETUP_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QDebug>
|
||||
|
||||
#include "repeaterattributes.h"
|
||||
#include "rigidentities.h"
|
||||
|
||||
namespace Ui {
|
||||
class repeaterSetup;
|
||||
}
|
||||
|
||||
class repeaterSetup : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit repeaterSetup(QWidget *parent = 0);
|
||||
~repeaterSetup();
|
||||
void setRig(rigCapabilities rig);
|
||||
|
||||
signals:
|
||||
void getDuplexMode();
|
||||
void setDuplexMode(duplexMode dm);
|
||||
void setTone(quint16 tone);
|
||||
void setTSQL(quint16 tsql);
|
||||
void setDTCS(quint16 dcode, bool tinv, bool rinv);
|
||||
void getTone();
|
||||
void getTSQL();
|
||||
void getDTCS();
|
||||
void setRptAccessMode(rptAccessTxRx tmode);
|
||||
void getRptAccessMode();
|
||||
|
||||
public slots:
|
||||
void receiveDuplexMode(duplexMode dm);
|
||||
void handleRptAccessMode(rptAccessTxRx tmode);
|
||||
void handleTone(quint16 tone);
|
||||
void handleTSQL(quint16 tsql);
|
||||
void handleDTCS(quint16 dcscode, bool tinv, bool rinv);
|
||||
|
||||
private slots:
|
||||
void on_rptSimplexBtn_clicked();
|
||||
void on_rptDupPlusBtn_clicked();
|
||||
void on_rptDupMinusBtn_clicked();
|
||||
void on_rptAutoBtn_clicked();
|
||||
void on_rptReadRigBtn_clicked();
|
||||
void on_rptToneCombo_activated(int index);
|
||||
void on_rptDTCSCombo_activated(int index);
|
||||
void on_debugBtn_clicked();
|
||||
void on_toneNone_clicked();
|
||||
void on_toneTone_clicked();
|
||||
void on_toneTSQL_clicked();
|
||||
void on_toneDTCS_clicked();
|
||||
|
||||
private:
|
||||
Ui::repeaterSetup *ui;
|
||||
|
||||
void populateTones();
|
||||
void populateDTCS();
|
||||
rigCapabilities rig;
|
||||
bool haveRig = false;
|
||||
duplexMode currentdm;
|
||||
};
|
||||
|
||||
#endif // REPEATERSETUP_H
|
|
@ -0,0 +1,237 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>repeaterSetup</class>
|
||||
<widget class="QMainWindow" name="repeaterSetup">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>217</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Repeater Setup</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="rptReadRigBtn">
|
||||
<property name="text">
|
||||
<string>Read Current Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="debugBtn">
|
||||
<property name="text">
|
||||
<string>Debug</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Repeater Duplex</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rptSimplexBtn">
|
||||
<property name="text">
|
||||
<string>Simplex</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">rptDuplexBtns</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rptDupPlusBtn">
|
||||
<property name="text">
|
||||
<string>Dup+</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">rptDuplexBtns</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rptDupMinusBtn">
|
||||
<property name="text">
|
||||
<string>Dup-</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">rptDuplexBtns</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rptAutoBtn">
|
||||
<property name="text">
|
||||
<string>Auto</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">rptDuplexBtns</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Repeater Tone Type</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="toneNone">
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">rptToneBtns</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="toneTone">
|
||||
<property name="text">
|
||||
<string>Transmit Tone only</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">rptToneBtns</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="toneTSQL">
|
||||
<property name="text">
|
||||
<string>Tone Squelch</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">rptToneBtns</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="toneDTCS">
|
||||
<property name="text">
|
||||
<string>DTCS</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">rptToneBtns</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Tone Selection</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Tone</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="rptToneCombo"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>DTCS</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="rptDTCSCombo"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="rptDTCSInvertTx">
|
||||
<property name="text">
|
||||
<string>Invert Tx</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="rptDTCSInvertRx">
|
||||
<property name="text">
|
||||
<string>Invert Rx</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="rptDuplexBtns"/>
|
||||
<buttongroup name="rptToneBtns"/>
|
||||
</buttongroups>
|
||||
</ui>
|
|
@ -0,0 +1,312 @@
|
|||
|
||||
Opus-tools, with the exception of opusinfo.[ch] is available under
|
||||
the following two clause BSD-style license:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Opusinfo is a fork of ogginfo from the vorbis-tools package
|
||||
(https://www.xiph.org). It is available under the GPL:
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
|
@ -0,0 +1,219 @@
|
|||
/* Copyright (C) 2003 Jean-Marc Valin */
|
||||
/**
|
||||
@file arch.h
|
||||
@brief Various architecture definitions Speex
|
||||
*/
|
||||
/*
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef ARCH_H
|
||||
#define ARCH_H
|
||||
|
||||
/* A couple test to catch stupid option combinations */
|
||||
#ifdef FIXED_POINT
|
||||
|
||||
#if ((defined (ARM4_ASM)||defined (ARM4_ASM)) && defined(BFIN_ASM)) || (defined (ARM4_ASM)&&defined(ARM5E_ASM))
|
||||
#error Make up your mind. What CPU do you have?
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
|
||||
#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef OUTSIDE_SPEEX
|
||||
#include "speex/speexdsp_types.h"
|
||||
#endif
|
||||
|
||||
#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
|
||||
#define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */
|
||||
#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */
|
||||
#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
|
||||
#define ABS32(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 32-bit value. */
|
||||
#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 32-bit value. */
|
||||
#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
|
||||
typedef spx_int16_t spx_word16_t;
|
||||
typedef spx_int32_t spx_word32_t;
|
||||
typedef spx_word32_t spx_mem_t;
|
||||
typedef spx_word16_t spx_coef_t;
|
||||
typedef spx_word16_t spx_lsp_t;
|
||||
typedef spx_word32_t spx_sig_t;
|
||||
|
||||
#define Q15ONE 32767
|
||||
|
||||
#define LPC_SCALING 8192
|
||||
#define SIG_SCALING 16384
|
||||
#define LSP_SCALING 8192.
|
||||
#define GAMMA_SCALING 32768.
|
||||
#define GAIN_SCALING 64
|
||||
#define GAIN_SCALING_1 0.015625
|
||||
|
||||
#define LPC_SHIFT 13
|
||||
#define LSP_SHIFT 13
|
||||
#define SIG_SHIFT 14
|
||||
#define GAIN_SHIFT 6
|
||||
|
||||
#define WORD2INT(x) ((x) < -32767 ? -32768 : ((x) > 32766 ? 32767 : (x)))
|
||||
|
||||
#define VERY_SMALL 0
|
||||
#define VERY_LARGE32 ((spx_word32_t)2147483647)
|
||||
#define VERY_LARGE16 ((spx_word16_t)32767)
|
||||
#define Q15_ONE ((spx_word16_t)32767)
|
||||
|
||||
|
||||
#ifdef FIXED_DEBUG
|
||||
#include "fixed_debug.h"
|
||||
#else
|
||||
|
||||
#include "fixed_generic.h"
|
||||
|
||||
#ifdef ARM5E_ASM
|
||||
#include "fixed_arm5e.h"
|
||||
#elif defined (ARM4_ASM)
|
||||
#include "fixed_arm4.h"
|
||||
#elif defined (BFIN_ASM)
|
||||
#include "fixed_bfin.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#else
|
||||
|
||||
typedef float spx_mem_t;
|
||||
typedef float spx_coef_t;
|
||||
typedef float spx_lsp_t;
|
||||
typedef float spx_sig_t;
|
||||
typedef float spx_word16_t;
|
||||
typedef float spx_word32_t;
|
||||
|
||||
#define Q15ONE 1.0f
|
||||
#define LPC_SCALING 1.f
|
||||
#define SIG_SCALING 1.f
|
||||
#define LSP_SCALING 1.f
|
||||
#define GAMMA_SCALING 1.f
|
||||
#define GAIN_SCALING 1.f
|
||||
#define GAIN_SCALING_1 1.f
|
||||
|
||||
|
||||
#define VERY_SMALL 1e-15f
|
||||
#define VERY_LARGE32 1e15f
|
||||
#define VERY_LARGE16 1e15f
|
||||
#define Q15_ONE ((spx_word16_t)1.f)
|
||||
|
||||
#define QCONST16(x,bits) (x)
|
||||
#define QCONST32(x,bits) (x)
|
||||
|
||||
#define NEG16(x) (-(x))
|
||||
#define NEG32(x) (-(x))
|
||||
#define EXTRACT16(x) (x)
|
||||
#define EXTEND32(x) (x)
|
||||
#define SHR16(a,shift) (a)
|
||||
#define SHL16(a,shift) (a)
|
||||
#define SHR32(a,shift) (a)
|
||||
#define SHL32(a,shift) (a)
|
||||
#define PSHR16(a,shift) (a)
|
||||
#define PSHR32(a,shift) (a)
|
||||
#define VSHR32(a,shift) (a)
|
||||
#define SATURATE16(x,a) (x)
|
||||
#define SATURATE32(x,a) (x)
|
||||
#define SATURATE32PSHR(x,shift,a) (x)
|
||||
|
||||
#define PSHR(a,shift) (a)
|
||||
#define SHR(a,shift) (a)
|
||||
#define SHL(a,shift) (a)
|
||||
#define SATURATE(x,a) (x)
|
||||
|
||||
#define ADD16(a,b) ((a)+(b))
|
||||
#define SUB16(a,b) ((a)-(b))
|
||||
#define ADD32(a,b) ((a)+(b))
|
||||
#define SUB32(a,b) ((a)-(b))
|
||||
#define MULT16_16_16(a,b) ((a)*(b))
|
||||
#define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b))
|
||||
#define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b))
|
||||
|
||||
#define MULT16_32_Q11(a,b) ((a)*(b))
|
||||
#define MULT16_32_Q13(a,b) ((a)*(b))
|
||||
#define MULT16_32_Q14(a,b) ((a)*(b))
|
||||
#define MULT16_32_Q15(a,b) ((a)*(b))
|
||||
#define MULT16_32_P15(a,b) ((a)*(b))
|
||||
|
||||
#define MAC16_32_Q11(c,a,b) ((c)+(a)*(b))
|
||||
#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
|
||||
|
||||
#define MAC16_16_Q11(c,a,b) ((c)+(a)*(b))
|
||||
#define MAC16_16_Q13(c,a,b) ((c)+(a)*(b))
|
||||
#define MAC16_16_P13(c,a,b) ((c)+(a)*(b))
|
||||
#define MULT16_16_Q11_32(a,b) ((a)*(b))
|
||||
#define MULT16_16_Q13(a,b) ((a)*(b))
|
||||
#define MULT16_16_Q14(a,b) ((a)*(b))
|
||||
#define MULT16_16_Q15(a,b) ((a)*(b))
|
||||
#define MULT16_16_P15(a,b) ((a)*(b))
|
||||
#define MULT16_16_P13(a,b) ((a)*(b))
|
||||
#define MULT16_16_P14(a,b) ((a)*(b))
|
||||
|
||||
#define DIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
|
||||
#define PDIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
|
||||
#define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
|
||||
#define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
|
||||
|
||||
#define WORD2INT(x) ((x) < -32767.5f ? -32768 : \
|
||||
((x) > 32766.5f ? 32767 : (spx_int16_t)floor(.5 + (x))))
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
|
||||
|
||||
/* 2 on TI C5x DSP */
|
||||
#define BYTES_PER_CHAR 2
|
||||
#define BITS_PER_CHAR 16
|
||||
#define LOG2_BITS_PER_CHAR 4
|
||||
|
||||
#else
|
||||
|
||||
#define BYTES_PER_CHAR 1
|
||||
#define BITS_PER_CHAR 8
|
||||
#define LOG2_BITS_PER_CHAR 3
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef FIXED_DEBUG
|
||||
extern long long spx_mips;
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,128 @@
|
|||
/* Copyright (C) 2007-2008 Jean-Marc Valin
|
||||
* Copyright (C) 2008 Thorvald Natvig
|
||||
*/
|
||||
/**
|
||||
@file resample_sse.h
|
||||
@brief Resampler functions (SSE version)
|
||||
*/
|
||||
/*
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <xmmintrin.h>
|
||||
|
||||
#define OVERRIDE_INNER_PRODUCT_SINGLE
|
||||
static inline float inner_product_single(const float *a, const float *b, unsigned int len)
|
||||
{
|
||||
unsigned int i;
|
||||
float ret;
|
||||
__m128 sum = _mm_setzero_ps();
|
||||
for (i=0;i<len;i+=8)
|
||||
{
|
||||
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a+i), _mm_loadu_ps(b+i)));
|
||||
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a+i+4), _mm_loadu_ps(b+i+4)));
|
||||
}
|
||||
sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
|
||||
sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
|
||||
_mm_store_ss(&ret, sum);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define OVERRIDE_INTERPOLATE_PRODUCT_SINGLE
|
||||
static inline float interpolate_product_single(const float *a, const float *b, unsigned int len, const spx_uint32_t oversample, float *frac) {
|
||||
unsigned int i;
|
||||
float ret;
|
||||
__m128 sum = _mm_setzero_ps();
|
||||
__m128 f = _mm_loadu_ps(frac);
|
||||
for(i=0;i<len;i+=2)
|
||||
{
|
||||
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_load1_ps(a+i), _mm_loadu_ps(b+i*oversample)));
|
||||
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_load1_ps(a+i+1), _mm_loadu_ps(b+(i+1)*oversample)));
|
||||
}
|
||||
sum = _mm_mul_ps(f, sum);
|
||||
sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
|
||||
sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
|
||||
_mm_store_ss(&ret, sum);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef __SSE2__
|
||||
#include <emmintrin.h>
|
||||
#define OVERRIDE_INNER_PRODUCT_DOUBLE
|
||||
|
||||
static inline double inner_product_double(const float *a, const float *b, unsigned int len)
|
||||
{
|
||||
unsigned int i;
|
||||
double ret;
|
||||
__m128d sum = _mm_setzero_pd();
|
||||
__m128 t;
|
||||
for (i=0;i<len;i+=8)
|
||||
{
|
||||
t = _mm_mul_ps(_mm_loadu_ps(a+i), _mm_loadu_ps(b+i));
|
||||
sum = _mm_add_pd(sum, _mm_cvtps_pd(t));
|
||||
sum = _mm_add_pd(sum, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
|
||||
|
||||
t = _mm_mul_ps(_mm_loadu_ps(a+i+4), _mm_loadu_ps(b+i+4));
|
||||
sum = _mm_add_pd(sum, _mm_cvtps_pd(t));
|
||||
sum = _mm_add_pd(sum, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
|
||||
}
|
||||
sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
|
||||
_mm_store_sd(&ret, sum);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define OVERRIDE_INTERPOLATE_PRODUCT_DOUBLE
|
||||
static inline double interpolate_product_double(const float *a, const float *b, unsigned int len, const spx_uint32_t oversample, float *frac) {
|
||||
unsigned int i;
|
||||
double ret;
|
||||
__m128d sum;
|
||||
__m128d sum1 = _mm_setzero_pd();
|
||||
__m128d sum2 = _mm_setzero_pd();
|
||||
__m128 f = _mm_loadu_ps(frac);
|
||||
__m128d f1 = _mm_cvtps_pd(f);
|
||||
__m128d f2 = _mm_cvtps_pd(_mm_movehl_ps(f,f));
|
||||
__m128 t;
|
||||
for(i=0;i<len;i+=2)
|
||||
{
|
||||
t = _mm_mul_ps(_mm_load1_ps(a+i), _mm_loadu_ps(b+i*oversample));
|
||||
sum1 = _mm_add_pd(sum1, _mm_cvtps_pd(t));
|
||||
sum2 = _mm_add_pd(sum2, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
|
||||
|
||||
t = _mm_mul_ps(_mm_load1_ps(a+i+1), _mm_loadu_ps(b+(i+1)*oversample));
|
||||
sum1 = _mm_add_pd(sum1, _mm_cvtps_pd(t));
|
||||
sum2 = _mm_add_pd(sum2, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
|
||||
}
|
||||
sum1 = _mm_mul_pd(f1, sum1);
|
||||
sum2 = _mm_mul_pd(f2, sum2);
|
||||
sum = _mm_add_pd(sum1, sum2);
|
||||
sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
|
||||
_mm_store_sd(&ret, sum);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,344 @@
|
|||
/* Copyright (C) 2007 Jean-Marc Valin
|
||||
|
||||
File: speex_resampler.h
|
||||
Resampling code
|
||||
|
||||
The design goals of this code are:
|
||||
- Very fast algorithm
|
||||
- Low memory requirement
|
||||
- Good *perceptual* quality (and not best SNR)
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SPEEX_RESAMPLER_H
|
||||
#define SPEEX_RESAMPLER_H
|
||||
|
||||
#ifdef OUTSIDE_SPEEX
|
||||
|
||||
/********* WARNING: MENTAL SANITY ENDS HERE *************/
|
||||
|
||||
/* If the resampler is defined outside of Speex, we change the symbol names so that
|
||||
there won't be any clash if linking with Speex later on. */
|
||||
|
||||
/* #define RANDOM_PREFIX your software name here */
|
||||
#ifndef RANDOM_PREFIX
|
||||
#error "Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes"
|
||||
#endif
|
||||
|
||||
#define CAT_PREFIX2(a,b) a ## b
|
||||
#define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
|
||||
|
||||
#define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
|
||||
#define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
|
||||
#define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
|
||||
#define speex_resampler_process_float CAT_PREFIX(RANDOM_PREFIX,_resampler_process_float)
|
||||
#define speex_resampler_process_int CAT_PREFIX(RANDOM_PREFIX,_resampler_process_int)
|
||||
#define speex_resampler_process_interleaved_float CAT_PREFIX(RANDOM_PREFIX,_resampler_process_interleaved_float)
|
||||
#define speex_resampler_process_interleaved_int CAT_PREFIX(RANDOM_PREFIX,_resampler_process_interleaved_int)
|
||||
#define speex_resampler_set_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_set_rate)
|
||||
#define speex_resampler_get_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_get_rate)
|
||||
#define speex_resampler_set_rate_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_set_rate_frac)
|
||||
#define speex_resampler_get_ratio CAT_PREFIX(RANDOM_PREFIX,_resampler_get_ratio)
|
||||
#define speex_resampler_set_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_set_quality)
|
||||
#define speex_resampler_get_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_get_quality)
|
||||
#define speex_resampler_set_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_input_stride)
|
||||
#define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_stride)
|
||||
#define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_output_stride)
|
||||
#define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_stride)
|
||||
#define speex_resampler_get_input_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_latency)
|
||||
#define speex_resampler_get_output_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_latency)
|
||||
#define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip_zeros)
|
||||
#define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem)
|
||||
#define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror)
|
||||
|
||||
#define spx_int16_t short
|
||||
#define spx_int32_t int
|
||||
#define spx_uint16_t unsigned short
|
||||
#define spx_uint32_t unsigned int
|
||||
|
||||
#define speex_assert(cond)
|
||||
|
||||
#else /* OUTSIDE_SPEEX */
|
||||
|
||||
#include "speexdsp_types.h"
|
||||
|
||||
#endif /* OUTSIDE_SPEEX */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SPEEX_RESAMPLER_QUALITY_MAX 10
|
||||
#define SPEEX_RESAMPLER_QUALITY_MIN 0
|
||||
#define SPEEX_RESAMPLER_QUALITY_DEFAULT 4
|
||||
#define SPEEX_RESAMPLER_QUALITY_VOIP 3
|
||||
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
|
||||
|
||||
enum {
|
||||
RESAMPLER_ERR_SUCCESS = 0,
|
||||
RESAMPLER_ERR_ALLOC_FAILED = 1,
|
||||
RESAMPLER_ERR_BAD_STATE = 2,
|
||||
RESAMPLER_ERR_INVALID_ARG = 3,
|
||||
RESAMPLER_ERR_PTR_OVERLAP = 4,
|
||||
RESAMPLER_ERR_OVERFLOW = 5,
|
||||
|
||||
RESAMPLER_ERR_MAX_ERROR
|
||||
};
|
||||
|
||||
struct SpeexResamplerState_;
|
||||
typedef struct SpeexResamplerState_ SpeexResamplerState;
|
||||
|
||||
/** Create a new resampler with integer input and output rates.
|
||||
* @param nb_channels Number of channels to be processed
|
||||
* @param in_rate Input sampling rate (integer number of Hz).
|
||||
* @param out_rate Output sampling rate (integer number of Hz).
|
||||
* @param quality Resampling quality between 0 and 10, where 0 has poor quality
|
||||
* and 10 has very high quality.
|
||||
* @return Newly created resampler state
|
||||
* @retval NULL Error: not enough memory
|
||||
*/
|
||||
|
||||
SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
|
||||
spx_uint32_t in_rate,
|
||||
spx_uint32_t out_rate,
|
||||
int quality,
|
||||
int *err);
|
||||
|
||||
/** Create a new resampler with fractional input/output rates. The sampling
|
||||
* rate ratio is an arbitrary rational number with both the numerator and
|
||||
* denominator being 32-bit integers.
|
||||
* @param nb_channels Number of channels to be processed
|
||||
* @param ratio_num Numerator of the sampling rate ratio
|
||||
* @param ratio_den Denominator of the sampling rate ratio
|
||||
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
|
||||
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
|
||||
* @param quality Resampling quality between 0 and 10, where 0 has poor quality
|
||||
* and 10 has very high quality.
|
||||
* @return Newly created resampler state
|
||||
* @retval NULL Error: not enough memory
|
||||
*/
|
||||
SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
|
||||
spx_uint32_t ratio_num,
|
||||
spx_uint32_t ratio_den,
|
||||
spx_uint32_t in_rate,
|
||||
spx_uint32_t out_rate,
|
||||
int quality,
|
||||
int *err);
|
||||
|
||||
/** Destroy a resampler state.
|
||||
* @param st Resampler state
|
||||
*/
|
||||
void speex_resampler_destroy(SpeexResamplerState *st);
|
||||
|
||||
/** Resample a float array. The input and output buffers must *not* overlap.
|
||||
* @param st Resampler state
|
||||
* @param channel_index Index of the channel to process for the multi-channel
|
||||
* base (0 otherwise)
|
||||
* @param in Input buffer
|
||||
* @param in_len Number of input samples in the input buffer. Returns the
|
||||
* number of samples processed
|
||||
* @param out Output buffer
|
||||
* @param out_len Size of the output buffer. Returns the number of samples written
|
||||
*/
|
||||
int speex_resampler_process_float(SpeexResamplerState *st,
|
||||
spx_uint32_t channel_index,
|
||||
const float *in,
|
||||
spx_uint32_t *in_len,
|
||||
float *out,
|
||||
spx_uint32_t *out_len);
|
||||
|
||||
/** Resample an int array. The input and output buffers must *not* overlap.
|
||||
* @param st Resampler state
|
||||
* @param channel_index Index of the channel to process for the multi-channel
|
||||
* base (0 otherwise)
|
||||
* @param in Input buffer
|
||||
* @param in_len Number of input samples in the input buffer. Returns the number
|
||||
* of samples processed
|
||||
* @param out Output buffer
|
||||
* @param out_len Size of the output buffer. Returns the number of samples written
|
||||
*/
|
||||
int speex_resampler_process_int(SpeexResamplerState *st,
|
||||
spx_uint32_t channel_index,
|
||||
const spx_int16_t *in,
|
||||
spx_uint32_t *in_len,
|
||||
spx_int16_t *out,
|
||||
spx_uint32_t *out_len);
|
||||
|
||||
/** Resample an interleaved float array. The input and output buffers must *not* overlap.
|
||||
* @param st Resampler state
|
||||
* @param in Input buffer
|
||||
* @param in_len Number of input samples in the input buffer. Returns the number
|
||||
* of samples processed. This is all per-channel.
|
||||
* @param out Output buffer
|
||||
* @param out_len Size of the output buffer. Returns the number of samples written.
|
||||
* This is all per-channel.
|
||||
*/
|
||||
int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
|
||||
const float *in,
|
||||
spx_uint32_t *in_len,
|
||||
float *out,
|
||||
spx_uint32_t *out_len);
|
||||
|
||||
/** Resample an interleaved int array. The input and output buffers must *not* overlap.
|
||||
* @param st Resampler state
|
||||
* @param in Input buffer
|
||||
* @param in_len Number of input samples in the input buffer. Returns the number
|
||||
* of samples processed. This is all per-channel.
|
||||
* @param out Output buffer
|
||||
* @param out_len Size of the output buffer. Returns the number of samples written.
|
||||
* This is all per-channel.
|
||||
*/
|
||||
int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
|
||||
const spx_int16_t *in,
|
||||
spx_uint32_t *in_len,
|
||||
spx_int16_t *out,
|
||||
spx_uint32_t *out_len);
|
||||
|
||||
/** Set (change) the input/output sampling rates (integer value).
|
||||
* @param st Resampler state
|
||||
* @param in_rate Input sampling rate (integer number of Hz).
|
||||
* @param out_rate Output sampling rate (integer number of Hz).
|
||||
*/
|
||||
int speex_resampler_set_rate(SpeexResamplerState *st,
|
||||
spx_uint32_t in_rate,
|
||||
spx_uint32_t out_rate);
|
||||
|
||||
/** Get the current input/output sampling rates (integer value).
|
||||
* @param st Resampler state
|
||||
* @param in_rate Input sampling rate (integer number of Hz) copied.
|
||||
* @param out_rate Output sampling rate (integer number of Hz) copied.
|
||||
*/
|
||||
void speex_resampler_get_rate(SpeexResamplerState *st,
|
||||
spx_uint32_t *in_rate,
|
||||
spx_uint32_t *out_rate);
|
||||
|
||||
/** Set (change) the input/output sampling rates and resampling ratio
|
||||
* (fractional values in Hz supported).
|
||||
* @param st Resampler state
|
||||
* @param ratio_num Numerator of the sampling rate ratio
|
||||
* @param ratio_den Denominator of the sampling rate ratio
|
||||
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
|
||||
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
|
||||
*/
|
||||
int speex_resampler_set_rate_frac(SpeexResamplerState *st,
|
||||
spx_uint32_t ratio_num,
|
||||
spx_uint32_t ratio_den,
|
||||
spx_uint32_t in_rate,
|
||||
spx_uint32_t out_rate);
|
||||
|
||||
/** Get the current resampling ratio. This will be reduced to the least
|
||||
* common denominator.
|
||||
* @param st Resampler state
|
||||
* @param ratio_num Numerator of the sampling rate ratio copied
|
||||
* @param ratio_den Denominator of the sampling rate ratio copied
|
||||
*/
|
||||
void speex_resampler_get_ratio(SpeexResamplerState *st,
|
||||
spx_uint32_t *ratio_num,
|
||||
spx_uint32_t *ratio_den);
|
||||
|
||||
/** Set (change) the conversion quality.
|
||||
* @param st Resampler state
|
||||
* @param quality Resampling quality between 0 and 10, where 0 has poor
|
||||
* quality and 10 has very high quality.
|
||||
*/
|
||||
int speex_resampler_set_quality(SpeexResamplerState *st,
|
||||
int quality);
|
||||
|
||||
/** Get the conversion quality.
|
||||
* @param st Resampler state
|
||||
* @param quality Resampling quality between 0 and 10, where 0 has poor
|
||||
* quality and 10 has very high quality.
|
||||
*/
|
||||
void speex_resampler_get_quality(SpeexResamplerState *st,
|
||||
int *quality);
|
||||
|
||||
/** Set (change) the input stride.
|
||||
* @param st Resampler state
|
||||
* @param stride Input stride
|
||||
*/
|
||||
void speex_resampler_set_input_stride(SpeexResamplerState *st,
|
||||
spx_uint32_t stride);
|
||||
|
||||
/** Get the input stride.
|
||||
* @param st Resampler state
|
||||
* @param stride Input stride copied
|
||||
*/
|
||||
void speex_resampler_get_input_stride(SpeexResamplerState *st,
|
||||
spx_uint32_t *stride);
|
||||
|
||||
/** Set (change) the output stride.
|
||||
* @param st Resampler state
|
||||
* @param stride Output stride
|
||||
*/
|
||||
void speex_resampler_set_output_stride(SpeexResamplerState *st,
|
||||
spx_uint32_t stride);
|
||||
|
||||
/** Get the output stride.
|
||||
* @param st Resampler state copied
|
||||
* @param stride Output stride
|
||||
*/
|
||||
void speex_resampler_get_output_stride(SpeexResamplerState *st,
|
||||
spx_uint32_t *stride);
|
||||
|
||||
/** Get the latency introduced by the resampler measured in input samples.
|
||||
* @param st Resampler state
|
||||
*/
|
||||
int speex_resampler_get_input_latency(SpeexResamplerState *st);
|
||||
|
||||
/** Get the latency introduced by the resampler measured in output samples.
|
||||
* @param st Resampler state
|
||||
*/
|
||||
int speex_resampler_get_output_latency(SpeexResamplerState *st);
|
||||
|
||||
/** Make sure that the first samples to go out of the resamplers don't have
|
||||
* leading zeros. This is only useful before starting to use a newly created
|
||||
* resampler. It is recommended to use that when resampling an audio file, as
|
||||
* it will generate a file with the same length. For real-time processing,
|
||||
* it is probably easier not to use this call (so that the output duration
|
||||
* is the same for the first frame).
|
||||
* @param st Resampler state
|
||||
*/
|
||||
int speex_resampler_skip_zeros(SpeexResamplerState *st);
|
||||
|
||||
/** Reset a resampler so a new (unrelated) stream can be processed.
|
||||
* @param st Resampler state
|
||||
*/
|
||||
int speex_resampler_reset_mem(SpeexResamplerState *st);
|
||||
|
||||
/** Returns the English meaning for an error code
|
||||
* @param err Error code
|
||||
* @return English string
|
||||
*/
|
||||
const char *speex_resampler_strerror(int err);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
2187
rigcommander.cpp
2187
rigcommander.cpp
Plik diff jest za duży
Load Diff
303
rigcommander.h
303
rigcommander.h
|
@ -5,8 +5,10 @@
|
|||
#include <QDebug>
|
||||
|
||||
#include "commhandler.h"
|
||||
#include "pttyhandler.h"
|
||||
#include "udphandler.h"
|
||||
#include "rigidentities.h"
|
||||
#include "repeaterattributes.h"
|
||||
|
||||
// This file figures out what to send to the comm and also
|
||||
// parses returns into useful things.
|
||||
|
@ -15,6 +17,37 @@
|
|||
// note: using a define because switch case doesn't even work with const unsigned char. Surprised me.
|
||||
#define compCivAddr 0xE1
|
||||
|
||||
enum meterKind {
|
||||
meterS,
|
||||
meterSWR,
|
||||
meterPower,
|
||||
meterALC,
|
||||
meterComp,
|
||||
meterVoltage,
|
||||
meterCurrent
|
||||
};
|
||||
|
||||
enum spectrumMode {
|
||||
spectModeCenter=0x00,
|
||||
spectModeFixed=0x01,
|
||||
spectModeScrollC=0x02,
|
||||
spectModeScrollF=0x03,
|
||||
spectModeUnknown=0xff
|
||||
};
|
||||
|
||||
struct freqt {
|
||||
quint64 Hz;
|
||||
double MHzDouble;
|
||||
};
|
||||
|
||||
struct rigStateStruct {
|
||||
freqt vfoAFreq;
|
||||
freqt vfoBFreq;
|
||||
unsigned char ptt;
|
||||
unsigned char mode;
|
||||
unsigned char filter;
|
||||
bool datamode;
|
||||
};
|
||||
|
||||
class rigCommander : public QObject
|
||||
{
|
||||
|
@ -24,107 +57,303 @@ public:
|
|||
rigCommander();
|
||||
~rigCommander();
|
||||
|
||||
bool usingLAN();
|
||||
|
||||
public slots:
|
||||
void process();
|
||||
void commSetup(unsigned char rigCivAddr, QString rigSerialPort, quint32 rigBaudRate);
|
||||
void commSetup(unsigned char rigCivAddr, QString ip, quint16 cport, quint16 sport, quint16 aport,
|
||||
QString username, QString password, quint16 buffer, quint16 rxsample, quint8 rxcodec,quint16 txsample, quint8 txcodec);
|
||||
void commSetup(unsigned char rigCivAddr, udpPreferences prefs);
|
||||
void closeComm();
|
||||
|
||||
// Power:
|
||||
void powerOn();
|
||||
void powerOff();
|
||||
|
||||
// Spectrum:
|
||||
void enableSpectOutput();
|
||||
void disableSpectOutput();
|
||||
void enableSpectrumDisplay();
|
||||
void disableSpectrumDisplay();
|
||||
void setSpectrumBounds(double startFreq, double endFreq, unsigned char edgeNumber);
|
||||
void setSpectrumCenteredMode(bool centerEnable); // centered or band-wise
|
||||
void setSpectrumMode(spectrumMode spectMode);
|
||||
void getSpectrumCenterMode();
|
||||
void getSpectrumMode();
|
||||
void setSpectrumRefLevel(int level);
|
||||
void getSpectrumRefLevel();
|
||||
void getSpectrumRefLevel(unsigned char mainSub);
|
||||
void setScopeSpan(char span);
|
||||
void getScopeSpan(bool isSub);
|
||||
void getScopeSpan();
|
||||
|
||||
void setScopeEdge(char edge);
|
||||
void getScopeEdge();
|
||||
void getScopeMode();
|
||||
void setFrequency(double freq);
|
||||
void setMode(char mode);
|
||||
|
||||
// Frequency, Mode, BSR:
|
||||
void setFrequency(freqt freq);
|
||||
void getFrequency();
|
||||
void getBandStackReg(char band, char regCode);
|
||||
void setMode(unsigned char mode, unsigned char modeFilter);
|
||||
void getMode();
|
||||
void getPTT();
|
||||
void setPTT(bool pttOn);
|
||||
void setDataMode(bool dataOn);
|
||||
void getDataMode();
|
||||
void getRfGain();
|
||||
void getAfGain();
|
||||
void getSql();
|
||||
void setRfGain(unsigned char level);
|
||||
void setAfGain(unsigned char level);
|
||||
void getBandStackReg(char band, char regCode);
|
||||
void getRitEnabled();
|
||||
void getRitValue();
|
||||
void setRitValue(int ritValue);
|
||||
void setRitEnable(bool ritEnabled);
|
||||
|
||||
// PTT, ATU, ATT, Antenna, and Preamp:
|
||||
void getPTT();
|
||||
void setPTT(bool pttOn);
|
||||
void startATU();
|
||||
void setATU(bool enabled);
|
||||
void getATUStatus();
|
||||
void getAttenuator();
|
||||
void getPreamp();
|
||||
void getAntenna();
|
||||
void setAttenuator(unsigned char att);
|
||||
void setPreamp(unsigned char pre);
|
||||
void setAntenna(unsigned char ant);
|
||||
|
||||
// Repeater:
|
||||
void setDuplexMode(duplexMode dm);
|
||||
void getDuplexMode();
|
||||
void getTransmitFrequency();
|
||||
void setTone(quint16 tone);
|
||||
void setTSQL(quint16 tsql);
|
||||
void getTSQL();
|
||||
void getTone();
|
||||
void setDTCS(quint16 dcscode, bool tinv, bool rinv);
|
||||
void getDTCS();
|
||||
void setRptAccessMode(rptAccessTxRx ratr);
|
||||
void getRptAccessMode();
|
||||
|
||||
// Get Levels:
|
||||
void getLevels(); // all supported levels
|
||||
void getRfGain();
|
||||
void getAfGain();
|
||||
void getSql();
|
||||
void getTxLevel();
|
||||
void getMicGain();
|
||||
void getCompLevel();
|
||||
void getMonitorLevel();
|
||||
void getVoxGain();
|
||||
void getAntiVoxGain();
|
||||
void getUSBGain();
|
||||
void getLANGain();
|
||||
void getACCGain();
|
||||
void getACCGain(unsigned char ab);
|
||||
void getModInput(bool dataOn);
|
||||
void getModInputLevel(rigInput input);
|
||||
|
||||
// Set Levels:
|
||||
void setSquelch(unsigned char level);
|
||||
void setRfGain(unsigned char level);
|
||||
void setAfGain(unsigned char level);
|
||||
void setTxPower(unsigned char power);
|
||||
void setMicGain(unsigned char gain);
|
||||
void setUSBGain(unsigned char gain);
|
||||
void setLANGain(unsigned char gain);
|
||||
void setACCGain(unsigned char gain);
|
||||
void setACCGain(unsigned char gain, unsigned char ab);
|
||||
void setCompLevel(unsigned char compLevel);
|
||||
void setMonitorLevel(unsigned char monitorLevel);
|
||||
void setVoxGain(unsigned char gain);
|
||||
void setAntiVoxGain(unsigned char gain);
|
||||
void setModInput(rigInput input, bool dataOn);
|
||||
void setModInputLevel(rigInput input, unsigned char level);
|
||||
|
||||
// NB, NR, IP+:
|
||||
void setIPP(bool enabled);
|
||||
void getIPP();
|
||||
// Maybe put some of these into a struct?
|
||||
// setReceiverDSPParam(dspParam param);
|
||||
//void getNRLevel();
|
||||
//void getNREnabled();
|
||||
//void getNBLevel();
|
||||
//void getNBEnabled();
|
||||
//void getNotchEnabled();
|
||||
//void getNotchLevel();
|
||||
//void setNotchEnabled(bool enabled);
|
||||
//void setNotchLevel(unsigned char level);
|
||||
|
||||
|
||||
// Meters:
|
||||
void getSMeter();
|
||||
void getRFPowerMeter();
|
||||
void getSWRMeter();
|
||||
void getALCMeter();
|
||||
void getCompReductionMeter();
|
||||
void getVdMeter();
|
||||
void getIDMeter();
|
||||
void getMeters(meterKind meter); // all supported meters per transmit or receive
|
||||
|
||||
// Rig ID and CIV:
|
||||
void getRigID();
|
||||
void findRigs();
|
||||
void setCIVAddr(unsigned char civAddr);
|
||||
void handleNewData(const QByteArray &data);
|
||||
|
||||
// Calibration:
|
||||
void getRefAdjustCourse();
|
||||
void getRefAdjustFine();
|
||||
void setRefAdjustCourse(unsigned char level);
|
||||
void setRefAdjustFine(unsigned char level);
|
||||
|
||||
// Satellite:
|
||||
void setSatelliteMode(bool enabled);
|
||||
void getSatelliteMode();
|
||||
|
||||
// UDP:
|
||||
void handleNewData(const QByteArray& data);
|
||||
void receiveAudioData(const audioPacket& data);
|
||||
void handleSerialPortError(const QString port, const QString errorText);
|
||||
void handleStatusUpdate(const QString text);
|
||||
void changeBufferSize(const quint16 value);
|
||||
void changeLatency(const quint16 value);
|
||||
void dataFromServer(QByteArray data);
|
||||
|
||||
// Speech:
|
||||
void sayFrequency();
|
||||
void sayMode();
|
||||
void sayAll();
|
||||
|
||||
// Housekeeping:
|
||||
void handleStatusUpdate(const QString text);
|
||||
void getDebug();
|
||||
|
||||
signals:
|
||||
// Communication:
|
||||
void commReady();
|
||||
void haveSpectrumData(QByteArray spectrum, double startFreq, double endFreq); // pass along data to UI
|
||||
void haveRigID(rigCapabilities rigCaps);
|
||||
void discoveredRigID(rigCapabilities rigCaps);
|
||||
void haveSerialPortError(const QString port, const QString errorText);
|
||||
void haveStatusUpdate(const QString text);
|
||||
void haveFrequency(double frequencyMhz);
|
||||
void haveMode(QString mode);
|
||||
void dataForComm(const QByteArray &outData);
|
||||
|
||||
// UDP:
|
||||
void haveChangeLatency(quint16 value);
|
||||
void haveDataForServer(QByteArray outData);
|
||||
void haveAudioData(audioPacket data);
|
||||
void initUdpHandler();
|
||||
void haveSetVolume(unsigned char level);
|
||||
|
||||
// Spectrum:
|
||||
void haveSpectrumData(QByteArray spectrum, double startFreq, double endFreq); // pass along data to UI
|
||||
void haveSpectrumBounds();
|
||||
void haveScopeSpan(freqt span, bool isSub);
|
||||
void haveSpectrumMode(spectrumMode spectmode);
|
||||
void haveScopeEdge(char edge);
|
||||
void haveSpectrumRefLevel(int level);
|
||||
|
||||
// Rig ID:
|
||||
void haveRigID(rigCapabilities rigCaps);
|
||||
void discoveredRigID(rigCapabilities rigCaps);
|
||||
|
||||
// Frequency, Mode, data, and bandstack:
|
||||
void haveFrequency(freqt freqStruct);
|
||||
void haveMode(unsigned char mode, unsigned char filter);
|
||||
void haveDataMode(bool dataModeEnabled);
|
||||
void haveBandStackReg(float freq, char mode, bool dataOn);
|
||||
void haveSpectrumBounds();
|
||||
void haveScopeSpan(char span);
|
||||
void haveSpectrumFixedMode(bool fixedEnabled);
|
||||
void haveScopeEdge(char edge);
|
||||
void haveRitEnabled(bool ritEnabled);
|
||||
void haveRitFrequency(int ritHz);
|
||||
|
||||
// Repeater:
|
||||
void haveDuplexMode(duplexMode);
|
||||
void haveRptAccessMode(rptAccessTxRx ratr);
|
||||
void haveTone(quint16 tone);
|
||||
void haveTSQL(quint16 tsql);
|
||||
void haveDTCS(quint16 dcscode, bool tinv, bool rinv);
|
||||
|
||||
// Levels:
|
||||
void haveRfGain(unsigned char level);
|
||||
void haveAfGain(unsigned char level);
|
||||
void haveSql(unsigned char level);
|
||||
void haveTxPower(unsigned char level);
|
||||
void dataForComm(const QByteArray &outData);
|
||||
void getMoreDebug();
|
||||
void finished();
|
||||
void haveMicGain(unsigned char level);
|
||||
void haveCompLevel(unsigned char level);
|
||||
void haveMonitorLevel(unsigned char level);
|
||||
void haveVoxGain(unsigned char gain);
|
||||
void haveAntiVoxGain(unsigned char gain);
|
||||
|
||||
// Modulation source and gain:
|
||||
void haveModInput(rigInput input, bool isData);
|
||||
void haveLANGain(unsigned char gain);
|
||||
void haveUSBGain(unsigned char gain);
|
||||
void haveACCGain(unsigned char gain, unsigned char ab);
|
||||
void haveModSrcGain(rigInput input, unsigned char gain);
|
||||
|
||||
// Meters:
|
||||
void haveMeter(meterKind meter, unsigned char level);
|
||||
void haveSMeter(unsigned char level);
|
||||
void haveRFMeter(unsigned char level);
|
||||
void haveSWRMeter(unsigned char);
|
||||
void haveALCMeter(unsigned char);
|
||||
void haveCompMeter(unsigned char dbreduction);
|
||||
void haveVdMeter(unsigned char voltage);
|
||||
void haveIdMeter(unsigned char current);
|
||||
|
||||
// Calibration:
|
||||
void haveRefAdjustCourse(unsigned char level);
|
||||
void haveRefAdjustFine(unsigned char level);
|
||||
|
||||
// PTT and ATU:
|
||||
void havePTTStatus(bool pttOn);
|
||||
void haveATUStatus(unsigned char status);
|
||||
void haveChangeBufferSize(quint16 value);
|
||||
void haveAttenuator(unsigned char att);
|
||||
void havePreamp(unsigned char pre);
|
||||
void haveAntenna(unsigned char ant);
|
||||
|
||||
// Rig State
|
||||
void stateInfo(rigStateStruct* state);
|
||||
|
||||
// Housekeeping:
|
||||
void getMoreDebug();
|
||||
void finished();
|
||||
|
||||
private:
|
||||
void setup();
|
||||
QByteArray stripData(const QByteArray &data, unsigned char cutPosition);
|
||||
void parseData(QByteArray data); // new data come here
|
||||
void parseCommand();
|
||||
unsigned char bcdHexToDecimal(unsigned char in);
|
||||
unsigned char bcdHexToUChar(unsigned char in);
|
||||
unsigned char bcdHexToUChar(unsigned char hundreds, unsigned char tensunits);
|
||||
unsigned int bcdHexToUInt(unsigned char hundreds, unsigned char tensunits);
|
||||
QByteArray bcdEncodeInt(unsigned int);
|
||||
void parseFrequency();
|
||||
float parseFrequency(QByteArray data, unsigned char lastPosition); // supply index where Mhz is found
|
||||
freqt parseFrequency(QByteArray data, unsigned char lastPosition); // supply index where Mhz is found
|
||||
QByteArray makeFreqPayload(double frequency);
|
||||
QByteArray makeFreqPayload(freqt freq);
|
||||
QByteArray encodeTone(quint16 tone, bool tinv, bool rinv);
|
||||
QByteArray encodeTone(quint16 tone);
|
||||
quint16 decodeTone(QByteArray eTone);
|
||||
quint16 decodeTone(QByteArray eTone, bool &tinv, bool &rinv);
|
||||
|
||||
void parseMode();
|
||||
void parseSpectrum();
|
||||
void parseWFData();
|
||||
void parseSpectrumRefLevel();
|
||||
void parseDetailedRegisters1A05();
|
||||
void parseRegisters1A();
|
||||
void parseBandStackReg();
|
||||
void parseRegister1B();
|
||||
void parseRegisters1C();
|
||||
void parseRegister16();
|
||||
void parseRegister21();
|
||||
void parseBandStackReg();
|
||||
void parsePTT();
|
||||
void parseATU();
|
||||
void parseLevels(); // register 0x14
|
||||
void sendLevelCmd(unsigned char levAddr, unsigned char level);
|
||||
QByteArray getLANAddr();
|
||||
QByteArray getUSBAddr();
|
||||
QByteArray getACCAddr(unsigned char ab);
|
||||
void setModInput(rigInput input, bool dataOn, bool isQuery);
|
||||
void sendDataOut();
|
||||
void prepDataAndSend(QByteArray data);
|
||||
void debugMe();
|
||||
void printHex(const QByteArray &pdata);
|
||||
void printHex(const QByteArray &pdata, bool printVert, bool printHoriz);
|
||||
commHandler * comm=Q_NULLPTR;
|
||||
|
||||
commHandler* comm = Q_NULLPTR;
|
||||
pttyHandler* ptty = Q_NULLPTR;
|
||||
udpHandler* udp=Q_NULLPTR;
|
||||
QThread* udpHandlerThread = Q_NULLPTR;
|
||||
|
||||
void determineRigCaps();
|
||||
QByteArray payloadIn;
|
||||
QByteArray echoPerfix;
|
||||
|
@ -141,21 +370,23 @@ private:
|
|||
double spectrumEndFreq;
|
||||
|
||||
struct rigCapabilities rigCaps;
|
||||
|
||||
rigStateStruct rigState;
|
||||
|
||||
bool haveRigCaps;
|
||||
model_kind model;
|
||||
quint8 spectSeqMax;
|
||||
quint16 spectAmpMax;
|
||||
quint16 spectLenMax;
|
||||
unsigned char oldScopeMode;
|
||||
spectrumMode oldScopeMode;
|
||||
|
||||
bool usingNativeLAN; // indicates using OEM LAN connection (705,7610,9700,7850)
|
||||
bool lookingForRig;
|
||||
bool foundRig;
|
||||
|
||||
double frequencyMhz;
|
||||
unsigned char civAddr; // IC-7300: 0x94 is default = 148decimal
|
||||
unsigned char civAddr;
|
||||
unsigned char incomingCIVAddr; // place to store the incoming CIV.
|
||||
//const unsigned char compCivAddr = 0xE1; // 0xE1 is new default, 0xE0 was before.
|
||||
bool pttAllowed;
|
||||
|
||||
QString rigSerialPort;
|
||||
|
|
|
@ -0,0 +1,349 @@
|
|||
#include "rigctld.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
|
||||
|
||||
rigCtlD::rigCtlD(QObject* parent) :
|
||||
QTcpServer(parent)
|
||||
{
|
||||
}
|
||||
|
||||
rigCtlD::~rigCtlD()
|
||||
{
|
||||
}
|
||||
|
||||
void rigCtlD::receiveFrequency(freqt freq)
|
||||
{
|
||||
emit setFrequency(freq);
|
||||
}
|
||||
void rigCtlD::receiveStateInfo(rigStateStruct* state)
|
||||
{
|
||||
qDebug("Setting rig state");
|
||||
rigState = state;
|
||||
}
|
||||
|
||||
int rigCtlD::startServer(qint16 port)
|
||||
{
|
||||
if (!this->listen(QHostAddress::Any, port)) {
|
||||
qDebug(logRigCtlD()) << "could not start on port " << port;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug(logRigCtlD()) << "started on port " << port;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rigCtlD::incomingConnection(qintptr socket) {
|
||||
rigCtlClient* client = new rigCtlClient(socket, rigCaps, rigState, this);
|
||||
connect(this, SIGNAL(onStopped()), client, SLOT(closeSocket()));
|
||||
}
|
||||
|
||||
|
||||
void rigCtlD::stopServer()
|
||||
{
|
||||
qDebug(logRigCtlD()) << "stopping server";
|
||||
emit onStopped();
|
||||
}
|
||||
|
||||
void rigCtlD::receiveRigCaps(rigCapabilities caps)
|
||||
{
|
||||
qDebug(logRigCtlD()) << "Got rigcaps for:" << caps.modelName;
|
||||
this->rigCaps = caps;
|
||||
}
|
||||
|
||||
rigCtlClient::rigCtlClient(int socketId, rigCapabilities caps,rigStateStruct *state, rigCtlD *parent) : QObject(parent)
|
||||
{
|
||||
commandBuffer.clear();
|
||||
sessionId = socketId;
|
||||
rigCaps = caps;
|
||||
rigState = state;
|
||||
socket = new QTcpSocket(this);
|
||||
this->parent = parent;
|
||||
if (!socket->setSocketDescriptor(sessionId))
|
||||
{
|
||||
qDebug(logRigCtlD()) << " error binding socket: " << sessionId;
|
||||
return;
|
||||
}
|
||||
connect(socket, SIGNAL(readyRead()), this, SLOT(socketReadyRead()), Qt::DirectConnection);
|
||||
connect(socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()), Qt::DirectConnection);
|
||||
connect(parent, SIGNAL(sendData(QString)), this, SLOT(sendData(QString)), Qt::DirectConnection);
|
||||
qDebug(logRigCtlD()) << " session connected: " << sessionId;
|
||||
}
|
||||
|
||||
void rigCtlClient::socketReadyRead()
|
||||
{
|
||||
QByteArray data = socket->readAll();
|
||||
commandBuffer.append(data);
|
||||
static QString sep = " ";
|
||||
static int num = 0;
|
||||
if (commandBuffer.endsWith('\n'))
|
||||
{
|
||||
// Process command
|
||||
if (rigState == Q_NULLPTR)
|
||||
{
|
||||
qDebug(logRigCtlD()) << "no rigState!";
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug(logRigCtlD()) << sessionId << "command received" << commandBuffer;
|
||||
if (commandBuffer[num] == ";" || commandBuffer[num] == "|" || commandBuffer[num] == ",")
|
||||
{
|
||||
sep = commandBuffer[num].toLatin1();
|
||||
num++;
|
||||
}
|
||||
else if (commandBuffer[num] == "+")
|
||||
{
|
||||
sep = "\n";
|
||||
}
|
||||
|
||||
if (commandBuffer[num] == "q")
|
||||
{
|
||||
closeSocket();
|
||||
}
|
||||
if (commandBuffer.contains("\\chk_vfo"))
|
||||
{
|
||||
sendData(QString("0\n"));
|
||||
}
|
||||
if (commandBuffer.contains("\\dump_state"))
|
||||
{
|
||||
// Currently send "fake" state information until I can work out what is required!
|
||||
sendData(QString("1\n1\n0\n150000.000000 1500000000.000000 0x1ff -1 -1 0x16000003 0xf\n0 0 0 0 0 0 0\n0 0 0 0 0 0 0\n0x1ff 1\n0x1ff 0\n0 0\n0x1e 2400\n0x2 500\n0x1 8000\n0x1 2400\n0x20 15000\n0x20 8000\n0x40 230000\n0 0\n9990\n9990\n10000\n0\n10\n10 20 30\n0x3effffff\n0x3effffff\n0x7fffffff\n0x7fffffff\n0x7fffffff\n0x7fffffff\ndone\n"));
|
||||
}
|
||||
if (commandBuffer[num] == "f" || commandBuffer.contains("\\get_freq"))
|
||||
{
|
||||
sendData(QString("%1\n").arg(rigState->vfoAFreq.Hz));
|
||||
}
|
||||
else if (commandBuffer[num] == "F" || commandBuffer.contains("\\set_freq"))
|
||||
{
|
||||
const QRegExp rx(QLatin1Literal("[^0-9]+"));
|
||||
auto&& parts = commandBuffer.split(rx);
|
||||
freqt freq;
|
||||
if (parts.length() > 1) {
|
||||
freq.Hz = parts[1].toInt();
|
||||
emit parent->setFrequency(freq);
|
||||
}
|
||||
sendData(QString("RPRT 0\n"));
|
||||
}
|
||||
else if (commandBuffer[num] == "1" || commandBuffer.contains("\\dump_caps"))
|
||||
{
|
||||
dumpCaps(sep);
|
||||
}
|
||||
else if (commandBuffer[num] == "t")
|
||||
{
|
||||
sendData(QString("%1\n").arg(rigState->ptt));
|
||||
}
|
||||
else if (commandBuffer[num] == "T")
|
||||
{
|
||||
if (commandBuffer[num + 2] == "0") {
|
||||
emit parent->setPTT(false);
|
||||
}
|
||||
else {
|
||||
emit parent->setPTT(true);
|
||||
}
|
||||
sendData(QString("RPRT 0\n"));
|
||||
}
|
||||
else if (commandBuffer[num] == "v")
|
||||
{
|
||||
sendData(QString("VFOA\n"));
|
||||
}
|
||||
else if (commandBuffer[num] == "m")
|
||||
{
|
||||
sendData(QString("%1\n%2\n").arg(getMode(rigState->mode,rigState->datamode)).arg(getFilter(rigState->mode,rigState->filter)));
|
||||
}
|
||||
else if (commandBuffer[num] == "M")
|
||||
{
|
||||
// Set mode
|
||||
const QRegExp rx(QLatin1Literal("\\s+"));
|
||||
auto&& parts = commandBuffer.split(rx);
|
||||
if (parts.length() > 1) {
|
||||
qDebug(logRigCtlD()) << "setting mode: " << getMode(parts[1]);
|
||||
emit parent->setMode(getMode(parts[1]), 0x06);
|
||||
}
|
||||
sendData(QString("RPRT 0\n"));
|
||||
}
|
||||
else if (commandBuffer[num] == "s")
|
||||
{
|
||||
sendData(QString("0\nVFOA\n"));
|
||||
}
|
||||
commandBuffer.clear();
|
||||
sep = " ";
|
||||
num = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void rigCtlClient::socketDisconnected()
|
||||
{
|
||||
qDebug(logRigCtlD()) << sessionId << "disconnected";
|
||||
socket->deleteLater();
|
||||
this->deleteLater();
|
||||
}
|
||||
|
||||
void rigCtlClient::closeSocket()
|
||||
{
|
||||
socket->close();
|
||||
}
|
||||
|
||||
void rigCtlClient::sendData(QString data)
|
||||
{
|
||||
qDebug(logRigCtlD()) << "Sending:" << data;
|
||||
if (socket != Q_NULLPTR && socket->isValid() && socket->isOpen())
|
||||
{
|
||||
socket->write(data.toLatin1());
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug(logRigCtlD()) << "socket not open!";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void rigCtlClient::dumpCaps(QString sep)
|
||||
{
|
||||
sendData(QString("Caps dump for model: %1%2").arg(rigCaps.modelID).arg(sep));
|
||||
sendData(QString("Model Name:\t%1%2").arg(rigCaps.modelName).arg(sep));
|
||||
sendData(QString("Mfg Name:\tIcom%1").arg(sep));
|
||||
sendData(QString("Backend version:\t0.1%1").arg(sep));
|
||||
sendData(QString("Backend copyright:\t2021%1").arg(sep));
|
||||
sendData(QString("Rig type:\tTransceiver%1").arg(sep));
|
||||
sendData(QString("PTT type:\tRig capable%1").arg(sep));
|
||||
sendData(QString("DCD type:\tRig capable%1").arg(sep));
|
||||
sendData(QString("Port type:\tNetwork link%1").arg(sep));
|
||||
sendData(QString("\n"));
|
||||
}
|
||||
|
||||
QString rigCtlClient::getFilter(unsigned char mode, unsigned char filter) {
|
||||
|
||||
if (mode == 3 || mode == 7 || mode == 12 || mode == 17) {
|
||||
switch (filter) {
|
||||
case 1:
|
||||
return QString("1200");
|
||||
case 2:
|
||||
return QString("500");
|
||||
case 3:
|
||||
return QString("250");
|
||||
}
|
||||
}
|
||||
else if (mode == 4 || mode == 8)
|
||||
{
|
||||
switch (filter) {
|
||||
case 1:
|
||||
return QString("2400");
|
||||
case 2:
|
||||
return QString("500");
|
||||
case 3:
|
||||
return QString("250");
|
||||
}
|
||||
}
|
||||
else if (mode == 2)
|
||||
{
|
||||
switch (filter) {
|
||||
case 1:
|
||||
return QString("9000");
|
||||
case 2:
|
||||
return QString("6000");
|
||||
case 3:
|
||||
return QString("3000");
|
||||
}
|
||||
}
|
||||
else if (mode == 5)
|
||||
{
|
||||
switch (filter) {
|
||||
case 1:
|
||||
return QString("15000");
|
||||
case 2:
|
||||
return QString("10000");
|
||||
case 3:
|
||||
return QString("7000");
|
||||
}
|
||||
}
|
||||
else { // SSB or unknown mode
|
||||
switch (filter) {
|
||||
case 1:
|
||||
return QString("3000");
|
||||
case 2:
|
||||
return QString("2400");
|
||||
case 3:
|
||||
return QString("1800");
|
||||
}
|
||||
}
|
||||
return QString("");
|
||||
}
|
||||
|
||||
QString rigCtlClient::getMode(unsigned char mode, bool datamode) {
|
||||
(void)datamode;
|
||||
switch (mode) {
|
||||
case 0:
|
||||
return QString("LSB");
|
||||
case 1:
|
||||
return QString("USB");
|
||||
case 2:
|
||||
return QString("AM");
|
||||
case 3:
|
||||
return QString("CW");
|
||||
case 4:
|
||||
return QString("RTTY");
|
||||
case 5:
|
||||
return QString("FM");
|
||||
case 6:
|
||||
return QString("WFM");
|
||||
case 7:
|
||||
return QString("CWR");
|
||||
case 8:
|
||||
return QString("RTTYR");
|
||||
case 12:
|
||||
return QString("PKTUSB");
|
||||
case 17:
|
||||
return QString("PKTLSB");
|
||||
case 22:
|
||||
return QString("PKTFM");
|
||||
default:
|
||||
return QString("");
|
||||
}
|
||||
return QString("");
|
||||
}
|
||||
|
||||
unsigned char rigCtlClient::getMode(QString modeString) {
|
||||
|
||||
if (modeString == QString("LSB")) {
|
||||
return 0;
|
||||
}
|
||||
else if (modeString == QString("USB")) {
|
||||
return 1;
|
||||
}
|
||||
else if (modeString == QString("AM")) {
|
||||
return 2;
|
||||
}
|
||||
else if (modeString == QString("CW")) {
|
||||
return 3;
|
||||
}
|
||||
else if (modeString == QString("RTTY")) {
|
||||
return 4;
|
||||
}
|
||||
else if (modeString == QString("FM")) {
|
||||
return 5;
|
||||
}
|
||||
else if (modeString == QString("WFM")) {
|
||||
return 6;
|
||||
}
|
||||
else if (modeString == QString("CWR")) {
|
||||
return 7;
|
||||
}
|
||||
else if (modeString == QString("RTTYR")) {
|
||||
return 8;
|
||||
}
|
||||
else if (modeString == QString("PKTUSB")) {
|
||||
return 1;
|
||||
}
|
||||
else if (modeString == QString("PKTLSB")) {
|
||||
return 0;
|
||||
}
|
||||
else if (modeString == QString("PKTFM")) {
|
||||
return 22;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
#ifndef RIGCTLD_H
|
||||
#define RIGCTLD_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
#include <QSet>
|
||||
#include <QDataStream>
|
||||
|
||||
#include "rigcommander.h"
|
||||
|
||||
|
||||
class rigCtlD : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit rigCtlD(QObject *parent=Q_NULLPTR);
|
||||
virtual ~rigCtlD();
|
||||
|
||||
int startServer(qint16 port);
|
||||
void stopServer();
|
||||
rigCapabilities rigCaps;
|
||||
|
||||
signals:
|
||||
void onStarted();
|
||||
void onStopped();
|
||||
void sendData(QString data);
|
||||
void setFrequency(freqt freq);
|
||||
void setPTT(bool state);
|
||||
void setMode(unsigned char mode, unsigned char modeFilter);
|
||||
|
||||
public slots:
|
||||
virtual void incomingConnection(qintptr socketDescriptor);
|
||||
void receiveRigCaps(rigCapabilities caps);
|
||||
void receiveStateInfo(rigStateStruct* state);
|
||||
void receiveFrequency(freqt freq);
|
||||
|
||||
private:
|
||||
rigStateStruct* rigState = Q_NULLPTR;
|
||||
};
|
||||
|
||||
|
||||
class rigCtlClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit rigCtlClient(int socket, rigCapabilities caps, rigStateStruct *state, rigCtlD* parent = Q_NULLPTR);
|
||||
int getSocketId();
|
||||
|
||||
|
||||
public slots:
|
||||
void socketReadyRead();
|
||||
void socketDisconnected();
|
||||
void closeSocket();
|
||||
void sendData(QString data);
|
||||
|
||||
protected:
|
||||
int sessionId;
|
||||
QTcpSocket* socket = Q_NULLPTR;
|
||||
QString commandBuffer;
|
||||
|
||||
private:
|
||||
void dumpCaps(QString sep);
|
||||
rigCapabilities rigCaps;
|
||||
rigStateStruct* rigState = Q_NULLPTR;
|
||||
rigCtlD* parent;
|
||||
QString getMode(unsigned char mode, bool datamode);
|
||||
unsigned char getMode(QString modeString);
|
||||
QString getFilter(unsigned char mode, unsigned char filter);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,4 +1,5 @@
|
|||
#include "rigidentities.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
// Copytight 2017-2021 Elliott H. Liggett
|
||||
|
||||
|
@ -18,6 +19,9 @@ model_kind determineRadioModel(unsigned char rigID)
|
|||
case model7300:
|
||||
rig = model7300;
|
||||
break;
|
||||
case modelR8600:
|
||||
rig = modelR8600;
|
||||
break;
|
||||
case model7600:
|
||||
rig = model7600;
|
||||
break;
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
|
||||
#include <QtNumeric>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <vector>
|
||||
|
||||
// Credit:
|
||||
// Credit for parts of CIV list:
|
||||
// http://www.docksideradio.com/Icom%20Radio%20Hex%20Addresses.htm
|
||||
|
||||
// 7850 and 7851 have the same commands and are essentially identical
|
||||
|
@ -13,6 +15,7 @@ enum model_kind {
|
|||
model7100 = 0x88,
|
||||
model7200 = 0x76,
|
||||
model7300 = 0x94,
|
||||
modelR8600 = 0x96,
|
||||
model7600 = 0x7A,
|
||||
model7610 = 0x98,
|
||||
model7700 = 0x74,
|
||||
|
@ -20,9 +23,41 @@ enum model_kind {
|
|||
model7850 = 0x8E,
|
||||
model9700 = 0xA2,
|
||||
model705 = 0xA4,
|
||||
model706 = 0x58,
|
||||
modelUnknown = 0xFF
|
||||
};
|
||||
|
||||
enum rigInput{ inputMic=0,
|
||||
inputACC=1,
|
||||
inputUSB=3,
|
||||
inputLAN=5,
|
||||
inputACCA,
|
||||
inputACCB,
|
||||
inputNone,
|
||||
inputUnknown=0xff
|
||||
};
|
||||
|
||||
enum bandType { band23cm=1,
|
||||
band70cm,
|
||||
band2m,
|
||||
bandAir,
|
||||
bandWFM,
|
||||
band4m,
|
||||
band6m,
|
||||
band10m,
|
||||
band12m,
|
||||
band15m,
|
||||
band17m,
|
||||
band20m,
|
||||
band30m,
|
||||
band40m,
|
||||
band60m,
|
||||
band80m,
|
||||
band160m,
|
||||
band630m,
|
||||
band2200m,
|
||||
bandGen
|
||||
};
|
||||
|
||||
model_kind determineRadioModel(unsigned char rigID);
|
||||
|
||||
|
@ -38,11 +73,30 @@ struct rigCapabilities {
|
|||
bool hasEthernet;
|
||||
bool hasWiFi;
|
||||
|
||||
QVector<rigInput> inputs;
|
||||
|
||||
bool hasSpectrum;
|
||||
quint8 spectSeqMax;
|
||||
quint16 spectAmpMax;
|
||||
quint16 spectLenMax;
|
||||
|
||||
bool hasDD;
|
||||
bool hasDV;
|
||||
bool hasATU;
|
||||
|
||||
bool hasCTCSS;
|
||||
bool hasDTCS;
|
||||
|
||||
bool hasTransmit;
|
||||
bool hasAttenuator;
|
||||
bool hasPreamp;
|
||||
bool hasAntennaSel;
|
||||
|
||||
std::vector <unsigned char> attenuators;
|
||||
std::vector <unsigned char> preamps;
|
||||
std::vector <unsigned char> antennas;
|
||||
std::vector <bandType> bands;
|
||||
unsigned char bsr[20] = {0};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#include "satellitesetup.h"
|
||||
#include "ui_satellitesetup.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
satelliteSetup::satelliteSetup(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::satelliteSetup)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
satelliteSetup::~satelliteSetup()
|
||||
{
|
||||
delete ui;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef SATELLITESETUP_H
|
||||
#define SATELLITESETUP_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class satelliteSetup;
|
||||
}
|
||||
|
||||
class satelliteSetup : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit satelliteSetup(QWidget *parent = 0);
|
||||
~satelliteSetup();
|
||||
|
||||
private:
|
||||
Ui::satelliteSetup *ui;
|
||||
};
|
||||
|
||||
#endif // SATELLITESETUP_H
|
|
@ -0,0 +1,534 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>satelliteSetup</class>
|
||||
<widget class="QDialog" name="satelliteSetup">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>563</width>
|
||||
<height>311</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>563</width>
|
||||
<height>311</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>563</width>
|
||||
<height>311</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Satellite Setup</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>9</x>
|
||||
<y>9</y>
|
||||
<width>541</width>
|
||||
<height>291</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Satellite Setup:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton">
|
||||
<property name="text">
|
||||
<string>Linear Inverting</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_3">
|
||||
<property name="text">
|
||||
<string>Linear Non-Inverting</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_2">
|
||||
<property name="text">
|
||||
<string>FM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="fmSetupLayout">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Uplink:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Downlink:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>30</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="linearUplinkLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Uplink from:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>To:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="linearDownlinkLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Downlink from:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>To:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="linearTelemetryLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Telemetry: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Additional Spectrum Margin (KHz)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox">
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>(added to both sides)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Set VFOs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Set Spectrum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="text">
|
||||
<string>Add Markers</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
1739
udphandler.cpp
1739
udphandler.cpp
Plik diff jest za duży
Load Diff
238
udphandler.h
238
udphandler.h
|
@ -8,6 +8,8 @@
|
|||
#include <QTimer>
|
||||
#include <QMutex>
|
||||
#include <QDateTime>
|
||||
#include <QByteArray>
|
||||
#include <QVector>
|
||||
|
||||
// Allow easy endian-ness conversions
|
||||
#include <QtEndian>
|
||||
|
@ -17,47 +19,70 @@
|
|||
#include <QBuffer>
|
||||
#include <QThread>
|
||||
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "rxaudiohandler.h"
|
||||
#include "audiohandler.h"
|
||||
#include "packettypes.h"
|
||||
|
||||
#define PURGE_SECONDS 10
|
||||
#define TOKEN_RENEWAL 60000
|
||||
#define PING_PERIOD 100
|
||||
#define IDLE_PERIOD 100
|
||||
#define TXAUDIO_PERIOD 10
|
||||
#define AREYOUTHERE_PERIOD 500
|
||||
#define WATCHDOG_PERIOD 500
|
||||
#define RETRANSMIT_PERIOD 100
|
||||
|
||||
struct udpPreferences {
|
||||
QString ipAddress;
|
||||
quint16 controlLANPort;
|
||||
quint16 serialLANPort;
|
||||
quint16 audioLANPort;
|
||||
QString username;
|
||||
QString password;
|
||||
QString audioOutput;
|
||||
QString audioInput;
|
||||
quint16 audioRXLatency;
|
||||
quint16 audioTXLatency;
|
||||
quint16 audioRXSampleRate;
|
||||
quint8 audioRXCodec;
|
||||
quint16 audioTXSampleRate;
|
||||
quint8 audioTXCodec;
|
||||
quint8 resampleQuality;
|
||||
QString clientName;
|
||||
};
|
||||
|
||||
void passcode(QString in, QByteArray& out);
|
||||
QByteArray parseNullTerminatedString(QByteArray c, int s);
|
||||
|
||||
// Parent class that contains all common items.
|
||||
class udpBase : public QObject
|
||||
{
|
||||
|
||||
|
||||
public:
|
||||
~udpBase();
|
||||
|
||||
void init();
|
||||
|
||||
qint64 SendTrackedPacket(QByteArray d);
|
||||
qint64 SendPacketConnect();
|
||||
qint64 SendPacketConnect2();
|
||||
qint64 SendPacketDisconnect();
|
||||
void SendPkt0Idle(bool tracked, quint16 seq);
|
||||
void SendPkt7Idle();
|
||||
void PurgeOldEntries();
|
||||
void dataReceived(QByteArray r);
|
||||
void sendPing();
|
||||
void sendRetransmitRange(quint16 first, quint16 second, quint16 third,quint16 fourth);
|
||||
|
||||
void DataReceived(QByteArray r);
|
||||
void sendControl(bool tracked,quint8 id, quint16 seq);
|
||||
|
||||
QTime timeStarted;
|
||||
|
||||
unsigned char* Passcode(QString str);
|
||||
QByteArray parseNullTerminatedString(QByteArray c, int s);
|
||||
QUdpSocket* udp=Q_NULLPTR;
|
||||
uint32_t localSID = 0;
|
||||
uint32_t remoteSID = 0;
|
||||
char authID[6] = { 0, 0, 0, 0, 0, 0 };
|
||||
char a8replyID[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
uint16_t authInnerSendSeq = 0;
|
||||
uint16_t innerSendSeq = 0x8304; // Not sure why?
|
||||
uint32_t myId = 0;
|
||||
uint32_t remoteId = 0;
|
||||
uint8_t authSeq = 0x00;
|
||||
//uint16_t innerSendSeq = 0x8304; // Not sure why?
|
||||
uint16_t sendSeqB = 0;
|
||||
uint16_t sendSeq = 1;
|
||||
uint16_t lastReceivedSeq = 0;
|
||||
uint16_t lastReceivedSeq = 1;
|
||||
uint16_t pkt0SendSeq = 0;
|
||||
uint16_t pkt7SendSeq = 0;
|
||||
uint16_t periodicSeq = 0;
|
||||
QDateTime lastPacket0Sent;
|
||||
QDateTime lastPacket7Sent;
|
||||
quint64 latency = 0;
|
||||
|
||||
QString username = "";
|
||||
|
@ -67,48 +92,75 @@ public:
|
|||
bool isAuthenticated = false;
|
||||
quint16 localPort=0;
|
||||
quint16 port=0;
|
||||
QTimer *pkt7Timer=Q_NULLPTR; // Send pkt7 packets every 3 seconds
|
||||
QTimer *pkt0Timer=Q_NULLPTR; // Send pkt0 packets every 1000ms.
|
||||
QTimer *periodic=Q_NULLPTR; // Send pkt0 packets every 1000ms.
|
||||
bool periodicRunning = false;
|
||||
bool sentPacketConnect2 = false;
|
||||
time_t lastReceived = time(0);
|
||||
QMutex mutex;
|
||||
QTime lastReceived =QTime::currentTime();
|
||||
QMutex udpMutex;
|
||||
QMutex txBufferMutex;
|
||||
QMutex rxBufferMutex;
|
||||
|
||||
struct SEQBUFENTRY {
|
||||
time_t timeSent;
|
||||
QTime timeSent;
|
||||
uint16_t seqNum;
|
||||
QByteArray data;
|
||||
quint8 retransmitCount;
|
||||
};
|
||||
|
||||
QList <SEQBUFENTRY> txSeqBuf = QList<SEQBUFENTRY>();
|
||||
QList <SEQBUFENTRY> seqBuf = QList<SEQBUFENTRY>();
|
||||
QVector<SEQBUFENTRY> txSeqBuf;
|
||||
|
||||
QVector<quint16> rxSeqBuf;
|
||||
|
||||
QVector<SEQBUFENTRY> rxMissing;
|
||||
|
||||
void sendTrackedPacket(QByteArray d);
|
||||
void purgeOldEntries();
|
||||
|
||||
QTimer* areYouThereTimer = Q_NULLPTR; // Send are-you-there packets every second until a response is received.
|
||||
QTimer* pingTimer = Q_NULLPTR; // Start sending pings immediately.
|
||||
QTimer* idleTimer = Q_NULLPTR; // Start watchdog once we are connected.
|
||||
|
||||
QTimer* watchdogTimer = Q_NULLPTR;
|
||||
QTimer* retransmitTimer = Q_NULLPTR;
|
||||
|
||||
QDateTime lastPingSentTime;
|
||||
uint16_t pingSendSeq = 0;
|
||||
|
||||
quint16 areYouThereCounter=0;
|
||||
|
||||
quint32 packetsSent=0;
|
||||
quint32 packetsLost=0;
|
||||
|
||||
quint16 seqPrefix = 0;
|
||||
|
||||
private:
|
||||
void sendRetransmitRequest();
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Class for all (pseudo) serial communications
|
||||
class udpSerial : public udpBase
|
||||
class udpCivData : public udpBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
udpSerial(QHostAddress local, QHostAddress ip, quint16 sport);
|
||||
udpCivData(QHostAddress local, QHostAddress ip, quint16 civPort);
|
||||
~udpCivData();
|
||||
QMutex serialmutex;
|
||||
|
||||
signals:
|
||||
//void ReceiveSerial(QByteArray);
|
||||
int Receive(QByteArray);
|
||||
int receive(QByteArray);
|
||||
|
||||
public slots:
|
||||
int Send(QByteArray d);
|
||||
void send(QByteArray d);
|
||||
|
||||
|
||||
private:
|
||||
void DataReceived();
|
||||
void SendIdle();
|
||||
void SendPeriodic();
|
||||
qint64 SendPacketOpenClose(bool close);
|
||||
void watchdog();
|
||||
void dataReceived();
|
||||
void sendOpenClose(bool close);
|
||||
|
||||
QTimer* startCivDataTimer = Q_NULLPTR;
|
||||
};
|
||||
|
||||
|
||||
|
@ -118,40 +170,52 @@ class udpAudio : public udpBase
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
udpAudio(QHostAddress local, QHostAddress ip, quint16 aport, quint16 buffer, quint16 rxsample, quint8 rxcodec, quint16 txsample, quint8 txcodec);
|
||||
udpAudio(QHostAddress local, QHostAddress ip, quint16 aport, quint16 rxlatency, quint16 txlatency, quint16 rxsample, quint8 rxcodec, quint16 txsample, quint8 txcodec, QString outputPort, QString inputPort,quint8 resampleQuality);
|
||||
~udpAudio();
|
||||
QAudioOutput* audio;
|
||||
|
||||
signals:
|
||||
void haveAudioData(QByteArray data);
|
||||
void setupAudio(const QAudioFormat format, const quint16 bufferSize, const bool isulaw);
|
||||
void haveChangeBufferSize(quint16 value);
|
||||
void haveAudioData(audioPacket data);
|
||||
|
||||
void setupTxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, QString port, quint8 resampleQuality);
|
||||
void setupRxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, QString port, quint8 resampleQuality);
|
||||
|
||||
void haveChangeLatency(quint16 value);
|
||||
void haveSetVolume(unsigned char value);
|
||||
|
||||
public slots:
|
||||
void changeBufferSize(quint16 value);
|
||||
void changeLatency(quint16 value);
|
||||
void setVolume(unsigned char value);
|
||||
|
||||
private:
|
||||
|
||||
void DataReceived();
|
||||
void sendTxAudio();
|
||||
void dataReceived();
|
||||
void watchdog();
|
||||
|
||||
QAudioFormat format;
|
||||
quint16 bufferSize;
|
||||
quint16 rxLatency;
|
||||
quint16 txLatency;
|
||||
quint16 rxSampleRate;
|
||||
quint16 txSampleRate;
|
||||
quint8 rxCodec;
|
||||
quint8 txCodec;
|
||||
quint8 rxChannelCount = 1;
|
||||
bool rxIsUlawCodec = false;
|
||||
quint8 rxNumSamples = 16;
|
||||
quint8 rxNumSamples = 8;
|
||||
quint8 txChannelCount = 1;
|
||||
bool txIsUlawCodec = false;
|
||||
quint8 txNumSamples = 16;
|
||||
quint8 txNumSamples = 8;
|
||||
|
||||
bool sentPacketConnect2 = false;
|
||||
uint16_t sendAudioSeq = 0;
|
||||
|
||||
rxAudioHandler* rxaudio;
|
||||
QThread* rxAudioThread;
|
||||
audioHandler* rxaudio = Q_NULLPTR;
|
||||
QThread* rxAudioThread = Q_NULLPTR;
|
||||
|
||||
audioHandler* txaudio = Q_NULLPTR;
|
||||
QThread* txAudioThread = Q_NULLPTR;
|
||||
|
||||
QTimer* txAudioTimer=Q_NULLPTR;
|
||||
|
||||
};
|
||||
|
||||
|
@ -163,37 +227,41 @@ class udpHandler: public udpBase
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
udpHandler(QString ip, quint16 cport, quint16 sport, quint16 aport, QString username, QString password,
|
||||
quint16 buffer, quint16 rxsample, quint8 rxcodec, quint16 txsample, quint8 txcodec);
|
||||
udpHandler(udpPreferences prefs);
|
||||
~udpHandler();
|
||||
|
||||
udpSerial *serial=Q_NULLPTR;
|
||||
udpAudio *audio=Q_NULLPTR;
|
||||
|
||||
bool serialAndAudioOpened = false;
|
||||
bool streamOpened = false;
|
||||
|
||||
udpCivData* civ = Q_NULLPTR;
|
||||
udpAudio* audio = Q_NULLPTR;
|
||||
|
||||
|
||||
public slots:
|
||||
void receiveDataFromUserToRig(QByteArray); // This slot will send data on to
|
||||
void receiveFromSerialStream(QByteArray);
|
||||
void changeBufferSize(quint16 value);
|
||||
|
||||
void receiveFromCivStream(QByteArray);
|
||||
void receiveAudioData(const audioPacket &data);
|
||||
void changeLatency(quint16 value);
|
||||
void setVolume(unsigned char value);
|
||||
void init();
|
||||
|
||||
signals:
|
||||
void RigConnected(const QString&);
|
||||
void haveDataFromPort(QByteArray data); // emit this when we have data, connect to rigcommander
|
||||
void haveAudioData(audioPacket data); // emit this when we have data, connect to rigcommander
|
||||
void haveNetworkError(QString, QString);
|
||||
void haveChangeLatency(quint16 value);
|
||||
void haveSetVolume(unsigned char value);
|
||||
void haveNetworkStatus(QString);
|
||||
void haveChangeBufferSize(quint16 value);
|
||||
|
||||
private:
|
||||
|
||||
void sendAreYouThere();
|
||||
|
||||
void dataReceived();
|
||||
|
||||
void sendRequestStream();
|
||||
void sendLogin();
|
||||
void sendToken(uint8_t magic);
|
||||
|
||||
qint64 SendRequestSerialAndAudio();
|
||||
qint64 SendPacketLogin();
|
||||
qint64 SendPacketAuth(uint8_t magic);
|
||||
void ReAuth();
|
||||
void DataReceived();
|
||||
bool gotA8ReplyID = false;
|
||||
bool gotAuthOK = false;
|
||||
|
||||
|
@ -203,19 +271,43 @@ private:
|
|||
|
||||
bool radioInUse = false;
|
||||
|
||||
quint16 aport;
|
||||
quint16 sport;
|
||||
quint16 controlPort;
|
||||
quint16 civPort;
|
||||
quint16 audioPort;
|
||||
|
||||
quint16 rxSampleRate;
|
||||
quint16 txSampleRate;
|
||||
quint16 rxBufferSize;
|
||||
quint16 rxLatency;
|
||||
quint16 txLatency;
|
||||
quint8 rxCodec;
|
||||
quint8 txCodec;
|
||||
|
||||
QString audioInputPort;
|
||||
QString audioOutputPort;
|
||||
|
||||
quint8 resampleQuality;
|
||||
|
||||
quint16 reauthInterval = 60000;
|
||||
QTimer reauthTimer;
|
||||
QByteArray devName;
|
||||
QByteArray compName;
|
||||
QString devName;
|
||||
QString compName;
|
||||
QString audioType;
|
||||
//QByteArray replyId;
|
||||
quint16 tokRequest;
|
||||
quint32 token;
|
||||
// These are for stream ident info.
|
||||
char identa;
|
||||
quint32 identb;
|
||||
|
||||
QByteArray usernameEncoded;
|
||||
QByteArray passwordEncoded;
|
||||
|
||||
QTimer* tokenTimer = Q_NULLPTR;
|
||||
QTimer* areYouThereTimer = Q_NULLPTR;
|
||||
|
||||
bool highBandwidthConnection = false;
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(struct audioPacket)
|
||||
|
||||
#endif
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,163 @@
|
|||
#ifndef UDPSERVER_H
|
||||
#define UDPSERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QUdpSocket>
|
||||
#include <QNetworkDatagram>
|
||||
#include <QNetworkInterface>
|
||||
#include <QHostInfo>
|
||||
#include <QTimer>
|
||||
#include <QMutex>
|
||||
#include <QDateTime>
|
||||
#include <QByteArray>
|
||||
#include <QList>
|
||||
#include <QVector>
|
||||
|
||||
// Allow easy endian-ness conversions
|
||||
#include <QtEndian>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <udpserversetup.h>
|
||||
#include "packettypes.h"
|
||||
#include "rigidentities.h"
|
||||
#include "audiohandler.h"
|
||||
|
||||
extern void passcode(QString in,QByteArray& out);
|
||||
extern QByteArray parseNullTerminatedString(QByteArray c, int s);
|
||||
|
||||
struct SEQBUFENTRY {
|
||||
QTime timeSent;
|
||||
uint16_t seqNum;
|
||||
QByteArray data;
|
||||
quint8 retransmitCount;
|
||||
};
|
||||
|
||||
class udpServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
udpServer(SERVERCONFIG config);
|
||||
~udpServer();
|
||||
|
||||
public slots:
|
||||
void init();
|
||||
void dataForServer(QByteArray);
|
||||
void receiveAudioData(const audioPacket &data);
|
||||
void receiveRigCaps(rigCapabilities caps);
|
||||
|
||||
signals:
|
||||
void haveDataFromServer(QByteArray);
|
||||
void haveAudioData(audioPacket data);
|
||||
void setupTxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, QString port, quint8 resampleQuality);
|
||||
void setupRxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, QString port, quint8 resampleQuality);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
struct CLIENT {
|
||||
bool connected = false;
|
||||
QHostAddress ipAddress;
|
||||
quint16 port;
|
||||
QByteArray clientName;
|
||||
QDateTime timeConnected;
|
||||
QDateTime lastHeard;
|
||||
bool isStreaming;
|
||||
quint16 civPort;
|
||||
quint16 audioPort;
|
||||
quint16 txBufferLen;
|
||||
quint32 myId;
|
||||
quint32 remoteId;
|
||||
quint16 txSeq=0;
|
||||
quint16 rxSeq;
|
||||
quint16 connSeq;
|
||||
quint16 pingSeq;
|
||||
quint32 rxPingTime; // 32bit as has other info
|
||||
quint8 authInnerSeq;
|
||||
quint16 authSeq;
|
||||
quint16 innerSeq;
|
||||
quint16 sendAudioSeq;
|
||||
quint8 identa;
|
||||
quint32 identb;
|
||||
quint16 tokenRx;
|
||||
quint32 tokenTx;
|
||||
quint32 commonCap;
|
||||
quint8 wdseq;
|
||||
QUdpSocket* socket;
|
||||
|
||||
|
||||
QTimer* pingTimer;
|
||||
QTimer* idleTimer;
|
||||
QTimer* wdTimer;
|
||||
QTimer* retransmitTimer;
|
||||
|
||||
// Only used for audio.
|
||||
quint8 rxCodec;
|
||||
quint8 txCodec;
|
||||
quint16 rxSampleRate;
|
||||
quint16 txSampleRate;
|
||||
SERVERUSER user;
|
||||
|
||||
QVector <SEQBUFENTRY> txSeqBuf;
|
||||
QVector <quint16> rxSeqBuf;
|
||||
QVector <SEQBUFENTRY> rxMissing;
|
||||
quint16 seqPrefix;
|
||||
};
|
||||
|
||||
void controlReceived();
|
||||
void civReceived();
|
||||
void audioReceived();
|
||||
void commonReceived(QList<CLIENT*>* l,CLIENT* c, QByteArray r);
|
||||
|
||||
void sendPing(QList<CLIENT*> *l,CLIENT* c, quint16 seq, bool reply);
|
||||
void sendControl(CLIENT* c, quint8 type, quint16 seq);
|
||||
void sendLoginResponse(CLIENT* c, bool allowed);
|
||||
void sendCapabilities(CLIENT* c);
|
||||
void sendConnectionInfo(CLIENT* c);
|
||||
void sendTokenResponse(CLIENT* c,quint8 type);
|
||||
void sendStatus(CLIENT* c);
|
||||
void sendRetransmitRequest(CLIENT* c);
|
||||
void watchdog(CLIENT* c);
|
||||
void sendRxAudio();
|
||||
void deleteConnection(QList<CLIENT*> *l, CLIENT* c);
|
||||
|
||||
SERVERCONFIG config;
|
||||
|
||||
QUdpSocket* udpControl = Q_NULLPTR;
|
||||
QUdpSocket* udpCiv = Q_NULLPTR;
|
||||
QUdpSocket* udpAudio = Q_NULLPTR;
|
||||
QHostAddress localIP;
|
||||
QString macAddress;
|
||||
|
||||
quint32 controlId = 0;
|
||||
quint32 civId = 0;
|
||||
quint32 audioId = 0;
|
||||
|
||||
quint8 rigciv = 0xa2;
|
||||
|
||||
QMutex mutex; // Used for critical operations.
|
||||
|
||||
QList <CLIENT*> controlClients = QList<CLIENT*>();
|
||||
QList <CLIENT*> civClients = QList<CLIENT*>();
|
||||
QList <CLIENT*> audioClients = QList<CLIENT*>();
|
||||
QTime timeStarted;
|
||||
rigCapabilities rigCaps;
|
||||
|
||||
audioHandler* rxaudio = Q_NULLPTR;
|
||||
QThread* rxAudioThread = Q_NULLPTR;
|
||||
|
||||
audioHandler* txaudio = Q_NULLPTR;
|
||||
QThread* txAudioThread = Q_NULLPTR;
|
||||
|
||||
QTimer* rxAudioTimer=Q_NULLPTR;
|
||||
quint16 rxSampleRate = 0;
|
||||
quint16 txSampleRate = 0;
|
||||
quint8 rxCodec = 0;
|
||||
quint8 txCodec = 0;
|
||||
|
||||
QHostAddress hasTxAudio;
|
||||
};
|
||||
|
||||
|
||||
#endif // UDPSERVER_H
|
|
@ -0,0 +1,111 @@
|
|||
#include "udpserversetup.h"
|
||||
#include "ui_udpserversetup.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
udpServerSetup::udpServerSetup(QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::udpServerSetup)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
// Get any stored config information from the main form.
|
||||
SERVERCONFIG config;
|
||||
emit serverConfig(config,false); // Just send blank server config.
|
||||
}
|
||||
|
||||
udpServerSetup::~udpServerSetup()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// Slot to receive config.
|
||||
void udpServerSetup::receiveServerConfig(SERVERCONFIG conf)
|
||||
{
|
||||
qDebug() << "Getting server config";
|
||||
|
||||
ui->enableCheckbox->setChecked(conf.enabled);
|
||||
ui->controlPortText->setText(QString::number(conf.controlPort));
|
||||
ui->civPortText->setText(QString::number(conf.civPort));
|
||||
ui->audioPortText->setText(QString::number(conf.audioPort));
|
||||
|
||||
int row = 0;
|
||||
|
||||
foreach (SERVERUSER user, conf.users)
|
||||
{
|
||||
if (user.username != "" && user.password != "")
|
||||
{
|
||||
if (ui->usersTable->rowCount() <= row) {
|
||||
ui->usersTable->insertRow(ui->usersTable->rowCount());
|
||||
}
|
||||
ui->usersTable->setItem(row, 0, new QTableWidgetItem(user.username));
|
||||
ui->usersTable->setItem(row, 1, new QTableWidgetItem(user.password));
|
||||
QComboBox* comboBox = new QComboBox();
|
||||
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
|
||||
comboBox->setCurrentIndex(user.userType);
|
||||
ui->usersTable->setCellWidget(row, 2, comboBox);
|
||||
row++;
|
||||
}
|
||||
}
|
||||
// Delete any rows no longer needed
|
||||
|
||||
for (int count = row; count <= ui->usersTable->rowCount(); count++)
|
||||
{
|
||||
if (count == conf.users.count()) {
|
||||
ui->usersTable->insertRow(ui->usersTable->rowCount());
|
||||
QComboBox* comboBox = new QComboBox();
|
||||
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
|
||||
ui->usersTable->setCellWidget(count, 2, comboBox);
|
||||
}
|
||||
else if (count > conf.users.count()) {
|
||||
ui->usersTable->removeRow(count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void udpServerSetup::accept()
|
||||
{
|
||||
qDebug() << "Server config stored";
|
||||
SERVERCONFIG config;
|
||||
config.enabled = ui->enableCheckbox->isChecked();
|
||||
config.controlPort = ui->controlPortText->text().toInt();
|
||||
config.civPort = ui->civPortText->text().toInt();
|
||||
config.audioPort = ui->audioPortText->text().toInt();
|
||||
|
||||
config.users.clear();
|
||||
|
||||
for (int row = 0; row < ui->usersTable->model()->rowCount(); row++)
|
||||
{
|
||||
if (ui->usersTable->item(row, 0) != NULL && ui->usersTable->item(row, 1) != NULL)
|
||||
{
|
||||
SERVERUSER user;
|
||||
user.username = ui->usersTable->item(row, 0)->text();
|
||||
user.password = ui->usersTable->item(row, 1)->text();
|
||||
QComboBox* comboBox = (QComboBox*)ui->usersTable->cellWidget(row, 2);
|
||||
user.userType = comboBox->currentIndex();
|
||||
config.users.append(user);
|
||||
|
||||
}
|
||||
else {
|
||||
ui->usersTable->removeRow(row);
|
||||
}
|
||||
}
|
||||
|
||||
emit serverConfig(config,true);
|
||||
this->hide();
|
||||
}
|
||||
|
||||
|
||||
void udpServerSetup::on_usersTable_cellClicked(int row, int col)
|
||||
{
|
||||
qDebug() << "Clicked on " << row << "," << col;
|
||||
if (row == ui->usersTable->model()->rowCount() - 1 && ui->usersTable->item(row, 0) != NULL && ui->usersTable->item(row, 1) != NULL) {
|
||||
ui->usersTable->insertRow(ui->usersTable->rowCount());
|
||||
QComboBox* comboBox = new QComboBox();
|
||||
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
|
||||
userTypes.append(comboBox);
|
||||
ui->usersTable->setCellWidget(ui->usersTable->rowCount() - 1, 2, comboBox);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef UDPSERVERSETUP_H
|
||||
#define UDPSERVERSETUP_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QComboBox>
|
||||
#include <QList>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
struct SERVERUSER {
|
||||
QString username;
|
||||
QString password;
|
||||
quint8 userType;
|
||||
};
|
||||
|
||||
struct SERVERCONFIG {
|
||||
bool enabled;
|
||||
bool lan;
|
||||
quint16 controlPort;
|
||||
quint16 civPort;
|
||||
quint16 audioPort;
|
||||
QString audioOutput;
|
||||
QString audioInput;
|
||||
quint8 resampleQuality;
|
||||
|
||||
QList <SERVERUSER> users;
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class udpServerSetup;
|
||||
}
|
||||
|
||||
class udpServerSetup : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit udpServerSetup(QWidget* parent = 0);
|
||||
~udpServerSetup();
|
||||
|
||||
private slots:
|
||||
void on_usersTable_cellClicked(int row, int col);
|
||||
|
||||
public slots:
|
||||
void receiveServerConfig(SERVERCONFIG conf);
|
||||
|
||||
signals:
|
||||
void serverConfig(SERVERCONFIG conf, bool store);
|
||||
|
||||
private:
|
||||
Ui::udpServerSetup* ui;
|
||||
void accept();
|
||||
QList<QComboBox*> userTypes;
|
||||
};
|
||||
|
||||
#endif // UDPSERVER_H
|
|
@ -0,0 +1,392 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>udpServerSetup</class>
|
||||
<widget class="QDialog" name="udpServerSetup">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>440</width>
|
||||
<height>351</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>440</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>440</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Server Setup</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Server Setup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="enableCheckbox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Contol Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="controlPortText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>99999</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>50001</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Civ Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="civPortText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>99999</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>50002</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Audio Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="audioPortText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>99999</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>50003</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QTableWidget" name="usersTable">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>160</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>750</width>
|
||||
<height>330</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>100</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Username</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Admin</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="okButton">
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>okButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>udpServerSetup</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>278</x>
|
||||
<y>253</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>96</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>cancelButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>udpServerSetup</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>369</x>
|
||||
<y>253</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>179</x>
|
||||
<y>282</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
2828
wfmain.cpp
2828
wfmain.cpp
Plik diff jest za duży
Load Diff
366
wfmain.h
366
wfmain.h
|
@ -15,6 +15,15 @@
|
|||
#include "rigcommander.h"
|
||||
#include "freqmemory.h"
|
||||
#include "rigidentities.h"
|
||||
#include "repeaterattributes.h"
|
||||
|
||||
#include "calibrationwindow.h"
|
||||
#include "repeatersetup.h"
|
||||
#include "satellitesetup.h"
|
||||
#include "udpserversetup.h"
|
||||
#include "udpserver.h"
|
||||
#include "qledlabel.h"
|
||||
#include "rigctld.h"
|
||||
|
||||
#include <qcustomplot.h>
|
||||
#include <qserialportinfo.h>
|
||||
|
@ -34,31 +43,85 @@ public:
|
|||
~wfmain();
|
||||
|
||||
signals:
|
||||
// Power
|
||||
void sendPowerOn();
|
||||
void sendPowerOff();
|
||||
|
||||
// Frequency, mode, band:
|
||||
void getFrequency();
|
||||
void setFrequency(double freq);
|
||||
void setFrequency(freqt freq);
|
||||
void getMode();
|
||||
void setMode(char modeIndex);
|
||||
void setMode(unsigned char modeIndex, unsigned char modeFilter);
|
||||
void setDataMode(bool dataOn);
|
||||
void getDataMode();
|
||||
void getPTT();
|
||||
void setPTT(bool pttOn);
|
||||
void getModInput(bool dataOn);
|
||||
void setModInput(rigInput input, bool dataOn);
|
||||
void getBandStackReg(char band, char regCode);
|
||||
void getDebug();
|
||||
void getRitEnabled();
|
||||
void getRitValue();
|
||||
void setRitValue(int ritValue);
|
||||
void setRitEnable(bool ritEnabled);
|
||||
|
||||
// Repeater:
|
||||
void getDuplexMode();
|
||||
void getTone();
|
||||
void getTSQL();
|
||||
void getDTCS();
|
||||
void getRptAccessMode();
|
||||
|
||||
// Level get:
|
||||
void getLevels(); // get all levels
|
||||
void getRfGain();
|
||||
void getAfGain();
|
||||
void getSql();
|
||||
void getDebug();
|
||||
void getTxPower();
|
||||
void getMicGain();
|
||||
void getSpectrumRefLevel();
|
||||
void getModInputLevel(rigInput input);
|
||||
|
||||
// Level set:
|
||||
void setRfGain(unsigned char level);
|
||||
void setAfGain(unsigned char level);
|
||||
void setSql(unsigned char level);
|
||||
void setMicGain(unsigned char);
|
||||
void setCompLevel(unsigned char);
|
||||
void setTxPower(unsigned char);
|
||||
void setMonitorLevel(unsigned char);
|
||||
void setVoxGain(unsigned char);
|
||||
void setAntiVoxGain(unsigned char);
|
||||
void setSpectrumRefLevel(int);
|
||||
|
||||
void setModLevel(rigInput input, unsigned char level);
|
||||
void setACCGain(unsigned char level);
|
||||
void setACCAGain(unsigned char level);
|
||||
void setACCBGain(unsigned char level);
|
||||
void setUSBGain(unsigned char level);
|
||||
void setLANGain(unsigned char level);
|
||||
|
||||
void getMeters(meterKind meter);
|
||||
|
||||
|
||||
// PTT, ATU, ATT, Antenna, Preamp:
|
||||
void getPTT();
|
||||
void setPTT(bool pttOn);
|
||||
void getAttenuator();
|
||||
void getPreamp();
|
||||
void getAntenna();
|
||||
void setAttenuator(unsigned char att);
|
||||
void setPreamp(unsigned char pre);
|
||||
void setAntenna(unsigned char ant);
|
||||
void startATU();
|
||||
void setATU(bool atuEnabled);
|
||||
void getATUStatus();
|
||||
|
||||
void getRigID(); // this is the model of the rig
|
||||
void getRigCIV(); // get the rig's CIV addr
|
||||
void spectOutputEnable();
|
||||
void spectOutputDisable();
|
||||
void scopeDisplayEnable();
|
||||
void scopeDisplayDisable();
|
||||
void setScopeCenterMode(bool centerEnable);
|
||||
void setScopeMode(spectrumMode spectMode);
|
||||
void setScopeSpan(char span);
|
||||
void setScopeEdge(char edge);
|
||||
void setScopeFixedEdge(double startFreq, double endFreq, unsigned char edgeNumber);
|
||||
|
@ -69,10 +132,12 @@ signals:
|
|||
void sayMode();
|
||||
void sayAll();
|
||||
void sendCommSetup(unsigned char rigCivAddr, QString rigSerialPort, quint32 rigBaudRate);
|
||||
void sendCommSetup(unsigned char rigCivAddr, QString ip, quint16 cport, quint16 sport, quint16 aport,
|
||||
QString username, QString password, quint16 buffer, quint16 rxsample, quint8 rxcodec, quint16 txsample, quint8 txcodec);
|
||||
void sendCommSetup(unsigned char rigCivAddr, udpPreferences prefs);
|
||||
void sendCloseComm();
|
||||
void sendChangeBufferSize(quint16 value);
|
||||
void sendChangeLatency(quint16 latency);
|
||||
void initServer();
|
||||
void sendServerConfig(SERVERCONFIG conf);
|
||||
void sendRigCaps(rigCapabilities caps);
|
||||
|
||||
private slots:
|
||||
void shortcutF1();
|
||||
|
@ -111,19 +176,49 @@ private slots:
|
|||
|
||||
void handlePttLimit(); // hit at 3 min transmit length
|
||||
|
||||
void on_startBtn_clicked();
|
||||
void receiveCommReady();
|
||||
void receiveFreq(double);
|
||||
void receiveMode(QString);
|
||||
void receiveFreq(freqt);
|
||||
void receiveMode(unsigned char mode, unsigned char filter);
|
||||
void receiveSpectrumData(QByteArray spectrum, double startFreq, double endFreq);
|
||||
void receiveSpectrumFixedMode(bool isFixed);
|
||||
void receiveSpectrumMode(spectrumMode spectMode);
|
||||
void receiveSpectrumSpan(freqt freqspan, bool isSub);
|
||||
void receivePTTstatus(bool pttOn);
|
||||
void receiveDataModeStatus(bool dataOn);
|
||||
void receiveBandStackReg(float freq, char mode, bool dataOn); // freq, mode, (filter,) datamode
|
||||
void receiveRITStatus(bool ritEnabled);
|
||||
void receiveRITValue(int ritValHz);
|
||||
void receiveModInput(rigInput input, bool dataOn);
|
||||
//void receiveDuplexMode(duplexMode dm);
|
||||
|
||||
|
||||
|
||||
// Levels:
|
||||
void receiveRfGain(unsigned char level);
|
||||
void receiveAfGain(unsigned char level);
|
||||
void receiveSql(unsigned char level);
|
||||
void receiveTxPower(unsigned char power);
|
||||
void receiveMicGain(unsigned char gain);
|
||||
void receiveCompLevel(unsigned char compLevel);
|
||||
void receiveMonitorGain(unsigned char monitorGain);
|
||||
void receiveVoxGain(unsigned char voxGain);
|
||||
void receiveAntiVoxGain(unsigned char antiVoxGain);
|
||||
void receiveSpectrumRefLevel(int level);
|
||||
void receiveACCGain(unsigned char level, unsigned char ab);
|
||||
void receiveUSBGain(unsigned char level);
|
||||
void receiveLANGain(unsigned char level);
|
||||
|
||||
// Meters:
|
||||
void receiveMeter(meterKind meter, unsigned char level);
|
||||
// void receiveSMeter(unsigned char level);
|
||||
// void receivePowerMeter(unsigned char level);
|
||||
// void receiveALCMeter(unsigned char level);
|
||||
// void receiveCompMeter(unsigned char level);
|
||||
|
||||
|
||||
void receiveATUStatus(unsigned char atustatus);
|
||||
void receivePreamp(unsigned char pre);
|
||||
void receiveAttenuator(unsigned char att);
|
||||
//void receiveAntennaSel(unsigned char ant);
|
||||
void receiveRigID(rigCapabilities rigCaps);
|
||||
void receiveFoundRigID(rigCapabilities rigCaps);
|
||||
void receiveSerialPortError(QString port, QString errorText);
|
||||
|
@ -135,7 +230,9 @@ private slots:
|
|||
void handleWFScroll(QWheelEvent *);
|
||||
void handlePlotScroll(QWheelEvent *);
|
||||
void runDelayedCommand();
|
||||
void runPeriodicCommands();
|
||||
void showStatusBarText(QString text);
|
||||
void serverConfigRequested(SERVERCONFIG conf, bool store);
|
||||
|
||||
// void on_getFreqBtn_clicked();
|
||||
|
||||
|
@ -143,8 +240,6 @@ private slots:
|
|||
|
||||
// void on_debugBtn_clicked();
|
||||
|
||||
void on_stopBtn_clicked();
|
||||
|
||||
void on_clearPeakBtn_clicked();
|
||||
|
||||
void on_drawPeakChk_clicked(bool checked);
|
||||
|
@ -171,9 +266,6 @@ private slots:
|
|||
|
||||
void on_fCEbtn_clicked();
|
||||
|
||||
|
||||
void on_scopeCenterModeChk_clicked(bool checked);
|
||||
|
||||
void on_fEnterBtn_clicked();
|
||||
|
||||
void on_scopeBWCombo_currentIndexChanged(int index);
|
||||
|
@ -216,8 +308,6 @@ private slots:
|
|||
|
||||
void on_aboutBtn_clicked();
|
||||
|
||||
void on_aboutQtBtn_clicked();
|
||||
|
||||
void on_fStoBtn_clicked();
|
||||
|
||||
void on_fRclBtn_clicked();
|
||||
|
@ -226,8 +316,6 @@ private slots:
|
|||
|
||||
void on_afGainSlider_valueChanged(int value);
|
||||
|
||||
void on_drawTracerChk_toggled(bool checked);
|
||||
|
||||
void on_tuneNowBtn_clicked();
|
||||
|
||||
void on_tuneEnableChk_clicked(bool checked);
|
||||
|
@ -245,16 +333,12 @@ private slots:
|
|||
|
||||
void on_pttEnableChk_clicked(bool checked);
|
||||
|
||||
void on_lanEnableChk_clicked(bool checked);
|
||||
void on_lanEnableBtn_clicked(bool checked);
|
||||
|
||||
void on_ipAddressTxt_textChanged(QString text);
|
||||
|
||||
void on_controlPortTxt_textChanged(QString text);
|
||||
|
||||
void on_serialPortTxt_textChanged(QString text);
|
||||
|
||||
void on_audioPortTxt_textChanged(QString text);
|
||||
|
||||
void on_usernameTxt_textChanged(QString text);
|
||||
|
||||
void on_passwordTxt_textChanged(QString text);
|
||||
|
@ -267,7 +351,9 @@ private slots:
|
|||
|
||||
void on_connectBtn_clicked();
|
||||
|
||||
void on_audioBufferSizeSlider_valueChanged(int value);
|
||||
void on_rxLatencySlider_valueChanged(int value);
|
||||
|
||||
void on_txLatencySlider_valueChanged(int value);
|
||||
|
||||
void on_audioRXCodecCombo_currentIndexChanged(int value);
|
||||
|
||||
|
@ -277,6 +363,76 @@ private slots:
|
|||
|
||||
void on_scopeEnableWFBtn_clicked(bool checked);
|
||||
|
||||
void on_sqlSlider_valueChanged(int value);
|
||||
|
||||
void on_modeFilterCombo_activated(int index);
|
||||
|
||||
void on_dataModeBtn_toggled(bool checked);
|
||||
|
||||
void on_udpServerSetupBtn_clicked();
|
||||
|
||||
void on_transmitBtn_clicked();
|
||||
|
||||
void on_adjRefBtn_clicked();
|
||||
|
||||
void on_satOpsBtn_clicked();
|
||||
|
||||
void on_txPowerSlider_valueChanged(int value);
|
||||
|
||||
void on_micGainSlider_valueChanged(int value);
|
||||
|
||||
void on_scopeRefLevelSlider_valueChanged(int value);
|
||||
|
||||
void on_useSystemThemeChk_clicked(bool checked);
|
||||
|
||||
void on_modInputCombo_activated(int index);
|
||||
|
||||
void on_modInputDataCombo_activated(int index);
|
||||
|
||||
void on_tuneLockChk_clicked(bool checked);
|
||||
|
||||
void on_spectrumModeCombo_currentIndexChanged(int index);
|
||||
|
||||
void on_serialEnableBtn_clicked(bool checked);
|
||||
|
||||
void on_tuningStepCombo_currentIndexChanged(int index);
|
||||
|
||||
void on_serialDeviceListCombo_activated(const QString &arg1);
|
||||
|
||||
void on_rptSetupBtn_clicked();
|
||||
|
||||
void on_attSelCombo_activated(int index);
|
||||
|
||||
void on_preampSelCombo_activated(int index);
|
||||
|
||||
void on_antennaSelCombo_activated(int index);
|
||||
|
||||
void on_wfthemeCombo_activated(int index);
|
||||
|
||||
void on_rigPowerOnBtn_clicked();
|
||||
|
||||
void on_rigPowerOffBtn_clicked();
|
||||
|
||||
void on_ritTuneDial_valueChanged(int value);
|
||||
|
||||
void on_ritEnableChk_clicked(bool checked);
|
||||
|
||||
void on_band23cmbtn_clicked();
|
||||
|
||||
void on_band70cmbtn_clicked();
|
||||
|
||||
void on_band2mbtn_clicked();
|
||||
|
||||
void on_band4mbtn_clicked();
|
||||
|
||||
void on_band630mbtn_clicked();
|
||||
|
||||
void on_band2200mbtn_clicked();
|
||||
|
||||
void on_bandAirbtn_clicked();
|
||||
|
||||
void on_bandWFMbtn_clicked();
|
||||
|
||||
private:
|
||||
Ui::wfmain *ui;
|
||||
QSettings settings;
|
||||
|
@ -284,13 +440,19 @@ private:
|
|||
void saveSettings();
|
||||
QCustomPlot *plot; // line plot
|
||||
QCustomPlot *wf; // waterfall image
|
||||
QCPItemTracer * tracer; // marker of current frequency
|
||||
QCPItemLine * freqIndicatorLine;
|
||||
//commHandler *comm;
|
||||
void setAppTheme(bool isDark);
|
||||
void setAppTheme(bool isCustom);
|
||||
void setPlotTheme(QCustomPlot *plot, bool isDark);
|
||||
void prepareWf();
|
||||
void getInitialRigState();
|
||||
void setBandButtons();
|
||||
void showButton(QPushButton *btn);
|
||||
void hideButton(QPushButton *btn);
|
||||
|
||||
void openRig();
|
||||
void powerRigOff();
|
||||
void powerRigOn();
|
||||
QWidget * theParent;
|
||||
QStringList portList;
|
||||
QString serialPortRig;
|
||||
|
@ -333,19 +495,24 @@ private:
|
|||
|
||||
|
||||
rigCommander * rig=Q_NULLPTR;
|
||||
QThread * rigThread=Q_NULLPTR;
|
||||
QThread* rigThread = Q_NULLPTR;
|
||||
QCPColorMap * colorMap;
|
||||
QCPColorMapData * colorMapData;
|
||||
QCPColorScale * colorScale;
|
||||
QTimer * delayedCommand;
|
||||
QTimer * periodicPollingTimer;
|
||||
QTimer * pttTimer;
|
||||
|
||||
|
||||
QStringList modes;
|
||||
int currentModeIndex;
|
||||
QStringList spans;
|
||||
QStringList edges;
|
||||
QStringList commPorts;
|
||||
QLabel* rigStatus;
|
||||
QLabel* rigName;
|
||||
QLedLabel* pttLed;
|
||||
QLedLabel* connectedLed;
|
||||
|
||||
quint16 spectWidth;
|
||||
quint16 wfLength;
|
||||
|
@ -354,6 +521,12 @@ private:
|
|||
|
||||
QByteArray spectrumPeaks;
|
||||
|
||||
QByteArray powerMeterReadings;
|
||||
int powerMeterPos = 0;
|
||||
|
||||
QByteArray SMeterReadings;
|
||||
int smeterPos=0;
|
||||
|
||||
QVector <QByteArray> wfimage;
|
||||
|
||||
bool onFullscreen;
|
||||
|
@ -363,13 +536,27 @@ private:
|
|||
|
||||
double oldLowerFreq;
|
||||
double oldUpperFreq;
|
||||
double freqMhz;
|
||||
double knobFreqMhz;
|
||||
enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdGetMode, cmdGetDataMode, cmdSetDataModeOn, cmdSetDataModeOff,
|
||||
freqt freq;
|
||||
float tsKnobMHz;
|
||||
|
||||
enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdGetMode, cmdGetDataMode,
|
||||
cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue,
|
||||
cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdGetAfGain,
|
||||
cmdGetSql, cmdGetATUStatus, cmdScopeCenterMode, cmdScopeFixedMode};
|
||||
cmdGetSql, cmdGetATUStatus, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT,
|
||||
cmdGetTxPower, cmdGetMicGain, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput,
|
||||
cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed,
|
||||
cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetPowerMeter, cmdGetALCMeter, cmdGetCompMeter,
|
||||
cmdGetTone, cmdGetTSQL, cmdGetDTCS, cmdGetRptAccessMode, cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna};
|
||||
|
||||
cmds cmdOut;
|
||||
QVector <cmds> cmdOutQue;
|
||||
QVector <cmds> periodicCmdQueue;
|
||||
int pCmdNum = 0;
|
||||
int delayedCmdIntervalLAN_ms = 100;
|
||||
int delayedCmdIntervalSerial_ms = 100;
|
||||
int delayedCmdStartupInterval_ms = 100;
|
||||
bool usingLAN = false;
|
||||
|
||||
freqMemory mem;
|
||||
struct colors {
|
||||
QColor Dark_PlotBackground;
|
||||
|
@ -380,7 +567,8 @@ private:
|
|||
QColor Dark_PlotTickLabel;
|
||||
QColor Dark_PlotBasePen;
|
||||
QColor Dark_PlotTickPen;
|
||||
QColor Dark_PlotFreqTracer;
|
||||
QColor Dark_PeakPlotLine;
|
||||
QColor Dark_TuningLine;
|
||||
|
||||
QColor Light_PlotBackground;
|
||||
QColor Light_PlotAxisPen;
|
||||
|
@ -390,15 +578,16 @@ private:
|
|||
QColor Light_PlotTickLabel;
|
||||
QColor Light_PlotBasePen;
|
||||
QColor Light_PlotTickPen;
|
||||
QColor Light_PlotFreqTracer;
|
||||
QColor Light_PeakPlotLine;
|
||||
QColor Light_TuningLine;
|
||||
|
||||
} colorScheme;
|
||||
|
||||
struct preferences {
|
||||
bool useFullScreen;
|
||||
bool useDarkMode;
|
||||
bool useSystemTheme;
|
||||
bool drawPeaks;
|
||||
bool drawTracer;
|
||||
QString stylesheetPath;
|
||||
unsigned char radioCIVAddr;
|
||||
QString serialPortRadio;
|
||||
|
@ -406,40 +595,111 @@ private:
|
|||
bool enablePTT;
|
||||
bool niceTS;
|
||||
bool enableLAN;
|
||||
QString ipAddress;
|
||||
quint16 controlLANPort;
|
||||
quint16 serialLANPort;
|
||||
quint16 audioLANPort;
|
||||
QString username;
|
||||
QString password;
|
||||
QString audioOutput;
|
||||
QString audioInput;
|
||||
quint16 audioRXBufferSize;
|
||||
quint16 audioRXSampleRate;
|
||||
quint8 audioRXCodec;
|
||||
quint16 audioTXSampleRate;
|
||||
quint8 audioTXCodec;
|
||||
bool enableRigCtlD;
|
||||
quint16 rigCtlPort;
|
||||
colors colorScheme;
|
||||
} prefs;
|
||||
|
||||
preferences defPrefs;
|
||||
udpPreferences udpPrefs;
|
||||
udpPreferences udpDefPrefs;
|
||||
|
||||
colors defaultColors;
|
||||
|
||||
void setDefaultColors(); // populate with default values
|
||||
void useColors(); // set the plot up
|
||||
void setDefPrefs(); // populate default values to default prefs
|
||||
void setTuningSteps();
|
||||
|
||||
quint64 roundFrequency(quint64 frequency, unsigned int tsHz);
|
||||
quint64 roundFrequencyWithStep(quint64 oldFreq, int steps,\
|
||||
unsigned int tsHz);
|
||||
|
||||
void setUIFreq(double frequency);
|
||||
void setUIFreq();
|
||||
|
||||
void changeTxBtn();
|
||||
void issueDelayedCommand(cmds cmd);
|
||||
void issueDelayedCommandPriority(cmds cmd);
|
||||
void issueDelayedCommandUnique(cmds cmd);
|
||||
void changeSliderQuietly(QSlider *slider, int value);
|
||||
|
||||
void processModLevel(rigInput source, unsigned char level);
|
||||
|
||||
void processChangingCurrentModLevel(unsigned char level);
|
||||
|
||||
void changeModLabel(rigInput source);
|
||||
void changeModLabel(rigInput source, bool updateLevel);
|
||||
|
||||
void changeModLabelAndSlider(rigInput source);
|
||||
|
||||
void initPeriodicCommands();
|
||||
void insertPeriodicCommand(cmds cmd, unsigned char priority);
|
||||
|
||||
|
||||
void changeMode(mode_kind mode);
|
||||
void changeMode(mode_kind mode, bool dataOn);
|
||||
|
||||
int oldFreqDialVal;
|
||||
|
||||
rigCapabilities rigCaps;
|
||||
rigInput currentModSrc = inputUnknown;
|
||||
rigInput currentModDataSrc = inputUnknown;
|
||||
mode_kind currentMode = modeUSB;
|
||||
|
||||
bool haveRigCaps;
|
||||
bool amTransmitting;
|
||||
bool usingDataMode = false;
|
||||
|
||||
unsigned char micGain=0;
|
||||
unsigned char accAGain=0;
|
||||
unsigned char accBGain=0;
|
||||
unsigned char accGain=0;
|
||||
unsigned char usbGain=0;
|
||||
unsigned char lanGain=0;
|
||||
|
||||
calibrationWindow *cal;
|
||||
repeaterSetup *rpt;
|
||||
satelliteSetup *sat;
|
||||
udpServerSetup *srv;
|
||||
|
||||
udpServer* udp = Q_NULLPTR;
|
||||
rigCtlD* rigCtl = Q_NULLPTR;
|
||||
QThread* serverThread = Q_NULLPTR;
|
||||
|
||||
void bandStackBtnClick();
|
||||
bool waitingForBandStackRtn;
|
||||
char bandStkBand;
|
||||
char bandStkRegCode;
|
||||
|
||||
bool freqLock;
|
||||
|
||||
float tsPlus;
|
||||
float tsPlusShift;
|
||||
float tsPlusControl;
|
||||
float tsPage;
|
||||
float tsPageShift;
|
||||
float tsWfScroll;
|
||||
|
||||
unsigned int tsPlusHz;
|
||||
unsigned int tsPlusShiftHz;
|
||||
unsigned int tsPlusControlHz;
|
||||
unsigned int tsPageHz;
|
||||
unsigned int tsPageShiftHz;
|
||||
unsigned int tsWfScrollHz;
|
||||
unsigned int tsKnobHz;
|
||||
|
||||
|
||||
SERVERCONFIG serverConfig;
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(struct rigCapabilities) ;
|
||||
|
||||
Q_DECLARE_METATYPE(struct rigCapabilities)
|
||||
Q_DECLARE_METATYPE(struct freqt)
|
||||
Q_DECLARE_METATYPE(struct udpPreferences)
|
||||
Q_DECLARE_METATYPE(struct rigStateStruct)
|
||||
Q_DECLARE_METATYPE(enum rigInput)
|
||||
Q_DECLARE_METATYPE(enum meterKind)
|
||||
Q_DECLARE_METATYPE(enum spectrumMode)
|
||||
|
||||
#endif // WFMAIN_H
|
||||
|
|
Plik binarny nie jest wyświetlany.
54
wfview.pro
54
wfview.pro
|
@ -31,9 +31,19 @@ QMAKE_LFLAGS += -O2 -march=native -s
|
|||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
|
||||
|
||||
linux:DEFINES += HOST=\\\"`hostname`\\\" UNAME=\\\"`whoami`\\\"
|
||||
# These defines are used for the resampler
|
||||
DEFINES += OUTSIDE_SPEEX
|
||||
DEFINES += RANDOM_PREFIX=wf
|
||||
|
||||
linux:DEFINES += GITSHORT="\\\"$(shell git -C $$PWD rev-parse --short HEAD)\\\""
|
||||
macx:INCLUDEPATH += /usr/local/include
|
||||
macx:LIBS += -L/usr/local/lib
|
||||
|
||||
macx:ICON = wfview.icns
|
||||
|
||||
|
||||
!win32:DEFINES += HOST=\\\"`hostname`\\\" UNAME=\\\"`whoami`\\\"
|
||||
|
||||
!win32:DEFINES += GITSHORT="\\\"$(shell git -C $$PWD rev-parse --short HEAD)\\\""
|
||||
|
||||
win32:INCLUDEPATH += c:/qcustomplot
|
||||
win32:DEFINES += HOST=1
|
||||
|
@ -68,7 +78,7 @@ CONFIG(debug, release|debug) {
|
|||
else: QCPLIB = qcustomplot
|
||||
}
|
||||
|
||||
QCPLIB = qcustomplot
|
||||
# QCPLIB = qcustomplot
|
||||
|
||||
LIBS += -L./ -l$$QCPLIB
|
||||
|
||||
|
@ -81,7 +91,17 @@ SOURCES += main.cpp\
|
|||
rigidentities.cpp \
|
||||
udphandler.cpp \
|
||||
logcategories.cpp \
|
||||
rxaudiohandler.cpp
|
||||
audiohandler.cpp \
|
||||
calibrationwindow.cpp \
|
||||
satellitesetup.cpp \
|
||||
udpserversetup.cpp \
|
||||
udpserver.cpp \
|
||||
meter.cpp \
|
||||
qledlabel.cpp \
|
||||
pttyhandler.cpp \
|
||||
resampler/resample.c \
|
||||
repeatersetup.cpp \
|
||||
rigctld.cpp
|
||||
|
||||
HEADERS += wfmain.h \
|
||||
commhandler.h \
|
||||
|
@ -90,8 +110,28 @@ HEADERS += wfmain.h \
|
|||
rigidentities.h \
|
||||
udphandler.h \
|
||||
logcategories.h \
|
||||
rxaudiohandler.h
|
||||
|
||||
FORMS += wfmain.ui
|
||||
audiohandler.h \
|
||||
calibrationwindow.h \
|
||||
satellitesetup.h \
|
||||
udpserversetup.h \
|
||||
udpserver.h \
|
||||
packettypes.h \
|
||||
meter.h \
|
||||
qledlabel.h \
|
||||
pttyhandler.h \
|
||||
resampler/speex_resampler.h \
|
||||
resampler/arch.h \
|
||||
resampler/resample_sse.h \
|
||||
repeatersetup.h \
|
||||
repeaterattributes.h \
|
||||
rigctld.h
|
||||
|
||||
|
||||
FORMS += wfmain.ui \
|
||||
calibrationwindow.ui \
|
||||
satellitesetup.ui \
|
||||
udpserversetup.ui \
|
||||
repeatersetup.ui
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30804.86
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wfview", "wfview.vcxproj", "{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
Template|x64 = Template|x64
|
||||
Template|x86 = Template|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Debug|x64.Build.0 = Debug|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Release|x64.ActiveCfg = Release|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Release|x64.Build.0 = Release|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Release|x86.ActiveCfg = Release|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Template|x64.ActiveCfg = Release|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Template|x64.Build.0 = Release|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Template|x86.ActiveCfg = Release|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Template|x86.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {DED7FD3A-2DD6-4C9E-B809-BE03F4C13F69}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,339 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}</ProjectGuid>
|
||||
<RootNamespace>wfview</RootNamespace>
|
||||
<Keyword>QtVS_v303</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' or !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<OutputDirectory>release\</OutputDirectory>
|
||||
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<IntermediateDirectory>release\</IntermediateDirectory>
|
||||
<PrimaryOutput>wfview</PrimaryOutput>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<OutputDirectory>debug\</OutputDirectory>
|
||||
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<IntermediateDirectory>debug\</IntermediateDirectory>
|
||||
<PrimaryOutput>wfview</PrimaryOutput>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>debug\</OutDir>
|
||||
<IntDir>debug\</IntDir>
|
||||
<TargetName>wfview</TargetName>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>release\</OutDir>
|
||||
<IntDir>release\</IntDir>
|
||||
<TargetName>wfview</TargetName>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtInstall>msvc2019_64_5</QtInstall>
|
||||
<QtModules>core;network;gui;multimedia;widgets;serialport;printsupport</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QtInstall>msvc2019_64_5</QtInstall>
|
||||
<QtModules>core;opengl;network;gui;multimedia;widgets;serialport;printsupport</QtModules>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">
|
||||
<Import Project="$(QtMsBuild)\qt.props" />
|
||||
</ImportGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;c:\qcustomplot;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -s -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblerListingLocation>release\</AssemblerListingLocation>
|
||||
<BrowseInformation>false</BrowseInformation>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<ObjectFileName>release\</ObjectFileName>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_USE_OPENGL;HOST=1;UNAME=1;GITSHORT=1;NDEBUG;QT_NO_DEBUG;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessToFile>false</PreprocessToFile>
|
||||
<ProgramDataBaseFileName>
|
||||
</ProgramDataBaseFileName>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>OpenGL32.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\openssl\lib;C:\Utils\my_sql\mysql-5.7.25-winx64\lib;C:\Utils\postgresql\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>-O2 -s "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>$(OutDir)\wfview.exe</OutputFile>
|
||||
<RandomizedBaseAddress>true</RandomizedBaseAddress>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DefaultCharType>Unsigned</DefaultCharType>
|
||||
<EnableErrorChecks>None</EnableErrorChecks>
|
||||
<WarningLevel>0</WarningLevel>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_USE_OPENGL;HOST=1;UNAME=1;GITSHORT=1;NDEBUG;QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_OPENGL_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<QtMoc>
|
||||
<CompilerFlavor>msvc</CompilerFlavor>
|
||||
<Include>./$(Configuration)/moc_predefs.h</Include>
|
||||
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
|
||||
<DynamicSource>output</DynamicSource>
|
||||
<QtMocDir>$(Configuration)</QtMocDir>
|
||||
<QtMocFileName>moc_%(Filename).cpp</QtMocFileName>
|
||||
</QtMoc>
|
||||
<QtRcc>
|
||||
<Compression>default</Compression>
|
||||
<ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription>
|
||||
<QtRccDir>$(Configuration)</QtRccDir>
|
||||
<QtRccFileName>qrc_%(Filename).cpp</QtRccFileName>
|
||||
</QtRcc>
|
||||
<QtUic>
|
||||
<ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription>
|
||||
<QtUicDir>$(ProjectDir)</QtUicDir>
|
||||
<QtUicFileName>ui_%(Filename).h</QtUicFileName>
|
||||
</QtUic>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;c:\qcustomplot;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblerListingLocation>debug\</AssemblerListingLocation>
|
||||
<BrowseInformation>false</BrowseInformation>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<ObjectFileName>debug\</ObjectFileName>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_USE_OPENGL;HOST=1;UNAME=1;GITSHORT=1;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessToFile>false</PreprocessToFile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>OpenGL32.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\openssl\lib;C:\Utils\my_sql\mysql-5.7.25-winx64\lib;C:\Utils\postgresql\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<OutputFile>$(OutDir)\wfview.exe</OutputFile>
|
||||
<RandomizedBaseAddress>true</RandomizedBaseAddress>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DefaultCharType>Unsigned</DefaultCharType>
|
||||
<EnableErrorChecks>None</EnableErrorChecks>
|
||||
<WarningLevel>0</WarningLevel>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_USE_OPENGL;HOST=1;UNAME=1;GITSHORT=1;QT_MULTIMEDIA_LIB;QT_OPENGL_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<QtMoc>
|
||||
<CompilerFlavor>msvc</CompilerFlavor>
|
||||
<Include>./$(Configuration)/moc_predefs.h</Include>
|
||||
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
|
||||
<DynamicSource>output</DynamicSource>
|
||||
<QtMocDir>$(Configuration)</QtMocDir>
|
||||
<QtMocFileName>moc_%(Filename).cpp</QtMocFileName>
|
||||
</QtMoc>
|
||||
<QtRcc>
|
||||
<Compression>default</Compression>
|
||||
<ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription>
|
||||
<QtRccDir>$(Configuration)</QtRccDir>
|
||||
<QtRccFileName>qrc_%(Filename).cpp</QtRccFileName>
|
||||
</QtRcc>
|
||||
<QtUic>
|
||||
<ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription>
|
||||
<QtUicDir>$(ProjectDir)</QtUicDir>
|
||||
<QtUicFileName>ui_%(Filename).h</QtUicFileName>
|
||||
</QtUic>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="calibrationwindow.cpp" />
|
||||
<ClCompile Include="commhandler.cpp" />
|
||||
<ClCompile Include="freqmemory.cpp" />
|
||||
<ClCompile Include="pttyhandler.cpp" />
|
||||
<ClCompile Include="qledlabel.cpp" />
|
||||
<ClCompile Include="logcategories.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="c:\qcustomplot\qcustomplot.cpp" />
|
||||
<ClCompile Include="meter.cpp" />
|
||||
<ClCompile Include="repeatersetup.cpp" />
|
||||
<ClCompile Include="resampler\resample.c" />
|
||||
<ClCompile Include="rigcommander.cpp" />
|
||||
<ClCompile Include="rigctld.cpp" />
|
||||
<ClCompile Include="rigidentities.cpp" />
|
||||
<ClCompile Include="audiohandler.cpp" />
|
||||
<ClCompile Include="satellitesetup.cpp" />
|
||||
<ClCompile Include="udphandler.cpp" />
|
||||
<ClCompile Include="udpserver.cpp" />
|
||||
<ClCompile Include="udpserversetup.cpp" />
|
||||
<ClCompile Include="wfmain.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="udpserver.h" />
|
||||
<QtMoc Include="udpserversetup.h" />
|
||||
<QtMoc Include="satellitesetup.h" />
|
||||
<QtMoc Include="audiohandler.h" />
|
||||
<QtMoc Include="commhandler.h">
|
||||
</QtMoc>
|
||||
<QtMoc Include="calibrationwindow.h" />
|
||||
<ClInclude Include="freqmemory.h" />
|
||||
<QtMoc Include="qledlabel.h" />
|
||||
<ClInclude Include="logcategories.h" />
|
||||
<QtMoc Include="c:\qcustomplot\qcustomplot.h">
|
||||
</QtMoc>
|
||||
<QtMoc Include="rigcommander.h">
|
||||
</QtMoc>
|
||||
<QtMoc Include="meter.h" />
|
||||
<ClInclude Include="packettypes.h" />
|
||||
<QtMoc Include="pttyhandler.h" />
|
||||
<QtMoc Include="repeatersetup.h" />
|
||||
<ClInclude Include="resampler\speex_resampler.h" />
|
||||
<QtMoc Include="rigctld.h" />
|
||||
<ClInclude Include="rigidentities.h" />
|
||||
<QtMoc Include="udphandler.h">
|
||||
</QtMoc>
|
||||
<QtMoc Include="wfmain.h">
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >debug\moc_predefs.h</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generate moc_predefs.h</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">debug\moc_predefs.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="release\moc_predefs.h.cbt">
|
||||
<FileType>Document</FileType>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -s -fvisibility=hidden -fvisibility-inlines-hidden -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generate moc_predefs.h</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">release\moc_predefs.h;%(Outputs)</Outputs>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="calibrationwindow.ui" />
|
||||
<QtUic Include="repeatersetup.ui" />
|
||||
<QtUic Include="satellitesetup.ui" />
|
||||
<QtUic Include="udpserversetup.ui" />
|
||||
<QtUic Include="wfmain.ui">
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="qdarkstyle\rc\Hmovetoolbar.png" />
|
||||
<None Include="qdarkstyle\rc\Hsepartoolbar.png" />
|
||||
<None Include="qdarkstyle\rc\Vmovetoolbar.png" />
|
||||
<None Include="qdarkstyle\rc\Vsepartoolbar.png" />
|
||||
<None Include="qdarkstyle\rc\branch_closed-on.png" />
|
||||
<None Include="qdarkstyle\rc\branch_closed.png" />
|
||||
<None Include="qdarkstyle\rc\branch_open-on.png" />
|
||||
<None Include="qdarkstyle\rc\branch_open.png" />
|
||||
<None Include="qdarkstyle\rc\checkbox_checked.png" />
|
||||
<None Include="qdarkstyle\rc\checkbox_checked_disabled.png" />
|
||||
<None Include="qdarkstyle\rc\checkbox_checked_focus.png" />
|
||||
<None Include="qdarkstyle\rc\checkbox_indeterminate.png" />
|
||||
<None Include="qdarkstyle\rc\checkbox_indeterminate_focus.png" />
|
||||
<None Include="qdarkstyle\rc\checkbox_unchecked.png" />
|
||||
<None Include="qdarkstyle\rc\checkbox_unchecked_disabled.png" />
|
||||
<None Include="qdarkstyle\rc\checkbox_unchecked_focus.png" />
|
||||
<None Include="qdarkstyle\rc\close-hover.png" />
|
||||
<None Include="qdarkstyle\rc\close-pressed.png" />
|
||||
<None Include="qdarkstyle\rc\close.png" />
|
||||
<None Include="qdarkstyle\rc\down_arrow.png" />
|
||||
<None Include="qdarkstyle\rc\down_arrow_disabled.png" />
|
||||
<None Include="qdarkstyle\rc\left_arrow.png" />
|
||||
<None Include="qdarkstyle\rc\left_arrow_disabled.png" />
|
||||
<None Include="qdarkstyle\rc\radio_checked.png" />
|
||||
<None Include="qdarkstyle\rc\radio_checked_disabled.png" />
|
||||
<None Include="qdarkstyle\rc\radio_checked_focus.png" />
|
||||
<None Include="qdarkstyle\rc\radio_unchecked.png" />
|
||||
<None Include="qdarkstyle\rc\radio_unchecked_disabled.png" />
|
||||
<None Include="qdarkstyle\rc\radio_unchecked_focus.png" />
|
||||
<QtRcc Include="resources\resources.qrc">
|
||||
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">resources</InitFuncName>
|
||||
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">resources</InitFuncName>
|
||||
</QtRcc>
|
||||
<None Include="qdarkstyle\rc\right_arrow.png" />
|
||||
<None Include="qdarkstyle\rc\right_arrow_disabled.png" />
|
||||
<None Include="qdarkstyle\rc\sizegrip.png" />
|
||||
<QtRcc Include="qdarkstyle\style.qrc">
|
||||
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">style</InitFuncName>
|
||||
<InitFuncName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">style</InitFuncName>
|
||||
</QtRcc>
|
||||
<None Include="qdarkstyle\style.qss" />
|
||||
<None Include="qdarkstyle\rc\stylesheet-branch-end.png" />
|
||||
<None Include="qdarkstyle\rc\stylesheet-branch-more.png" />
|
||||
<None Include="qdarkstyle\rc\stylesheet-vline.png" />
|
||||
<None Include="qdarkstyle\rc\transparent.png" />
|
||||
<None Include="qdarkstyle\rc\undock.png" />
|
||||
<None Include="qdarkstyle\rc\up_arrow.png" />
|
||||
<None Include="qdarkstyle\rc\up_arrow_disabled.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="resources\install.sh" />
|
||||
<None Include="resources\wfview.desktop" />
|
||||
<None Include="resources\wfview.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
</Project>
|
|
@ -0,0 +1,372 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files">
|
||||
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files">
|
||||
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||
<Extensions>qrc;*</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||
<Extensions>qrc;*</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Distribution Files">
|
||||
<UniqueIdentifier>{B83CAF91-C7BF-462F-B76C-EA11631F866C}</UniqueIdentifier>
|
||||
<Extensions>*</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
<Filter Include="Distribution Files">
|
||||
<UniqueIdentifier>{B83CAF91-C7BF-462F-B76C-EA11631F866C}</UniqueIdentifier>
|
||||
<Extensions>*</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="commhandler.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="freqmemory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="logcategories.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="c:\qcustomplot\qcustomplot.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rigcommander.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rigidentities.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="udphandler.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="wfmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="audiohandler.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="calibrationwindow.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="satellitesetup.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="udpserversetup.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="udpserver.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="qledlabel.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pttyhandler.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="resampler\resample.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="repeatersetup.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rigctld.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="commhandler.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<ClInclude Include="freqmemory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="logcategories.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<QtMoc Include="c:\qcustomplot\qcustomplot.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="rigcommander.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<ClInclude Include="rigidentities.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<QtMoc Include="udphandler.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="wfmain.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="audiohandler.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="calibrationwindow.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="satellitesetup.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="udpserversetup.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="udpserver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="meter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="qledlabel.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="pttyhandler.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="repeatersetup.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="rigctld.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
||||
<Filter>Generated Files</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="release\moc_predefs.h.cbt">
|
||||
<Filter>Generated Files</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="wfmain.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="calibrationwindow.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="satellitesetup.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="udpserversetup.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="repeatersetup.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="qdarkstyle\rc\Hmovetoolbar.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\Hsepartoolbar.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\Vmovetoolbar.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\Vsepartoolbar.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\branch_closed-on.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\branch_closed.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\branch_open-on.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\branch_open.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\checkbox_checked.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\checkbox_checked_disabled.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\checkbox_checked_focus.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\checkbox_indeterminate.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\checkbox_indeterminate_focus.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\checkbox_unchecked.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\checkbox_unchecked_disabled.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\checkbox_unchecked_focus.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\close-hover.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\close-pressed.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\close.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\down_arrow.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\down_arrow_disabled.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\left_arrow.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\left_arrow_disabled.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\radio_checked.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\radio_checked_disabled.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\radio_checked_focus.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\radio_unchecked.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\radio_unchecked_disabled.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\radio_unchecked_focus.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<QtRcc Include="resources\resources.qrc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</QtRcc>
|
||||
<None Include="qdarkstyle\rc\right_arrow.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\right_arrow_disabled.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\sizegrip.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<QtRcc Include="qdarkstyle\style.qrc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</QtRcc>
|
||||
<None Include="qdarkstyle\style.qss">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\stylesheet-branch-end.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\stylesheet-branch-more.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\stylesheet-vline.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\transparent.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\undock.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\up_arrow.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="qdarkstyle\rc\up_arrow_disabled.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="resources\wfview.png">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
<None Include="resources\wfview.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="resources\install.sh">
|
||||
<Filter>Distribution Files</Filter>
|
||||
</None>
|
||||
<None Include="resources\wfview.desktop">
|
||||
<Filter>Distribution Files</Filter>
|
||||
</None>
|
||||
<None Include="resources\wfview.png">
|
||||
<Filter>Distribution Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="packettypes.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resampler\speex_resampler.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
Ładowanie…
Reference in New Issue