diff --git a/ECTrainer2/ECTrainerGUI.cpp b/ECTrainer2/ECTrainerGUI.cpp index 79751b8..bd2987f 100644 --- a/ECTrainer2/ECTrainerGUI.cpp +++ b/ECTrainer2/ECTrainerGUI.cpp @@ -95,7 +95,7 @@ // ヘッダー描画 cv::Mat header = _Logo.clone(); double contactTime = Ect()->PWorker()->GetContactTime() / 1000.0; - double expTime = Ect()->PWorker()->GetExpTime() / 1000.0; + double expTime = Ect()->PStimulus()->GetExpTime() / 1000.0; double progress = expTime / Ect()->PStimulus()->GetTotalExpTime(); cv::rectangle(header, cv::Rect(1000, 14, (int)(400 * progress), 22), CV_RGB(0, 199, 0), cv::FILLED); cv::rectangle(header, cv::Rect(1000, 54, (int)(400 * contactTime / 15.0), 22), CV_RGB(240, 116, 95), cv::FILLED); diff --git a/ECTrainer2/Stimulus.cpp b/ECTrainer2/Stimulus.cpp index 99e3057..da88b01 100644 --- a/ECTrainer2/Stimulus.cpp +++ b/ECTrainer2/Stimulus.cpp @@ -36,6 +36,7 @@ _TotalExpTime = 0; _StimInfoSet.clear(); _StageMax = 0; + float accTime = 0; for (int r = 0; r < table.size(); r++) { if (table[r].size() != 6 || atoi(table[r][0].c_str()) < 1) continue; StimInfo st; @@ -44,6 +45,8 @@ int idx = (int)st.filepath.find_last_of("/\\"); st.filename = idx == std::string::npos ? st.filepath : st.filepath.substr(idx + 1); st.dulation = (float)atof(table[r][2].c_str()); + st.accTime = accTime; + accTime += st.dulation * 1000.F; st.csvfile = table[r][3]; st.smallmovie = table[r][4]; st.stage = atoi(table[r][5].c_str()); diff --git a/ECTrainer2/Stimulus.h b/ECTrainer2/Stimulus.h index a0511ff..d9ab41d 100644 --- a/ECTrainer2/Stimulus.h +++ b/ECTrainer2/Stimulus.h @@ -21,6 +21,7 @@ std::string filename; // 提示ファイル名(パスなし) std::string smallmovie; // 縮小動画ファイル名 float dulation; // 時間(sec) + float accTime; // この刺激までの蓄積時間(ms) std::string csvfile; // ターゲット座標ファイル(無い場合は_アンダーバー) int stage; // 刺激ステージ }; @@ -98,6 +99,8 @@ std::vector GetMovieObject(float eTime = -1.f); // 合計実験時間を取得 float GetTotalExpTime() { return _TotalExpTime; } + // 実験経過時間を取得 + float GetExpTime() { return _StimNo < 0 ? 0 : _StimInfoSet[_StimNo].accTime + (float)_StimTimer.Elapse(); } // ソフトウェアキャリブレーション実行中かどうか bool IsSoftCalib() { return _StimNo < 0 ? false : _StimInfoSet[_StimNo].type == StimInfo::TYPE_CALIB; } // ステージ取得