Example #1
0
        protected MultiThreadOscilloscope(
            ConstructorTuple <ICanvas <T> > canvas_constructor,
            ConstructorTuple <IPointDrawer> point_drawer_constructor,
            IGraphProducer graph_producer,
            IControlPanel control_panel,
            ConcurrentQueue <T> buffer = null)
        {
            ICanvas <T>  canvas       = canvas_constructor.NewInstance();
            IPointDrawer point_drawer = point_drawer_constructor.NewInstance();

            if (canvas.GraphSize != point_drawer.GraphSize)
            {
                throw new OscillocopeBuildException("canvas and point_drawer have different GraphSize", new DifferentGraphSizeException());
            }
            if (graph_producer.RequireConcurrentDrawer && !point_drawer.IsConcurrent)
            {
                throw new OscillocopeBuildException("graph_producer require multi-thread-safe PointDrawer but point_drawer is not");
            }
            this.canvas_constructor       = canvas_constructor;
            this.point_drawer_constructor = point_drawer_constructor;
            this.graph_producer           = graph_producer;
            this.control_panel            = control_panel;
            if (buffer == null)
            {
                this.buffer = new ConcurrentQueue <T>();
            }
            else
            {
                this.buffer = buffer;
            }
            this.free_canvas.Enqueue(canvas);
            this.free_point_drawer.Enqueue(point_drawer);
        }
Example #2
0
 public TimeCountedOscilloscope(
     ICanvas <T> canvas,
     IPointDrawer point_drawer,
     IGraphProducer graph_producer,
     IControlPanel control_panel)
     : base(canvas, point_drawer, graph_producer, control_panel)
 {
 }
Example #3
0
 public DrivedOscilloscope(
     ConstructorTuple <ICanvas <T> > canvas_constructor,
     ConstructorTuple <IPointDrawer> point_drawer_constructor,
     IGraphProducer graph_producer,
     IControlPanel control_panel,
     ConcurrentQueue <T> buffer = null)
     : base(
         canvas_constructor: canvas_constructor,
         point_drawer_constructor: point_drawer_constructor,
         graph_producer: graph_producer,
         control_panel: control_panel,
         buffer: buffer)
 {
 }
Example #4
0
 protected SingleThreadOscilloscope(
     ICanvas <T> canvas,
     IPointDrawer point_drawer,
     IGraphProducer graph_producer,
     IControlPanel control_panel)
 {
     if (canvas.GraphSize != point_drawer.GraphSize)
     {
         throw new OscillocopeBuildException("canvas and point_drawer have different GraphSize", new DifferentGraphSizeException());
     }
     if (graph_producer.RequireConcurrentDrawer && !point_drawer.IsConcurrent)
     {
         throw new OscillocopeBuildException("graph_producer require multi-thread-safe PointDrawer but point_drawer is not");
     }
     this.canvas         = canvas;
     this.point_drawer   = point_drawer;
     this.graph_producer = graph_producer;
     this.control_panel  = control_panel;
 }