コード例 #1
0
        public void SetList(ExperimentList e)
        {
            lst = e;

            ExperimentObject = new Experiment(); /* инициализация объекта эксперимента, в который будут вносится
                                                    изминения, и который будет возвращёт обратно в MainForm    */
            foreach (ExperimentInfo p in e.eList) // Создаём список типов экспериментов
            {
                listBox1.Items.Add(p.ToString()); // в списке будут p.ToString();
            }
            listBox1.DoubleClick += new EventHandler(listBox1_DoubleClick);
        }
コード例 #2
0
        public ExpStats(ExperimentList e, ref TabControl tabs)
        {
            InitializeComponent();

            ExperimentObject = new Experiment(); /* ������������� ������� ������������, � ������� ����� ��������
                                                    ���������, � ������� ����� ��������� ������� � MainForm    */
            tc = tabs;
            List<Object> types = new List<object>();
            foreach (ExperimentInfo p in e.eList) // ������ ������ ����� �������������
            {
               if(!types.Contains(p.GraphicsObj.GetType()))
               {
                    listBox1.Items.Add(p); // � ������ ����� p.ToString();
                    types.Add(p.GraphicsObj.GetType());
               }
              }
        }
コード例 #3
0
 void experimentAddControl_UserSelected(object sender, Experiment e)
 {
     this.ExperimentObject = e;
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
コード例 #4
0
 private void ConstructExperiment()
 {
     ExperimentObject = new Experiment();
     //ExperimentObject.Graphics = (GraphicPrimitive) lst.eList[listBox1.SelectedIndex].GraphicsObj.Clone(); // сырой шаблон
     ExperimentObject.Graphics = (GraphicPrimitive) Activator.CreateInstance(lst.eList[listBox1.SelectedIndex].GraphicsObj.GetType());
 }
コード例 #5
0
        public void AddNewTabWithExperiment(Experiment c)
        {
            ExperimentControl p = new ExperimentControl();
            p.Name = "ExpCtrl";
            p.LoadExperiment(c);

            p.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;

            p.Size = Tabs.Size;
            p.Left = Tabs.Left;
            p.Top = Tabs.Top - 25;

            Size _Size = p.Size;
            _Size.Width -= 202;
            _Size.Height -= 26;
            //p.Size = _Size;
            p.Experiment.Graphics.SetDrawingBorder(p.Left, p.Top, _Size);

            //���������� ���� ������������
            switch (p.Experiment.Graphics.Needs)
            {
                case ExperimentNeeds.None: break;
                case ExperimentNeeds.Normal: break; //���������� ����������
                case ExperimentNeeds.ZedGraph:
                    //�������� ��������
                    ZedGraph.ZedGraphControl zgc = new ZedGraph.ZedGraphControl();
                    zgc.Size = _Size;
                    p.Controls.Add(zgc);
                    GraphPane zgcPane = zgc.GraphPane;
                    zgcPane.Chart.Fill = new Fill(Color.White, Color.LightBlue, 45.0F);
                    p.Experiment.Graphics.CreateControl(zgc); //�������� ������� Zedgraph'�
                    break;

                case ExperimentNeeds.XNA: break;//�������� 3�-�����
                case ExperimentNeeds.Graph:
                        ZedGraphControl graph = new ZedGraphControl();
                        graph.Size = _Size;
                        p.Controls.Add(graph);

                        GraphPane myPane;
                        /*graph.Top = 0;
                        graph.Left = 0;
                        graph.Height = this.Height;
                        graph.Width = this.Width;
                        */
                        myPane = graph.GraphPane;
                        p.Experiment.Graphics.SetGraphInfo(myPane);
                        myPane.Legend.IsVisible = false;
                        myPane.Chart.Fill = new Fill(Color.White, Color.LightBlue, 45.0F);
                        break;
                case ExperimentNeeds.OpenGL:
                        SimpleOpenGlControl tao_ctrl = new SimpleOpenGlControl();
                        tao_ctrl.Size = _Size;
                        tao_ctrl.Name = "TaoControl";
                        p.Controls.Add(tao_ctrl);
                        tao_ctrl.MouseDown += p.OGL_MouseDown;
                        tao_ctrl.MouseUp += p.OGL_MouseUp;
                        tao_ctrl.MouseMove += p.OGL_MouseMove;
                        //tao_ctrl.MouseWheel += p.OGL_MouseWheel;
                        tao_ctrl.KeyDown += p.OGL_KeyDown;

                        tao_ctrl.InitializeContexts();
                        break;
            }

            p.LoadParameters(p.Experiment.Graphics.ParameterListTemplate);
            //    p.Experiment.pList = p.Experiment.Graphics.ParameterListTemplate;

            p.Experiment.Graphics.SetParameters(p.Experiment.Graphics.ParameterListTemplate);
            p.Anchor = AnchorStyles.Bottom & AnchorStyles.Right & AnchorStyles.Top & AnchorStyles.Left;

            Tabs.TabPages.Add("exp" + ExperimentCount, "����������� " + ExperimentCount);
            Tabs.TabPages[ExperimentCount].Controls.Add(p);
            Tabs.SelectTab(ExperimentCount);
            Tabs.TabPages[ExperimentCount].Focus();

            ExperimentCount++;
        }
コード例 #6
0
 void c_UserSelected(object sender, Experiment ExperimentObject)
 {
     AddNewTabWithExperiment(ExperimentObject);
 }
コード例 #7
0
        double[] targetPos = { 0, 0, 1, 1 }; // targetPos[3] - zoom

        #endregion Fields

        #region Constructors

        public ExperimentControl()
        {
            InitializeComponent();
            this.Experiment = new Experiment();
        }
コード例 #8
0
 internal void LoadExperiment(MDK.Experiment c)
 {
     descriptionLabel.Text = c.Graphics.GetAbout().Description;
     this.Experiment = c;
 }