kopia lustrzana https://github.com/PianetaRadio/CatRadio
Check hamlib version on startup
rodzic
146207cd98
commit
0fdc71f98d
|
@ -2,6 +2,9 @@ CatRadio
|
||||||
|
|
||||||
(+ New, * Updated, - Removed)
|
(+ New, * Updated, - Removed)
|
||||||
|
|
||||||
|
1.4.1 - 2024-xx-xx
|
||||||
|
+ Check hamlib version on startup
|
||||||
|
|
||||||
1.4.0 - 2024-03-17
|
1.4.0 - 2024-03-17
|
||||||
+ Auto Connect option
|
+ Auto Connect option
|
||||||
+ Auto Power-on option
|
+ Auto Power-on option
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
#include <rig.h> //Hamlib
|
#include <rig.h> //Hamlib
|
||||||
|
@ -193,7 +194,19 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
ui->lineEdit_vfoMain->setValue(0);
|
ui->lineEdit_vfoMain->setValue(0);
|
||||||
ui->lineEdit_vfoSub->setValue(0);
|
ui->lineEdit_vfoSub->setValue(0);
|
||||||
|
|
||||||
if (rigCom.autoConnect) ui->pushButton_Connect->toggle(); //Auto connect
|
//Check Hamlib version
|
||||||
|
if (!checkHamlibVersion(4, 6, 0))
|
||||||
|
{
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setWindowTitle("Hamlib");
|
||||||
|
msgBox.setText("Please, update Hamlib libraries to version 4.6 or higher.");
|
||||||
|
msgBox.setIcon(QMessageBox::Warning);
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
|
msgBox.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Auto connect
|
||||||
|
if (rigCom.autoConnect) ui->pushButton_Connect->toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
@ -802,6 +815,32 @@ void MainWindow::setSubMeter()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool MainWindow::checkHamlibVersion(int major, int minor, int revision)
|
||||||
|
{
|
||||||
|
QString hamlibVer = rig_version();
|
||||||
|
QRegularExpression hamlibVerExp("(?P<major>\\d)\\.(?P<minor>\\d)\\.?(?P<revision>\\d)?");
|
||||||
|
|
||||||
|
QRegularExpressionMatch hamlibVerMatch = hamlibVerExp.match(hamlibVer);
|
||||||
|
|
||||||
|
if (hamlibVerMatch.hasMatch())
|
||||||
|
{
|
||||||
|
int majorVer = hamlibVerMatch.captured("major").toInt();
|
||||||
|
int minorVer = hamlibVerMatch.captured("minor").toInt();
|
||||||
|
int revisionVer = hamlibVerMatch.captured("revision").toInt();
|
||||||
|
|
||||||
|
//qDebug()<<majorVer<<minorVer<<revisionVer;
|
||||||
|
|
||||||
|
if (majorVer > major) return true;
|
||||||
|
else if (majorVer < major) return false;
|
||||||
|
else if (minorVer > minor) return true; //& majorVer=major
|
||||||
|
else if (minorVer < minor) return false; //& majorVer=major
|
||||||
|
else if (revisionVer < revision) return false; //& majorVer=major, minorVer=minor
|
||||||
|
else return true; //revisionVer>=revision & majorVer=major, minorVer=minor
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//***** PushButton *****
|
//***** PushButton *****
|
||||||
|
|
||||||
void MainWindow::on_pushButton_Connect_toggled(bool checked)
|
void MainWindow::on_pushButton_Connect_toggled(bool checked)
|
||||||
|
|
|
@ -220,6 +220,8 @@ private:
|
||||||
|
|
||||||
void guiInit();
|
void guiInit();
|
||||||
void setSubMeter();
|
void setSubMeter();
|
||||||
|
|
||||||
|
bool checkHamlibVersion(int major, int minor, int revision);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|
Ładowanie…
Reference in New Issue