From 2d2ed8c9380823770b682e34887cb5ac932703cf Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Wed, 5 Dec 2018 13:45:11 -0600 Subject: [PATCH] begin working on OBP and Peer systems --- templates/hblink_table.html | 68 +++++++++++++++++++------------------ web_tables.py | 25 ++++++++------ 2 files changed, 49 insertions(+), 44 deletions(-) diff --git a/templates/hblink_table.html b/templates/hblink_table.html index 5301a7e..760e47a 100755 --- a/templates/hblink_table.html +++ b/templates/hblink_table.html @@ -56,34 +56,48 @@

Client Systems

+ - - + + + - + - - - - - - + + + + + + + + - {% for _client in _table['PEERS'] %} + {% for _peer in _table['PEERS'] %} - - - - - - - + + + + + + + + + + + + + + + + + {% endfor %}
HBP SystemClient Radio IDCallsignConnectionPing SentPing AckMasterID/Callsign/Location
Master IP:Port
Connected
Sent/Ack/Missed
LinkedTSSlotCall
Type
Source
Subscriber
Source
Peer
Destination
{{ _client}} {{ _table['PEERS'][_client]['RADIO_ID'] }}{{ _table['PEERS'][_client]['CALLSIGN'] }}{{ _table['PEERS'][_client]['STATS']['CONNECTION'] }}{{ _table['PEERS'][_client]['STATS']['PINGS_SENT'] }}{{ _table['PEERS'][_client]['STATS']['PINGS_ACKD'] }}{{ _table['PEERS'][_client]['MASTER_IP'] }} {{ _peer}}{{ _table['PEERS'][_peer]['RADIO_ID'] }}, {{_table['PEERS'][_peer]['CALLSIGN']}}, {{_table['PEERS'][_peer]['LOCATION']}}
Master: {{ _table['PEERS'][_peer]['MASTER_IP'] }}:{{ _table['PEERS'][_peer]['MASTER_PORT'] }}
{{ _table['PEERS'][_peer]['STATS']['CONNECTED'] }}
{{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] }}/{{ _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }}/{{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] - _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }}
TS1
TS2
@@ -91,33 +105,21 @@

OpenBridge Systems

- - - - - + - - - - + {% for _openbridge in _table['OPENBRIDGES'] %} - - - - {% endfor %} diff --git a/web_tables.py b/web_tables.py index afad505..6211819 100755 --- a/web_tables.py +++ b/web_tables.py @@ -201,8 +201,12 @@ def build_hblink_table(_config, _stats_table): elif _hbp_data['MODE'] == 'PEER': _stats_table['PEERS'][_hbp] = {} _stats_table['PEERS'][_hbp]['CALLSIGN'] = _hbp_data['CALLSIGN'] + _stats_table['PEERS'][_hbp]['LOCATION'] = _hbp_data['LOCATION'] _stats_table['PEERS'][_hbp]['RADIO_ID'] = int_id(_hbp_data['RADIO_ID']) _stats_table['PEERS'][_hbp]['MASTER_IP'] = _hbp_data['MASTER_IP'] + _stats_table['PEERS'][_hbp]['MASTER_PORT'] = _hbp_data['MASTER_PORT'] + _stats_table['PEERS'][_hbp]['CONNECTION'] = 'YES' #_hbp_data['CONNECTION'] + _stats_table['PEERS'][_hbp]['CONNECTED'] = 'now' #since(_hbp_data['CONNECTED']) _stats_table['PEERS'][_hbp]['STATS'] = _hbp_data['STATS'] # Process OpenBridge systems @@ -323,15 +327,6 @@ def rts_update(p): timeSlot = int(p[7]) destination = int(p[8]) - ''' - if trx == 'RX': - color = '00ff00' - elif trx == 'TX': - color = 'ff0000' - else: - color = '0000ff' - ''' - if system in CTABLE['MASTERS']: for peer in CTABLE['MASTERS'][system]['PEERS']: if sourcePeer == peer: @@ -358,9 +353,17 @@ def rts_update(p): CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['SRC'] = '' CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['DEST'] = '' + else: + logger.warning('tried to update a tranmission for a peer not yet listed: system %s, action %s, callType %s, tx/rx %s, streamid %s, sourcePeer %s, sourceSub %s, timeSlot %s, destination %s ', system, action, callType, trx, streamId, sourcePeer, sourceSub, timeSlot, destination) + + if system in CTABLE['OPENBRIDGES']: + pass + + if system in CTABLE['PEERS']: + pass + build_stats() - else: - logger.warning('tried to update a tranmission for a peer not yet listed') + # # PROCESS IN COMING MESSAGES AND TAKE THE CORRECT ACTION DEPENING ON THE OPCODE #
OpenBridge SystemNetwork IDTarget IPTarget Port - - + Network ID
Target IP:Port
Active Calls
{{ _openbridge}} {{ _table['OPENBRIDGES'][_openbridge]['NETWORK_ID'] }}{{ _table['OPENBRIDGES'][_openbridge]['TARGET_IP'] }}{{ _table['OPENBRIDGES'][_openbridge]['TARGET_PORT'] }} - + {{ _table['OPENBRIDGES'][_openbridge]['NETWORK_ID'] }}
{{ _table['OPENBRIDGES'][_openbridge]['TARGET_IP'] }}:{{ _table['OPENBRIDGES'][_openbridge]['TARGET_PORT'] }}