<commit_before>app.directive('alarmpanel',function() { 
  return { 
    restrict: 'E', 
    templateUrl:'./directives/alarmpanel/alarmpanel.html',
    controller: 'AlarmPanelCtrl',
    controllerAs: 'vm',
    bindToController: true              
    }; 
});

app.controller('AlarmPanelCtrl',
    function ($scope,$interval,dashboardService,datastatesService,userService,statusboardService){ 
    
    $scope.telemetry = dashboardService.telemetry;
    var flexprop = 100;
    $scope.alarmpanel = statusboardService.getStatusTable();//status board current alerts;
    var time, ack = "";
    $scope.name = userService.getUserName();
    $scope.role = userService.userRole;
    $scope.contents = [];
    $scope.masteralarmstatus = statusboardService.getMasterAlarmColors();
    $scope.class = []; // for glowing effect

    $scope.vehicleColors = []; //contains all the vehicles to be displayed for the mission
    
    getVehicles();

    //Function to display master alarm and its sub systems
    function getVehicles(){
        $scope.configInterval = $interval(function(){
            var telemetry = dashboardService.telemetry;

            if(!dashboardService.isEmpty(telemetry)){
                var data = dashboardService.sortObject(telemetry.data);
                for(var key in data) {
                    if(data.hasOwnProperty(key)) {
                        //check if the platform exists in the contents
                        var index = $scope.contents.findIndex(content => content.vehicle === key);

                        //add in contents if not exists
                        if(index == -1){
                            $scope.contents.push({
                                "vehicle":key,
                                "flexprop":"",
                                "categories":Object.keys(data[key]),
                                "vehicleColor":"",
                                "categoryColors": [],
                                "tableArray":[],
                                "subCategoryColors" :[],
                                "ackStatus":false
                            });

                            $scope.vehicleColors.push({"vehicle":key,"status":false});
                        } else { //update categories if vehicle exists in contents
                            $scope.contents[index].categories = Object.keys(data[key])
                        }<commit_msg>added sort function to sort the subsystems while displaying in alarm panel<commit_after>app.directive('alarmpanel',function() { 
  return { 
    restrict: 'E', 
    templateUrl:'./directives/alarmpanel/alarmpanel.html',
    controller: 'AlarmPanelCtrl',
    controllerAs: 'vm',
    bindToController: true              
    }; 
});

app.controller('AlarmPanelCtrl',
    function ($scope,$interval,dashboardService,datastatesService,userService,statusboardService){ 
    
    $scope.telemetry = dashboardService.telemetry;
    var flexprop = 100;
    $scope.alarmpanel = statusboardService.getStatusTable();//status board current alerts;
    var time, ack = "";
    $scope.name = userService.getUserName();
    $scope.role = userService.userRole;
    $scope.contents = [];
    $scope.masteralarmstatus = statusboardService.getMasterAlarmColors();
    $scope.class = []; // for glowing effect

    $scope.vehicleColors = []; //contains all the vehicles to be displayed for the mission
    
    getVehicles();

    //Function to display master alarm and its sub systems
    function getVehicles(){
        $scope.configInterval = $interval(function(){
            var telemetry = dashboardService.telemetry;

            if(!dashboardService.isEmpty(telemetry)){
                var data = dashboardService.sortObject(telemetry.data);
                for(var key in data) {
                    if(data.hasOwnProperty(key)) {
                        //check if the platform exists in the contents
                        var index = $scope.contents.findIndex(content => content.vehicle === key);

                        //add in contents if not exists
                        var subsystems = Object.keys(data[key]).sort();
                        if(index == -1){
                            $scope.contents.push({
                                "vehicle":key,
                                "flexprop":"",
                                "categories":subsystems,
                                "vehicleColor":"",
                                "categoryColors": [],
                                "tableArray":[],
                                "subCategoryColors" :[],
                                "ackStatus":false
                            });

                            $scope.vehicleColors.push({"vehicle":key,"status":false});
                        } else { //update categories if vehicle exists in contents
                            $scope.contents[index].categories = subsystems;
                        }
{'fraction_non_alphanumeric': 0.10776384957541447, 'fraction_numerical': 0.0016174686615446825, 'mean_word_length': 1.6454545454545455, 'pattern_counts': {'":': 18, '<': 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': '4924615', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1145, 'n_words': 246}