Fix input level slider name

rigcreator
Phil Taylor 2023-04-28 00:31:41 +01:00
rodzic 17e18a926a
commit c7c5bce4f0
9 zmienionych plików z 88 dodań i 63 usunięć

Wyświetl plik

@ -2005,10 +2005,10 @@ void rigCommander::parseCommand()
emit haveLANGain(bcdHexToUChar(payloadIn[4],payloadIn[5]));
break;
case funcDATAOffMod:
emit haveModInput(rigInput((inputTypes)bcdHexToUChar(payloadIn[4])),false);
emit haveModInput((inputTypes)bcdHexToUChar(payloadIn[4]),false);
break;
case funcDATA1Mod:
emit haveModInput(rigInput((inputTypes)bcdHexToUChar(payloadIn[4])),true);
emit haveModInput((inputTypes)bcdHexToUChar(payloadIn[4]),true);
break;
case funcDATA2Mod:
break;
@ -2431,7 +2431,7 @@ void rigCommander::getModInput(bool dataOn)
}
}
void rigCommander::setModInput(rigInput input, bool dataOn)
void rigCommander::setModInput(inputTypes input, bool dataOn)
{
// The input enum is as follows:
@ -2445,9 +2445,9 @@ void rigCommander::setModInput(rigInput input, bool dataOn)
QByteArray payload;
funcs f=(dataOn) ? funcDATA1Mod :funcDATAOffMod;
if (getCommand(f,payload,input.type))
if (getCommand(f,payload,input))
{
payload.append(input.type);
payload.append(input);
prepDataAndSend(payload);
}
@ -2566,9 +2566,9 @@ void rigCommander::setModInput(rigInput input, bool dataOn)
*/
}
void rigCommander::setModInputLevel(rigInput input, unsigned char level)
void rigCommander::setModInputLevel(inputTypes input, unsigned char level)
{
switch(input.type)
switch(input)
{
case inputMic:
setMicGain(level);
@ -2619,9 +2619,9 @@ void rigCommander::setDialLock(bool lockOn)
}
}
void rigCommander::getModInputLevel(rigInput input)
void rigCommander::getModInputLevel(inputTypes input)
{
switch(input.type)
switch(input)
{
case inputMic:
getMicGain();
@ -3758,8 +3758,7 @@ void rigCommander::parseDetailedRegisters1A05()
int subcmd = bcdHexToUChar(payloadIn[3]) + (100*bcdHexToUChar(payloadIn[2]));
rigInput input;
input.type = (inputTypes)bcdHexToUChar(payloadIn[4]);
inputTypes input = (inputTypes)bcdHexToUChar(payloadIn[4]);
int inputRaw = bcdHexToUChar(payloadIn[4]);
switch(rigCaps.model)

Wyświetl plik

@ -182,7 +182,7 @@ public slots:
void getACCGain();
void getACCGain(unsigned char ab);
void getModInput(bool dataOn);
void getModInputLevel(rigInput input);
void getModInputLevel(inputTypes input);
void getAfMute();
void getDialLock();
@ -203,8 +203,8 @@ public slots:
void setMonitorGain(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);
void setModInput(inputTypes input, bool dataOn);
void setModInputLevel(inputTypes input, unsigned char level);
void setAfMute(bool muteOn);
void setDialLock(bool lockOn);
void setNBLevel(unsigned char level);
@ -352,11 +352,11 @@ signals:
void haveNR(bool en);
// Modulation source and gain:
void haveModInput(rigInput input, bool isData);
void haveModInput(inputTypes 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);
void haveModSrcGain(inputTypes input, unsigned char gain);
// Meters:
void haveMeter(meterKind meter, unsigned char level);

Wyświetl plik

@ -32,7 +32,7 @@ void rigCreator::on_defaultRigs_clicked(bool clicked)
QString appdata = "/usr/local/share/wfview/rigs";
QString file = QFileDialog::getOpenFileName(this,"Select Rig Filename",appdata,"Rig Files (*.rig)",nullptr,QFileDialog::DontUseNativeDialog);
#else
QString appdata = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+"/rigs";
QString appdata = QCoreApplication::applicationDirPath()+"/rigs";
QString file = QFileDialog::getOpenFileName(this,"Select Rig Filename",appdata,"Rig Files (*.rig)");
#endif
@ -46,9 +46,15 @@ void rigCreator::on_loadFile_clicked(bool clicked)
{
Q_UNUSED(clicked)
#ifdef DEVMODE
QString appdata = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
#ifdef Q_OS_LINUX
QString appdata = "/usr/local/share/wfview";
#else
QString appdata = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)+"/wfview";
QString appdata = QCoreApplication::applicationDirPath();
#endif
#else
QString appdata = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
#endif
QDir dir(appdata);
if (!dir.exists()) {
@ -286,9 +292,13 @@ void rigCreator::on_saveFile_clicked(bool clicked)
{
Q_UNUSED(clicked)
#ifdef DEVMODE
QString appdata = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
#ifdef Q_OS_LINUX
QString appdata = "/usr/local/share/wfview";
#else
QString appdata = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)+"/wfview";
QString appdata = QCoreApplication::applicationDirPath();
#endif
#else
QString appdata = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
#endif
QDir dir(appdata);

Wyświetl plik

@ -10,6 +10,12 @@
<height>551</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>

Wyświetl plik

@ -109,10 +109,10 @@ public:
}
}
void set(stateTypes s, rigInput x, bool u) {
if ((x.type != map[s]._value) && ((!u && !map[s]._updated) || (u))) {
void set(stateTypes s, inputTypes x, bool u) {
if ((x != map[s]._value) && ((!u && !map[s]._updated) || (u))) {
_mutex.lock();
map[s]._value = quint64(x.type);
map[s]._value = quint64(x);
map[s]._valid = true;
map[s]._updated = u;
map[s]._dateUpdated = QDateTime::currentDateTime();
@ -128,7 +128,7 @@ public:
quint32 getUInt32(stateTypes s) { return quint32(map[s]._value); }
quint64 getInt64(stateTypes s) { return map[s]._value; }
duplexMode getDuplex(stateTypes s) { return duplexMode(map[s]._value); }
rigInput getInput(stateTypes s) { return rigInput((inputTypes)map[s]._value); }
inputTypes getInput(stateTypes s) { return inputTypes(map[s]._value); }
QMap<stateTypes, value> map;

Wyświetl plik

@ -60,6 +60,7 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
qRegisterMetaType<rptAccessTxRx>();
qRegisterMetaType<rptrAccessData_t>();
qRegisterMetaType<rigInput>();
qRegisterMetaType<inputTypes>();
qRegisterMetaType<meterKind>();
qRegisterMetaType<spectrumMode>();
qRegisterMetaType<freqt>();
@ -95,7 +96,7 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
#ifdef Q_OS_LINUX
QString appdata = "/usr/local/share/wfview/rigs";
#else
QString appdata = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)+"/rigs";
QString appdata = QCoreApplication::applicationDirPath()+"/rigs";
#endif
QDir rigsDir(appdata);
@ -121,7 +122,7 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
}
}
QString docsdata = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)+"/wfview/rigs";
QString docsdata = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)+"/rigs";
QDir docsDir(docsdata);
if (docsDir.exists()){
QStringList rigs = docsDir.entryList(QStringList() << "*.rig" << "*.RIG", QDir::Files);
@ -573,8 +574,8 @@ void wfmain::rigConnections()
connect(this, SIGNAL(getDuplexMode()), rig, SLOT(getDuplexMode()));
connect(this, SIGNAL(getModInput(bool)), rig, SLOT(getModInput(bool)));
connect(rig, SIGNAL(haveModInput(rigInput,bool)), this, SLOT(receiveModInput(rigInput, bool)));
connect(this, SIGNAL(setModInput(rigInput, bool)), rig, SLOT(setModInput(rigInput,bool)));
connect(rig, SIGNAL(haveModInput(inputTypes,bool)), this, SLOT(receiveModInput(inputTypes, bool)));
connect(this, SIGNAL(setModInput(inputTypes, bool)), rig, SLOT(setModInput(inputTypes,bool)));
connect(rig, SIGNAL(haveSpectrumData(QByteArray, double, double)), this, SLOT(receiveSpectrumData(QByteArray, double, double)));
connect(rig, SIGNAL(haveSpectrumMode(spectrumMode)), this, SLOT(receiveSpectrumMode(spectrumMode)));
@ -614,7 +615,7 @@ void wfmain::rigConnections()
connect(this, SIGNAL(getTxPower()), rig, SLOT(getTxLevel()));
connect(this, SIGNAL(getMicGain()), rig, SLOT(getMicGain()));
connect(this, SIGNAL(getSpectrumRefLevel()), rig, SLOT(getSpectrumRefLevel()));
connect(this, SIGNAL(getModInputLevel(rigInput)), rig, SLOT(getModInputLevel(rigInput)));
connect(this, SIGNAL(getModInputLevel(inputTypes)), rig, SLOT(getModInputLevel(inputTypes)));
connect(this, SIGNAL(getPassband()), rig, SLOT(getPassband()));
connect(this, SIGNAL(getMonitorGain()), rig, SLOT(getMonitorGain()));
connect(this, SIGNAL(getVoxGain()), rig, SLOT(getVoxGain()));
@ -643,7 +644,7 @@ void wfmain::rigConnections()
connect(this, SIGNAL(setVoxGain(unsigned char)), rig, SLOT(setVoxGain(unsigned char)));
connect(this, SIGNAL(setAntiVoxGain(unsigned char)), rig, SLOT(setAntiVoxGain(unsigned char)));
connect(this, SIGNAL(setSpectrumRefLevel(int)), rig, SLOT(setSpectrumRefLevel(int)));
connect(this, SIGNAL(setModLevel(rigInput, unsigned char)), rig, SLOT(setModInputLevel(rigInput, unsigned char)));
connect(this, SIGNAL(setModLevel(inputTypes, unsigned char)), rig, SLOT(setModInputLevel(inputTypes, unsigned char)));
connect(this, SIGNAL(setNBLevel(unsigned char)), rig, SLOT(setNBLevel(unsigned char)));
connect(this, SIGNAL(setNBLevel(unsigned char)), rig, SLOT(setNBLevel(unsigned char)));
@ -4003,7 +4004,7 @@ void wfmain::doCmd(commandtype cmddata)
case cmdSetModLevel:
{
unsigned char modlevel = (*std::static_pointer_cast<unsigned char>(data));
rigInput currentIn;
inputTypes currentIn;
if(usingDataMode)
{
currentIn = currentModDataSrc;
@ -7252,13 +7253,13 @@ void wfmain::receiveTxPower(unsigned char power)
void wfmain::receiveMicGain(unsigned char gain)
{
processModLevel(rigInput(inputMic), gain);
processModLevel(inputTypes(inputMic), gain);
emit sendLevel(cmdGetMicGain,gain);
}
void wfmain::processModLevel(rigInput source, unsigned char level)
void wfmain::processModLevel(inputTypes source, unsigned char level)
{
rigInput currentIn;
inputTypes currentIn;
if(usingDataMode)
{
currentIn = currentModDataSrc;
@ -7266,7 +7267,7 @@ void wfmain::processModLevel(rigInput source, unsigned char level)
currentIn = currentModSrc;
}
switch(source.type)
switch(source)
{
case inputMic:
micGain = level;
@ -7294,7 +7295,7 @@ void wfmain::processModLevel(rigInput source, unsigned char level)
default:
break;
}
if(currentIn.type == source.type)
if(currentIn == source)
{
changeSliderQuietly(ui->micGainSlider, level);
emit sendLevel(cmdGetModLevel,level);
@ -7302,7 +7303,7 @@ void wfmain::processModLevel(rigInput source, unsigned char level)
}
void wfmain::receiveModInput(rigInput input, bool dataOn)
void wfmain::receiveModInput(inputTypes input, bool dataOn)
{
QComboBox *box;
QString inputName;
@ -7324,7 +7325,7 @@ void wfmain::receiveModInput(rigInput input, bool dataOn)
for(int i=0; i < box->count(); i++)
{
if(box->itemData(i).toInt() == (int)input.type)
if(box->itemData(i).toInt() == (int)input)
{
box->blockSignals(true);
box->setCurrentIndex(i);
@ -7338,7 +7339,7 @@ void wfmain::receiveModInput(rigInput input, bool dataOn)
changeModLabel(input);
}
if(!found)
qInfo(logSystem()) << "Could not find modulation input: " << (int)input.type;
qInfo(logSystem()) << "Could not find modulation input: " << (int)input;
}
void wfmain::receiveACCGain(unsigned char level, unsigned char ab)
@ -7533,8 +7534,8 @@ void wfmain::receiveSpectrumRefLevel(int level)
void wfmain::on_modInputCombo_activated(int index)
{
emit setModInput( rigInput((inputTypes)ui->modInputCombo->currentData().toInt()), false );
currentModSrc = rigInput((inputTypes)ui->modInputCombo->currentData().toInt());
emit setModInput( inputTypes(ui->modInputCombo->currentData().toInt()), false );
currentModSrc = inputTypes(ui->modInputCombo->currentData().toInt());
issueDelayedCommand(cmdGetCurrentModLevel);
if(!usingDataMode)
{
@ -7545,8 +7546,8 @@ void wfmain::on_modInputCombo_activated(int index)
void wfmain::on_modInputData1Combo_activated(int index)
{
emit setModInput( rigInput((inputTypes)ui->modInputData1Combo->currentData().toInt()), true );
currentModDataSrc = rigInput((inputTypes)ui->modInputData1Combo->currentData().toInt());
emit setModInput( inputTypes(ui->modInputData1Combo->currentData().toInt()), true );
currentModDataSrc = inputTypes(ui->modInputData1Combo->currentData().toInt());
issueDelayedCommand(cmdGetCurrentModLevel);
if(usingDataMode)
@ -7569,21 +7570,21 @@ void wfmain::on_modInputData3Combo_activated(int index)
}
void wfmain::changeModLabelAndSlider(rigInput source)
void wfmain::changeModLabelAndSlider(inputTypes source)
{
changeModLabel(source, true);
}
void wfmain::changeModLabel(rigInput input)
void wfmain::changeModLabel(inputTypes input)
{
changeModLabel(input, false);
}
void wfmain::changeModLabel(rigInput input, bool updateLevel)
void wfmain::changeModLabel(inputTypes input, bool updateLevel)
{
unsigned char gain = 0;
switch(input.type)
switch(input)
{
case inputMic:
gain = micGain;
@ -7607,7 +7608,11 @@ void wfmain::changeModLabel(rigInput input, bool updateLevel)
gain=0;
break;
}
ui->modSliderLbl->setText(input.name);
foreach (auto ip, rigCaps.inputs)
{
if (ip.type == input)
ui->modSliderLbl->setText(ip.name);
}
if(updateLevel)
{
changeSliderQuietly(ui->micGainSlider, gain);

Wyświetl plik

@ -129,7 +129,7 @@ signals:
void setDataMode(bool dataOn, unsigned char filter);
void getDataMode();
void getModInput(bool dataOn);
void setModInput(rigInput input, bool dataOn);
void setModInput(inputTypes input, bool dataOn);
void getBandStackReg(char band, char regCode);
void getDebug();
void getRitEnabled();
@ -165,7 +165,7 @@ signals:
void getTxPower();
void getMicGain();
void getSpectrumRefLevel();
void getModInputLevel(rigInput input);
void getModInputLevel(inputTypes input);
void getMeters(meterKind meter);
void getPassband();
void getVoxGain();
@ -214,7 +214,7 @@ signals:
void setSpectrumRefLevel(int);
void setModLevel(rigInput input, unsigned char level);
void setModLevel(inputTypes input, unsigned char level);
void setACCGain(unsigned char level);
void setACCAGain(unsigned char level);
void setACCBGain(unsigned char level);
@ -344,7 +344,7 @@ private slots:
void receiveBandStackReg(freqt f, char mode, char filter, bool dataOn); // freq, mode, (filter,) datamode
void receiveRITStatus(bool ritEnabled);
void receiveRITValue(int ritValHz);
void receiveModInput(rigInput input, bool dataOn);
void receiveModInput(inputTypes input, bool dataOn);
//void receiveDuplexMode(duplexMode dm);
void receivePassband(quint16 pass);
void receiveMonitorGain(unsigned char pass);
@ -1096,14 +1096,14 @@ private:
void statusFromSliderPercent(QString name, int percentValue);
void statusFromSliderRaw(QString name, int rawValue);
void processModLevel(rigInput source, unsigned char level);
void processModLevel(inputTypes source, unsigned char level);
void processChangingCurrentModLevel(unsigned char level);
void changeModLabel(rigInput source);
void changeModLabel(rigInput source, bool updateLevel);
void changeModLabel(inputTypes source);
void changeModLabel(inputTypes source, bool updateLevel);
void changeModLabelAndSlider(rigInput source);
void changeModLabelAndSlider(inputTypes source);
void initPeriodicCommands();
// Fast command queue for S-Meter:
@ -1134,8 +1134,8 @@ private:
QHash<unsigned char,QString> rigList;
rigCapabilities rigCaps;
rigInput currentModSrc = inputUnknown;
rigInput currentModDataSrc = inputUnknown;
inputTypes currentModSrc = inputUnknown;
inputTypes currentModDataSrc = inputUnknown;
mode_kind currentMode = modeUSB;
mode_info currentModeInfo;
@ -1245,6 +1245,7 @@ Q_DECLARE_METATYPE(struct networkStatus)
Q_DECLARE_METATYPE(struct networkAudioLevels)
Q_DECLARE_METATYPE(struct spotData)
Q_DECLARE_METATYPE(struct rigInput)
Q_DECLARE_METATYPE(enum inputTypes)
Q_DECLARE_METATYPE(enum meterKind)
Q_DECLARE_METATYPE(enum spectrumMode)
Q_DECLARE_METATYPE(enum mode_kind)

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -3456,8 +3456,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>820</width>
<height>298</height>
<width>579</width>
<height>254</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
@ -5563,8 +5563,8 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="underlayButtonGroup"/>
<buttongroup name="pollingButtonGroup"/>
<buttongroup name="buttonGroup"/>
<buttongroup name="underlayButtonGroup"/>
</buttongroups>
</ui>

Wyświetl plik

@ -155,6 +155,7 @@ CONFIG(debug, release|debug) {
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\portaudio\msvc\x64\Debug\portaudio_x64.dll wfview-debug $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\hidapi\windows\X64\Debug\hidapi.dll wfview-debug $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\opus\win32\VS2015\x64\DebugDLL\opus.dll wfview-debug $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c xcopy /s/y ..\wfview\rigs\*.* wfview-debug\rigs\*.* $$escape_expand(\\n\\t))
LIBS += -L../portaudio/msvc/X64/Debug/ -lportaudio_x64
contains(DEFINES,USB_CONTROLLER){
LIBS += -L../hidapi/windows/x64/debug -lhidapi
@ -167,6 +168,7 @@ CONFIG(debug, release|debug) {
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\portaudio\msvc\win32\Debug\portaudio_x86.dll wfview-debug\$$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\hidapi\windows\Debug\hidapi.dll wfview-debug $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\opus\win32\VS2015\win32\DebugDLL\opus.dll wfview-debug $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c xcopy /s/y ..\wfview\rigs\*.* wfview-debug\rigs\*.* $$escape_expand(\\n\\t))
contains(DEFINES,USB_CONTROLLER){
LIBS += -L../hidapi/windows/debug -lhidapi
}
@ -187,6 +189,7 @@ CONFIG(debug, release|debug) {
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\portaudio\msvc\x64\Release\portaudio_x64.dll wfview-release $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\hidapi\windows\X64\Release\hidapi.dll wfview-release $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\opus\win32\VS2015\x64\ReleaseDLL\opus.dll wfview-release $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c xcopy /s/y ..\wfview\rigs\*.* wfview-release\rigs\*.* $$escape_expand(\\n\\t))
contains(DEFINES,USB_CONTROLLER){
LIBS += -L../hidapi/windows/x64/release -lhidapi
}
@ -198,6 +201,7 @@ CONFIG(debug, release|debug) {
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\portaudio\msvc\win32\Release\portaudio_x86.dll wfview-release $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\hidapi\windows\Release\hidapi.dll wfview-release $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c copy /y ..\opus\win32\VS2015\win32\ReleaseDLL\opus.dll wfview-release $$escape_expand(\\n\\t))
QMAKE_POST_LINK +=$$quote(cmd /c xcopy /s/y ..\wfview\rigs\*.* wfview-release\rigs\*.* $$escape_expand(\\n\\t))
contains(DEFINES,USB_CONTROLLER){
win32:LIBS += -L../hidapi/windows/release -lhidapi
}