curveJs.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. var ycgl = new Array();
  2. var ycgl2 = new Array();
  3. var ycgl3 = new Array();
  4. var ycgl4 = new Array();
  5. var d = new Array();
  6. function getCurve() {
  7. var windfarm = $("#windfarm").val();
  8. var ssdate2 = $("#ssdate2").val();
  9. var url = "getCurveAction.action?windfarm=" + windfarm + "&ssdate2="
  10. + ssdate2;
  11. $.getJSON(url, function(data) {
  12. if (data != null) {
  13. for ( var i = 0; i < data.length; i++) {
  14. ycgl[i] = Math.round(data[i].var1 * 100) / 100;
  15. ycgl2[i] = Math.round(data[i].var22 * 100) / 100;
  16. ycgl3[i] = Math.round(data[i].var33 * 100) / 100;
  17. ycgl4[i] = Math.round(data[i].var44 * 100) / 100;
  18. }
  19. }
  20. });
  21. }
  22. var ycgl1 = new Array();
  23. function getCurve2() {
  24. var windfarm = $("#windfarm").val();
  25. var ssdate2 = $("#ssdate2").val();
  26. var url = "getCurveAction2.action?windfarm=" + windfarm + "&ssdate2="
  27. + ssdate2;
  28. $.getJSON(url, function(data) {
  29. if (data != null) {
  30. for ( var i = 0; i < data.length; i++) {
  31. ycgl1[i] = Math.round(data[i].var1 * 100) / 100;
  32. d[i] = data[i].d;
  33. }
  34. }
  35. });
  36. }
  37. $(document).ready(
  38. function() {
  39. $.ajaxSetup( {
  40. async : false
  41. });
  42. getCurve();
  43. getCurve2();
  44. $.ajaxSetup( {
  45. async : true
  46. });
  47. showJqGrid();
  48. showJqGrid1();
  49. showJqGrid2();
  50. showJqGrid3();
  51. var sure = $("#sure").val();
  52. if (sure == 0) {
  53. } else if (sure == 1) {
  54. $("#div1").text("短期预测(已确认此方案)");
  55. $("#button").hide();
  56. $("#button2").hide();
  57. $("#button3").hide();
  58. $("#button4").hide();
  59. } else if (sure == 2) {
  60. $("#div2").text("短期预测(拟合)(已确认此方案)");
  61. $("#button").hide();
  62. $("#button2").hide();
  63. $("#button3").hide();
  64. $("#button4").hide();
  65. } else if (sure == 3) {
  66. $("#div3").text("超短期预测(已确认此方案)");
  67. $("#button").hide();
  68. $("#button2").hide();
  69. $("#button3").hide();
  70. $("#button4").hide();
  71. } else if (sure == 4) {
  72. $("#div4").text("超短期预测(拟合)(已确认此方案)");
  73. $("#button").hide();
  74. $("#button2").hide();
  75. $("#button3").hide();
  76. $("#button4").hide();
  77. }
  78. $('#container').highcharts(
  79. {
  80. chart : {
  81. type : 'spline'
  82. },
  83. title : {
  84. text : '短期预测'
  85. },
  86. xAxis : {
  87. categories : [ '0:00', '1:00', '2:00', '3:00',
  88. '4:00', '5:00', '6:00', '7:00', '8:00',
  89. '9:00', '10:00', '11:00', '12:00', '13:00',
  90. '14:00', '15:00', '16:00', '17:00',
  91. '18:00', '19:00', '20:00', '21:00',
  92. '22:00', '23:00', '23:45' ]
  93. },
  94. yAxis : {
  95. labels : {
  96. formatter : function() {
  97. return this.value
  98. }
  99. },
  100. title : {
  101. text : '短期预测'
  102. }
  103. },
  104. tooltip : {
  105. crosshairs : true,
  106. shared : true
  107. },
  108. credits : {
  109. enabled : false
  110. },
  111. plotOptions : {
  112. spline : {
  113. marker : {
  114. radius : 3,
  115. lineColor : '#666666',
  116. lineWidth : 1
  117. }
  118. }
  119. },
  120. series : [ {
  121. name : '短期预测功率(单位:MW)',
  122. marker : {
  123. enabled : false,
  124. name : '短期预测功率(单位:MW)'
  125. },
  126. data : ycgl
  127. }, {
  128. name : '实际功率(单位:MW)',
  129. marker : {
  130. enabled : false,
  131. name : '实际功率(单位:MW)'
  132. },
  133. data : ycgl3
  134. }, {
  135. name : '实际风速',
  136. marker : {
  137. enabled : false,
  138. name : '实际风速'
  139. },
  140. data : ycgl2
  141. } ]
  142. });
  143. $('#container1').highcharts(
  144. {
  145. chart : {
  146. type : 'spline'
  147. },
  148. title : {
  149. text : '短期预测(拟合)'
  150. },
  151. xAxis : {
  152. categories : [ '0:00', '1:00', '2:00', '3:00',
  153. '4:00', '5:00', '6:00', '7:00', '8:00',
  154. '9:00', '10:00', '11:00', '12:00', '13:00',
  155. '14:00', '15:00', '16:00', '17:00',
  156. '18:00', '19:00', '20:00', '21:00',
  157. '22:00', '23:00', '23:45' ]
  158. },
  159. yAxis : {
  160. labels : {
  161. formatter : function() {
  162. return this.value
  163. }
  164. },
  165. title : {
  166. text : '短期预测(拟合)'
  167. }
  168. },
  169. credits : {
  170. enabled : false
  171. },
  172. tooltip : {
  173. crosshairs : true,
  174. shared : true
  175. },
  176. plotOptions : {
  177. spline : {
  178. marker : {
  179. radius : 3,
  180. lineColor : '#666666',
  181. lineWidth : 1
  182. }
  183. }
  184. },
  185. series : [ {
  186. name : '拟合功率(单位:MW)',
  187. marker : {
  188. enabled : false,
  189. name : '拟合功率(单位:MW)'
  190. },
  191. data : ycgl4
  192. }, {
  193. name : '实际功率(单位:MW)',
  194. marker : {
  195. enabled : false,
  196. name : '实际功率(单位:MW)'
  197. },
  198. data : ycgl3
  199. }, {
  200. name : '实际风速',
  201. marker : {
  202. enabled : false,
  203. name : '实际风速'
  204. },
  205. data : ycgl2
  206. } ]
  207. });
  208. $('#container2').highcharts(
  209. {
  210. chart : {
  211. type : 'spline'
  212. },
  213. title : {
  214. text : '超短期预测'
  215. },
  216. xAxis : {
  217. categories : [ '0:00', '1:00', '2:00', '3:00',
  218. '4:00', '5:00', '6:00', '7:00', '8:00',
  219. '9:00', '10:00', '11:00', '12:00', '13:00',
  220. '14:00', '15:00', '16:00', '17:00',
  221. '18:00', '19:00', '20:00', '21:00',
  222. '22:00', '23:00', '23:45' ]
  223. },
  224. yAxis : {
  225. labels : {
  226. formatter : function() {
  227. return this.value
  228. }
  229. },
  230. title : {
  231. text : '超短期预测'
  232. }
  233. },
  234. credits : {
  235. enabled : false
  236. },
  237. tooltip : {
  238. crosshairs : {
  239. width : 2
  240. },
  241. shared : true
  242. },
  243. plotOptions : {
  244. spline : {
  245. marker : {
  246. radius : 3,
  247. lineColor : '#666666',
  248. lineWidth : 1
  249. }
  250. }
  251. },
  252. series : [ {
  253. name : '超短期预测功率(单位:MW)',
  254. marker : {
  255. symbol : 'square',
  256. enabled : false,
  257. name : '超短期预测功率(单位:MW)'
  258. },
  259. data : ycgl1
  260. }, {
  261. name : '实际功率(单位:MW)',
  262. marker : {
  263. enabled : false,
  264. name : '实际功率(单位:MW)'
  265. },
  266. data : ycgl3
  267. }, {
  268. name : '实际风速',
  269. marker : {
  270. enabled : false,
  271. name : '实际风速'
  272. },
  273. data : ycgl2
  274. } ]
  275. });
  276. $('#container3').highcharts(
  277. {
  278. chart : {
  279. type : 'spline'
  280. },
  281. title : {
  282. text : '超短期预测(拟合)'
  283. },
  284. xAxis : {
  285. categories : [ '0:00', '1:00', '2:00', '3:00',
  286. '4:00', '5:00', '6:00', '7:00', '8:00',
  287. '9:00', '10:00', '11:00', '12:00', '13:00',
  288. '14:00', '15:00', '16:00', '17:00',
  289. '18:00', '19:00', '20:00', '21:00',
  290. '22:00', '23:00', '23:45' ]
  291. },
  292. yAxis : {
  293. labels : {
  294. formatter : function() {
  295. return this.value
  296. }
  297. },
  298. title : {
  299. text : '超短期预测(拟合)'
  300. }
  301. },
  302. credits : {
  303. enabled : false
  304. },
  305. tooltip : {
  306. crosshairs : true,
  307. shared : true
  308. },
  309. plotOptions : {
  310. spline : {
  311. marker : {
  312. radius : 3,
  313. lineColor : '#666666',
  314. lineWidth : 1
  315. }
  316. }
  317. },
  318. series : [ {
  319. name : '拟合功率(单位:MW)',
  320. marker : {
  321. enabled : false,
  322. name : '拟合功率(单位:MW)'
  323. },
  324. data : ycgl4
  325. }, {
  326. name : '实际功率(单位:MW)',
  327. marker : {
  328. enabled : false,
  329. name : '实际功率(单位:MW)'
  330. },
  331. data : ycgl3
  332. }, {
  333. name : '实际风速',
  334. marker : {
  335. enabled : false,
  336. name : '实际风速'
  337. },
  338. data : ycgl2
  339. } ]
  340. });
  341. });
  342. function showJqGrid() {
  343. var furnishedno = $("#furnishedno").val();
  344. var temp = 'getInfo.action?furnishedno=' + furnishedno + "&type=短期";
  345. var url = encodeURI(encodeURI(temp));
  346. var id = 'gridTable';
  347. var datatype = 'json';
  348. var colNames = [ '开始时间', '结束时间', '预测内容', 'sure' ];
  349. var colModel = [ {
  350. name : 'begindate',
  351. index : 'begindate',
  352. width : 150,
  353. align : 'center'
  354. }, {
  355. name : 'enddate',
  356. index : 'enddate',
  357. width : 150,
  358. align : 'center'
  359. }, {
  360. name : 'predictioncontent',
  361. index : 'predictioncontent',
  362. width : 115,
  363. align : 'center'
  364. }, {
  365. name : 'sure',
  366. index : 'sure',
  367. width : 115,
  368. align : 'center',
  369. hidden : true
  370. } ];
  371. var caption = '';
  372. var sortname = 'begindate';
  373. var gridPagerID = 'gridPager';
  374. var sortorder = 'desc';
  375. var height = 'auto';
  376. var width = 'auto';
  377. var rownumbers = true;
  378. var multiselect = false;
  379. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname,
  380. gridPagerID, sortorder, height, width, multiselect, rownumbers);
  381. }
  382. function showJqGrid1() {
  383. var furnishedno = $("#furnishedno").val();
  384. var temp = 'getInfo.action?furnishedno=' + furnishedno + "&type=短期拟合";
  385. var url = encodeURI(encodeURI(temp));
  386. var id = 'gridTable1';
  387. var datatype = 'json';
  388. var colNames = [ '开始时间', '结束时间', '预测内容', 'sure' ];
  389. var colModel = [ {
  390. name : 'begindate',
  391. index : 'begindate',
  392. width : 150,
  393. align : 'center'
  394. }, {
  395. name : 'enddate',
  396. index : 'enddate',
  397. width : 150,
  398. align : 'center'
  399. }, {
  400. name : 'predictioncontent',
  401. index : 'predictioncontent',
  402. width : 115,
  403. align : 'center'
  404. }, {
  405. name : 'sure',
  406. index : 'sure',
  407. width : 115,
  408. align : 'center',
  409. hidden : true
  410. } ];
  411. var caption = '';
  412. var sortname = 'begindate';
  413. var gridPagerID = 'gridPager1';
  414. var sortorder = 'desc';
  415. var height = 'auto';
  416. var width = 'auto';
  417. var rownumbers = true;
  418. var multiselect = false;
  419. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname,
  420. gridPagerID, sortorder, height, width, multiselect, rownumbers);
  421. }
  422. function showJqGrid2() {
  423. var furnishedno = $("#furnishedno").val();
  424. var temp = 'getInfo.action?furnishedno=' + furnishedno + "&type=超短期";
  425. var url = encodeURI(encodeURI(temp));
  426. var id = 'gridTable2';
  427. var datatype = 'json';
  428. var colNames = [ '开始时间', '结束时间', '预测内容', 'sure' ];
  429. var colModel = [ {
  430. name : 'begindate',
  431. index : 'begindate',
  432. width : 150,
  433. align : 'center'
  434. }, {
  435. name : 'enddate',
  436. index : 'enddate',
  437. width : 150,
  438. align : 'center'
  439. }, {
  440. name : 'predictioncontent',
  441. index : 'predictioncontent',
  442. width : 115,
  443. align : 'center'
  444. }, {
  445. name : 'sure',
  446. index : 'sure',
  447. width : 115,
  448. align : 'center',
  449. hidden : true
  450. } ];
  451. var caption = '';
  452. var sortname = 'begindate';
  453. var gridPagerID = 'gridPager2';
  454. var sortorder = 'desc';
  455. var height = 'auto';
  456. var width = 'auto';
  457. var rownumbers = true;
  458. var multiselect = false;
  459. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname,
  460. gridPagerID, sortorder, height, width, multiselect, rownumbers);
  461. }
  462. function showJqGrid3() {
  463. var furnishedno = $("#furnishedno").val();
  464. var temp = 'getInfo.action?furnishedno=' + furnishedno + "&type=超短期拟合";
  465. var url = encodeURI(encodeURI(temp));
  466. var id = 'gridTable3';
  467. var datatype = 'json';
  468. var colNames = [ '开始时间', '结束时间', '预测内容', 'sure' ];
  469. var colModel = [ {
  470. name : 'begindate',
  471. index : 'begindate',
  472. width : 150,
  473. align : 'center'
  474. }, {
  475. name : 'enddate',
  476. index : 'enddate',
  477. width : 150,
  478. align : 'center'
  479. }, {
  480. name : 'predictioncontent',
  481. index : 'predictioncontent',
  482. width : 115,
  483. align : 'center'
  484. }, {
  485. name : 'sure',
  486. index : 'sure',
  487. width : 115,
  488. align : 'center',
  489. hidden : true
  490. } ];
  491. var caption = '';
  492. var sortname = 'begindate';
  493. var gridPagerID = 'gridPager3';
  494. var sortorder = 'desc';
  495. var height = 'auto';
  496. var width = 'auto';
  497. var rownumbers = true;
  498. var multiselect = false;
  499. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname,
  500. gridPagerID, sortorder, height, width, multiselect, rownumbers);
  501. }