agc.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. var chart1;
  2. var chart2;
  3. var chart3;
  4. var chart4;
  5. var chart5;
  6. var chart6;
  7. var chart7;
  8. var chart8;
  9. var options1;
  10. var options2;
  11. var options3;
  12. var options4;
  13. var options5;
  14. var options6;
  15. var options7;
  16. var options8;
  17. Highcharts.setOptions({
  18. global : {
  19. useUTC : false
  20. }
  21. });
  22. String.prototype.endWith=function(oString){
  23. var reg=new RegExp(oString+"$");
  24. return reg.test(this);
  25. };
  26. options1= {
  27. colors: [
  28. '#00B259', //绿
  29. '#B20000', //红
  30. '#006DD9', //蓝
  31. '#000000', //黑
  32. '#FFBFFF',//藕荷色
  33. '#FF8000'//橘黄
  34. ],
  35. chart: {
  36. renderTo: 'container1',
  37. type: 'spline',
  38. zoomType: 'x',
  39. events: {
  40. }
  41. },
  42. title: {
  43. text: '崇礼风电场AGC功率曲线'
  44. },
  45. subtitle: {
  46. text: ''
  47. },
  48. xAxis: {
  49. labels: {
  50. align: 'center',
  51. formatter: function() {
  52. return Highcharts.dateFormat('%H %M', this.value);
  53. }
  54. },
  55. //tickInterval: 5,
  56. type: 'datetime'
  57. },
  58. yAxis: [{
  59. title: {
  60. text: '功率数值(MW)'
  61. }
  62. }
  63. /* ,{
  64. title:{
  65. text :'风速(m/s)'
  66. },
  67. labels:{
  68. formatter: function(){
  69. return this.value;
  70. }
  71. },
  72. lineWidth : 1,
  73. opposite:true
  74. }*/],
  75. legend: {
  76. layout: 'vertical',
  77. // backgroundColor: '#FFFFFF',
  78. align: 'right',
  79. verticalAlign: 'top',
  80. x:-60,
  81. floating: true
  82. },
  83. tooltip: {
  84. crosshairs:{//控制十字线
  85. width:2
  86. },
  87. shared:true,
  88. xDateFormat:'%Y-%m-%d %H:%M'
  89. },
  90. credits: {
  91. enabled: false
  92. },
  93. plotOptions: {
  94. spline: {
  95. dataLabels : {
  96. enabled :false
  97. },
  98. borderWidth: 0
  99. },
  100. series: {
  101. cursor: 'pointer',
  102. marker: {
  103. radius: 0,
  104. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  105. }
  106. }
  107. },
  108. series: [{
  109. type: 'spline',
  110. name: '实际功率(单位:MW)',
  111. yAxis:0
  112. },
  113. {
  114. type: 'spline',
  115. name: 'AGC限电指令值(单位:MW)',
  116. yAxis:0
  117. },{
  118. type: 'spline',
  119. name: '理论功率(单位:MW)',
  120. yAxis:0
  121. }/*{
  122. type: 'spline',
  123. name: '超短期预测功率(单位:MW)',
  124. yAxis:0
  125. },{
  126. type: 'spline',
  127. name: '短期预测功率(单位:MW)',
  128. yAxis:0
  129. }*/]
  130. };
  131. options2= {
  132. colors: [
  133. '#00B259', //绿
  134. '#B20000', //红
  135. '#006DD9', //蓝
  136. '#000000', //黑
  137. '#FFBFFF',//藕荷色
  138. '#FF8000'//橘黄
  139. ],
  140. chart: {
  141. renderTo: 'container2',
  142. type: 'spline',
  143. zoomType: 'x',
  144. events: {
  145. }
  146. },
  147. title: {
  148. text: '康保风电场AGC功率曲线'
  149. },
  150. subtitle: {
  151. text: ''
  152. },
  153. xAxis: {
  154. labels: {
  155. align: 'center',
  156. formatter: function() {
  157. return Highcharts.dateFormat('%H %M', this.value);
  158. }
  159. },
  160. //tickInterval: 10,
  161. type: 'datetime'
  162. },
  163. yAxis: [{
  164. title: {
  165. text: '功率数值(MW)'
  166. }
  167. }
  168. /* ,{
  169. title:{
  170. text :'风速(m/s)'
  171. },
  172. labels:{
  173. formatter: function(){
  174. return this.value;
  175. }
  176. },
  177. lineWidth : 1,
  178. opposite:true
  179. }*/],
  180. legend: {
  181. layout: 'vertical',
  182. align: 'right',
  183. verticalAlign: 'top',
  184. x:-60,
  185. floating: true
  186. },
  187. tooltip: {
  188. crosshairs:{//控制十字线
  189. width:2
  190. },
  191. shared:true,
  192. xDateFormat:'%Y-%m-%d %H:%M'
  193. },
  194. credits: {
  195. enabled: false
  196. },
  197. plotOptions: {
  198. spline: {
  199. dataLabels : {
  200. enabled :false
  201. },
  202. borderWidth: 0
  203. },
  204. series: {
  205. cursor: 'pointer',
  206. marker: {
  207. radius: 0,
  208. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  209. }
  210. }
  211. },
  212. series: [{
  213. type: 'spline',
  214. name: '实际功率(单位:MW)',
  215. yAxis:0
  216. },
  217. {
  218. type: 'spline',
  219. name: 'AGC限电指令值(单位:MW)',
  220. yAxis:0
  221. },{
  222. type: 'spline',
  223. name: '理论功率(单位:MW)',
  224. yAxis:0
  225. }/*,{
  226. type: 'spline',
  227. name: '超短期预测功率(单位:MW)',
  228. yAxis:0
  229. },{
  230. type: 'spline',
  231. name: '短期预测功率(单位:MW)',
  232. yAxis:0
  233. }*/]
  234. };
  235. options3= {
  236. colors: [
  237. '#00B259', //绿
  238. '#B20000', //红
  239. '#006DD9', //蓝
  240. '#000000', //黑
  241. '#FFBFFF',//藕荷色
  242. '#FF8000'//橘黄
  243. ],
  244. chart: {
  245. renderTo: 'container3',
  246. type: 'spline',
  247. zoomType: 'x',
  248. events: {
  249. }
  250. },
  251. title: {
  252. text: '代县风电场AGC功率曲线'
  253. },
  254. subtitle: {
  255. text: ''
  256. },
  257. xAxis: {
  258. labels: {
  259. align: 'center',
  260. formatter: function() {
  261. return Highcharts.dateFormat('%H %M', this.value);
  262. }
  263. },
  264. //tickInterval: 10,
  265. type: 'datetime'
  266. },
  267. yAxis: [{
  268. title: {
  269. text: '功率数值(MW)'
  270. }
  271. }
  272. /* ,{
  273. title:{
  274. text :'风速(m/s)'
  275. },
  276. labels:{
  277. formatter: function(){
  278. return this.value;
  279. }
  280. },
  281. lineWidth : 1,
  282. opposite:true
  283. }*/],
  284. legend: {
  285. layout: 'vertical',
  286. align: 'right',
  287. verticalAlign: 'top',
  288. x:-60,
  289. floating: true
  290. },
  291. tooltip: {
  292. crosshairs:{//控制十字线
  293. width:2
  294. },
  295. shared:true,
  296. xDateFormat:'%Y-%m-%d %H:%M'
  297. },
  298. credits: {
  299. enabled: false
  300. },
  301. plotOptions: {
  302. spline: {
  303. dataLabels : {
  304. enabled :false
  305. },
  306. borderWidth: 0
  307. },
  308. series: {
  309. cursor: 'pointer',
  310. marker: {
  311. radius: 0,
  312. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  313. }
  314. }
  315. },
  316. series: [{
  317. type: 'spline',
  318. name: '实际功率(单位:MW)',
  319. yAxis:0
  320. },
  321. {
  322. type: 'spline',
  323. name: 'AGC限电指令值(单位:MW)',
  324. yAxis:0
  325. },{
  326. type: 'spline',
  327. name: '理论功率(单位:MW)',
  328. yAxis:0
  329. }/*,{
  330. type: 'spline',
  331. name: '超短期预测功率(单位:MW)',
  332. yAxis:0
  333. },{
  334. type: 'spline',
  335. name: '短期预测功率(单位:MW)',
  336. yAxis:0
  337. }*/
  338. ]
  339. };
  340. options4= {
  341. colors: [
  342. '#00B259', //绿
  343. '#B20000', //红
  344. '#006DD9', //蓝
  345. '#000000', //黑
  346. '#FFBFFF',//藕荷色
  347. '#FF8000'//橘黄
  348. ],
  349. chart: {
  350. renderTo: 'container1',
  351. type: 'spline',
  352. zoomType: 'x',
  353. events: {
  354. }
  355. },
  356. title: {
  357. text: '红花梁AVC电压曲线'
  358. },
  359. subtitle: {
  360. text: ''
  361. },
  362. xAxis: {
  363. labels: {
  364. align: 'center',
  365. formatter: function() {
  366. return Highcharts.dateFormat('%H %M', this.value);
  367. }
  368. },
  369. //tickInterval: 10,
  370. type: 'datetime'
  371. },
  372. yAxis: [{
  373. title: {
  374. text: '电压(KV)'
  375. }
  376. }
  377. ],
  378. legend: {
  379. layout: 'vertical',
  380. align: 'right',
  381. verticalAlign: 'top',
  382. x:-60,
  383. floating: true
  384. },
  385. tooltip: {
  386. crosshairs:{//控制十字线
  387. width:2
  388. },
  389. shared:true,
  390. xDateFormat:'%Y-%m-%d %H:%M'
  391. },
  392. credits: {
  393. enabled: false
  394. },
  395. plotOptions: {
  396. spline: {
  397. dataLabels : {
  398. enabled :false
  399. },
  400. borderWidth: 0
  401. },
  402. series: {
  403. cursor: 'pointer',
  404. marker: {
  405. radius: 0,
  406. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  407. }
  408. }
  409. },
  410. series: [{
  411. type: 'spline',
  412. name: 'AVC母线电压实际值(单位:KV)',
  413. yAxis:0
  414. },
  415. {
  416. type: 'spline',
  417. name: 'AVC母线电压调控值(单位:KV)',
  418. yAxis:0
  419. }]
  420. };
  421. options5= {
  422. colors: [
  423. '#00B259', //绿
  424. '#B20000', //红
  425. '#006DD9', //蓝
  426. '#000000', //黑
  427. '#FFBFFF',//藕荷色
  428. '#FF8000'//橘黄
  429. ],
  430. chart: {
  431. renderTo: 'container2',
  432. type: 'spline',
  433. zoomType: 'x',
  434. events: {
  435. }
  436. },
  437. title: {
  438. text: '照阳河AVC电压曲线'
  439. },
  440. subtitle: {
  441. text: ''
  442. },
  443. xAxis: {
  444. labels: {
  445. align: 'center',
  446. formatter: function() {
  447. return Highcharts.dateFormat('%H %M', this.value);
  448. }
  449. },
  450. //tickInterval: 10,
  451. type: 'datetime'
  452. },
  453. yAxis: [{
  454. title: {
  455. text: '电压(KV)'
  456. }
  457. }
  458. ],
  459. legend: {
  460. layout: 'vertical',
  461. align: 'right',
  462. verticalAlign: 'top',
  463. x:-60,
  464. floating: true
  465. },
  466. tooltip: {
  467. crosshairs:{//控制十字线
  468. width:2
  469. },
  470. shared:true,
  471. xDateFormat:'%Y-%m-%d %H:%M'
  472. },
  473. credits: {
  474. enabled: false
  475. },
  476. plotOptions: {
  477. spline: {
  478. dataLabels : {
  479. enabled :false
  480. },
  481. borderWidth: 0
  482. },
  483. series: {
  484. cursor: 'pointer',
  485. marker: {
  486. radius: 0,
  487. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  488. }
  489. }
  490. },
  491. series: [{
  492. type: 'spline',
  493. name: 'AVC母线电压实际值(单位:KV)',
  494. yAxis:0
  495. },
  496. {
  497. type: 'spline',
  498. name: 'AVC母线电压调控值(单位:KV)',
  499. yAxis:0
  500. }]
  501. };
  502. options6= {
  503. colors: [
  504. '#00B259', //绿
  505. '#B20000', //红
  506. '#006DD9', //蓝
  507. '#000000', //黑
  508. '#FFBFFF',//藕荷色
  509. '#FF8000'//橘黄
  510. ],
  511. chart: {
  512. renderTo: 'container3',
  513. type: 'spline',
  514. zoomType: 'x',
  515. events: {
  516. }
  517. },
  518. title: {
  519. text: '雁门关AVC电压曲线'
  520. },
  521. subtitle: {
  522. text: ''
  523. },
  524. xAxis: {
  525. labels: {
  526. align: 'center',
  527. formatter: function() {
  528. return Highcharts.dateFormat('%H %M', this.value);
  529. }
  530. },
  531. //tickInterval: 10,
  532. type: 'datetime'
  533. },
  534. yAxis: [{
  535. title: {
  536. text: '电压(KV)'
  537. }
  538. }
  539. ],
  540. legend: {
  541. layout: 'vertical',
  542. align: 'right',
  543. verticalAlign: 'top',
  544. x:-60,
  545. floating: true
  546. },
  547. tooltip: {
  548. crosshairs:{//控制十字线
  549. width:2
  550. },
  551. shared:true,
  552. xDateFormat:'%Y-%m-%d %H:%M'
  553. },
  554. credits: {
  555. enabled: false
  556. },
  557. plotOptions: {
  558. spline: {
  559. dataLabels : {
  560. enabled :false
  561. },
  562. borderWidth: 0
  563. },
  564. series: {
  565. cursor: 'pointer',
  566. marker: {
  567. radius: 0,
  568. symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
  569. }
  570. }
  571. },
  572. series: [{
  573. type: 'spline',
  574. name: 'AVC母线电压实际值(单位:KV)',
  575. yAxis:0
  576. },
  577. {
  578. type: 'spline',
  579. name: 'AVC母线电压调控值(单位:KV)',
  580. yAxis:0
  581. }]
  582. };
  583. function agcLine(wpid,type){
  584. var url = "/agc/getAgcLine.action";
  585. if(type=="s"){
  586. url = "/agc/getAgcLineForSimple.action?wpid="+wpid;
  587. }
  588. $.ajax({
  589. url : url,
  590. type : "post",
  591. cache : false,
  592. dataType : "json",
  593. data : {},
  594. ifModified : false,
  595. success : function(result) {
  596. $.each(result, function(k, v) {
  597. //alert(k +"==" + v.length)
  598. var xdgl = [];
  599. var sjgl = [];
  600. var xtime =[];
  601. var ycgl = [];
  602. var llgl =[];
  603. var dqcr =[];
  604. var index=0;
  605. var count1=0;
  606. var count2=0;
  607. var count3=0;
  608. var count4=0;
  609. $.each(v, function(i,obj) {
  610. if(index<obj.value8){
  611. index++;
  612. if(obj.value3!=null){
  613. ycgl.push( parseFloat(obj.value3) );
  614. /*if(k=="KB_FDC"){
  615. dqcr.push(parseFloat(obj.value3*0.85));}*/
  616. }else{
  617. ycgl.push( null );
  618. }
  619. }
  620. if(count1 < obj.value6){
  621. if(obj.value1==null){
  622. sjgl.push(null);
  623. }else{
  624. sjgl.push(parseFloat(obj.value1));
  625. }
  626. count1++;
  627. }
  628. if(count2 < obj.value7){
  629. if(obj.value2==null){
  630. xdgl.push(null);
  631. }else{
  632. xdgl.push(parseFloat(obj.value2));
  633. }
  634. count2++;
  635. }
  636. if(count3 < obj.value5){
  637. if(obj.value4==null){
  638. llgl.push(null);
  639. }else{
  640. llgl.push(parseFloat(obj.value4));
  641. }
  642. count3++;
  643. }
  644. /*if(count4 < obj.value10){
  645. if(obj.value9==null){
  646. dqcr.push(0.0);
  647. }else{
  648. if(k=="KB_FDC"){
  649. }else{
  650. dqcr.push(parseFloat(obj.value9));
  651. }
  652. }
  653. count4++;
  654. }*/
  655. if(obj.time==null){
  656. xtime.push(null);
  657. }else{
  658. xtime.push(parseFloat(obj.time));
  659. }
  660. });
  661. if(k=="CL_FDC"){
  662. options1.series[0].data = sjgl;
  663. options1.series[1].data = xdgl;
  664. // options1.series[3].data = ycgl;
  665. options1.series[2].data = llgl;
  666. /*options1.series[4].data = dqcr;*/
  667. options1.xAxis.categories = xtime;
  668. chart1 = new Highcharts.Chart(options1);
  669. }else if(k=="KB_FDC"){
  670. options2.series[0].data = sjgl;
  671. options2.series[1].data = xdgl;
  672. // options2.series[3].data = ycgl;
  673. options2.series[2].data = llgl;
  674. /*options2.series[4].data = dqcr;*/
  675. options2.xAxis.categories = xtime;
  676. chart2 = new Highcharts.Chart(options2);
  677. }else if(k=="DX_FDC"){
  678. options3.series[0].data = sjgl;
  679. options3.series[1].data = xdgl;
  680. // options3.series[2].data = ycgl;
  681. options3.series[2].data = llgl;
  682. /*options3.series[4].data = dqcr;*/
  683. options3.xAxis.categories = xtime;
  684. chart3 = new Highcharts.Chart(options3);
  685. }
  686. });
  687. /*chart1 = new Highcharts.Chart(options1);
  688. chart2 = new Highcharts.Chart(options2);
  689. chart3 = new Highcharts.Chart(options3);*/
  690. }
  691. });
  692. }