fix: Failed to load the default config

This commit is contained in:
dreamsourcelabTAI 2023-03-08 17:51:44 +08:00
parent 9b4a564ae9
commit 8e084fb0a9
20 changed files with 133 additions and 1148 deletions

View File

@ -75,6 +75,18 @@ public:
return _dev_type == DEV_TYPE_USB;
}
inline bool is_virtual(){
return (is_file() || is_demo());
}
inline bool is_hardware_logic(){
return is_hardware() && _driver_name == "DSLogic";
}
inline bool is_hardware_dso(){
return is_hardware() && _driver_name == "DSCope";
}
inline void set_callback(IDeviceAgentCallback *callback){
_callback = callback;
}

View File

@ -341,10 +341,11 @@ void DsoTriggerDock::type_changed()
void DsoTriggerDock::device_change()
{
if (_session->get_device()->name() != "DSLogic") {
if (_session->get_device()->is_hardware_logic() == false) {
_position_spinBox->setDisabled(true);
_position_slider->setDisabled(true);
} else {
}
else {
_position_spinBox->setDisabled(false);
_position_slider->setDisabled(false);
}
@ -352,7 +353,7 @@ void DsoTriggerDock::device_change()
void DsoTriggerDock::init()
{
if (_session->get_device()->name().contains("virtual")) {
if (_session->get_device()->is_virtual()) {
for(QAbstractButton * btn : _source_group->buttons())
btn->setDisabled(true);

View File

@ -188,13 +188,14 @@ void TriggerDock::simple_trigger()
void TriggerDock::adv_trigger()
{
if (_session->get_device()->driver_name() == "DSLogic") {
if (_session->get_device()->is_hardware_logic()) {
bool stream = false;
GVariant *gvar = _session->get_device()->get_config(NULL, NULL, SR_CONF_STREAM);
if (gvar != NULL) {
stream = g_variant_get_boolean(gvar);
g_variant_unref(gvar);
}
if (stream) {
dialogs::DSMessageBox msg(this);
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRIGGER), "Trigger"));
@ -204,7 +205,8 @@ void TriggerDock::adv_trigger()
msg.mBox()->setIcon(QMessageBox::Warning);
msg.exec();
_simple_radioButton->setChecked(true);
} else {
}
else {
widget_enable(0);
}
}
@ -275,17 +277,18 @@ void TriggerDock::device_updated()
}
sample_limits = _session->get_device()->get_sample_limit();
if (stream)
maxRange = 1;
else if (hw_depth >= sample_limits)
maxRange = DS_MAX_TRIG_PERCENT;
else
maxRange = ceil(hw_depth * DS_MAX_TRIG_PERCENT / sample_limits);
_position_spinBox->setRange(MinTrigPosition, maxRange);
_position_slider->setRange(MinTrigPosition, maxRange);
if (_session->get_device()->name().contains("virtual") ||
stream) {
if (_session->get_device()->is_virtual() || stream) {
_simple_radioButton->setChecked(true);
simple_trigger();
}

View File

@ -774,6 +774,7 @@ namespace pv
continue;
GVariant *gvar = NULL;
int id = 0;
//dsv_info("read key:'%s'", info->name);
@ -806,21 +807,24 @@ namespace pv
gvar = g_variant_new_string(sessionObj[info->name].toString().toLocal8Bit().data());
}
else if (info->datatype == SR_T_LIST)
{
int id = 0;
{
id = 0;
if (format_ver > 2){
// Is new version format.
id = sessionObj[info->name].toInt();
}
else{
else{
const char *fd_key = sessionObj[info->name].toString().toLocal8Bit().data();
id = ds_dsl_option_value_to_code(conf_dev_mode, info->key, fd_key);
if (id == -1){
dsv_warn("The lang text parse fail! will use default value, the text:%s", fd_key);
dsv_err("Convert failed, key:\"%s\", value:\"%s\""
,info->name, fd_key);
id = 0; //set default value.
}
else{
dsv_info("key:'%s',text:'%s',convert to code:%d",info->name, fd_key, id);
dsv_info("Convert success, key:\"%s\", value:\"%s\", get code:%d"
,info->name, fd_key, id);
}
}
gvar = g_variant_new_int16(id);
@ -832,7 +836,10 @@ namespace pv
continue;
}
_device_agent->set_config(NULL, NULL, info->key, gvar);
bool bFlag = _device_agent->set_config(NULL, NULL, info->key, gvar);
if (!bFlag){
dsv_err("Set device config option failed, id:%d, code:%d", info->key, id);
}
}
}

View File

@ -765,21 +765,27 @@ namespace pv
std::vector<view::Signal *> sigs;
view::Signal *signal = NULL;
int logic_chan_num = 0;
int dso_chan_num = 0;
int all_chann_num = 0;
// Make the logic probe list
for (GSList *l = _device_agent.get_channels(); l; l = l->next)
{
sr_channel *probe =
(sr_channel *)l->data;
assert(probe);
sr_channel *probe = (sr_channel *)l->data;
signal = NULL;
all_chann_num++;
switch (probe->type)
{
case SR_CHANNEL_LOGIC:
if (probe->enabled)
{
{
logic_chan_num++;
auto i = _signals.begin();
while (i != _signals.end())
{
if ((*i)->get_index() == probe->index)
@ -793,6 +799,7 @@ namespace pv
}
i++;
}
if (signal == NULL)
{
signal = new view::LogicSignal(_view_data->get_logic(), probe);
@ -802,7 +809,9 @@ namespace pv
case SR_CHANNEL_ANALOG:
if (probe->enabled)
{
{
dso_chan_num++;
auto i = _signals.begin();
while (i != _signals.end())
{
@ -835,6 +844,9 @@ namespace pv
}
spectrum_rebuild();
dsv_info("Rebuild channnel list, logic channel count:%d, dso channel count:%d, all:%d",
logic_chan_num, dso_chan_num, all_chann_num);
}
void SigSession::refresh(int holdtime)

View File

@ -31,6 +31,7 @@
#include "../utility/path.h"
#include "../ui/langresource.h"
#include "../log.h"
namespace pv {
namespace toolbars {
@ -188,16 +189,15 @@ void FileBar::on_actionDefault_triggered()
{
QDir dir(GetResourceDir());
if (!dir.exists()) {
MsgBox::Show(NULL, L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SAVE_CANFIND_SESSIONFILE), "Cannot find default session file for this device!"), this);
MsgBox::Show(NULL, L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SAVE_CANFIND_SESSIONFILE),
"Cannot find default session file for this device!"), this);
return;
}
QString driver_name = _session->get_device()->name();
QString driver_name = _session->get_device()->driver_name();
QString mode_name = QString::number(_session->get_device()->get_work_mode());
QString file_name = dir.absolutePath() + "/" + driver_name + mode_name +".def.dsc";
int language = AppConfig::Instance()._frameOptions.language;
QString file_name = dir.absolutePath() + "/" + driver_name + mode_name +
".def" + QString::number(language) + ".dsc";
sig_load_session(file_name);
}

View File

@ -117,7 +117,8 @@ void DsoSignal::set_scale(int height)
void DsoSignal::set_enable(bool enable)
{
if (session->get_device()->name() == "DSLogic" && get_index() == 0){
if (session->get_device()->is_hardware_logic()
&& get_index() == 0){
return;
}
@ -255,9 +256,10 @@ bool DsoSignal::load_settings()
_bits = DefaultBits;
dsv_warn("%s%d", "Warning: config_get SR_CONF_UNIT_BITS failed, set to %d(default).", DefaultBits);
if (strncmp(session->get_device()->name().toUtf8().data(), "virtual", 7))
if (session->get_device()->is_hardware())
return false;
}
gvar = session->get_device()->get_config(NULL, NULL, SR_CONF_REF_MIN);
if (gvar != NULL) {
_ref_min = g_variant_get_uint32(gvar);
@ -329,7 +331,8 @@ bool DsoSignal::load_settings()
}
else {
dsv_err("%s", "ERROR: config_get SR_CONF_TRIGGER_VALUE failed.");
if (strncmp(session->get_device()->name().toUtf8().data(), "virtual", 7))
if (session->get_device()->is_hardware())
return false;
}
@ -410,7 +413,7 @@ double DsoSignal::pos2ratio(int pos)
double DsoSignal::get_trig_vrate()
{
if (session->get_device()->name() == "DSLogic")
if (session->get_device()->is_hardware_logic())
return value2ratio(_trig_value - ratio2value(0.5)) + get_zero_ratio();
else
return value2ratio(_trig_value);
@ -428,12 +431,13 @@ void DsoSignal::set_trig_ratio(double ratio, bool delta_change)
{
double delta = ratio;
if (session->get_device()->name() == "DSLogic") {
if (session->get_device()->is_hardware_logic()) {
delta = delta - get_zero_ratio();
delta = min(delta, 0.5);
delta = max(delta, -0.5);
_trig_value = ratio2value(delta + 0.5);
} else {
}
else {
_trig_value = ratio2value(delta);
}
@ -1151,35 +1155,41 @@ bool DsoSignal::mouse_press(int right, const QPoint pt)
const QRectF x100_rect = get_rect(DSO_X100, y, right);
if (chEn_rect.contains(pt)) {
if (session->get_device()->name() != "virtual-session" &&
!_en_lock) {
if (session->get_device()->is_file() == false && !_en_lock) {
set_enable(!enabled());
}
return true;
} else if (enabled()) {
}
else if (enabled()) {
if (vDial_rect.contains(pt) && pt.x() > vDial_rect.center().x()) {
if (pt.y() > vDial_rect.center().y())
go_vDialNext(true);
else
go_vDialPre(true);
} else if (session->get_device()->name() != "virtual-session" &&
acdc_rect.contains(pt)) {
if (session->get_device()->name() == "DSLogic")
}
else if (session->get_device()->is_file() == false && acdc_rect.contains(pt)) {
if (session->get_device()->is_hardware_logic())
set_acCoupling((get_acCoupling()+1)%2);
else
set_acCoupling((get_acCoupling()+1)%2);
} else if (auto_rect.contains(pt)) {
if (!session->get_device()->name().contains("virtual"))
}
else if (auto_rect.contains(pt)) {
if (session->get_device()->is_hardware())
auto_start();
} else if (x1_rect.contains(pt)) {
}
else if (x1_rect.contains(pt)) {
set_factor(1);
} else if (x10_rect.contains(pt)) {
}
else if (x10_rect.contains(pt)) {
set_factor(10);
} else if (x100_rect.contains(pt)) {
}
else if (x100_rect.contains(pt)) {
set_factor(100);
} else {
}
else {
return false;
}
return true;
}
return false;

View File

@ -578,7 +578,7 @@ void View::update_scale_offset()
void View::mode_changed()
{
if (_device_agent->name().contains("virtual"))
if (_device_agent->is_virtual())
_scale = WellSamplesPerPixel * 1.0 / _session->cur_snap_samplerate();
_scale = max(min(_scale, _maxscale), _minscale);
}

View File

@ -1,74 +0,0 @@
{
"Device": "DSCope",
"DeviceMode": 1,
"Horizontal trigger position": "50",
"Language": 25,
"Operation Mode": "正常",
"Time base": "10000",
"Trigger channel": "0",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Version": 2,
"channel": [
{
"colour": "#eeb211",
"coupling": 0,
"enabled": true,
"index": 0,
"name": "0",
"trigValue": 0.40157480314960631,
"type": 10001,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.40157480314960631
},
{
"colour": "#009925",
"coupling": 0,
"enabled": true,
"index": 1,
"name": "1",
"trigValue": 0.59842519685039375,
"type": 10001,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.59842519685039375
}
],
"decoder": [
],
"measure": [
{
"index": 0,
"site": 0,
"type": 1
},
{
"index": 0,
"site": 1,
"type": 17
},
{
"index": 0,
"site": 2,
"type": 18
},
{
"index": 1,
"site": 5,
"type": 1
},
{
"index": 1,
"site": 6,
"type": 17
},
{
"index": 1,
"site": 7,
"type": 18
}
]
}

View File

@ -1,74 +0,0 @@
{
"Device": "DSCope",
"DeviceMode": 1,
"Horizontal trigger position": "50",
"Language": 31,
"Operation Mode": "Normal",
"Time base": "10000",
"Trigger channel": "0",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Version": 2,
"channel": [
{
"colour": "#eeb211",
"coupling": 0,
"enabled": true,
"index": 0,
"name": "0",
"trigValue": 0.40157480314960631,
"type": 10001,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.40157480314960631
},
{
"colour": "#009925",
"coupling": 0,
"enabled": true,
"index": 1,
"name": "1",
"trigValue": 0.59842519685039375,
"type": 10001,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.59842519685039375
}
],
"decoder": [
],
"measure": [
{
"index": 0,
"site": 0,
"type": 1
},
{
"index": 0,
"site": 1,
"type": 17
},
{
"index": 0,
"site": 2,
"type": 18
},
{
"index": 1,
"site": 5,
"type": 1
},
{
"index": 1,
"site": 6,
"type": 17
},
{
"index": 1,
"site": 7,
"type": 18
}
]
}

View File

@ -1,48 +0,0 @@
{
"Device": "DSCope",
"DeviceMode": 2,
"Horizontal trigger position": "0",
"Language": 25,
"Operation Mode": "正常",
"Sample count": "10000000",
"Sample rate": "10000000",
"Time base": "10000",
"Trigger channel": "0",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Version": 2,
"channel": [
{
"colour": "#eeb211",
"coupling": 0,
"enabled": true,
"index": 0,
"mapMax": 5,
"mapMin": -5,
"mapUnit": "V",
"name": "0",
"type": 10002,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.5
},
{
"colour": "#009925",
"coupling": 0,
"enabled": true,
"index": 1,
"mapMax": 5,
"mapMin": -5,
"mapUnit": "V",
"name": "1",
"type": 10002,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.5
}
],
"decoder": [
]
}

View File

@ -1,48 +0,0 @@
{
"Device": "DSCope",
"DeviceMode": 2,
"Horizontal trigger position": "0",
"Language": 31,
"Operation Mode": "Normal",
"Sample count": "10000000",
"Sample rate": "10000000",
"Time base": "10000",
"Trigger channel": "0",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Version": 2,
"channel": [
{
"colour": "#eeb211",
"coupling": 0,
"enabled": true,
"index": 0,
"mapMax": 5,
"mapMin": -5,
"mapUnit": "V",
"name": "0",
"type": 10002,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.5
},
{
"colour": "#009925",
"coupling": 0,
"enabled": true,
"index": 1,
"mapMax": 5,
"mapMin": -5,
"mapUnit": "V",
"name": "1",
"type": 10002,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.5
}
],
"decoder": [
]
}

View File

@ -1,279 +0,0 @@
{
"Channel Mode": "使用16个通道(最大采样率 20MHz)",
"Device": "DSLogic",
"DeviceMode": 0,
"Enable RLE Compress": 0,
"Filter Targets": "无",
"Horizontal trigger position": "0",
"Language": 25,
"Max Height": "1X",
"Operation Mode": "Stream模式",
"Sample count": "1000000",
"Sample rate": "1000000",
"Stop Options": "上传已采集的数据",
"Threshold Level": 1,
"Trigger channel": "0",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Using Clock Negedge": 0,
"Using External Clock": 0,
"Version": 2,
"channel": [
{
"colour": "default",
"enabled": true,
"index": 0,
"name": "0",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 1,
"name": "1",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 2,
"name": "2",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 3,
"name": "3",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 4,
"name": "4",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 5,
"name": "5",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 6,
"name": "6",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 7,
"name": "7",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 8,
"name": "8",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 9,
"name": "9",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 10,
"name": "10",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 11,
"name": "11",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 12,
"name": "12",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 13,
"name": "13",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 14,
"name": "14",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 15,
"name": "15",
"strigger": 0,
"type": 10000
}
],
"decoder": [
],
"trigger": {
"advTriggerMode": false,
"serialTriggerBits": 0,
"serialTriggerChannel": 0,
"serialTriggerClock": "X X X X X X X X X X X X X X X X",
"serialTriggerData": "X X X X X X X X X X X X X X X X",
"serialTriggerStart": "X X X X X X X X X X X X X X X X",
"serialTriggerStop": "X X X X X X X X X X X X X X X X",
"stageTriggerContiguous0": false,
"stageTriggerContiguous1": false,
"stageTriggerContiguous10": false,
"stageTriggerContiguous11": false,
"stageTriggerContiguous12": false,
"stageTriggerContiguous13": false,
"stageTriggerContiguous14": false,
"stageTriggerContiguous15": false,
"stageTriggerContiguous2": false,
"stageTriggerContiguous3": false,
"stageTriggerContiguous4": false,
"stageTriggerContiguous5": false,
"stageTriggerContiguous6": false,
"stageTriggerContiguous7": false,
"stageTriggerContiguous8": false,
"stageTriggerContiguous9": false,
"stageTriggerCount0": 1,
"stageTriggerCount1": 1,
"stageTriggerCount10": 1,
"stageTriggerCount11": 1,
"stageTriggerCount12": 1,
"stageTriggerCount13": 1,
"stageTriggerCount14": 1,
"stageTriggerCount15": 1,
"stageTriggerCount2": 1,
"stageTriggerCount3": 1,
"stageTriggerCount4": 1,
"stageTriggerCount5": 1,
"stageTriggerCount6": 1,
"stageTriggerCount7": 1,
"stageTriggerCount8": 1,
"stageTriggerCount9": 1,
"stageTriggerInv00": 0,
"stageTriggerInv01": 0,
"stageTriggerInv010": 0,
"stageTriggerInv011": 0,
"stageTriggerInv012": 0,
"stageTriggerInv013": 0,
"stageTriggerInv014": 0,
"stageTriggerInv015": 0,
"stageTriggerInv02": 0,
"stageTriggerInv03": 0,
"stageTriggerInv04": 0,
"stageTriggerInv05": 0,
"stageTriggerInv06": 0,
"stageTriggerInv07": 0,
"stageTriggerInv08": 0,
"stageTriggerInv09": 0,
"stageTriggerInv10": 0,
"stageTriggerInv11": 0,
"stageTriggerInv110": 0,
"stageTriggerInv111": 0,
"stageTriggerInv112": 0,
"stageTriggerInv113": 0,
"stageTriggerInv114": 0,
"stageTriggerInv115": 0,
"stageTriggerInv12": 0,
"stageTriggerInv13": 0,
"stageTriggerInv14": 0,
"stageTriggerInv15": 0,
"stageTriggerInv16": 0,
"stageTriggerInv17": 0,
"stageTriggerInv18": 0,
"stageTriggerInv19": 0,
"stageTriggerLogic0": 1,
"stageTriggerLogic1": 1,
"stageTriggerLogic10": 1,
"stageTriggerLogic11": 1,
"stageTriggerLogic12": 1,
"stageTriggerLogic13": 1,
"stageTriggerLogic14": 1,
"stageTriggerLogic15": 1,
"stageTriggerLogic2": 1,
"stageTriggerLogic3": 1,
"stageTriggerLogic4": 1,
"stageTriggerLogic5": 1,
"stageTriggerLogic6": 1,
"stageTriggerLogic7": 1,
"stageTriggerLogic8": 1,
"stageTriggerLogic9": 1,
"stageTriggerValue00": "X X X X X X X X X X X X X X X X",
"stageTriggerValue01": "X X X X X X X X X X X X X X X X",
"stageTriggerValue010": "X X X X X X X X X X X X X X X X",
"stageTriggerValue011": "X X X X X X X X X X X X X X X X",
"stageTriggerValue012": "X X X X X X X X X X X X X X X X",
"stageTriggerValue013": "X X X X X X X X X X X X X X X X",
"stageTriggerValue014": "X X X X X X X X X X X X X X X X",
"stageTriggerValue015": "X X X X X X X X X X X X X X X X",
"stageTriggerValue02": "X X X X X X X X X X X X X X X X",
"stageTriggerValue03": "X X X X X X X X X X X X X X X X",
"stageTriggerValue04": "X X X X X X X X X X X X X X X X",
"stageTriggerValue05": "X X X X X X X X X X X X X X X X",
"stageTriggerValue06": "X X X X X X X X X X X X X X X X",
"stageTriggerValue07": "X X X X X X X X X X X X X X X X",
"stageTriggerValue08": "X X X X X X X X X X X X X X X X",
"stageTriggerValue09": "X X X X X X X X X X X X X X X X",
"stageTriggerValue10": "X X X X X X X X X X X X X X X X",
"stageTriggerValue11": "X X X X X X X X X X X X X X X X",
"stageTriggerValue110": "X X X X X X X X X X X X X X X X",
"stageTriggerValue111": "X X X X X X X X X X X X X X X X",
"stageTriggerValue112": "X X X X X X X X X X X X X X X X",
"stageTriggerValue113": "X X X X X X X X X X X X X X X X",
"stageTriggerValue114": "X X X X X X X X X X X X X X X X",
"stageTriggerValue115": "X X X X X X X X X X X X X X X X",
"stageTriggerValue12": "X X X X X X X X X X X X X X X X",
"stageTriggerValue13": "X X X X X X X X X X X X X X X X",
"stageTriggerValue14": "X X X X X X X X X X X X X X X X",
"stageTriggerValue15": "X X X X X X X X X X X X X X X X",
"stageTriggerValue16": "X X X X X X X X X X X X X X X X",
"stageTriggerValue17": "X X X X X X X X X X X X X X X X",
"stageTriggerValue18": "X X X X X X X X X X X X X X X X",
"stageTriggerValue19": "X X X X X X X X X X X X X X X X",
"triggerPos": 1,
"triggerStages": 0,
"triggerTab": 0
}
}

View File

@ -1,279 +0,0 @@
{
"Channel Mode": "Use 16 Channels (Max 20MHz)",
"Device": "DSLogic",
"DeviceMode": 0,
"Enable RLE Compress": 0,
"Filter Targets": "None",
"Horizontal trigger position": "0",
"Language": 31,
"Max Height": "1X",
"Operation Mode": "Stream Mode",
"Sample count": "1000000",
"Sample rate": "1000000",
"Stop Options": "Upload captured data",
"Threshold Level": 1,
"Trigger channel": "0",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Using Clock Negedge": 0,
"Using External Clock": 0,
"Version": 2,
"channel": [
{
"colour": "default",
"enabled": true,
"index": 0,
"name": "0",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 1,
"name": "1",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 2,
"name": "2",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 3,
"name": "3",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 4,
"name": "4",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 5,
"name": "5",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 6,
"name": "6",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 7,
"name": "7",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 8,
"name": "8",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 9,
"name": "9",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 10,
"name": "10",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 11,
"name": "11",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 12,
"name": "12",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 13,
"name": "13",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 14,
"name": "14",
"strigger": 0,
"type": 10000
},
{
"colour": "default",
"enabled": true,
"index": 15,
"name": "15",
"strigger": 0,
"type": 10000
}
],
"decoder": [
],
"trigger": {
"advTriggerMode": false,
"serialTriggerBits": 0,
"serialTriggerChannel": 0,
"serialTriggerClock": "X X X X X X X X X X X X X X X X",
"serialTriggerData": "X X X X X X X X X X X X X X X X",
"serialTriggerStart": "X X X X X X X X X X X X X X X X",
"serialTriggerStop": "X X X X X X X X X X X X X X X X",
"stageTriggerContiguous0": false,
"stageTriggerContiguous1": false,
"stageTriggerContiguous10": false,
"stageTriggerContiguous11": false,
"stageTriggerContiguous12": false,
"stageTriggerContiguous13": false,
"stageTriggerContiguous14": false,
"stageTriggerContiguous15": false,
"stageTriggerContiguous2": false,
"stageTriggerContiguous3": false,
"stageTriggerContiguous4": false,
"stageTriggerContiguous5": false,
"stageTriggerContiguous6": false,
"stageTriggerContiguous7": false,
"stageTriggerContiguous8": false,
"stageTriggerContiguous9": false,
"stageTriggerCount0": 1,
"stageTriggerCount1": 1,
"stageTriggerCount10": 1,
"stageTriggerCount11": 1,
"stageTriggerCount12": 1,
"stageTriggerCount13": 1,
"stageTriggerCount14": 1,
"stageTriggerCount15": 1,
"stageTriggerCount2": 1,
"stageTriggerCount3": 1,
"stageTriggerCount4": 1,
"stageTriggerCount5": 1,
"stageTriggerCount6": 1,
"stageTriggerCount7": 1,
"stageTriggerCount8": 1,
"stageTriggerCount9": 1,
"stageTriggerInv00": 0,
"stageTriggerInv01": 0,
"stageTriggerInv010": 0,
"stageTriggerInv011": 0,
"stageTriggerInv012": 0,
"stageTriggerInv013": 0,
"stageTriggerInv014": 0,
"stageTriggerInv015": 0,
"stageTriggerInv02": 0,
"stageTriggerInv03": 0,
"stageTriggerInv04": 0,
"stageTriggerInv05": 0,
"stageTriggerInv06": 0,
"stageTriggerInv07": 0,
"stageTriggerInv08": 0,
"stageTriggerInv09": 0,
"stageTriggerInv10": 0,
"stageTriggerInv11": 0,
"stageTriggerInv110": 0,
"stageTriggerInv111": 0,
"stageTriggerInv112": 0,
"stageTriggerInv113": 0,
"stageTriggerInv114": 0,
"stageTriggerInv115": 0,
"stageTriggerInv12": 0,
"stageTriggerInv13": 0,
"stageTriggerInv14": 0,
"stageTriggerInv15": 0,
"stageTriggerInv16": 0,
"stageTriggerInv17": 0,
"stageTriggerInv18": 0,
"stageTriggerInv19": 0,
"stageTriggerLogic0": 1,
"stageTriggerLogic1": 1,
"stageTriggerLogic10": 1,
"stageTriggerLogic11": 1,
"stageTriggerLogic12": 1,
"stageTriggerLogic13": 1,
"stageTriggerLogic14": 1,
"stageTriggerLogic15": 1,
"stageTriggerLogic2": 1,
"stageTriggerLogic3": 1,
"stageTriggerLogic4": 1,
"stageTriggerLogic5": 1,
"stageTriggerLogic6": 1,
"stageTriggerLogic7": 1,
"stageTriggerLogic8": 1,
"stageTriggerLogic9": 1,
"stageTriggerValue00": "X X X X X X X X X X X X X X X X",
"stageTriggerValue01": "X X X X X X X X X X X X X X X X",
"stageTriggerValue010": "X X X X X X X X X X X X X X X X",
"stageTriggerValue011": "X X X X X X X X X X X X X X X X",
"stageTriggerValue012": "X X X X X X X X X X X X X X X X",
"stageTriggerValue013": "X X X X X X X X X X X X X X X X",
"stageTriggerValue014": "X X X X X X X X X X X X X X X X",
"stageTriggerValue015": "X X X X X X X X X X X X X X X X",
"stageTriggerValue02": "X X X X X X X X X X X X X X X X",
"stageTriggerValue03": "X X X X X X X X X X X X X X X X",
"stageTriggerValue04": "X X X X X X X X X X X X X X X X",
"stageTriggerValue05": "X X X X X X X X X X X X X X X X",
"stageTriggerValue06": "X X X X X X X X X X X X X X X X",
"stageTriggerValue07": "X X X X X X X X X X X X X X X X",
"stageTriggerValue08": "X X X X X X X X X X X X X X X X",
"stageTriggerValue09": "X X X X X X X X X X X X X X X X",
"stageTriggerValue10": "X X X X X X X X X X X X X X X X",
"stageTriggerValue11": "X X X X X X X X X X X X X X X X",
"stageTriggerValue110": "X X X X X X X X X X X X X X X X",
"stageTriggerValue111": "X X X X X X X X X X X X X X X X",
"stageTriggerValue112": "X X X X X X X X X X X X X X X X",
"stageTriggerValue113": "X X X X X X X X X X X X X X X X",
"stageTriggerValue114": "X X X X X X X X X X X X X X X X",
"stageTriggerValue115": "X X X X X X X X X X X X X X X X",
"stageTriggerValue12": "X X X X X X X X X X X X X X X X",
"stageTriggerValue13": "X X X X X X X X X X X X X X X X",
"stageTriggerValue14": "X X X X X X X X X X X X X X X X",
"stageTriggerValue15": "X X X X X X X X X X X X X X X X",
"stageTriggerValue16": "X X X X X X X X X X X X X X X X",
"stageTriggerValue17": "X X X X X X X X X X X X X X X X",
"stageTriggerValue18": "X X X X X X X X X X X X X X X X",
"stageTriggerValue19": "X X X X X X X X X X X X X X X X",
"triggerPos": 1,
"triggerStages": 0,
"triggerTab": 0
}
}

View File

@ -1,82 +0,0 @@
{
"Channel Mode": "使用通道 0~1 (最大采样率 200MHz)",
"Device": "DSLogic",
"DeviceMode": 1,
"Enable RLE Compress": 1,
"Filter Targets": "无",
"Horizontal trigger position": "50",
"Language": 25,
"Max Height": "1X",
"Operation Mode": "Stream模式",
"Sample count": "1000000",
"Sample rate": "100000000",
"Stop Options": "上传已采集的数据",
"Threshold Level": "1.8/2.5/3.3V Level",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Using Clock Negedge": 0,
"Using External Clock": 0,
"Version": 2,
"channel": [
{
"colour": "#eeb211",
"coupling": 0,
"enabled": true,
"index": 0,
"name": "0",
"trigValue": 0.40157480314960631,
"type": 10001,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.40157480314960631
},
{
"colour": "#009925",
"coupling": 0,
"enabled": true,
"index": 1,
"name": "1",
"trigValue": 0.59842519685039375,
"type": 10001,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.59842519685039375
}
],
"decoder": [
],
"measure": [
{
"index": 0,
"site": 0,
"type": 1
},
{
"index": 0,
"site": 1,
"type": 17
},
{
"index": 0,
"site": 2,
"type": 18
},
{
"index": 1,
"site": 5,
"type": 1
},
{
"index": 1,
"site": 6,
"type": 17
},
{
"index": 1,
"site": 7,
"type": 18
}
]
}

View File

@ -1,82 +0,0 @@
{
"Channel Mode": "Use Channels 0~1 (Max 200MHz)",
"Device": "DSLogic",
"DeviceMode": 1,
"Enable RLE Compress": 1,
"Filter Targets": "None",
"Horizontal trigger position": "50",
"Language": 31,
"Max Height": "1X",
"Operation Mode": "Stream Mode",
"Sample count": "1000000",
"Sample rate": "100000000",
"Stop Options": "Upload captured data",
"Threshold Level": "1.8/2.5/3.3V Level",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Using Clock Negedge": 0,
"Using External Clock": 0,
"Version": 2,
"channel": [
{
"colour": "#eeb211",
"coupling": 0,
"enabled": true,
"index": 0,
"name": "0",
"trigValue": 0.40157480314960631,
"type": 10001,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.40157480314960631
},
{
"colour": "#009925",
"coupling": 0,
"enabled": true,
"index": 1,
"name": "1",
"trigValue": 0.59842519685039375,
"type": 10001,
"vdiv": 1000,
"vfactor": 1,
"zeroPos": 0.59842519685039375
}
],
"decoder": [
],
"measure": [
{
"index": 0,
"site": 0,
"type": 1
},
{
"index": 0,
"site": 1,
"type": 17
},
{
"index": 0,
"site": 2,
"type": 18
},
{
"index": 1,
"site": 5,
"type": 1
},
{
"index": 1,
"site": 6,
"type": 17
},
{
"index": 1,
"site": 7,
"type": 18
}
]
}

View File

@ -1,52 +0,0 @@
{
"Channel Mode": "使用通道 0~1 (最大采样率 10MHz)",
"Device": "DSLogic",
"DeviceMode": 2,
"Enable RLE Compress": 1,
"Filter Targets": "无",
"Horizontal trigger position": "0",
"Language": 25,
"Max Height": "1X",
"Operation Mode": "Stream模式",
"Sample count": "1000000",
"Sample rate": "1000000",
"Stop Options": "上传已采集的数据",
"Threshold Level": "1.8/2.5/3.3V Level",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Using Clock Negedge": 0,
"Using External Clock": 0,
"Version": 2,
"channel": [
{
"colour": "#eeb211",
"coupling": 0,
"enabled": true,
"index": 0,
"mapMax": 5,
"mapMin": -5,
"mapUnit": "V",
"name": "0",
"type": 10002,
"vdiv": 1000,
"zeroPos": 0.5
},
{
"colour": "#009925",
"coupling": 0,
"enabled": true,
"index": 1,
"mapMax": 5,
"mapMin": -5,
"mapUnit": "V",
"name": "1",
"type": 10002,
"vdiv": 1000,
"zeroPos": 0.5
}
],
"decoder": [
]
}

View File

@ -1,52 +0,0 @@
{
"Channel Mode": "Use Channels 0~1 (Max 10MHz)",
"Device": "DSLogic",
"DeviceMode": 2,
"Enable RLE Compress": 1,
"Filter Targets": "None",
"Horizontal trigger position": "0",
"Language": 31,
"Max Height": "1X",
"Operation Mode": "Stream Mode",
"Sample count": "1000000",
"Sample rate": "1000000",
"Stop Options": "Upload captured data",
"Threshold Level": "1.8/2.5/3.3V Level",
"Trigger hold off": "0",
"Trigger margin": "8",
"Trigger slope": "0",
"Trigger source": "0",
"Using Clock Negedge": 0,
"Using External Clock": 0,
"Version": 2,
"channel": [
{
"colour": "#eeb211",
"coupling": 0,
"enabled": true,
"index": 0,
"mapMax": 5,
"mapMin": -5,
"mapUnit": "V",
"name": "0",
"type": 10002,
"vdiv": 1000,
"zeroPos": 0.5
},
{
"colour": "#009925",
"coupling": 0,
"enabled": true,
"index": 1,
"mapMax": 5,
"mapMin": -5,
"mapUnit": "V",
"name": "1",
"type": 10002,
"vdiv": 1000,
"zeroPos": 0.5
}
],
"decoder": [
]
}

View File

@ -1527,30 +1527,39 @@ SR_PRIV int sr_dslogic_option_value_to_code(const struct sr_dev_inst *sdi, int c
int i;
int n;
struct DSL_context *devc;
char *list_text;
char *cn_name;
assert(sdi);
assert(sdi->priv);
devc = sdi->priv;
list_text = NULL;
cn_name = NULL;
if (config_id == SR_CONF_CHANNEL_MODE)
{
for (i = 0; i < ARRAY_SIZE(channel_modes); i++) {
list_text = channel_modes[i].descr;
if (devc->profile->dev_caps.channels & (1 << i))
{
if (strcmp(channel_modes[i].descr, value) == 0)
{
if (strcmp(list_text, value) == 0)
return channel_modes[i].id;
if (i < ARRAY_SIZE(channel_mode_cn_map)){
if (channel_modes[i].id != channel_mode_cn_map[i].id)
assert(0);
if (strcmp(channel_mode_cn_map[i].name, value) == 0)
assert(0);
cn_name = channel_mode_cn_map[i].name;
if (strcmp(cn_name, value) == 0)
return channel_modes[i].id;
}
}
}
sr_err("Unkown lang text value:%s,config id:%d", value, config_id);
sr_err("Unkown text value:%s, config id:%d", value, config_id);
return -1;
}

View File

@ -1156,44 +1156,45 @@ struct ds_trigger_pos {
uint32_t status;
};
enum DSL_CHANNEL_ID {
enum DSL_CHANNEL_ID
{
DSL_STREAM20x16 = 0,
DSL_STREAM25x12,
DSL_STREAM50x6,
DSL_STREAM100x3,
DSL_STREAM25x12 = 1,
DSL_STREAM50x6 = 2,
DSL_STREAM100x3 = 3,
DSL_STREAM20x16_3DN2,
DSL_STREAM25x12_3DN2,
DSL_STREAM50x6_3DN2,
DSL_STREAM100x3_3DN2,
DSL_STREAM20x16_3DN2 = 4,
DSL_STREAM25x12_3DN2 = 5,
DSL_STREAM50x6_3DN2 = 6,
DSL_STREAM100x3_3DN2 = 7,
DSL_STREAM10x32_32_3DN2,
DSL_STREAM20x16_32_3DN2,
DSL_STREAM25x12_32_3DN2,
DSL_STREAM50x6_32_3DN2,
DSL_STREAM100x3_32_3DN2,
DSL_STREAM10x32_32_3DN2 = 8,
DSL_STREAM20x16_32_3DN2 = 9,
DSL_STREAM25x12_32_3DN2 = 10,
DSL_STREAM50x6_32_3DN2 = 11,
DSL_STREAM100x3_32_3DN2 = 12,
DSL_STREAM50x32,
DSL_STREAM100x30,
DSL_STREAM250x12,
DSL_STREAM125x16_16,
DSL_STREAM250x12_16,
DSL_STREAM500x6,
DSL_STREAM1000x3,
DSL_STREAM50x32 = 13,
DSL_STREAM100x30 = 14,
DSL_STREAM250x12 = 15,
DSL_STREAM125x16_16 = 16,
DSL_STREAM250x12_16 = 17,
DSL_STREAM500x6 = 18,
DSL_STREAM1000x3 = 19,
DSL_BUFFER100x16,
DSL_BUFFER200x8,
DSL_BUFFER400x4,
DSL_BUFFER100x16 = 20,
DSL_BUFFER200x8 = 21,
DSL_BUFFER400x4 = 22,
DSL_BUFFER250x32,
DSL_BUFFER500x16,
DSL_BUFFER1000x8,
DSL_BUFFER250x32 = 23,
DSL_BUFFER500x16 = 24,
DSL_BUFFER1000x8 = 25,
DSL_ANALOG10x2,
DSL_ANALOG10x2_500,
DSL_ANALOG10x2 = 26,
DSL_ANALOG10x2_500 = 27,
DSL_DSO200x2,
DSL_DSO1000x2,
DSL_DSO200x2 = 28,
DSL_DSO1000x2 = 29,
};
/*--- input/input.c ---------------------------------------------------------*/