Newer
Older
PrismSoftware / ECTrainer2 / Worker.h
#pragma once

#include <stdio.h>
#include <Windows.h>
#include <tchar.h>

namespace mwut {
	class HPTimer;
};

class BaseProcess;
class ECTrainer;
enum class APP_STATUS;

// ワーカークラス
// アプリケーションの状態管理
// アイコンタクト判定
// ログ出力
class Worker : public BaseProcess
{
	const TCHAR* DATA_LOG_FILE = _T("LogData.csv");
	const TCHAR* EVENT_LOG_FILE = _T("LogEvent.txt");
	APP_STATUS _AppStatus;	// アプリケーション状態
	FILE* _fpLogData;		// データログファイルポインタ
	FILE* _fpLogEvent;		// イベントログファイルポインタ
	mwut::HPTimer* _pTimer;	// ログ用のタイマー

	// データログ出力
	void DataLog();
	// イベントログ出力
	void EventLog(const TCHAR* msg);
	// 基本処理
	bool Routine();
	// イベント処理
	bool EventProc(MSG& msg);

public:
	// コンストラクタ
	Worker(ECTrainer* pEct);
	// デストラクタ
	~Worker();
	// 初期化
	bool Init();
	// アプリケーション状態の取得
	APP_STATUS GetAppStatus() { return _AppStatus; }
};