コード例 #1
0
        public void CanReadITCClock()
        {
            HekkaDevice device;

            uint err = ITCMM.ITC_OpenDevice(ITCMM.USB18_ID, 0, ITCMM.SMART_MODE, out device);

            Assert.AreEqual(ITCMM.ACQ_SUCCESS,
                            err,
                            ErrorDescription.ErrorString(err)
                            );

            try
            {
                //ITCMM.HWFunction sHWFunction = new ITCMM.HWFunction();

                err = ITCMM.ITC_InitDevice(device, IntPtr.Zero); //ref sHWFunction);
                Assert.AreEqual(ITCMM.ACQ_SUCCESS,
                                err,
                                ErrorDescription.ErrorString(err)
                                );

                double t1;
                err = ITCMM.ITC_GetTime(device, out t1);
                Assert.AreEqual(ITCMM.ACQ_SUCCESS,
                                err,
                                ErrorDescription.ErrorString(err)
                                );

                double t2 = t1;
                err = ITCMM.ITC_GetTime(device, out t2);
                Assert.AreEqual(ITCMM.ACQ_SUCCESS,
                                err,
                                ErrorDescription.ErrorString(err)
                                );

                Assert.Greater(t2, t1);
            }
            finally
            {
                err = ITCMM.ITC_CloseDevice(device);
                Assert.AreEqual(ITCMM.ACQ_SUCCESS,
                                err,
                                ErrorDescription.ErrorString(err)
                                );
            }
        }