Commit 3c24567b 刘韬

1

1 个父辈 54085d57
pybabel extract -F babel.cfg -o messages.pot .
pybabel update -i messages.pot -d translations
pybabel compile -d translations
\ No newline at end of file \ No newline at end of file
...@@ -326,6 +326,7 @@ def server_post(seq): ...@@ -326,6 +326,7 @@ def server_post(seq):
os.system(dd) os.system(dd)
logging.warning("执行时间设定:{}:{}".format(currentdate,dd)) logging.warning("执行时间设定:{}:{}".format(currentdate,dd))
# response = requests.post("http://jsonplaceholder.typicode.com/posts", data = "some dummy content") # response = requests.post("http://jsonplaceholder.typicode.com/posts", data = "some dummy content")
print(response.status_code,response.text)
ele_json = response.json() ele_json = response.json()
print ('ele_json:{}'.format(ele_json)) print ('ele_json:{}'.format(ele_json))
ip_config['post'] = 'success' ip_config['post'] = 'success'
......
λÖÃ,address,led,sensor,ÓÅÏȼ¶,¸ß¶È,¿í¶È λÖÃ,address,led,sensor,led_channel,ÓÅÏȼ¶,¸ß¶È,¿í¶È
S10392-A1-001,A1,1,1,10,16,13 S10392-A1-001,A1,1,1,1,10,16,13
S10392-A1-002,A1,2,2,10,16,13 S10392-A1-002,A1,2,2,1,10,16,13
S10392-A1-003,A1,3,3,10,16,13 S10392-A1-003,A1,3,3,1,10,16,13
S10392-A1-004,A1,4,4,10,16,13 S10392-A1-004,A1,4,4,1,10,16,13
S10392-A1-005,A1,5,5,10,16,13 S10392-A1-005,A1,5,5,1,10,16,13
S10392-A1-006,A1,6,6,10,16,13 S10392-A1-006,A1,6,6,1,10,16,13
S10392-A1-007,A1,7,7,10,16,13 S10392-A1-007,A1,7,7,1,10,16,13
S10392-A1-008,A1,8,8,10,16,13 S10392-A1-008,A1,8,8,1,10,16,13
S10392-A1-009,A1,9,9,10,16,13 S10392-A1-009,A1,9,9,1,10,16,13
S10392-A1-010,A1,10,10,10,16,13 S10392-A1-010,A1,10,10,1,10,16,13
S10392-A1-011,A1,11,11,10,16,13 S10392-A1-011,A1,11,11,1,10,16,13
S10392-A1-012,A1,12,12,10,16,13 S10392-A1-012,A1,12,12,1,10,16,13
S10392-A1-013,A1,13,13,10,16,13 S10392-A1-013,A1,13,13,1,10,16,13
S10392-A1-014,A1,14,14,10,16,13 S10392-A1-014,A1,14,14,1,10,16,13
S10392-A1-015,A1,15,15,10,16,13 S10392-A1-015,A1,15,15,1,10,16,13
S10392-A1-016,A1,16,16,10,16,13 S10392-A1-016,A1,16,16,1,10,16,13
S10392-A1-017,A1,17,17,10,16,13 S10392-A1-017,A1,17,17,1,10,16,13
S10392-A1-018,A1,18,18,10,16,13 S10392-A1-018,A1,18,18,1,10,16,13
S10392-A1-019,A1,19,19,10,16,13 S10392-A1-019,A1,19,19,1,10,16,13
S10392-A1-020,A1,20,20,10,16,13 S10392-A1-020,A1,20,20,1,10,16,13
S10392-A1-021,A1,21,21,10,16,13 S10392-A1-021,A1,21,21,1,10,16,13
S10392-A1-022,A1,22,22,10,16,13 S10392-A1-022,A1,22,22,1,10,16,13
S10392-A1-023,A1,23,23,10,16,13 S10392-A1-023,A1,23,23,1,10,16,13
S10392-A1-024,A1,24,24,10,16,13 S10392-A1-024,A1,24,24,1,10,16,13
S10392-A1-025,A1,25,25,10,16,13 S10392-A1-025,A1,25,25,1,10,16,13
S10392-A1-026,A1,26,26,10,16,13 S10392-A1-026,A1,26,26,1,10,16,13
S10392-A1-027,A1,27,27,10,16,13 S10392-A1-027,A1,27,27,1,10,16,13
S10392-A2-001,A2,1,1,10,8,7 S10392-A2-001,A2,1,1,1,10,8,7
S10392-A2-002,A2,2,2,10,8,7 S10392-A2-002,A2,2,2,1,10,8,7
S10392-A2-003,A2,3,3,10,8,7 S10392-A2-003,A2,3,3,1,10,8,7
S10392-A2-004,A2,4,4,10,8,7 S10392-A2-004,A2,4,4,1,10,8,7
S10392-A2-005,A2,5,5,10,8,7 S10392-A2-005,A2,5,5,1,10,8,7
S10392-A2-006,A2,6,6,10,8,7 S10392-A2-006,A2,6,6,1,10,8,7
S10392-A2-007,A2,7,7,10,8,7 S10392-A2-007,A2,7,7,1,10,8,7
S10392-A2-008,A2,8,8,10,8,7 S10392-A2-008,A2,8,8,1,10,8,7
S10392-A2-009,A2,9,9,10,8,7 S10392-A2-009,A2,9,9,1,10,8,7
S10392-A2-010,A2,10,10,10,8,7 S10392-A2-010,A2,10,10,1,10,8,7
S10392-A2-011,A2,11,11,10,8,7 S10392-A2-011,A2,11,11,1,10,8,7
S10392-A2-012,A2,12,12,10,8,7 S10392-A2-012,A2,12,12,1,10,8,7
S10392-A2-013,A2,13,13,10,8,7 S10392-A2-013,A2,13,13,1,10,8,7
S10392-A2-014,A2,14,14,10,8,7 S10392-A2-014,A2,14,14,1,10,8,7
S10392-A2-015,A2,15,15,10,8,7 S10392-A2-015,A2,15,15,1,10,8,7
S10392-A2-016,A2,16,16,10,8,7 S10392-A2-016,A2,16,16,1,10,8,7
S10392-A2-017,A2,17,17,10,8,7 S10392-A2-017,A2,17,17,1,10,8,7
S10392-A2-018,A2,18,18,10,8,7 S10392-A2-018,A2,18,18,1,10,8,7
S10392-A2-019,A2,19,19,10,8,7 S10392-A2-019,A2,19,19,1,10,8,7
S10392-A2-020,A2,20,20,10,8,7 S10392-A2-020,A2,20,20,1,10,8,7
S10392-A2-021,A2,21,21,10,8,7 S10392-A2-021,A2,21,21,1,10,8,7
S10392-A2-022,A2,22,22,10,8,7 S10392-A2-022,A2,22,22,1,10,8,7
S10392-A2-023,A2,23,23,10,8,7 S10392-A2-023,A2,23,23,1,10,8,7
S10392-A2-024,A2,24,24,10,8,7 S10392-A2-024,A2,24,24,1,10,8,7
S10392-A2-025,A2,25,25,10,8,7 S10392-A2-025,A2,25,25,1,10,8,7
S10392-A2-026,A2,26,26,10,8,7 S10392-A2-026,A2,26,26,1,10,8,7
S10392-A2-027,A2,27,27,10,8,7 S10392-A2-027,A2,27,27,1,10,8,7
S10392-A2-028,A2,28,28,10,8,7 S10392-A2-028,A2,28,28,1,10,8,7
S10392-A2-029,A2,29,29,10,8,7 S10392-A2-029,A2,29,29,1,10,8,7
S10392-A2-030,A2,30,30,10,8,7 S10392-A2-030,A2,30,30,1,10,8,7
S10392-A2-031,A2,31,31,10,8,7 S10392-A2-031,A2,31,31,1,10,8,7
S10392-A2-032,A2,32,32,10,8,7 S10392-A2-032,A2,32,32,1,10,8,7
S10392-A2-033,A2,33,33,10,8,7 S10392-A2-033,A2,33,33,1,10,8,7
S10392-A3-001,A3,1,1,10,8,7 S10392-A3-001,A3,1,1,2,10,8,7
S10392-A3-002,A3,2,2,10,8,7 S10392-A3-002,A3,2,2,2,10,8,7
S10392-A3-003,A3,3,3,10,8,7 S10392-A3-003,A3,3,3,2,10,8,7
S10392-A3-004,A3,4,4,10,8,7 S10392-A3-004,A3,4,4,2,10,8,7
S10392-A3-005,A3,5,5,10,8,7 S10392-A3-005,A3,5,5,2,10,8,7
S10392-A3-006,A3,6,6,10,8,7 S10392-A3-006,A3,6,6,2,10,8,7
S10392-A3-007,A3,7,7,10,8,7 S10392-A3-007,A3,7,7,2,10,8,7
S10392-A3-008,A3,8,8,10,8,7 S10392-A3-008,A3,8,8,2,10,8,7
S10392-A3-009,A3,9,9,10,8,7 S10392-A3-009,A3,9,9,2,10,8,7
S10392-A3-010,A3,10,10,10,8,7 S10392-A3-010,A3,10,10,2,10,8,7
S10392-A3-011,A3,11,11,10,8,7 S10392-A3-011,A3,11,11,2,10,8,7
S10392-A3-012,A3,12,12,10,8,7 S10392-A3-012,A3,12,12,2,10,8,7
S10392-A3-013,A3,13,13,10,8,7 S10392-A3-013,A3,13,13,2,10,8,7
S10392-A3-014,A3,14,14,10,8,7 S10392-A3-014,A3,14,14,2,10,8,7
S10392-A3-015,A3,15,15,10,8,7 S10392-A3-015,A3,15,15,2,10,8,7
S10392-A3-016,A3,16,16,10,8,7 S10392-A3-016,A3,16,16,2,10,8,7
S10392-A3-017,A3,17,17,10,8,7 S10392-A3-017,A3,17,17,2,10,8,7
S10392-A3-018,A3,18,18,10,8,7 S10392-A3-018,A3,18,18,2,10,8,7
S10392-A3-019,A3,19,19,10,8,7 S10392-A3-019,A3,19,19,2,10,8,7
S10392-A3-020,A3,20,20,10,8,7 S10392-A3-020,A3,20,20,2,10,8,7
S10392-A3-021,A3,21,21,10,8,7 S10392-A3-021,A3,21,21,2,10,8,7
S10392-A3-022,A3,22,22,10,8,7 S10392-A3-022,A3,22,22,2,10,8,7
S10392-A3-023,A3,23,23,10,8,7 S10392-A3-023,A3,23,23,2,10,8,7
S10392-A3-024,A3,24,24,10,8,7 S10392-A3-024,A3,24,24,2,10,8,7
S10392-A3-025,A3,25,25,10,8,7 S10392-A3-025,A3,25,25,2,10,8,7
S10392-A3-026,A3,26,26,10,8,7 S10392-A3-026,A3,26,26,2,10,8,7
S10392-A3-027,A3,27,27,10,8,7 S10392-A3-027,A3,27,27,2,10,8,7
S10392-A3-028,A3,28,28,10,8,7 S10392-A3-028,A3,28,28,2,10,8,7
S10392-A3-029,A3,29,29,10,8,7 S10392-A3-029,A3,29,29,2,10,8,7
S10392-A3-030,A3,30,30,10,8,7 S10392-A3-030,A3,30,30,2,10,8,7
S10392-A3-031,A3,31,31,10,8,7 S10392-A3-031,A3,31,31,2,10,8,7
S10392-A3-032,A3,32,32,10,8,7 S10392-A3-032,A3,32,32,2,10,8,7
S10392-A3-033,A3,33,33,10,8,7 S10392-A3-033,A3,33,33,2,10,8,7
S10392-B1-001,B1,1,1,10,8,7
S10392-B1-002,B1,2,2,10,8,7
S10392-B1-003,B1,3,3,10,8,7
S10392-B1-004,B1,4,4,10,8,7
S10392-B1-005,B1,5,5,10,8,7
S10392-B1-006,B1,6,6,10,8,7
S10392-B1-007,B1,7,7,10,8,7
S10392-B1-008,B1,8,8,10,8,7
S10392-B1-009,B1,9,9,10,8,7
S10392-B1-010,B1,10,10,10,8,7
S10392-B1-011,B1,11,11,10,8,7
S10392-B1-012,B1,12,12,10,8,7
S10392-B1-013,B1,13,13,10,8,7
S10392-B1-014,B1,14,14,10,8,7
S10392-B1-015,B1,15,15,10,8,7
S10392-B1-016,B1,16,16,10,8,7
S10392-B1-017,B1,17,17,10,8,7
S10392-B1-018,B1,18,18,10,8,7
S10392-B1-019,B1,19,19,10,8,7
S10392-B1-020,B1,20,20,10,8,7
S10392-B1-021,B1,21,21,10,8,7
S10392-B1-022,B1,22,22,10,8,7
S10392-B1-023,B1,23,23,10,8,7
S10392-B1-024,B1,24,24,10,8,7
S10392-B1-025,B1,25,25,10,8,7
S10392-B1-026,B1,26,26,10,8,7
S10392-B1-027,B1,27,27,10,8,7
S10392-B1-028,B1,28,28,10,8,7
S10392-B1-029,B1,29,29,10,8,7
S10392-B1-030,B1,30,30,10,8,7
S10392-B1-031,B1,31,31,10,8,7
S10392-B1-032,B1,32,32,10,8,7
S10392-B1-033,B1,33,33,10,8,7
S10392-B2-001,B2,1,1,10,8,7
S10392-B2-002,B2,2,2,10,8,7
S10392-B2-003,B2,3,3,10,8,7
S10392-B2-004,B2,4,4,10,8,7
S10392-B2-005,B2,5,5,10,8,7
S10392-B2-006,B2,6,6,10,8,7
S10392-B2-007,B2,7,7,10,8,7
S10392-B2-008,B2,8,8,10,8,7
S10392-B2-009,B2,9,9,10,8,7
S10392-B2-010,B2,10,10,10,8,7
S10392-B2-011,B2,11,11,10,8,7
S10392-B2-012,B2,12,12,10,8,7
S10392-B2-013,B2,13,13,10,8,7
S10392-B2-014,B2,14,14,10,8,7
S10392-B2-015,B2,15,15,10,8,7
S10392-B2-016,B2,16,16,10,8,7
S10392-B2-017,B2,17,17,10,8,7
S10392-B2-018,B2,18,18,10,8,7
S10392-B2-019,B2,19,19,10,8,7
S10392-B2-020,B2,20,20,10,8,7
S10392-B2-021,B2,21,21,10,8,7
S10392-B2-022,B2,22,22,10,8,7
S10392-B2-023,B2,23,23,10,8,7
S10392-B2-024,B2,24,24,10,8,7
S10392-B2-025,B2,25,25,10,8,7
S10392-B2-026,B2,26,26,10,8,7
S10392-B2-027,B2,27,27,10,8,7
S10392-B2-028,B2,28,28,10,8,7
S10392-B2-029,B2,29,29,10,8,7
S10392-B2-030,B2,30,30,10,8,7
S10392-B2-031,B2,31,31,10,8,7
S10392-B2-032,B2,32,32,10,8,7
S10392-B2-033,B2,33,33,10,8,7
...@@ -12,7 +12,7 @@ basepath = os.path.dirname(__file__) ...@@ -12,7 +12,7 @@ basepath = os.path.dirname(__file__)
shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl' shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl'
def ver(): def ver():
return "1.93" return "1.94"
class _shelfconfig: class _shelfconfig:
def __init__(self): def __init__(self):
......
此文件太大,无法显示。
此文件太大,无法显示。
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<config ver="10"> <config ver="10">
<item key="ipstart" ver="10" value="192.168.1.113" /> <item key="ipstart" ver="10" value="192.168.101.142" />
<item key="ipend" ver="10" value="113" /> <item key="ipend" ver="10" value="142" />
</config> </config>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<config ver="10"> <config ver="10">
<item key="ipstart" ver="10" value="192.168.1.113" /> <item key="ipstart" ver="10" value="192.168.101.142" />
<item key="ipend" ver="10" value="113" /> <item key="ipend" ver="10" value="142" />
</config> </config>
\ No newline at end of file \ No newline at end of file
{"192.168.101.132":{"IP":"192.168.101.132","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":91,"shelfState":{"isupdate":false,"state":"on","msg":"未进行测试动作","ipconfig":{"post":"success","ip":"http://192.168.101.108/smf-core","cid":"SO1484"},"version":"1.92","serial_state":"串口连接正常","ad_serial":"串口号:/dev/ttyUSB0,地址:A1@A2@A3@B1@B2"},"memo":null},"192.168.1.113":{"IP":"192.168.1.113","Mac":"DA:90:CC:85:CE:A2","Host":null,"BoardType":2,"Ver":0.0,"MCAddr":null,"PingDelay":47,"shelfState":{"isupdate":true,"state":"off","msg":"未进行测试动作","ipconfig":{"post":"wait","ip":"http://192.168.1.243/smf-core","cid":"4"},"version":"1.7","serial_state":"Error,'NoneType' object has no attribute 'is_open'","ad_serial":"串口号:/dev/ttyUSB0,地址:A1@A2@A3@A4@A5@A6@A7@B1@B2@B3@B4@B5@B6@B7"},"memo":null}}
\ No newline at end of file \ No newline at end of file
{"192.168.101.132":{"IP":"192.168.101.132","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":91,"shelfState":{"isupdate":false,"state":"on","msg":"未进行测试动作","ipconfig":{"post":"success","ip":"http://192.168.101.108/smf-core","cid":"SO1484"},"version":"1.92","serial_state":"串口连接正常","ad_serial":"串口号:/dev/ttyUSB0,地址:A1@A2@A3@B1@B2"},"memo":null},"192.168.1.113":{"IP":"192.168.1.113","Mac":"DA:90:CC:85:CE:A2","Host":null,"BoardType":2,"Ver":0.0,"MCAddr":null,"PingDelay":47,"shelfState":{"isupdate":false,"state":"off","msg":"未进行测试动作","ipconfig":{"post":"wait","ip":"http://192.168.1.243/smf-core","cid":"4"},"version":"1.7","serial_state":"Error,'NoneType' object has no attribute 'is_open'","ad_serial":"串口号:/dev/ttyUSB0,地址:A1@A2@A3@A4@A5@A6@A7@B1@B2@B3@B4@B5@B6@B7"},"memo":null},"192.168.101.142":{"IP":"192.168.101.142","Mac":"","Host":null,"BoardType":0,"Ver":0.0,"MCAddr":null,"PingDelay":28,"shelfState":{"isupdate":true,"state":"on","msg":"未进行测试动作","ipconfig":{"post":"success","ip":"http://192.168.101.108/smf-core","cid":"m1","redlight":"on"},"version":"2.1","serial_state":null,"ad_serial":null},"memo":null}}
\ No newline at end of file \ No newline at end of file
...@@ -37,7 +37,7 @@ app = Flask(__name__) ...@@ -37,7 +37,7 @@ app = Flask(__name__)
babel = Babel(app) babel = Babel(app)
app.config.from_object(Config) app.config.from_object(Config)
app.after_request(add_header) app.after_request(add_header)
LANGUAGES = { app.config["LANGUAGES"] = {
"zh": "Chinese", "zh": "Chinese",
"en": "English", "en": "English",
"ja": "Japanese" "ja": "Japanese"
......
...@@ -298,6 +298,9 @@ def get_towerstate(): ...@@ -298,6 +298,9 @@ def get_towerstate():
'1@4':{'action':False,'status':'off'}, '1@4':{'action':False,'status':'off'},
'2@5':{'action':False,'status':'off'}, '2@5':{'action':False,'status':'off'},
'3@6':{'action':True,'status':'on'}, '3@6':{'action':True,'status':'on'},
'4@1':{'action':False,'status':'off'},
'5@2':{'action':False,'status':'off'},
'6@3':{'action':True,'status':'on'},
'1@1':{'action':False,'status':'off'}, '1@1':{'action':False,'status':'off'},
'2@2':{'action':False,'status':'off'}, '2@2':{'action':False,'status':'off'},
'3@3':{'action':True,'status':'on'}, '3@3':{'action':True,'status':'on'},
......
...@@ -326,6 +326,7 @@ def server_post(seq): ...@@ -326,6 +326,7 @@ def server_post(seq):
os.system(dd) os.system(dd)
logging.warning("执行时间设定:{}:{}".format(currentdate,dd)) logging.warning("执行时间设定:{}:{}".format(currentdate,dd))
# response = requests.post("http://jsonplaceholder.typicode.com/posts", data = "some dummy content") # response = requests.post("http://jsonplaceholder.typicode.com/posts", data = "some dummy content")
print(response.status_code,response.text)
ele_json = response.json() ele_json = response.json()
print ('ele_json:{}'.format(ele_json)) print ('ele_json:{}'.format(ele_json))
ip_config['post'] = 'success' ip_config['post'] = 'success'
......
<script> <script>
function switchLanguage(language){ function switchLanguage(language) {
$.ajax({ $.ajax({
url: "/language/"+language, url: "/language/" + language,
type: "get", type: "get",
//data: JSON.stringify(ionum), //data: JSON.stringify(ionum),
//contentType: "application/json", //contentType: "application/json",
//dataType: 'json', //dataType: 'json',
success: function (data) { success: function (data) {
location.reload(); location.reload();
}, },
error: function (e) { error: function (e) {
window.reload(); window.reload();
} }
}); });
return false; return false;
} }
</script> </script>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
aria-expanded="false" aria-controls="navbar"> aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
...@@ -28,20 +28,27 @@ ...@@ -28,20 +28,27 @@
</button> </button>
<span class="navbar-brand" href="#">{{ _('感应式料架') }}</span> <span class="navbar-brand" href="#">{{ _('感应式料架') }}</span>
</div> </div>
<div id="navbar" class="navbar-collapse collapse"> <div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li{{ " class=active" if index==1 }}><a href="{{ url_for('induction_control') }}">{{ _('通用') }}</a></li> <li
<li{{ " class=active" if index==2 }}><a href="{{ url_for('induction_test') }}">{{ _('测试') }}</a> </li> {{ " class=active" if index==1 }}><a href="{{ url_for('induction_control') }}">{{ _('通用') }}</a></li>
<li{{ " class=active" if index==3 }}><a href="{{ url_for('induction_config') }}">{{ _('配置') }}</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>
</ul> </ul>
<ul class="nav navbar-nav navbar-right" style="font-size: 14px;""> <ul class="nav navbar-nav navbar-right" style="font-size: 14px;"
<li> ">
<a href="#" onclick="return switchLanguage('zh');">简体中文</a> <li>
</li> <a href="#" onclick="return switchLanguage('zh');">简体中文</a>
<li> </li>
<a href="#" onclick="return switchLanguage('en');">English</a> <li>
</li> <a href="#" onclick="return switchLanguage('en');">English</a>
</li>
<li>
<a href="#" onclick="return switchLanguage('ja');">日本語</a>
</li>
</ul> </ul>
</div> </div>
<!--/.nav-collapse --> <!--/.nav-collapse -->
......
...@@ -132,6 +132,51 @@ ...@@ -132,6 +132,51 @@
</div><!-- /.col-sm-4 --> </div><!-- /.col-sm-4 -->
</div> </div>
</div> </div>
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">{{ _('标定') }}</h3>
</div>
<div class="panel-body">
<label for="a1" class="col-sm-2">{{ _('地址编号') }}</label>
<div class="col-sm-3">
<select id='addr' 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>99</option>
</select>
</div>
<label for="a2" class="col-sm-2">{{ _('参数') }}</label>
<div class="col-sm-3">
<select id='calibrate' class="form-control">
<option>autotrain</option>
<option>max</option>
<option>min</option>
</select>
</div>
<!-- <label for="io" class="col-sm-1">地址编号</label> -->
<div class="col-sm-4">
<input type="button" value="{{ _('自动标定') }}" class="btn btn-warning"
onclick="auto_calibrate()" />
</div><!-- /.col-sm-4 -->
</div>
</div>
<!--div class="panel panel-success"> <!--div class="panel panel-success">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">{{ _('控制器备份&升级') }}</h3> <h3 class="panel-title">{{ _('控制器备份&升级') }}</h3>
...@@ -356,7 +401,32 @@ ...@@ -356,7 +401,32 @@
} }
}) })
} }
// auto_calibrate
function auto_calibrate() {
if (confirm("{{ _('请谨慎操作') }}")) {
var addrs = document.getElementById("addr").value;
addrs = addrs.replace('B', 'A1');
addrs = addrs.replace('A', '');
var data = {
"addr": addrs,
"calibrate": document.getElementById("calibrate").value
}
$.ajax({
url: "/auto_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");
}
})
}
}
</script> </script>
<script src="/static/js/jquery.min.js"></script> <script src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script> <script src="/static/js/bootstrap.min.js"></script>
......
...@@ -12,7 +12,7 @@ basepath = os.path.dirname(__file__) ...@@ -12,7 +12,7 @@ basepath = os.path.dirname(__file__)
shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl' shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl'
def ver(): def ver():
return "1.93" return "1.94"
class _shelfconfig: class _shelfconfig:
def __init__(self): def __init__(self):
......
...@@ -25,6 +25,7 @@ class SerialCommunication(): ...@@ -25,6 +25,7 @@ class SerialCommunication():
# self.port = read_com() # self.port = read_com()
# self.uploads_path = Config.UPLOAD_FOLDER # self.uploads_path = Config.UPLOAD_FOLDER
self.serialstate="串口连接正常" self.serialstate="串口连接正常"
with open(Config.IP_PATH + "/serialcom.txt", "r") as f: with open(Config.IP_PATH + "/serialcom.txt", "r") as f:
serialcom = f.read() serialcom = f.read()
self.port = serialcom.strip("\n") self.port = serialcom.strip("\n")
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!