mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-23 13:42:55 +08:00
fix: when protocol list show with keyword,create a new protocol,the index was wrong
This commit is contained in:
parent
59cb022c78
commit
3914467d58
@ -444,7 +444,7 @@ void DecoderStack::do_decode_work()
|
||||
if (_samplerate == 0.0)
|
||||
return;
|
||||
|
||||
decode_proc();
|
||||
execute_decode_stack();
|
||||
}
|
||||
|
||||
uint64_t DecoderStack::get_max_sample_count()
|
||||
@ -552,7 +552,7 @@ void DecoderStack::decode_data(const uint64_t decode_start, const uint64_t decod
|
||||
decode_done();
|
||||
}
|
||||
|
||||
void DecoderStack::decode_proc()
|
||||
void DecoderStack::execute_decode_stack()
|
||||
{
|
||||
srd_session *session;
|
||||
srd_decoder_inst *prev_di = NULL;
|
||||
@ -562,6 +562,8 @@ void DecoderStack::decode_proc()
|
||||
assert(_snapshot);
|
||||
|
||||
// Create the session
|
||||
// one decoderstatck onwer one session
|
||||
// all decoderstatck execute in sequence
|
||||
srd_session_new(&session);
|
||||
|
||||
assert(session);
|
||||
|
@ -155,7 +155,7 @@ public:
|
||||
|
||||
private:
|
||||
void decode_data(const uint64_t decode_start, const uint64_t decode_end, srd_session *const session);
|
||||
void decode_proc();
|
||||
void execute_decode_stack();
|
||||
static void annotation_callback(srd_proto_data *pdata, void *decoder);
|
||||
void do_decode_work();
|
||||
|
||||
|
@ -113,7 +113,7 @@ ProtocolDock::ProtocolDock(QWidget *parent, view::View &view, SigSession *sessio
|
||||
_protocol_combobox->setCompleter(NULL);
|
||||
|
||||
GSList *l = g_slist_sort(g_slist_copy((GSList*)srd_decoder_list()), decoder_name_cmp);
|
||||
int protocol_index = 0;
|
||||
|
||||
std::map<std::string, int> pro_key_table;
|
||||
QString repeatNammes;
|
||||
|
||||
@ -127,9 +127,8 @@ ProtocolDock::ProtocolDock(QWidget *parent, view::View &view, SigSession *sessio
|
||||
DecoderInfoItem *info = new DecoderInfoItem();
|
||||
strncpy(info->Name, d->name, DECODER_NAME_LEN-1);
|
||||
strncpy(info->Id, d->id, DECODER_NAME_LEN-1);
|
||||
info->Index = protocol_index;
|
||||
info->ObjectHandle = l->data;
|
||||
protocol_index++;
|
||||
|
||||
info->ObjectHandle = l->data;
|
||||
|
||||
_decoderInfoList.push_back(info);
|
||||
|
||||
@ -145,11 +144,14 @@ ProtocolDock::ProtocolDock(QWidget *parent, view::View &view, SigSession *sessio
|
||||
}
|
||||
}
|
||||
g_slist_free(l);
|
||||
|
||||
|
||||
//sort protocol list
|
||||
sort(_decoderInfoList.begin(), _decoderInfoList.end(), ProtocolDock::protocol_sort_callback);
|
||||
|
||||
int protocol_index = 0;
|
||||
for (auto info : _decoderInfoList){
|
||||
info->Index = protocol_index;
|
||||
protocol_index++;
|
||||
_protocol_combobox->addItem(QString::fromUtf8(info->Name), QVariant::fromValue(info->Index));
|
||||
}
|
||||
_protocol_combobox->setCurrentIndex(-1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user