void CBasicLog::StartTrial() { m_iSymbolCount = 0; m_iKeyCount = 0; m_dBits = 0.0; m_strStartDate = GetDateStamp(); m_iInitialRate = GetLongParameter(LP_MAX_BITRATE); }
// OutputToStream() // Outputs an ImageData instance as ASCII text to the stream provided. void ImageData::OutputToStream( ostream &out ) { out << " Filename: \"" << GetFilename() << "\"" << endl; out << " File Format: " << GetFileFormat() << "; \"" << ImageFileFormatStrings[ GetFileFormat() ] << "\"" << endl; out << " File Size: " << GetFileSize() << " bytes " << endl; out << endl; out << " File Data:" << endl; out << " Bits Per Pixel: " << GetBitsPerPixel() << endl; out << " Compression: " << GetCompression() << "; \"" << ImageCompressionModeStrings[ GetCompression() ] << "\"" << endl; out << " DPI X/Y: " << GetDPIX() << "/" << GetDPIY() << endl; out << " Pixel Aspect Ration: " << GetPixelAspectNum() << "/" << GetPixelAspectDenom() << endl; out << " Gamma Correction: " << GetGammaNum() << "/" << GetGammaDenom() << endl; out << " Thumbnail: "; if( GetThumbnail() == NULL ) out << "No" << endl; else out << "Yes" << endl; out << endl; out << " Creator Data:" << endl; out << " Author: \"" << GetAuthor() << "\"" << endl; out << " Creator Program: \"" << GetCreator() << "\"" << endl; out << " Creator Version: " << GetCreatorVersion() << "." << GetCreatorRevision() << GetCreatorSubRev() << endl; out << " Comment: \"" << GetComment() << "\"" << endl; out << " Job Name: \"" << GetJobName() << "\"" << endl; out << " Job Time: " << GetJobTime()[0] << ":" << GetJobTime()[1] << ":" << GetJobTime()[2] << endl; out << " Date Stamp: " << GetDateStamp()[0] << "/" << GetDateStamp()[1] << "/" << GetDateStamp()[2] << " " << GetDateStamp()[3] << ":" << GetDateStamp()[4] << ":" << GetDateStamp()[5] << endl; out << endl; out << " Image Data:" << endl; out << " Width: " << GetImage()->GetWidth() << endl; out << " Height: " << GetImage()->GetHeight() << endl; out << " Type: " << GetImage()->GetType() << "; \"" << ImageTypeStrings[ GetImage()->GetType() ] << "\"" << endl; out << " Num Registers: "; if( GetImage()->GetType() == IMAGE_INDEXED ) out << GetImage()->GetNumRegisters() << endl; else out << "N/A" << endl; }
void CBasicLog::EndTrial() { if(!m_bStarted) return; std::string strFileName(GetStringParameter(SP_USER_LOC)); strFileName.append("dasher_basic.log"); std::ofstream oFile; oFile.open(strFileName.c_str(), ios::out | ios::app); oFile << "\"" << m_strStartDate << "\":\"" << GetDateStamp() << "\":" << m_iSymbolCount << ":" << m_dBits << ":" << m_iKeyCount << ":" << m_iInitialRate / 100.0 << ":" << GetLongParameter(LP_MAX_BITRATE) / 100.0 << ":\"" << GetStringParameter(SP_INPUT_FILTER) << "\":\"" << GetStringParameter(SP_ALPHABET_ID) << "\"" << std::endl; oFile.close(); m_bStarted = false; }