view_f5950e43d649170e76544f7fcc05285c.c
5.23 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
/*
Generated from client/settings/function/cameraSetup.esp
*/
#include "esp.h"
static void view_f5950e43d649170e76544f7fcc05285c(HttpConn *conn) {
espRenderBlock(conn, "<!DOCTYPE html>\r\n\
<html>\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\
.mainContainer {\r\n\
width: 90%;\r\n\
height: 400px;\r\n\
padding: 8px;\r\n\
}\r\n\
.tdTitle {\r\n\
width: 110px;\r\n\
}\r\n\
.picExample {\r\n\
height: 276px;\r\n\
width: 322px;\r\n\
background: url(../../images/cameraSetup.png) no-repeat 0 0;\r\n\
}\r\n\
</style>\r\n\
</head>\r\n\
<body>\r\n\
<div class=\"mainContainer\">\r\n\
<form id=\"cameraSetupForm\">\r\n\
<table class=\"settingsContainer\">\r\n\
<tr>\r\n\
<td class=\"tdTitle\">杆高(1-10米)</td>\r\n\
<td class=\"tdContent\">\r\n\
<input type=\"text\" name=\"210\" id=\"210\" class=\"settingParameter\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td class=\"tdTitle\">焦距(5-50毫米)</td>\r\n\
<td class=\"tdContent\">\r\n\
<input type=\"text\" name=\"211\" id=\"211\" class=\"settingParameter\">\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td colspan=\"2\">\r\n\
<div class=\"picExample\">\r\n\
\r\n\
</div>\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td colspan=\"2\">\r\n\
", 1695);
inputSecurityToken(); espRenderBlock(conn, "\r\n\
<a href=\"#\" id=\"btnSave\" class=\"settingBtn\">保存</a>\r\n\
</td>\r\n\
</tr>\r\n\
</table>\r\n\
</form>\r\n\
</div>\r\n\
<script src=\"../../scripts/easyui/jquery.min.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.validate.min.js\"></script>\r\n\
<script src=\"../../scripts/jquery.validate.extend.js\"></script>\r\n\
<script type=\"text/javascript\">\r\n\
var parameterAdaptor = new ParameterAdaptor();\r\n\
var rebootManager = new RebootManager();\r\n\
\r\n\
$().ready(function() {\r\n\
loadCameraSetupInfo();\r\n\
setTimeout(loadAttributeInfo, 200);\r\n\
$(\"#btnSave\").click(saveParametersToServer);\r\n\
\r\n\
//表单验证\r\n\
$(\"#cameraSetupForm\").validate({\r\n\
rules: {\r\n\
210: {\r\n\
required:true,\r\n\
range:[1,10]\r\n\
},\r\n\
211: {\r\n\
required:true,\r\n\
range:[5,50]\r\n\
}\r\n\
}\r\n\
});\r\n\
});\r\n\
\r\n\
//加载相机设置参数\r\n\
function loadCameraSetupInfo() {\r\n\
var RefererInfo = \"cameraSetup\";\r\n\
parameterAdaptor.getParameters(RefererInfo, function(data) {\r\n\
$(\"#cameraSetupForm\").form(\"load\", data.feedback);\r\n\
});\r\n\
}\r\n\
\r\n\
function loadAttributeInfo() {\r\n\
var RefererInfo = \"cameraSetup\";\r\n\
parameterAdaptor.getAttribute(RefererInfo, function(data){\r\n\
for(var pId in data){\r\n\
if(document.getElementById(pId) != null)\r\n\
document.getElementById(pId).setAttribute( \"title\", data[pId]);\r\n\
} \r\n\
});\r\n\
}\r\n\
\r\n\
//保存参数到服务器\r\n\
function saveParametersToServer() {\r\n\
var formObj = $(\"#cameraSetupForm\");\r\n\
if (!formObj.valid()) {\r\n\
$.messager.alert(\"提示\", \"参数验证有误,请修改后再提交!\", \"error\");\r\n\
return;\r\n\
}\r\n\
parameterAdaptor.saveParameters(formObj, function(response) {\r\n\
if (response.error) {\r\n\
$.messager.show({\r\n\
title:'结果',\r\n\
msg:'修改成功!',\r\n\
timeout:3000,\r\n\
showType:'slide'\r\n\
});\r\n\
}\r\n\
});\r\n\
\r\n\
}\r\n\
</script>\r\n\
</body>\r\n\
</html>\r\n\
", 2594);
}
ESP_EXPORT int esp_view_f5950e43d649170e76544f7fcc05285c(HttpRoute *route, MprModule *module) {
espDefineView(route, "client/settings/function/cameraSetup.esp", view_f5950e43d649170e76544f7fcc05285c);
return 0;
}