var ycgl = new Array(); var ycgl2 = new Array(); var ycgl3 = new Array(); var ycgl4 = new Array(); var d = new Array(); function getCurve() { var windfarm = $("#windfarm").val(); var ssdate2 = $("#ssdate2").val(); var url = "getCurveAction.action?windfarm=" + windfarm + "&ssdate2=" + ssdate2; $.getJSON(url, function(data) { if (data != null) { for ( var i = 0; i < data.length; i++) { ycgl[i] = Math.round(data[i].var1 * 100) / 100; ycgl2[i] = Math.round(data[i].var22 * 100) / 100; ycgl3[i] = Math.round(data[i].var33 * 100) / 100; ycgl4[i] = Math.round(data[i].var44 * 100) / 100; } } }); } var ycgl1 = new Array(); function getCurve2() { var windfarm = $("#windfarm").val(); var ssdate2 = $("#ssdate2").val(); var url = "getCurveAction2.action?windfarm=" + windfarm + "&ssdate2=" + ssdate2; $.getJSON(url, function(data) { if (data != null) { for ( var i = 0; i < data.length; i++) { ycgl1[i] = Math.round(data[i].var1 * 100) / 100; d[i] = data[i].d; } } }); } $(document).ready( function() { $.ajaxSetup( { async : false }); getCurve(); getCurve2(); $.ajaxSetup( { async : true }); showJqGrid(); showJqGrid1(); showJqGrid2(); showJqGrid3(); var sure = $("#sure").val(); if (sure == 0) { } else if (sure == 1) { $("#div1").text("短期预测(已确认此方案)"); $("#button").hide(); $("#button2").hide(); $("#button3").hide(); $("#button4").hide(); } else if (sure == 2) { $("#div2").text("短期预测(拟合)(已确认此方案)"); $("#button").hide(); $("#button2").hide(); $("#button3").hide(); $("#button4").hide(); } else if (sure == 3) { $("#div3").text("超短期预测(已确认此方案)"); $("#button").hide(); $("#button2").hide(); $("#button3").hide(); $("#button4").hide(); } else if (sure == 4) { $("#div4").text("超短期预测(拟合)(已确认此方案)"); $("#button").hide(); $("#button2").hide(); $("#button3").hide(); $("#button4").hide(); } $('#container').highcharts( { chart : { type : 'spline' }, title : { text : '短期预测' }, xAxis : { categories : [ '0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '23:45' ] }, yAxis : { labels : { formatter : function() { return this.value } }, title : { text : '短期预测' } }, tooltip : { crosshairs : true, shared : true }, credits : { enabled : false }, plotOptions : { spline : { marker : { radius : 3, lineColor : '#666666', lineWidth : 1 } } }, series : [ { name : '短期预测功率(单位:MW)', marker : { enabled : false, name : '短期预测功率(单位:MW)' }, data : ycgl }, { name : '实际功率(单位:MW)', marker : { enabled : false, name : '实际功率(单位:MW)' }, data : ycgl3 }, { name : '实际风速', marker : { enabled : false, name : '实际风速' }, data : ycgl2 } ] }); $('#container1').highcharts( { chart : { type : 'spline' }, title : { text : '短期预测(拟合)' }, xAxis : { categories : [ '0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '23:45' ] }, yAxis : { labels : { formatter : function() { return this.value } }, title : { text : '短期预测(拟合)' } }, credits : { enabled : false }, tooltip : { crosshairs : true, shared : true }, plotOptions : { spline : { marker : { radius : 3, lineColor : '#666666', lineWidth : 1 } } }, series : [ { name : '拟合功率(单位:MW)', marker : { enabled : false, name : '拟合功率(单位:MW)' }, data : ycgl4 }, { name : '实际功率(单位:MW)', marker : { enabled : false, name : '实际功率(单位:MW)' }, data : ycgl3 }, { name : '实际风速', marker : { enabled : false, name : '实际风速' }, data : ycgl2 } ] }); $('#container2').highcharts( { chart : { type : 'spline' }, title : { text : '超短期预测' }, xAxis : { categories : [ '0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '23:45' ] }, yAxis : { labels : { formatter : function() { return this.value } }, title : { text : '超短期预测' } }, credits : { enabled : false }, tooltip : { crosshairs : { width : 2 }, shared : true }, plotOptions : { spline : { marker : { radius : 3, lineColor : '#666666', lineWidth : 1 } } }, series : [ { name : '超短期预测功率(单位:MW)', marker : { symbol : 'square', enabled : false, name : '超短期预测功率(单位:MW)' }, data : ycgl1 }, { name : '实际功率(单位:MW)', marker : { enabled : false, name : '实际功率(单位:MW)' }, data : ycgl3 }, { name : '实际风速', marker : { enabled : false, name : '实际风速' }, data : ycgl2 } ] }); $('#container3').highcharts( { chart : { type : 'spline' }, title : { text : '超短期预测(拟合)' }, xAxis : { categories : [ '0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '23:45' ] }, yAxis : { labels : { formatter : function() { return this.value } }, title : { text : '超短期预测(拟合)' } }, credits : { enabled : false }, tooltip : { crosshairs : true, shared : true }, plotOptions : { spline : { marker : { radius : 3, lineColor : '#666666', lineWidth : 1 } } }, series : [ { name : '拟合功率(单位:MW)', marker : { enabled : false, name : '拟合功率(单位:MW)' }, data : ycgl4 }, { name : '实际功率(单位:MW)', marker : { enabled : false, name : '实际功率(单位:MW)' }, data : ycgl3 }, { name : '实际风速', marker : { enabled : false, name : '实际风速' }, data : ycgl2 } ] }); }); function showJqGrid() { var furnishedno = $("#furnishedno").val(); var temp = 'getInfo.action?furnishedno=' + furnishedno + "&type=短期"; var url = encodeURI(encodeURI(temp)); var id = 'gridTable'; var datatype = 'json'; var colNames = [ '开始时间', '结束时间', '预测内容', 'sure' ]; var colModel = [ { name : 'begindate', index : 'begindate', width : 150, align : 'center' }, { name : 'enddate', index : 'enddate', width : 150, align : 'center' }, { name : 'predictioncontent', index : 'predictioncontent', width : 115, align : 'center' }, { name : 'sure', index : 'sure', width : 115, align : 'center', hidden : true } ]; var caption = ''; var sortname = 'begindate'; var gridPagerID = 'gridPager'; var sortorder = 'desc'; var height = 'auto'; var width = 'auto'; var rownumbers = true; var multiselect = false; myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID, sortorder, height, width, multiselect, rownumbers); } function showJqGrid1() { var furnishedno = $("#furnishedno").val(); var temp = 'getInfo.action?furnishedno=' + furnishedno + "&type=短期拟合"; var url = encodeURI(encodeURI(temp)); var id = 'gridTable1'; var datatype = 'json'; var colNames = [ '开始时间', '结束时间', '预测内容', 'sure' ]; var colModel = [ { name : 'begindate', index : 'begindate', width : 150, align : 'center' }, { name : 'enddate', index : 'enddate', width : 150, align : 'center' }, { name : 'predictioncontent', index : 'predictioncontent', width : 115, align : 'center' }, { name : 'sure', index : 'sure', width : 115, align : 'center', hidden : true } ]; var caption = ''; var sortname = 'begindate'; var gridPagerID = 'gridPager1'; var sortorder = 'desc'; var height = 'auto'; var width = 'auto'; var rownumbers = true; var multiselect = false; myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID, sortorder, height, width, multiselect, rownumbers); } function showJqGrid2() { var furnishedno = $("#furnishedno").val(); var temp = 'getInfo.action?furnishedno=' + furnishedno + "&type=超短期"; var url = encodeURI(encodeURI(temp)); var id = 'gridTable2'; var datatype = 'json'; var colNames = [ '开始时间', '结束时间', '预测内容', 'sure' ]; var colModel = [ { name : 'begindate', index : 'begindate', width : 150, align : 'center' }, { name : 'enddate', index : 'enddate', width : 150, align : 'center' }, { name : 'predictioncontent', index : 'predictioncontent', width : 115, align : 'center' }, { name : 'sure', index : 'sure', width : 115, align : 'center', hidden : true } ]; var caption = ''; var sortname = 'begindate'; var gridPagerID = 'gridPager2'; var sortorder = 'desc'; var height = 'auto'; var width = 'auto'; var rownumbers = true; var multiselect = false; myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID, sortorder, height, width, multiselect, rownumbers); } function showJqGrid3() { var furnishedno = $("#furnishedno").val(); var temp = 'getInfo.action?furnishedno=' + furnishedno + "&type=超短期拟合"; var url = encodeURI(encodeURI(temp)); var id = 'gridTable3'; var datatype = 'json'; var colNames = [ '开始时间', '结束时间', '预测内容', 'sure' ]; var colModel = [ { name : 'begindate', index : 'begindate', width : 150, align : 'center' }, { name : 'enddate', index : 'enddate', width : 150, align : 'center' }, { name : 'predictioncontent', index : 'predictioncontent', width : 115, align : 'center' }, { name : 'sure', index : 'sure', width : 115, align : 'center', hidden : true } ]; var caption = ''; var sortname = 'begindate'; var gridPagerID = 'gridPager3'; var sortorder = 'desc'; var height = 'auto'; var width = 'auto'; var rownumbers = true; var multiselect = false; myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID, sortorder, height, width, multiselect, rownumbers); }