annotate src/OutputDataWriter.cpp @ 43:b7ad807c9cde

Added annotation writing and the src for the result calculator
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Fri, 04 May 2012 15:33:36 +0100
parents
children e359b9bad811
rev   line source
andrew@43 1 /*
andrew@43 2 * outputDataWriter.cpp
andrew@43 3 * MultipleAudioMathcher
andrew@43 4 *
andrew@43 5 * Created by Andrew on 25/04/2012.
andrew@43 6 * Copyright 2012 QMUL. All rights reserved.
andrew@43 7 *
andrew@43 8 */
andrew@43 9
andrew@43 10 #include "OutputDataWriter.h"
andrew@43 11
andrew@43 12 OutputDataWriter::OutputDataWriter(){
andrew@43 13 filepath = "../../../data/output.txt";
andrew@43 14 openFile();
andrew@43 15 }
andrew@43 16
andrew@43 17 void OutputDataWriter::writeOutput(const int& liveTime, const int& rehearsalTime, const int& playedRehearsalTime){
andrew@43 18
andrew@43 19 if (outputFile.is_open()){
andrew@43 20 outputFile << liveTime/1000.0 << "\t" << rehearsalTime/1000.0 << "\t" << playedRehearsalTime/1000.0 << endl;
andrew@43 21 }
andrew@43 22 }
andrew@43 23
andrew@43 24 void OutputDataWriter::openFile(){
andrew@43 25 if (!outputFile.is_open())
andrew@43 26 outputFile.open(filepath.c_str());
andrew@43 27 }
andrew@43 28
andrew@43 29 void OutputDataWriter::closeFile(){
andrew@43 30 if (outputFile.is_open())
andrew@43 31 outputFile.close();
andrew@43 32 }