Fix monitoring update error

This commit is contained in:
Thiago Alves 2020-03-06 10:27:22 -05:00 committed by GitHub
parent f7e9b79fea
commit 85a6504668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -806,8 +806,6 @@ monitoring_head = """
monitoring_tail = """
</table>
</div>
</div>
</div>
</div>
@ -819,7 +817,8 @@ monitoring_tail = """
function loadData()
{
url = 'monitor-update'
html_modbus_port = document.getElementById('modbus_port_cfg');
url = 'monitor-update?mb_port=' + html_modbus_port.value;
try
{
req = new XMLHttpRequest();

View File

@ -1464,6 +1464,10 @@ def monitoring():
return_str += str(debug_data.value)
return_str += '</tr>'
data_index += 1
return_str += """
</table>
</div>
<input type='hidden' id='modbus_port_cfg' name='modbus_port_cfg' value='""" + str(modbus_port_cfg) + "'>"
return_str += pages.monitoring_tail
#Modbus Server is not enabled
@ -1508,7 +1512,8 @@ def monitor_update():
#if (openplc_runtime.status() == "Running"):
if (True):
monitor.start_monitor()
mb_port_cfg = flask.request.args.get('mb_port')
monitor.start_monitor(int(mb_port_cfg))
data_index = 0
for debug_data in monitor.debug_vars:
return_str += '<tr style="height:60px" onclick="document.location=\'point-info?table_id=' + str(data_index) + '\'">'