noMotorVehicleViolation.esp
31.2 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="../../../css/frame.css" rel="stylesheet" />
<link href="../../../scripts/easyui/themes/default/easyui.css" rel="stylesheet" />
<link href="../../../scripts/easyui/themes/icon.css" rel="stylesheet" />
<link rel="stylesheet" href="../../../css/timeSpans.css">
<style type="text/css">
body,
.panel-body {
background-color: #F3F5F6;
}
.settingGroups {
width: 100%;
}
.settingGroup {
background-color: white;
margin-top: 5px;
border: 1px solid #99A1AD;
}
.settingGroup .groupTitle {
height: 30px;
line-height: 30px;
background-color: #DBDFE5;
text-align: center;
font-weight: bold;
}
.settingItem {
/*height: 30px;*/
line-height: 21px;
}
.itemTitle {
display: block;
padding: 8px;
background-color: #DBDFE5;
border-bottom: 1px solid #99A1AD;
border-top: 1px solid #99A1AD;
}
.itemTitle:hover {
background-color: #BD0000;
}
.itemContent {
display: block;
padding: 4px;
display: none;
}
.itemContent table {
border: 0;
border-collapse: collapse;
width: 100%;
}
.itemContent table td {
padding: 4px;
}
.itemContent table td.title,
td.title {
width: 240px;
text-align: left;
}
.itemContent table td.content,
td.content {
padding: 3px;
position: relative;
}
.title1 {
width: 78px;
}
.content1 {
margin-left: 13px;
}
.settingElement1 {
width: 87px;
height: 21px;
border: 1px solid #99A1AD;
}
.itemContent table td.btn {
padding: 3px;
}
.settingElement {
width: 180px;
height: 21px;
border: 1px solid #99A1AD;
}
select.settingElement {
height: 23px;
}
a.settingBtn {
display: block;
height: 23px;
width: 98px;
border: 0;
background: url(../../../images/btn_bg.png) no-repeat 0 0;
float: right;
margin-right: 0;
text-align: center;
cursor: pointer;
}
.bottomArea .settingBtn {
position: fixed;
left: 5px;
bottom: 5px;
}
a.settingBtn:active {
background-position: 0 -23px;
}
.subTitle {
width: 120px;
}
/*红灯设置*/
table.redLight tr td.title {
width: 300px;
}
.redLightSource1,
.redLightSource2,
.redLightSource3 {
display: none;
}
.ocxOperateContainer {
width: 100%;
height: 100%;
border-collapse: collapse;
}
/*抓拍解发条件*/
.option_position {
display: none;
}
/*----主页面布局------*/
.mainDiv {
background-color: #f3f5f6;
overflow: hidden;
width: 1256px;
}
#intersectionInfo {
width: 100%;
height: 100%;
}
.leftArea {
width: 566px;
padding: 0 4px;
float: left;
overflow: hidden;
}
.rightArea {
position: relative;
width: 670px;
height: 1062px;
max-height: 100%;
overflow: hidden;
float: right;
}
.rightArea .rightUpper {
width: 100%;
height: 600px;
}
.rightArea .rightLower {
width: 650px;
height: 462px;
position: absolute;
bottom: 0;
right: 0;
padding: 8px;
border: 1px solid #7C8895;
}
.bottomArea {
height: 42px;
padding: 10px;
clear: both;
}
.paramterTip {
cursor: help
}
</style>
</head>
<body>
<div class="mainDiv">
<form id="intersectionInfo">
<div class="leftArea">
<ul class="settingGroups">
<li class="settingGroup">
<div class="groupTitle">
违法监测
</div>
<Ul class="settingItem">
<li class="itemTitle">行人闯红灯、非机动车逆行</li>
<li class="itemContent">
<table>
<tr>
<td class="title">
<span class="paramterTip" title="行人闯红灯、非机动车逆行共用参数">开启时间段</span>
</td>
<td class="content" style="position: relative">
<input type="text" class="settingElement timeSpans" id="600" name="600" readonly="true" />
<div class="timeSelector">
<ul class='timeSpanContainer'>
</ul>
<a class="timeSelectorAdd settingBtn">添加时间段</a>
<a class="timeSelectorSave settingBtn">保存</a>
</div>
</td>
</tr>
<tr>
<td class="title">
<span class="paramterTip" title="行人闯红灯、非机动车逆行共用参数">第2张过停止线多少米</span>
</td>
<td class="content">
<input type="text" class="settingElement" id="601" name="601" value="" />
</td>
</tr>
<tr>
<td class="title">
<span class="paramterTip" title="行人闯红灯、非机动车逆行共用参数">特写图抠图比例</span>
</td>
<td class="content">
<input type="text" class="settingElement" name="602" id="602">
</td>
</tr>
</table>
</li>
<li class="itemContent">
<ul class="settingItem">
<li class="itemTitle">
<input class="checkboxAlign showTrigger" id="603" name="603" type="checkbox" />行人闯红灯
</li>
<li class="itemContent">
<table>
<tr>
<td class="title">
<span class="paramterTip" title="如果上面共用参数: 开启时间段 已配置,则以上面参数为准">开启时间
</span>
</td>
<td style="position: relative">
<input type="text" class="settingElement timeSpans" id="604" name="604" readonly="true" />
<div class="timeSelector">
<ul class='timeSpanContainer'>
</ul>
<a class="timeSelectorAdd settingBtn">添加时间段</a>
<a class="timeSelectorSave settingBtn">保存</a>
</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
<li class="itemContent">
<ul class="settingItem">
<li class="itemTitle">
<input class="checkboxAlign showTrigger" type="checkbox" name="605" id="605" />非机动车逆行
</li>
<li class="itemContent">
<table>
<tr>
<td class="title">
<span class="paramterTip" title="如果上面共用参数: 开启时间段 已配置,则以上面参数为准">开启时间
</span>
</td>
<td class="content" style="position:relative">
<input type="text" class="settingElement timeSpans" name="606" id="606">
<div class="timeSelector">
<ul class='timeSpanContainer'>
</ul>
<a class="timeSelectorAdd settingBtn">添加时间段</a>
<a class="timeSelectorSave settingBtn">保存</a>
</div>
</td>
</tr>
<tr>
<td class="title">最小撞线速度</td>
<td class="content">
<input type="text" class="settingElement" name="607" id="607">
</td>
</tr>
</table>
</li>
</ul>
</li>
</Ul>
</li>
<li class="settingGroup">
<div class="groupTitle">
事件监测
</div>
<ul class="settingItem">
<li class="itemTitle">
<input class="checkboxAlign showTrigger" type="checkbox" name="608" id="608" /> 流量统计
</li>
<li class="itemContent">
<table>
<tr>
<td class="title">时间间隔</td>
<td class="content">
<input class="settingElement" name="609" id="609" type="text" />
</td>
</tr>
<tr>
<td colspan="2">
<input class="checkboxAlign" type="checkbox" name="610" id="610" /> 在视频流上显示流量信息
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="rightArea">
<div class="rightUpper">
<object id="roiOcxObject" classid="clsid:7E4DB96E-7A82-48DD-8376-7552E2D09170" style="height: 530px; width: 100%;">
</object>
<div style="height:30px;">
<a class="settingBtn" style="float: left;" id="capturePicture">抓图</a>
</div>
</div>
<div class="rightLower">
<table class="redLight">
<tr>
<td class="title">
红灯最短时长(0-100秒)
</td>
<td class="title">
<input type="text" class="settingElement" name="401" id="401" />
</td>
</tr>
<tr>
<td class="title">
持续状态多长时间报警(秒)
</td>
<td class="title">
<input type="text" class="settingElement" name="402" id="402" />
</td>
</tr>
<tr>
<td class="title">红灯开始后无效时长(秒)</td>
<td class="content">
<input class="settingElement" name="403" id="403" type="text" />
</td>
</tr>
<tr>
<td class="title">红灯结束前无效时长(秒)</td>
<td class="content">
<input class="settingElement" name="404" id="404" type="text" />
</td>
</tr>
<tr>
<td colspan="2">
<input class="checkboxAlign" name="405" id="405" type="checkbox" />红灯校正
</td>
</tr>
<tr>
<td class="title">校正灵敏度(1-100)</td>
<td class="content">
<input class="settingElement" name="406" id="406" type="text" />
</td>
</tr>
<tr>
<td class="title">开始时间1</td>
<td class="content">
<input type="text" name="407" id="407" class="Wdate" onclick="WdatePicker({ dateFmt: 'HH:mm:ss', maxDate: '#F{$dp.$D(\'4071\')||\'23:59:59\'}'});"
/>
</td>
</tr>
<tr>
<td class="title">结束时间1</td>
<td class="content">
<input type="text" name="4071" id="4071" class="Wdate" onclick="WdatePicker({ dateFmt: 'HH:mm:ss', minDate: '#F{$dp.$D(\'407\')||\'00:00:00\'}' });"
/>
</td>
</tr>
<tr>
<td class="title">开始时间2</td>
<td class="content">
<input type="text" name="4072" id="4072" class="Wdate" onclick="WdatePicker({ dateFmt: 'HH:mm:ss', maxDate: '#F{$dp.$D(\'4073\')||\'23:59:59\'}' });"
/>
</td>
</tr>
<tr>
<td class="title">结束时间2</td>
<td class="content">
<input type="text" name="4073" id="4073" class="Wdate" onclick="WdatePicker({ dateFmt: 'HH:mm:ss', minDate: '#F{$dp.$D(\'4072\')||\'00:00:00\'}' });"
/>
</td>
</tr>
<tr>
<td class="title">红灯信号源</td>
<td class="content">
<select class="settingElement" name="408" id="408">
<option value="0">视频识别</option>
<option value="1" disabled="disabled">IO信号识别</option>
<option value="2">网络信号识别</option>
<option value="3" disabled="disabled">串口信号识别</option>
</select>
</td>
</tr>
<tr class="redLightSource0">
<td class="title">灯色最小饱和度(1-100)</td>
<td class="content">
<input class="settingElement" name="409" id="409" type="text" />
</td>
</tr>
<tr class="redLightSource1">
<td class="title">红灯检测器有效电平</td>
<td class="content">
<select class="settingElement" name="413" id="413">
<option value="0">高电平</option>
<option value="1">低电平</option>
</select>
</td>
</tr>
<tr class="redLightSource2">
<td class="title">左转灯通道</td>
<td class="content">
<input class="settingElement" name="410" id="410" type="text" />
</td>
</tr>
<tr class="redLightSource2">
<td class="title">右转灯通道</td>
<td class="content">
<input class="settingElement" name="411" id="411" type="text" />
</td>
</tr>
<tr class="redLightSource2">
<td class="title">直行灯通道</td>
<td class="content">
<input class="settingElement" name="412" id="412" type="text" />
</td>
</tr>
<tr class="redLightSource3">
<td class="title">协议</td>
<td class="content">
<select class="settingElement" name="414" id="414">
<option value="0">协议1</option>
<option value="1">协议2</option>
<option value="2">协议3</option>
<option value="3">协议4</option>
</select>
</td>
</tr>
</table>
</div>
</div>
<div class="bottomArea">
<a class="settingBtn" id="btnSave" style="float: left;">保存</a>
</div>
<% inputSecurityToken(); %>
</form>
</div>
<script src="../../../scripts/jquery-1.11.1.js"></script>
<script src="../../../scripts/easyui/jquery.easyui.min.js"></script>
<script src="../../../scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
<script src="../../../scripts/utilities.js"></script>
<script src="../../../scripts/jquery.form.js"></script>
<script src="../../../scripts/jquery.validate.min.js"></script>
<script src="../../../scripts/jquery.validate.extend.js"></script>
<script src="../../../scripts/My97DatePicker/WdatePicker.js"></script>
<script src="captureSettingsCommon.js"></script>
<script type="text/javascript">
var ocxController;
var showedDatepicker;//已经显示的
//参数加载适配器
var parameterAdaptor = new ParameterAdaptor();
var triggerBuffer = new Array();
$().ready(function () {
var ip = window.location.hostname;
var roiOcxObject = document.getElementById("roiOcxObject");
ocxController = new ROIOcxController(roiOcxObject);
try {
var timestamp = new Date().getTime();
ocxController.showPage();
ocxController.loadUrlPage("http://" + ip + "/do/trafficController/roiOcxRequestEvent?EventType=1&t=" + timestamp);
ocxController.loadUrlXml("http://" + ip + "/do/trafficController/roiOcxRequestEvent?EventType=2&t=" + timestamp);
} catch (err) {
if (console)
console.error("ROI:" + err.name + "->" + err.message);
}
// 加载参数
setTimeout(loadCaptureSettings, 200);
// 保存参数
$("#btnSave").click(saveParametersToServer);
// 抓拍图片
$("#capturePicture").click(exportPicture);
//红灯信号源
$("#408").change(redLightHandler);
$("#intersectionInfo input:checkbox").click(onCheckboxClicked);
$(".itemTitle").click(showOrHidenSettingItem);
//验证表单
validateForm();
});
function validateForm() {
var rules = {
601: {
number: true,
validMinusZero: true
},
602: {
number: true,
validMinusZero: true
},
607: {
number: true,
validMinusZero: true
},
609: {
range: [0, 65535],
digits: true
},
401: {
range: [0, 100],
digits: true
},
402: {
range: [30, 86400],
digits: true
},
403: {
range: [0, 10],
digits: true
},
404: {
range: [0, 10],
digits: true
},
406: {
range: [1, 100],
digits: true
},
409: {
range: [1, 100],
digits: true
}
};
rules[393] = rules[394]
= rules[395] = rules[396] = rules[397] = rules[398] = rules[399] = rules[400]
= { digits: true };
rules[410] = rules[411] = rules[412] = {
range: [1, 12],
digits: true
};
rules[290] = rules[389] = rules[391] = { ip: true };
$("#intersectionInfo").validate({
rules: rules
});
}
//红灯信号源监听事件
function redLightHandler(event) {
var selectedValue = $("#408").val();
var s0 = $(".redLightSource0");
var s1 = $(".redLightSource1");
var s2 = $(".redLightSource2");
var s3 = $(".redLightSource3");
switch (selectedValue) {
case "0":
s0.show();
s1.hide();
s2.hide();
s3.hide();
break;
case "1":
s0.hide();
s1.show();
s2.hide();
s3.hide();
break;
case "2":
s0.hide();
s1.hide();
s2.show();
s3.hide();
break;
case "3":
s0.hide();
s1.hide();
s2.hide();
s3.show();
break;
default:
break;
}
}
//checkbox点击事件
function onCheckboxClicked(event) {
var self = $(event.currentTarget);
var panel;
//更改Value
self.val(this.checked + 0 + "");
if (self.hasClass("relativeToTrigger")) {
var parent = $(event.currentTarget).parents(".settingItem");
var checkedCount = parent.find(".relativeToTrigger:checked").length;
panel = self.parents(".itemContent");
var switchCheckbox = self.parents(".itemContent").siblings(".itemTitle").find("input:checkbox");
switchCheckbox.prop("checked", !(checkedCount == 0)).val(checkedCount == 0 ? "0" : "1");
}
if (self.hasClass("showTrigger")) {
//显示对应详细设置项
panel = self.parent().siblings(".itemContent");
panel.find(".relativeToTrigger").prop("checked", this.checked).val(this.checked + 0 + "");
}
event.stopPropagation();
}
function showOrHidenSettingItem(event) {
var self = $(event.currentTarget);
self.siblings(".itemContent").toggle();
}
//更新设置项的UI(主要是是否展开详细设置)
function updateSettingItemUI() {
var itemTriggers = $(".showTrigger");
var currentObj;
var isOpen = false;
itemTriggers.each(function (index) {
isOpen = false;
currentObj = $(this);
var isChecked = currentObj.is(":checked");
if (isChecked) {
isOpen = true;
} else {
//有一种情况是要根据底下的选项来决定是否选中
var relativeTriggers = currentObj.parents(".settingItem").find(".relativeToTrigger:checked");
isOpen = relativeTriggers.length > 0;
if (isOpen) {
currentObj.prop("checked", "checked");
}
}
if (isOpen) {
currentObj.parent().siblings(".itemContent").show();
}
});
//更新右下角红灯
redLightHandler();
}
function exportPicture() {
var url = "/do/trafficController/capturePicture";
window.open(url);
}
//加载抓拍参数信息
function loadCaptureSettings() {
var refererInfo = "intersection";
parameterAdaptor.getParameters(refererInfo, function (data) {
//性能太烂,自己绑定值
//$("#intersectionInfo").form("load", data.feedback);
bindFormData($("#intersectionInfo"), data.feedback);
//更新UI
updateSettingItemUI();
});
}
function bindFormData(formObj, data) {
var element;
var elementType;
for (var key in data) {
element = formObj.find("#" + key);
//如果使用id没有找到,则改为使用name来查找对象,增加容错性
if (element.length == 0) {
element = formObj.find("[name='" + key + "']");
}
elementType = element.attr("type");
if (elementType == "checkbox") {
element.prop("checked", data[key] == "on" ? "checked" : "");
} else {
element.val(data[key]);
}
}
}
//显示已更改的值
function showChangedValue(newValue, oldValue) {
var id = $(this).attr("id").split("_")[1];
$("#" + id).val(newValue);
}
//提交参数到服务器保存
function saveParametersToServer() {
var formObj = $("#intersectionInfo");
//验证参数
if (!formObj.valid()) {
$("#roiOcxObject").hide();
$.messager.alert("提示", "参数验证有误,请修改后再提交!", "error", function () {
$("#roiOcxObject").show();
});
return;
}
parameterAdaptor.saveParameters(formObj);
}
</script>
<!-- 捕获ocx控件roiOcxObject抛出的事件 -->
<script type="text/javascript" for="roiOcxObject" event="roiRequestEvent(EventType, szParam1, nParam2)">
//var roiRequestUrl = "/do/trafficController/roiOcxRequestEvent?EventType=" + EventType;
if (ocxController != null) {
var ip = window.location.hostname;
if (EventType == 1) {
ocxController.loadUrlPage("http://" + ip + "/do/trafficController/roiOcxRequestEvent?EventType=1");
} else if (EventType == 2) {
ocxController.loadUrlXml("http://" + ip + "/do/trafficController/roiOcxRequestEvent?EventType=2");
}
}
</script>
<script type="text/javascript" for="roiOcxObject" event="roiResponseEvent(EventType, szParam1, szParam2, nParam3)">
var roiRequestUrl = "/do/trafficController/roiOcxResponseEvent?EventType=" + EventType;
//var roiRequestUrl = "/do/trafficController/importRoiXml";
var szJson = {};
szJson["paramXml"] = szParam2;
//添加securityToken
var securityToken = document.getElementsByName("-xsrf-");
if (securityToken.length > 0) {
szJson["-xsrf-"] = securityToken[0].value;
} else {
alert("securityToken为空!不能提交!");
}
$.post(roiRequestUrl, szJson, function (data) {
if (!data.error) {
$.messager.show({
title: '结果',
msg: 'roiResponseEvent:' + 'Event=' + EventType + ' 事件提交失败!原因:' + data.feedback.Msg,
timeout: 0,
showType: 'slide'
});
} else {
$.messager.show({
title: '结果',
msg: 'roiResponseEvent:' + 'Event=' + EventType + '事件提交成功!',
timeout: 3000,
showType: 'slide'
});
}
}, "json");
</script>
</body>
</html>