view_36b7b6d4a7f4b236af7ce9795b3d383d.c
36.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
/*
Generated from client/settings/function/capture/noMotorVehicleViolation.esp
*/
#include "esp.h"
static void view_36b7b6d4a7f4b236af7ce9795b3d383d(HttpConn *conn) {
espRenderBlock(conn, "<!DOCTYPE html>\r\n\
<html>\r\n\
\r\n\
<head>\r\n\
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n\
<title></title>\r\n\
<link href=\"../../../css/frame.css\" rel=\"stylesheet\" />\r\n\
<link href=\"../../../scripts/easyui/themes/default/easyui.css\" rel=\"stylesheet\" />\r\n\
<link href=\"../../../scripts/easyui/themes/icon.css\" rel=\"stylesheet\" />\r\n\
<link rel=\"stylesheet\" href=\"../../../css/timeSpans.css\">\r\n\
<style type=\"text/css\">\r\n\
body,\r\n\
.panel-body {\r\n\
background-color: #F3F5F6;\r\n\
}\r\n\
\r\n\
.settingGroups {\r\n\
width: 100%;\r\n\
}\r\n\
\r\n\
.settingGroup {\r\n\
background-color: white;\r\n\
margin-top: 5px;\r\n\
border: 1px solid #99A1AD;\r\n\
}\r\n\
\r\n\
.settingGroup .groupTitle {\r\n\
height: 30px;\r\n\
line-height: 30px;\r\n\
background-color: #DBDFE5;\r\n\
\r\n\
text-align: center;\r\n\
font-weight: bold;\r\n\
}\r\n\
\r\n\
.settingItem {\r\n\
/*height: 30px;*/\r\n\
line-height: 21px;\r\n\
}\r\n\
\r\n\
.itemTitle {\r\n\
display: block;\r\n\
padding: 8px;\r\n\
background-color: #DBDFE5;\r\n\
border-bottom: 1px solid #99A1AD;\r\n\
border-top: 1px solid #99A1AD;\r\n\
}\r\n\
\r\n\
.itemTitle:hover {\r\n\
background-color: #BD0000;\r\n\
}\r\n\
\r\n\
.itemContent {\r\n\
display: block;\r\n\
padding: 4px;\r\n\
display: none;\r\n\
}\r\n\
\r\n\
.itemContent table {\r\n\
border: 0;\r\n\
border-collapse: collapse;\r\n\
width: 100%;\r\n\
}\r\n\
\r\n\
.itemContent table td {\r\n\
padding: 4px;\r\n\
}\r\n\
\r\n\
.itemContent table td.title,\r\n\
td.title {\r\n\
width: 240px;\r\n\
text-align: left;\r\n\
}\r\n\
\r\n\
.itemContent table td.content,\r\n\
td.content {\r\n\
padding: 3px;\r\n\
position: relative;\r\n\
}\r\n\
\r\n\
.title1 {\r\n\
width: 78px;\r\n\
}\r\n\
\r\n\
.content1 {\r\n\
margin-left: 13px;\r\n\
}\r\n\
\r\n\
.settingElement1 {\r\n\
width: 87px;\r\n\
height: 21px;\r\n\
border: 1px solid #99A1AD;\r\n\
}\r\n\
\r\n\
.itemContent table td.btn {\r\n\
padding: 3px;\r\n\
}\r\n\
\r\n\
.settingElement {\r\n\
width: 180px;\r\n\
height: 21px;\r\n\
border: 1px solid #99A1AD;\r\n\
}\r\n\
\r\n\
select.settingElement {\r\n\
height: 23px;\r\n\
}\r\n\
\r\n\
a.settingBtn {\r\n\
display: block;\r\n\
height: 23px;\r\n\
width: 98px;\r\n\
border: 0;\r\n\
background: url(../../../images/btn_bg.png) no-repeat 0 0;\r\n\
float: right;\r\n\
margin-right: 0;\r\n\
text-align: center;\r\n\
cursor: pointer;\r\n\
}\r\n\
\r\n\
.bottomArea .settingBtn {\r\n\
position: fixed;\r\n\
left: 5px;\r\n\
bottom: 5px;\r\n\
}\r\n\
\r\n\
a.settingBtn:active {\r\n\
background-position: 0 -23px;\r\n\
}\r\n\
\r\n\
.subTitle {\r\n\
width: 120px;\r\n\
}\r\n\
\r\n\
/*红灯设置*/\r\n\
\r\n\
table.redLight tr td.title {\r\n\
width: 300px;\r\n\
}\r\n\
\r\n\
.redLightSource1,\r\n\
.redLightSource2,\r\n\
.redLightSource3 {\r\n\
display: none;\r\n\
}\r\n\
\r\n\
.ocxOperateContainer {\r\n\
width: 100%;\r\n\
height: 100%;\r\n\
border-collapse: collapse;\r\n\
}\r\n\
\r\n\
/*抓拍解发条件*/\r\n\
\r\n\
.option_position {\r\n\
display: none;\r\n\
}\r\n\
\r\n\
/*----主页面布局------*/\r\n\
\r\n\
.mainDiv {\r\n\
background-color: #f3f5f6;\r\n\
overflow: hidden;\r\n\
width: 1256px;\r\n\
}\r\n\
\r\n\
#intersectionInfo {\r\n\
width: 100%;\r\n\
height: 100%;\r\n\
}\r\n\
\r\n\
.leftArea {\r\n\
width: 566px;\r\n\
padding: 0 4px;\r\n\
float: left;\r\n\
overflow: hidden;\r\n\
}\r\n\
\r\n\
.rightArea {\r\n\
position: relative;\r\n\
width: 670px;\r\n\
height: 1062px;\r\n\
max-height: 100%;\r\n\
overflow: hidden;\r\n\
float: right;\r\n\
}\r\n\
\r\n\
.rightArea .rightUpper {\r\n\
width: 100%;\r\n\
height: 600px;\r\n\
}\r\n\
\r\n\
.rightArea .rightLower {\r\n\
width: 650px;\r\n\
height: 462px;\r\n\
position: absolute;\r\n\
bottom: 0;\r\n\
right: 0;\r\n\
padding: 8px;\r\n\
border: 1px solid #7C8895;\r\n\
}\r\n\
\r\n\
.bottomArea {\r\n\
height: 42px;\r\n\
padding: 10px;\r\n\
clear: both;\r\n\
}\r\n\
\r\n\
.paramterTip {\r\n\
cursor: help\r\n\
}\r\n\
</style>\r\n\
</head>\r\n\
\r\n\
<body>\r\n\
<div class=\"mainDiv\">\r\n\
<form id=\"intersectionInfo\">\r\n\
<div class=\"leftArea\">\r\n\
<ul class=\"settingGroups\">\r\n\
<li class=\"settingGroup\">\r\n\
<div class=\"groupTitle\">\r\n\
违法监测\r\n\
</div>\r\n\
<Ul class=\"settingItem\">\r\n\
<li class=\"itemTitle\">行人闯红灯、非机动车逆行</li>\r\n\
<li class=\"itemContent\">\r\n\
<table>\r\n\
<tr>\r\n\
<td class=\"title\">\r\n\
<span class=\"paramterTip\" title=\"行人闯红灯、非机动车逆行共用参数\">开启时间段</span>\r\n\
</td>\r\n\
<td class=\"content\" style=\"position: relative\">\r\n\
<input type=\"text\" class=\"settingElement timeSpans\" id=\"600\" name=\"600\" readonly=\"true\" />\r\n\
<div class=\"timeSelector\">\r\n\
<ul class='timeSpanContainer'>\r\n\
</ul>\r\n\
<a class=\"timeSelectorAdd settingBtn\">添加时间段</a>\r\n\
<a class=\"timeSelectorSave settingBtn\">保存</a>\r\n\
</div>\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">\r\n\
<span class=\"paramterTip\" title=\"行人闯红灯、非机动车逆行共用参数\">第2张过停止线多少米</span>\r\n\
</td>\r\n\
<td class=\"content\">\r\n\
<input type=\"text\" class=\"settingElement\" id=\"601\" name=\"601\" value=\"\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">\r\n\
<span class=\"paramterTip\" title=\"行人闯红灯、非机动车逆行共用参数\">特写图抠图比例</span>\r\n\
</td>\r\n\
<td class=\"content\">\r\n\
<input type=\"text\" class=\"settingElement\" name=\"602\" id=\"602\">\r\n\
</td>\r\n\
</tr>\r\n\
</table>\r\n\
</li>\r\n\
<li class=\"itemContent\">\r\n\
<ul class=\"settingItem\">\r\n\
<li class=\"itemTitle\">\r\n\
<input class=\"checkboxAlign showTrigger\" id=\"603\" name=\"603\" type=\"checkbox\" />行人闯红灯\r\n\
</li>\r\n\
<li class=\"itemContent\">\r\n\
<table>\r\n\
<tr>\r\n\
<td class=\"title\">\r\n\
<span class=\"paramterTip\" title=\"如果上面共用参数: 开启时间段 已配置,则以上面参数为准\">开启时间\r\n\
</span>\r\n\
</td>\r\n\
<td style=\"position: relative\">\r\n\
<input type=\"text\" class=\"settingElement timeSpans\" id=\"604\" name=\"604\" readonly=\"true\" />\r\n\
<div class=\"timeSelector\">\r\n\
<ul class='timeSpanContainer'>\r\n\
</ul>\r\n\
<a class=\"timeSelectorAdd settingBtn\">添加时间段</a>\r\n\
<a class=\"timeSelectorSave settingBtn\">保存</a>\r\n\
</div>\r\n\
</td>\r\n\
</tr>\r\n\
</table>\r\n\
</li>\r\n\
</ul>\r\n\
</li>\r\n\
<li class=\"itemContent\">\r\n\
<ul class=\"settingItem\">\r\n\
<li class=\"itemTitle\">\r\n\
<input class=\"checkboxAlign showTrigger\" type=\"checkbox\" name=\"605\" id=\"605\" />非机动车逆行\r\n\
</li>\r\n\
<li class=\"itemContent\">\r\n\
<table>\r\n\
<tr>\r\n\
<td class=\"title\">\r\n\
<span class=\"paramterTip\" title=\"如果上面共用参数: 开启时间段 已配置,则以上面参数为准\">开启时间\r\n\
</span>\r\n\
</td>\r\n\
<td class=\"content\" style=\"position:relative\">\r\n\
<input type=\"text\" class=\"settingElement timeSpans\" name=\"606\" id=\"606\">\r\n\
<div class=\"timeSelector\">\r\n\
<ul class='timeSpanContainer'>\r\n\
</ul>\r\n\
<a class=\"timeSelectorAdd settingBtn\">添加时间段</a>\r\n\
<a class=\"timeSelectorSave settingBtn\">保存</a>\r\n\
</div>\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">最小撞线速度</td>\r\n\
<td class=\"content\">\r\n\
<input type=\"text\" class=\"settingElement\" name=\"607\" id=\"607\">\r\n\
</td>\r\n\
</tr>\r\n\
</table>\r\n\
</li>\r\n\
</ul>\r\n\
</li>\r\n\
</Ul>\r\n\
</li>\r\n\
\r\n\
<li class=\"settingGroup\">\r\n\
<div class=\"groupTitle\">\r\n\
事件监测\r\n\
</div>\r\n\
<ul class=\"settingItem\">\r\n\
<li class=\"itemTitle\">\r\n\
<input class=\"checkboxAlign showTrigger\" type=\"checkbox\" name=\"608\" id=\"608\" /> 流量统计\r\n\
</li>\r\n\
<li class=\"itemContent\">\r\n\
<table>\r\n\
<tr>\r\n\
<td class=\"title\">时间间隔</td>\r\n\
<td class=\"content\">\r\n\
<input class=\"settingElement\" name=\"609\" id=\"609\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td colspan=\"2\">\r\n\
<input class=\"checkboxAlign\" type=\"checkbox\" name=\"610\" id=\"610\" /> 在视频流上显示流量信息\r\n\
</td>\r\n\
</tr>\r\n\
</table>\r\n\
</li>\r\n\
</ul>\r\n\
</li>\r\n\
</ul>\r\n\
</div>\r\n\
<div class=\"rightArea\">\r\n\
<div class=\"rightUpper\">\r\n\
<object id=\"roiOcxObject\" classid=\"clsid:7E4DB96E-7A82-48DD-8376-7552E2D09170\" style=\"height: 530px; width: 100%;\">\r\n\
</object>\r\n\
\r\n\
<div style=\"height:30px;\">\r\n\
<a class=\"settingBtn\" style=\"float: left;\" id=\"capturePicture\">抓图</a>\r\n\
</div>\r\n\
\r\n\
</div>\r\n\
\r\n\
<div class=\"rightLower\">\r\n\
<table class=\"redLight\">\r\n\
<tr>\r\n\
<td class=\"title\">\r\n\
红灯最短时长(0-100秒)\r\n\
</td>\r\n\
<td class=\"title\">\r\n\
<input type=\"text\" class=\"settingElement\" name=\"401\" id=\"401\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">\r\n\
持续状态多长时间报警(秒)\r\n\
</td>\r\n\
<td class=\"title\">\r\n\
<input type=\"text\" class=\"settingElement\" name=\"402\" id=\"402\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">红灯开始后无效时长(秒)</td>\r\n\
<td class=\"content\">\r\n\
<input class=\"settingElement\" name=\"403\" id=\"403\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">红灯结束前无效时长(秒)</td>\r\n\
<td class=\"content\">\r\n\
<input class=\"settingElement\" name=\"404\" id=\"404\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td colspan=\"2\">\r\n\
<input class=\"checkboxAlign\" name=\"405\" id=\"405\" type=\"checkbox\" />红灯校正\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">校正灵敏度(1-100)</td>\r\n\
<td class=\"content\">\r\n\
<input class=\"settingElement\" name=\"406\" id=\"406\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">开始时间1</td>\r\n\
<td class=\"content\">\r\n\
<input type=\"text\" name=\"407\" id=\"407\" class=\"Wdate\" onclick=\"WdatePicker({ dateFmt: 'HH:mm:ss', maxDate: '#F{$dp.$D(\\'4071\\')||\\'23:59:59\\'}'});\"\r\n\
/>\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">结束时间1</td>\r\n\
<td class=\"content\">\r\n\
<input type=\"text\" name=\"4071\" id=\"4071\" class=\"Wdate\" onclick=\"WdatePicker({ dateFmt: 'HH:mm:ss', minDate: '#F{$dp.$D(\\'407\\')||\\'00:00:00\\'}' });\"\r\n\
/>\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">开始时间2</td>\r\n\
<td class=\"content\">\r\n\
<input type=\"text\" name=\"4072\" id=\"4072\" class=\"Wdate\" onclick=\"WdatePicker({ dateFmt: 'HH:mm:ss', maxDate: '#F{$dp.$D(\\'4073\\')||\\'23:59:59\\'}' });\"\r\n\
/>\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">结束时间2</td>\r\n\
<td class=\"content\">\r\n\
<input type=\"text\" name=\"4073\" id=\"4073\" class=\"Wdate\" onclick=\"WdatePicker({ dateFmt: 'HH:mm:ss', minDate: '#F{$dp.$D(\\'4072\\')||\\'00:00:00\\'}' });\"\r\n\
/>\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"title\">红灯信号源</td>\r\n\
<td class=\"content\">\r\n\
<select class=\"settingElement\" name=\"408\" id=\"408\">\r\n\
<option value=\"0\">视频识别</option>\r\n\
<option value=\"1\" disabled=\"disabled\">IO信号识别</option>\r\n\
<option value=\"2\">网络信号识别</option>\r\n\
<option value=\"3\" disabled=\"disabled\">串口信号识别</option>\r\n\
</select>\r\n\
</td>\r\n\
</tr>\r\n\
<tr class=\"redLightSource0\">\r\n\
<td class=\"title\">灯色最小饱和度(1-100)</td>\r\n\
<td class=\"content\">\r\n\
<input class=\"settingElement\" name=\"409\" id=\"409\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr class=\"redLightSource1\">\r\n\
<td class=\"title\">红灯检测器有效电平</td>\r\n\
<td class=\"content\">\r\n\
<select class=\"settingElement\" name=\"413\" id=\"413\">\r\n\
<option value=\"0\">高电平</option>\r\n\
<option value=\"1\">低电平</option>\r\n\
</select>\r\n\
</td>\r\n\
</tr>\r\n\
<tr class=\"redLightSource2\">\r\n\
<td class=\"title\">左转灯通道</td>\r\n\
<td class=\"content\">\r\n\
<input class=\"settingElement\" name=\"410\" id=\"410\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr class=\"redLightSource2\">\r\n\
<td class=\"title\">右转灯通道</td>\r\n\
<td class=\"content\">\r\n\
<input class=\"settingElement\" name=\"411\" id=\"411\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr class=\"redLightSource2\">\r\n\
<td class=\"title\">直行灯通道</td>\r\n\
<td class=\"content\">\r\n\
<input class=\"settingElement\" name=\"412\" id=\"412\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr class=\"redLightSource3\">\r\n\
<td class=\"title\">协议</td>\r\n\
<td class=\"content\">\r\n\
<select class=\"settingElement\" name=\"414\" id=\"414\">\r\n\
<option value=\"0\">协议1</option>\r\n\
<option value=\"1\">协议2</option>\r\n\
<option value=\"2\">协议3</option>\r\n\
<option value=\"3\">协议4</option>\r\n\
</select>\r\n\
</td>\r\n\
</tr>\r\n\
</table>\r\n\
</div>\r\n\
</div>\r\n\
<div class=\"bottomArea\">\r\n\
<a class=\"settingBtn\" id=\"btnSave\" style=\"float: left;\">保存</a>\r\n\
</div>\r\n\
", 21054);
inputSecurityToken(); espRenderBlock(conn, "\r\n\
</form>\r\n\
</div>\r\n\
<script src=\"../../../scripts/jquery-1.11.1.js\"></script>\r\n\
<script src=\"../../../scripts/easyui/jquery.easyui.min.js\"></script>\r\n\
<script src=\"../../../scripts/easyui/locale/easyui-lang-zh_CN.js\"></script>\r\n\
<script src=\"../../../scripts/utilities.js\"></script>\r\n\
<script src=\"../../../scripts/jquery.form.js\"></script>\r\n\
<script src=\"../../../scripts/jquery.validate.min.js\"></script>\r\n\
<script src=\"../../../scripts/jquery.validate.extend.js\"></script>\r\n\
<script src=\"../../../scripts/My97DatePicker/WdatePicker.js\"></script>\r\n\
<script src=\"captureSettingsCommon.js\"></script>\r\n\
<script type=\"text/javascript\">\r\n\
\r\n\
var ocxController;\r\n\
var showedDatepicker;//已经显示的\r\n\
//参数加载适配器 \r\n\
var parameterAdaptor = new ParameterAdaptor();\r\n\
var triggerBuffer = new Array();\r\n\
\r\n\
$().ready(function () {\r\n\
var ip = window.location.hostname;\r\n\
var roiOcxObject = document.getElementById(\"roiOcxObject\");\r\n\
\r\n\
ocxController = new ROIOcxController(roiOcxObject);\r\n\
try {\r\n\
var timestamp = new Date().getTime();\r\n\
ocxController.showPage();\r\n\
ocxController.loadUrlPage(\"http://\" + ip + \"/do/trafficController/roiOcxRequestEvent?EventType=1&t=\" + timestamp);\r\n\
ocxController.loadUrlXml(\"http://\" + ip + \"/do/trafficController/roiOcxRequestEvent?EventType=2&t=\" + timestamp);\r\n\
} catch (err) {\r\n\
if (console)\r\n\
console.error(\"ROI:\" + err.name + \"->\" + err.message);\r\n\
}\r\n\
\r\n\
// 加载参数\r\n\
setTimeout(loadCaptureSettings, 200);\r\n\
// 保存参数\r\n\
$(\"#btnSave\").click(saveParametersToServer);\r\n\
// 抓拍图片\r\n\
$(\"#capturePicture\").click(exportPicture);\r\n\
\r\n\
//红灯信号源\r\n\
$(\"#408\").change(redLightHandler);\r\n\
\r\n\
$(\"#intersectionInfo input:checkbox\").click(onCheckboxClicked);\r\n\
$(\".itemTitle\").click(showOrHidenSettingItem);\r\n\
\r\n\
//验证表单\r\n\
validateForm();\r\n\
});\r\n\
\r\n\
function validateForm() {\r\n\
var rules = {\r\n\
601: {\r\n\
number: true,\r\n\
validMinusZero: true\r\n\
},\r\n\
602: {\r\n\
number: true,\r\n\
validMinusZero: true\r\n\
},\r\n\
607: {\r\n\
number: true,\r\n\
validMinusZero: true\r\n\
},\r\n\
609: {\r\n\
range: [0, 65535],\r\n\
digits: true\r\n\
},\r\n\
401: {\r\n\
range: [0, 100],\r\n\
digits: true\r\n\
},\r\n\
402: {\r\n\
range: [30, 86400],\r\n\
digits: true\r\n\
},\r\n\
403: {\r\n\
range: [0, 10],\r\n\
digits: true\r\n\
},\r\n\
404: {\r\n\
range: [0, 10],\r\n\
digits: true\r\n\
},\r\n\
406: {\r\n\
range: [1, 100],\r\n\
digits: true\r\n\
},\r\n\
409: {\r\n\
range: [1, 100],\r\n\
digits: true\r\n\
}\r\n\
};\r\n\
rules[393] = rules[394]\r\n\
= rules[395] = rules[396] = rules[397] = rules[398] = rules[399] = rules[400]\r\n\
= { digits: true };\r\n\
rules[410] = rules[411] = rules[412] = {\r\n\
range: [1, 12],\r\n\
digits: true\r\n\
};\r\n\
rules[290] = rules[389] = rules[391] = { ip: true };\r\n\
$(\"#intersectionInfo\").validate({\r\n\
rules: rules\r\n\
});\r\n\
}\r\n\
\r\n\
//红灯信号源监听事件\r\n\
function redLightHandler(event) {\r\n\
var selectedValue = $(\"#408\").val();\r\n\
\r\n\
var s0 = $(\".redLightSource0\");\r\n\
var s1 = $(\".redLightSource1\");\r\n\
var s2 = $(\".redLightSource2\");\r\n\
var s3 = $(\".redLightSource3\");\r\n\
\r\n\
switch (selectedValue) {\r\n\
case \"0\":\r\n\
s0.show();\r\n\
s1.hide();\r\n\
s2.hide();\r\n\
s3.hide();\r\n\
break;\r\n\
case \"1\":\r\n\
s0.hide();\r\n\
s1.show();\r\n\
s2.hide();\r\n\
s3.hide();\r\n\
break;\r\n\
case \"2\":\r\n\
s0.hide();\r\n\
s1.hide();\r\n\
s2.show();\r\n\
s3.hide();\r\n\
break;\r\n\
case \"3\":\r\n\
s0.hide();\r\n\
s1.hide();\r\n\
s2.hide();\r\n\
s3.show();\r\n\
break;\r\n\
default:\r\n\
break;\r\n\
}\r\n\
}\r\n\
//checkbox点击事件\r\n\
function onCheckboxClicked(event) {\r\n\
var self = $(event.currentTarget);\r\n\
\r\n\
var panel;\r\n\
//更改Value\r\n\
self.val(this.checked + 0 + \"\");\r\n\
\r\n\
if (self.hasClass(\"relativeToTrigger\")) {\r\n\
var parent = $(event.currentTarget).parents(\".settingItem\");\r\n\
var checkedCount = parent.find(\".relativeToTrigger:checked\").length;\r\n\
panel = self.parents(\".itemContent\");\r\n\
var switchCheckbox = self.parents(\".itemContent\").siblings(\".itemTitle\").find(\"input:checkbox\");\r\n\
switchCheckbox.prop(\"checked\", !(checkedCount == 0)).val(checkedCount == 0 ? \"0\" : \"1\");\r\n\
}\r\n\
\r\n\
if (self.hasClass(\"showTrigger\")) {\r\n\
//显示对应详细设置项\r\n\
panel = self.parent().siblings(\".itemContent\");\r\n\
\r\n\
panel.find(\".relativeToTrigger\").prop(\"checked\", this.checked).val(this.checked + 0 + \"\");\r\n\
}\r\n\
event.stopPropagation();\r\n\
}\r\n\
\r\n\
function showOrHidenSettingItem(event) {\r\n\
var self = $(event.currentTarget);\r\n\
self.siblings(\".itemContent\").toggle();\r\n\
}\r\n\
\r\n\
//更新设置项的UI(主要是是否展开详细设置)\r\n\
function updateSettingItemUI() {\r\n\
\r\n\
var itemTriggers = $(\".showTrigger\");\r\n\
var currentObj;\r\n\
var isOpen = false;\r\n\
itemTriggers.each(function (index) {\r\n\
isOpen = false;\r\n\
currentObj = $(this);\r\n\
var isChecked = currentObj.is(\":checked\");\r\n\
if (isChecked) {\r\n\
isOpen = true;\r\n\
} else {\r\n\
//有一种情况是要根据底下的选项来决定是否选中\r\n\
var relativeTriggers = currentObj.parents(\".settingItem\").find(\".relativeToTrigger:checked\");\r\n\
isOpen = relativeTriggers.length > 0;\r\n\
if (isOpen) {\r\n\
currentObj.prop(\"checked\", \"checked\");\r\n\
}\r\n\
}\r\n\
\r\n\
if (isOpen) {\r\n\
currentObj.parent().siblings(\".itemContent\").show();\r\n\
}\r\n\
});\r\n\
//更新右下角红灯\r\n\
redLightHandler();\r\n\
}\r\n\
\r\n\
function exportPicture() {\r\n\
var url = \"/do/trafficController/capturePicture\";\r\n\
window.open(url);\r\n\
}\r\n\
\r\n\
//加载抓拍参数信息\r\n\
function loadCaptureSettings() {\r\n\
var refererInfo = \"intersection\";\r\n\
parameterAdaptor.getParameters(refererInfo, function (data) {\r\n\
//性能太烂,自己绑定值\r\n\
//$(\"#intersectionInfo\").form(\"load\", data.feedback);\r\n\
bindFormData($(\"#intersectionInfo\"), data.feedback);\r\n\
//更新UI\r\n\
updateSettingItemUI();\r\n\
});\r\n\
}\r\n\
\r\n\
function bindFormData(formObj, data) {\r\n\
var element;\r\n\
var elementType;\r\n\
for (var key in data) {\r\n\
element = formObj.find(\"#\" + key);\r\n\
//如果使用id没有找到,则改为使用name来查找对象,增加容错性\r\n\
if (element.length == 0) {\r\n\
element = formObj.find(\"[name='\" + key + \"']\");\r\n\
}\r\n\
elementType = element.attr(\"type\");\r\n\
if (elementType == \"checkbox\") {\r\n\
element.prop(\"checked\", data[key] == \"on\" ? \"checked\" : \"\");\r\n\
} else {\r\n\
element.val(data[key]);\r\n\
}\r\n\
}\r\n\
}\r\n\
\r\n\
//显示已更改的值\r\n\
function showChangedValue(newValue, oldValue) {\r\n\
var id = $(this).attr(\"id\").split(\"_\")[1];\r\n\
$(\"#\" + id).val(newValue);\r\n\
}\r\n\
\r\n\
//提交参数到服务器保存\r\n\
function saveParametersToServer() {\r\n\
var formObj = $(\"#intersectionInfo\");\r\n\
//验证参数\r\n\
if (!formObj.valid()) {\r\n\
$(\"#roiOcxObject\").hide();\r\n\
\r\n\
$.messager.alert(\"提示\", \"参数验证有误,请修改后再提交!\", \"error\", function () {\r\n\
$(\"#roiOcxObject\").show();\r\n\
});\r\n\
return;\r\n\
}\r\n\
parameterAdaptor.saveParameters(formObj);\r\n\
}\r\n\
</script>\r\n\
\r\n\
<!-- 捕获ocx控件roiOcxObject抛出的事件 -->\r\n\
<script type=\"text/javascript\" for=\"roiOcxObject\" event=\"roiRequestEvent(EventType, szParam1, nParam2)\">\r\n\
//var roiRequestUrl = \"/do/trafficController/roiOcxRequestEvent?EventType=\" + EventType;\r\n\
if (ocxController != null) {\r\n\
var ip = window.location.hostname;\r\n\
if (EventType == 1) {\r\n\
ocxController.loadUrlPage(\"http://\" + ip + \"/do/trafficController/roiOcxRequestEvent?EventType=1\");\r\n\
} else if (EventType == 2) {\r\n\
ocxController.loadUrlXml(\"http://\" + ip + \"/do/trafficController/roiOcxRequestEvent?EventType=2\");\r\n\
}\r\n\
} \r\n\
</script>\r\n\
\r\n\
<script type=\"text/javascript\" for=\"roiOcxObject\" event=\"roiResponseEvent(EventType, szParam1, szParam2, nParam3)\">\r\n\
var roiRequestUrl = \"/do/trafficController/roiOcxResponseEvent?EventType=\" + EventType;\r\n\
//var roiRequestUrl = \"/do/trafficController/importRoiXml\";\r\n\
var szJson = {};\r\n\
szJson[\"paramXml\"] = szParam2;\r\n\
\r\n\
//添加securityToken\r\n\
var securityToken = document.getElementsByName(\"-xsrf-\");\r\n\
if (securityToken.length > 0) {\r\n\
szJson[\"-xsrf-\"] = securityToken[0].value;\r\n\
} else {\r\n\
alert(\"securityToken为空!不能提交!\");\r\n\
}\r\n\
\r\n\
$.post(roiRequestUrl, szJson, function (data) {\r\n\
if (!data.error) {\r\n\
$.messager.show({\r\n\
title: '结果',\r\n\
msg: 'roiResponseEvent:' + 'Event=' + EventType + ' 事件提交失败!原因:' + data.feedback.Msg,\r\n\
timeout: 0,\r\n\
showType: 'slide'\r\n\
});\r\n\
} else {\r\n\
$.messager.show({\r\n\
title: '结果',\r\n\
msg: 'roiResponseEvent:' + 'Event=' + EventType + '事件提交成功!',\r\n\
timeout: 3000,\r\n\
showType: 'slide'\r\n\
});\r\n\
}\r\n\
}, \"json\");\r\n\
</script>\r\n\
\r\n\
</body>\r\n\
\r\n\
</html>", 11661);
}
ESP_EXPORT int esp_view_36b7b6d4a7f4b236af7ce9795b3d383d(HttpRoute *route, MprModule *module) {
espDefineView(route, "client/settings/function/capture/noMotorVehicleViolation.esp", view_36b7b6d4a7f4b236af7ce9795b3d383d);
return 0;
}