view_2c635105f8784a8a83832244f5c2f3ab.c
17.7 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
/*
Generated from client/settings/function/capture/busSetting.esp
*/
#include "esp.h"
static void view_2c635105f8784a8a83832244f5c2f3ab(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\
<style type=\"text/css\">\r\n\
body {\r\n\
min-width: 1256px;\r\n\
}\r\n\
\r\n\
.mainDiv {\r\n\
background-color: #f3f5f6;\r\n\
overflow: hidden;\r\n\
/* width: 1256px; */\r\n\
width: 100%;\r\n\
}\r\n\
\r\n\
.leftArea {\r\n\
width: 566px;\r\n\
height: 570px;\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: 570px;\r\n\
max-height: 100%;\r\n\
overflow: hidden;\r\n\
float: left;\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\
.rightArea .rightLower table.redLight {}\r\n\
\r\n\
.bottomArea {\r\n\
height: 800px;\r\n\
width: 100%;\r\n\
/* padding: 10px; */\r\n\
clear: both;\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\
</style>\r\n\
</head>\r\n\
\r\n\
<body>\r\n\
<div class=\"mainDiv\">\r\n\
<form id=\"busConfigInfo\">\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\
<table class=\"settingsContainer\">\r\n\
<tr>\r\n\
<td class=\"tdContent\" colspan=\"2\">\r\n\
<input id=\"540\" name=\"540\" type=\"checkbox\" class=\"checkboxAlign\" />无条件检测黄线\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdTitle\">\r\n\
车牌识别置信度阈值\r\n\
</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"541\" name=\"541\" class=\"settingParameter needReboot\" onkeyup=\"value=value.replace(/[^\\d]/g,'')\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdTitle\">\r\n\
报警的黄线条件\r\n\
</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"542\" name=\"542\" class=\"settingParameter needReboot\" onkeyup=\"value=value.replace(/[^\\d]/g,'')\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdContent\" colspan=\"2\">\r\n\
<input id=\"543\" name=\"543\" type=\"checkbox\" class=\"checkboxAlign\" />报警必须有视频\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdTitle\">\r\n\
GPS距路段最大偏移\r\n\
</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"544\" name=\"544\" class=\"settingParameter needReboot\" onkeyup=\"value=value.replace(/[^\\d]/g,'')\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdContent\" colspan=\"2\">\r\n\
<input id=\"545\" name=\"545\" type=\"checkbox\" class=\"checkboxAlign\" />开启路段GPS过滤\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdContent\" colspan=\"2\">\r\n\
<input id=\"546\" name=\"546\" type=\"checkbox\" class=\"checkboxAlign\" />开启限行时间段过滤\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdTitle\">\r\n\
路口最大距离(m)\r\n\
</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"547\" name=\"547\" class=\"settingParameter needReboot\" onkeyup=\"value=value.replace(/[^\\d]/g,'')\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdTitle\">\r\n\
GPS差值间隔(ms)\r\n\
</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"548\" name=\"548\" class=\"settingParameter needReboot\" onkeyup=\"value=value.replace(/[^\\d]/g,'')\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdTitle\">\r\n\
抓拍时间间隔\r\n\
<br>(200-10000ms)\r\n\
</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"2011005\" name=\"2011005\" class=\"settingParameter\" onkeyup=\"value=value.replace(/[^\\d]/g,'')\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdTitle\">\r\n\
此类车牌不抓拍\r\n\
<br>(多个以英文;分隔)\r\n\
</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"2011006\" name=\"2011006\" class=\"settingParameter\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td colspan=\"2\">\r\n\
<a href=\"#\" id=\"btnSave\" class=\"settingBtn\" style=\"float:left;\">保存</a>\r\n\
</td>\r\n\
</tr>\r\n\
</table>\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\
<div style=\"height:30px;\">\r\n\
<a class=\"settingBtn\" style=\"float: left;\" id=\"capturePicture\">抓图</a>\r\n\
</div>\r\n\
</div>\r\n\
</div>\r\n\
<!--<div class=\"bottomArea\">\r\n\
<iframe style=\"width:100%;height:100%;border:0;\" frameborder=\"no\" src=\"../../bus/roadList.esp\">\r\n\
</iframe>\r\n\
</div>-->\r\n\
\r\n\
", 8565);
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 type=\"text/javascript\">\r\n\
\r\n\
var ocxController;\r\n\
//参数适配器\r\n\
var parameterAdaptor = new ParameterAdaptor();\r\n\
$().ready(function () {\r\n\
initBusParams();\r\n\
\r\n\
$(\".bottomArea\").load(\"../../bus/test.html\");\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\
//公交模式不用红灯相关的,更换为Kakou模式,ROI不带红灯\r\n\
ocxController.switchToKakouMode();\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\
validateForm();\r\n\
\r\n\
//保存参数\r\n\
$(\"#btnSave\").click(saveParametersToServer);\r\n\
});\r\n\
\r\n\
//初始化公交参数信息\r\n\
function initBusParams() {\r\n\
var RefererInfo = \"intersection\";\r\n\
parameterAdaptor.getParameters(RefererInfo, bindBusParams);\r\n\
}\r\n\
\r\n\
function bindBusParams(data) {\r\n\
var map = data.feedback;\r\n\
$(\"#busConfigInfo\").form(\"load\", map);\r\n\
$.each(map, function (key, value) {\r\n\
$(\"#busConfigInfo input[type='checkbox']\").each(function (i, item) {\r\n\
if (item.id == key && value == 1) {\r\n\
$(\"#\" + item.id).prop(\"checked\", \"checked\");\r\n\
}\r\n\
});\r\n\
});\r\n\
}\r\n\
\r\n\
function validateForm() {\r\n\
var rules = {\r\n\
2011005: {\r\n\
range: [200, 10000],\r\n\
digits: true\r\n\
}\r\n\
,\r\n\
2011006: {\r\n\
maxByteLength: 100\r\n\
}\r\n\
\r\n\
};\r\n\
$(\"#busConfigInfo\").validate({\r\n\
rules: rules\r\n\
});\r\n\
}\r\n\
\r\n\
//提交参数到服务器保存\r\n\
function saveParametersToServer() {\r\n\
var formObj = $(\"#busConfigInfo\");\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, null, \"get\");\r\n\
}\r\n\
\r\n\
function ROIOcxController(ocxObj) {\r\n\
var ocxObject = ocxObj;\r\n\
\r\n\
this.switchToKakouMode = function () {\r\n\
switchOcxMode(1);\r\n\
};\r\n\
this.showPage = function () {\r\n\
showOcxPage();\r\n\
};\r\n\
this.showDialog = function () {\r\n\
showOcxDialog();\r\n\
};\r\n\
this.loadUrlPage = function (imgUrl) {\r\n\
loadOcxUrlPage(imgUrl);\r\n\
};\r\n\
this.loadUrlXml = function (imgUrl) {\r\n\
loadOcxUrlXml(imgUrl);\r\n\
};\r\n\
\r\n\
function switchOcxMode(mode) {\r\n\
ocxObject.SetKakouShow(mode);\r\n\
};\r\n\
function showOcxPage() {\r\n\
ocxObject.showRoiPage();\r\n\
};\r\n\
\r\n\
function showOcxDialog() {\r\n\
ocxObject.AboutBox();\r\n\
};\r\n\
\r\n\
function loadOcxUrlPage(imgUrl) {\r\n\
var err = ocxObject.loadRoiPictureFromUrl(imgUrl);\r\n\
if (err != 0) {\r\n\
//alert(\"loadRoiPictureFromUrl: err = \" + err);\r\n\
}\r\n\
};\r\n\
\r\n\
function loadOcxUrlXml(imgUrl) {\r\n\
var err = ocxObject.loadRoiXmlFromUrl(imgUrl);\r\n\
if (err != 0) {\r\n\
//alert(\"loadRoiXmlFromXml: err = \" + err);\r\n\
}\r\n\
};\r\n\
}\r\n\
\r\n\
function showOcxObj() {\r\n\
$(\"#roiOcxObject\").show();\r\n\
}\r\n\
\r\n\
function hideOcxObj() {\r\n\
$(\"#roiOcxObject\").hide();\r\n\
}\r\n\
</script>\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\
</body>\r\n\
\r\n\
</html>", 7193);
}
ESP_EXPORT int esp_view_2c635105f8784a8a83832244f5c2f3ab(HttpRoute *route, MprModule *module) {
espDefineView(route, "client/settings/function/capture/busSetting.esp", view_2c635105f8784a8a83832244f5c2f3ab);
return 0;
}