1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-04 15:04:38 -04:00

Add Radio Astronomy plugin

This commit is contained in:
Jon Beniston
2021-10-12 11:31:14 +01:00
parent 05fce637bc
commit fbef25884e
83 changed files with 19095 additions and 112 deletions
+25
View File
@@ -106,6 +106,31 @@ void VISA::close(ViSession session)
}
}
QStringList VISA::processCommands(ViSession session, const QString& commands)
{
QStringList list = commands.split("\n");
QStringList results;
for (int i = 0; i < list.size(); i++)
{
QString command = list[i].trimmed();
if (!command.isEmpty() && !command.startsWith("#")) // Allow # to comment out lines
{
qDebug() << "VISA ->: " << command;
QByteArray bytes = QString("%1\n").arg(command).toLatin1();
char *cmd = bytes.data();
viPrintf(session, cmd);
if (command.endsWith("?"))
{
char buf[1024] = "";
char format[] = "%t";
viScanf(session, format, buf);
results.append(buf);
qDebug() << "VISA <-: " << QString(buf).trimmed();
}
}
}
return results;
}
#ifdef _MSC_VER