<commit_before>/**
 * Created by patrik on 2015-09-14.
 */
(function () {
    'use strict';

    angular
      .module('app.spServices')
      .controller('spServicesController', spServicesController);

    spServicesController.$inject = ['spServicesService', '$scope', 'dashboardService','logger', 'modelService','itemService'];
    /* @ngInject */
    function spServicesController(spServicesService, $scope, dashboardService, logger, modelService,itemService) {
        var vm = this;
        var dashboard = $scope.$parent.$parent.$parent.vm.dashboard;
        vm.widget = $scope.$parent.$parent.$parent.vm.widget; //For GUI
        vm.registeredServices = spServicesService.spServices; //From REST-api
        vm.displayedRegisteredServices = []; //For GUI
        vm.startSpService = startSPService; //To start a service. Name of service as parameter
        vm.currentProgess = {};
        vm.serviceAttributes = {};
        vm.showDetails = {};
        vm.isServiceActive = isServiceActive;

        activate();

        function activate() {
            $scope.$on('closeRequest', function() {
                dashboardService.closeWidget(vm.widget.id);
            });

            _.forEach(vm.registeredServices, function(s){
                vm.showDetails[s.name] = false;
            });

        }

        function startSPService(spService) {
            spServicesService.callService(spService, {"data":vm.serviceAttributes[spService.name]}, resp, prog);

            if (!_.isUndefined(vm.currentProgess[event.service])){
                delete vm.currentProgess[event.service];
            }
        }

        function resp(event){
            console.log("RESP GOT: ");
            console.log(event);

            if (event.isa === 'Response') {
                for(var i = 0; i < event.ids.length; i++) {
                    if (!_.isUndefined(event.ids[i].sop)) {
                        var widgetKind = _.find(dashboardService.widgetKinds, {title: 'SOP Maker'});
                        var widgetStorage = {
                            sopSpec: event.ids[i]
                        };
                        dashboardService.addWidget(dashboard, widgetKind, widgetStorage);
                    }
                }
            }
            updateInfo(event);
        }
<commit_msg>Turned off auto open of SOPs<commit_after>/**
 * Created by patrik on 2015-09-14.
 */
(function () {
    'use strict';

    angular
      .module('app.spServices')
      .controller('spServicesController', spServicesController);

    spServicesController.$inject = ['spServicesService', '$scope', 'dashboardService','logger', 'modelService','itemService'];
    /* @ngInject */
    function spServicesController(spServicesService, $scope, dashboardService, logger, modelService,itemService) {
        var vm = this;
        var dashboard = $scope.$parent.$parent.$parent.vm.dashboard;
        vm.widget = $scope.$parent.$parent.$parent.vm.widget; //For GUI
        vm.registeredServices = spServicesService.spServices; //From REST-api
        vm.displayedRegisteredServices = []; //For GUI
        vm.startSpService = startSPService; //To start a service. Name of service as parameter
        vm.currentProgess = {};
        vm.serviceAttributes = {};
        vm.showDetails = {};
        vm.isServiceActive = isServiceActive;

        activate();

        function activate() {
            $scope.$on('closeRequest', function() {
                dashboardService.closeWidget(vm.widget.id);
            });

            _.forEach(vm.registeredServices, function(s){
                vm.showDetails[s.name] = false;
            });

        }

        function startSPService(spService) {
            spServicesService.callService(spService, {"data":vm.serviceAttributes[spService.name]}, resp, prog);

            if (!_.isUndefined(vm.currentProgess[event.service])){
                delete vm.currentProgess[event.service];
            }
        }

        function resp(event){
            console.log("RESP GOT: ");
            console.log(event);

//            if (event.isa === 'Response') {
//                for(var i = 0; i < event.ids.length; i++) {
//                    if (!_.isUndefined(event.ids[i].sop)) {
//                        var widgetKind = _.find(dashboardService.widgetKinds, {title: 'SOP Maker'});
//                        var widgetStorage = {
//                            sopSpec: event.ids[i]
//                        };
//                        dashboardService.addWidget(dashboard, widgetKind, widgetStorage);
//                    }
//                }
//            }
            updateInfo(event);
        }

{'fraction_non_alphanumeric': 0.1301825993555317, 'fraction_numerical': 0.003866809881847476, 'mean_word_length': 1.8955223880597014, 'pattern_counts': {'":': 2, '<': 5, '<?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': '4549669', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1200, 'n_words': 221}