//预览功能 private void PreviewControler() { float X = this.panel1.Size.Width ; X = X / 373; float Y = this.panel1.Size.Height ; Y = Y / 245; X =Math.Max(1F, Math.Min(2F, Math.Min(X, Y))); panel1.Controls.Clear(); Point XY = new Point(this.panel1.Size.Width / 5 - 10, this.panel1.Size.Height / 6);//定位 Point YX = new Point(this.panel1.Size.Width / 4 - 40, this.panel1.Size.Height / 3 - 15); if (Basic[7] == "Modules") { Modules controler = new Modules(); controler.Location = XY; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "Arithmetic") { //ControlTactic.SpecialControl.Fuzzy fuzzy = new ControlTactic.SpecialControl.Fuzzy(); Arithmetic controler = new Arithmetic(); controler.Location = XY; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "OutputValue") { OutputValue controler = new OutputValue(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "InputValue") { InputValue controler = new InputValue(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "Constant") { Constant controler = new Constant(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "SystemConstant") { SystemConstant controler = new SystemConstant(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "Lable") { ControlTactic.Label controler = new ControlTactic.Label(); controler.Location = YX; SetVelue(controler); controler.Scaling = 1.8F * X; panel1.Controls.Add(controler); } else if (Basic[7] == "JMP") { ControlTactic.JMP controler = new ControlTactic.JMP(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } }
//预览功能 private void PreviewControler() { float X = this.panel1.Size.Width; X = X / 373; float Y = this.panel1.Size.Height; Y = Y / 245; X = Math.Max(1F, Math.Min(2F, Math.Min(X, Y))); panel1.Controls.Clear(); Point XY = new Point(this.panel1.Size.Width / 5 - 10, this.panel1.Size.Height / 6);//定位 Point YX = new Point(this.panel1.Size.Width / 4 - 40, this.panel1.Size.Height / 3 - 15); if (Basic[7] == "Modules") { Modules controler = new Modules(); controler.Location = XY; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "Arithmetic") { //ControlTactic.SpecialControl.Fuzzy fuzzy = new ControlTactic.SpecialControl.Fuzzy(); Arithmetic controler = new Arithmetic(); controler.Location = XY; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "OutputValue") { OutputValue controler = new OutputValue(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "InputValue") { InputValue controler = new InputValue(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "Constant") { Constant controler = new Constant(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "SystemConstant") { SystemConstant controler = new SystemConstant(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } else if (Basic[7] == "Lable") { ControlTactic.Label controler = new ControlTactic.Label(); controler.Location = YX; SetVelue(controler); controler.Scaling = 1.8F * X; panel1.Controls.Add(controler); } else if (Basic[7] == "JMP") { ControlTactic.JMP controler = new ControlTactic.JMP(); controler.Location = YX; SetVelue(controler); controler.Scaling = X; panel1.Controls.Add(controler); } }