コード例 #1
0
        public string StartAcquisition()
        {
            // RAZ des données précédentes
            LOG.DebugFormat("<<< StartAcquisition()");

            WiiBoardDatas.Clear();
            this.acquisitionStartedAt = DateTime.UtcNow;
            // Start acquisition
            var response = StartLowLevelAcquisition();

            AcquisitionActive = true;

            LOG.DebugFormat(">>> StartAcquisition() (OK)");
            return(response);
        }
コード例 #2
0
        private void WiimoteChanged(object sender, WiimoteChangedEventArgs e)
        {
            WiiBoardData singleDataPoint = dataMapper.MapFromWiiFormat(e.WiimoteState, this.acquisitionStartedAt);

            LOG.DebugFormat("Current value: topLeftKg={0}, topRightKg={1}, bottomLeftKg={2}, bottomRightKg={3}, weightKg={4}, gravity.X={5}, gravity.Y={6}, Horodate={7}, TIMESTAMP={8}", singleDataPoint.topLeftKg, singleDataPoint.topRightKg, singleDataPoint.bottomLeftKg, singleDataPoint.bottomRightKg, singleDataPoint.weightKg, singleDataPoint.gravity.X, singleDataPoint.gravity.Y, singleDataPoint.Horodate, singleDataPoint.TIMESTAMP);

            if (IsValidData(singleDataPoint))
            {
                WiiBoardDatas.Add(singleDataPoint);
                #if DEBUG
                LOG.DebugFormat("Wiimote callback from ID={0}: data was collected.", ((Wiimote)sender).ID);
                #endif
            }
            else
            {
                LOG.DebugFormat("Wiimote callback from ID={0}: no valid data.", ((Wiimote)sender).ID);
            }
        }
コード例 #3
0
        public string StopAcquisition(bool keepDatas)
        {
            LOG.DebugFormat("<<< StopAcquisition(): keepDatas={0}", keepDatas);
            string response;

            try
            {
                response = StopLowLevelAcquisition();
            }
            finally
            {
                if (!keepDatas)
                {
                    //RAZ des données acquises
                    WiiBoardDatas.Clear();
                }
                AcquisitionActive = false;
            }

            response = "Acquisition stopped";
            LOG.Debug(">>> StopAcquisition(bool) (OK)");
            return(response);
        }