/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.cogJobManagerEdit1 = new Cognex.VisionPro.QuickBuild.CogJobManagerEdit(); this.SuspendLayout(); // // cogJobManagerEdit1 // this.cogJobManagerEdit1.Dock = System.Windows.Forms.DockStyle.Fill; this.cogJobManagerEdit1.Location = new System.Drawing.Point(0, 0); this.cogJobManagerEdit1.Name = "cogJobManagerEdit1"; this.cogJobManagerEdit1.Size = new System.Drawing.Size(728, 454); this.cogJobManagerEdit1.Subject = null; this.cogJobManagerEdit1.TabIndex = 0; // // FormQB // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(728, 454); this.Controls.Add(this.cogJobManagerEdit1); this.Name = "FormQB"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Configuration"; this.Closing += new System.ComponentModel.CancelEventHandler(this.FormQB_Closing); this.Load += new System.EventHandler(this.FormQB_Load); this.ResumeLayout(false); }
private void btn_openQuickBuild_Click(object sender, RoutedEventArgs e) { Trace.WriteLine("Open current project in QuickBuild ..."); saveCognexFile(); if (myJobManagerEdit == null) { if (myJobManager != null) { try { myJobManagerEdit = new CogJobManagerEdit(); myJobManagerEdit.ShowLocalizationTab = false; myJobManagerEdit.Subject = myJobManager; } catch { } } } FormsHoster formHoster = new FormsHoster(); formHoster.FormHost.Child = myJobManagerEdit; formHoster.WindowState = System.Windows.WindowState.Maximized; formHoster.ShowDialog(); formHoster = null; myJobManagerEdit = null; }
//加载Job private void LoadCogJobManager(CogJobManagerEdit cogJobManagerEdit, string path) { try { //Thread threadZJY = new Thread(delegate (){ //创建线程 Class1.CogJobManager = (CogJobManager)CogSerializer.LoadObjectFromFile(Application.StartupPath + path); cogJobManagerEdit1.Subject = Class1.CogJobManager; // }); //threadZJY.Priority = ThreadPriority.Lowest; //线程优先级 //threadZJY.Start(); } catch (FileNotFoundException f) { MessageBox.Show(f.FileName + "该路径下没有此文件"); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.Label1 = new System.Windows.Forms.Label(); this.myCountText = new System.Windows.Forms.TextBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.RunContCheckBox = new System.Windows.Forms.CheckBox(); this.RunOnceButton = new System.Windows.Forms.Button(); this.cogRecordDisplay1 = new Cognex.VisionPro.CogRecordDisplay(); this.cogJobManagerEdit1 = new Cognex.VisionPro.QuickBuild.CogJobManagerEdit(); this.button1 = new System.Windows.Forms.Button(); this.TotalBytesLabel = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.cogRecordDisplay1)).BeginInit(); this.SuspendLayout(); // // Label1 // this.Label1.Location = new System.Drawing.Point(29, 138); this.Label1.Name = "Label1"; this.Label1.Size = new System.Drawing.Size(48, 17); this.Label1.TabIndex = 4; this.Label1.Text = "Count:"; // // myCountText // this.myCountText.Location = new System.Drawing.Point(48, 164); this.myCountText.Name = "myCountText"; this.myCountText.ReadOnly = true; this.myCountText.Size = new System.Drawing.Size(77, 21); this.myCountText.TabIndex = 3; // // timer1 // this.timer1.Interval = 50; // // RunContCheckBox // this.RunContCheckBox.Appearance = System.Windows.Forms.Appearance.Button; this.RunContCheckBox.Location = new System.Drawing.Point(19, 60); this.RunContCheckBox.Name = "RunContCheckBox"; this.RunContCheckBox.Size = new System.Drawing.Size(115, 35); this.RunContCheckBox.TabIndex = 2; this.RunContCheckBox.Text = "Run Continuous"; this.RunContCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.RunContCheckBox.CheckedChanged += new System.EventHandler(this.RunContCheckBox_CheckedChanged); // // RunOnceButton // this.RunOnceButton.Location = new System.Drawing.Point(19, 17); this.RunOnceButton.Name = "RunOnceButton"; this.RunOnceButton.Size = new System.Drawing.Size(115, 35); this.RunOnceButton.TabIndex = 1; this.RunOnceButton.Text = "Run Once"; this.RunOnceButton.Click += new System.EventHandler(this.RunOnceButton_Click); // // cogRecordDisplay1 // this.cogRecordDisplay1.ColorMapLowerClipColor = System.Drawing.Color.Black; this.cogRecordDisplay1.ColorMapLowerRoiLimit = 0D; this.cogRecordDisplay1.ColorMapPredefined = Cognex.VisionPro.Display.CogDisplayColorMapPredefinedConstants.None; this.cogRecordDisplay1.ColorMapUpperClipColor = System.Drawing.Color.Black; this.cogRecordDisplay1.ColorMapUpperRoiLimit = 1D; this.cogRecordDisplay1.DoubleTapZoomCycleLength = 2; this.cogRecordDisplay1.DoubleTapZoomSensitivity = 2.5D; this.cogRecordDisplay1.Location = new System.Drawing.Point(142, 22); this.cogRecordDisplay1.MouseWheelMode = Cognex.VisionPro.Display.CogDisplayMouseWheelModeConstants.Zoom1; this.cogRecordDisplay1.MouseWheelSensitivity = 1D; this.cogRecordDisplay1.Name = "cogRecordDisplay1"; this.cogRecordDisplay1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("cogRecordDisplay1.OcxState"))); this.cogRecordDisplay1.Size = new System.Drawing.Size(369, 282); this.cogRecordDisplay1.TabIndex = 6; // // cogJobManagerEdit1 // this.cogJobManagerEdit1.Location = new System.Drawing.Point(517, 22); this.cogJobManagerEdit1.Name = "cogJobManagerEdit1"; this.cogJobManagerEdit1.ShowLocalizationTab = false; this.cogJobManagerEdit1.Size = new System.Drawing.Size(382, 282); this.cogJobManagerEdit1.Subject = null; this.cogJobManagerEdit1.TabIndex = 7; // // button1 // this.button1.Location = new System.Drawing.Point(19, 323); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(115, 35); this.button1.TabIndex = 8; this.button1.Text = "Run Once"; this.button1.Click += new System.EventHandler(this.button1_Click); // // TotalBytesLabel // this.TotalBytesLabel.Location = new System.Drawing.Point(199, 341); this.TotalBytesLabel.Name = "TotalBytesLabel"; this.TotalBytesLabel.Size = new System.Drawing.Size(226, 17); this.TotalBytesLabel.TabIndex = 66; this.TotalBytesLabel.Text = "0"; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(898, 455); this.Controls.Add(this.TotalBytesLabel); this.Controls.Add(this.button1); this.Controls.Add(this.cogJobManagerEdit1); this.Controls.Add(this.cogRecordDisplay1); this.Controls.Add(this.RunContCheckBox); this.Controls.Add(this.RunOnceButton); this.Controls.Add(this.myCountText); this.Controls.Add(this.Label1); this.Name = "Form1"; this.Text = "QuickBuild Sample Application"; ((System.ComponentModel.ISupportInitialize)(this.cogRecordDisplay1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }