Exemplo n.º 1
0
        public DataTools(IDataFromFile data)
        {
            _dat = data;
            acc  = _dat.GetDataFromFile().Accelerometer;

            for (int i = 0; i < 100; i++)
            {
                Console.WriteLine(acc[i].stamp.ToString());
            }
            gyro = _dat.GetDataFromFile().Gyroscope;

            var accCopy  = new List <Accelerometer>(acc.ToList());
            var gyroCopy = new List <Gyroscope>(gyro.ToList());

            acc  = accCopy;
            gyro = gyroCopy;

            var acF = acc.First().stamp;
            var acL = acF;

            foreach (var b in acc)
            {
                if (b.stamp > acL)
                {
                    acL = b.stamp;
                }
            }

            currentTimeAcc = currentTimeGyro = acF;
            var fs = "";

            //for (int i = 0; i < 900; i++)       Console.WriteLine(gyroCopy[i].x + ";" + gyroCopy[i].y + ";" + gyroCopy[i].z);
        }
Exemplo n.º 2
0
 public AnalysisController(AnalysisService _service, IDataFromFile dataFromFile, DataTools model
                           , SequentialDataTools sTools, FallDetection d)
 {
     this._service = _service;
     _dataFromFile = dataFromFile;
     _model        = model;
     _sTools       = sTools;
     _d            = d;
 }
Exemplo n.º 3
0
        public SequentialDataTools(IDataFromFile dat)
        {
            _dat = dat;
            var model = _dat.GetDataFromFile();

            _acc  = model.Accelerometer.ToList();
            _gyro = model.Gyroscope.ToList();
            this.initSequence();
            //AccInternalCounter = 1000; //To make a fall happen pretty quickly
        }