Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
董杰
/
induction_shelf
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9aae8f83
由
韩晓涛
编写于
2025-01-10 15:02:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
树莓派页面调整
1 个父辈
54085d57
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
482 行增加
和
437 行删除
smartshelf/app/templates/head.html
smartshelf/app/templates/induction_admin.html
smartshelf/app/templates/induction_test.html
smartshelf/app/templates/head.html
查看文件 @
9aae8f8
...
...
@@ -31,12 +31,10 @@
<div
id=
"navbar"
class=
"navbar-collapse collapse"
>
<ul
class=
"nav navbar-nav"
>
<li
{{
"
class=
active"
if
index=
=1
}}
><a
href=
"{{ url_for('induction_control') }}"
>
{{ _('通用') }}
</a></li>
<li
{{
"
class=
active"
if
index=
=2
}}
><a
href=
"{{ url_for('induction_test') }}"
>
{{ _('测试') }}
</a>
</li>
<li
{{
"
class=
active"
if
index=
=3
}}
><a
href=
"{{ url_for('induction_config') }}"
>
{{ _('配置') }}
</a>
</li>
<li
{{
"
class=
active"
if
index=
=1
}}
><a
href=
"{{ url_for('induction_control') }}"
>
{{ _('通用') }}
</a></li>
<li
{{
"
class=
active"
if
index=
=2
}}
><a
href=
"{{ url_for('induction_test') }}"
>
{{ _('测试') }}
</a>
</li>
<li
{{
"
class=
active"
if
index=
=3
}}
><a
href=
"{{ url_for('induction_config') }}"
>
{{ _('配置') }}
</a>
</li>
<!-- <li {{ " class=active" if index==3 }}><a href="{{ url_for('induction_admin') }}">{{ _('admin') }}</a> </li>-->
</ul>
<ul
class=
"nav navbar-nav navbar-right"
style=
"font-size: 14px;"
"
>
...
...
smartshelf/app/templates/induction_admin.html
查看文件 @
9aae8f8
...
...
@@ -36,7 +36,7 @@
onclick=
"hancalibrate()"
/>
<input
type=
"button"
value=
"{{ _('获取阈值') }}"
class=
"btn btn-warning"
onclick=
"getcalibrate()"
/>
</div>
<!-- /.col-sm-4 -->
</div>
</div>
</div>
...
...
smartshelf/app/templates/induction_test.html
查看文件 @
9aae8f8
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title>
{{ _('感应式料架系统') }}
</title>
<link
rel=
"icon"
href=
"/static/favicon.ico"
>
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<script
src=
"/static/js/jquery.min.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<meta
charset=
"utf-8"
>
<title>
{{ _('感应式料架系统') }}
</title>
<link
rel=
"icon"
href=
"/static/favicon.ico"
>
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<script
src=
"/static/js/jquery.min.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<style>
.row
{
margin-bottom
:
10px
;
}
</style>
</head>
<body
style=
"font-size:18px;"
>
{% set index=2 %}
{% import 'head.html' as head with context%}
{{ head }}
{% set index=2 %}
{% import 'head.html' as head with context%}
{{ head }}
<div
class=
"container-fluid"
>
<div
class=
"row"
>
<hr
class=
"divider"
/><hr
class=
"divider"
/><hr
class=
"divider"
/>
<div
class=
"row"
>
<hr
class=
"divider"
/>
<hr
class=
"divider"
/>
<hr
class=
"divider"
/>
<div
class=
"col-md-6"
>
<!--div class="panel panel-info">
<div class="panel-heading">
...
...
@@ -43,95 +49,104 @@
</div-->
<!-- 灯条测试 -->
<div
class=
"panel panel-warning"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
{{ _('灯条测试') }}
</h3>
</div>
<div
class=
"panel-body"
>
<label
for=
"cha"
class=
"col-sm-2"
>
{{ _('地址') }}
</label>
<div
class=
"col-sm-3"
>
<select
id=
'addrs'
class=
"form-control"
>
<option>
A1
</option>
<option>
A2
</option>
<option>
A3
</option>
<option>
A4
</option>
<option>
A5
</option>
<option>
A6
</option>
<option>
A7
</option>
<option>
A8
</option>
<option>
A9
</option>
<option>
B1
</option>
<option>
B2
</option>
<option>
B3
</option>
<option>
B4
</option>
<option>
B5
</option>
<option>
B6
</option>
<option>
B7
</option>
<option>
B8
</option>
<option>
B9
</option>
<option>
all
</option>
</select>
</div>
<!-- /.col-sm-4 -->
<label
for=
"cha1"
class=
"col-sm-2"
>
{{ _('颜色') }}
</label>
<div
class=
"col-sm-3"
>
<select
id=
'linecolor'
class=
"form-control"
>
{% for color in colors %}
<option>
{{ color }}
</option>
{% endfor %}
</select>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
{{ _('灯条测试') }}
</h3>
</div>
<div
class=
"panel-body"
>
<div
class=
"row align-items-start"
>
<div
class=
"col"
>
<label
for=
"cha"
class=
"col-sm-2"
>
{{ _('地址') }}
</label>
<div
class=
"col-sm-4"
>
<select
id=
'addrs'
class=
"form-control"
>
<option>
A1
</option>
<option>
A2
</option>
<option>
A3
</option>
<option>
A4
</option>
<option>
A5
</option>
<option>
A6
</option>
<option>
A7
</option>
<option>
A8
</option>
<option>
A9
</option>
<option>
B1
</option>
<option>
B2
</option>
<option>
B3
</option>
<option>
B4
</option>
<option>
B5
</option>
<option>
B6
</option>
<option>
B7
</option>
<option>
B8
</option>
<option>
B9
</option>
<option>
all
</option>
</select>
</div>
</div>
<div
class=
"col"
>
<label
for=
"cha1"
class=
"col-sm-2"
>
{{ _('颜色') }}
</label>
<div
class=
"col-sm-4"
>
<select
id=
'linecolor'
class=
"form-control"
>
{% for color in colors %}
<option>
{{ color }}
</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div
class=
"col-sm-12"
style=
"padding: 3px;"
></div>
<div
class=
"col-sm-6"
"
>
<input
type=
"button"
value=
{{
_
('开启')
}}
class=
"btn btn-warning"
onclick=
"indlineledon()"
/>
<input
type=
"button"
value=
{{
_
('关闭')
}}
class=
"btn btn-info"
onclick=
"indlineledoff()"
/>
</div>
<!-- /.col-sm-4 -->
</div>
<div
class=
"col-sm-6"
>
<input
type=
"button"
value=
{{
_
('开启')
}}
class=
"btn btn-warning"
onclick=
"indlineledon()"
/>
<input
type=
"button"
value=
{{
_
('关闭')
}}
class=
"btn btn-info"
onclick=
"indlineledoff()"
/>
</div>
</div>
</div>
<div
class=
"panel panel-success"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
{{ _('库位操作测试') }}
</h3>
</div>
<div
class=
"panel-body"
>
<label
for=
"stock_cha1"
class=
"col-sm-2"
>
{{ _('库位') }}
</label>
<div
class=
"col-sm-5"
>
<select
id=
"led_address"
class=
"form-control"
>
{% for optionv in option_list %}
<option>
{{ optionv }}
</option>
{% endfor %}
</select>
</div>
<label
for=
"cha2"
class=
"col-sm-2"
>
{{ _('颜色') }}
</label>
<div
class=
"col-sm-3"
>
<select
id=
'indexcolor'
class=
"form-control"
>
{% for color in colors %}
<option>
{{ color }}
</option>
{% endfor %}
</select>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
{{ _('库位操作测试') }}
</h3>
</div>
<div
class=
"panel-body"
>
<div
class=
"row align-items-start"
>
<div
class=
"col"
>
<label
for=
"stock_cha1"
class=
"col-sm-2"
>
{{ _('库位') }}
</label>
<div
class=
"col-sm-4"
>
<select
id=
"led_address"
class=
"form-control"
>
{% for optionv in option_list %}
<option>
{{ optionv }}
</option>
{% endfor %}
</select>
</div>
</div>
<div
class=
"col"
>
<label
for=
"cha2"
class=
"col-sm-2"
>
{{ _('颜色') }}
</label>
<div
class=
"col-sm-4"
>
<select
id=
'indexcolor'
class=
"form-control"
>
{% for color in colors %}
<option>
{{ color }}
</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div
class=
"col-sm-12"
style=
"padding: 3px;"
></div>
<div
class=
"col-sm-12"
>
<input
type=
"button"
value=
{{
_
('亮灯')
}}
class=
"btn btn-warning"
onclick=
"indledopen()"
/>
<input
type=
"button"
value=
{{
_
('灭灯')
}}
class=
"btn btn-info"
onclick=
"indledoff()"
/>
<input
type=
"button"
value=
{{
_
('重置')
}}
class=
"btn btn-info"
onclick=
"indresetled()"
/>
<input
type=
"button"
value=
{{
_
('标定')
}}
class=
"btn btn-info"
onclick=
"single_calibrate()"
/>
</div>
<!-- /.col-sm-4 -->
</div>
<input
type=
"button"
value=
{{
_
('亮灯')
}}
class=
"btn btn-warning"
onclick=
"indledopen()"
/>
<input
type=
"button"
value=
{{
_
('灭灯')
}}
class=
"btn btn-info"
onclick=
"indledoff()"
/>
<input
type=
"button"
value=
{{
_
('重置')
}}
class=
"btn btn-info"
onclick=
"indresetled()"
/>
<input
type=
"button"
value=
{{
_
('标定')
}}
class=
"btn btn-info"
onclick=
"single_calibrate()"
/>
</div>
</div>
</div>
<div
class=
"panel panel-success"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
{{ _('状态灯测试') }}
</h3>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
{{ _('状态灯测试') }}
</h3>
</div>
<div
class=
"panel-body"
>
<label
for=
"cha4"
class=
"col-sm-2"
>
{{ _('选择') }}
</label>
<div
class=
"col-sm-3"
>
<select
id=
'workchannel'
class=
"form-control"
>
<option>
1
</option>
<option>
2
</option>
<option>
3
</option>
<option>
4
</option>
<option>
5
</option>
<option>
6
</option>
</select>
<select
id=
'workchannel'
class=
"form-control"
>
<option>
1
</option>
<option>
2
</option>
<option>
3
</option>
<option>
4
</option>
<option>
5
</option>
<option>
6
</option>
</select>
</div>
<!-- <label for="cha6" class="col-sm-1">{{ _('颜色') }}</label>
<div class="col-sm-3">
...
...
@@ -142,10 +157,10 @@
</select>
</div> -->
<div
class=
"col-sm-4"
>
<input
type=
"button"
value=
{{
_
('亮灯')
}}
class=
"btn btn-warning"
onclick=
"indworkinglight()"
/>
<input
type=
"button"
value=
{{
_
('灭灯')
}}
class=
"btn btn-info"
onclick=
"indworkingoff()"
/>
<input
type=
"button"
value=
{{
_
('亮灯')
}}
class=
"btn btn-warning"
onclick=
"indworkinglight()"
/>
<input
type=
"button"
value=
{{
_
('灭灯')
}}
class=
"btn btn-info"
onclick=
"indworkingoff()"
/>
</div>
<!-- /.col-sm-4 -->
</div>
</div>
</div>
<!--div class="panel panel-success">
...
...
@@ -171,404 +186,436 @@
</div>
<div
class=
"col-md-6"
>
<div
id=
"panel-group"
>
<!-- 1 -->
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
{{ _('消息') }}
</h3>
</div>
<div
class=
"panel-body"
>
<div
class=
"alert alert-info"
role=
"alert"
>
<p>
{{ _('运行状态') }}:
<span
id=
"shelfstate"
></span>
</p>
</div>
<div
class=
"alert alert-info"
role=
"alert"
>
<p>
{{ _('测试消息') }}:
<span
id=
"testinfo"
></span>
</p>
</div>
<!-- <div class="alert alert-info" role="alert">
<p>
{{ _('配置文件加载状态') }}:<span>{{ config_state }}</span>
</p>
</div> -->
<div
class=
"alert alert-info"
role=
"alert"
>
<p>
{{ _('串口状态') }}:
<span
id=
"serialstate"
></span>
</p>
</div>
<!-- 1 -->
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
{{ _('消息') }}
</h3>
</div>
<div
class=
"panel-body"
>
<div
class=
"alert alert-info"
role=
"alert"
>
<p>
{{ _('运行状态') }}:
<span
id=
"shelfstate"
></span>
</p>
</div>
<div
class=
"alert alert-info"
role=
"alert"
>
<p>
{{ _('测试消息') }}:
<span
id=
"testinfo"
></span>
</p>
</div>
<!-- <div class="alert alert-info" role="alert">
<p>
{{ _('配置文件加载状态') }}:<span>{{ config_state }}</span>
</p>
</div> -->
<div
class=
"alert alert-info"
role=
"alert"
>
<p>
{{ _('串口状态') }}:
<span
id=
"serialstate"
></span>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$
(
document
).
ready
(
function
()
{
getstate
();
console
.
log
(
'success'
);
});
// 获取开机关机状态
function
getstate
(){
});
// 获取开机关机状态
function
getstate
()
{
// var form= new FormData(document.getElementById("test_form"));
$
.
ajax
({
url
:
"/getstate"
,
type
:
"post"
,
url
:
"/getstate"
,
type
:
"post"
,
// data:form,
dataType
:
'json'
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
data
)
{
processData
:
false
,
contentType
:
false
,
success
:
function
(
data
)
{
console
.
log
(
data
)
if
(
data
[
0
].
state
==
'on'
)
{
$
(
"#shelfstate"
).
html
(
"{{_('运行中')}}"
);}
else
if
(
data
[
0
].
state
==
'off'
)
{
$
(
"#shelfstate"
).
html
(
"{{_('已关闭')}}"
);}
else
{
$
(
"#shelfstate"
).
html
(
"{{_('未初始化')}}"
);}
if
(
data
[
0
].
state
==
'on'
)
{
$
(
"#shelfstate"
).
html
(
"{{_('运行中')}}"
);
}
else
if
(
data
[
0
].
state
==
'off'
)
{
$
(
"#shelfstate"
).
html
(
"{{_('已关闭')}}"
);
}
else
{
$
(
"#shelfstate"
).
html
(
"{{_('未初始化')}}"
);
}
// $("#shelfstate").html("<b>已关闭</b>")
// $("#testinfo").html(data[0].msg)
$
(
"#serialstate"
).
html
(
data
[
0
].
serial_state
)
},
error
:
function
(
e
)
{
alert
(
"未获取到状态信息"
);
error
:
function
(
e
)
{
alert
(
"未获取到状态信息"
);
}
})
}
}
// 灯条测试
function
indlineledon
()
{
// 灯条测试
function
indlineledon
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
addrs
=
document
.
getElementById
(
"addrs"
).
value
;
addrs
=
addrs
.
replace
(
'B'
,
'A1'
);
addrs
=
addrs
.
replace
(
'A'
,
''
);
var
data
=
{
"channel_num"
:
addrs
,
"channel_color"
:
document
.
getElementById
(
"linecolor"
).
value
}
console
.
log
(
data
)
$
.
ajax
({
url
:
"/indlineledon"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
// alert (data.msg)
},
error
:
function
(
e
){
alert
(
"error"
);
}
})
}
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
addrs
=
document
.
getElementById
(
"addrs"
).
value
;
addrs
=
addrs
.
replace
(
'B'
,
'A1'
);
addrs
=
addrs
.
replace
(
'A'
,
''
);
var
data
=
{
"channel_num"
:
addrs
,
"channel_color"
:
document
.
getElementById
(
"linecolor"
).
value
}
console
.
log
(
data
)
$
.
ajax
({
url
:
"/indlineledon"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
// alert (data.msg)
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
function
indlineledoff
()
{
function
indlineledoff
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
addrs
=
document
.
getElementById
(
"addrs"
).
value
;
addrs
=
addrs
.
replace
(
'B'
,
'A1'
);
addrs
=
addrs
.
replace
(
'A'
,
''
);
var
data
=
{
"channel_num"
:
addrs
,
"channel_color"
:
'off'
}
var
addrs
=
document
.
getElementById
(
"addrs"
).
value
;
addrs
=
addrs
.
replace
(
'B'
,
'A1'
);
addrs
=
addrs
.
replace
(
'A'
,
''
);
var
data
=
{
"channel_num"
:
addrs
,
"channel_color"
:
'off'
}
// var form= new FormData(document.getElementById("test_form"));
// var data = {"word":"hello"}
console
.
log
(
data
)
$
.
ajax
({
url
:
"/indlineledoff"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
url
:
"/indlineledoff"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
dataType
:
'json'
,
contentType
:
"application/json"
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"error"
);
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
// 库位灯测试
function
indledopen
(){
}
}
// 库位灯测试
function
indledopen
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"light_led_color"
:
document
.
getElementById
(
"indexcolor"
).
value
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
$
.
ajax
({
url
:
"/indledopen"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"error"
);
}
})
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"light_led_color"
:
document
.
getElementById
(
"indexcolor"
).
value
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
}
$
.
ajax
({
url
:
"/indledopen"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
// 库位灯测试
function
indledoff
()
{
// 库位灯测试
function
indledoff
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"light_led_color"
:
"off"
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
// console.log(data)
$
.
ajax
({
url
:
"/indledoff"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"error"
);
}
})
}
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"light_led_color"
:
"off"
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
// console.log(data)
$
.
ajax
({
url
:
"/indledoff"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
// 状态灯测试
function
indworkinglight
()
{
// 状态灯测试
function
indworkinglight
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"workchannel"
:
document
.
getElementById
(
"workchannel"
).
value
,
"command"
:
'worklight'
}
$
.
ajax
({
url
:
"/indworkinglight"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
// processData: false,//用于对data参数进行序列化处理 这里必须false
// contentType: false, //必须
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"error"
);
}
})
}
}
// auto_calibrate
function
single_calibrate
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
);
return
;
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"workchannel"
:
document
.
getElementById
(
"workchannel"
).
value
,
"command"
:
'worklight'
}
$
.
ajax
({
url
:
"/indworkinglight"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
// processData: false,//用于对data参数进行序列化处理 这里必须false
// contentType: false, //必须
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
// auto_calibrate
function
single_calibrate
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
);
return
;
}
if
(
confirm
(
"{{ _('操作前请确保该库位中没有物料') }}"
))
{
var
data
=
{
"light_led_color"
:
document
.
getElementById
(
"indexcolor"
).
value
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
$
.
ajax
({
url
:
"/single_calibrate"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
// $("#testinfo").html(data.msg)
alert
(
data
.
msg
);
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
if
(
confirm
(
"{{ _('操作前请确保该库位中没有物料') }}"
))
{
var
data
=
{
"light_led_color"
:
document
.
getElementById
(
"indexcolor"
).
value
,
"light_led"
:
document
.
getElementById
(
"led_address"
).
value
}
$
.
ajax
({
url
:
"/single_calibrate"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
// $("#testinfo").html(data.msg)
alert
(
data
.
msg
);
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
function
indworkingoff
()
{
function
indworkingoff
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"workchannel"
:
document
.
getElementById
(
"workchannel"
).
value
,
"command"
:
'workoff'
}
$
.
ajax
({
url
:
"/indworkingoff"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
// processData: false,//用于对data参数进行序列化处理 这里必须false
// contentType: false, //必须
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"error"
);
}
})
}
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"workchannel"
:
document
.
getElementById
(
"workchannel"
).
value
,
"command"
:
'workoff'
}
$
.
ajax
({
url
:
"/indworkingoff"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
// processData: false,//用于对data参数进行序列化处理 这里必须false
// contentType: false, //必须
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
// 库位灯重置
function
indresetled
()
{
// 库位灯重置
function
indresetled
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
$
.
ajax
({
url
:
"/indresetled"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"error"
);
}
})
}
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
$
.
ajax
({
url
:
"/indresetled"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
// 检查串口连接状态
function
checkcom
()
{
// 检查串口连接状态
function
checkcom
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
$
.
ajax
({
url
:
"/checkcom"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"error"
);
}
})
}
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
$
.
ajax
({
url
:
"/checkcom"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
// 扫描所有串口
function
scancom
()
{
// 扫描所有串口
function
scancom
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
$
.
ajax
({
url
:
"/scancom"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#serialstate"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"error"
);
}
})
}
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
$
.
ajax
({
url
:
"/scancom"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
$
(
"#serialstate"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"error"
);
}
})
}
}
// 重置主板
function
resetmain
()
{
// 重置主板
function
resetmain
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"command"
:
"reset"
}
$
.
ajax
({
url
:
"/resetmain"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"重置失败"
);
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"command"
:
"reset"
}
$
.
ajax
({
url
:
"/resetmain"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"重置失败"
);
}
})
}
}
}
// 重置power
function
powermain
()
{
// 重置power
function
powermain
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"command"
:
"power"
}
$
.
ajax
({
url
:
"/powermain"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"power重置失败"
);
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
var
data
=
{
"command"
:
"power"
}
$
.
ajax
({
url
:
"/powermain"
,
type
:
"post"
,
data
:
JSON
.
stringify
(
data
),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"power重置失败"
);
}
})
}
}
}
// 开启扫描自动测试
function
scantest
()
{
// 开启扫描自动测试
function
scantest
()
{
var
shelfstate
=
document
.
getElementById
(
"shelfstate"
).
innerHTML
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
$
.
ajax
({
url
:
"/scantest"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
){
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
){
alert
(
"启动扫描库位失败"
);
}
if
(
shelfstate
==
"{{_('运行中')}}"
)
{
alert
(
"{{_('料架运行中,请关闭后再进行配置')}}"
)
}
else
{
$
.
ajax
({
url
:
"/scantest"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"启动扫描库位失败"
);
}
})
}
}
}
// 关闭扫描自动测试
function
stopscantest
()
{
// 关闭扫描自动测试
function
stopscantest
()
{
$
.
ajax
({
url
:
"/stopscantest"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"停止失败"
);
}
})
}
url
:
"/stopscantest"
,
type
:
"post"
,
// data:JSON.stringify(data),
contentType
:
"application/json"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#testinfo"
).
html
(
data
.
msg
)
alert
(
data
.
msg
)
},
error
:
function
(
e
)
{
alert
(
"停止失败"
);
}
})
}
</script>
<script
src=
"/static/js/jquery.min.js"
></script>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论