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

Method save_proc

DSView/pv/dialogs/protocolexp.cpp:195–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195void ProtocolExp::save_proc()
196{
197 _export_cancel = false;
198
199 QFile file(_fileName);
200 file.open(QIODevice::WriteOnly | QIODevice::Text);
201 QTextStream out(&file);
202 encoding::set_utf8(out);
203 // out.setGenerateByteOrderMark(true); // UTF-8 without BOM
204 int row_num = 0;
205 ExportRowInfo row_inf_arr[EXPORT_DEC_ROW_COUNT_MAX];
206 std::vector<Annotation*> annotations_arr[EXPORT_DEC_ROW_COUNT_MAX];
207
208 for (std::list<QCheckBox *>::const_iterator i = _row_sel_list.begin();
209 i != _row_sel_list.end(); i++)
210 {
211 if ((*i)->isChecked())
212 {
213 row_inf_arr[row_num].title = (*i)->property("title").toString();
214 row_inf_arr[row_num].row_index = (*i)->property("index").toULongLong();
215 row_num++;
216
217 if (row_num == EXPORT_DEC_ROW_COUNT_MAX)
218 break;
219 }
220 }
221
222 if (row_num == 0){
223 dsv_info("ERROR: There have no decode data row to export.");
224 return;
225 }
226
227 pv::data::DecoderModel *decoder_model = _session->get_decoder_model();
228 const auto decoder_stack = decoder_model->getDecoderStack();
229
230 int fd_row_dex = 0;
231 const std::map<const Row, bool> rows_lshow = decoder_stack->get_rows_lshow();
232 for (auto it = rows_lshow.begin();it != rows_lshow.end(); it++)
233 {
234 if ((*it).second)
235 {
236 for (int i=0; i<row_num; i++) {
237 if (row_inf_arr[i].row_index == fd_row_dex){
238 row_inf_arr[i].row = &(*it).first;
239 break;
240 }
241 }
242 fd_row_dex++;
243 }
244 }
245
246 //get annotation list
247 uint64_t total_ann_count = 0;
248
249 for (int i=0; i<row_num; i++)
250 {
251 decoder_stack->get_annotation_subset(annotations_arr[i], *row_inf_arr[i].row,
252 0, decoder_stack->sample_count() - 1);

Callers

nothing calls this directly

Calls 11

set_utf8Function · 0.85
get_decoder_modelMethod · 0.80
getDecoderStackMethod · 0.80
get_rows_lshowMethod · 0.80
sizeMethod · 0.80
start_sampleMethod · 0.80
closeMethod · 0.80
endMethod · 0.45
get_annotation_subsetMethod · 0.45
sample_countMethod · 0.45
samplerateMethod · 0.45

Tested by

no test coverage detected