forked from Ivasoft/DSView
Able to set trig postion for demo
This commit is contained in:
@@ -233,7 +233,7 @@ void DsoTriggerDock::pos_changed(int pos)
|
||||
ret = _session->get_device()->set_config_byte(
|
||||
SR_CONF_HORIZ_TRIGGERPOS,pos);
|
||||
if (!ret) {
|
||||
if (_session->get_device()->is_hardware()){
|
||||
if (_session->get_device()->is_hardware() || true){
|
||||
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_HOR_TRI_POS_FAIL),
|
||||
"Change horiz trigger position failed!"));
|
||||
|
||||
@@ -379,6 +379,10 @@ void DsoTriggerDock::update_view()
|
||||
bool bDisable = _session->get_device()->is_file();
|
||||
bool ret;
|
||||
|
||||
if (_session->get_device()->is_demo()){
|
||||
bDisable = true;
|
||||
}
|
||||
|
||||
for(QAbstractButton * btn : _source_group->buttons()){
|
||||
btn->setDisabled(bDisable);
|
||||
}
|
||||
@@ -396,6 +400,11 @@ void DsoTriggerDock::update_view()
|
||||
_position_spinBox->setDisabled(bDisable);
|
||||
_position_slider->setDisabled(bDisable);
|
||||
|
||||
if (_session->get_device()->is_demo()){
|
||||
_position_spinBox->setDisabled(false);
|
||||
_position_slider->setDisabled(false);
|
||||
}
|
||||
|
||||
if (_session->get_device()->is_file()){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -884,6 +884,9 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
||||
case SR_CONF_CHANNEL_MODE:
|
||||
*data = g_variant_new_int16(vdev->logic_ch_mode);
|
||||
break;
|
||||
case SR_CONF_HORIZ_TRIGGERPOS:
|
||||
*data = g_variant_new_byte(vdev->trigger_hrate);
|
||||
break;
|
||||
default:
|
||||
return SR_ERR_NA;
|
||||
}
|
||||
@@ -1118,6 +1121,9 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
|
||||
|
||||
}
|
||||
break;
|
||||
case SR_CONF_HORIZ_TRIGGERPOS:
|
||||
vdev->trigger_hrate = g_variant_get_byte(data);
|
||||
break;
|
||||
default:
|
||||
sr_err("Unknown capability: %d.", id);
|
||||
return SR_ERR_NA;
|
||||
|
||||
@@ -204,6 +204,7 @@ struct session_vdev
|
||||
uint8_t max_height;
|
||||
struct sr_status mstatus;
|
||||
struct session_packet_buffer *packet_buffer;
|
||||
uint8_t trigger_hrate; //dso trig position.
|
||||
|
||||
//time
|
||||
uint64_t packet_len;
|
||||
|
||||
Reference in New Issue
Block a user