Merge branch 'master' of github.com:jankae/LibreVNA
This commit is contained in:
commit
c248bba1ed
@ -234,6 +234,14 @@ Device::~Device()
|
||||
}
|
||||
}
|
||||
|
||||
void Device::RegisterTypes()
|
||||
{
|
||||
qRegisterMetaType<Protocol::Datapoint>("Datapoint");
|
||||
qRegisterMetaType<Protocol::ManualStatusV1>("ManualV1");
|
||||
qRegisterMetaType<Protocol::SpectrumAnalyzerResult>("SpectrumAnalyzerResult");
|
||||
qRegisterMetaType<Protocol::AmplitudeCorrectionPoint>("AmplitudeCorrection");
|
||||
}
|
||||
|
||||
bool Device::SendPacket(const Protocol::PacketInfo& packet, std::function<void(TransmissionResult)> cb, unsigned int timeout)
|
||||
{
|
||||
Transmission t;
|
||||
|
@ -58,6 +58,8 @@ public:
|
||||
// connect to a VNA device. If serial is specified only connecting to this device, otherwise to the first one found
|
||||
Device(QString serial = QString());
|
||||
~Device();
|
||||
|
||||
static void RegisterTypes();
|
||||
bool SendPacket(const Protocol::PacketInfo& packet, std::function<void(TransmissionResult)> cb = nullptr, unsigned int timeout = 500);
|
||||
bool Configure(Protocol::SweepSettings settings, std::function<void(TransmissionResult)> cb = nullptr);
|
||||
bool Configure(Protocol::SpectrumAnalyzerSettings settings, std::function<void(TransmissionResult)> cb = nullptr);
|
||||
|
@ -234,11 +234,6 @@ AppWindow::AppWindow(QWidget *parent)
|
||||
// Set default mode
|
||||
vna->activate();
|
||||
|
||||
qRegisterMetaType<Protocol::Datapoint>("Datapoint");
|
||||
qRegisterMetaType<Protocol::ManualStatusV1>("ManualV1");
|
||||
qRegisterMetaType<Protocol::SpectrumAnalyzerResult>("SpectrumAnalyzerResult");
|
||||
qRegisterMetaType<Protocol::AmplitudeCorrectionPoint>("AmplitudeCorrection");
|
||||
|
||||
auto pref = Preferences::getInstance();
|
||||
if(pref.Startup.UseSetupFile) {
|
||||
LoadSetup(pref.Startup.SetupFile);
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "appwindow.h"
|
||||
#include <QtWidgets/QApplication>
|
||||
#include "Device/device.h"
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <signal.h>
|
||||
#endif
|
||||
@ -23,6 +24,8 @@ int main(int argc, char *argv[]) {
|
||||
QCoreApplication::setApplicationVersion(window->getAppVersion() + "-" +
|
||||
window->getAppGitHash().left(9));
|
||||
|
||||
Device::RegisterTypes();
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
signal(SIGINT, tryExitGracefully);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user