Ejemplo n.º 1
0
    def run_reporter():

        reporter = Reporter(
            transceiver=DummyTransceiver(dt=0.0005),
            transformers=[TimedCombiner(dt=0.1),
                          Pickler(),
                          Compressor()],
            publisher=ZMQPublisher())
        reporter.run()
Ejemplo n.º 2
0
    def run_reporter():

        reporter = Reporter(
            transceiver=DummyTransceiver(
                dt=0.0005
            ),
            transformers=[
                TimedCombiner(dt=0.1),
                Pickler(),
                Compressor()
            ],
            publisher=ZMQPublisher()
        )
        reporter.run()
Ejemplo n.º 3
0
"""

from zircon.transceivers.dummy import DummyTransceiver
from zircon.publishers.zeromq import ZMQPublisher
from zircon.reporters.base import Reporter
from zircon.transformers.common import *
from math import sin, pi


# Generated signal
def sine_wave(t):
    return sin(2*pi*t/3.0)

# Sampling frequency
freq = 1000

reporter = Reporter(
    transceiver=DummyTransceiver(
        signal_name='MY_SIGNAL',
        data_gen=sine_wave,
        dt=1.0/freq
    ),
    transformers=[
        TimedCombiner(dt=0.1),
        Pickler(),
        Compressor()
    ],
    publisher=ZMQPublisher()
)
reporter.run()
Ejemplo n.º 4
0
from zircon.transceivers.dummy_multiple import DummyMultipleTransceiver
from zircon.publishers.zeromq import ZMQPublisher
from zircon.reporters.base import Reporter
from zircon.transformers.common import *

from math import sin, pi
from random import gauss

reporter = Reporter(
    transceiver=DummyMultipleTransceiver(
        signals={
            'IMU_X': lambda x: 1.0 * sin(2*pi*(x/3.0 + 1)) + gauss(0, 0.2),
            'IMU_Y': lambda x: 1.5 * sin(2*pi*x/2.5) + gauss(0, 0.2),
            'IMU_Z': lambda x: 1.3 * sin(2*pi*x/2.8) + gauss(0, 0.3),
            'IMU_X_FILTERED': lambda x: 1.0 * sin(2*pi*(x/3.0 + 1)),
            'IMU_Y_FILTERED': lambda x: 1.5 * sin(2*pi*x/2.5),
            'IMU_Z_FILTERED': lambda x: 1.3 * sin(2*pi*x/2.8),
        },
        dt=0.01,
    ),
    transformers=[
        Splitter(),
        TimedCombiner(dt=0.1),
        Pickler(),
        Compressor()
    ],
    publisher=ZMQPublisher()
)
reporter.run()
Ejemplo n.º 5
0
        self.pause()

        timestamp = int(time.time() * 1e6)
        val = self.data_gen(self.t)
        return timestamp, self.signal_name, val

    def write(self, data):
        print('[WRITE] {}'.format(data))
        return True


if __name__ == '__main__':

    from zircon.publishers.zeromq import ZMQPublisher
    from zircon.reporters.base import Reporter
    from zircon.transformers.common import *
    from math import sin, pi

    def signal_generator(t):
        return sin(2 * pi * t / 3.0)

    reporter = Reporter(
        transceiver=DummyTransceiver(signal_name='MY_SIGNAL',
                                     data_gen=signal_generator,
                                     dt=1.0 / 1000),
        transformers=[TimedCombiner(dt=0.1),
                      Pickler(),
                      Compressor()],
        publisher=ZMQPublisher())
    reporter.run()
Ejemplo n.º 6
0
            data.append((timestamp, '{}_READ'.format(d.upper()),
                         disk_io[d].read_bytes)) for d in disk_io
        ]
        [
            data.append((timestamp, '{}_WRITE'.format(d.upper()),
                         disk_io[d].write_bytes)) for d in disk_io
        ]
        return data

    def write(self, data):
        print('[WRITE] {}'.format(data))
        return True


if __name__ == '__main__':

    from zircon.publishers.zeromq import ZMQPublisher
    from zircon.reporters.base import Reporter

    from zircon.transformers.common import *

    reporter = Reporter(transceiver=SystemTransceiver(),
                        transformers=[
                            Splitter(),
                            TimedCombiner(dt=0.1),
                            Pickler(),
                            Compressor()
                        ],
                        publisher=ZMQPublisher())
    reporter.run()