(function () {
|
'use strict';
|
angular.module('task.controller')
|
.controller('ConveyorMonitorCtrl', ConveyorMonitorCtrl);
|
|
function ConveyorMonitorCtrl($scope, $window, CurdHelper, ETaskTypeService, Global, $timeout, $state, Utils) {
|
|
|
$scope.data = [];
|
|
$scope.isBlank = Utils.isBlank;
|
|
$scope.init = init;
|
|
$scope.view = view;
|
$scope.info_div = {
|
width: $window.innerWidth / 2 - 35,
|
height: 550
|
}
|
$scope.input_length = {
|
width: ($window.innerWidth) / 4 - 132 - 45,
|
}
|
$scope.task_send_div = {
|
width: $window.innerWidth - 50
|
};
|
$scope.sendFlag = false;
|
$scope.init = init;
|
|
|
function init() {
|
$timeout(function () { queryConveyor(); }, 10);
|
}
|
|
function queryConveyor() {
|
CurdHelper.query("./Device/GetConveyorInfos", function (data) {
|
$scope.data = data.Result;
|
for (var i = 0; i < $scope.data.length; i++) {
|
$scope.data[i].$background = "grove.png";
|
|
}
|
|
if ($state.includes("task.conveyor-monitor")) {
|
$timeout(queryConveyor, 1000);
|
}
|
});
|
}
|
|
function view(d) {
|
debugger;
|
if (d.ConveyorName == "conveyor1") {
|
$state.go("task.conveyor-monitor-detail1", { name: d.ConveyorName });
|
}
|
else {
|
$state.go("task.conveyor-monitor-detail2", { name: d.ConveyorName });
|
}
|
}
|
|
|
}
|
})();
|