diff --git a/ECTrainer2/Logger.cpp b/ECTrainer2/Logger.cpp index 2521449..253a15a 100644 --- a/ECTrainer2/Logger.cpp +++ b/ECTrainer2/Logger.cpp @@ -36,7 +36,7 @@ nkc::wut::DebugPrintf(_T("Log start: %s\n"), _logFileName.c_str()); TCHAR msg[1024]; - _stprintf_s(msg, 1024, _T("time,stimNo,stimTime,gazeVx,gazeVy,shiftX,shiftY," + _stprintf_s(msg, 1024, _T("time,stimNo,sceneNo,stimTime,gazeVx,gazeVy,shiftX,shiftY," "gazeIx,gazeIy,target,contact time,Feedback,TrainLevel,RR,pupilR,pupilL," "H11,H12,H13,H21,H22,H23,H31,H32,H33\n")); @@ -49,9 +49,9 @@ double* ptr = r.H.ptr(0); TCHAR msg[1024]; - _stprintf_s(msg, 1024, _T("%.3f,%d,%.3f,%.1f,%.1f,%.1f,%.1f" + _stprintf_s(msg, 1024, _T("%.3f,%d,%d,%.3f,%.1f,%.1f,%.1f,%.1f" ",%.1f,%.1f,%d,%.2f,%d,%d,%d,%.1f,%.1f,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf\n"), - r.ElapTime, r.StimNo, r.SceneTime, r.GazeV.x, r.GazeV.y, r.Shift.x, r.Shift.y, + r.ElapTime, r.StimNo, r.SceneNo, r.SceneTime, r.GazeV.x, r.GazeV.y, r.Shift.x, r.Shift.y, r.GazeI.x, r.GazeI.y, r.Target, r.ContactTime, r.Feedback, r.TrainingLevel, r.RR, r.PupilR, r.PupilL, *ptr, *(ptr + 1), *(ptr + 2), *(ptr + 3), *(ptr + 4), *(ptr + 5), *(ptr + 6), *(ptr + 7), *(ptr + 8)); @@ -78,10 +78,3 @@ void Logger::Stop() { _logFileName = _T(""); } - -// 集計 -void Logger::Summarize() { - for (int scn = 0; scn < 40; scn++) { - - } -} \ No newline at end of file diff --git a/ECTrainer2/Logger.h b/ECTrainer2/Logger.h index cd77afe..cdcd495 100644 --- a/ECTrainer2/Logger.h +++ b/ECTrainer2/Logger.h @@ -10,6 +10,7 @@ struct Record { double ElapTime; // 経過時間 int StimNo; // 刺激データ番号 + int SceneNo; // シーン番号 double SceneTime; // 刺激提示の経過時間 cv::Point2f GazeV; // 注視点(視野カメラ座標) cv::Point2f Shift; // ずれ @@ -40,7 +41,6 @@ void StartRecord(std::string subject, int visit); void WriteRecord(Record& r); void Stop(); - void Summarize(); }; // 将来ログクラスを階層化する diff --git a/ECTrainer2/Stimulus.h b/ECTrainer2/Stimulus.h index 0386a55..097f68b 100644 --- a/ECTrainer2/Stimulus.h +++ b/ECTrainer2/Stimulus.h @@ -108,4 +108,6 @@ int GetStage() { return _Scene; } // 最大ステージ取得 int GetStageMax() { return _SceneMax; } + // 刺激のシーン番号を取得 + int GetScene(int stimNo) { return _StimInfoSet[stimNo].scene; }; }; diff --git a/ECTrainer2/Worker.cpp b/ECTrainer2/Worker.cpp index a5f506f..2a7d1de 100644 --- a/ECTrainer2/Worker.cpp +++ b/ECTrainer2/Worker.cpp @@ -136,6 +136,7 @@ Record r; r.ElapTime = _pExpTimer->Elapse() / 1000.; // 経過時間 r.StimNo = stimNo; // 刺激データ番号 + r.SceneNo = stimNo < 1 ? 0 : Ect()->PStimulus()->GetScene(stimNo - 1); // シーン番号 r.SceneTime = Ect()->PStimulus()->GetStimTime() / 1000.; // 刺激提示の経過時間 r.GazeV = gazeV; // 注視点(視野カメラ座標) r.Shift = _ShiftLog.size() > 0 && Ect()->PStimulus()->GetStimTime() >= SHIFT_LOG_STARTTIME @@ -271,24 +272,6 @@ // イベントログ出力 void Worker::EventLog(const TCHAR* msg) { Logger::WriteEvent(msg); - - //CreateDirectory(_T(LOG_DIR), NULL); - //FILE* fp = NULL; // イベントログファイルポインタ - - //if (_tfopen_s(&fp, _T("../log/events.txt"), _T("a")) != 0) { - // Ect()->MsgBox(_T("Can't open event log file."), MB_ICONERROR); - // return; - //} - - //if (_tcslen(msg) < 1) { - // _ftprintf(fp, _T("\n")); - //} else { - // std::wstring datestr = nkc::wut::Multi2Wide(nkc::wut::DateTimeStr()); - // _ftprintf(fp, _T("%s %s\n"), datestr.c_str(), msg); - // nkc::wut::DebugPrintf(_T("%s %s\n"), datestr.c_str(), msg); - //} - - //fclose(fp); } // コンタクト累積時間を取得