Commit 1ac72926 authored by ahoms's avatar ahoms
Browse files

* added resetLastFrameNb() to (re)initialize the m_last_frameid_saved to -1

* fixed total header alignment to 512 (was 511)


git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@109 45c4679d-1946-429d-baad-37912b19538b
parent f4908ee9
......@@ -104,6 +104,7 @@ namespace lima {
void removeAllFrameHeaders();
void frameReady(Data &);
void resetLastFrameNb();
private:
class _SaveTask;
......
......@@ -63,11 +63,11 @@ private:
//@brief constructor
CtSaving::CtSaving(CtControl &aCtrl) :
m_ctrl(aCtrl),
m_ready_flag(true),
m_last_frameid_saved(0)
m_ready_flag(true)
{
m_save_cnt = new _SaveContainer(*this);
m_saving_cbk = new _SaveCBK(*this);
resetLastFrameNb();
}
//@brief destructor
......@@ -304,6 +304,10 @@ void CtSaving::_takeHeader(std::map<long,HeaderMap>::iterator &headerIter, Heade
m_frame_headers.erase(headerIter);
}
void CtSaving::resetLastFrameNb()
{
m_last_frameid_saved = -1;
}
void CtSaving::frameReady(Data &aData)
{
......@@ -558,6 +562,6 @@ void CtSaving::_SaveContainer::_writeEdfHeader(Data &aData,HeaderMap &aHeader)
long lenght = aEndPosition - aStartPosition;
long finalHeaderLenght = (lenght + 511) & ~511; // 512 alignment
snprintf(aBuffer,sizeof(aBuffer),"%*s}\n",int(finalHeaderLenght - lenght - 3),"");
snprintf(aBuffer,sizeof(aBuffer),"%*s}\n",int(finalHeaderLenght - lenght - 2),"");
m_fout << aBuffer;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment