@@ -178,6 +178,11 @@ AgilentOscilloscope::~AgilentOscilloscope()
178178{
179179}
180180
181+ /* *
182+ @brief Set up the operating mode for a channel
183+
184+ @param channel The channel to configure
185+ */
181186void AgilentOscilloscope::ConfigureWaveform (string channel)
182187{
183188 // Select the channel to apply settings to
@@ -194,6 +199,7 @@ void AgilentOscilloscope::ConfigureWaveform(string channel)
194199// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
195200// Accessors
196201
202+ // /@brief Return the constant driver name "agilent".
197203string AgilentOscilloscope::GetDriverNameInternal ()
198204{
199205 return " agilent" ;
@@ -231,16 +237,39 @@ void AgilentOscilloscope::FlushConfigCache()
231237 m_trigger = NULL ;
232238}
233239
240+ /* *
241+ @brief Check if a channel is analog
242+
243+ @param i Channel index
244+
245+ @return True if analog, false if digital
246+ */
234247bool AgilentOscilloscope::IsAnalogChannel (size_t i)
235248{
236249 return GetOscilloscopeChannel (i)->GetType (0 ) == Stream::STREAM_TYPE_ANALOG;
237250}
238251
239- size_t AgilentOscilloscope::GetDigitalPodIndex (size_t i) {
252+ /* *
253+ @brief Get the digital pod number given a channel number
254+
255+ @param i Channel index
256+
257+ @return Pod number
258+ */
259+ size_t AgilentOscilloscope::GetDigitalPodIndex (size_t i)
260+ {
240261 return ((i - m_digitalChannelBase) / 8 ) + 1 ;
241262}
242263
243- std::string AgilentOscilloscope::GetDigitalPodName (size_t i) {
264+ /* *
265+ @brief Get the digital pod name given a channel number
266+
267+ @param i Channel index
268+
269+ @return Pod name
270+ */
271+ std::string AgilentOscilloscope::GetDigitalPodName (size_t i)
272+ {
244273 return " POD" + to_string (GetDigitalPodIndex (i));
245274}
246275
@@ -561,6 +590,13 @@ Oscilloscope::TriggerMode AgilentOscilloscope::PollTrigger()
561590 }
562591}
563592
593+ /* *
594+ @brief Download waveform data from a single channel
595+
596+ @param channel Name of the channel
597+
598+ @return Raw waveform data
599+ */
564600vector<uint8_t > AgilentOscilloscope::GetWaveformData (string channel)
565601{
566602 lock_guard<recursive_mutex> lock (m_mutex);
@@ -586,6 +622,13 @@ vector<uint8_t> AgilentOscilloscope::GetWaveformData(string channel)
586622 return buf;
587623}
588624
625+ /* *
626+ @brief Get the waveform preamble for a single channel
627+
628+ @param channel Name of the channel
629+
630+ @return Preamble data
631+ */
589632AgilentOscilloscope::WaveformPreamble AgilentOscilloscope::GetWaveformPreamble (string channel)
590633{
591634 WaveformPreamble ret;
@@ -602,9 +645,18 @@ AgilentOscilloscope::WaveformPreamble AgilentOscilloscope::GetWaveformPreamble(s
602645 return ret;
603646}
604647
648+ /* *
649+ @brief Convert raw data from a digital pod into waveform objects
650+
651+ @param[out] pending_waveforms Resulting digital waveforms
652+ @param[in] data The raw sample data
653+ @param[in] preamble Preamble of the waveform
654+ @param chan_start Index of the first channel in the pod
655+ */
605656void AgilentOscilloscope::ProcessDigitalWaveforms (
606657 map<int , vector<WaveformBase*>> &pending_waveforms,
607- vector<uint8_t > &data, AgilentOscilloscope::WaveformPreamble &preamble,
658+ vector<uint8_t > &data,
659+ AgilentOscilloscope::WaveformPreamble &preamble,
608660 size_t chan_start)
609661{
610662 for (int i = 0 ; i < 8 ; i++)
@@ -797,7 +849,8 @@ bool AgilentOscilloscope::IsTriggerArmed()
797849 return m_triggerArmed;
798850}
799851
800- static std::map<uint64_t , double > sampleRateToDuration {
852+ static std::map<uint64_t , double > sampleRateToDuration
853+ {
801854 // Map sample rates to corresponding maximum on-screen time duration setting
802855 {8000 , 500 },
803856 {20000 , 200 },
@@ -896,6 +949,12 @@ uint64_t AgilentOscilloscope::GetSampleDepth()
896949 return depth;
897950}
898951
952+ /* *
953+ @brief Simultaneously set sample rate and memory depth
954+
955+ @param rate Sample rate, in samples per second
956+ @param depth Acquisition memory depth
957+ */
899958void AgilentOscilloscope::SetSampleRateAndDepth (uint64_t rate, uint64_t depth)
900959{
901960 // Look up the maximum capture duration for the requested sample rate
@@ -1024,6 +1083,9 @@ void AgilentOscilloscope::PullEdgeTrigger()
10241083 GetTriggerSlope (et, m_transport->ReadReply ());
10251084}
10261085
1086+ /* *
1087+ @brief Reads settings for an Nth-edge-burst trigger from the instrument
1088+ */
10271089void AgilentOscilloscope::PullNthEdgeBurstTrigger ()
10281090{
10291091 // Clear out any triggers of the wrong type
@@ -1065,6 +1127,9 @@ void AgilentOscilloscope::PullNthEdgeBurstTrigger()
10651127 bt->SetEdgeNumber (stoi (m_transport->ReadReply ()));
10661128}
10671129
1130+ /* *
1131+ @brief Reads settings for a pulse width trigger from the instrument
1132+ */
10681133void AgilentOscilloscope::PullPulseWidthTrigger ()
10691134{
10701135 // Clear out any triggers of the wrong type
@@ -1135,6 +1200,9 @@ void AgilentOscilloscope::PullPulseWidthTrigger()
11351200
11361201/* *
11371202 @brief Processes the slope for an edge or edge-derived trigger
1203+
1204+ @param trig Trigger to configure
1205+ @param reply Response from the instrument
11381206 */
11391207void AgilentOscilloscope::GetTriggerSlope (EdgeTrigger* trig, string reply)
11401208{
@@ -1152,6 +1220,9 @@ void AgilentOscilloscope::GetTriggerSlope(EdgeTrigger* trig, string reply)
11521220
11531221/* *
11541222 @brief Processes the slope for an Nth edge burst trigger
1223+
1224+ @param trig Trigger to configure
1225+ @param reply Response from the instrument
11551226 */
11561227void AgilentOscilloscope::GetTriggerSlope (NthEdgeBurstTrigger* trig, string reply)
11571228{
@@ -1164,7 +1235,9 @@ void AgilentOscilloscope::GetTriggerSlope(NthEdgeBurstTrigger* trig, string repl
11641235}
11651236
11661237/* *
1167- @brief Parses a trigger condition
1238+ @brief Converts a trigger condition from a string to a Trigger::Condition
1239+
1240+ @param reply Response from the instrument
11681241 */
11691242Trigger::Condition AgilentOscilloscope::GetCondition (string reply)
11701243{
@@ -1181,6 +1254,11 @@ Trigger::Condition AgilentOscilloscope::GetCondition(string reply)
11811254 return Trigger::CONDITION_LESS;
11821255}
11831256
1257+ /* *
1258+ @brief Figures out what kind of probe is connected to a channel
1259+
1260+ @param i Channel index
1261+ */
11841262void AgilentOscilloscope::GetProbeType (size_t i)
11851263{
11861264 {
@@ -1224,6 +1302,8 @@ void AgilentOscilloscope::PushTrigger()
12241302
12251303/* *
12261304 @brief Pushes settings for an edge trigger to the instrument
1305+
1306+ @param trig The trigger
12271307 */
12281308void AgilentOscilloscope::PushEdgeTrigger (EdgeTrigger* trig)
12291309{
@@ -1244,6 +1324,8 @@ void AgilentOscilloscope::PushEdgeTrigger(EdgeTrigger* trig)
12441324
12451325/* *
12461326 @brief Pushes settings for a Nth edge burst trigger to the instrument
1327+
1328+ @param trig The trigger
12471329 */
12481330void AgilentOscilloscope::PushNthEdgeBurstTrigger (NthEdgeBurstTrigger* trig)
12491331{
@@ -1260,6 +1342,8 @@ void AgilentOscilloscope::PushNthEdgeBurstTrigger(NthEdgeBurstTrigger* trig)
12601342
12611343/* *
12621344 @brief Pushes settings for a pulse width trigger to the instrument
1345+
1346+ @param trig The trigger
12631347 */
12641348void AgilentOscilloscope::PushPulseWidthTrigger (PulseWidthTrigger* trig)
12651349{
@@ -1285,6 +1369,12 @@ void AgilentOscilloscope::PushPulseWidthTrigger(PulseWidthTrigger* trig)
12851369 }
12861370}
12871371
1372+ /* *
1373+ @brief Send a trigger condition to the instrument
1374+
1375+ @param path SCPI path of the parameter to set
1376+ @param cond Trigger condition
1377+ */
12881378void AgilentOscilloscope::PushCondition (string path, Trigger::Condition cond)
12891379{
12901380 string cond_str;
@@ -1305,11 +1395,23 @@ void AgilentOscilloscope::PushCondition(string path, Trigger::Condition cond)
13051395 m_transport->SendCommand (path + " " + cond_str);
13061396}
13071397
1398+ /* *
1399+ @brief Send a floating-point value to the instrument
1400+
1401+ @param path SCPI path of the parameter to set
1402+ @param f The value to send
1403+ */
13081404void AgilentOscilloscope::PushFloat (string path, float f)
13091405{
13101406 m_transport->SendCommand (path + " " + to_string_sci (f));
13111407}
13121408
1409+ /* *
1410+ @brief Send a trigger slope to the instrument
1411+
1412+ @param path SCPI path of the parameter to set
1413+ @param slope The desired slope
1414+ */
13131415void AgilentOscilloscope::PushSlope (string path, EdgeTrigger::EdgeType slope)
13141416{
13151417 string slope_str;
@@ -1333,6 +1435,12 @@ void AgilentOscilloscope::PushSlope(string path, EdgeTrigger::EdgeType slope)
13331435 m_transport->SendCommand (path + " " + slope_str);
13341436}
13351437
1438+ /* *
1439+ @brief Send a trigger slope to the instrument
1440+
1441+ @param path SCPI path of the parameter to set
1442+ @param slope The desired slope
1443+ */
13361444void AgilentOscilloscope::PushSlope (string path, NthEdgeBurstTrigger::EdgeType slope)
13371445{
13381446 string slope_str;
0 commit comments