예제 #1
0
 public SignallController(int size)
 {
     Internal    = new SignalsModel(size);
     View        = new SignalViewState(Internal);
     ViewChanged = () => { };
     SignChanged = () => { };
 }
예제 #2
0
        private Panel GetSignalFrame(SignalsModel manager, SinSignal signal, int i)
        {
            var frame = new Panel
            {
                BorderStyle = BorderStyle.FixedSingle,
                Height      = frameHeight,
                Width       = Width - 20
            };

            var delButton = new Button
            {
                Dock = DockStyle.Bottom,
                Text = "Удалить"
            };

            delButton.Click += (sender, ev) =>
            {
                new SignalDeleteConfirm(manager, signal).ShowDialog();
            };

            var formula = new Label
            {
                Dock = DockStyle.Top,
                Text = manager.Signals[i].Options.GetTextFormula(),
                Font = new Font("Arial", 10)
            };

            frame.Controls.Add(formula);
            frame.Controls.Add(delButton);
            Controls.Add(frame);

            return(frame);
        }
예제 #3
0
        public SignalViewState(SignalsModel manager, SignalViewType current)
        {
            views = new Dictionary <SignalViewType, ISignalsVisualizer>();
            SetView(new AloneVisualizer(manager.Sum), SignalViewType.Summarized);
            SetView(new ManagerVisualizer(manager), SignalViewType.Divided);

            var divided = new List <SignalViewOptions>();

            CurrentType = current;
        }
예제 #4
0
        public ManagerVisualizer(SignalsModel manager)
        {
            options = new List <SignalViewOptions>();

            options.AddRange(manager.Signals.Select((s) => new SignalViewOptions(s)));

            //manager.AddedSignal += (signal) => { options.Add(new SignalViewOptions(signal)); };
            //manager.DeletedSignal += (signal) => {
            //    for (var i = 0; i < options.Count; i++)
            //        if (options[i].Signal.Equals(signal))
            //        {
            //            options.RemoveAt(i);
            //            break;
            //        }
            //};
        }
예제 #5
0
 public SumSignal(SignalsModel main)
 {
     manager = main;
 }
예제 #6
0
 public SignalViewState(SignalsModel manager) : this(manager, DEFAULT_VIEW)
 {
 }