forked from Ivasoft/DSView
One option for whether to switch data buffer on repeat mode
This commit is contained in:
@@ -100,6 +100,7 @@ void _loadApp(AppOptions &o, QSettings &st){
|
||||
getFiled("transDecoderDlg", st, o.transDecoderDlg, true);
|
||||
getFiled("trigPosDisplayInMid", st, o.trigPosDisplayInMid, true);
|
||||
getFiled("displayProfileInBar", st, o.displayProfileInBar, false);
|
||||
getFiled("swapBackBufferAlways", st, o.swapBackBufferAlways, false);
|
||||
|
||||
QString fmt;
|
||||
getFiled("protocalFormats", st, fmt, "");
|
||||
@@ -121,6 +122,7 @@ void _saveApp(AppOptions &o, QSettings &st){
|
||||
setFiled("transDecoderDlg", st, o.transDecoderDlg);
|
||||
setFiled("trigPosDisplayInMid", st, o.trigPosDisplayInMid);
|
||||
setFiled("displayProfileInBar", st, o.displayProfileInBar);
|
||||
setFiled("swapBackBufferAlways", st, o.swapBackBufferAlways);
|
||||
|
||||
QString fmt = FormatArrayToString(o.m_protocolFormats);
|
||||
setFiled("protocalFormats", st, fmt);
|
||||
|
||||
@@ -64,6 +64,7 @@ struct AppOptions
|
||||
bool transDecoderDlg;
|
||||
bool trigPosDisplayInMid;
|
||||
bool displayProfileInBar;
|
||||
bool swapBackBufferAlways;
|
||||
|
||||
std::vector<StringPair> m_protocolFormats;
|
||||
};
|
||||
|
||||
@@ -66,10 +66,14 @@ bool ApplicationParamDlg::ShowDlg(QWidget *parent)
|
||||
QCheckBox *ck_profileBar = new QCheckBox();
|
||||
ck_profileBar->setChecked(app._appOptions.displayProfileInBar);
|
||||
|
||||
QCheckBox *ck_abortData = new QCheckBox();
|
||||
ck_abortData->setChecked(app._appOptions.swapBackBufferAlways);
|
||||
|
||||
lay.setHorizontalSpacing(8);
|
||||
|
||||
if (mode == LOGIC){
|
||||
lay.addRow(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_QUICK_SCROLL), "Quick scroll"), ck_quickScroll);
|
||||
lay.addRow(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_USE_ABORT_DATA_REPEAT), "Used abort data"), ck_abortData);
|
||||
}
|
||||
else if (mode == DSO){
|
||||
lay.addRow(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIG_DISPLAY_MIDDLE), "Tig pos in middle"), ck_trigInMid);
|
||||
@@ -88,6 +92,7 @@ bool ApplicationParamDlg::ShowDlg(QWidget *parent)
|
||||
app._appOptions.quickScroll = ck_quickScroll->isChecked();
|
||||
app._appOptions.trigPosDisplayInMid = ck_trigInMid->isChecked();
|
||||
app._appOptions.displayProfileInBar = ck_profileBar->isChecked();
|
||||
app._appOptions.swapBackBufferAlways = ck_abortData->isChecked();
|
||||
|
||||
app.SaveApp();
|
||||
|
||||
|
||||
@@ -2102,6 +2102,17 @@ namespace pv
|
||||
bAddDecoder = true;
|
||||
}
|
||||
|
||||
if (is_repeat_mode())
|
||||
{
|
||||
AppConfig &app = AppConfig::Instance();
|
||||
bool swapBackBufferAlways = app._appOptions.swapBackBufferAlways;
|
||||
if (!swapBackBufferAlways && !_is_working && _capture_times > 1){
|
||||
bAddDecoder = false;
|
||||
bSwapBuffer = false;
|
||||
_capture_data->clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (bAddDecoder){
|
||||
clear_all_decode_task2();
|
||||
clear_decode_result();
|
||||
|
||||
@@ -698,5 +698,9 @@
|
||||
{
|
||||
"id": "IDS_DLG_SERIAL_INPUT_AS_HEX",
|
||||
"text": "以十六进制格式输入"
|
||||
},
|
||||
{
|
||||
"id": "IDS_DLG_USE_ABORT_DATA_REPEAT",
|
||||
"text": "重复模式下允许使用中途停止的数据"
|
||||
}
|
||||
]
|
||||
@@ -698,5 +698,9 @@
|
||||
{
|
||||
"id": "IDS_DLG_SERIAL_INPUT_AS_HEX",
|
||||
"text": "Input with hex format"
|
||||
},
|
||||
{
|
||||
"id": "IDS_DLG_USE_ABORT_DATA_REPEAT",
|
||||
"text": "Allow use of the midway stopped data on repeat mode"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user