diff --git a/ECTrainer2/BitalMonitor.cpp b/ECTrainer2/BitalMonitor.cpp index 2bb7e9a..1b4591e 100644 --- a/ECTrainer2/BitalMonitor.cpp +++ b/ECTrainer2/BitalMonitor.cpp @@ -5,11 +5,12 @@ // �R���X�g���N�^ BitalMonitor::BitalMonitor(ECTrainer* pEct) :BaseProcess(pEct) - , _rrInterval(ECTrainer::RINGBUFSIZE, 0) + , _rrInterval() , _useDevice(false) , _lastRR(0) { ::ZeroMemory(lastBuf, BUF_LEN); + _rrInterval.Put(0); } // ������ diff --git a/ECTrainer2/ECTrainer.h b/ECTrainer2/ECTrainer.h index ba3cc77..8dccd8e 100644 --- a/ECTrainer2/ECTrainer.h +++ b/ECTrainer2/ECTrainer.h @@ -59,7 +59,6 @@ HINSTANCE _hInstance; public: - static const int RINGBUFSIZE = 4; ECTrainer(HINSTANCE hInstance); ~ECTrainer(); ECTrainerGUI* PECTrainerGUI() { return (ECTrainerGUI*)_pProcs[(int)PROC::GUI]; } diff --git a/ECTrainer2/ECTrainerGUI.cpp b/ECTrainer2/ECTrainerGUI.cpp index cea1cf5..a763dd2 100644 --- a/ECTrainer2/ECTrainerGUI.cpp +++ b/ECTrainer2/ECTrainerGUI.cpp @@ -21,7 +21,6 @@ , _DispImageHeight(0) , _SceneBufferScale(1.F) , _hWndMain(NULL) - //, _AppRunning(true) , _dsm(NULL) { _dsm = new DShowMovie(); diff --git a/ECTrainer2/ECTrainerGUI.h b/ECTrainer2/ECTrainerGUI.h index 1a35a23..4fc0c96 100644 --- a/ECTrainer2/ECTrainerGUI.h +++ b/ECTrainer2/ECTrainerGUI.h @@ -13,12 +13,11 @@ const cv::String WIN_DISP = "ECTrainer Display"; const cv::String WIN_MAIN = "Eye Contact Trainer"; const cv::String SNAPSHOT_FILE = "snapshot.jpg"; - const cv::Size MAIN_FRAME_SIZE = cv::Size(1480, 620); - const int IMAGE_WIDTH = 640; - const cv::Size DISP_SIZE = cv::Size(IMAGE_WIDTH, 480); - const cv::Point SCENE_BUFFER_POS = cv::Point(170, 120); - const cv::Point DISP_IMAGE_POS = cv::Point(820, 120); - const int KEY_ESC = 27; + 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 + const cv::Point DISP_IMAGE_POS = cv::Point(820, 120); // �h���摜�\���ӎv + const int IMAGE_WIDTH = 640; // ���C���E�C���h�E�ɕ\������摜�� + const cv::Size DISP_SIZE = cv::Size(IMAGE_WIDTH, 480); // ���C���E�C���h�E�ɕ\������摜�T�C�Y DShowMovie* _dsm; cv::Mat _MainFrame; // ���C���E�C���h�E�t���[�� @@ -28,7 +27,7 @@ int _SceneBufferHeight; float _SceneBufferScale; int _DispImageHeight; - HWND _hWndMain; + HWND _hWndMain; // ���C���E�C���h�E�̃n���h�� // ��{���� bool Routine(); diff --git a/ECTrainer2/EyeTrack.cpp b/ECTrainer2/EyeTrack.cpp index ff4669a..9181d09 100644 --- a/ECTrainer2/EyeTrack.cpp +++ b/ECTrainer2/EyeTrack.cpp @@ -9,9 +9,8 @@ #include // �R���X�g���N�^ -EyeTrack::EyeTrack(ECTrainer* pEct) - : BaseProcess(pEct) - , _GazeV(ECTrainer::RINGBUFSIZE) +EyeTrack::EyeTrack(ECTrainer* pEct) : BaseProcess(pEct) + , _GazeV() , _lastGidx(0) , _gazePoint(cv::Point2f(-1.F, -1.F)) , _gpCx(MEAN_BUF_SIZE) diff --git a/ECTrainer2/ImageProc.cpp b/ECTrainer2/ImageProc.cpp index 5bc7fc4..5fe461a 100644 --- a/ECTrainer2/ImageProc.cpp +++ b/ECTrainer2/ImageProc.cpp @@ -5,9 +5,8 @@ #include "Marker.h" // �R���X�g���N�^ -ImageProc::ImageProc(ECTrainer* pEct) - : BaseProcess(pEct) - , _OutputBuf(ECTrainer::RINGBUFSIZE) { +ImageProc::ImageProc(ECTrainer* pEct) : BaseProcess(pEct) + , _OutputBuf() { } // ���[�v diff --git a/ECTrainer2/KeepAlive.cpp b/ECTrainer2/KeepAlive.cpp index d3f79bc..d64551d 100644 --- a/ECTrainer2/KeepAlive.cpp +++ b/ECTrainer2/KeepAlive.cpp @@ -6,8 +6,7 @@ #include "myWinUtils.h" // �R���X�g���N�^ -KeepAlive::KeepAlive(ECTrainer* pEct) - : BaseProcess(pEct) +KeepAlive::KeepAlive(ECTrainer* pEct) : BaseProcess(pEct) , _sent(false) , _socket(NULL) , _count(0) { diff --git a/ECTrainer2/Marker.cpp b/ECTrainer2/Marker.cpp index b85c106..daa4983 100644 --- a/ECTrainer2/Marker.cpp +++ b/ECTrainer2/Marker.cpp @@ -6,10 +6,11 @@ // �R���X�g���N�^ Marker::Marker() : _detected(false) - , _HomographyV2I(ECTrainer::RINGBUFSIZE, cv::Mat::zeros(3, 3, CV_64F)) + , _HomographyV2I() { _Dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_4X4_50); CalcMarkerCorners(IMGSIZE); + _HomographyV2I.Put(cv::Mat::zeros(3, 3, CV_64F)); } // �}�[�J�[���W�̌v�Z diff --git a/ECTrainer2/RingBuffer.h b/ECTrainer2/RingBuffer.h index 3b730f1..29acccf 100644 --- a/ECTrainer2/RingBuffer.h +++ b/ECTrainer2/RingBuffer.h @@ -5,6 +5,7 @@ template class RingBuffer { + static const int DEEFAULT_SIZE = 4; T* _data; std::mutex* _mtxData; std::mutex _mtxIndex; @@ -13,7 +14,7 @@ int _read; bool _update; public: - RingBuffer(int size); + RingBuffer(int size = DEEFAULT_SIZE); RingBuffer(int size, T initial); ~RingBuffer(); void Put(T value); diff --git a/ECTrainer2/SceneCamera.cpp b/ECTrainer2/SceneCamera.cpp index c26e875..819e948 100644 --- a/ECTrainer2/SceneCamera.cpp +++ b/ECTrainer2/SceneCamera.cpp @@ -8,9 +8,9 @@ #include "MyWinUtils.h" // �R���X�g���N�^ -SceneCamera::SceneCamera(ECTrainer* pEct) - : BaseProcess(pEct) - , _buffer(ECTrainer::RINGBUFSIZE) { +SceneCamera::SceneCamera(ECTrainer* pEct) : BaseProcess(pEct) + , _buffer() +{ } // ������ diff --git a/ECTrainer2/Stimulus.cpp b/ECTrainer2/Stimulus.cpp index 04d9adc..284659c 100644 --- a/ECTrainer2/Stimulus.cpp +++ b/ECTrainer2/Stimulus.cpp @@ -6,8 +6,8 @@ Stimulus::Stimulus(ECTrainer* pEct) : BaseProcess(pEct) , _StimNo(-1) , _pMovieObject(NULL) - , _Display(ECTrainer::RINGBUFSIZE) - , _Movie(ECTrainer::RINGBUFSIZE) + , _Display() + , _Movie() { _pMovieObject = new MovieObject; _Movie.Put(L"STOP"); @@ -32,7 +32,7 @@ StimInfo st; st.type = atoi(table[r][0].c_str()); st.filepath = table[r][1]; - int idx = st.filepath.find_last_of("/\\"); + int idx = (int)st.filepath.find_last_of("/\\"); st.filename = idx == std::string::npos ? st.filepath : st.filepath.substr(idx + 1); st.dulation = (float)atof(table[r][2].c_str()); st.csvfile = table[r][3]; diff --git a/ECTrainer2/TobiiREST.cpp b/ECTrainer2/TobiiREST.cpp index 78a028f..fe05a63 100644 --- a/ECTrainer2/TobiiREST.cpp +++ b/ECTrainer2/TobiiREST.cpp @@ -4,13 +4,10 @@ #include "myWinUtils.h" // �R���X�g���N�^ -TobiiREST::TobiiREST(ECTrainer* pEct) - :BaseProcess(pEct) - //, _CalibTrigger(false) +TobiiREST::TobiiREST(ECTrainer* pEct) : BaseProcess(pEct) , _BatteryLevel(999) , _lastBatteryQuery(0) { - } // ������ diff --git a/ECTrainer2/Worker.cpp b/ECTrainer2/Worker.cpp index ec22e75..b374648 100644 --- a/ECTrainer2/Worker.cpp +++ b/ECTrainer2/Worker.cpp @@ -15,7 +15,7 @@ , _fpLogEvent(NULL) , _pExpTimer(NULL) , _pContactTimer(NULL) - , _TargetImage(ECTrainer::RINGBUFSIZE) + , _TargetImage() { _pExpTimer = new mwut::HPTimer(); _pContactTimer = new mwut::HPTimer();