<commit_before>// Angular Module

var hortalizeStatus = angular.module('hortalizeStatus', ['ngRoute','ngResource','ngCordova']);

hortalizeStatus.config(['$routeProvider', function($routeProvider) {
	$routeProvider.
		when('/chicorita', {templateUrl: 'home.html', controller: 'chicoritaController'}).
		otherwise({redirectTo: '/chicorita'});
}]);

// Angular Controllers

hortalizeStatus.controller('chicoritaController', function($scope, $log, $cordovaBluetoothSerial, $location){
	document.addEventListener('deviceready', function () {
		$cordovaBluetoothSerial.available().then(
			function (result) {
				$location.path('#/start');
				getInfo();
			},
			function (err) {
				$log.info('seu bluetooth está ligado?');
			}
		);
	}, false);

	function getInfo(){
		$cordovaBluetoothSerial.subscribe('\r').then(
			function (result) {
				$log.info(result);
				$scope.infoBt = result;
			},
			function (err) {
				$log.error('sem conexão com a Hortalize');
			}
		);
	}

	$scope.tab = 1;
	$scope.statsInfo = [
		{ id: 'temp', unit: 'ºC', info: '32', type: 'Temperatura'},
		{ id: 'level', unit: '%', info: '75', type: 'Umidade do Solo'}, 
	];
	$scope.humityLevel = [
		{ id: 'temp', unit: '%', info: '50'},
	];
	/*$scope.crops = [
		{ name: 'Alface', slug: 'alface'},
		{ name: 'Manjericão', slug: 'manjeiricao'},
		{ name: 'Morango', slug: 'morango'},
		{ name: 'Cebolinha', slug: 'cebolinha'},
		{ name: 'Tomate Cereja', slug: 'tomate-cereja'},
		{ name: 'Hortelã', slug: 'hortela'},
	];*/

	$('.js-add-crop').on('click', function (){
		$(this).addClass('adding');
		$('body').removeAttr('id');
		$('body').attr('id', 'cropList');
		$(this).off('click');
		$(this).removeClass('js-add-crop');
	});

	$('.crop-item').on('click', function(){
		var selectedCrop = $('.crop').attr('class');
		$('.adding').addClass(selectedCrop + " js-crop-info crop-info");
		$('body').attr('id', ' ');
		$('.adding').removeClass('adding');
	});
});<commit_msg>Split bluetooth info into array<commit_after>// Angular Module

var hortalizeStatus = angular.module('hortalizeStatus', ['ngRoute','ngResource','ngCordova']);

hortalizeStatus.config(['$routeProvider', function($routeProvider) {
	$routeProvider.
		when('/chicorita', {templateUrl: 'home.html', controller: 'chicoritaController'}).
		otherwise({redirectTo: '/chicorita'});
}]);

// Angular Controllers

hortalizeStatus.controller('chicoritaController', function($scope, $log, $cordovaBluetoothSerial, $location){
	/*document.addEventListener('deviceready', function () {
		$cordovaBluetoothSerial.isConnected(
		    function() {
		        getInfo();
		    },
		    function() {
		        console.log("Bluetooth is *not* connected");
		    }
		);
	}, false);

	function getInfo(){
		$cordovaBluetoothSerial.subscribe('\r').then(
			function (result) {
				$log.info(result);
				$scope.infoBt = result;
			},
			function (err) {
				$log.error('sem conexão com a Hortalize');
			}
		);
	}*/

	$scope.receivedBT = "75//76.00//19.00//90/n";
	$scope.splitBT = $scope.receivedBT.split("//");
	$scope.waterLevel = Math.round($scope.splitBT[0]);
	$scope.airHumidity = Math.round($scope.splitBT[1]);
	$scope.temperature = Math.round($scope.splitBT[2]);
	$scope.soilHumidity = Math.round($scope.splitBT[3].replace("/n", ""));
	console.log($scope.soilHumidity);

	$scope.tab = 1;
	$scope.statsInfo = [
		{ id: 'temp', unit: 'ºC', info: $scope.temperature, type: 'Temperatura'},
		{ id: 'level', unit: '%', info: $scope.waterLevel, type: 'Umidade do Solo'},
	];
	$scope.humityLevel = [
		{ id: 'temp', unit: '%', info: $scope.soilHumidity},
	];

	$('.js-add-crop').on('click', function (){
		$(this).addClass('adding');
		$('body').removeAttr('id');
		$('body').attr('id', 'cropList');
		$(this).off('click');
		$(this).removeClass('js-add-crop');
	});

	$('.crop-item').on('click', function(){
		var selectedCrop = $('.crop').attr('class');
		$('.adding').addClass(selectedCrop + " js-crop-info crop-info");
		$('body').attr('id', ' ');
		$('.adding').removeClass('adding');
	});
});
{'fraction_non_alphanumeric': 0.23090320975367007, 'fraction_numerical': 0.005971634735008708, 'mean_word_length': 4.560165975103734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6689685', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1428, 'n_words': 234}