Commit a2af0b92 董杰

二维码功能,增加状态灯

1 个父辈 2e33aa18
......@@ -142,3 +142,22 @@ def process_file():
def reboot():
os.system('/prog/./restart.sh')
def openteam():
# os.system('/usr/bin/./teamviwer')
cmd = "nohub /opt/teamviewer/tv_bin/TeamViewer"
run = pexpect.spawn('su -c "%s" root' %cmd)
time.sleep(0.5)
run.sendline('xxx')
# cmd1 = "./teamviwer"
# run1 = pexpect.spawn('su -c "%s" root' %cmd1)
# time.sleep(0.5)
# run1.sendline('xxx')
logging.warning("teamview open")
@app.route('/openteamview',methods=['POST'])
def openteamview():
openteam()
info = {'operation':'已打开teamview'}
return json.dumps(info)
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-04-08 16:38+0800\n"
"POT-Creation-Date: 2021-04-19 15:19+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -21,171 +21,183 @@ msgstr ""
msgid "智能料架系统"
msgstr ""
#: templates/base.html:23 templates/ledtest.html:23
#: templates/shelfconfig.html:79
#: templates/base.html:26 templates/ledtest.html:24
#: templates/shelfconfig.html:80
msgid "亮灯料架"
msgstr ""
#: templates/base.html:27 templates/ledtest.html:27
#: templates/shelfconfig.html:83
#: templates/base.html:30 templates/ledtest.html:28
#: templates/shelfconfig.html:84
msgid "控制"
msgstr ""
#: templates/base.html:28 templates/ledtest.html:28
#: templates/shelfconfig.html:84
#: templates/base.html:31 templates/ledtest.html:29
#: templates/shelfconfig.html:85
msgid "测试"
msgstr ""
#: templates/base.html:29 templates/ledtest.html:29
#: templates/shelfconfig.html:85
#: templates/base.html:32 templates/ledtest.html:30
#: templates/shelfconfig.html:86
msgid "料架配置"
msgstr ""
#: templates/base.html:45 templates/ledtest.html:45
#: templates/shelfconfig.html:101
#: templates/base.html:58 templates/ledtest.html:46
#: templates/shelfconfig.html:102
msgid "料架系统"
msgstr ""
#: templates/base.html:50
#: templates/base.html:63
msgid "开关"
msgstr ""
#: templates/base.html:53
#: templates/base.html:66
msgid "启动"
msgstr ""
#: templates/base.html:54
#: templates/base.html:67
msgid "停止"
msgstr ""
#: templates/base.html:62 templates/ledtest.html:137
#: templates/shelfconfig.html:154
#: templates/base.html:75 templates/ledtest.html:159
#: templates/shelfconfig.html:155
msgid "提醒消息"
msgstr ""
#: templates/base.html:67 templates/ledtest.html:142
#: templates/shelfconfig.html:159
#: templates/base.html:80 templates/ledtest.html:164
#: templates/shelfconfig.html:160
msgid "运行状态"
msgstr ""
#: templates/base.html:72 templates/ledtest.html:152
#: templates/shelfconfig.html:164
#: templates/base.html:85 templates/ledtest.html:174
#: templates/shelfconfig.html:165
msgid "配置文件加载状态"
msgstr ""
#: templates/base.html:77 templates/shelfconfig.html:124
#: templates/shelfconfig.html:169
#: templates/base.html:90 templates/shelfconfig.html:125
#: templates/shelfconfig.html:170
msgid "服务器地址"
msgstr ""
#: templates/base.html:82 templates/shelfconfig.html:130
#: templates/shelfconfig.html:174
#: templates/base.html:95 templates/shelfconfig.html:131
#: templates/shelfconfig.html:175
msgid "料架编号"
msgstr ""
#: templates/base.html:87
#: templates/base.html:100
msgid "服务器连接状态"
msgstr ""
#: templates/base.html:96 templates/ledtest.html:131
#: templates/shelfconfig.html:148
#: templates/base.html:109 templates/ledtest.html:153
#: templates/shelfconfig.html:149
msgid "运行日志&状态信息"
msgstr ""
#: templates/base.html:101
#: templates/base.html:114
msgid "日志下载"
msgstr ""
#: templates/base.html:104
#: templates/base.html:117
msgid "下载日志"
msgstr ""
#: templates/base.html:111
#: templates/base.html:124
msgid "日志"
msgstr ""
#: templates/ledtest.html:50
#: templates/ledtest.html:51
msgid "灯条测试"
msgstr ""
#: templates/ledtest.html:53 templates/ledtest.html:109
#: templates/ledtest.html:54 templates/ledtest.html:110
msgid "通道"
msgstr ""
#: templates/ledtest.html:60 templates/ledtest.html:88
#: templates/ledtest.html:116
#: templates/ledtest.html:61 templates/ledtest.html:89
#: templates/ledtest.html:117
msgid "颜色"
msgstr ""
#: templates/ledtest.html:70
#: templates/ledtest.html:71
msgid "灯条全开"
msgstr ""
#: templates/ledtest.html:71
#: templates/ledtest.html:72
msgid "灯条关闭"
msgstr ""
#: templates/ledtest.html:77
#: templates/ledtest.html:78
msgid "库位操作测试"
msgstr ""
#: templates/ledtest.html:80
#: templates/ledtest.html:81
msgid "库位"
msgstr ""
#: templates/ledtest.html:98 templates/ledtest.html:124
#: templates/ledtest.html:99 templates/ledtest.html:125
msgid "亮灯"
msgstr ""
#: templates/ledtest.html:99 templates/ledtest.html:125
#: templates/ledtest.html:100 templates/ledtest.html:126
msgid "灭灯"
msgstr ""
#: templates/ledtest.html:100
#: templates/ledtest.html:101
msgid "重置"
msgstr ""
#: templates/ledtest.html:106
#: templates/ledtest.html:107
msgid "状态灯测试"
msgstr ""
#: templates/ledtest.html:133
msgid "下载库位二维码"
msgstr ""
#: templates/ledtest.html:145
msgid "下载二维码"
msgstr ""
#: templates/ledtest.html:147
msgid "单个二维码尺寸(含白色底框)尺寸为16*16mm,黑码尺寸为10*10mm"
msgstr ""
#: templates/ledtest.html:169
msgid "测试消息"
msgstr ""
#: templates/shelfconfig.html:106
#: templates/shelfconfig.html:107
msgid "配置文件"
msgstr ""
#: templates/shelfconfig.html:110
#: templates/shelfconfig.html:111
msgid "选择文件"
msgstr ""
#: templates/shelfconfig.html:113
#: templates/shelfconfig.html:114
msgid "上传"
msgstr ""
#: templates/shelfconfig.html:119
#: templates/shelfconfig.html:120
msgid "服务器配置"
msgstr ""
#: templates/shelfconfig.html:134
#: templates/shelfconfig.html:135
msgid "保存"
msgstr ""
#: templates/shelfconfig.html:139
#: templates/shelfconfig.html:140
msgid "控制器备份&升级"
msgstr ""
#: templates/shelfconfig.html:143
#: templates/shelfconfig.html:144
msgid "料架升级"
msgstr ""
#: templates/shelfconfig.html:179
#: templates/shelfconfig.html:180
msgid "操作提醒"
msgstr ""
#: templates/shelfconfig.html:184
#: templates/shelfconfig.html:185
msgid "软件版本"
msgstr ""
......@@ -318,8 +318,8 @@ def check_leds():
if leds:
if channel == '1' and not statusgreenA:
statusgreenA = True
driver_gpio.init(SET_CHANNEL['redA'])
driver_gpio.gpio_high(SET_CHANNEL['redA'])
driver_gpio.init(SET_CHANNEL['yellowA'])
driver_gpio.gpio_high(SET_CHANNEL['yellowA'])
# t = threading.Thread(target=deal_with_greenA)
# t.start()
logging.warning("A面黄状态灯开启")
......@@ -327,19 +327,19 @@ def check_leds():
statusgreenB = True
# t = threading.Thread(target=deal_with_greenB)
# t.start()
driver_gpio.init(SET_CHANNEL['redB'])
driver_gpio.gpio_high(SET_CHANNEL['redB'])
driver_gpio.init(SET_CHANNEL['yellowB'])
driver_gpio.gpio_high(SET_CHANNEL['yellowB'])
logging.warning("B面黄状态灯开启")
else:
if channel == '1' and statusgreenA:
statusgreenA = False
driver_gpio.init(SET_CHANNEL['redA'])
driver_gpio.gpio_low(SET_CHANNEL['redA'])
driver_gpio.init(SET_CHANNEL['yellowA'])
driver_gpio.gpio_low(SET_CHANNEL['yellowA'])
logging.warning("A面黄状态灯关闭")
elif channel == '2' and statusgreenB:
statusgreenB = False
driver_gpio.init(SET_CHANNEL['redB'])
driver_gpio.gpio_low(SET_CHANNEL['redB'])
driver_gpio.init(SET_CHANNEL['yellowB'])
driver_gpio.gpio_low(SET_CHANNEL['yellowB'])
logging.warning("B面黄状态灯关闭")
......
1.1
\ No newline at end of file
1.2
\ No newline at end of file
......@@ -142,6 +142,7 @@
<div class="panel-body">
<!-- <input type="button" value="软件备份" class="btn btn-info" onclick="backup()"/> -->
<input type="button" value={{ _('料架升级') }} class="btn btn-info" onclick="upgrade()"/>
<!-- <input type="button" value={{ _('teamview') }} class="btn btn-info" onclick="openteamview()"/> -->
</div>
</div>
</div>
......@@ -338,6 +339,28 @@
}
}
function openteamview(){
if (confirm("确认打开")) {
$.ajax({
url:"/openteamview",
type:"post",
// data:JSON.stringify(data),
contentType: "application/json",
dataType: 'json',
success:function(data){
$("#operation").html(data.operation)
alert(data.operation);
},
error:function(e){
alert("升级成功,请刷新浏览器");
}
})
}
else {
alert("已取消");
}
}
</script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-04-08 16:38+0800\n"
"POT-Creation-Date: 2021-04-19 15:19+0800\n"
"PO-Revision-Date: 2021-04-08 16:25+0800\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
......@@ -22,171 +22,183 @@ msgstr ""
msgid "智能料架系统"
msgstr "SmartShelf"
#: templates/base.html:23 templates/ledtest.html:23
#: templates/shelfconfig.html:79
#: templates/base.html:26 templates/ledtest.html:24
#: templates/shelfconfig.html:80
msgid "亮灯料架"
msgstr "Lighting material rack"
#: templates/base.html:27 templates/ledtest.html:27
#: templates/shelfconfig.html:83
#: templates/base.html:30 templates/ledtest.html:28
#: templates/shelfconfig.html:84
msgid "控制"
msgstr "Control"
#: templates/base.html:28 templates/ledtest.html:28
#: templates/shelfconfig.html:84
#: templates/base.html:31 templates/ledtest.html:29
#: templates/shelfconfig.html:85
msgid "测试"
msgstr "Test"
#: templates/base.html:29 templates/ledtest.html:29
#: templates/shelfconfig.html:85
#: templates/base.html:32 templates/ledtest.html:30
#: templates/shelfconfig.html:86
msgid "料架配置"
msgstr "Material rack configuration"
#: templates/base.html:45 templates/ledtest.html:45
#: templates/shelfconfig.html:101
#: templates/base.html:58 templates/ledtest.html:46
#: templates/shelfconfig.html:102
msgid "料架系统"
msgstr "Material rack system"
#: templates/base.html:50
#: templates/base.html:63
msgid "开关"
msgstr "switch"
#: templates/base.html:53
#: templates/base.html:66
msgid "启动"
msgstr "Start"
#: templates/base.html:54
#: templates/base.html:67
msgid "停止"
msgstr "Stop"
#: templates/base.html:62 templates/ledtest.html:137
#: templates/shelfconfig.html:154
#: templates/base.html:75 templates/ledtest.html:159
#: templates/shelfconfig.html:155
msgid "提醒消息"
msgstr "Reminder message"
#: templates/base.html:67 templates/ledtest.html:142
#: templates/shelfconfig.html:159
#: templates/base.html:80 templates/ledtest.html:164
#: templates/shelfconfig.html:160
msgid "运行状态"
msgstr "Running status"
#: templates/base.html:72 templates/ledtest.html:152
#: templates/shelfconfig.html:164
#: templates/base.html:85 templates/ledtest.html:174
#: templates/shelfconfig.html:165
msgid "配置文件加载状态"
msgstr "Configuration file loading status"
#: templates/base.html:77 templates/shelfconfig.html:124
#: templates/shelfconfig.html:169
#: templates/base.html:90 templates/shelfconfig.html:125
#: templates/shelfconfig.html:170
msgid "服务器地址"
msgstr "Server address"
#: templates/base.html:82 templates/shelfconfig.html:130
#: templates/shelfconfig.html:174
#: templates/base.html:95 templates/shelfconfig.html:131
#: templates/shelfconfig.html:175
msgid "料架编号"
msgstr "Material rack number"
#: templates/base.html:87
#: templates/base.html:100
msgid "服务器连接状态"
msgstr "Server connection status"
#: templates/base.html:96 templates/ledtest.html:131
#: templates/shelfconfig.html:148
#: templates/base.html:109 templates/ledtest.html:153
#: templates/shelfconfig.html:149
msgid "运行日志&状态信息"
msgstr "Run log & status information"
#: templates/base.html:101
#: templates/base.html:114
msgid "日志下载"
msgstr "Log"
#: templates/base.html:104
#: templates/base.html:117
msgid "下载日志"
msgstr "download log"
#: templates/base.html:111
#: templates/base.html:124
msgid "日志"
msgstr "running log"
#: templates/ledtest.html:50
#: templates/ledtest.html:51
msgid "灯条测试"
msgstr "Light bar test"
#: templates/ledtest.html:53 templates/ledtest.html:109
#: templates/ledtest.html:54 templates/ledtest.html:110
msgid "通道"
msgstr "channel"
#: templates/ledtest.html:60 templates/ledtest.html:88
#: templates/ledtest.html:116
#: templates/ledtest.html:61 templates/ledtest.html:89
#: templates/ledtest.html:117
msgid "颜色"
msgstr "color"
#: templates/ledtest.html:70
#: templates/ledtest.html:71
msgid "灯条全开"
msgstr "light"
#: templates/ledtest.html:71
#: templates/ledtest.html:72
msgid "灯条关闭"
msgstr "off"
#: templates/ledtest.html:77
#: templates/ledtest.html:78
msgid "库位操作测试"
msgstr "Location operation test"
#: templates/ledtest.html:80
#: templates/ledtest.html:81
msgid "库位"
msgstr "Location"
#: templates/ledtest.html:98 templates/ledtest.html:124
#: templates/ledtest.html:99 templates/ledtest.html:125
msgid "亮灯"
msgstr "light"
#: templates/ledtest.html:99 templates/ledtest.html:125
#: templates/ledtest.html:100 templates/ledtest.html:126
msgid "灭灯"
msgstr "off"
#: templates/ledtest.html:100
#: templates/ledtest.html:101
msgid "重置"
msgstr "reset"
#: templates/ledtest.html:106
#: templates/ledtest.html:107
msgid "状态灯测试"
msgstr "Status light test"
#: templates/ledtest.html:133
msgid "下载库位二维码"
msgstr "download location QR code"
#: templates/ledtest.html:145
msgid "下载二维码"
msgstr "download"
#: templates/ledtest.html:147
msgid "单个二维码尺寸(含白色底框)尺寸为16*16mm,黑码尺寸为10*10mm"
msgstr "Single QR code size(including white bottom frame) size is 16*16mm,black code size is 10*10mm"
#: templates/ledtest.html:169
msgid "测试消息"
msgstr "test message"
#: templates/shelfconfig.html:106
#: templates/shelfconfig.html:107
msgid "配置文件"
msgstr "config file"
#: templates/shelfconfig.html:110
#: templates/shelfconfig.html:111
msgid "选择文件"
msgstr "Select file"
#: templates/shelfconfig.html:113
#: templates/shelfconfig.html:114
msgid "上传"
msgstr "Upload"
#: templates/shelfconfig.html:119
#: templates/shelfconfig.html:120
msgid "服务器配置"
msgstr "server configuration"
#: templates/shelfconfig.html:134
#: templates/shelfconfig.html:135
msgid "保存"
msgstr "save"
#: templates/shelfconfig.html:139
#: templates/shelfconfig.html:140
msgid "控制器备份&升级"
msgstr "Controller backup & upgrade"
#: templates/shelfconfig.html:143
#: templates/shelfconfig.html:144
msgid "料架升级"
msgstr "software upgrade"
#: templates/shelfconfig.html:179
#: templates/shelfconfig.html:180
msgid "操作提醒"
msgstr "Operation reminder"
#: templates/shelfconfig.html:184
#: templates/shelfconfig.html:185
msgid "软件版本"
msgstr "Software version"
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!