Exemple #1
0
        /// <summary>
        /// get latest collected data, doesnt remove it from ringbuffer
        /// </summary>
        /// <param name="num_samples"></param>
        /// <returns>latest collected data, can be less than "num_samples"</returns>
        public double[,] get_current_board_data (int num_samples)
        {
            int num_rows = BoardShim.get_num_rows (master_board_id); 
            double[] data_arr = new double[num_samples * num_rows];
            int[] current_size = new int[1];
            int ec = BoardControllerLibrary.get_current_board_data (num_samples, data_arr, current_size, board_id, input_json);
		    if (ec != (int) CustomExitCodes.STATUS_OK) {
			    throw new BrainFlowException (ec);
            }
            double[,] result = new double[num_rows, current_size[0]];
            for (int i = 0; i < num_rows; i++)
            {
                for (int j = 0; j < current_size[0]; j++)
                {
                    result[i, j] = data_arr[i * current_size[0] + j];
                }
            }
            return result;
	    }