MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / installDataSaver

Method installDataSaver

Default/GenericInspector/InspectorUI.cpp:761–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759}
760
761bool
762InspectorUI::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
795void
796InspectorUI::uninstallDataSaver(void)

Callers 2

onToggleRecordMethod · 0.95

Calls 3

captureFileNameMethod · 0.95
getBaudRateMethod · 0.95
setSampleRateMethod · 0.45

Tested by

no test coverage detected