Exemple #1
0
        private void metroButton1_Click_1(object sender, EventArgs e)
        {
            ControlForm controlForm = new ControlForm();

            controlForm.Show();
            this.Hide();
        }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // gestion des pour empêcher que la fenêtre charger à chage évenement pour redessiner


            panelDraw.GetType().GetMethod("SetStyle", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(panelDraw,
                                                                                                                                                 new Object[] { System.Windows.Forms.ControlStyles.UserPaint | System.Windows.Forms.ControlStyles.AllPaintingInWmPaint
                                                                                                                                                                | System.Windows.Forms.ControlStyles.OptimizedDoubleBuffer, true });

            //panelDraw.BackColor = Color.Black;

            ControlForm.SetInit(this); // initialisation pour le control de l'application Max Min Restore and Full
            Splitter splitter = new Splitter();

            splitter.Dock    = DockStyle.Left;
            splitter.Size    = new Size(3, 554);
            splitter.Padding = new System.Windows.Forms.Padding(3);
            // splitter.BackColor= System.Drawing.SystemColors.ControlDark;
            // splitter.Cursor= Cursor = System.Windows.Forms.Cursors.SizeWE;

            this.panelmain2.Controls.AddRange(new Control[] { panelDraw, splitter, this.panelF, });
            this.panelF.Controls.AddRange(new Control[] { this.treeView1, splitter_pangcd_treev, PanelViewGCODE });

            userScale = 1.0f;
            scale     = 8.0f;
        }
Exemple #3
0
        public static ControlForm GetControlForm()
        {
            var form = new ControlForm();

            form.LoadPlugins();

            return form;
        }
Exemple #4
0
        public static Control GetControl(ControlForm ControlForm)
        {
            var control = Control.FromLocation(ControlForm.ControlPlugins.First(), new Point(1, 2), false);

            control.Text = "Control";

            return control;
        }
Exemple #5
0
        public static Control GetControl(ControlForm ControlForm)
        {
            var control = Control.FromLocation(ControlForm.ControlPlugins.First(), new Point(1, 2), false);

            control.Text = "Control";

            return(control);
        }
Exemple #6
0
        public static ControlForm GetControlForm()
        {
            var form = new ControlForm();

            form.LoadPlugins();

            return(form);
        }
Exemple #7
0
        public static Group GetGroup(ControlForm ControlForm)
        {
            var group   = Group.FromLocation(ControlForm.ControlPlugins, new Point(1, 2));
            var control = ControlTests.GetControl(ControlForm);

            group.Text = "Group";
            group.Controls.Add(control);

            return(group);
        }
Exemple #8
0
        public static Group GetGroup(ControlForm ControlForm)
        {
            var group = Group.FromLocation(ControlForm.ControlPlugins, new Point(1, 2));
            var control = ControlTests.GetControl(ControlForm);

            group.Text = "Group";
            group.Controls.Add(control);

            return group;
        }
Exemple #9
0
        public void LoadPlugins()
        {
            // Arrange
            var form = new ControlForm();

            // Act
            form.LoadPlugins();

            // Assert
            Assert.IsTrue(form.ControlPlugins.OfType<Meter>().Any());
            Assert.IsTrue(form.ControlPlugins.OfType<Spinner>().Any());
            Assert.IsTrue(form.ControlPlugins.OfType<Toggle>().Any());
            Assert.IsTrue(form.LoggingPlugins.OfType<CSV>().Any());
        }
Exemple #10
0
        public void LoadPlugins()
        {
            // Arrange
            var form = new ControlForm();

            // Act
            form.LoadPlugins();

            // Assert
            Assert.IsTrue(form.ControlPlugins.OfType <Meter>().Any());
            Assert.IsTrue(form.ControlPlugins.OfType <Spinner>().Any());
            Assert.IsTrue(form.ControlPlugins.OfType <Toggle>().Any());
            Assert.IsTrue(form.LoggingPlugins.OfType <CSV>().Any());
        }
Exemple #11
0
        public static void AssertIsCopy(ControlForm ControlForm, ControlForm ControlFormCopy)
        {
            var groups = ControlForm.Controls.OfType<Group>();
            var groupsCopy = ControlFormCopy.Controls.OfType<Group>();

            Assert.AreEqual(ControlForm.Text, ControlFormCopy.Text);
            Assert.AreEqual(ControlForm.Width, ControlFormCopy.Width);
            Assert.AreEqual(ControlForm.Height, ControlFormCopy.Height);
            Assert.AreEqual(groups.Count(), groupsCopy.Count());

            for (var i = 0; i < groups.Count(); i++)
            {
                GroupTests.AssertIsCopy(groups.ElementAt(i), groupsCopy.ElementAt(i));
            }
        }
Exemple #12
0
        private void button11_Click(object sender, EventArgs e)
        {
            var selected = GetSelected();

            if (selected?.Item?.Id_nb == null)
            {
                return;
            }

            var form = new ControlForm();

            form.Controls.Add(new ItemTemplateControl(selected.Item.Id_nb));

            form.ShowDialog();
        }
Exemple #13
0
        public static void AssertIsCopy(ControlForm ControlForm, ControlForm ControlFormCopy)
        {
            var groups     = ControlForm.Controls.OfType <Group>();
            var groupsCopy = ControlFormCopy.Controls.OfType <Group>();

            Assert.AreEqual(ControlForm.Text, ControlFormCopy.Text);
            Assert.AreEqual(ControlForm.Width, ControlFormCopy.Width);
            Assert.AreEqual(ControlForm.Height, ControlFormCopy.Height);
            Assert.AreEqual(groups.Count(), groupsCopy.Count());

            for (var i = 0; i < groups.Count(); i++)
            {
                GroupTests.AssertIsCopy(groups.ElementAt(i), groupsCopy.ElementAt(i));
            }
        }
        /// <summary>
        /// Start the simulation with the provided course from Setup()
        /// </summary>
        public void Run()
        {
            control        = new ControlForm(raceCourses[choice - 1].TotalDistance);
            _simulatedData = new SimulatedDataSource()
            {
                InputFilename = trackFileName,
                Handler       = control
            };

            _simulatedData.Start();
            Application.Run(control);

            // Run simulator for RUN_TIME_IN_MINUTES
            const int RUN_TIME_IN_MINUTES = 3;

            Thread.Sleep(RUN_TIME_IN_MINUTES * 6000);

            _simulatedData.Stop();
        }
Exemple #15
0
 private void NodeControl_Item_Click(object sender, EventArgs e)
 {
     if (curSelectNode != null)
     {
         ArmClient armClient = null;
         if (FindDeviceByNoeId(curSelectNode.id, out armClient))
         {
             if (armClient.Status)
             {
                 ControlForm form = new ControlForm(armClient, curSelectNode);
                 form.Show();
             }
             else
             {
                 MessageBox.Show("该节点不在线");
             }
         }
     }
     else
     {
         return;
     }
 }
Exemple #16
0
 public void NodeCapture()
 {
     if (curSelectNode != null)
     {
         ArmClient armClient = null;
         if (FindDeviceByNoeId(curSelectNode.id, out armClient))
         {
             if (armClient.Status)
             {
                 ControlForm form = new ControlForm(armClient, curSelectNode);
                 form.Show();
             }
             else
             {
                 MessageBox.Show("该节点不在线");
             }
         }
     }
     else
     {
         return;
     }
 }
        public CharacterCreator(ControlForm Form, CharakterErstellungsDaten Daten)
        {
            this.Universe = Daten.Universe;
            this.Form = Form;
            this.Data = new ManifestData(Universe);

            Desc = CreateLabel("");
            ScrollDesc = new ScrollBox(Desc);
            ScrollDesc.Top = 20;
            ScrollDesc.Left = 20;
            Controls.Add(ScrollDesc);

            Liste = new ControlList();
            Liste.Align = 1f;
            Liste.Location = new Point(50, 10);
            ScrollBox = new ScrollBox(Liste);
            ScrollBox.Top = 20;
            Controls.Add(ScrollBox);

            Werte = new List<CharakterWertControl>();
            NeedSpeicherort = new List<Control>();

            MakeSaveOpenDialogs();
        }
Exemple #18
0
        public double FetchZeit(out bool erfolgreich, double min, double max)
        {
            ControlForm cf = new ControlForm();
            WarteControl wc = new WarteControl(min, max,
                (sender, e) => cf.Close(),
                (sender, e) => cf.Close());
            wc.Size = new System.Drawing.Size(500, 500);
            cf.SetControl(wc);
            cf.ShowDialog();

            erfolgreich = wc.MyStatus == WarteControl.Status.OK;
            return wc.Wert;
        }
Exemple #19
0
        // fin

        private void CloseBtn_Click(object sender, EventArgs e)
        {
            ControlForm.Exit();
        }
Exemple #20
0
        private void treeView1_DoubleClick(object sender, EventArgs e) //从光标所在的位置得到该位置上的节点
        {
            TreeNode node = this.treeView1.GetNodeAt(pi);

            if (pi.X < node.Bounds.Left || pi.X > node.Bounds.Right)
            {
                //不触发事件;
            }
            else if (node.Parent != null)
            {
                int parent = int.Parse(node.Parent.Name);
                //传感器
                if (node.Index == (int.Parse(AGV.Sensor.Key) - 1))
                {
                    try
                    {
                        sensorForm[parent].WindowState = FormWindowState.Normal;
                        sensorForm[parent].Show();     //弹出这个窗口
                        sensorForm[parent].Activate(); //激活显示
                    }
                    catch (Exception)
                    {
                        sensorForm[parent] = new SensorForm(int.Parse(node.Parent.Name));
                        sensorForm[parent].Show();//弹出这个窗口
                    }
                }
                //运行状态
                else if (node.Index == (int.Parse(AGV.State.Key) - 1))
                {
                    try
                    {
                        stateForm[parent].WindowState = FormWindowState.Normal;
                        stateForm[parent].Show();     //弹出这个窗口
                        stateForm[parent].Activate(); //激活显示
                    }
                    catch (Exception)
                    {
                        stateForm[parent] = new StateForm(int.Parse(node.Parent.Name));
                        stateForm[parent].Show();//弹出这个窗口
                    }
                }
                //远程操作
                else if (node.Index == (int.Parse(AGV.Control.Key) - 1))
                {
                    try
                    {
                        controlForm[parent].WindowState = FormWindowState.Normal;
                        controlForm[parent].Show();     //弹出这个窗口
                        controlForm[parent].Activate(); //激活显示
                    }
                    catch (Exception)
                    {
                        controlForm[parent] = new ControlForm(int.Parse(node.Parent.Name));
                        controlForm[parent].Show();//弹出这个窗口
                    }
                }
                //参数设置
                else if (node.Index == (int.Parse(AGV.Set.Key) - 1))
                {
                    try
                    {
                        setForm[parent].WindowState = FormWindowState.Normal;
                        setForm[parent].Show();     //弹出这个窗口
                        setForm[parent].Activate(); //激活显示
                    }
                    catch (Exception)
                    {
                        setForm[parent] = new SetForm(int.Parse(node.Parent.Name));
                        setForm[parent].Show();//弹出这个窗口
                    }
                }
                //寄存器
                else if (node.Index == (int.Parse(AGV.Register.Key) - 1))
                {
                    try
                    {
                        registerForm[parent].WindowState = FormWindowState.Normal;
                        registerForm[parent].Show();     //弹出这个窗口
                        registerForm[parent].Activate(); //激活显示
                    }
                    catch (Exception)
                    {
                        registerForm[parent] = new RegisterForm(int.Parse(node.Parent.Name));
                        registerForm[parent].Show();//弹出这个窗口
                    }
                }
            }
        }
Exemple #21
0
 private void MaxMinBtn_Click(object sender, EventArgs e)
 {
     this.panelDraw.Invalidate();
     ControlForm.DoMaximize(this, (Button)sender);
 }
Exemple #22
0
 private void RestorBtn_Click(object sender, EventArgs e)
 {
     ControlForm.Minimize(this);
 }