diff --git a/ECTrainer2/BaseProcess.cpp b/ECTrainer2/BaseProcess.cpp index e54bff3..d500023 100644 --- a/ECTrainer2/BaseProcess.cpp +++ b/ECTrainer2/BaseProcess.cpp @@ -24,10 +24,8 @@ // �X���b�h�{�� bool BaseProcess::MainLoop() { - if (_threadID == 0) { - _threadID = ::GetCurrentThreadId(); // ���C���X���b�hID�擾 - } - mwut::DebugPrintf(_T("Main thread id=%d\n"), ::GetCurrentThreadId()); + if (_threadID == 0) _threadID = ::GetCurrentThreadId(); // ���C���X���b�hID�擾 + mwut::DebugPrintf(_T("Thread %d start\n"), _threadID); // ���b�Z�[�W�L���[�̍쐬 MSG msg; @@ -79,3 +77,8 @@ else ::PostThreadMessage(_threadID, msgid, 0, 0); return true; } + +// �X���b�h�n���h����‚��� +void BaseProcess::CloseThread() { + CloseHandle(_threadHandle); +} diff --git a/ECTrainer2/BaseProcess.h b/ECTrainer2/BaseProcess.h index dcd3c0a..3fc3f86 100644 --- a/ECTrainer2/BaseProcess.h +++ b/ECTrainer2/BaseProcess.h @@ -34,4 +34,6 @@ bool WaitForExit(DWORD timeOut = 3000); // ���b�Z�[�W�𑗂� bool Tell(int msgid); + // �X���b�h�n���h����‚��� + void CloseThread(); }; diff --git a/ECTrainer2/BitalMonitor.cpp b/ECTrainer2/BitalMonitor.cpp index e323248..87e88df 100644 --- a/ECTrainer2/BitalMonitor.cpp +++ b/ECTrainer2/BitalMonitor.cpp @@ -43,7 +43,7 @@ // �o�C�^�� char comBuf[BUF_LEN] = { '\0' }; - DWORD readBytes = _Com.Receive((BYTE*)comBuf, BUF_LEN /2); + DWORD readBytes = _Com.Receive((BYTE*)comBuf, BUF_LEN / 2); // �O��̎c�蕶����ɒlj����邽�ߓǂݍ��ݗʂ�}������ if (readBytes > 0) { std::cout << "readBytes:" << readBytes << std::endl; comBuf[readBytes] = '\0'; diff --git a/ECTrainer2/ECTrainer.cpp b/ECTrainer2/ECTrainer.cpp index b4f6649..37f9760 100644 --- a/ECTrainer2/ECTrainer.cpp +++ b/ECTrainer2/ECTrainer.cpp @@ -11,27 +11,28 @@ #include "Worker.h" #include "KeepAlive.h" + // �R���X�g���N�^ ECTrainer::ECTrainer(HINSTANCE hInstance) : _AppRunning(true) , _hInstance(hInstance) { _pMarker = new Marker(); - _pProcs[GUI] = new ECTrainerGUI(this); - _pProcs[IMGPROC] = new ImageProc(this); - _pProcs[SCNCAM] = new SceneCamera(this); - _pProcs[STIM] = new Stimulus(this, _pMarker); - _pProcs[ALIVE] = new KeepAlive(this); - _pProcs[EYETR] = new EyeTrack(this); - _pProcs[REST] = new TobiiREST(this); - _pProcs[BITAL] = new BitalMonitor(this); - _pProcs[WORKER] = new Worker(this); + _pProcs[(int)PROC::GUI] = new ECTrainerGUI(this); + _pProcs[(int)PROC::IMGPROC] = new ImageProc(this); + _pProcs[(int)PROC::SCNCAM] = new SceneCamera(this); + _pProcs[(int)PROC::STIM] = new Stimulus(this, _pMarker); + _pProcs[(int)PROC::ALIVE] = new KeepAlive(this); + _pProcs[(int)PROC::EYETR] = new EyeTrack(this); + _pProcs[(int)PROC::REST] = new TobiiREST(this); + _pProcs[(int)PROC::BITAL] = new BitalMonitor(this); + _pProcs[(int)PROC::WORKER] = new Worker(this); _MovieToShow = _T(""); } // �f�X�g���N�^ ECTrainer::~ECTrainer() { - for (int i = 0; i < PROC::NUM; i++) { + for (int i = 0; i < (int)PROC::NUM; i++) { if (_pProcs[i]) delete _pProcs[i]; } } @@ -39,36 +40,21 @@ // ������ bool ECTrainer::Process() { // �v���Z�X������ - for (int i = 0; i < PROC::NUM; i++) { + for (int i = 0; i < (int)PROC::NUM; i++) { if (!_pProcs[i]->Init()) return false; } // �X���b�h�J�n - const int N_THREADS = PROC::NUM - 4; // GUI�̓��C���X���b�h�Ŏ��s����̂� -1 - DWORD thIds[N_THREADS]; - HANDLE thHandles[N_THREADS]; - for (int i = 0; i < N_THREADS; i++) { - thHandles[i] = CreateThread(NULL, 0, ThreadEntry, _pProcs[i+1], 0, &thIds[i]); - } - for (int i = BITAL; i < NUM; i++) { + for (int i = (int)PROC::REST; i < (int)PROC::NUM; i++) { if (!_pProcs[i]->Launch()) return false; } - _pProcs[GUI]->MainLoop(); - - for (int i = BITAL; i < NUM; i++) { - auto rv = _pProcs[i]->WaitForExit(); - mwut::DebugPrintf(_T("Process %d exit %s\n"), i, rv ? _T("ok") : _T("ng")); - } + _pProcs[(int)PROC::GUI]->MainLoop(); // �X���b�h�I�� - DWORD timeOut = 1000; // �^�C���A�E�g(ms) - if (WaitForMultipleObjects(N_THREADS, thHandles, TRUE, timeOut) != WAIT_TIMEOUT) { - OutputDebugString(_T("All threads stopped sccessfully.\n")); - } else { - OutputDebugString(_T("Waiting threads stop timeout.\n")); - } - for (int i = 0; i < N_THREADS; i++) { - if (thHandles[i]) CloseHandle(thHandles[i]); + for (int i = (int)PROC::REST; i < (int)PROC::NUM; i++) { + auto rv = _pProcs[i]->WaitForExit(); + mwut::DebugPrintf(_T("Process %d exit %s\n"), i, rv ? _T("ok") : _T("ng")); + _pProcs[i]->CloseThread(); } return true; @@ -77,7 +63,7 @@ // �A�v���P�[�V�������~ void ECTrainer::StopApp() { _AppRunning = false; - for (int i = 0; i < PROC::NUM; i++) _pProcs[i]->Tell(WM_QUIT); + for (int i = 0; i < (int)PROC::NUM; i++) _pProcs[i]->Tell(WM_QUIT); } // ���ʃX���b�h�J�n�_ diff --git a/ECTrainer2/ECTrainer.h b/ECTrainer2/ECTrainer.h index f0dadcb..de85bca 100644 --- a/ECTrainer2/ECTrainer.h +++ b/ECTrainer2/ECTrainer.h @@ -4,8 +4,8 @@ #include "myOpenCV.h" #define ADDR "192.168.71.50" -//#define EYEDEVICE_GLASS2 -#define EYEDEVICE_NONE +#define EYEDEVICE_GLASS2 +//#define EYEDEVICE_NONE class BaseProcess; class ECTrainerGUI; @@ -19,12 +19,18 @@ class KeepAlive; class Marker; +// ���b�Z�[�W�ꗗ +enum class EMSG { + CALIB_START = WM_USER, + CALIB_END, +}; + class ECTrainer { -private: - // �v���Z�X�ꗗ�i���������j GUI�擪, ALIVE -> EYETR - enum PROC { GUI, REST, IMGPROC, STIM, ALIVE, EYETR, BITAL, WORKER, SCNCAM, NUM }; - BaseProcess* _pProcs[PROC::NUM]; + // �v���Z�X�ꗗ�i���������j GUI�擪, SCNCAM->ALIVE->EYETR + enum class PROC { GUI, REST, IMGPROC, STIM, SCNCAM, ALIVE, EYETR, BITAL, WORKER, NUM }; + + BaseProcess* _pProcs[(int)PROC::NUM]; Marker* _pMarker; HINSTANCE _hInstance; bool _AppRunning; // ���s���t���O @@ -37,15 +43,15 @@ static const int RINGBUFSIZE = 4; ECTrainer(HINSTANCE hInstance); ~ECTrainer(); - ECTrainerGUI* PECTrainerGUI() { return (ECTrainerGUI*)_pProcs[GUI]; } - ImageProc* PImageProc() { return (ImageProc*)_pProcs[IMGPROC]; } - SceneCamera* PSceneCamera() { return (SceneCamera*)_pProcs[SCNCAM]; } - Stimulus* PStimulus() { return (Stimulus*)_pProcs[STIM]; } - KeepAlive* PKeepAlive() { return (KeepAlive*)_pProcs[ALIVE]; } - EyeTrack* PEyeTrack() { return (EyeTrack*)_pProcs[EYETR]; } - TobiiREST* PTobiiREST() { return (TobiiREST*)_pProcs[REST]; } - BitalMonitor* PBitalMonitor() { return (BitalMonitor*)_pProcs[BITAL]; } - Worker* PWorker() { return (Worker*)_pProcs[WORKER]; } + ECTrainerGUI* PECTrainerGUI() { return (ECTrainerGUI*)_pProcs[(int)PROC::GUI]; } + ImageProc* PImageProc() { return (ImageProc*)_pProcs[(int)PROC::IMGPROC]; } + SceneCamera* PSceneCamera() { return (SceneCamera*)_pProcs[(int)PROC::SCNCAM]; } + Stimulus* PStimulus() { return (Stimulus*)_pProcs[(int)PROC::STIM]; } + KeepAlive* PKeepAlive() { return (KeepAlive*)_pProcs[(int)PROC::ALIVE]; } + EyeTrack* PEyeTrack() { return (EyeTrack*)_pProcs[(int)PROC::EYETR]; } + TobiiREST* PTobiiREST() { return (TobiiREST*)_pProcs[(int)PROC::REST]; } + BitalMonitor* PBitalMonitor() { return (BitalMonitor*)_pProcs[(int)PROC::BITAL]; } + Worker* PWorker() { return (Worker*)_pProcs[(int)PROC::WORKER]; } Marker* PMarker() { return _pMarker; } bool Process(); diff --git a/ECTrainer2/ECTrainerGUI.cpp b/ECTrainer2/ECTrainerGUI.cpp index 1d8b86a..0e25392 100644 --- a/ECTrainer2/ECTrainerGUI.cpp +++ b/ECTrainer2/ECTrainerGUI.cpp @@ -177,7 +177,7 @@ } //cvui::printf("Mouse W %d, %d", mp.x, mp.y); //cvui::printf("Mouse L %.2f, %.2f", imagePos.x, imagePos.y); - cvui::printf("View Gaze %d, %d", _pEct->PEyeTrack()->GetGazeV().x, _pEct->PEyeTrack()->GetGazeV().y); + cvui::printf("View Gaze %.0f, %.0f", _pEct->PEyeTrack()->GetGazeV().x, _pEct->PEyeTrack()->GetGazeV().y); //cvui::printf("Img Gaze %.2f, %.2f", _pEct->GetGazeI().x, _pEct->GetGazeI().y); cvui::text(_pEct->PMarker()->IsDetected() ? "AR Markers OK" : "AR Markers NG"); cvui::printf("Battery %d %%", _pEct->PTobiiREST()->GetBatteryLevel()); diff --git a/ECTrainer2/EyeTrack.cpp b/ECTrainer2/EyeTrack.cpp index eac6c48..715ecb0 100644 --- a/ECTrainer2/EyeTrack.cpp +++ b/ECTrainer2/EyeTrack.cpp @@ -1,7 +1,6 @@ #include #include #include "common.h" -#include "MeanBuffer.h" #pragma comment(lib, "ws2_32.lib") #include @@ -10,61 +9,57 @@ EyeTrack::EyeTrack(ECTrainer* pEct) : BaseProcess(pEct) , _GazeV(ECTrainer::RINGBUFSIZE) + , _lastGidx(0) + , _gazePoint(cv::Point2f(-1.F, -1.F)) + , _gpCx(MEAN_BUF_SIZE) + , _gpCy(MEAN_BUF_SIZE) { } // ���C�����[�v -bool EyeTrack::MainLoop() { +bool EyeTrack::Routine() { #if defined(EYEDEVICE_GLASS2) + // �ŏ���KeepAlive���M�҂� + if (!_pEct->PKeepAlive()->IsSent()) { + Sleep(1); + return true; + } + + // �f�[�^��M int slen = _pEct->PKeepAlive()->GetSocketAddrLen(); char buf[KeepAlive::SOCKET_BUF_LEN]; - int lastGidx = 0; - cv::Point2f gazePoint; - cv::Size sceneSize = _pEct->PSceneCamera()->GetSize(); - //std::cout << "sceneSize: " << sceneSize.width << "," << sceneSize.height << std::endl; - MeanBuffer gpCx(MEAN_BUF_SIZE), gpCy(MEAN_BUF_SIZE); - - while (!_pEct->PKeepAlive()->IsSent()) Sleep(1); // �ŏ���KeepAlive���M�҂� - - while (_pEct->IsAppRun()) { - - // �f�[�^��M - memset(buf, '\0', KeepAlive::SOCKET_BUF_LEN); - if (recvfrom(_pEct->PKeepAlive()->GetSocket(), buf, KeepAlive::SOCKET_BUF_LEN, - 0, _pEct->PKeepAlive()->GetSocketAddr(), &slen) == SOCKET_ERROR) - { - std::cerr << "Data Receive Error" << std::endl; - Sleep(10); - continue; - } - //std::cout << buf << std::endl; - - // ��M�f�[�^��� - GazeData gd(buf); - if (gd.gidx > lastGidx) { - if (gazePoint.x > 0 && gazePoint.y > 0) { - gpCx.Push(gazePoint.x * sceneSize.width); - gpCy.Push(gazePoint.y * sceneSize.height); - _GazeV.Put(cv::Point2f(gpCx.Mean(), gpCy.Mean())); - } - else { - _GazeV.Put(gazePoint); - } - - gazePoint = cv::Point2f(-1.F, -1.F); - lastGidx = gd.gidx; - } - if (gd.isGP && gd.s == 0) { - gazePoint = gd.gp; - } - if (gd.isPDR && gd.s == 0) _pupilD.r = gd.pdr; - } -#elif defined(EYEDEVICE_NONE) - while (_pEct->IsAppRun()) { - _GazeV.Put(cv::Point2f(-1.F, -1.F)); + memset(buf, '\0', KeepAlive::SOCKET_BUF_LEN); + if (recvfrom(_pEct->PKeepAlive()->GetSocket(), buf, KeepAlive::SOCKET_BUF_LEN, + 0, _pEct->PKeepAlive()->GetSocketAddr(), &slen) == SOCKET_ERROR) { + std::cerr << "Data Receive Error" << std::endl; Sleep(10); + return true; +} + //std::cout << buf << std::endl; + + // ��M�f�[�^��� + GazeData gd(buf); + if (gd.gidx > _lastGidx) { + if (_gazePoint.x > 0 && _gazePoint.y > 0) { + _gpCx.Push(_gazePoint.x * _pEct->PSceneCamera()->GetSize().width); + _gpCy.Push(_gazePoint.y * _pEct->PSceneCamera()->GetSize().height); + _GazeV.Put(cv::Point2f(_gpCx.Mean(), _gpCy.Mean())); + } else { + _GazeV.Put(_gazePoint); + } + + _gazePoint = cv::Point2f(-1.F, -1.F); + _lastGidx = gd.gidx; } + if (gd.isGP && gd.s == 0) { + _gazePoint = gd.gp; + } + if (gd.isPDR && gd.s == 0) _pupilD.r = gd.pdr; + +#elif defined(EYEDEVICE_NONE) + _GazeV.Put(cv::Point2f(-1.F, -1.F)); + Sleep(10); #endif return true; diff --git a/ECTrainer2/EyeTrack.h b/ECTrainer2/EyeTrack.h index 0257751..468df8e 100644 --- a/ECTrainer2/EyeTrack.h +++ b/ECTrainer2/EyeTrack.h @@ -3,6 +3,7 @@ #include "BaseProcess.h" #include "myOpenCV.h" #include "RingBuffer.h" +#include "MeanBuffer.h" // LR�e���v���[�g template @@ -18,12 +19,15 @@ RingBuffer _GazeV; // ����摜���̒����_���W LR _pupilD; + int _lastGidx; // �O��̃f�[�^�C���f�b�N�X + cv::Point2f _gazePoint; + MeanBuffer _gpCx, _gpCy; // �ړ����σo�b�t�@ public: // �R���X�g���N�^ EyeTrack(ECTrainer* pEct); // ���C�����[�v - bool MainLoop(); + bool Routine(); // �����_�̍X�V�� bool IsNewGazeV() { return _GazeV.IsNew(); } // �����_���擾 diff --git a/ECTrainer2/ImageProc.cpp b/ECTrainer2/ImageProc.cpp index 23b45b9..5bc7fc4 100644 --- a/ECTrainer2/ImageProc.cpp +++ b/ECTrainer2/ImageProc.cpp @@ -11,14 +11,15 @@ } // ���[�v -bool ImageProc::MainLoop() { - while (_pEct->IsAppRun()) { - Sleep(0); - if (!_pEct->PSceneCamera()->IsNew()) continue; - cv::Mat img = _pEct->PSceneCamera()->GetImage().clone(); - _pEct->PMarker()->Detect(img); - _OutputBuf.Put(img); - } +bool ImageProc::Routine() { + + // �V�[���J�����̃t���[���X�V�҂� + Sleep(0); + if (!_pEct->PSceneCamera()->IsNew()) return true; + + cv::Mat img = _pEct->PSceneCamera()->GetImage().clone(); + _pEct->PMarker()->Detect(img); + _OutputBuf.Put(img); return true; } diff --git a/ECTrainer2/ImageProc.h b/ECTrainer2/ImageProc.h index a47f406..a055359 100644 --- a/ECTrainer2/ImageProc.h +++ b/ECTrainer2/ImageProc.h @@ -12,7 +12,7 @@ public: ImageProc(ECTrainer* pEct); - bool MainLoop(); + bool Routine(); // �o�̓o�b�t�@������o�� cv::Mat GetImage() { return _OutputBuf.Get(); } }; diff --git a/ECTrainer2/KeepAlive.cpp b/ECTrainer2/KeepAlive.cpp index 0956983..c109b2d 100644 --- a/ECTrainer2/KeepAlive.cpp +++ b/ECTrainer2/KeepAlive.cpp @@ -8,7 +8,8 @@ KeepAlive::KeepAlive(ECTrainer* pEct) : BaseProcess(pEct) , _sent(false) - , _socket(NULL) { + , _socket(NULL) + , _count(0) { _socketAddrLen = sizeof(_socketAddr); memset((char*)&_socketAddr, 0, _socketAddrLen); } @@ -40,23 +41,20 @@ } // ���C�����[�v -bool KeepAlive::MainLoop() { +bool KeepAlive::Routine() { #if defined(EYEDEVICE_GLASS2) const std::string KA_DATA_MSG = "{\"type\": \"live.data.unicast\", \"key\": \"some_GUID\", \"op\": \"start\"}"; char message[SOCKET_BUF_LEN]; strcpy_s(message, SOCKET_BUF_LEN, KA_DATA_MSG.c_str()); - int count = 0; - while (_pEct->IsAppRun()) { - Sleep(100); - if (++count < KEEP_ALIVE_WAIT_COUNT) continue; - count = 0; - if (sendto(_socket, message, (int)strlen(message), 0, - (struct sockaddr*)&_socketAddr, _socketAddrLen) == SOCKET_ERROR) { - std::cerr << "Keep Alive Data Sent Error" << std::endl; - } else { - _sent = true; - } + Sleep(100); + if (++_count < KEEP_ALIVE_WAIT_COUNT) return true; + _count = 0; + if (sendto(_socket, message, (int)strlen(message), 0, + (struct sockaddr*)&_socketAddr, _socketAddrLen) == SOCKET_ERROR) { + std::cerr << "Keep Alive Data Sent Error" << std::endl; + } else { + _sent = true; } #endif diff --git a/ECTrainer2/KeepAlive.h b/ECTrainer2/KeepAlive.h index 0d86ad7..5f99371 100644 --- a/ECTrainer2/KeepAlive.h +++ b/ECTrainer2/KeepAlive.h @@ -10,6 +10,7 @@ struct sockaddr_in _socketAddr; // �ڑ���A�h���X bool _sent; // �V�O�i�����M��� true: ���M�� false: �����M int _socketAddrLen; // �A�h���X���̃T�C�Y + int _count; // ���[�v�J�E���g public: static const int SOCKET_BUF_LEN = 512; // Socket�ʐM�o�b�t�@�T�C�Y @@ -19,7 +20,7 @@ // ������ bool Init(); // ���C�����[�v - bool MainLoop(); + bool Routine(); // �V�O�i�����M��Ԏ擾 bool IsSent() { return _sent; }; // �\�P�b�g�擾 diff --git a/ECTrainer2/Stimulus.cpp b/ECTrainer2/Stimulus.cpp index b12a74d..7000490 100644 --- a/ECTrainer2/Stimulus.cpp +++ b/ECTrainer2/Stimulus.cpp @@ -33,25 +33,23 @@ } // ���[�v -bool Stimulus::MainLoop() { +bool Stimulus::Routine() { - while (_pEct->IsAppRun()) { - if (_StimNo >= 0) { - DWORD current = GetTickCount(); - if ((float)(current - _StartTime) / 1000.F > _StimInfoSet[_StimNo].dulation) { - if (_StimInfoSet[_StimNo].type == 2) { - SetPage(STIM_PAGE::WHITE); - _pEct->SetMovieToShow(L"STOP"); - } - if (++_StimNo < _StimInfoSet.size()) { - SetStimulus(); - } else { - SetPage(STIM_PAGE::STOP); - } + if (_StimNo >= 0) { + DWORD current = GetTickCount(); + if ((float)(current - _StartTime) / 1000.F > _StimInfoSet[_StimNo].dulation) { + if (_StimInfoSet[_StimNo].type == 2) { + SetPage(STIM_PAGE::WHITE); + _pEct->SetMovieToShow(L"STOP"); + } + if (++_StimNo < _StimInfoSet.size()) { + SetStimulus(); + } else { + SetPage(STIM_PAGE::STOP); } } - Sleep(30); } + Sleep(30); return true; } diff --git a/ECTrainer2/Stimulus.h b/ECTrainer2/Stimulus.h index d60c95a..db41dba 100644 --- a/ECTrainer2/Stimulus.h +++ b/ECTrainer2/Stimulus.h @@ -45,7 +45,7 @@ public: Stimulus(ECTrainer* pEct, Marker* pMarker); bool Init(); - bool MainLoop(); + bool Routine(); void SetPage(STIM_PAGE st); //cv::Point2f GetEyeR() { return _StimImages[_StimNo].eyes[0]; } //cv::Point2f GetEyeL() { return _StimImages[_StimNo].eyes[1]; } diff --git a/ECTrainer2/TobiiREST.cpp b/ECTrainer2/TobiiREST.cpp index 8c989b4..37e2000 100644 --- a/ECTrainer2/TobiiREST.cpp +++ b/ECTrainer2/TobiiREST.cpp @@ -8,7 +8,9 @@ :BaseProcess(pEct) , _CalibTrigger(false) , _CalibStatus(CALIB_STATUS::NONE) - , _BatteryLevel(999) { + , _BatteryLevel(999) + , _lastBatteryQuery(0) +{ } @@ -45,27 +47,25 @@ } // ���[�v -bool TobiiREST::MainLoop() { - DWORD lastBatteryQuery = 0; - while (_pEct->IsAppRun()) { +bool TobiiREST::Routine() { - // �L�����u���[�V���� - if (_CalibTrigger) { - _CalibTrigger = false; - if (StartCalib()) { - QueryCalibResult(); - } + // �L�����u���[�V���� + if (_CalibTrigger) { + _CalibTrigger = false; + if (StartCalib()) { + QueryCalibResult(); } - - // �o�b�e���[���擾 - DWORD cTime = timeGetTime(); - if (cTime - lastBatteryQuery > BATTERY_QUERY_INTERVAL) { - lastBatteryQuery = cTime; - QueryBatteryLevel(); - } - - Sleep(1); } + + // �o�b�e���[���擾 + DWORD cTime = timeGetTime(); + if (cTime - _lastBatteryQuery > BATTERY_QUERY_INTERVAL) { + _lastBatteryQuery = cTime; + QueryBatteryLevel(); + } + + Sleep(1); + return true; } diff --git a/ECTrainer2/TobiiREST.h b/ECTrainer2/TobiiREST.h index 5ce53d1..6463675 100644 --- a/ECTrainer2/TobiiREST.h +++ b/ECTrainer2/TobiiREST.h @@ -17,6 +17,8 @@ bool _CalibTrigger; CALIB_STATUS _CalibStatus; int _BatteryLevel; // ���ڑ��� 999 + DWORD _lastBatteryQuery; // �O��̃o�b�e���[���擾���� + bool StartCalib(); bool QueryCalibResult(); @@ -26,7 +28,7 @@ TobiiREST(ECTrainer* pEct); bool Init(); - bool MainLoop(); + bool Routine(); void StartCalibration() { _CalibStatus = CALIB_STATUS::NONE; _CalibTrigger = true; }; int GetBatteryLevel() { return _BatteryLevel; }; CALIB_STATUS GetCalibStatus() { return _CalibStatus; }