| 759 | } |
| 760 | |
| 761 | bool |
| 762 | InspectorUI::installDataSaver(void) |
| 763 | { |
| 764 | if (this->dataSaver == nullptr) { |
| 765 | std::string path = this->captureFileName(); |
| 766 | this->fd = open(path.c_str(), O_CREAT | O_TRUNC | O_WRONLY, 0600); |
| 767 | if (this->fd == -1) { |
| 768 | std::string path; |
| 769 | |
| 770 | path = "Failed to open capture file <pre>" + |
| 771 | path + |
| 772 | "</pre>: " + |
| 773 | std::string(strerror(errno)); |
| 774 | |
| 775 | (void) QMessageBox::critical( |
| 776 | this->owner, |
| 777 | "Save demodulator output", |
| 778 | QString::fromStdString(path), |
| 779 | QMessageBox::Close); |
| 780 | |
| 781 | return false; |
| 782 | } |
| 783 | |
| 784 | this->dataSaver = new FileDataSaver(this->fd, this); |
| 785 | this->recordingRate = this->getBaudRate(); |
| 786 | this->dataSaver->setSampleRate(recordingRate); |
| 787 | connectDataSaver(); |
| 788 | |
| 789 | return true; |
| 790 | } |
| 791 | |
| 792 | return false; |
| 793 | } |
| 794 | |
| 795 | void |
| 796 | InspectorUI::uninstallDataSaver(void) |
no test coverage detected