OSDSettings.esp
16.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
<!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" />
<style type="text/css">
.tab_content {
/*min-height: 450px;*/
}
/*视频Tab页内部样式*/
.functionSelector {
height: 20px;
padding: 5px;
}
.fTitle {
width: 100px;
display: inline-block;
text-align: right;
padding-right: 10px;
}
.fContent {
width: 152px;
text-align: left;
padding-left: 10px;
}
.tdOnlyOne {
margin-left: 63px;
}
.tdTitle {
width: 110px;
}
/*------默认格式显示情况----------*/
.policeFormat {
display: none;
}
.osd_time {
display: none;
}
/*fieldset样式*/
fieldset {
border: 1px solid #808080;
width: 700px;
}
</style>
</head>
<body>
<ul class="tab_header">
<!--<li class="tab_title" data-index="0">结果图</li>-->
<li class="tab_title selected" data-index="1">视频流</li>
<li class="clear"></li>
</ul>
<form id="osdForm">
<div class="tab_content" style="display: none;">
</div>
<div class="tab_content">
<div class="content_group">
<div class="functionSelector">
<span class="fTitle">
<label>字幕叠加格式</label>
</span>
<span class="fContent">
<select name="180" id="180" class="settingParameter">
<option value="0">普通格式</option>
<option value="1">公安部格式</option>
</select>
</span>
</div>
<div class="normalFormat">
<table class="settingsContainer normalFormatTable">
<tr>
<td class="tdTitle">
<input class="checkboxAlign" name="181" id="181" type="checkbox" />
<label class="checkboxAlign"> 显示时间</label>
</td>
<td class="tdContent">
<!--<span class="osd_time">
<input class="checkboxAlign" name="182" id="182" type="checkbox" /><span class="checkboxAlign"> 显示毫秒</span>
</span>
<span class="osd_time">
<input class="checkboxAlign" name="183" id="183" type="checkbox" /><span class="checkboxAlign"> 显示星期</span>
</span>-->
</td>
</tr>
<tr>
<td class="tdTitle">
<label>时间显示位置</label>
</td>
<td class="tdContent">
<select id="184" name="184" class="settingParameter">
<option value="0">左上角</option>
<option value="1">右上角</option>
<option value="2">左下角</option>
<option value="3">右下角</option>
</select>
</td>
</tr>
<tr>
<td class="tdTitle">
<label>字体</label>
</td>
<td class="tdContent">
<select id="185" name="185" class="settingParameter">
<option value="0" selected="selected">宋体</option>
</select>
</td>
</tr>
<tr>
<td class="tdTitle">
<label>字体大小</label>
</td>
<td class="tdContent">
<select id="186" name="186" class="settingParameter">
<option value="0">16</option>
<option value="1">24</option>
<option value="2">28</option>
<option value="3">32</option>
<option value="4">64</option>
</select>
</td>
</tr>
<tr>
<td class="tdTitle">
<label>自定义字幕1</label>
</td>
<td class="tdContent">
<input name="187" id="187" class="settingParameter" type="text" />
</td>
</tr>
<tr>
<td class="tdTitle">
<label>自定义字幕2</label>
</td>
<td class="tdContent">
<input name="188" id="188" class="settingParameter" type="text" />
</td>
</tr>
<tr>
<td class="tdTitle">
<label>自定义字幕3</label>
<td class="tdContent">
<input name="189" id="189" class="settingParameter" type="text" />
</td>
</tr>
<tr>
<td class="tdTitle">
<label>自定义字幕4</label>
<td class="tdContent">
<input name="190" id="190" class="settingParameter" type="text" />
</td>
</tr>
</table>
</div>
<div class="policeFormat">
<table class="settingsContainer normalFormatTable">
<tr>
<td class="tdTitle">
<input class="checkboxAlign" name="192" id="192" type="checkbox" />
<label class="checkboxAlign"> 显示时间</label>
</td>
<td class="tdContent">
</td>
</tr>
<tr>
<td class="tdTitle">
<label>时间显示位置</label>
</td>
<td class="tdContent">
<select id="191" name="191" class="settingParameter">
<option value="0">左上角</option>
<option value="1">右上角</option>
<option value="2">左下角</option>
<option value="3">右下角</option>
</select>
</td>
</tr>
</table>
<fieldset>
<legend>地点信息</legend>
<table class="settingsContainer">
<tr>
<td class="tdTitle">地点信息一</td>
<td class="tdContent">
<input id="193" name="193" class="settingParameter" type="text" />
</td>
</tr>
<tr>
<td class="tdTitle">地点信息二</td>
<td class="tdContent">
<input id="194" name="194" class="settingParameter" type="text" />
</td>
</tr>
<tr>
<td class="tdTitle">地点信息三</td>
<td class="tdContent">
<input id="195" name="195" class="settingParameter" type="text" />
</td>
</tr>
<tr>
<td class="tdTitle">地点信息四</td>
<td class="tdContent">
<input id="196" name="196" class="settingParameter" type="text" />
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>设备属性</legend>
<table class="settingsContainer">
<tr>
<td class="tdTitle">控制方式</td>
<td class="tdContent">
<select id="197" name="197" class="settingParameter">
<option value="0">固</option>
<option value="1">动</option>
</select>
</td>
</tr>
<tr>
<td class="tdTitle">类型</td>
<td class="tdContent">
<select id="198" name="198" class="settingParameter">
<option value="0">球形</option>
<option value="1">枪式</option>
</select>
</td>
</tr>
<tr>
<td class="tdTitle">安装位置</td>
<td class="tdContent">
<select id="199" name="199" class="settingParameter">
<option value="0">室内</option>
<option value="1">室外</option>
</select>
</td>
</tr>
<tr>
<td class="tdTitle">用途</td>
<td class="tdContent">
<select id="200" name="200" class="settingParameter">
<option value="0">治安</option>
<option value="1">交通</option>
<option value="2">重点部位</option>
</select>
</td>
</tr>
<tr>
<td class="tdTitle">监控方位</td>
<td class="tdContent">
<select id="201" name="201" class="settingParameter">
<option value="0">东</option>
<option value="1">南</option>
<option value="2">西</option>
<option value="3">北</option>
</select>
</td>
</tr>
</table>
</fieldset>
</div>
</div>
</div>
<% inputSecurityToken(); %>
</form>
<div class="operateDiv" style="padding-left:5px;">
<a class="settingBtn" id="btnSave" style="float: left;">保存</a>
<div class="clear"></div>
</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.validate.min.js"></script>
<script src="../../scripts/jquery.validate.extend.js"></script>
<script type="text/javascript">
var parameterAdaptor = new ParameterAdaptor();
var o_rules = {};
$().ready(function () {
//事件
$("#180").change(onOsdFormatChanged);
//$("#181").change(onOsdTimeChanged);
//加载信息
loadOsdInfo();
$("#btnSave").click(saveParametersToServer);
$("#186").change(onFontSizeChanged);
o_rules[187] = o_rules[188] = o_rules[189] = o_rules[190] = {
maxByteLength: 60
};
$("#osdForm").validate({
rules: o_rules
});
});
function onFontSizeChanged() {
var rules = {};
//添加验证
if ($("#186").val() != "4") {
$("#187").rules("remove", "maxByteLength");
$("#187").rules("add", { maxByteLength: 60 });
$("#188").rules("remove", "maxByteLength");
$("#188").rules("add", { maxByteLength: 60 });
$("#189").rules("remove", "maxByteLength");
$("#189").rules("add", { maxByteLength: 60 });
$("#190").rules("remove", "maxByteLength");
$("#190").rules("add", { maxByteLength: 60 });
} else {
$("#187").rules("remove", "maxByteLength");
$("#187").rules("add", { maxByteLength: 48 });
$("#188").rules("remove", "maxByteLength");
$("#188").rules("add", { maxByteLength: 48 });
$("#189").rules("remove", "maxByteLength");
$("#189").rules("add", { maxByteLength: 48 });
$("#190").rules("remove", "maxByteLength");
$("#190").rules("add", { maxByteLength: 48 });
}
}
//当视频Osd格式变更时
function onOsdFormatChanged() {
var selectedValue = $("#180").find("option:selected").val();
if (selectedValue == "0") {
$(".normalFormat").show();
$(".policeFormat").hide();
} else {
$(".normalFormat").hide();
$(".policeFormat").show();
}
}
//当Osd时间选项更改时
function onOsdTimeChanged() {
var isChecked = $("#181").is(":checked");
if (isChecked) {
$(".osd_time").show();
} else {
$(".osd_time").hide();
}
}
//加载Osd信息
function loadOsdInfo() {
var RefererInfo = "OSDSettings";
//调用公用方法加载参数
parameterAdaptor.getParameters(RefererInfo, function (data) {
$("#osdForm").form("load", data.feedback);
$("#185").val(0);
$("#185").attr("disabled", "disabled");
onOsdFormatChanged();
//onOsdTimeChanged();
});
}
//保存参数到服务器
function saveParametersToServer() {
var formObj = $("#osdForm");
if (!formObj.valid()) {
$.messager.alert("提示", "参数验证有误,请修改后再提交!", "error");
return;
}
parameterAdaptor.saveParameters(formObj);
}
</script>
</body>
</html>