The sample rate on the Hameg scopes changes depending on the number of channels
turned on and on the current timebase.
Update the sample rate if any of the above change.
const char *tmp;
uint64_t p, q, tmp_u64;
double tmp_d;
const char *tmp;
uint64_t p, q, tmp_u64;
double tmp_d;
+ gboolean update_sample_rate;
if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG;
if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG;
model = devc->model_config;
state = devc->model_state;
model = devc->model_config;
state = devc->model_state;
+ update_sample_rate = FALSE;
float_str);
ret = sr_scpi_send(sdi->conn, command);
float_str);
ret = sr_scpi_send(sdi->conn, command);
+ update_sample_rate = TRUE;
if (ret == SR_OK)
ret = sr_scpi_get_opc(sdi->conn);
if (ret == SR_OK)
ret = sr_scpi_get_opc(sdi->conn);
+ if (ret == SR_OK && update_sample_rate)
+ ret = hmo_update_sample_rate(sdi);
+
{
GSList *l;
unsigned int i;
{
GSList *l;
unsigned int i;
+ gboolean *pod_enabled, setup_changed;
char command[MAX_COMMAND_SIZE];
struct scope_state *state;
struct scope_config *model;
char command[MAX_COMMAND_SIZE];
struct scope_state *state;
struct scope_config *model;
scpi = sdi->conn;
state = devc->model_state;
model = devc->model_config;
scpi = sdi->conn;
state = devc->model_state;
model = devc->model_config;
pod_enabled = g_try_malloc0(sizeof(gboolean) * model->digital_pods);
pod_enabled = g_try_malloc0(sizeof(gboolean) * model->digital_pods);
if (sr_scpi_send(scpi, command) != SR_OK)
return SR_ERR;
state->analog_channels[probe->index].state = probe->enabled;
if (sr_scpi_send(scpi, command) != SR_OK)
return SR_ERR;
state->analog_channels[probe->index].state = probe->enabled;
break;
case SR_PROBE_LOGIC:
/*
break;
case SR_PROBE_LOGIC:
/*
return SR_ERR;
state->digital_channels[probe->index] = probe->enabled;
return SR_ERR;
state->digital_channels[probe->index] = probe->enabled;
break;
default:
return SR_ERR;
break;
default:
return SR_ERR;
if (sr_scpi_send(scpi, command) != SR_OK)
return SR_ERR;
state->digital_pods[i - 1] = pod_enabled[i - 1];
if (sr_scpi_send(scpi, command) != SR_OK)
return SR_ERR;
state->digital_pods[i - 1] = pod_enabled[i - 1];
+ if (setup_changed && hmo_update_sample_rate(sdi) != SR_OK)
+ return SR_ERR;
+