forked from Ivasoft/DSView
Replace the message box call type
This commit is contained in:
@@ -33,8 +33,8 @@
|
|||||||
#include "../dsvdef.h"
|
#include "../dsvdef.h"
|
||||||
#include "../appcontrol.h"
|
#include "../appcontrol.h"
|
||||||
#include "../sigsession.h"
|
#include "../sigsession.h"
|
||||||
|
|
||||||
#include "../ui/langresource.h"
|
#include "../ui/langresource.h"
|
||||||
|
#include "../ui/msgbox.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -383,14 +383,10 @@ void Calibration::reload_value()
|
|||||||
|
|
||||||
void Calibration::on_reset()
|
void Calibration::on_reset()
|
||||||
{
|
{
|
||||||
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SET_DEF_CAL_SETTING),
|
||||||
|
"All calibration settings will become the defualt values!"));
|
||||||
|
|
||||||
dialogs::DSMessageBox msg(this);
|
if (MsgBox::Confirm(strMsg)) {
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ATTENTION), "Attention"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SET_DEF_CAL_SETTING), "All calibration settings will become the defualt values!"));
|
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole);
|
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CANCEL), "Cancel"), QMessageBox::RejectRole);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
if (msg.exec()) {
|
|
||||||
_device_agent->set_config(NULL, NULL, SR_CONF_ZERO_DEFAULT,
|
_device_agent->set_config(NULL, NULL, SR_CONF_ZERO_DEFAULT,
|
||||||
g_variant_new_boolean(true));
|
g_variant_new_boolean(true));
|
||||||
reload_value();
|
reload_value();
|
||||||
|
|||||||
@@ -212,12 +212,8 @@ void DeviceOptions::accept()
|
|||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ALL_CHANNEL_DISABLE), "All channel disabled! Please enable at least one channel."));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ATTENTION), "Attention"));
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ALL_CHANNEL_DISABLE), "All channel disabled! Please enable at least one channel."));
|
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,17 +443,14 @@ void DeviceOptions::zero_adj()
|
|||||||
using namespace Qt;
|
using namespace Qt;
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
|
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_AUTO_CALIB_START),
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_INFORMATION), "Information"));
|
"Auto Calibration program will be started. Don't connect any probes. \nIt can take a while!"));
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_AUTO_CALIB_START),
|
bool bRet = MsgBox::Confirm(strMsg);
|
||||||
"Auto Calibration program will be started. Don't connect any probes. It can take a while!"));
|
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole);
|
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CANCEL), "Cancel") ,QMessageBox::RejectRole);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Information);
|
|
||||||
|
|
||||||
if (msg.exec()) {
|
if (bRet) {
|
||||||
_device_agent->set_config(NULL, NULL, SR_CONF_ZERO, g_variant_new_boolean(true));
|
_device_agent->set_config(NULL, NULL, SR_CONF_ZERO, g_variant_new_boolean(true));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
_device_agent->set_config(NULL, NULL, SR_CONF_ZERO, g_variant_new_boolean(false));
|
_device_agent->set_config(NULL, NULL, SR_CONF_ZERO, g_variant_new_boolean(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -580,7 +573,7 @@ void DeviceOptions::channel_checkbox_clicked(QCheckBox *sc)
|
|||||||
if (cur_ch_num > vld_ch_num) {
|
if (cur_ch_num > vld_ch_num) {
|
||||||
QString msg_str(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_MAX_CHANNEL_COUNT_WARNING), "max count of channels!"));
|
QString msg_str(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_MAX_CHANNEL_COUNT_WARNING), "max count of channels!"));
|
||||||
msg_str = msg_str.replace("{0}", QString::number(vld_ch_num) );
|
msg_str = msg_str.replace("{0}", QString::number(vld_ch_num) );
|
||||||
MsgBox::Show("", msg_str);
|
MsgBox::Show(msg_str);
|
||||||
|
|
||||||
sc->setChecked(false);
|
sc->setChecked(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,16 +233,12 @@ void DsoTriggerDock::pos_changed(int pos)
|
|||||||
ret = _session->get_device()->set_config(NULL, NULL,
|
ret = _session->get_device()->set_config(NULL, NULL,
|
||||||
SR_CONF_HORIZ_TRIGGERPOS,
|
SR_CONF_HORIZ_TRIGGERPOS,
|
||||||
g_variant_new_byte((uint8_t)pos));
|
g_variant_new_byte((uint8_t)pos));
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
dialogs::DSMessageBox msg(this);
|
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_HOR_TRI_POS_FAIL),
|
|
||||||
"Change horiz trigger position failed!"));
|
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
|
|
||||||
if (_session->get_device()->is_hardware()){
|
if (_session->get_device()->is_hardware()){
|
||||||
msg.exec();
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_HOR_TRI_POS_FAIL),
|
||||||
|
"Change horiz trigger position failed!"));
|
||||||
|
|
||||||
|
MsgBox::Show(strMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -267,13 +263,9 @@ void DsoTriggerDock::hold_changed(int hold)
|
|||||||
g_variant_new_uint64(holdoff));
|
g_variant_new_uint64(holdoff));
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_TRI_HOLDOFF_TIME_FAIL),
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_TRI_HOLDOFF_TIME_FAIL),
|
|
||||||
"Change trigger hold off time failed!"));
|
"Change trigger hold off time failed!"));
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,13 +276,9 @@ void DsoTriggerDock::margin_changed(int margin)
|
|||||||
SR_CONF_TRIGGER_MARGIN,
|
SR_CONF_TRIGGER_MARGIN,
|
||||||
g_variant_new_byte(margin));
|
g_variant_new_byte(margin));
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_SENSITIVITY_FAIL),
|
||||||
msg.mBox()->setText((L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue")));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_SENSITIVITY_FAIL),
|
|
||||||
"Change trigger value sensitivity failed!"));
|
"Change trigger value sensitivity failed!"));
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,7 +291,7 @@ void DsoTriggerDock::source_changed()
|
|||||||
_ch0o1_radioButton->setChecked(false);
|
_ch0o1_radioButton->setChecked(false);
|
||||||
|
|
||||||
QString msg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DISABLED_CHANNEL_TRIG), "Disabled channels cannot be used for triggering!"));
|
QString msg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DISABLED_CHANNEL_TRIG), "Disabled channels cannot be used for triggering!"));
|
||||||
MsgBox::Show("", msg);
|
MsgBox::Show(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
int id = _source_group->checkedId();
|
int id = _source_group->checkedId();
|
||||||
@@ -315,13 +303,9 @@ void DsoTriggerDock::source_changed()
|
|||||||
SR_CONF_TRIGGER_SOURCE,
|
SR_CONF_TRIGGER_SOURCE,
|
||||||
g_variant_new_byte(id));
|
g_variant_new_byte(id));
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_SOURCE_FAIL),
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_SOURCE_FAIL),
|
|
||||||
"Change trigger source failed!"));
|
"Change trigger source failed!"));
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,13 +354,9 @@ void DsoTriggerDock::channel_changed(int ch)
|
|||||||
SR_CONF_TRIGGER_CHANNEL,
|
SR_CONF_TRIGGER_CHANNEL,
|
||||||
g_variant_new_byte(_channel_comboBox->currentData().toInt()));
|
g_variant_new_byte(_channel_comboBox->currentData().toInt()));
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_CHANNEL_FAIL),
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_CHANNEL_FAIL),
|
|
||||||
"Change trigger channel failed!"));
|
"Change trigger channel failed!"));
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,13 +369,9 @@ void DsoTriggerDock::type_changed()
|
|||||||
SR_CONF_TRIGGER_SLOPE,
|
SR_CONF_TRIGGER_SLOPE,
|
||||||
g_variant_new_byte(id));
|
g_variant_new_byte(id));
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_TYPE_FAIL),
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_TYPE_FAIL),
|
|
||||||
"Change trigger type failed!"));
|
"Change trigger type failed!"));
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,11 @@
|
|||||||
#include "../data/snapshot.h"
|
#include "../data/snapshot.h"
|
||||||
#include "../dialogs/dsdialog.h"
|
#include "../dialogs/dsdialog.h"
|
||||||
#include "../dialogs/dsmessagebox.h"
|
#include "../dialogs/dsmessagebox.h"
|
||||||
|
#include "../config/appconfig.h"
|
||||||
|
#include "../ui/langresource.h"
|
||||||
|
#include "../ui/msgbox.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QMessageBox>
|
|
||||||
#include "../config/appconfig.h"
|
|
||||||
|
|
||||||
#include "../ui/langresource.h"
|
|
||||||
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
|
|
||||||
@@ -477,14 +475,9 @@ void MeasureDock::show_all_coursor()
|
|||||||
auto &cursor_list = _view.get_cursorList();
|
auto &cursor_list = _view.get_cursorList();
|
||||||
|
|
||||||
if (cursor_list.empty()) {
|
if (cursor_list.empty()) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PLEASE_INSERT_CURSOR),
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_INFORMATION), "Information"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PLEASE_INSERT_CURSOR),
|
|
||||||
"Please insert cursor before using cursor measure."));
|
"Please insert cursor before using cursor measure."));
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole);
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setIcon(QMessageBox::Information);
|
|
||||||
msg.exec();
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,8 @@
|
|||||||
#include <QtConcurrent/QtConcurrent>
|
#include <QtConcurrent/QtConcurrent>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "../config/appconfig.h"
|
#include "../config/appconfig.h"
|
||||||
|
|
||||||
#include "../ui/langresource.h"
|
#include "../ui/langresource.h"
|
||||||
|
#include "../ui/msgbox.h"
|
||||||
|
|
||||||
namespace pv {
|
namespace pv {
|
||||||
namespace dock {
|
namespace dock {
|
||||||
@@ -131,12 +131,8 @@ void SearchDock::on_previous()
|
|||||||
const auto logic_snapshot = dynamic_cast<data::LogicSnapshot*>(snapshot);
|
const auto logic_snapshot = dynamic_cast<data::LogicSnapshot*>(snapshot);
|
||||||
|
|
||||||
if (logic_snapshot == NULL || logic_snapshot->empty()) {
|
if (logic_snapshot == NULL || logic_snapshot->empty()) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_SAMPLE_DATA), "No Sample data!"));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search"));
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_SAMPLE_DATA), "No Sample data!"));
|
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,14 +140,11 @@ void SearchDock::on_previous()
|
|||||||
last_pos = _view.get_search_pos();
|
last_pos = _view.get_search_pos();
|
||||||
last_hit = _view.get_search_hit();
|
last_hit = _view.get_search_hit();
|
||||||
if (last_pos == 0) {
|
if (last_pos == 0) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH_AT_START), "Search cursor at the start position!"));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search"));
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH_AT_START), "Search cursor at the start position!"));
|
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
QFuture<void> future;
|
QFuture<void> future;
|
||||||
future = QtConcurrent::run([&]{
|
future = QtConcurrent::run([&]{
|
||||||
last_pos -= last_hit;
|
last_pos -= last_hit;
|
||||||
@@ -171,12 +164,8 @@ void SearchDock::on_previous()
|
|||||||
dlg.exec();
|
dlg.exec();
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PATTERN_NOT_FOUND), "Pattern not found!"));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search"));
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PATTERN_NOT_FOUND), "Pattern not found!"));
|
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
_view.set_search_pos(last_pos, true);
|
_view.set_search_pos(last_pos, true);
|
||||||
@@ -193,24 +182,16 @@ void SearchDock::on_next()
|
|||||||
const auto logic_snapshot = dynamic_cast<data::LogicSnapshot*>(snapshot);
|
const auto logic_snapshot = dynamic_cast<data::LogicSnapshot*>(snapshot);
|
||||||
|
|
||||||
if (logic_snapshot == NULL || logic_snapshot->empty()) {
|
if (logic_snapshot == NULL || logic_snapshot->empty()) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_SAMPLE_DATA), "No Sample data!"));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search"));
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_SAMPLE_DATA), "No Sample data!"));
|
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int64_t end = logic_snapshot->get_sample_count() - 1;
|
const int64_t end = logic_snapshot->get_sample_count() - 1;
|
||||||
last_pos = _view.get_search_pos() + _view.get_search_hit();
|
last_pos = _view.get_search_pos() + _view.get_search_hit();
|
||||||
if (last_pos >= end) {
|
if (last_pos >= end) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH_AT_END), "Search cursor at the end position!"));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search"));
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH_AT_END), "Search cursor at the end position!"));
|
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
QFuture<void> future;
|
QFuture<void> future;
|
||||||
@@ -231,12 +212,8 @@ void SearchDock::on_next()
|
|||||||
dlg.exec();
|
dlg.exec();
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PATTERN_NOT_FOUND), "Pattern not found!"));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search"));
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PATTERN_NOT_FOUND), "Pattern not found!"));
|
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
_view.set_search_pos(last_pos, true);
|
_view.set_search_pos(last_pos, true);
|
||||||
|
|||||||
@@ -34,12 +34,13 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <libsigrok.h>
|
#include <libsigrok.h>
|
||||||
|
#include <QRegExp>
|
||||||
|
#include <QRegExpValidator>
|
||||||
#include "../config/appconfig.h"
|
#include "../config/appconfig.h"
|
||||||
#include "../deviceagent.h"
|
#include "../deviceagent.h"
|
||||||
#include "../view/logicsignal.h"
|
#include "../view/logicsignal.h"
|
||||||
#include "../ui/langresource.h"
|
#include "../ui/langresource.h"
|
||||||
#include <QRegExp>
|
#include "../ui/msgbox.h"
|
||||||
#include <QRegExpValidator>
|
|
||||||
|
|
||||||
namespace pv {
|
namespace pv {
|
||||||
namespace dock {
|
namespace dock {
|
||||||
@@ -199,13 +200,9 @@ void TriggerDock::adv_trigger()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stream) {
|
if (stream) {
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STREAM_NO_AD_TRIGGER),
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRIGGER), "Trigger"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STREAM_NO_AD_TRIGGER),
|
|
||||||
"Stream Mode Don't Support Advanced Trigger!"));
|
"Stream Mode Don't Support Advanced Trigger!"));
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
_simple_radioButton->setChecked(true);
|
_simple_radioButton->setChecked(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -213,13 +210,9 @@ void TriggerDock::adv_trigger()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_session->get_device()->is_file() == false){
|
else if (_session->get_device()->is_file() == false){
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_AD_TRIGGER_NEED_HARDWARE),
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRIGGER), "Trigger"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_AD_TRIGGER_NEED_HARDWARE),
|
|
||||||
"Advanced Trigger need DSLogic Hardware Support!"));
|
"Advanced Trigger need DSLogic Hardware Support!"));
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
MsgBox::Show(strMsg);
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
_simple_radioButton->setChecked(true);
|
_simple_radioButton->setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
|
|
||||||
class ISessionCallback
|
class ISessionCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void show_error(QString error)=0;
|
|
||||||
virtual void session_error()=0;
|
virtual void session_error()=0;
|
||||||
virtual void session_save()=0;
|
virtual void session_save()=0;
|
||||||
virtual void data_updated()=0;
|
virtual void data_updated()=0;
|
||||||
@@ -47,6 +46,7 @@ public:
|
|||||||
|
|
||||||
virtual void receive_header()=0;
|
virtual void receive_header()=0;
|
||||||
virtual void trigger_message(int msg)=0;
|
virtual void trigger_message(int msg)=0;
|
||||||
|
virtual void delay_prop_msg(QString strMsg)=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ISessionDataGetter
|
class ISessionDataGetter
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QJsonValue>
|
#include <QJsonValue>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
|
||||||
@@ -97,6 +98,7 @@
|
|||||||
#include "ui/langresource.h"
|
#include "ui/langresource.h"
|
||||||
#include "mainframe.h"
|
#include "mainframe.h"
|
||||||
#include "dsvdef.h"
|
#include "dsvdef.h"
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
namespace pv
|
namespace pv
|
||||||
{
|
{
|
||||||
@@ -283,6 +285,8 @@ namespace pv
|
|||||||
//
|
//
|
||||||
connect(_dso_trigger_widget, SIGNAL(set_trig_pos(int)), _view, SLOT(set_trig_pos(int)));
|
connect(_dso_trigger_widget, SIGNAL(set_trig_pos(int)), _view, SLOT(set_trig_pos(int)));
|
||||||
|
|
||||||
|
_delay_prop_msg_timer.SetCallback(std::bind(&MainWindow::on_delay_prop_msg, this));
|
||||||
|
|
||||||
_logo_bar->set_mainform_callback(this);
|
_logo_bar->set_mainform_callback(this);
|
||||||
|
|
||||||
// Try load from file.
|
// Try load from file.
|
||||||
@@ -329,17 +333,14 @@ namespace pv
|
|||||||
_session->set_file(file_name);
|
_session->set_file(file_name);
|
||||||
}
|
}
|
||||||
catch (QString e)
|
catch (QString e)
|
||||||
{
|
{
|
||||||
show_error(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_FAIL_TO_LOAD), "Failed to load ") + file_name);
|
QString strMsg(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_FAIL_TO_LOAD), "Failed to load "));
|
||||||
|
strMsg += file_name;
|
||||||
|
MsgBox::Show(strMsg);
|
||||||
_session->set_default_device();
|
_session->set_default_device();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::show_error(QString error)
|
|
||||||
{
|
|
||||||
MsgBox::Show(NULL, error.toStdString().c_str(), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::session_error()
|
void MainWindow::session_error()
|
||||||
{
|
{
|
||||||
_event.session_error();
|
_event.session_error();
|
||||||
@@ -387,21 +388,10 @@ namespace pv
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogs::DSMessageBox msg(this);
|
dialogs::DSMessageBox *box = NULL;
|
||||||
|
MsgBox::Show("", title, details, this, &box, false);
|
||||||
connect(_session->device_event_object(), SIGNAL(device_updated()), &msg, SLOT(accept()));
|
connect(_session->device_event_object(), SIGNAL(device_updated()), box, SLOT(accept()));
|
||||||
|
box->exec();
|
||||||
QFont font("Monaco");
|
|
||||||
font.setStyleHint(QFont::Monospace);
|
|
||||||
font.setFixedPitch(true);
|
|
||||||
msg.mBox()->setFont(font);
|
|
||||||
|
|
||||||
msg.mBox()->setText(title);
|
|
||||||
msg.mBox()->setInformativeText(details);
|
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
msg.exec();
|
|
||||||
|
|
||||||
_session->clear_error();
|
_session->clear_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1483,9 +1473,11 @@ namespace pv
|
|||||||
|
|
||||||
dsv_info("The cable's USB port version: %d.0", cable_ver);
|
dsv_info("The cable's USB port version: %d.0", cable_ver);
|
||||||
|
|
||||||
if (usb30_support && usb_speed == LIBUSB_SPEED_HIGH)
|
if (usb30_support && usb_speed == LIBUSB_SPEED_HIGH){
|
||||||
show_error(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHECK_USB_SPEED_ERROR),
|
QString str_err(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHECK_USB_SPEED_ERROR),
|
||||||
"Plug it into a USB 2.0 port will seriously affect its performance.\nPlease replug it into a USB 3.0 port."));
|
"Plug the device into a USB 2.0 port will seriously affect its performance.\nPlease replug it into a USB 3.0 port."));
|
||||||
|
delay_prop_msg(str_err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1558,8 +1550,9 @@ namespace pv
|
|||||||
g_variant_unref(gvar);
|
g_variant_unref(gvar);
|
||||||
if (version == 1)
|
if (version == 1)
|
||||||
{
|
{
|
||||||
show_error(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR),
|
QString strMsg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR),
|
||||||
"Current loading file has an old format. \nThis will lead to a slow loading speed. \nPlease resave it after loaded."));
|
"Current loading file has an old format. \nThis will lead to a slow loading speed. \nPlease resave it after loaded."));
|
||||||
|
MsgBox::Show(strMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1723,18 +1716,17 @@ namespace pv
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DSV_MSG_CURRENT_DEVICE_CHANGE_PREV:
|
case DSV_MSG_CURRENT_DEVICE_CHANGE_PREV:
|
||||||
|
if (_msg != NULL){
|
||||||
|
_msg->close();
|
||||||
|
_msg = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
_protocol_widget->del_all_protocol();
|
_protocol_widget->del_all_protocol();
|
||||||
_view->reload();
|
_view->reload();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSV_MSG_CURRENT_DEVICE_CHANGED:
|
case DSV_MSG_CURRENT_DEVICE_CHANGED:
|
||||||
{
|
{
|
||||||
if (_msg != NULL)
|
|
||||||
{
|
|
||||||
_msg->close();
|
|
||||||
_msg = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
reset_all_view();
|
reset_all_view();
|
||||||
load_device_config();
|
load_device_config();
|
||||||
_sampling_bar->update_device_list();
|
_sampling_bar->update_device_list();
|
||||||
@@ -1746,8 +1738,7 @@ namespace pv
|
|||||||
if (_device_agent->is_hardware())
|
if (_device_agent->is_hardware())
|
||||||
{
|
{
|
||||||
_session->on_load_config_end();
|
_session->on_load_config_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (_device_agent->get_work_mode() == LOGIC && _device_agent->is_file() == false)
|
if (_device_agent->get_work_mode() == LOGIC && _device_agent->is_file() == false)
|
||||||
_view->auto_set_max_scale();
|
_view->auto_set_max_scale();
|
||||||
@@ -1853,6 +1844,11 @@ namespace pv
|
|||||||
|
|
||||||
case DSV_MSG_NEW_USB_DEVICE:
|
case DSV_MSG_NEW_USB_DEVICE:
|
||||||
{
|
{
|
||||||
|
if (_msg != NULL){
|
||||||
|
_msg->close();
|
||||||
|
_msg = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
_sampling_bar->update_device_list();
|
_sampling_bar->update_device_list();
|
||||||
|
|
||||||
if (_session->get_device()->is_demo() == false)
|
if (_session->get_device()->is_demo() == false)
|
||||||
@@ -1890,17 +1886,21 @@ namespace pv
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DSV_MSG_CURRENT_DEVICE_DETACHED:
|
case DSV_MSG_CURRENT_DEVICE_DETACHED:
|
||||||
|
if (_msg != NULL){
|
||||||
|
_msg->close();
|
||||||
|
_msg = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Save current config, and switch to the last device.
|
// Save current config, and switch to the last device.
|
||||||
_session->device_event_object()->device_updated();
|
_session->device_event_object()->device_updated();
|
||||||
session_save();
|
session_save();
|
||||||
_view->hide_calibration();
|
_view->hide_calibration();
|
||||||
if (confirm_to_store_data())
|
|
||||||
{
|
if (confirm_to_store_data()){
|
||||||
_is_auto_switch_device = true;
|
_is_auto_switch_device = true;
|
||||||
on_save();
|
on_save();
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
{
|
|
||||||
_session->set_default_device();
|
_session->set_default_device();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1998,4 +1998,22 @@ namespace pv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::delay_prop_msg(QString strMsg)
|
||||||
|
{
|
||||||
|
_strMsg = strMsg;
|
||||||
|
if (_strMsg != ""){
|
||||||
|
_delay_prop_msg_timer.Start(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_delay_prop_msg()
|
||||||
|
{
|
||||||
|
_delay_prop_msg_timer.Stop();
|
||||||
|
|
||||||
|
if (_strMsg != ""){
|
||||||
|
MsgBox::Show("", _strMsg, this, &_msg);
|
||||||
|
_msg = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace pv
|
} // namespace pv
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "eventobject.h"
|
#include "eventobject.h"
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include "dstimer.h"
|
||||||
|
|
||||||
class QAction;
|
class QAction;
|
||||||
class QMenuBar;
|
class QMenuBar;
|
||||||
@@ -120,6 +121,7 @@ private slots:
|
|||||||
void on_receive_data_len(quint64 len);
|
void on_receive_data_len(quint64 len);
|
||||||
void on_cur_snap_samplerate_changed();
|
void on_cur_snap_samplerate_changed();
|
||||||
void on_trigger_message(int msg);
|
void on_trigger_message(int msg);
|
||||||
|
void on_delay_prop_msg();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void prgRate(int progress);
|
void prgRate(int progress);
|
||||||
@@ -146,28 +148,26 @@ private:
|
|||||||
QJsonDocument get_session_json_from_file(QString file);
|
QJsonDocument get_session_json_from_file(QString file);
|
||||||
QJsonArray get_decoder_json_from_file(QString file);
|
QJsonArray get_decoder_json_from_file(QString file);
|
||||||
void calc_min_height();
|
void calc_min_height();
|
||||||
|
void session_save();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//ISessionCallback
|
//ISessionCallback
|
||||||
void show_error(QString error);
|
|
||||||
void session_error();
|
void session_error();
|
||||||
void data_updated();
|
void data_updated();
|
||||||
void update_capture();
|
void update_capture();
|
||||||
void cur_snap_samplerate_changed();
|
void cur_snap_samplerate_changed();
|
||||||
|
|
||||||
void signals_changed();
|
void signals_changed();
|
||||||
void receive_trigger(quint64 trigger_pos);
|
void receive_trigger(quint64 trigger_pos);
|
||||||
void frame_ended();
|
void frame_ended();
|
||||||
void frame_began();
|
void frame_began();
|
||||||
void show_region(uint64_t start, uint64_t end, bool keep);
|
void show_region(uint64_t start, uint64_t end, bool keep);
|
||||||
|
|
||||||
void show_wait_trigger();
|
void show_wait_trigger();
|
||||||
void repeat_hold(int percent);
|
void repeat_hold(int percent);
|
||||||
void decode_done();
|
void decode_done();
|
||||||
void receive_data_len(quint64 len);
|
void receive_data_len(quint64 len);
|
||||||
void receive_header();
|
void receive_header();
|
||||||
void trigger_message(int msg);
|
void trigger_message(int msg);
|
||||||
void session_save();
|
void delay_prop_msg(QString strMsg);
|
||||||
|
|
||||||
//ISessionDataGetter
|
//ISessionDataGetter
|
||||||
bool genSessionData(std::string &str);
|
bool genSessionData(std::string &str);
|
||||||
@@ -223,6 +223,8 @@ private:
|
|||||||
bool _is_save_confirm_msg;
|
bool _is_save_confirm_msg;
|
||||||
std::string _pattern_mode;
|
std::string _pattern_mode;
|
||||||
QWidget *_frame;
|
QWidget *_frame;
|
||||||
|
DsTimer _delay_prop_msg_timer;
|
||||||
|
QString _strMsg;
|
||||||
|
|
||||||
int _key_value;
|
int _key_value;
|
||||||
bool _key_vaild;
|
bool _key_vaild;
|
||||||
|
|||||||
@@ -125,8 +125,7 @@ namespace pv
|
|||||||
_feed_timer.SetCallback(std::bind(&SigSession::feed_timeout, this));
|
_feed_timer.SetCallback(std::bind(&SigSession::feed_timeout, this));
|
||||||
_repeat_timer.SetCallback(std::bind(&SigSession::repeat_capture_wait_timeout, this));
|
_repeat_timer.SetCallback(std::bind(&SigSession::repeat_capture_wait_timeout, this));
|
||||||
_repeat_wait_prog_timer.SetCallback(std::bind(&SigSession::repeat_wait_prog_timeout, this));
|
_repeat_wait_prog_timer.SetCallback(std::bind(&SigSession::repeat_wait_prog_timeout, this));
|
||||||
_refresh_rt_timer.SetCallback(std::bind(&SigSession::realtime_refresh_timeout, this));
|
_refresh_rt_timer.SetCallback(std::bind(&SigSession::realtime_refresh_timeout, this));
|
||||||
_delay_prop_msg_timer.SetCallback(std::bind(&SigSession::on_delay_prop_msg, this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SigSession::SigSession(SigSession &o)
|
SigSession::SigSession(SigSession &o)
|
||||||
@@ -216,6 +215,8 @@ namespace pv
|
|||||||
assert(!_is_working);
|
assert(!_is_working);
|
||||||
assert(_callback);
|
assert(_callback);
|
||||||
|
|
||||||
|
ds_device_handle old_dev = _device_agent.handle();
|
||||||
|
|
||||||
set_operation_mode(OPT_SINGLE);
|
set_operation_mode(OPT_SINGLE);
|
||||||
|
|
||||||
_callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGE_PREV);
|
_callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGE_PREV);
|
||||||
@@ -225,8 +226,6 @@ namespace pv
|
|||||||
|
|
||||||
_device_status = ST_INIT;
|
_device_status = ST_INIT;
|
||||||
|
|
||||||
ds_device_handle old_dev = _device_agent.handle();
|
|
||||||
|
|
||||||
if (ds_active_device(dev_handle) != SR_OK)
|
if (ds_active_device(dev_handle) != SR_OK)
|
||||||
{
|
{
|
||||||
dsv_err("%s", "Switch device error!");
|
dsv_err("%s", "Switch device error!");
|
||||||
@@ -259,13 +258,13 @@ namespace pv
|
|||||||
if (_device_agent.is_hardware() && _device_agent.check_firmware_version() == false)
|
if (_device_agent.is_hardware() && _device_agent.check_firmware_version() == false)
|
||||||
{
|
{
|
||||||
QString strMsg = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TO_RECONNECT_FOR_FIRMWARE), "Please reconnect the device!");
|
QString strMsg = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TO_RECONNECT_FOR_FIRMWARE), "Please reconnect the device!");
|
||||||
delay_prop_msg(strMsg);
|
_callback->delay_prop_msg(strMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_device_agent.handle() != dev_handle && old_dev != NULL_HANDLE)
|
if (_device_agent.handle() != dev_handle && old_dev != NULL_HANDLE)
|
||||||
{
|
{
|
||||||
QString strMsg = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DEVICE_BUSY_SWITCH_FAILED), "Device is busy!");
|
QString strMsg = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DEVICE_BUSY_SWITCH_FAILED), "Device is busy!");
|
||||||
MsgBox::Show("",strMsg);
|
MsgBox::Show(strMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -577,7 +576,7 @@ namespace pv
|
|||||||
if (_device_agent.have_enabled_channel() == false)
|
if (_device_agent.have_enabled_channel() == false)
|
||||||
{
|
{
|
||||||
QString err_str(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_ENABLED_CHANNEL), "No channels enabled!"));
|
QString err_str(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_ENABLED_CHANNEL), "No channels enabled!"));
|
||||||
_callback->show_error(err_str);
|
MsgBox::Show(err_str);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2288,20 +2287,4 @@ namespace pv
|
|||||||
set_cur_samplelimits(_device_agent.get_sample_limit());
|
set_cur_samplelimits(_device_agent.get_sample_limit());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SigSession::delay_prop_msg(QString strMsg)
|
|
||||||
{
|
|
||||||
_strMsg = strMsg;
|
|
||||||
if (_strMsg != ""){
|
|
||||||
_delay_prop_msg_timer.Start(1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SigSession::on_delay_prop_msg()
|
|
||||||
{
|
|
||||||
_delay_prop_msg_timer.Stop();
|
|
||||||
|
|
||||||
if (_strMsg != "")
|
|
||||||
MsgBox::Show("", _strMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace pv
|
} // namespace pv
|
||||||
|
|||||||
@@ -410,8 +410,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void on_load_config_end();
|
void on_load_config_end();
|
||||||
void init_signals();
|
void init_signals();
|
||||||
void delay_prop_msg(QString strMsg);
|
|
||||||
|
|
||||||
inline bool is_doing_action(){
|
inline bool is_doing_action(){
|
||||||
return _is_action;
|
return _is_action;
|
||||||
@@ -496,8 +495,7 @@ private:
|
|||||||
void repeat_wait_prog_timeout();
|
void repeat_wait_prog_timeout();
|
||||||
void realtime_refresh_timeout();
|
void realtime_refresh_timeout();
|
||||||
|
|
||||||
void clear_signals();
|
void clear_signals();
|
||||||
void on_delay_prop_msg();
|
|
||||||
|
|
||||||
inline void data_lock(){
|
inline void data_lock(){
|
||||||
_data_lock = true;
|
_data_lock = true;
|
||||||
@@ -527,7 +525,7 @@ private:
|
|||||||
DsTimer _repeat_timer;
|
DsTimer _repeat_timer;
|
||||||
DsTimer _repeat_wait_prog_timer;
|
DsTimer _repeat_wait_prog_timer;
|
||||||
DsTimer _refresh_rt_timer;
|
DsTimer _refresh_rt_timer;
|
||||||
DsTimer _delay_prop_msg_timer;
|
|
||||||
int _noData_cnt;
|
int _noData_cnt;
|
||||||
bool _data_lock;
|
bool _data_lock;
|
||||||
bool _data_updated;
|
bool _data_updated;
|
||||||
@@ -562,7 +560,7 @@ private:
|
|||||||
uint64_t _rt_ck_refresh_time_id;
|
uint64_t _rt_ck_refresh_time_id;
|
||||||
COLLECT_OPT_MODE _opt_mode;
|
COLLECT_OPT_MODE _opt_mode;
|
||||||
bool _is_stream_mode;
|
bool _is_stream_mode;
|
||||||
QString _strMsg;
|
|
||||||
bool _is_action;
|
bool _is_action;
|
||||||
uint64_t _dso_packet_count;
|
uint64_t _dso_packet_count;
|
||||||
|
|
||||||
|
|||||||
@@ -889,15 +889,11 @@ namespace pv
|
|||||||
|
|
||||||
if (zero)
|
if (zero)
|
||||||
{
|
{
|
||||||
dialogs::DSMessageBox msg(this);
|
QString str1(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_AUTO_CALIB), "Auto Calibration"));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_AUTO_CALIB), "Auto Calibration"));
|
QString str2(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ADJUST_SAVE), "Please adjust zero skew and save the result"));
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ADJUST_SAVE), "Please adjust zero skew and save the result"));
|
bool bRet = MsgBox::Confirm(str1, str2);
|
||||||
// msg.setStandardButtons(QMessageBox::Ok);
|
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole);
|
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SKIP), "Skip"), QMessageBox::RejectRole);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
|
|
||||||
if (msg.exec())
|
if (bRet)
|
||||||
{
|
{
|
||||||
zero_adj();
|
zero_adj();
|
||||||
}
|
}
|
||||||
@@ -960,15 +956,9 @@ namespace pv
|
|||||||
|
|
||||||
if (zero)
|
if (zero)
|
||||||
{
|
{
|
||||||
dialogs::DSMessageBox msg(this);
|
QString strMsg(L_S(STR_PAGE_MSG,S_ID(IDS_MSG_AUTO_CALIB_START), "Auto Calibration program will be started. Don't connect any probes. \nIt can take a while!"));
|
||||||
msg.mBox()->setText(L_S(STR_PAGE_MSG,S_ID(IDS_MSG_AUTO_CALIB), "Auto Calibration"));
|
|
||||||
msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG,S_ID(IDS_MSG_AUTO_CALIB_START), "Auto Calibration program will be started. Don't connect any probes. It can take a while!"));
|
|
||||||
|
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG,S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole);
|
if (MsgBox::Confirm(strMsg))
|
||||||
msg.mBox()->addButton(L_S(STR_PAGE_MSG,S_ID(IDS_MSG_SKIP), "Skip"), QMessageBox::RejectRole);
|
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
|
||||||
|
|
||||||
if (msg.exec())
|
|
||||||
{
|
{
|
||||||
zero_adj();
|
zero_adj();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,27 @@
|
|||||||
//QMessageBox::information(NULL, "Title", "Content");
|
//QMessageBox::information(NULL, "Title", "Content");
|
||||||
//QMessageBox::information(NULL, "Title", "Content",QMessageBox::Yes|QMessageBox::No|QMessageBox::Abort);
|
//QMessageBox::information(NULL, "Title", "Content",QMessageBox::Yes|QMessageBox::No|QMessageBox::Abort);
|
||||||
|
|
||||||
|
void MsgBox::Show(const QString text)
|
||||||
|
{
|
||||||
|
MsgBox::Show("", text, "", NULL, NULL, true);
|
||||||
|
}
|
||||||
|
|
||||||
void MsgBox::Show(const QString title, const QString text, QWidget *parent)
|
void MsgBox::Show(const QString title, const QString text, QWidget *parent)
|
||||||
|
{
|
||||||
|
MsgBox::Show(title, text, "", parent,NULL, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Show(const QString title, const QString text, const QString infoText)
|
||||||
|
{
|
||||||
|
MsgBox::Show(title, text, infoText, NULL, NULL, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MsgBox::Show(const QString title, const QString text, QWidget *parent, pv::dialogs::DSMessageBox **box)
|
||||||
|
{
|
||||||
|
MsgBox::Show(title, text, "", parent, box, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MsgBox::Show(const QString title, const QString text, const QString infoText, QWidget *parent, pv::dialogs::DSMessageBox **box, bool bExecute)
|
||||||
{
|
{
|
||||||
assert(!text.isEmpty());
|
assert(!text.isEmpty());
|
||||||
|
|
||||||
@@ -45,14 +65,30 @@ void MsgBox::Show(const QString title, const QString text, QWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pv::dialogs::DSMessageBox msg(parent, title);
|
pv::dialogs::DSMessageBox msg(parent, title);
|
||||||
msg.mBox()->setText(str);
|
|
||||||
// msg.mBox()->setInformativeText(QString(text));
|
if (box != NULL){
|
||||||
|
*box = &msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.mBox()->setText(str);
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
msg.mBox()->setStandardButtons(QMessageBox::Ok);
|
||||||
msg.mBox()->setIcon(QMessageBox::Warning);
|
msg.mBox()->setIcon(QMessageBox::Warning);
|
||||||
msg.exec();
|
|
||||||
|
if (infoText != ""){
|
||||||
|
msg.mBox()->setInformativeText(infoText);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bExecute){
|
||||||
|
msg.exec();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MsgBox::Confirm(const QString text, QWidget *parent)
|
bool MsgBox::Confirm(const QString text, QWidget *parent)
|
||||||
|
{
|
||||||
|
MsgBox::Confirm(text, "", parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MsgBox::Confirm(const QString text, const QString infoText, QWidget *parent)
|
||||||
{
|
{
|
||||||
assert(!text.isEmpty());
|
assert(!text.isEmpty());
|
||||||
|
|
||||||
@@ -69,6 +105,11 @@ bool MsgBox::Confirm(const QString text, QWidget *parent)
|
|||||||
msg.mBox()->setText(str);
|
msg.mBox()->setText(str);
|
||||||
msg.mBox()->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
msg.mBox()->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||||
msg.mBox()->setIcon(QMessageBox::Question);
|
msg.mBox()->setIcon(QMessageBox::Question);
|
||||||
|
|
||||||
|
if (infoText != ""){
|
||||||
|
msg.mBox()->setInformativeText(infoText);
|
||||||
|
}
|
||||||
|
|
||||||
msg.exec();
|
msg.exec();
|
||||||
return msg.IsYes();
|
return msg.IsYes();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,21 @@
|
|||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
|
namespace pv{
|
||||||
|
namespace dialogs{
|
||||||
|
class DSMessageBox;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class MsgBox
|
class MsgBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static void Show(const QString text);
|
||||||
static void Show(const QString title, const QString text, QWidget *parent=0);
|
static void Show(const QString title, const QString text, QWidget *parent=0);
|
||||||
|
static void Show(const QString title, const QString text, const QString infoText);
|
||||||
|
static void Show(const QString title, const QString text, QWidget *parent, pv::dialogs::DSMessageBox **box);
|
||||||
|
static void Show(const QString title, const QString text, const QString infoText, QWidget *parent, pv::dialogs::DSMessageBox **box, bool bExecute=true);
|
||||||
|
|
||||||
static bool Confirm(const QString text, QWidget *parent=0);
|
static bool Confirm(const QString text, QWidget *parent=0);
|
||||||
|
static bool Confirm(const QString text, const QString infoText, QWidget *parent=0);
|
||||||
};
|
};
|
||||||
@@ -49,11 +49,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_CHECK_USB_SPEED_ERROR",
|
"id": "IDS_DLG_CHECK_USB_SPEED_ERROR",
|
||||||
"text": " 将其插入USB 2.0端口将严重影响其性能.\n 请将其重新插入USB 3.0端口."
|
"text": "将该设备插入USB 2.0端口会严重影响其性能.\n请重新插入USB 3.0端口."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR",
|
"id": "IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR",
|
||||||
"text": " 当前加载文件具有旧格式 . \n这将导致加载速度变慢. \n请在加载后重新保存."
|
"text": "当前加载文件具有旧格式 . \n这将导致加载速度变慢. \n请在加载后重新保存."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_ABOUT",
|
"id": "IDS_DLG_ABOUT",
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_SAVE_CALIBRATION_RESULTS",
|
"id": "IDS_DLG_SAVE_CALIBRATION_RESULTS",
|
||||||
"text": " 保存校准结果...可能需要一段时间."
|
"text": "保存校准结果...可能需要一段时间."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_CANCEL",
|
"id": "IDS_DLG_CANCEL",
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_RELOAD_CALIBRATION_RESULTS",
|
"id": "IDS_DLG_RELOAD_CALIBRATION_RESULTS",
|
||||||
"text": " 重新加载上次校准...可能需要一段时间."
|
"text": "重新加载上次校准...可能需要一段时间."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_DECODER_OPTIONS",
|
"id": "IDS_DLG_DECODER_OPTIONS",
|
||||||
@@ -253,7 +253,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_EXPORT_PROTOCOL_LIST_RESULT",
|
"id": "IDS_DLG_EXPORT_PROTOCOL_LIST_RESULT",
|
||||||
"text": " 导出协议列表结果...可能需要一段时间 ."
|
"text": "导出协议列表结果...可能需要一段时间 ."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_FIT_TO_WINDOW",
|
"id": "IDS_DLG_FIT_TO_WINDOW",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_MSG_AUTO_CALIB_START",
|
"id": "IDS_MSG_AUTO_CALIB_START",
|
||||||
"text": "自动校准程序将启动。不要连接任何探针。这可能需要一段时间!"
|
"text": "自动校准程序将启动。不要连接任何探针。\n这可能需要一段时间!"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_MSG_AUTO_CALIB",
|
"id": "IDS_MSG_AUTO_CALIB",
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_MSG_MAX_CHANNEL_COUNT_WARNING",
|
"id": "IDS_MSG_MAX_CHANNEL_COUNT_WARNING",
|
||||||
"text": "当前模式仅支持最大 {0}\n通道数!"
|
"text": "当前模式仅支持最大 {0} 通道数!"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_MSG_TRI_SET_ISSUE",
|
"id": "IDS_MSG_TRI_SET_ISSUE",
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_CHECK_USB_SPEED_ERROR",
|
"id": "IDS_DLG_CHECK_USB_SPEED_ERROR",
|
||||||
"text": "Plug it into a USB 2.0 port will seriously affect its performance.\n Please replug it into a USB 3.0 port."
|
"text": "Plug the device into a USB 2.0 port will seriously affect its performance.\n Please replug it into a USB 3.0 port."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR",
|
"id": "IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR",
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_MSG_AUTO_CALIB_START",
|
"id": "IDS_MSG_AUTO_CALIB_START",
|
||||||
"text": "Auto Calibration program will be started. Don't connect any probes. It can take a while!"
|
"text": "Auto Calibration program will be started. Don't connect any probes. \nIt can take a while!"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_MSG_AUTO_CALIB",
|
"id": "IDS_MSG_AUTO_CALIB",
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_MSG_MAX_CHANNEL_COUNT_WARNING",
|
"id": "IDS_MSG_MAX_CHANNEL_COUNT_WARNING",
|
||||||
"text": "Current mode only suppport max {0}\nchannels!"
|
"text": "Current mode only suppport max {0} channels!"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "IDS_MSG_TRI_SET_ISSUE",
|
"id": "IDS_MSG_TRI_SET_ISSUE",
|
||||||
|
|||||||
@@ -1985,7 +1985,7 @@ static int receive_data_dso(int fd, int revents, const struct sr_dev_inst *sdi)
|
|||||||
tem = DSO_MIN_VAL;
|
tem = DSO_MIN_VAL;
|
||||||
else
|
else
|
||||||
tem-= high_gate;
|
tem-= high_gate;
|
||||||
test[i] = tem;
|
// test[i] = tem;
|
||||||
*((uint8_t*)pack_buffer->post_buf + i) = (uint8_t)tem;
|
*((uint8_t*)pack_buffer->post_buf + i) = (uint8_t)tem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user