diff --git a/ECTrainer2/Stimulus.cpp b/ECTrainer2/Stimulus.cpp index 235ccfc..0dd9a89 100644 --- a/ECTrainer2/Stimulus.cpp +++ b/ECTrainer2/Stimulus.cpp @@ -99,7 +99,7 @@ break; case (int)ECTMSG::EXP_START: // 実験開始 - this->SetStimulus(0); + this->StartExp(); break; case (int)ECTMSG::EXP_STOP: // 実験停止 @@ -124,6 +124,20 @@ return true; } +// 実験開始 +void Stimulus::StartExp() { + int start = 0; + + // 刺激ステージを検索 + if (*Ect()->PWorker()->StartStagePtr() > 0) { + for (int i = 0; i < _StimInfoSet.size(); i++) { + if (_StimInfoSet[i].stage == *Ect()->PWorker()->StartStagePtr()) start = i; + } + } + + this->SetStimulus(start); +} + // 次の刺激へ移動 bool Stimulus::MoveNext() { if (_StimNo < 0) return false; diff --git a/ECTrainer2/Stimulus.h b/ECTrainer2/Stimulus.h index 337cb49..3f8d3a6 100644 --- a/ECTrainer2/Stimulus.h +++ b/ECTrainer2/Stimulus.h @@ -51,6 +51,8 @@ // ECTrainerインスタンス取得 ECTrainer* Ect() { return (ECTrainer*)_pUserdata; } + // 実験開始 + void StartExp(); // 刺激を設定 bool SetStimulus(int newStimNo); // 動画オブジェクトの読み込み