diff --git a/src/output/ods/comparbasesheet.cpp b/src/output/ods/comparbasesheet.cpp index 91b667bd468749dc648e04682606fc53e13cfd9f..b13c8acba21c00035d2ca2fca0d232c1a218f5bd 100644 --- a/src/output/ods/comparbasesheet.cpp +++ b/src/output/ods/comparbasesheet.cpp @@ -34,12 +34,15 @@ #include <QDebug> -ComparBaseSheet::ComparBaseSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project, const QString & title_sheet): _p_project(p_project) { +ComparBaseSheet::ComparBaseSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): _p_project(p_project) { _p_ods_export = p_ods_export; _p_writer = p_writer; - p_writer->writeSheet(title_sheet); +} + +void ComparBaseSheet::writeSheet () { + _p_writer->writeSheet(_title_sheet); - std::vector<IdentificationGroup *> identification_list = p_project->getIdentificationGroupList(); + std::vector<IdentificationGroup *> identification_list = _p_project->getIdentificationGroupList(); for (IdentificationGroup * p_ident:identification_list) { //writeHeaders(p_ident); writeIdentificationGroup(p_ident); @@ -105,7 +108,6 @@ void ComparBaseSheet::writeProteinMatch(const ProteinMatch * p_protein_match) { _p_writer->writeCell(p_protein_match->getGroupingGroupSp().get()->countProteinInSubgroup(subgroup_number)); for (MsRunSp & msrun_sp: _msrun_list) { - writeComparValue(p_protein_match, ValidationState::validAndChecked, msrun_sp.get()); } diff --git a/src/output/ods/comparbasesheet.h b/src/output/ods/comparbasesheet.h index beb90fc2f120668707ba8f16baa232ec7933e17c..0c41418f09e7fcc2468a1a0ba4c2db951f9e2b10 100644 --- a/src/output/ods/comparbasesheet.h +++ b/src/output/ods/comparbasesheet.h @@ -38,12 +38,15 @@ class ComparBaseSheet { public : - ComparBaseSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project,const QString & title_sheet); + ComparBaseSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project); private : void writeIdentificationGroup(IdentificationGroup * p_ident); void writeHeaders(IdentificationGroup * p_ident); void writeProteinMatch(const ProteinMatch * p_protein_match); - + +public : + void writeSheet(); +protected : virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun)=0; protected : @@ -51,6 +54,8 @@ protected : const Project * _p_project; CalcWriterInterface * _p_writer; std::vector<MsRunSp> _msrun_list; + QString _title_sheet; + }; #endif // COMPARBASESHEET_H diff --git a/src/output/ods/comparspecificspectrasheet.cpp b/src/output/ods/comparspecificspectrasheet.cpp index 20a02fec59e3b761a00de9c2f127a1a4c0281e1d..23e8534145fee6251820a3c58dc9bc2539889d72 100644 --- a/src/output/ods/comparspecificspectrasheet.cpp +++ b/src/output/ods/comparspecificspectrasheet.cpp @@ -30,11 +30,14 @@ #include "comparspecificspectrasheet.h" -ComparSpecificSpectraSheet::ComparSpecificSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project, QString("compar specific spectra")) { +ComparSpecificSpectraSheet::ComparSpecificSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project) { + _title_sheet = "compar specific spectra"; } void ComparSpecificSpectraSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) { + qDebug() << "ComparSpecificSpectraSheet::writeComparValue begin"; _p_writer->writeCell((unsigned int) p_protein_match->getGroupingGroupSp().get()->countSpecificSampleScan(p_protein_match, state, p_msrun)); + qDebug() << "ComparSpecificSpectraSheet::writeComparValue end"; } diff --git a/src/output/ods/comparspecificspectrasheet.h b/src/output/ods/comparspecificspectrasheet.h index dfe76fd60a669c385e21f65958c1ae3f6a34c082..267389372fe03e4620306eecd7c1e715eb3cba79 100644 --- a/src/output/ods/comparspecificspectrasheet.h +++ b/src/output/ods/comparspecificspectrasheet.h @@ -35,8 +35,8 @@ class ComparSpecificSpectraSheet: public ComparBaseSheet { public : ComparSpecificSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project); -private : - virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun); +protected : + virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) override; }; #endif // COMPARSPECIFICSPECTRASHEET_H diff --git a/src/output/ods/comparspectrasheet.cpp b/src/output/ods/comparspectrasheet.cpp index 4fb429a8442bb7b6a6ba32a09866efbc1910c917..bc15bc522f8e10f5d6d457612110d185d37e4bd6 100644 --- a/src/output/ods/comparspectrasheet.cpp +++ b/src/output/ods/comparspectrasheet.cpp @@ -34,19 +34,12 @@ #include <QDebug> -ComparSpectraSheet::ComparSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): _p_project(p_project) { - _p_ods_export = p_ods_export; - _p_writer = p_writer; - p_writer->writeSheet("compar spectra"); - - std::vector<IdentificationGroup *> identification_list = p_project->getIdentificationGroupList(); - for (IdentificationGroup * p_ident:identification_list) { - //writeHeaders(p_ident); - writeIdentificationGroup(p_ident); - } +ComparSpectraSheet::ComparSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): ComparBaseSheet(p_ods_export, p_writer, p_project) { + _title_sheet = "compar spectra"; } - -void ComparSpecificSpectraSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) { +void ComparSpectraSheet::writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) { + qDebug() << "ComparSpectraSheet::writeComparValue begin"; _p_writer->writeCell(p_protein_match->countSampleScan(state, p_msrun)); + qDebug() << "ComparSpectraSheet::writeComparValue end"; } diff --git a/src/output/ods/comparspectrasheet.h b/src/output/ods/comparspectrasheet.h index 36296fa63b2abc2e1eaef0ea5a4db9ec2bca685c..505b813d12fc59785d43be477d0795e3b1e86470 100644 --- a/src/output/ods/comparspectrasheet.h +++ b/src/output/ods/comparspectrasheet.h @@ -37,8 +37,8 @@ class ComparSpectraSheet:public ComparBaseSheet public : ComparSpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project); -private : - virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun); +protected : + virtual void writeComparValue(const ProteinMatch * p_protein_match, ValidationState state, const MsRun * p_msrun) override; }; #endif // COMPARSPECTRASHEET_H diff --git a/src/output/ods/odsexport.cpp b/src/output/ods/odsexport.cpp index b9e5ffe8da734a3825c6f67a43dfb7a5f9a35408..ab72b09e648b547219221688528bc6184ba83a86 100644 --- a/src/output/ods/odsexport.cpp +++ b/src/output/ods/odsexport.cpp @@ -77,9 +77,9 @@ void OdsExport::write(CalcWriterInterface * p_writer) { PeptidePosSheet(this, p_writer, _p_project); } if (settings.value("export_ods/comparspectra", "true").toBool()) { - ComparSpectraSheet(this, p_writer, _p_project); + ComparSpectraSheet(this, p_writer, _p_project).writeSheet(); } if (settings.value("export_ods/comparspecificspectra", "true").toBool()) { - ComparSpecificSpectraSheet(this, p_writer, _p_project); + ComparSpecificSpectraSheet(this, p_writer, _p_project).writeSheet(); } }