# -*- python -*-

from endless.framework.source_mock import MockSource
from endless.framework.sink_stdout import StdoutSink
from endless.framework.sink_animation import AnimationSink
from endless.framework import async_util

import datetime
import functools
import math


sink = AnimationSink(label='ENDLESS Proof Of Concept', xlabel='Timestamp', ylabel='Value', ymin=10, ymax=70)
source = MockSource(
    tag='sinewave', 
    timestamps=async_util.wallclock_timestamps_sleep(interval=datetime.timedelta(seconds=0.1)),
    data=functools.partial(async_util.yet_another_sin, amplitude=20, hz=5, phase_shift=math.pi/2, vertical_shift=36.5),
)
source.sample_out.connect(sink.sample_in)


COMPONENTS = (source, sink)
