define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echarts-theme', 'template'], function ($, undefined, Backend, Datatable, Table, Echarts, undefined, Template) {

    var Controller = {
        index: function () {

            //清除所有故障
            $(document).on("click", ".btn-all-fault", function () {
                var simNum = $(".simNum1").val();
                var simType1 = $(".simType1").val();
                $.ajax({
                    url: Config.url_type+"/sim/debug/debugClearAllFault/"+simNum+"/"+simType1,
                    type: 'get',
                    success: function (data) {
                        console.log(data);
                        if(data.code==200){
                            $(".content1").html();
                        }else{
                            Layer.alert(data.msg);
                            return;
                        }
                    }
                });
            });

            //清除一个故障
            $(document).on("click", ".btn-one-fault", function () {
                var simNum2 = $(".simNum2").val();
                var bindHardwareMsg2 = $(".bindHardwareMsg2").val();
                $.ajax({
                    url: Config.url_type+"/sim/debug/debugClearOneFault/"+simNum2+"/"+bindHardwareMsg2,
                    type: 'get',
                    success: function (data) {
                        console.log(data);
                        if(data.code==200){
                            $(".content2").html();
                        }else{
                            Layer.alert(data.msg);
                            return;
                        }
                    }
                });
            });



            //读取全部故障位置数据
            $(document).on("click", ".btn-alldata", function () {
                var simNum3 = $(".simNum3").val();
                var simType3 = $(".simType3").val();
                $.ajax({
                    url: Config.url_type+"/sim/debug/debugReadAllFualtResistance/"+simNum3+"/"+simType3,
                    type: 'get',
                    success: function (data) {
                        console.log(data);
                        if(data.code==200){
                            $(".content3").html();
                        }else{
                            Layer.alert(data.msg);
                            return;
                        }
                    }
                });
            });


            //读取一个故障位置数据
            $(document).on("click", ".btn-onedata", function () {
                var simNum4 = $(".simNum4").val();
                var bindHardwareMsg4 = $(".bindHardwareMsg4").val();
                $.ajax({
                    url: Config.url_type+"/sim/debug/debugReadOneFualtResistance/"+simNum4+"/"+bindHardwareMsg4,
                    type: 'get',
                    success: function (data) {
                        console.log(data);
                        if(data.code==200){
                            $(".content4").html();
                        }else{
                            Layer.alert(data.msg);
                            return;
                        }
                    }
                });
            });

            //读取模拟器类型序列号
            $(document).on("click", ".btn-simnum", function () {
                var simNum5 = $(".simNum5").val();
                $.ajax({
                    url: Config.url_type+"/sim/debug/debugReadSimType/"+simNum5,
                    type: 'get',
                    success: function (data) {
                        console.log(data);
                        if(data.code==200){
                            $(".content5").html();
                        }else{
                            Layer.alert(data.msg);
                            return;
                        }
                    }
                });
            });




            //下发所有故障
            $(document).on("click", ".btn-allxiafa", function () {
                var simNum6 = $(".simNum6").val();
                var simType6 = $(".simType6").val();
                $.ajax({
                    url: Config.url_type+"/sim/debug/debugWriteAllFault/"+simNum6+"/"+simType6,
                    type: 'get',
                    success: function (data) {
                        console.log(data);
                        if(data.code==200){
                            $(".content6").html();
                        }else{
                            Layer.alert(data.msg);
                            return;
                        }
                    }
                });
            });

            //下发一个故障
            $(document).on("click", ".btn-onexiafa", function () {
                var simNum7 = $(".simNum7").val();
                var bindHardwareMsg7 = $(".bindHardwareMsg7").val();
                $.ajax({
                    url: Config.url_type+"/sim/debug/debugWriteOneFault/"+simNum7+"/"+bindHardwareMsg7,
                    type: 'get',
                    success: function (data) {
                        console.log(data);
                        if(data.code==200){
                            $(".content7").html();
                        }else{
                            Layer.alert(data.msg);
                            return;
                        }
                    }
                });
            });



        }
    };

    return Controller;
});
