diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-10 15:18:59 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-10 15:18:59 -0500 |
commit | 8d3c1358eeaefec559c4a09995ff5b26393a9620 (patch) | |
tree | ab62cda8a3ddb0f77608625a52525726a7989665 /servers/gpib_server_lin/src/gpib_conn.cpp | |
parent | cb05310c2faa576313ebb0a637b09588a3a588a1 (diff) | |
download | ulab-8d3c1358eeaefec559c4a09995ff5b26393a9620.tar.gz ulab-8d3c1358eeaefec559c4a09995ff5b26393a9620.zip |
Add untested support for scope trace grabbing
Diffstat (limited to 'servers/gpib_server_lin/src/gpib_conn.cpp')
-rw-r--r-- | servers/gpib_server_lin/src/gpib_conn.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/servers/gpib_server_lin/src/gpib_conn.cpp b/servers/gpib_server_lin/src/gpib_conn.cpp index cf19cee..a17ee1f 100644 --- a/servers/gpib_server_lin/src/gpib_conn.cpp +++ b/servers/gpib_server_lin/src/gpib_conn.cpp @@ -267,6 +267,27 @@ void GPIBSocket::commandLoop() { writeEndOfFrame(); } } + else if ((m_instrumentCommand == "GETCHANNELTRACE")) { // Want channel trace + TQ_INT32 value; + ds >> value; + TQ_INT32 traceLength; + traceLength = scope_get_channel_trace(value, m_serverParent->m_scopeType.ascii(), m_serverParent->m_scopeDeviceSocket); + if (traceLength > 0) { + int i; + TQFloatArray traceData; + traceData.resize(traceLength); + for (i=0; i<traceLength; i++) { + traceData[i] = scope_raw_trace_data[i]; + } + ds << TQString("ACK"); + ds << traceData; + writeEndOfFrame(); + } + else { + ds << TQString("NCK"); + writeEndOfFrame(); + } + } else if (m_instrumentCommand == "SETVOLTSDIV") { // Want to change volts per division TQ_INT32 value1; ds >> value1; @@ -461,7 +482,6 @@ void GPIBSocket::commandLoop() { } } else if ((m_instrumentCommand == "GETSPECTRUMTRACE")) { // Want SA trace - ds << TQString("ACK"); if (commanalyzer_get_spectrum_analyzer_trace(m_serverParent->m_commanalyzerType.ascii(), m_serverParent->m_commanalyzerDeviceSocket) == 0) { int i; int tracelen = commanalyzerTraceLength(m_serverParent->m_commanalyzerType.ascii()); @@ -470,6 +490,7 @@ void GPIBSocket::commandLoop() { for (i=0; i<tracelen; i++) { traceData[i] = commanalyzer_raw_trace_data[i]; } + ds << TQString("ACK"); ds << traceData; writeEndOfFrame(); } |