Enforce amplitude cal point limit, SCPI command for reading trace data

This commit is contained in:
Jan Käberich 2021-04-12 19:48:19 +02:00
parent 611b1ef59d
commit 62939ff882
21 changed files with 342 additions and 116 deletions

View file

@ -170,7 +170,7 @@ Device::Device(QString serial)
if(!m_handle) {
QString message = "No device found";
auto msg = new QMessageBox(QMessageBox::Icon::Warning, "Error opening device", message);
msg->exec();
msg->show();
libusb_exit(m_context);
throw std::runtime_error(message.toStdString());
return;
@ -187,7 +187,7 @@ Device::Device(QString serial)
message.append("\" Maybe you are already connected to this device?");
qWarning() << message;
auto msg = new QMessageBox(QMessageBox::Icon::Warning, "Error opening device", message);
msg->exec();
msg->show();
libusb_exit(m_context);
throw std::runtime_error(message.toStdString());
}
@ -360,7 +360,7 @@ void Device::SearchDevices(std::function<bool (libusb_device_handle *, QString)>
"If that is not the case, you can try installing the WinUSB driver using Zadig (https://zadig.akeo.ie/)");
qWarning() << message;
auto msg = new QMessageBox(QMessageBox::Icon::Warning, "Error opening device", message);
msg->exec();
msg->show();
}
continue;
}
@ -520,6 +520,12 @@ void Device::transmissionFinished(TransmissionResult result)
qWarning() << "transmissionFinished with empty transmission queue, stray Ack?";
return;
}
if(result == TransmissionResult::Timeout) {
qWarning() << "transmissionFinished with timeout";
}
if(result == TransmissionResult::Nack) {
qWarning() << "transmissionFinished with NACK";
}
auto t = transmissionQueue.dequeue();
if(t.callback) {
t.callback(result);

View file

@ -57,7 +57,7 @@ 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();
bool SendPacket(const Protocol::PacketInfo& packet, std::function<void(TransmissionResult)> cb = nullptr, unsigned int timeout = 200);
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);
bool SetManual(Protocol::ManualControl manual);