diff --git a/ECTrainer2/BitalMonitor.cpp b/ECTrainer2/BitalMonitor.cpp index ad8051b..7ec02a7 100644 --- a/ECTrainer2/BitalMonitor.cpp +++ b/ECTrainer2/BitalMonitor.cpp @@ -1,5 +1,6 @@ #include "BitalMonitor.h" #include "ECTrainer.h" +#include "Worker.h" #include "myWinUtils.h" // �R���X�g���N�^ @@ -27,13 +28,13 @@ if (readBytes < 1) continue; //mwut::DebugPrintf(_T("check com %d\n"), com); if ((*comBuf >= '0' && *comBuf <= '9') || *comBuf == '#' || *comBuf == LF) { - mwut::DebugPrintf(_T("Bital device found on com%d\n"), com); + _pEct->PWorker()->EventLog(_T("Bital device connected.")); _useDevice = true; return true; } } - mwut::DebugPrintf(_T("Bital device not found\n")); + _pEct->PWorker()->EventLog(_T("Bital device not found.")); _useDevice = false; return true; } diff --git a/ECTrainer2/ECTrainerGUI.cpp b/ECTrainer2/ECTrainerGUI.cpp index 20e66f5..3b70790 100644 --- a/ECTrainer2/ECTrainerGUI.cpp +++ b/ECTrainer2/ECTrainerGUI.cpp @@ -183,6 +183,8 @@ case (int)ECTMSG::MOVIE_START: if (!_pEct->PDSMovie()->PlayMovie(_pEct->PStimulus()->GetMovie())) { + _pEct->PWorker()->EventLog((_T("Can't play movie file :") + + _pEct->PStimulus()->GetMovie()).c_str()); ((BaseProcess*)_pEct->PWorker())->PostMsg(ECTMSG::SYSTEM_ERROR); } break; diff --git a/ECTrainer2/SceneCamera.cpp b/ECTrainer2/SceneCamera.cpp index 547f973..99ef7e0 100644 --- a/ECTrainer2/SceneCamera.cpp +++ b/ECTrainer2/SceneCamera.cpp @@ -4,6 +4,7 @@ #include "ECTrainer.h" #include "SceneCamera.h" +#include "Worker.h" #include "ECTrainerGUI.h" #include "MyWinUtils.h" @@ -18,8 +19,10 @@ // ���E�J�����ɐڑ� #if defined(EYEDEVICE_GLASS2) _SceneCam.open("rtsp://" TOBII_ADDR ":8554/live/scene"); + _pEct->PWorker()->EventLog(_T("Tobii Glasses camera connected.")); #elif defined(EYEDEVICE_NONE) _SceneCam.open(0); + _pEct->PWorker()->EventLog(_T("Generic camera connected.")); #endif if (!_SceneCam.isOpened()) { MessageBox(NULL, _T("cannot open camera " TOBII_ADDR), NULL, 0); @@ -30,6 +33,7 @@ _SceneCam >> scene; _sceneSize = scene.size(); + return true; } diff --git a/ECTrainer2/Stimulus.cpp b/ECTrainer2/Stimulus.cpp index 47f49ad..31f787a 100644 --- a/ECTrainer2/Stimulus.cpp +++ b/ECTrainer2/Stimulus.cpp @@ -1,6 +1,7 @@ #include "BaseProcess.h" #include "Stimulus.h" #include "ECTrainer.h" +#include "Worker.h" // �R���X�g���N�^ Stimulus::Stimulus(ECTrainer* pEct) : BaseProcess(pEct) @@ -141,8 +142,9 @@ } else { _cap.open(_StimInfoSet[newStimNo].smallmovie); if (!_cap.isOpened()) { - mwut::DebugPrintf(_T("Can't open small movie file: %s\n"), - mwut::Multi2Wide(_StimInfoSet[newStimNo].filepath).c_str()); + _pEct->PWorker()->EventLog((_T("Can't open small movie file: ") + + mwut::Multi2Wide(_StimInfoSet[newStimNo].filepath)).c_str()); + ((BaseProcess*)_pEct->PWorker())->PostMsg(ECTMSG::SYSTEM_ERROR); return false; } @@ -159,8 +161,8 @@ bool Stimulus::SetImage(cv::String imageFile) { auto img = cv::imread(imageFile); if (img.empty()) { - mwut::DebugPrintf(_T("Can't open image file: %s\n"), - mwut::Multi2Wide(imageFile).c_str()); + _pEct->PWorker()->EventLog((_T("Can't open image file: ") + + mwut::Multi2Wide(imageFile)).c_str()); ((BaseProcess*)_pEct->PWorker())->PostMsg(ECTMSG::SYSTEM_ERROR); return false; } diff --git a/ECTrainer2/Worker.cpp b/ECTrainer2/Worker.cpp index 0ab37fe..79f88db 100644 --- a/ECTrainer2/Worker.cpp +++ b/ECTrainer2/Worker.cpp @@ -156,7 +156,7 @@ switch (msg.message) { case (int)ECTMSG::SOFTWARE_START: // �\�t�g�E�F�A�N�� - this->EventLog(_T("Software Start")); + this->EventLog(_T("\nSoftware Start")); break; case (int)ECTMSG::SOFTWARE_END: // �\�t�g�E�F�A�I�� @@ -226,23 +226,6 @@ ((BaseProcess*)_pEct->PECTrainerGUI())->PostMsg(ECTMSG::MOVIE_STOP); break; - //case (int)ECTMSG::MOVIE_START: // ����Đ��J�n - // this->EventLog(_T("Movie Start")); - // break; - - //case (int)ECTMSG::MOVIE_STOP: // ����Đ���~ - // this->EventLog(_T("Movie Stopped")); - // break; - - //case (int)ECTMSG::MOVIE_END: // ����Đ��I�� - // this->EventLog(_T("Movie End")); - // ((BaseProcess*)_pEct->PStimulus())->PostMsg(ECTMSG::MOVIE_END); - // break; - - //case (int)ECTMSG::MOVIE_ERROR: // ����G���[ - // this->EventLog(_T("Movie Error")); - // break; - case (int)ECTMSG::FB_OK: // �t�B�[�h�o�b�N�FOK PlaySound(SOUND_OK, NULL, SND_FILENAME | SND_ASYNC); //this->EventLog(_T("Feedback OK")); diff --git a/ECTrainer2/Worker.h b/ECTrainer2/Worker.h index c92fe80..906f7d0 100644 --- a/ECTrainer2/Worker.h +++ b/ECTrainer2/Worker.h @@ -41,9 +41,6 @@ RingBuffer _FullScreenImage; // �S��ʗp�摜 int _FBLevel; // �t�B�[�h�o�b�N���x�� 1�`5 bool _IsInside; // �������^�[�Q�b�g�ɂ��邩 - - // �C�x���g���O�o�� - void EventLog(const TCHAR* msg); // ��{���� bool Routine(); // �C�x���g���� @@ -68,4 +65,6 @@ bool IsNewFullScreenImg() { return _FullScreenImage.IsNew(); } // �S��ʉ摜�擾 cv::Mat GetFullScreenImg() { return _FullScreenImage.Get(); } + // �C�x���g���O�o�� + void EventLog(const TCHAR* msg); };