Skip to content

Commit

Permalink
Fix monitoring update error
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoralves authored Mar 6, 2020
1 parent f7e9b79 commit 85a6504
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions webserver/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,6 @@


monitoring_tail = """
</table>
</div>
</div>
</div>
</div>
Expand All @@ -819,7 +817,8 @@
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();
Expand Down
7 changes: 6 additions & 1 deletion webserver/webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) + '\'">'
Expand Down

0 comments on commit 85a6504

Please sign in to comment.