<commit_before>/**
 * Created by jlueders on 4/13/15.
 */
angular.module('NodeWebBase')
    .controller('dataSetController', ['$scope','$rootScope','$http','toggleEditMsg','setSelectionMsg', function ($scope, $rootScope, $http, toggleEditMsg,setSelectionMsg) {

        $scope.jobs = [];
        $scope.dataSets= [];
        $scope.polygonFiles = [];

        $scope.dataSetSelected=null;
        $scope.polyFile="";
        $scope.polygonSetSelected=null;
        $scope.newPolySetName = "";

        $scope.run={
                sTopN:"300",
                sFileName:"",
                bPercent:"",
                cStopW:"",
                useTimeSeries:false,
                sTopPercent:"0.0001",
                nFeat:""
            };
        $scope.editing = false;

        $scope.training={
            fileName:""
        };

        $scope.$watch("dataSetSelected", function(newval, oldval){
            if(newval!=oldval)
                    setSelectionMsg.broadcast('dataSetSelected', newval)
        });

        $scope.$watch("polygonSetSelected", function(newval,oldval){
            if(newval!=oldval) {
                setSelectionMsg.broadcast('polygonSetSelected',newval);
                if(newval) {
                    $scope.drawPolygonFile();
                }
                    toggleEditMsg.broadcast(false);
            }
        });

        $scope.getPolygonSets = function(){
            $scope.populatePolygonSelect();
        };

        //TODO: Needs to be depracated and replaced with getPolygonSets
        $scope.populatePolygonSelect = function() {
            if(!$rootScope.isAppConfigured())
                return;

            $http({
                method:"GET",
                url: "app/sitelists/list/"+$rootScope.username,
                params: {}
            }).success(function (response) {
                while($scope.polygonFiles.length > response.length)
                    $scope.polygonFiles.pop();

                $.extend($scope.polygonFiles, response)
            }).error($rootScope.showError);
        };

        $scope.$watch("editing", function(newval,oldval){
            console.log("datasetcontroller editing: " , newval);

            if(newval!=oldval){
                if($("#map-canvas").hasClass("mapHighlight")){
                    $scope.updateItem();
                };

                toggleEditMsg.broadcast(newval);
            }
        });<commit_msg>Changing datasets exists editing mode.<commit_after>/**
 * Created by jlueders on 4/13/15.
 */
angular.module('NodeWebBase')
    .controller('dataSetController', ['$scope','$rootScope','$http','toggleEditMsg','setSelectionMsg', function ($scope, $rootScope, $http, toggleEditMsg,setSelectionMsg) {

        $scope.jobs = [];
        $scope.dataSets= [];
        $scope.polygonFiles = [];

        $scope.dataSetSelected=null;
        $scope.polyFile="";
        $scope.polygonSetSelected=null;
        $scope.newPolySetName = "";

        $scope.run={
                sTopN:"300",
                sFileName:"",
                bPercent:"",
                cStopW:"",
                useTimeSeries:false,
                sTopPercent:"0.0001",
                nFeat:""
            };
        $scope.editing = false;

        $scope.training={
            fileName:""
        };

        $scope.$watch("dataSetSelected", function(newval, oldval){
            if(newval!=oldval)
                    setSelectionMsg.broadcast('dataSetSelected', newval)
        });

        $scope.$watch("polygonSetSelected", function(newval,oldval){
            if(newval!=oldval) {
                setSelectionMsg.broadcast('polygonSetSelected',newval);
                if(newval) {
                    $scope.drawPolygonFile();
                }
                $scope.editing=false;
                    //toggleEditMsg.broadcast(false);
            }
        });

        $scope.getPolygonSets = function(){
            $scope.populatePolygonSelect();
        };

        //TODO: Needs to be depracated and replaced with getPolygonSets
        $scope.populatePolygonSelect = function() {
            if(!$rootScope.isAppConfigured())
                return;

            $http({
                method:"GET",
                url: "app/sitelists/list/"+$rootScope.username,
                params: {}
            }).success(function (response) {
                while($scope.polygonFiles.length > response.length)
                    $scope.polygonFiles.pop();

                $.extend($scope.polygonFiles, response)
            }).error($rootScope.showError);
        };

        $scope.$watch("editing", function(newval,oldval){
            console.log("datasetcontroller editing: " , newval);

            if(newval!=oldval){
                if($("#map-canvas").hasClass("mapHighlight")){
                    $scope.updateItem();
                }

                toggleEditMsg.broadcast(newval);
            }
        });
{'fraction_non_alphanumeric': 0.13807024626564393, 'fraction_numerical': 0.005248284214775939, 'mean_word_length': 1.6554126473740622, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5046076', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1296, 'n_words': 173}