-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJunStreamWriter.h
46 lines (34 loc) · 1.11 KB
/
JunStreamWriter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef _JUN_STREAM_WRITER_
#define _JUN_STREAM_WRITER_
// This is a singleton class
#include <fstream>
#include <windows.h>
#include "JunDriveSystem.h"
#include "JunEMTracker.h"
class JunStreamWriter
{
public:
JunStreamWriter(JunDriveSystem* drive, JunEMTracker* sensor);
~JunStreamWriter();
void OpenStreams(::std::string fileNameTail);
void OpenStreams(::std::string fileNameTail, int fileNumber);
void ActivateFullConfigurationRecording();
void DeactivateFullConfigurationRecording();
void CloseStreams();
void StartWriting();
void StopWriting();
private:
void Initialize(JunDriveSystem* drive, JunEMTracker* sensor);
static void write_transformation(::std::ofstream* strm, const DOUBLE_POSITION_MATRIX_TIME_Q_RECORD& transformation);
static DWORD WINAPI writing_Thread(LPVOID pData);
void TerminateWriter();
private:
bool m_bWriting, m_bStop, m_recordFullConfiguration;
JunDriveSystem* m_drive;
JunEMTracker* m_sensor;
::std::vector<int> m_sensorIds;
::std::ofstream m_sensorStrm[4];
::std::ofstream m_driveStrm;
HANDLE hThread;
};
#endif