/* Fetch the first frame. */
if (devc->enabled_analog_probes) {
devc->analog_frame_size = DS1000_ANALOG_LIVE_WAVEFORM_SIZE;
- devc->channel_frame = devc->enabled_analog_probes->data;
+ devc->channel = devc->enabled_analog_probes->data;
if (sr_scpi_send(sdi->conn, ":WAV:DATA? CHAN%d",
- devc->channel_frame->index + 1) != SR_OK)
+ devc->channel->index + 1) != SR_OK)
return SR_ERR;
} else {
- devc->channel_frame = devc->enabled_digital_probes->data;
+ devc->channel = devc->enabled_digital_probes->data;
if (sr_scpi_send(sdi->conn, ":WAV:DATA? DIG") != SR_OK)
return SR_ERR;
}
- devc->num_frame_bytes = 0;
+ devc->num_frame_samples = 0;
} else {
if (devc->enabled_analog_probes) {
if (devc->data_source == DATA_SOURCE_MEMORY)
return SR_ERR;
} else
devc->analog_frame_size = DS2000_ANALOG_LIVE_WAVEFORM_SIZE;
- devc->channel_frame = devc->enabled_analog_probes->data;
+ devc->channel = devc->enabled_analog_probes->data;
if (rigol_ds_capture_start(sdi) != SR_OK)
return SR_ERR;
}
return SR_ERR;
if (sr_scpi_send(sdi->conn, ":WAV:SOUR CHAN%d",
- devc->channel_frame->index + 1) != SR_OK)
+ devc->channel->index + 1) != SR_OK)
return SR_ERR;
/* Check that the number of samples will be accepted */
if (sr_scpi_send(sdi->conn, ":WAV:POIN %d;*OPC", devc->analog_frame_size) != SR_OK)
return SR_ERR;
sr_dbg("Starting reading data from channel %d",
- devc->channel_frame->index + 1);
+ devc->channel->index + 1);
if (sr_scpi_send(sdi->conn, ":WAV:SOUR CHAN%d",
- devc->channel_frame->index + 1) != SR_OK)
+ devc->channel->index + 1) != SR_OK)
return SR_ERR;
if (devc->data_source != DATA_SOURCE_LIVE) {
if (sr_scpi_send(sdi->conn, ":WAV:RES") != SR_OK)
} else
rigol_ds_set_wait_event(devc, WAIT_NONE);
- devc->num_frame_bytes = 0;
+ devc->num_frame_samples = 0;
devc->num_block_bytes = 0;
return SR_OK;
* appear eventually.
*/
if (devc->data_source == DATA_SOURCE_LIVE
- && (unsigned)len < devc->num_frame_bytes) {
+ && (unsigned)len < devc->num_frame_samples) {
sr_dbg("Discarding short data block");
sr_scpi_read(scpi, (char *)devc->buffer, len + 1);
return TRUE;
}
}
- probe = devc->channel_frame;
+ probe = devc->channel;
if (devc->model->protocol == PROTOCOL_IEEE488_2) {
len = devc->num_block_bytes - devc->num_block_read;
len = sr_scpi_read(scpi, (char *)devc->buffer,
DS1000_ANALOG_LIVE_WAVEFORM_SIZE) :
DIGITAL_WAVEFORM_SIZE;
len = sr_scpi_read(scpi, (char *)devc->buffer,
- waveform_size - devc->num_frame_bytes);
+ waveform_size - devc->num_frame_samples);
}
sr_dbg("Received %d bytes.", len);
if (len == -1)
return TRUE;
- if (devc->num_frame_bytes == 0) {
+ if (devc->num_frame_samples == 0) {
/* Start of a new frame. */
packet.type = SR_DF_FRAME_BEGIN;
sr_session_send(sdi, &packet);
sr_dbg("%d of %d block bytes read", devc->num_block_read, devc->num_block_bytes);
}
- devc->num_frame_bytes += len;
+ devc->num_frame_samples += len;
- if (devc->num_frame_bytes < devc->analog_frame_size)
+ if (devc->num_frame_samples < devc->analog_frame_size)
/* Don't have the whole frame yet. */
return TRUE;
- sr_dbg("Frame completed, %d samples", devc->num_frame_bytes);
+ sr_dbg("Frame completed, %d samples", devc->num_frame_samples);
} else {
logic.length = len - 10;
logic.unitsize = 2;
packet.type = SR_DF_FRAME_END;
sr_session_send(sdi, &packet);
if (devc->model->protocol == PROTOCOL_LEGACY)
- devc->num_frame_bytes = 0;
+ devc->num_frame_samples = 0;
else {
/* Signal end of data download to scope */
if (devc->data_source != DATA_SOURCE_LIVE)
}
if (devc->enabled_analog_probes
- && devc->channel_frame == devc->enabled_analog_probes->data
+ && devc->channel == devc->enabled_analog_probes->data
&& devc->enabled_analog_probes->next != NULL) {
/* We got the frame for the first analog channel, but
* there's a second analog channel. */
- devc->channel_frame = devc->enabled_analog_probes->next->data;
+ devc->channel = devc->enabled_analog_probes->next->data;
if (devc->model->protocol == PROTOCOL_IEEE488_2) {
rigol_ds_channel_start(sdi);
} else {
sr_scpi_send(sdi->conn, ":WAV:DATA? CHAN%c",
- devc->channel_frame->name[2]);
+ devc->channel->name[2]);
}
} else {
/* Done with both analog channels in this frame. */
if (devc->enabled_digital_probes
- && devc->channel_frame != devc->enabled_digital_probes->data) {
+ && devc->channel != devc->enabled_digital_probes->data) {
/* Now we need to get the digital data. */
- devc->channel_frame = devc->enabled_digital_probes->data;
+ devc->channel = devc->enabled_digital_probes->data;
sr_scpi_send(sdi->conn, ":WAV:DATA? DIG");
} else if (++devc->num_frames == devc->limit_frames) {
/* End of last frame. */
/* Get the next frame, starting with the first analog channel. */
if (devc->model->protocol == PROTOCOL_IEEE488_2) {
if (devc->enabled_analog_probes) {
- devc->channel_frame = devc->enabled_analog_probes->data;
+ devc->channel = devc->enabled_analog_probes->data;
rigol_ds_capture_start(sdi);
}
} else {
if (devc->enabled_analog_probes) {
- devc->channel_frame = devc->enabled_analog_probes->data;
+ devc->channel = devc->enabled_analog_probes->data;
sr_scpi_send(sdi->conn, ":WAV:DATA? CHAN%c",
- devc->channel_frame->name[2]);
+ devc->channel->name[2]);
} else {
- devc->channel_frame = devc->enabled_digital_probes->data;
+ devc->channel = devc->enabled_digital_probes->data;
sr_scpi_send(sdi->conn, ":WAV:DATA? DIG");
}
}