diff --git a/ECTrainer2/ECTrainer.h b/ECTrainer2/ECTrainer.h index 93c0092..d8bd974 100644 --- a/ECTrainer2/ECTrainer.h +++ b/ECTrainer2/ECTrainer.h @@ -4,8 +4,8 @@ #include #include -//#define TOBII_ADDR "192.168.71.50" -#define TOBII_ADDR "192.168.23.156" +#define TOBII_ADDR "192.168.71.50" +//#define TOBII_ADDR "192.168.23.156" #define EYEDEVICE_GLASS2 //#define EYEDEVICE_NONE diff --git a/ECTrainer2/ECTrainerGUI.cpp b/ECTrainer2/ECTrainerGUI.cpp index 345fe5d..9f1994f 100644 --- a/ECTrainer2/ECTrainerGUI.cpp +++ b/ECTrainer2/ECTrainerGUI.cpp @@ -82,8 +82,20 @@ cv::circle(sceneBuf, _pEct->PEyeTrack()->GetGazeV(), 20, CV_RGB(0, 0, 255), 3); } + // �w�b�_�[�`�� + cv::Mat header = _Logo.clone(); + double contactTime = _pEct->PWorker()->GetContactTime() / 1000.0; + double expTime = _pEct->PWorker()->GetExpTime() / 1000.0; + double progress = expTime / _pEct->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); + cvui::image(_MainFrame, 0, 0, header); + cvui::text(_MainFrame, 850, 18, cv::format("%2d:%02d/%2d:%02d", + (int)expTime / 60, (int)expTime % 60, + (int)_pEct->PStimulus()->GetTotalExpTime()/60, (int)_pEct->PStimulus()->GetTotalExpTime() % 60), 0.6, 0); + cvui::text(_MainFrame, 880, 58, cv::format("%5.1f sec", contactTime), 0.6, 0); + // UI�`�� - cvui::image(_MainFrame, 0, 0, _Logo); cvui::beginColumn(_MainFrame, 10, 100, 140, -1, 10); switch (_pEct->PWorker()->GetAppStatus()) { case APP_STATUS::IDLE: diff --git a/ECTrainer2/ECTrainerGUI.h b/ECTrainer2/ECTrainerGUI.h index 361d6c0..723315d 100644 --- a/ECTrainer2/ECTrainerGUI.h +++ b/ECTrainer2/ECTrainerGUI.h @@ -13,7 +13,7 @@ private: const cv::String WIN_DISP = "ECTrainer Display"; const cv::String WIN_MAIN = "Eye Contact Trainer"; - const cv::String HEADER_FILE = "../images/Header1480.png"; + const cv::String HEADER_FILE = "../images/Header.png"; const cv::String SNAPSHOT_FILE = "snapshot.jpg"; const cv::Size MAIN_FRAME_SIZE = cv::Size(1480, 620); // ���C���E�C���h�E�̃T�C�Y const cv::Point SCENE_BUFFER_POS = cv::Point(170, 120); // ����摜�\���ʒu diff --git a/ECTrainer2/Stimulus.cpp b/ECTrainer2/Stimulus.cpp index 31f787a..f088065 100644 --- a/ECTrainer2/Stimulus.cpp +++ b/ECTrainer2/Stimulus.cpp @@ -9,6 +9,7 @@ , _pMovieObject(NULL) , _Display() , _Movie() + , _TotalExpTime(0) { _pMovieObject = new MovieObject; //_Movie.Put(L"STOP"); @@ -30,6 +31,7 @@ } // �e�[�u������\���̂֊i�[ + _TotalExpTime = 0; for (int r = 0; r < table.size(); r++) { if (table[r].size() != 5 || atoi(table[r][0].c_str()) < 1) continue; StimInfo st; @@ -40,7 +42,10 @@ st.dulation = (float)atof(table[r][2].c_str()); st.csvfile = table[r][3]; st.smallmovie = table[r][4]; - if (st.filepath.size() > 0) _StimInfoSet.push_back(st); + if (st.filepath.size() > 0) { + _StimInfoSet.push_back(st); + _TotalExpTime += st.dulation; + } } return true; diff --git a/ECTrainer2/Stimulus.h b/ECTrainer2/Stimulus.h index 88a7863..846f07a 100644 --- a/ECTrainer2/Stimulus.h +++ b/ECTrainer2/Stimulus.h @@ -43,6 +43,7 @@ RingBuffer _Display; // �\���摜 RingBuffer _Movie; // ������ cv::VideoCapture _cap; // ����I�u�W�F�N�g + float _TotalExpTime; // �h����ݒ� bool SetStimulus(int newStimNo); @@ -86,4 +87,6 @@ bool IsNewDisplay() { return _Display.IsNew(); } // �^�[�Q�b�g�����擾 std::vector GetMovieObject(float eTime = -1.f); + // ���v�������Ԃ��擾 + float GetTotalExpTime() { return _TotalExpTime; } }; diff --git a/ECTrainer2/Worker.cpp b/ECTrainer2/Worker.cpp index 97b7d39..7d73afb 100644 --- a/ECTrainer2/Worker.cpp +++ b/ECTrainer2/Worker.cpp @@ -281,3 +281,13 @@ fclose(fp); } + +// �R���^�N�g�ݐώ��Ԃ��擾 +double Worker::GetContactTime() { + return _AppStatus == APP_STATUS::STIM ? _ContactTime : 0; +} + +// �����o�ߎ��Ԃ��擾�imsec�j +double Worker::GetExpTime() { + return _AppStatus == APP_STATUS::STIM ? _pExpTimer->Elapse() : 0; +} diff --git a/ECTrainer2/Worker.h b/ECTrainer2/Worker.h index 0d8743c..c9575f6 100644 --- a/ECTrainer2/Worker.h +++ b/ECTrainer2/Worker.h @@ -74,5 +74,7 @@ // �C�x���g���O�o�� void EventLog(const TCHAR* msg); // �R���^�N�g�ݐώ��Ԃ��擾 - double GetContactTime() { return _ContactTime; } + double GetContactTime(); + // �����o�ߎ��Ԃ��擾�imsec�j + double GetExpTime(); };