+ (*model->trigger_slopes)[idx]);
+ if (sr_scpi_send(sdi->conn, command) != SR_OK ||
+ sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ state->trigger_slope = idx;
+ ret = SR_OK;
+ break;
+ case SR_CONF_TRIGGER_PATTERN:
+ tmp_str = (char *)g_variant_get_string(data, 0);
+ idx = strlen(tmp_str);
+ if (idx == 0 || idx > model->analog_channels + model->digital_channels)
+ return SR_ERR_ARG;
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_TRIGGER_PATTERN],
+ tmp_str);
+ if (sr_scpi_send(sdi->conn, command) != SR_OK ||
+ sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ strncpy(state->trigger_pattern,
+ tmp_str,
+ MAX_ANALOG_CHANNEL_COUNT + MAX_DIGITAL_CHANNEL_COUNT);
+ ret = SR_OK;
+ break;
+ case SR_CONF_HIGH_RESOLUTION:
+ tmp_bool = g_variant_get_boolean(data);
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_HIGH_RESOLUTION],
+ tmp_bool ? "AUTO" : "OFF");
+ if (sr_scpi_send(sdi->conn, command) != SR_OK ||
+ sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ /* High Resolution mode automatically switches off Peak Detection. */
+ if (tmp_bool) {
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_PEAK_DETECTION],
+ "OFF");
+ if (sr_scpi_send(sdi->conn, command) != SR_OK ||
+ sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ state->peak_detection = FALSE;
+ }
+ state->high_resolution = tmp_bool;
+ ret = SR_OK;
+ break;
+ case SR_CONF_PEAK_DETECTION:
+ tmp_bool = g_variant_get_boolean(data);
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_PEAK_DETECTION],
+ tmp_bool ? "AUTO" : "OFF");
+ if (sr_scpi_send(sdi->conn, command) != SR_OK ||
+ sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ /* Peak Detection automatically switches off High Resolution mode. */
+ if (tmp_bool) {
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_HIGH_RESOLUTION],
+ "OFF");
+ if (sr_scpi_send(sdi->conn, command) != SR_OK ||
+ sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ state->high_resolution = FALSE;
+ }
+ state->peak_detection = tmp_bool;
+ ret = SR_OK;