kopia lustrzana https://github.com/f4exb/sdrangel
Report to GUI if failed to open VISA device
rodzic
5d24bf9086
commit
ae88a7e584
|
@ -120,10 +120,11 @@ void NoiseFigure::stop()
|
|||
m_thread.wait();
|
||||
}
|
||||
|
||||
void NoiseFigure::openVISADevice()
|
||||
bool NoiseFigure::openVISADevice()
|
||||
{
|
||||
m_visa.openDefault();
|
||||
m_session = m_visa.open(m_settings.m_visaDevice);
|
||||
return m_session != 0;
|
||||
}
|
||||
|
||||
void NoiseFigure::closeVISADevice()
|
||||
|
@ -406,8 +407,18 @@ bool NoiseFigure::handleMessage(const Message& cmd)
|
|||
{
|
||||
if (m_state == IDLE)
|
||||
{
|
||||
openVISADevice();
|
||||
QTimer::singleShot(0, this, SLOT(nextState()));
|
||||
if (!m_settings.m_visaDevice.isEmpty())
|
||||
{
|
||||
if (openVISADevice()) {
|
||||
QTimer::singleShot(0, this, SLOT(nextState()));
|
||||
} else if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(MsgFinished::create(QString("Failed to open VISA device %1").arg(m_settings.m_visaDevice)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QTimer::singleShot(0, this, SLOT(nextState()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -219,12 +219,8 @@ public:
|
|||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
void openVISADevice();
|
||||
bool openVISADevice();
|
||||
void closeVISADevice();
|
||||
void processVISA(QStringList commands);
|
||||
void powerOn();
|
||||
|
|
|
@ -49,9 +49,9 @@ NoiseFigureControlDialog::~NoiseFigureControlDialog()
|
|||
|
||||
void NoiseFigureControlDialog::accept()
|
||||
{
|
||||
m_settings->m_powerOnCommand = ui->powerOnCommand->text();
|
||||
m_settings->m_powerOffCommand = ui->powerOffCommand->text();
|
||||
m_settings->m_visaDevice = ui->device->text();
|
||||
m_settings->m_powerOnCommand = ui->powerOnCommand->text().trimmed();
|
||||
m_settings->m_powerOffCommand = ui->powerOffCommand->text().trimmed();
|
||||
m_settings->m_visaDevice = ui->device->text().trimmed();
|
||||
m_settings->m_powerOnSCPI = ui->powerOnSCPI->toPlainText();
|
||||
m_settings->m_powerOffSCPI = ui->powerOffSCPI->toPlainText();
|
||||
m_settings->m_powerDelay = ui->delay->value();
|
||||
|
|
Ładowanie…
Reference in New Issue