-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f495866
commit b03aee6
Showing
31 changed files
with
595 additions
and
826 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
Proyecto/Proyecto-FrontEnd/app/src/modules/areas/areas.ctrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
(function ( ng ) { | ||
let mod = ng.module( 'areaModule' ); | ||
|
||
mod.controller( 'areasCtrl', [ '$scope', '$stateParams', 'AuthService', 'SessionService', '$http', 'urlBack', '$state', | ||
function ( $scope, $stateParams, AuthService, SessionService, $http, urlBack, $state ) { | ||
AuthService.checkUser( $scope.$parent.user ) | ||
.then( function ( response ) { | ||
$http( { | ||
method: 'GET', | ||
url: urlBack + '/areas/' + $stateParams.idArea, | ||
headers: { | ||
'user': SessionService.user.login, | ||
'token': SessionService.user.token | ||
} | ||
} ) | ||
.then( function ( response ) { | ||
$scope.area = response.data; | ||
$scope.microcontroladores = $scope.area.microcontroladores; | ||
|
||
const maxInRow = 10; | ||
let row = -1; | ||
let temp = []; | ||
$scope.microcontroladores.forEach( function ( item, index ) { | ||
if ( index % maxInRow === 0 ) { | ||
row++; | ||
} | ||
let nuevo = { | ||
id: item.id, | ||
sensores: item.sensores, | ||
x: row, | ||
y: index % maxInRow, | ||
value: 10, //TODO | ||
'hc-a2': 'MicronControlador ' + item.id | ||
}; | ||
temp.push( nuevo ); | ||
} ); | ||
|
||
$scope.microcontroladores = temp; | ||
let info = { | ||
chart: { | ||
type: 'tilemap', | ||
inverted: true, | ||
// height: '50%', | ||
}, | ||
title: { | ||
text: 'Niveles Del Sistema' | ||
}, | ||
xAxis: { | ||
visible: false | ||
}, | ||
yAxis: { | ||
visible: false | ||
}, | ||
colorAxis: { | ||
dataClasses: [ { | ||
from: 0, | ||
to: 50, | ||
color: '#F9EDB3', | ||
name: '< 50' | ||
}, { | ||
from: 51, | ||
to: 100, | ||
color: '#FFC428', | ||
name: '50 - 100' | ||
}, { | ||
from: 101, | ||
color: '#FF7987', | ||
name: '> 100' | ||
} ] | ||
}, | ||
tooltip: { | ||
headerFormat: '', | ||
pointFormat: 'The population of <b> {point.name}</b> is <b>{point.value}</b>' | ||
}, | ||
plotOptions: { | ||
series: { | ||
dataLabels: { | ||
enabled: true, | ||
format: '{point.hc-a2}', | ||
color: '#000000', | ||
style: { | ||
textOutline: false | ||
} | ||
}, | ||
point: { | ||
events: { | ||
click: function () { | ||
$scope.seeMC( this.id ); | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
series: [ { | ||
name: '', | ||
data: $scope.microcontroladores | ||
} ] | ||
}; | ||
Highcharts.chart( 'containerMicrocontrolador', info ); | ||
} ); | ||
} ); | ||
$scope.seeMC = function ( id ) { | ||
$state.go( 'microcontroladoresDetail', { idMicrocontrolador: id } ); | ||
}; | ||
} | ||
] ); | ||
})( angular ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h1>{{'Area '+area.id}}</h1> | ||
|
||
<div class="niveles-container"> | ||
<div> | ||
<div id="containerMicrocontrolador"></div> | ||
</div> | ||
</div> |
23 changes: 23 additions & 0 deletions
23
Proyecto/Proyecto-FrontEnd/app/src/modules/areas/areas.mod.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(function ( ng ) { | ||
let mod = ng.module( 'areaModule', [ 'ui.router' ] ); | ||
|
||
mod.config( [ '$stateProvider', '$urlRouterProvider', | ||
function ( $stateProvider, $urlRouterProvider ) { | ||
$urlRouterProvider.otherwise( '/areas' ); | ||
|
||
$stateProvider | ||
.state( 'areas', { | ||
url: '/areas/:idArea', | ||
parent: 'menu', | ||
params: { | ||
idArea: null | ||
}, | ||
views: { | ||
'listView': { | ||
templateUrl: 'app/src/modules/areas/areas.html', | ||
controller: 'areasCtrl' | ||
} | ||
} | ||
} ); | ||
} ] ); | ||
})( window.angular ); |
Empty file.
Empty file.
Oops, something went wrong.