36 void DataLogger::saveAsText(
DataStream &input){
41 if (!outFileHeader.open(QIODevice::WriteOnly | QIODevice::Text)) {
42 emit
updateStatus(
"Failed to open data file for write!");
43 std::cerr <<
"Failed to open header-data file for write!!" << endl;
45 QTextStream outHeader(&outFileHeader);
47 outHeader <<
"[ECG CAPTURE SETTINGS]\n" 49 <<
"Samples: " << QString::number(input.size()) <<
"\n" 50 <<
"Duration: " << QString::number(input.back().time) <<
"ms \n" 53 <<
"\n[RECORDING INFORMATION]\n" 61 outFileHeader.close();
67 if (!outFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
68 emit
updateStatus(
"Failed to open data file for write!");
69 std::cerr <<
"Failed to open data file for write" << std::endl;
71 QTextStream out(&outFile);
76 for (
int i ; i<input.size();i++){
78 out << tmp.
toText() << endl;
83 emit
updateStatus(QString(
"Samples saved in text format"));
84 std::cerr <<
"Samples saved in text format" << std::endl;
99 qDebug() <<
"Save as EDF not implemented yet" << endl;
QString getPatientCode()
Returns a QString containing the value from private QString patientCode.
int getSampleRate()
Returns a int containing the value from private int sampleRate.
QString getRecordingName()
Returns a QString containing the value from private QString recordingName.
void updateStatus(QString status)
Signal emitting status messages during the process.
QString getSource()
Returns a QString containing the value from private QString source.
QString getName()
Returns a QString containing the value from private QString name.
static SettingsSingleton & instance()
Retrives a reference to the ONE and ONLY SettingsSingleton created for the application.
QString getFileName()
Returns a QString containing the value from private QString fileName.
DataLogger(QObject *parent=0)
void save(DataStream &input)
Saves the input to a txt-file, header-file and edf-file(if bool saveAsEdf in SettingsSingleton) ...
Abstract Interface that should be used for storing data in the memory.
virtual QString toText() const
Converts the data from the struct into a QString representation.
Struct to store Biosignal data from a specific time, combined with DataStream it will store a sequenc...
QString getGender()
Returns a QString containing the value from private QString gender.
QString getNotes()
Returns a QString containing the value from private QString notes.
QString getBirthDate()
Returns a QString containing the value from private QString birthDate.