MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / try_commit_trigger

Method try_commit_trigger

DSView/pv/dock/triggerdock.cpp:945–1000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

943}
944
945void TriggerDock::try_commit_trigger()
946{
947 AppConfig &app = AppConfig::Instance();
948 int num = 0;
949
950 int mode = _session->get_device()->get_work_mode();
951 bool bInstant = _session->is_instant();
952
953 ds_trigger_reset();
954
955 if (mode != LOGIC || bInstant){
956 return;
957 }
958
959 if (commit_trigger() == false)
960 {
961 /* simple trigger check trigger_enable */
962 for(auto s : _session->get_signals()){
963 if (s->signal_type() == SR_CHANNEL_LOGIC) {
964 view::LogicSignal *logicSig = (view::LogicSignal*)s;
965 if (logicSig->commit_trig())
966 num++;
967 }
968 }
969
970 if (app.appOptions.warnofMultiTrig && num > 1)
971 {
972 dialogs::DSMessageBox msg(this);
973 msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRIGGER), "Trigger"));
974 msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SET_TRI_MULTI_CHANNEL),
975 "Trigger setted on multiple channels!\nCapture will Only triggered when all setted channels fullfill at one sample"));
976 msg.mBox()->setIcon(QMessageBox::Information);
977
978 QPushButton *noMoreButton = msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NOT_SHOW_AGAIN), "Not Show Again"), QMessageBox::ActionRole);
979 QPushButton *cancelButton = msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CLEAR_TRIG), "Clear Trig"), QMessageBox::ActionRole);
980 msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CONTINUE), "Continue"), QMessageBox::ActionRole);
981
982 msg.exec();
983
984 if (msg.mBox()->clickedButton() == cancelButton) {
985 for(auto s : _session->get_signals()){
986 if (s->signal_type() == SR_CHANNEL_LOGIC) {
987 view::LogicSignal *logicSig = (view::LogicSignal*)s;
988 logicSig->set_trig(view::LogicSignal::NONTRIG);
989 logicSig->commit_trig();
990 }
991 }
992 }
993
994 if (msg.mBox()->clickedButton() == noMoreButton)
995 {
996 app.appOptions.warnofMultiTrig = false;
997 }
998 }
999 }
1000}
1001
1002void TriggerDock::on_hex_checkbox_click(bool ck)

Callers 1

OnMessageMethod · 0.80

Calls 9

ds_trigger_resetFunction · 0.85
get_work_modeMethod · 0.80
get_deviceMethod · 0.80
is_instantMethod · 0.80
signal_typeMethod · 0.80
commit_trigMethod · 0.80
mBoxMethod · 0.80
set_trigMethod · 0.80
execMethod · 0.45

Tested by

no test coverage detected