Commit fcb25b7c 刘韬

优化库位加载编码自适应

1 个父辈 3e648fd5
正在显示 87 个修改的文件 包含 385 行增加22 行删除
......@@ -43,6 +43,7 @@ except Exception as e:
logging.warning("ip,cid未配置")
def confirm_state(state):
uploads_path = basepath + Config.STATE_PATH
with open(uploads_path + "state.txt","w") as f:
......@@ -272,7 +273,9 @@ def resolve_data(datajson):
logging.warning("所有库位灯打开,{}".format(operation['openAll']))
#"lightHouseOpenOrClose": "close=B=red"
if 'lightHouseOpenOrClose' in operation.keys():
tl = operation['lightHouseOpenOrClose'].split("=")
offstock = operation['lightHouseOpenOrClose'].split("|")
for stock in offstock:
tl = stock.split("=")
towerLightControl(tl[1],tl[2],tl[0])
logging.warning("灯塔控制:{},{}.{}".format(tl[0],tl[1],tl[2]))
if channels:
......@@ -470,6 +473,8 @@ def check_leds():
def start_show(wait=10):
if hasattr(Config, 'TOWER_CUSTCONTROL') and Config.TOWER_CUSTCONTROL:
return
if shelfconfig.TOWER_CUSTCONTROL==1:
return
global post_leds
pin1,pin2 = SET_LED_CHANNEL['1'],SET_LED_CHANNEL['2']
strip1 = get_strip(pin1)
......
......@@ -40,8 +40,15 @@ option_list = []
basepath = os.path.dirname(__file__)
uploads_path = basepath + Config.UPLOAD_FOLDER
state_path = basepath + Config.STATE_PATH
try:
with open(uploads_path +'/linePositions.csv', 'r',encoding='gbk') as f:
logging.warning("开始读取库位数据")
# 自动识别文件编码
import chardet
raw = open(uploads_path + '/linePositions.csv', 'rb').read()
enc = chardet.detect(raw)['encoding'] or 'gbk'
logging.warning("检测到的编码:{}".format(enc))
with open(uploads_path + '/linePositions.csv', 'r', encoding=enc) as f:
reader = csv.reader(f)
for row in reader:
if row[0]=='位置':
......@@ -52,7 +59,7 @@ try:
logging.warning("配置文件加载成功...")
config_state =True
except Exception as e:
logging.warning("配置文件加载失败,请上传配置文件")
logging.warning(". 原因: {}".format(e))
config_state = False
SET_CHANNEL = {'greenA':5,'yellowA':6,'redA':16,'greenB':17,'yellowB':27,'redB':23}
#SET_CHANNEL = {'greenB':5,'yellowB':6,'redB':16,'greenA':17,'yellowA':27,'redA':23}
......@@ -385,7 +392,13 @@ def reload_config():
global option_list
print (config_dict,option_list)
try:
with open(uploads_path +'/linePositions.csv', 'r',encoding='gbk') as f:
logging.warning("开始读取库位数据")
# 自动识别文件编码
import chardet
raw = open(uploads_path + '/linePositions.csv', 'rb').read()
enc = chardet.detect(raw)['encoding'] or 'gbk'
logging.warning("检测到的编码:{}".format(enc))
with open(uploads_path + '/linePositions.csv', 'r', encoding=enc) as f:
reader = csv.reader(f)
config_dict = {}
option_list = []
......@@ -396,7 +409,7 @@ def reload_config():
config_state = True
print (config_dict,option_list)
except Exception as e:
logging.warning("配置文件加载失败,请上传配置文件")
logging.warning("配置文件加载失败,请上传配置文件. 原因: {}".format(e))
config_state = False
def process_linetest(data):
......@@ -745,3 +758,17 @@ def rest_api_v1_shelf_lightHouse():
except Exception as e:
logging.error(f'Error in lightHouse interface: {str(e)}')
return 'FAIL'
import os, glob
@app.route('/getmac')
def getmac():
for root in glob.glob('/sys/class/net/*'):
iface = root.split('/')[-1]
if iface.startswith('eth'):
addr_file = os.path.join(root, 'address')
if os.path.isfile(addr_file):
with open(addr_file) as f:
mac = f.read().strip()
if mac and mac != '00:00:00:00:00:00':
return mac.upper()
return '00:00:00:00:00:00'
\ No newline at end of file
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
......@@ -7,8 +7,8 @@
<link rel="icon" type="image/png" href="/logo.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Neo Light</title>
<script type="module" crossorigin src="/assets/index-90a7a6a1.js"></script>
<link rel="stylesheet" href="/assets/index-0d387cd4.css">
<script type="module" crossorigin src="/assets/index-38395b74.js"></script>
<link rel="stylesheet" href="/assets/index-13675300.css">
</head>
<body>
......
1.69
\ No newline at end of file
1.72
\ No newline at end of file
......@@ -54766,3 +54766,84 @@ SyntaxError: invalid syntax
2025-10-16 15:29:08,750 : 测试界面
2025-10-16 15:29:08,781 : 127.0.0.1 - - [16/Oct/2025 15:29:08] "GET /ledtest HTTP/1.1" 200 -
2025-10-16 15:29:08,861 : 127.0.0.1 - - [16/Oct/2025 15:29:08] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:05,618 : 配置文件加载成功...
2025-12-05 13:47:05,986 : ip&cid...:{'post': 'wait', 'ip': '_', 'cid': '1562'}
2025-12-05 13:47:06,601 : 配置文件加载成功...
2025-12-05 13:47:06,946 : ip&cid...:{'post': 'wait', 'ip': '_', 'cid': '1562'}
2025-12-05 13:47:08,110 : 关闭成功
2025-12-05 13:47:08,119 : 127.0.0.1 - - [05/Dec/2025 13:47:08] "POST /stoppost HTTP/1.1" 200 -
2025-12-05 13:47:09,034 : 无需关闭
2025-12-05 13:47:09,035 : 127.0.0.1 - - [05/Dec/2025 13:47:09] "POST /stoppost HTTP/1.1" 200 -
2025-12-05 13:47:10,142 : 启动成功
2025-12-05 13:47:10,143 : 127.0.0.1 - - [05/Dec/2025 13:47:10] "POST /startpost HTTP/1.1" 200 -
2025-12-05 13:47:10,147 : 启动完成
2025-12-05 13:47:11,061 : 料架运行中无需重复启动
2025-12-05 13:47:11,063 : 127.0.0.1 - - [05/Dec/2025 13:47:11] "POST /startpost HTTP/1.1" 200 -
2025-12-05 13:47:11,067 : 启动完成
2025-12-05 13:47:16,105 : 127.0.0.1 - - [05/Dec/2025 13:47:16] "GET /induction_admin HTTP/1.1" 200 -
2025-12-05 13:47:16,180 : 127.0.0.1 - - [05/Dec/2025 13:47:16] "GET /assets/index-2ca6c47d.js HTTP/1.1" 200 -
2025-12-05 13:47:16,188 : 127.0.0.1 - - [05/Dec/2025 13:47:16] "GET /assets/index-32fd2caf.css HTTP/1.1" 200 -
2025-12-05 13:47:16,330 : 127.0.0.1 - - [05/Dec/2025 13:47:16] "GET /assets/404-538aa4d7.png HTTP/1.1" 200 -
2025-12-05 13:47:16,336 : 127.0.0.1 - - [05/Dec/2025 13:47:16] "GET /assets/404_cloud-98e7ac66.png HTTP/1.1" 200 -
2025-12-05 13:47:16,443 : 127.0.0.1 - - [05/Dec/2025 13:47:16] "GET /logo.png HTTP/1.1" 200 -
2025-12-05 13:47:18,246 : 库位灯有open指令:1000001=red=5|1000002=blue
2025-12-05 13:47:18,249 : 未找到库位:1000001=red=5,1000001,None
2025-12-05 13:47:18,255 : 未找到库位:1000002=blue,1000002,None
2025-12-05 13:47:20,433 : 127.0.0.1 - - [05/Dec/2025 13:47:20] "GET / HTTP/1.1" 200 -
2025-12-05 13:47:20,689 : 127.0.0.1 - - [05/Dec/2025 13:47:20] "GET /assets/logo-7fbd1700.png HTTP/1.1" 200 -
2025-12-05 13:47:20,690 : 127.0.0.1 - - [05/Dec/2025 13:47:20] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:20,705 : 127.0.0.1 - - [05/Dec/2025 13:47:20] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:20,720 : 127.0.0.1 - - [05/Dec/2025 13:47:20] "GET /getmac?_t=1764913640669 HTTP/1.1" 200 -
2025-12-05 13:47:20,723 : 127.0.0.1 - - [05/Dec/2025 13:47:20] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:20,776 : 127.0.0.1 - - [05/Dec/2025 13:47:20] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:20,791 : 127.0.0.1 - - [05/Dec/2025 13:47:20] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:22,690 : 127.0.0.1 - - [05/Dec/2025 13:47:22] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:22,714 : 127.0.0.1 - - [05/Dec/2025 13:47:22] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:22,764 : 127.0.0.1 - - [05/Dec/2025 13:47:22] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:24,684 : 127.0.0.1 - - [05/Dec/2025 13:47:24] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:24,712 : 127.0.0.1 - - [05/Dec/2025 13:47:24] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:24,763 : 127.0.0.1 - - [05/Dec/2025 13:47:24] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:25,579 : 127.0.0.1 - - [05/Dec/2025 13:47:25] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:25,609 : 127.0.0.1 - - [05/Dec/2025 13:47:25] "POST /get_networkinfo HTTP/1.1" 200 -
2025-12-05 13:47:25,663 : 127.0.0.1 - - [05/Dec/2025 13:47:25] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:27,579 : 127.0.0.1 - - [05/Dec/2025 13:47:27] "GET /config_state?_t=1764913647565 HTTP/1.1" 200 -
2025-12-05 13:47:27,583 : 127.0.0.1 - - [05/Dec/2025 13:47:27] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:27,594 : 127.0.0.1 - - [05/Dec/2025 13:47:27] "GET /positionlist?_t=1764913647565 HTTP/1.1" 200 -
2025-12-05 13:47:27,648 : 127.0.0.1 - - [05/Dec/2025 13:47:27] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:28,732 : 127.0.0.1 - - [05/Dec/2025 13:47:28] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:28,737 : 127.0.0.1 - - [05/Dec/2025 13:47:28] "GET /config_state?_t=1764913648716 HTTP/1.1" 200 -
2025-12-05 13:47:28,740 : 127.0.0.1 - - [05/Dec/2025 13:47:28] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:28,760 : 127.0.0.1 - - [05/Dec/2025 13:47:28] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:29,788 : 127.0.0.1 - - [05/Dec/2025 13:47:29] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:29,807 : 127.0.0.1 - - [05/Dec/2025 13:47:29] "GET /getmac?_t=1764913649760 HTTP/1.1" 200 -
2025-12-05 13:47:29,813 : 127.0.0.1 - - [05/Dec/2025 13:47:29] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:29,827 : 127.0.0.1 - - [05/Dec/2025 13:47:29] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:29,843 : 127.0.0.1 - - [05/Dec/2025 13:47:29] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:29,888 : 127.0.0.1 - - [05/Dec/2025 13:47:29] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:31,778 : 127.0.0.1 - - [05/Dec/2025 13:47:31] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:31,798 : 127.0.0.1 - - [05/Dec/2025 13:47:31] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:31,861 : 127.0.0.1 - - [05/Dec/2025 13:47:31] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:33,786 : 127.0.0.1 - - [05/Dec/2025 13:47:33] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:33,814 : 127.0.0.1 - - [05/Dec/2025 13:47:33] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:33,873 : 127.0.0.1 - - [05/Dec/2025 13:47:33] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:35,788 : 127.0.0.1 - - [05/Dec/2025 13:47:35] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:35,816 : 127.0.0.1 - - [05/Dec/2025 13:47:35] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:35,881 : 127.0.0.1 - - [05/Dec/2025 13:47:35] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:37,792 : 127.0.0.1 - - [05/Dec/2025 13:47:37] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:37,816 : 127.0.0.1 - - [05/Dec/2025 13:47:37] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:37,882 : 127.0.0.1 - - [05/Dec/2025 13:47:37] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:39,787 : 127.0.0.1 - - [05/Dec/2025 13:47:39] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:39,821 : 127.0.0.1 - - [05/Dec/2025 13:47:39] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:39,886 : 127.0.0.1 - - [05/Dec/2025 13:47:39] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:42,108 : 127.0.0.1 - - [05/Dec/2025 13:47:42] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:42,135 : 127.0.0.1 - - [05/Dec/2025 13:47:42] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:42,159 : 127.0.0.1 - - [05/Dec/2025 13:47:42] "POST /taillog HTTP/1.1" 200 -
2025-12-05 13:47:44,100 : 127.0.0.1 - - [05/Dec/2025 13:47:44] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:44,116 : 127.0.0.1 - - [05/Dec/2025 13:47:44] "POST /getstate HTTP/1.1" 200 -
2025-12-05 13:47:44,132 : 127.0.0.1 - - [05/Dec/2025 13:47:44] "POST /taillog HTTP/1.1" 200 -
2026-03-16 13:57:08,273 : 开始读取库位数据
2026-03-16 13:57:09,245 : 开始读取库位数据
2026-03-16 13:57:41,038 : * Detected change in 'D:\\rick\\python\\SmartShelf-raspberry\\smartshelf\\app\\routes.py', reloading
2026-03-16 15:15:04,887 : 开始读取库位数据
2026-03-16 15:15:05,901 : 开始读取库位数据
2026-03-16 15:15:07,508 : 检测到的编码:GB2312
{"192.168.101.145":{"IP":"192.168.101.145","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":19,"shelfState":{"isupdate":true,"state":"off","msg":"未进行测试动作","ipconfig":{"post":"wait","ip":"http://192.168.101.108/smf-core","cid":"S11695"},"version":"1.69","serial_state":null,"ad_serial":null},"memo":null},"192.168.101.138":{"IP":"192.168.101.138","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":89,"shelfState":{"isupdate":true,"state":"on","msg":"未进行测试动作","ipconfig":{"post":"success","ip":"http://192.168.101.108/smf-core","cid":"S11692"},"version":"1.69","serial_state":null,"ad_serial":null},"memo":null},"192.168.101.140":{"IP":"192.168.101.140","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":16,"shelfState":{"isupdate":true,"state":"on","msg":"未进行测试动作","ipconfig":{"post":"success","ip":"http://192.168.101.108/smf-core","cid":"S11693"},"version":"1.69","serial_state":null,"ad_serial":null},"memo":null},"192.168.101.142":{"IP":"192.168.101.142","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":45,"shelfState":{"isupdate":false,"state":"na","msg":null,"ipconfig":null,"version":null,"serial_state":"na","ad_serial":null},"memo":null}}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<config ver="10">
<item key="ipstart" ver="10" value="192.168.101.138" />
<item key="ipend" ver="10" value="142" />
<item key="ipstart" ver="10" value="192.168.101.47" />
<item key="ipend" ver="10" value="47" />
</config>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<config ver="10">
<item key="ipstart" ver="10" value="192.168.101.138" />
<item key="ipend" ver="10" value="142" />
<item key="ipstart" ver="10" value="192.168.101.47" />
<item key="ipend" ver="10" value="47" />
</config>
\ No newline at end of file
{"192.168.101.145":{"IP":"192.168.101.145","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":19,"shelfState":{"isupdate":false,"state":"off","msg":"未进行测试动作","ipconfig":{"post":"wait","ip":"http://192.168.101.108/smf-core","cid":"S11695"},"version":"1.69","serial_state":null,"ad_serial":null},"memo":null},"192.168.101.138":{"IP":"192.168.101.138","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":89,"shelfState":{"isupdate":false,"state":"on","msg":"未进行测试动作","ipconfig":{"post":"success","ip":"http://192.168.101.108/smf-core","cid":"S11692"},"version":"1.69","serial_state":null,"ad_serial":null},"memo":null},"192.168.101.140":{"IP":"192.168.101.140","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":16,"shelfState":{"isupdate":false,"state":"on","msg":"未进行测试动作","ipconfig":{"post":"success","ip":"http://192.168.101.108/smf-core","cid":"S11693"},"version":"1.69","serial_state":null,"ad_serial":null},"memo":null},"192.168.101.142":{"IP":"192.168.101.142","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":45,"shelfState":{"isupdate":false,"state":"na","msg":null,"ipconfig":null,"version":null,"serial_state":"na","ad_serial":null},"memo":null},"192.168.101.235":{"IP":"192.168.101.235","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":123,"shelfState":{"isupdate":false,"state":"off","msg":"未进行测试动作","ipconfig":{"post":"wait","ip":"http://192.168.10.99/smf-core","cid":"NL1"},"version":"1.72","serial_state":null,"ad_serial":null},"memo":null},"192.168.101.47":{"IP":"192.168.101.47","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":79,"shelfState":{"isupdate":true,"state":"off","msg":"未进行测试动作","ipconfig":{"post":"wait","ip":"http://192.168.10.99/smf-core","cid":"NL1"},"version":"1.72","serial_state":null,"ad_serial":null},"memo":null}}
\ No newline at end of file
此文件类型无法预览
......@@ -309,7 +309,7 @@
将程序路径写到注册表, 方便以后做软件更新
</summary>
</member>
<member name="M:CommonLib.AddOrUpdateStartupTask(System.Boolean,System.Int32)">
<member name="M:CommonLib.AddOrUpdateStartupTask(System.Nullable{System.Boolean},System.Int32)">
<summary>
将程序设置为计划任务电脑开机,用户登陆后自动启动
</summary>
......@@ -322,6 +322,11 @@
</summary>
<param name="action"></param>
</member>
<member name="M:CommonLib.DeleteWithRemainingCapacity">
<summary>
空间不足5G时自动删除文件
</summary>
</member>
<member name="M:CommonLib.DeleteOverDayFile(System.String,System.String,System.Int32)">
<summary>
删除超过指定天数的文件
......
......@@ -43,6 +43,7 @@ except Exception as e:
logging.warning("ip,cid未配置")
def confirm_state(state):
uploads_path = basepath + Config.STATE_PATH
with open(uploads_path + "state.txt","w") as f:
......@@ -272,7 +273,9 @@ def resolve_data(datajson):
logging.warning("所有库位灯打开,{}".format(operation['openAll']))
#"lightHouseOpenOrClose": "close=B=red"
if 'lightHouseOpenOrClose' in operation.keys():
tl = operation['lightHouseOpenOrClose'].split("=")
offstock = operation['lightHouseOpenOrClose'].split("|")
for stock in offstock:
tl = stock.split("=")
towerLightControl(tl[1],tl[2],tl[0])
logging.warning("灯塔控制:{},{}.{}".format(tl[0],tl[1],tl[2]))
if channels:
......@@ -470,6 +473,8 @@ def check_leds():
def start_show(wait=10):
if hasattr(Config, 'TOWER_CUSTCONTROL') and Config.TOWER_CUSTCONTROL:
return
if shelfconfig.TOWER_CUSTCONTROL==1:
return
global post_leds
pin1,pin2 = SET_LED_CHANNEL['1'],SET_LED_CHANNEL['2']
strip1 = get_strip(pin1)
......
......@@ -40,8 +40,15 @@ option_list = []
basepath = os.path.dirname(__file__)
uploads_path = basepath + Config.UPLOAD_FOLDER
state_path = basepath + Config.STATE_PATH
try:
with open(uploads_path +'/linePositions.csv', 'r',encoding='gbk') as f:
logging.warning("开始读取库位数据")
# 自动识别文件编码
import chardet
raw = open(uploads_path + '/linePositions.csv', 'rb').read()
enc = chardet.detect(raw)['encoding'] or 'gbk'
logging.warning("检测到的编码:{}".format(enc))
with open(uploads_path + '/linePositions.csv', 'r', encoding=enc) as f:
reader = csv.reader(f)
for row in reader:
if row[0]=='位置':
......@@ -52,7 +59,7 @@ try:
logging.warning("配置文件加载成功...")
config_state =True
except Exception as e:
logging.warning("配置文件加载失败,请上传配置文件")
logging.warning(". 原因: {}".format(e))
config_state = False
SET_CHANNEL = {'greenA':5,'yellowA':6,'redA':16,'greenB':17,'yellowB':27,'redB':23}
#SET_CHANNEL = {'greenB':5,'yellowB':6,'redB':16,'greenA':17,'yellowA':27,'redA':23}
......@@ -385,7 +392,13 @@ def reload_config():
global option_list
print (config_dict,option_list)
try:
with open(uploads_path +'/linePositions.csv', 'r',encoding='gbk') as f:
logging.warning("开始读取库位数据")
# 自动识别文件编码
import chardet
raw = open(uploads_path + '/linePositions.csv', 'rb').read()
enc = chardet.detect(raw)['encoding'] or 'gbk'
logging.warning("检测到的编码:{}".format(enc))
with open(uploads_path + '/linePositions.csv', 'r', encoding=enc) as f:
reader = csv.reader(f)
config_dict = {}
option_list = []
......@@ -396,7 +409,7 @@ def reload_config():
config_state = True
print (config_dict,option_list)
except Exception as e:
logging.warning("配置文件加载失败,请上传配置文件")
logging.warning("配置文件加载失败,请上传配置文件. 原因: {}".format(e))
config_state = False
def process_linetest(data):
......@@ -745,3 +758,17 @@ def rest_api_v1_shelf_lightHouse():
except Exception as e:
logging.error(f'Error in lightHouse interface: {str(e)}')
return 'FAIL'
import os, glob
@app.route('/getmac')
def getmac():
for root in glob.glob('/sys/class/net/*'):
iface = root.split('/')[-1]
if iface.startswith('eth'):
addr_file = os.path.join(root, 'address')
if os.path.isfile(addr_file):
with open(addr_file) as f:
mac = f.read().strip()
if mac and mac != '00:00:00:00:00:00':
return mac.upper()
return '00:00:00:00:00:00'
\ No newline at end of file
此文件的差异太大,无法显示。
/*
* Globals
*/
/* Links */
a,
a:focus,
a:hover {
color: #fff;
}
/* Custom default button */
.btn-default,
.btn-default:hover,
.btn-default:focus {
color: #333;
text-shadow: none; /* Prevent inheritance from `body` */
background-color: #fff;
border: 1px solid #fff;
}
/*
* Base structure
*/
html,
body {
height: 100%;
background-color: #333;
}
body {
color: #fff;
text-align: center;
text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
/* Extra markup and styles for table-esque vertical and horizontal centering */
.site-wrapper {
display: table;
width: 100%;
height: 100%; /* For at least Firefox */
min-height: 100%;
-webkit-box-shadow: inset 0 0 100px rgba(0,0,0,.5);
box-shadow: inset 0 0 100px rgba(0,0,0,.5);
}
.site-wrapper-inner {
display: table-cell;
vertical-align: top;
}
.cover-container {
margin-right: auto;
margin-left: auto;
}
/* Padding for spacing */
.inner {
padding: 30px;
}
/*
* Header
*/
.masthead-brand {
margin-top: 10px;
margin-bottom: 10px;
}
.masthead-nav > li {
display: inline-block;
}
.masthead-nav > li + li {
margin-left: 20px;
}
.masthead-nav > li > a {
padding-right: 0;
padding-left: 0;
font-size: 16px;
font-weight: bold;
color: #fff; /* IE8 proofing */
color: rgba(255,255,255,.75);
border-bottom: 2px solid transparent;
}
.masthead-nav > li > a:hover,
.masthead-nav > li > a:focus {
background-color: transparent;
border-bottom-color: #a9a9a9;
border-bottom-color: rgba(255,255,255,.25);
}
.masthead-nav > .active > a,
.masthead-nav > .active > a:hover,
.masthead-nav > .active > a:focus {
color: #fff;
border-bottom-color: #fff;
}
@media (min-width: 768px) {
.masthead-brand {
float: left;
}
.masthead-nav {
float: right;
}
}
/*
* Cover
*/
.cover {
padding: 0 20px;
}
.cover .btn-lg {
padding: 10px 20px;
font-weight: bold;
}
/*
* Footer
*/
.mastfoot {
color: #999; /* IE8 proofing */
color: rgba(255,255,255,.5);
}
/*
* Affix and center
*/
@media (min-width: 768px) {
/* Pull out the header and footer */
.masthead {
position: fixed;
top: 0;
}
.mastfoot {
position: fixed;
bottom: 0;
}
/* Start the vertical centering */
.site-wrapper-inner {
vertical-align: middle;
}
/* Handle the widths */
.masthead,
.mastfoot,
.cover-container {
width: 100%; /* Must be percentage or pixels for horizontal alignment */
}
}
@media (min-width: 992px) {
.masthead,
.mastfoot,
.cover-container {
width: 700px;
}
}
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*
* See the Getting Started docs for more information:
* http://getbootstrap.com/getting-started/#support-ie10-width
*/
@-ms-viewport { width: device-width; }
@-o-viewport { width: device-width; }
@viewport { width: device-width; }
......@@ -7,8 +7,8 @@
<link rel="icon" type="image/png" href="/logo.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Neo Light</title>
<script type="module" crossorigin src="/assets/index-271ab98b.js"></script>
<link rel="stylesheet" href="/assets/index-89b84b28.css">
<script type="module" crossorigin src="/assets/index-38395b74.js"></script>
<link rel="stylesheet" href="/assets/index-13675300.css">
</head>
<body>
......
.ew-alpha-slider-bg,.ew-alpha-slider-thumb,.ew-alpha-slider-wrapper,.ew-color-black-panel,.ew-color-cursor,.ew-color-drop-btn-group,.ew-color-picker,.ew-color-picker-arrow,.ew-color-picker-no,.ew-color-slider-thumb,.ew-color-white-panel{position:absolute}.ew-alpha-slider-bar,.ew-color-drop-container,.ew-color-mode-container .ew-color-mode-down,.ew-color-mode-container .ew-color-mode-up,.ew-color-panel,.ew-color-picker-arrow-left,.ew-color-picker-arrow-right,.ew-color-picker-box,.ew-color-slider,.ew-color-slider-bar{position:relative}.ew-alpha-slider-thumb,.ew-color-drop-btn,.ew-color-input,.ew-color-slider,.ew-color-slider-thumb{-webkit-box-sizing:border-box;box-sizing:border-box}.ew-alpha-slider-bar,.ew-alpha-slider-thumb,.ew-color-drop-btn,.ew-color-panel,.ew-color-picker-box,.ew-color-slider-bar,.ew-color-slider-thumb,.ew-pre-define-color{cursor:pointer}.ew-color-input,.ew-color-picker,.ew-color-picker-arrow-left,.ew-color-picker-arrow-right,.ew-color-picker-box,.ew-color-sure{background-color:#fff}.ew-color-drop-btn,.ew-color-input,.ew-color-picker-box,.ew-pre-define-color{outline:none}.ew-color-drop-btn,.ew-color-input,.ew-color-picker-arrow-left,.ew-color-picker-arrow-right,.ew-color-picker-box{display:inline-block}.ew-color-picker .ew-color-picker-content:after,.ew-pre-define-color-container:after{content:"";display:table;clear:both}.ew-color-slider.ew-is-vertical .ew-alpha-slider-bar,.ew-color-slider.ew-is-vertical .ew-color-slider-bar,.ew-pre-define-color{float:left}.ew-color-drop-btn,.ew-color-picker-no{text-align:center}.ew-color-picker{min-width:320px;-webkit-box-sizing:content-box;box-sizing:content-box;border:1px solid #ebeeff;-webkit-box-shadow:0 4px 15px rgba(0,0,0,.2);box-shadow:0 4px 15px rgba(0,0,0,.2);border-radius:5px;z-index:10;padding:7px;text-align:left;display:none}.ew-color-picker.ew-color-picker-disabled *{cursor:not-allowed}.ew-color-picker-content{margin-bottom:6px}.ew-color-panel{width:280px;height:180px}.ew-alpha-slider-bg,.ew-alpha-slider-wrapper,.ew-color-black-panel,.ew-color-picker-arrow,.ew-color-picker-no,.ew-color-white-panel{left:0;right:0;top:0;bottom:0}.ew-color-white-panel{background:-webkit-gradient(linear,left top,right top,from(#fff),to(hsla(0,0%,100%,0)));background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.ew-color-black-panel{background:-webkit-gradient(linear,left bottom,left top,from(#000),to(transparent));background:linear-gradient(0deg,#000,transparent)}.ew-color-slider.ew-is-vertical{width:27px;height:180px;float:right}.ew-color-slider.ew-is-horizontal{width:100%;height:14px}.ew-color-slider.ew-is-vertical .ew-color-slider-bar{background:-webkit-gradient(linear,left top,left bottom,color-stop(0,red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(180deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);margin-left:3px}.ew-color-slider.ew-is-horizontal .ew-color-slider-bar{background:-webkit-gradient(linear,left top,right top,color-stop(0,red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.ew-color-slider.ew-is-vertical .ew-alpha-slider-bar,.ew-color-slider.ew-is-vertical .ew-color-slider-bar{width:12px;height:100%}.ew-color-slider.ew-is-horizontal .ew-alpha-slider-bar,.ew-color-slider.ew-is-horizontal .ew-color-slider-bar{width:100%;height:12px}.ew-color-slider.ew-is-horizontal .ew-alpha-slider-bar{margin-top:3px}.ew-alpha-slider-wrapper,.ew-pre-define-color.ew-has-alpha{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.ew-alpha-slider-thumb,.ew-color-slider-thumb{left:0;top:0;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6)}.ew-color-slider.ew-is-horizontal .ew-alpha-slider-thumb,.ew-color-slider.ew-is-horizontal .ew-color-slider-thumb{width:4px;height:100%}.ew-color-slider.ew-is-vertical .ew-alpha-slider-thumb,.ew-color-slider.ew-is-vertical .ew-color-slider-thumb{width:12px;height:4px}.ew-color-cursor{left:100%;top:0;cursor:default;width:4px;height:4px;-webkit-transform:translate(-2px,-2px);transform:translate(-2px,-2px);border-radius:50%;-webkit-box-shadow:0 0 0 3px #fff,inset 0 0 2px 2px rgba(0,0,0,.4),0 0 2px 3px rgba(0,0,0,.5);box-shadow:0 0 0 3px #fff,inset 0 0 2px 2px rgba(0,0,0,.4),0 0 2px 3px rgba(0,0,0,.5);-webkit-transform:translate(-6px,-6px);transform:translate(-6px,-6px)}.ew-color-drop-container{margin-top:6px;padding-top:4px;min-height:28px;border-top:1px solid #cdcdcd}.ew-has-mode-container .ew-color-input{width:210px}.ew-has-mode-container .ew-color-mode-container{margin-left:3px}.ew-color-input{width:160px;height:28px;line-height:28px;border:1px solid #dcdfe6;padding:0 5px;-webkit-transition:border-color .2s cubic-bezier(.175,.885,.32,1.275);transition:border-color .2s cubic-bezier(.175,.885,.32,1.275);border-radius:5px}.ew-color-input:not(.ew-input-disabled):focus{border-color:#239fe6}.ew-color-drop-btn{padding:5px;font-size:12px;border-radius:3px;-webkit-transition:.1s;transition:.1s;font-weight:500;margin:0;white-space:nowrap;color:#606266;border:1px solid #dcdfe6;letter-spacing:1px}.ew-color-drop-btn-group{right:0;top:5px}.ew-color-clear{color:#4096ef;border-color:transparent;background-color:transparent;padding-left:0;padding-right:0}.ew-color-clear:active,.ew-color-clear:hover{color:#66b1ff}.ew-color-sure{margin-left:10px}.ew-color-sure:active,.ew-color-sure:hover{border-color:#4096ef;color:#4096ef}.ew-pre-define-color-container{width:280px;font-size:12px;margin-top:8px}.ew-pre-define-color-container:after{visibility:hidden;height:0}.ew-pre-define-color{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;border:1px solid #9b979b}.ew-pre-define-color-item{height:100%;border-radius:3px}.ew-pre-define-color.ew-pre-define-color-disabled{cursor:not-allowed}.ew-pre-define-color:nth-child(10n+1){margin-left:0}.ew-pre-define-color:not(.ew-pre-define-color-disabled):active,.ew-pre-define-color:not(.ew-pre-define-color-disabled):hover{opacity:.8}.ew-pre-define-color-active{-webkit-box-shadow:0 0 3px 2px #409eff;box-shadow:0 0 3px 2px #409eff}.ew-color-picker-box{border:1px solid #dcdee2;color:#535353;border-radius:4px;padding:4px 7px;line-height:1.5;font-size:14px;-webkit-transition:border-color .2s cubic-bezier(.175,.885,.32,1.275);transition:border-color .2s cubic-bezier(.175,.885,.32,1.275)}.ew-color-input.ew-input-disabled,.ew-color-picker-box-disabled{background-color:#ebe7e7;cursor:not-allowed}.ew-color-picker-arrow,.ew-color-picker-no{width:20px;height:20px;margin:auto;z-index:3}.ew-color-picker-no{width:40px;height:40px;font-size:20px;line-height:40px;color:#5e535f;border:1px solid #e2dfe2;border-radius:2px}.ew-color-picker-arrow{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ew-color-picker-arrow-left,.ew-color-picker-arrow-right{width:12px;height:1px}.ew-color-picker-arrow-left{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ew-color-picker-arrow-right{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);right:3px}.ew-color-mode-container{display:inline-block;vertical-align:middle;padding:6px;border-radius:2px}.ew-color-mode-container:hover{background-color:#ebe7e7}.ew-color-mode-container .ew-color-mode-down,.ew-color-mode-container .ew-color-mode-up{width:0;height:0;border-width:6px;border-style:solid;cursor:pointer}.ew-color-mode-container .ew-color-mode-up{bottom:5px;border-color:transparent transparent #606266}.ew-color-mode-container .ew-color-mode-down{top:5px;border-color:#606266 transparent transparent}.ew-color-mode-title{color:#535455;font-size:16px;display:inline-block;padding-right:2px}.ew-color-mode-title:after{content:":";display:inline-block}
\ No newline at end of file
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
// See the Getting Started docs for more information:
// http://getbootstrap.com/getting-started/#support-ie10-width
(function () {
'use strict';
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style')
msViewportStyle.appendChild(
document.createTextNode(
'@-ms-viewport{width:auto!important}'
)
)
document.querySelector('head').appendChild(msViewportStyle)
}
})();
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')
\ No newline at end of file
1.72
\ No newline at end of file
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!