diff --git a/ECTrainer2/ECTrainer.h b/ECTrainer2/ECTrainer.h index 5a6aa9f..668602f 100644 --- a/ECTrainer2/ECTrainer.h +++ b/ECTrainer2/ECTrainer.h @@ -6,8 +6,8 @@ #define TOBII_ADDR "192.168.71.50" //#define TOBII_ADDR "192.168.23.156" -//#define EYEDEVICE_GLASS2 -#define EYEDEVICE_NONE +#define EYEDEVICE_GLASS2 +//#define EYEDEVICE_NONE class BaseProcess; class ECTrainerGUI; diff --git a/ECTrainer2/EyeTrack.cpp b/ECTrainer2/EyeTrack.cpp index bc3b290..2cb15a6 100644 --- a/ECTrainer2/EyeTrack.cpp +++ b/ECTrainer2/EyeTrack.cpp @@ -25,17 +25,17 @@ #if defined(EYEDEVICE_GLASS2) // 最初のKeepAlive送信待ち - if (!_pEct->PKeepAlive()->IsSent()) { + if (!Ect()->PKeepAlive()->IsSent()) { Sleep(1); return true; } // データ受信 - int slen = _pEct->PKeepAlive()->GetSocketAddrLen(); + int slen = Ect()->PKeepAlive()->GetSocketAddrLen(); char buf[KeepAlive::SOCKET_BUF_LEN]; memset(buf, '\0', KeepAlive::SOCKET_BUF_LEN); - if (recvfrom(_pEct->PKeepAlive()->GetSocket(), buf, KeepAlive::SOCKET_BUF_LEN, - 0, _pEct->PKeepAlive()->GetSocketAddr(), &slen) == SOCKET_ERROR) { + if (recvfrom(Ect()->PKeepAlive()->GetSocket(), buf, KeepAlive::SOCKET_BUF_LEN, + 0, Ect()->PKeepAlive()->GetSocketAddr(), &slen) == SOCKET_ERROR) { std::cerr << "Data Receive Error" << std::endl; Sleep(10); return true; @@ -47,8 +47,8 @@ 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); + _gpCx.Push(_gazePoint.x * Ect()->PSceneCamera()->GetSize().width); + _gpCy.Push(_gazePoint.y * Ect()->PSceneCamera()->GetSize().height); _GazeV.Put(cv::Point2f(_gpCx.Mean(), _gpCy.Mean())); } else { _GazeV.Put(_gazePoint); diff --git a/ECTrainer2/TobiiREST.cpp b/ECTrainer2/TobiiREST.cpp index d76eb1f..bffeeb3 100644 --- a/ECTrainer2/TobiiREST.cpp +++ b/ECTrainer2/TobiiREST.cpp @@ -19,14 +19,14 @@ // Project ID取得 json::value json = REST_Handler::POST_Request(SERVER _T("/api/projects")).extract_json().get(); _ProjectID = json[_T("pr_id")].as_string(); - mwut::DebugPrintf(_T("Tobii Project ID : %s\n"), _ProjectID.c_str()); + nkc::wut::DebugPrintf(_T("Tobii Project ID : %s\n"), _ProjectID.c_str()); // Participant ID取得 json::value postData; postData[L"pa_project"] = json::value::string(_ProjectID); json = REST_Handler::POST_Request(SERVER _T("/api/participants"), postData).extract_json().get(); _ParticipantID = json[_T("pa_id")].as_string(); - mwut::DebugPrintf(_T("Tobii Prarticipant ID : %s\n"), _ParticipantID.c_str()); + nkc::wut::DebugPrintf(_T("Tobii Prarticipant ID : %s\n"), _ParticipantID.c_str()); #endif return true; @@ -81,12 +81,12 @@ postData[L"ca_participant"] = json::value::string(_ParticipantID); json::value json = REST_Handler::POST_Request(SERVER _T("/api/calibrations"), postData).extract_json().get(); _CalibrationID = json[_T("ca_id")].as_string(); - mwut::DebugPrintf(_T("Tobii Calibration ID : %s\n"), _CalibrationID.c_str()); + nkc::wut::DebugPrintf(_T("Tobii Calibration ID : %s\n"), _CalibrationID.c_str()); // Calibration開始 std::wstring url = SERVER _T("/api/calibrations/") + _CalibrationID + _T("/start"); json = REST_Handler::POST_Request(url.c_str()).extract_json().get(); - mwut::DebugPrintf(_T("Calibration start\n")); + nkc::wut::DebugPrintf(_T("Calibration start\n")); #endif return true; }