Esempio n. 1
0
        public SignalPanel(ApplicationState state) : base()
        {
            view = new SignalViewPanel(state);
            list = new SignalsList(state);

            SizeChanged += (sender, ev) =>
            {
                view.SetBounds(0, 0, Height / 2, Height / 2);

                var listPrefs = list.PreferredSize;
                list.SetBounds(0, view.Height,
                               listPrefs.Width, listPrefs.Height);
            };

            Controls.Add(view);
            Controls.Add(list);
            Invalidate();
        }
Esempio n. 2
0
        public SignalPanel(SignalManager signals) : base()
        {
            signalState = signals;
            viewType    = SignalViewType.Signals;

            signalViewes = new Dictionary <SignalViewType, Chart>();
            InitCharts();
            currentView = signalViewes[viewType];

            signalsList      = new SignalsList(signals);
            viewSwitchButton = new Button();
            viewSwitchButton = GetSwitchButton();

            Reconstruct();

            signals.AddedSignal += (values, index) =>
            {
                Reconstruct();
                Invalidate();
            };

            signals.DeletedSignal += (values, index) =>
            {
                Reconstruct();
                Invalidate();
            };

            Controls.Add(currentView);
            Controls.Add(viewSwitchButton);
            Controls.Add(signalsList);

            SizeChanged += (sender, ev) =>
            {
                currentView.SetBounds(0, 0, Height / 2, Height / 2);

                viewSwitchButton.Location = new Point(currentView.Width - viewSwitchButton.Width,
                                                      currentView.Height);

                var listPrefs = signalsList.PreferredSize;
                signalsList.SetBounds(0, currentView.Height + viewSwitchButton.Height,
                                      listPrefs.Width, listPrefs.Height);
            };
        }