Ejemplo n.º 1
0
    def _new_log(self, simlog, content):
        self.original_log(simlog, content)

        # content is expected to be updated adding _asn, _type
        assert '_asn' in content
        assert '_type' in content

        if ((_filter == 'all') or (content['_type'] in _filter)):
            eel.notifyLogEvent(content)
        else:
            pass
Ejemplo n.º 2
0
    def _new_actionEndSlotframe(self):
        global _elapsed_minutes

        self.original_actionEndSlotframe()
        asn = _sim_engine.getAsn()
        minutes = math.floor(asn * _sim_engine.settings.tsch_slotDuration / 60)
        if _elapsed_minutes < minutes:
            _elapsed_minutes = minutes
            eel.notifyLogEvent({
                '_type': '_backend.tick.minute',
                '_asn': asn,
                'currentValue': _elapsed_minutes
            })
        # we need to yield the CPU explicitly for other tasks because
        # threading is monkey-patched by gevent. see __init__.py.
        gevent.sleep(GEVENT_SLEEP_SECONDS_IN_SIM_ENGINE)