张松男
11 months ago
25 changed files with 2262 additions and 380 deletions
@ -0,0 +1,550 @@ |
|||
namespace QMAPP.WinForm.Forms.Injection |
|||
{ |
|||
partial class SewingPrint |
|||
{ |
|||
/// <summary>
|
|||
/// Required designer variable.
|
|||
/// </summary>
|
|||
private System.ComponentModel.IContainer components = null; |
|||
|
|||
/// <summary>
|
|||
/// Clean up any resources being used.
|
|||
/// </summary>
|
|||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|||
protected override void Dispose(bool disposing) |
|||
{ |
|||
if (disposing && (components != null)) |
|||
{ |
|||
components.Dispose(); |
|||
} |
|||
base.Dispose(disposing); |
|||
} |
|||
|
|||
#region Windows Form Designer generated code
|
|||
|
|||
/// <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.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); |
|||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); |
|||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); |
|||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); |
|||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); |
|||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); |
|||
this.DGView = new System.Windows.Forms.DataGridView(); |
|||
this.MAINCODE = new System.Windows.Forms.DataGridViewTextBoxColumn(); |
|||
this.MATERIAL_NAME = new System.Windows.Forms.DataGridViewTextBoxColumn(); |
|||
this.PRODUCTCODE = new System.Windows.Forms.DataGridViewTextBoxColumn(); |
|||
this.CREATETIME = new System.Windows.Forms.DataGridViewTextBoxColumn(); |
|||
this.tsbPrint = new System.Windows.Forms.Button(); |
|||
this.textMaterialName = new System.Windows.Forms.TextBox(); |
|||
this.txtMaterialCode = new System.Windows.Forms.TextBox(); |
|||
this.label6 = new System.Windows.Forms.Label(); |
|||
this.label1 = new System.Windows.Forms.Label(); |
|||
this.groupBox1 = new System.Windows.Forms.GroupBox(); |
|||
this.plPrintSetting = new System.Windows.Forms.Panel(); |
|||
this.textBox1 = new System.Windows.Forms.TextBox(); |
|||
this.cbMould = new System.Windows.Forms.ComboBox(); |
|||
this.label9 = new System.Windows.Forms.Label(); |
|||
this.tpPrintMode = new System.Windows.Forms.TabControl(); |
|||
this.tpManual = new System.Windows.Forms.TabPage(); |
|||
this.cbTemplateDesign = new System.Windows.Forms.CheckBox(); |
|||
this.tpTimer = new System.Windows.Forms.TabPage(); |
|||
this.label5 = new System.Windows.Forms.Label(); |
|||
this.cbPrintSpan = new System.Windows.Forms.ComboBox(); |
|||
this.cbPrintCount = new System.Windows.Forms.ComboBox(); |
|||
this.btnStart = new System.Windows.Forms.Button(); |
|||
this.btnStop = new System.Windows.Forms.Button(); |
|||
this.lblLastCount = new System.Windows.Forms.Label(); |
|||
this.label7 = new System.Windows.Forms.Label(); |
|||
this.label8 = new System.Windows.Forms.Label(); |
|||
this.timer2 = new System.Windows.Forms.Timer(this.components); |
|||
this.tabControl1 = new System.Windows.Forms.TabControl(); |
|||
this.tabPage1 = new System.Windows.Forms.TabPage(); |
|||
((System.ComponentModel.ISupportInitialize)(this.DGView)).BeginInit(); |
|||
this.groupBox1.SuspendLayout(); |
|||
this.plPrintSetting.SuspendLayout(); |
|||
this.tpPrintMode.SuspendLayout(); |
|||
this.tpManual.SuspendLayout(); |
|||
this.tpTimer.SuspendLayout(); |
|||
this.tabControl1.SuspendLayout(); |
|||
this.tabPage1.SuspendLayout(); |
|||
this.SuspendLayout(); |
|||
//
|
|||
// DGView
|
|||
//
|
|||
this.DGView.AllowUserToAddRows = false; |
|||
this.DGView.AllowUserToDeleteRows = false; |
|||
this.DGView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; |
|||
this.DGView.BackgroundColor = System.Drawing.SystemColors.ButtonFace; |
|||
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; |
|||
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control; |
|||
dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText; |
|||
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; |
|||
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; |
|||
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; |
|||
this.DGView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; |
|||
this.DGView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; |
|||
this.DGView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { |
|||
this.MAINCODE, |
|||
this.MATERIAL_NAME, |
|||
this.PRODUCTCODE, |
|||
this.CREATETIME}); |
|||
this.DGView.Dock = System.Windows.Forms.DockStyle.Fill; |
|||
this.DGView.Location = new System.Drawing.Point(4, 4); |
|||
this.DGView.Margin = new System.Windows.Forms.Padding(4); |
|||
this.DGView.Name = "DGView"; |
|||
this.DGView.ReadOnly = true; |
|||
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; |
|||
dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control; |
|||
dataGridViewCellStyle12.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText; |
|||
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight; |
|||
dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText; |
|||
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; |
|||
this.DGView.RowHeadersDefaultCellStyle = dataGridViewCellStyle12; |
|||
this.DGView.RowTemplate.Height = 23; |
|||
this.DGView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; |
|||
this.DGView.Size = new System.Drawing.Size(1006, 858); |
|||
this.DGView.TabIndex = 38; |
|||
//
|
|||
// MAINCODE
|
|||
//
|
|||
this.MAINCODE.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; |
|||
this.MAINCODE.DataPropertyName = "MAINCODE"; |
|||
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 15.75F); |
|||
this.MAINCODE.DefaultCellStyle = dataGridViewCellStyle8; |
|||
this.MAINCODE.FillWeight = 48.95314F; |
|||
this.MAINCODE.HeaderText = "条码信息"; |
|||
this.MAINCODE.Name = "MAINCODE"; |
|||
this.MAINCODE.ReadOnly = true; |
|||
this.MAINCODE.Width = 280; |
|||
//
|
|||
// MATERIAL_NAME
|
|||
//
|
|||
this.MATERIAL_NAME.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; |
|||
this.MATERIAL_NAME.DataPropertyName = "MATERIAL_NAME"; |
|||
dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 15.75F); |
|||
this.MATERIAL_NAME.DefaultCellStyle = dataGridViewCellStyle9; |
|||
this.MATERIAL_NAME.FillWeight = 99.90437F; |
|||
this.MATERIAL_NAME.HeaderText = "零件名称"; |
|||
this.MATERIAL_NAME.Name = "MATERIAL_NAME"; |
|||
this.MATERIAL_NAME.ReadOnly = true; |
|||
this.MATERIAL_NAME.Width = 260; |
|||
//
|
|||
// PRODUCTCODE
|
|||
//
|
|||
this.PRODUCTCODE.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; |
|||
this.PRODUCTCODE.DataPropertyName = "PRODUCTCODE"; |
|||
dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.PRODUCTCODE.DefaultCellStyle = dataGridViewCellStyle10; |
|||
this.PRODUCTCODE.FillWeight = 48.95314F; |
|||
this.PRODUCTCODE.HeaderText = "零件号"; |
|||
this.PRODUCTCODE.Name = "PRODUCTCODE"; |
|||
this.PRODUCTCODE.ReadOnly = true; |
|||
this.PRODUCTCODE.Width = 200; |
|||
//
|
|||
// CREATETIME
|
|||
//
|
|||
this.CREATETIME.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; |
|||
this.CREATETIME.DataPropertyName = "CREATETIME"; |
|||
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; |
|||
dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 15.75F); |
|||
dataGridViewCellStyle11.Format = "f"; |
|||
dataGridViewCellStyle11.NullValue = null; |
|||
this.CREATETIME.DefaultCellStyle = dataGridViewCellStyle11; |
|||
this.CREATETIME.FillWeight = 48.95314F; |
|||
this.CREATETIME.HeaderText = "操作时间"; |
|||
this.CREATETIME.Name = "CREATETIME"; |
|||
this.CREATETIME.ReadOnly = true; |
|||
this.CREATETIME.Width = 250; |
|||
//
|
|||
// tsbPrint
|
|||
//
|
|||
this.tsbPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); |
|||
this.tsbPrint.Font = new System.Drawing.Font("微软雅黑", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.tsbPrint.Image = global::QMAPP.WinForm.Resource1.save; |
|||
this.tsbPrint.Location = new System.Drawing.Point(362, 9); |
|||
this.tsbPrint.Margin = new System.Windows.Forms.Padding(4); |
|||
this.tsbPrint.Name = "tsbPrint"; |
|||
this.tsbPrint.Size = new System.Drawing.Size(285, 124); |
|||
this.tsbPrint.TabIndex = 34; |
|||
this.tsbPrint.Text = "打印"; |
|||
this.tsbPrint.TextAlign = System.Drawing.ContentAlignment.MiddleRight; |
|||
this.tsbPrint.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; |
|||
this.tsbPrint.UseVisualStyleBackColor = true; |
|||
this.tsbPrint.Click += new System.EventHandler(this.tsbPrint_Click); |
|||
//
|
|||
// textMaterialName
|
|||
//
|
|||
this.textMaterialName.BackColor = System.Drawing.SystemColors.Control; |
|||
this.textMaterialName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.textMaterialName.Location = new System.Drawing.Point(105, 165); |
|||
this.textMaterialName.Margin = new System.Windows.Forms.Padding(4); |
|||
this.textMaterialName.MaxLength = 3096; |
|||
this.textMaterialName.Name = "textMaterialName"; |
|||
this.textMaterialName.ReadOnly = true; |
|||
this.textMaterialName.Size = new System.Drawing.Size(553, 39); |
|||
this.textMaterialName.TabIndex = 33; |
|||
//
|
|||
// txtMaterialCode
|
|||
//
|
|||
this.txtMaterialCode.BackColor = System.Drawing.SystemColors.Control; |
|||
this.txtMaterialCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.txtMaterialCode.Location = new System.Drawing.Point(105, 223); |
|||
this.txtMaterialCode.Margin = new System.Windows.Forms.Padding(4); |
|||
this.txtMaterialCode.MaxLength = 3096; |
|||
this.txtMaterialCode.Name = "txtMaterialCode"; |
|||
this.txtMaterialCode.ReadOnly = true; |
|||
this.txtMaterialCode.Size = new System.Drawing.Size(553, 39); |
|||
this.txtMaterialCode.TabIndex = 30; |
|||
this.txtMaterialCode.TextChanged += new System.EventHandler(this.txtMaterialCode_TextChanged); |
|||
//
|
|||
// label6
|
|||
//
|
|||
this.label6.AutoSize = true; |
|||
this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.label6.Location = new System.Drawing.Point(4, 227); |
|||
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); |
|||
this.label6.Name = "label6"; |
|||
this.label6.Size = new System.Drawing.Size(93, 31); |
|||
this.label6.TabIndex = 29; |
|||
this.label6.Text = "零件号:"; |
|||
//
|
|||
// label1
|
|||
//
|
|||
this.label1.AutoSize = true; |
|||
this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.label1.Location = new System.Drawing.Point(4, 169); |
|||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); |
|||
this.label1.Name = "label1"; |
|||
this.label1.Size = new System.Drawing.Size(93, 31); |
|||
this.label1.TabIndex = 25; |
|||
this.label1.Text = "零件名:"; |
|||
//
|
|||
// groupBox1
|
|||
//
|
|||
this.groupBox1.Controls.Add(this.plPrintSetting); |
|||
this.groupBox1.Controls.Add(this.tpPrintMode); |
|||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Right; |
|||
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.groupBox1.Location = new System.Drawing.Point(1028, 6); |
|||
this.groupBox1.Margin = new System.Windows.Forms.Padding(4); |
|||
this.groupBox1.Name = "groupBox1"; |
|||
this.groupBox1.Padding = new System.Windows.Forms.Padding(4); |
|||
this.groupBox1.Size = new System.Drawing.Size(676, 910); |
|||
this.groupBox1.TabIndex = 40; |
|||
this.groupBox1.TabStop = false; |
|||
//
|
|||
// plPrintSetting
|
|||
//
|
|||
this.plPrintSetting.Controls.Add(this.textBox1); |
|||
this.plPrintSetting.Controls.Add(this.cbMould); |
|||
this.plPrintSetting.Controls.Add(this.label6); |
|||
this.plPrintSetting.Controls.Add(this.label1); |
|||
this.plPrintSetting.Controls.Add(this.label9); |
|||
this.plPrintSetting.Controls.Add(this.txtMaterialCode); |
|||
this.plPrintSetting.Controls.Add(this.textMaterialName); |
|||
this.plPrintSetting.Dock = System.Windows.Forms.DockStyle.Top; |
|||
this.plPrintSetting.Location = new System.Drawing.Point(4, 36); |
|||
this.plPrintSetting.Margin = new System.Windows.Forms.Padding(0); |
|||
this.plPrintSetting.Name = "plPrintSetting"; |
|||
this.plPrintSetting.Size = new System.Drawing.Size(668, 606); |
|||
this.plPrintSetting.TabIndex = 64; |
|||
//
|
|||
// textBox1
|
|||
//
|
|||
this.textBox1.Location = new System.Drawing.Point(128, 22); |
|||
this.textBox1.Name = "textBox1"; |
|||
this.textBox1.Size = new System.Drawing.Size(341, 39); |
|||
this.textBox1.TabIndex = 61; |
|||
this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCode_KeyDown); |
|||
//
|
|||
// cbMould
|
|||
//
|
|||
this.cbMould.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; |
|||
this.cbMould.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.cbMould.FormattingEnabled = true; |
|||
this.cbMould.Location = new System.Drawing.Point(128, 87); |
|||
this.cbMould.Margin = new System.Windows.Forms.Padding(4); |
|||
this.cbMould.Name = "cbMould"; |
|||
this.cbMould.Size = new System.Drawing.Size(530, 39); |
|||
this.cbMould.TabIndex = 60; |
|||
this.cbMould.SelectedIndexChanged += new System.EventHandler(this.cbMould_SelectedIndexChanged); |
|||
//
|
|||
// label9
|
|||
//
|
|||
this.label9.AutoSize = true; |
|||
this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.label9.Location = new System.Drawing.Point(3, 22); |
|||
this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); |
|||
this.label9.Name = "label9"; |
|||
this.label9.Size = new System.Drawing.Size(117, 31); |
|||
this.label9.TabIndex = 25; |
|||
this.label9.Text = "缝纫配置:"; |
|||
//
|
|||
// tpPrintMode
|
|||
//
|
|||
this.tpPrintMode.Controls.Add(this.tpManual); |
|||
this.tpPrintMode.Controls.Add(this.tpTimer); |
|||
this.tpPrintMode.Dock = System.Windows.Forms.DockStyle.Bottom; |
|||
this.tpPrintMode.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.tpPrintMode.Location = new System.Drawing.Point(4, 687); |
|||
this.tpPrintMode.Margin = new System.Windows.Forms.Padding(4); |
|||
this.tpPrintMode.Name = "tpPrintMode"; |
|||
this.tpPrintMode.Padding = new System.Drawing.Point(12, 9); |
|||
this.tpPrintMode.SelectedIndex = 0; |
|||
this.tpPrintMode.Size = new System.Drawing.Size(668, 219); |
|||
this.tpPrintMode.TabIndex = 62; |
|||
//
|
|||
// tpManual
|
|||
//
|
|||
this.tpManual.Controls.Add(this.cbTemplateDesign); |
|||
this.tpManual.Controls.Add(this.tsbPrint); |
|||
this.tpManual.Location = new System.Drawing.Point(4, 58); |
|||
this.tpManual.Margin = new System.Windows.Forms.Padding(4); |
|||
this.tpManual.Name = "tpManual"; |
|||
this.tpManual.Padding = new System.Windows.Forms.Padding(4); |
|||
this.tpManual.Size = new System.Drawing.Size(660, 157); |
|||
this.tpManual.TabIndex = 2; |
|||
this.tpManual.Text = "手动打印"; |
|||
this.tpManual.UseVisualStyleBackColor = true; |
|||
//
|
|||
// cbTemplateDesign
|
|||
//
|
|||
this.cbTemplateDesign.AutoSize = true; |
|||
this.cbTemplateDesign.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.cbTemplateDesign.Location = new System.Drawing.Point(9, 9); |
|||
this.cbTemplateDesign.Margin = new System.Windows.Forms.Padding(4); |
|||
this.cbTemplateDesign.Name = "cbTemplateDesign"; |
|||
this.cbTemplateDesign.Size = new System.Drawing.Size(136, 35); |
|||
this.cbTemplateDesign.TabIndex = 35; |
|||
this.cbTemplateDesign.Text = "模板调整"; |
|||
this.cbTemplateDesign.UseVisualStyleBackColor = true; |
|||
//
|
|||
// tpTimer
|
|||
//
|
|||
this.tpTimer.Controls.Add(this.label5); |
|||
this.tpTimer.Controls.Add(this.cbPrintSpan); |
|||
this.tpTimer.Controls.Add(this.cbPrintCount); |
|||
this.tpTimer.Controls.Add(this.btnStart); |
|||
this.tpTimer.Controls.Add(this.btnStop); |
|||
this.tpTimer.Controls.Add(this.lblLastCount); |
|||
this.tpTimer.Controls.Add(this.label7); |
|||
this.tpTimer.Controls.Add(this.label8); |
|||
this.tpTimer.Location = new System.Drawing.Point(4, 58); |
|||
this.tpTimer.Margin = new System.Windows.Forms.Padding(4); |
|||
this.tpTimer.Name = "tpTimer"; |
|||
this.tpTimer.Padding = new System.Windows.Forms.Padding(4); |
|||
this.tpTimer.Size = new System.Drawing.Size(660, 157); |
|||
this.tpTimer.TabIndex = 1; |
|||
this.tpTimer.Text = "定时打印"; |
|||
this.tpTimer.UseVisualStyleBackColor = true; |
|||
//
|
|||
// label5
|
|||
//
|
|||
this.label5.AutoSize = true; |
|||
this.label5.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.label5.Location = new System.Drawing.Point(12, 20); |
|||
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); |
|||
this.label5.Name = "label5"; |
|||
this.label5.Size = new System.Drawing.Size(129, 37); |
|||
this.label5.TabIndex = 56; |
|||
this.label5.Text = "定时打印"; |
|||
//
|
|||
// cbPrintSpan
|
|||
//
|
|||
this.cbPrintSpan.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; |
|||
this.cbPrintSpan.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.cbPrintSpan.FormattingEnabled = true; |
|||
this.cbPrintSpan.Items.AddRange(new object[] { |
|||
"10s", |
|||
"15s", |
|||
"20s", |
|||
"30s", |
|||
"40s", |
|||
"50s", |
|||
"60s", |
|||
"70s", |
|||
"80s"}); |
|||
this.cbPrintSpan.Location = new System.Drawing.Point(153, 15); |
|||
this.cbPrintSpan.Margin = new System.Windows.Forms.Padding(4); |
|||
this.cbPrintSpan.Name = "cbPrintSpan"; |
|||
this.cbPrintSpan.Size = new System.Drawing.Size(157, 45); |
|||
this.cbPrintSpan.TabIndex = 53; |
|||
//
|
|||
// cbPrintCount
|
|||
//
|
|||
this.cbPrintCount.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; |
|||
this.cbPrintCount.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.cbPrintCount.FormattingEnabled = true; |
|||
this.cbPrintCount.Items.AddRange(new object[] { |
|||
"20", |
|||
"50", |
|||
"100", |
|||
"150", |
|||
"200", |
|||
"300", |
|||
"400"}); |
|||
this.cbPrintCount.Location = new System.Drawing.Point(153, 76); |
|||
this.cbPrintCount.Margin = new System.Windows.Forms.Padding(4); |
|||
this.cbPrintCount.Name = "cbPrintCount"; |
|||
this.cbPrintCount.Size = new System.Drawing.Size(157, 45); |
|||
this.cbPrintCount.TabIndex = 54; |
|||
//
|
|||
// btnStart
|
|||
//
|
|||
this.btnStart.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.btnStart.Location = new System.Drawing.Point(344, 14); |
|||
this.btnStart.Margin = new System.Windows.Forms.Padding(4); |
|||
this.btnStart.Name = "btnStart"; |
|||
this.btnStart.Size = new System.Drawing.Size(135, 52); |
|||
this.btnStart.TabIndex = 55; |
|||
this.btnStart.Text = "开始"; |
|||
this.btnStart.UseVisualStyleBackColor = true; |
|||
this.btnStart.Click += new System.EventHandler(this.btnStart_Click); |
|||
//
|
|||
// btnStop
|
|||
//
|
|||
this.btnStop.Enabled = false; |
|||
this.btnStop.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.btnStop.Location = new System.Drawing.Point(495, 14); |
|||
this.btnStop.Margin = new System.Windows.Forms.Padding(4); |
|||
this.btnStop.Name = "btnStop"; |
|||
this.btnStop.Size = new System.Drawing.Size(135, 52); |
|||
this.btnStop.TabIndex = 55; |
|||
this.btnStop.Text = "停止"; |
|||
this.btnStop.UseVisualStyleBackColor = true; |
|||
this.btnStop.Click += new System.EventHandler(this.btnStop_Click); |
|||
//
|
|||
// lblLastCount
|
|||
//
|
|||
this.lblLastCount.AutoSize = true; |
|||
this.lblLastCount.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.lblLastCount.Location = new System.Drawing.Point(498, 84); |
|||
this.lblLastCount.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); |
|||
this.lblLastCount.Name = "lblLastCount"; |
|||
this.lblLastCount.Size = new System.Drawing.Size(34, 37); |
|||
this.lblLastCount.TabIndex = 59; |
|||
this.lblLastCount.Text = "0"; |
|||
//
|
|||
// label7
|
|||
//
|
|||
this.label7.AutoSize = true; |
|||
this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.label7.Location = new System.Drawing.Point(12, 81); |
|||
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); |
|||
this.label7.Name = "label7"; |
|||
this.label7.Size = new System.Drawing.Size(129, 37); |
|||
this.label7.TabIndex = 57; |
|||
this.label7.Text = "打印数量"; |
|||
//
|
|||
// label8
|
|||
//
|
|||
this.label8.AutoSize = true; |
|||
this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.label8.Location = new System.Drawing.Point(346, 84); |
|||
this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); |
|||
this.label8.Name = "label8"; |
|||
this.label8.Size = new System.Drawing.Size(129, 37); |
|||
this.label8.TabIndex = 58; |
|||
this.label8.Text = "剩余数量"; |
|||
//
|
|||
// timer2
|
|||
//
|
|||
this.timer2.Enabled = true; |
|||
this.timer2.Interval = 1000; |
|||
this.timer2.Tick += new System.EventHandler(this.timer2_Tick); |
|||
//
|
|||
// tabControl1
|
|||
//
|
|||
this.tabControl1.Controls.Add(this.tabPage1); |
|||
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; |
|||
this.tabControl1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); |
|||
this.tabControl1.Location = new System.Drawing.Point(6, 6); |
|||
this.tabControl1.Margin = new System.Windows.Forms.Padding(15, 15, 15, 4); |
|||
this.tabControl1.Name = "tabControl1"; |
|||
this.tabControl1.SelectedIndex = 0; |
|||
this.tabControl1.Size = new System.Drawing.Size(1022, 910); |
|||
this.tabControl1.TabIndex = 41; |
|||
//
|
|||
// tabPage1
|
|||
//
|
|||
this.tabPage1.Controls.Add(this.DGView); |
|||
this.tabPage1.Location = new System.Drawing.Point(4, 40); |
|||
this.tabPage1.Margin = new System.Windows.Forms.Padding(4); |
|||
this.tabPage1.Name = "tabPage1"; |
|||
this.tabPage1.Padding = new System.Windows.Forms.Padding(4); |
|||
this.tabPage1.Size = new System.Drawing.Size(1014, 866); |
|||
this.tabPage1.TabIndex = 0; |
|||
this.tabPage1.Text = "打印记录"; |
|||
this.tabPage1.UseVisualStyleBackColor = true; |
|||
//
|
|||
// SewingPrint
|
|||
//
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); |
|||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|||
this.ClientSize = new System.Drawing.Size(1710, 922); |
|||
this.Controls.Add(this.tabControl1); |
|||
this.Controls.Add(this.groupBox1); |
|||
this.Margin = new System.Windows.Forms.Padding(4); |
|||
this.Name = "SewingPrint"; |
|||
this.Padding = new System.Windows.Forms.Padding(6); |
|||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; |
|||
this.Text = "注塑条码打印"; |
|||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.InjectionCodePrint_FormClosed); |
|||
this.Load += new System.EventHandler(this.InjectionCodePrint_Load); |
|||
((System.ComponentModel.ISupportInitialize)(this.DGView)).EndInit(); |
|||
this.groupBox1.ResumeLayout(false); |
|||
this.plPrintSetting.ResumeLayout(false); |
|||
this.plPrintSetting.PerformLayout(); |
|||
this.tpPrintMode.ResumeLayout(false); |
|||
this.tpManual.ResumeLayout(false); |
|||
this.tpManual.PerformLayout(); |
|||
this.tpTimer.ResumeLayout(false); |
|||
this.tpTimer.PerformLayout(); |
|||
this.tabControl1.ResumeLayout(false); |
|||
this.tabPage1.ResumeLayout(false); |
|||
this.ResumeLayout(false); |
|||
|
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
private System.Windows.Forms.Label label1; |
|||
private System.Windows.Forms.TextBox txtMaterialCode; |
|||
private System.Windows.Forms.Label label6; |
|||
private System.Windows.Forms.TextBox textMaterialName; |
|||
private System.Windows.Forms.Button tsbPrint; |
|||
private System.Windows.Forms.DataGridView DGView; |
|||
private System.Windows.Forms.GroupBox groupBox1; |
|||
private System.Windows.Forms.DataGridViewTextBoxColumn MAINCODE; |
|||
private System.Windows.Forms.DataGridViewTextBoxColumn MATERIAL_NAME; |
|||
private System.Windows.Forms.DataGridViewTextBoxColumn PRODUCTCODE; |
|||
private System.Windows.Forms.DataGridViewTextBoxColumn CREATETIME; |
|||
private System.Windows.Forms.ComboBox cbPrintCount; |
|||
private System.Windows.Forms.ComboBox cbPrintSpan; |
|||
private System.Windows.Forms.Label label7; |
|||
private System.Windows.Forms.Label label5; |
|||
private System.Windows.Forms.Button btnStart; |
|||
private System.Windows.Forms.Label lblLastCount; |
|||
private System.Windows.Forms.Label label8; |
|||
private System.Windows.Forms.Button btnStop; |
|||
private System.Windows.Forms.Timer timer2; |
|||
private System.Windows.Forms.ComboBox cbMould; |
|||
private System.Windows.Forms.Label label9; |
|||
private System.Windows.Forms.TabControl tabControl1; |
|||
private System.Windows.Forms.TabPage tabPage1; |
|||
private System.Windows.Forms.TabControl tpPrintMode; |
|||
private System.Windows.Forms.TabPage tpTimer; |
|||
private System.Windows.Forms.TabPage tpManual; |
|||
private System.Windows.Forms.Panel plPrintSetting; |
|||
private System.Windows.Forms.CheckBox cbTemplateDesign; |
|||
private System.Windows.Forms.TextBox textBox1; |
|||
} |
|||
} |
@ -0,0 +1,708 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.Data; |
|||
using System.Drawing; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows.Forms; |
|||
using QMAPP.WinForm.Common; |
|||
using QMAPP.Entity; |
|||
using QMAPP.ServicesAgent; |
|||
using QMAPP.FJC.Entity.Operation; |
|||
using QMFrameWork.Common.Serialization; |
|||
using QMAPP.WinForm.Forms.Operation; |
|||
using QMAPP.FJC.Entity.Basic; |
|||
using QMAPP.MD.Entity.Bucket; |
|||
using QMAPP.MD.Entity; |
|||
|
|||
namespace QMAPP.WinForm.Forms.Injection |
|||
{ |
|||
public partial class SewingPrint : Form |
|||
{ |
|||
//获取服务代理
|
|||
QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent(); |
|||
|
|||
List<ProcessParameter> paramcolumns = new List<ProcessParameter>(); |
|||
FileSynchronizers.IFileSynchronizer sync; |
|||
|
|||
public SewingPrint() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private void InjectionCodePrint_Load(object sender, EventArgs e) |
|||
{ |
|||
LoadMachineList(); |
|||
SetConnectState(0); |
|||
|
|||
//this.radioButSignal.Checked = true;
|
|||
|
|||
PrintTempleCopyClass printClass = new PrintTempleCopyClass(); |
|||
printClass.CopyPrintTemple("InjectionCodePrint"); |
|||
|
|||
cbPrintCount.SelectedIndex = 3; |
|||
cbPrintSpan.SelectedIndex = 3; |
|||
} |
|||
|
|||
#region 加载零件号
|
|||
/// <summary>
|
|||
/// 加载设备列表
|
|||
/// </summary>
|
|||
private void LoadMachineList() |
|||
{ |
|||
#region
|
|||
|
|||
var material = new Material(); |
|||
material.MATERIAL_TYPE_CODE = "IP_FENGREN"; //零件号类型
|
|||
var materialResult = _agent.InvokeServiceFunction<List<Material>>("MaterialBLL_GetMaterialList", material); |
|||
materialResult.Insert(0, new Material { }); |
|||
this.cbMould.DataSource = materialResult; |
|||
this.cbMould.DisplayMember = "MATERIAL_NAME"; |
|||
this.cbMould.ValueMember = "MATERIAL_CODE"; |
|||
|
|||
#endregion
|
|||
} |
|||
#endregion
|
|||
|
|||
#region 打印
|
|||
/// <summary>
|
|||
/// 打印
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
private void tsbPrint_Click(object sender, EventArgs e) |
|||
{ |
|||
//窗体数据校验
|
|||
string errorMessae = ErrorCheck(); |
|||
if (errorMessae != "") |
|||
{ |
|||
MessageBox.Show(errorMessae, Resource1.ConfirmTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|||
return; |
|||
} |
|||
tsbPrint.Enabled = false; |
|||
CodeCreatePrint(); |
|||
tsbPrint.Enabled = true; |
|||
} |
|||
|
|||
private void CodeCreatePrint() |
|||
{ |
|||
Material materialInfo = new Material(); |
|||
materialInfo.MATERIAL_CODE = cbMould.SelectedValue.ToString(); |
|||
materialInfo.MATERIAL_NAME = cbMould.Text; |
|||
DataResult<List<PrintCode>> resultList = _agent.InvokeServiceFunction<DataResult<List<PrintCode>>>("MainOperationBLL_GetPrintCodeForMP4", materialInfo); |
|||
//var machine = new MachineInfo();
|
|||
//machine.MACHINENAME = "";
|
|||
//machine.MACHINECODDE = "";
|
|||
//machine.WORKCENTER_CODE = "";
|
|||
//machine.WORKCELL_CODE = "";
|
|||
//DataResult<List<PrintCode>> resultList = _agent.InvokeServiceFunction<DataResult<List<PrintCode>>>("MainOperationBLL_GetPrintCodeWithParam", materialListInfo, machine, model, "", new Dictionary<string, string>());
|
|||
try |
|||
{ |
|||
Print(resultList.Result, true); |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
var ss = e.Message; |
|||
} |
|||
|
|||
} |
|||
|
|||
private void CodeCreatePrint(string header, string datarow, char[] dataSeparator) |
|||
{ |
|||
|
|||
List<Material> materialListInfo = GetSelectedMaterials(); |
|||
//var machine = comMachine.SelectedItem as MachineInfo;
|
|||
var model = cbMould.SelectedItem as MachineInfoModels; |
|||
if (model == null) |
|||
{ |
|||
model = new MachineInfoModels(); |
|||
} |
|||
string tableName = paramcolumns.FirstOrDefault().PARATABLENAME; |
|||
Dictionary<string,string> param=new Dictionary<string,string>(); |
|||
param.Add("PARAMETER_COLUMNS",header); |
|||
var paramvalue=datarow.Split(dataSeparator); |
|||
for(int j=0;j<paramvalue.Length;j++) |
|||
{ |
|||
if(j<paramcolumns.Count) |
|||
{ |
|||
param.Add(paramcolumns[j].PARANAME,paramvalue[j]); |
|||
} |
|||
else |
|||
{ |
|||
break; |
|||
} |
|||
} |
|||
int i = 1; |
|||
//DataResult<List<PrintCode>> resultList = _agent.InvokeServiceFunction<DataResult<List<PrintCode>>>("MainOperationBLL_GetPrintCodeWithParam", materialListInfo,machine,model,tableName,param);
|
|||
//Print(resultList.Result,false);
|
|||
} |
|||
private void Print(List<PrintCode> codeList,bool IsManual) |
|||
{ |
|||
List<PrintTemplate.InjectLabel> labels = new List<PrintTemplate.InjectLabel>(); |
|||
//打印条码
|
|||
|
|||
string typeTem = ""; |
|||
string typeData = ""; |
|||
foreach (PrintCode item in codeList) |
|||
{ |
|||
//创建新行
|
|||
var row = new DataGridViewRow(); |
|||
if (DGView.Rows.Count == 0) |
|||
{ |
|||
var index = this.DGView.Rows.Add(); |
|||
row = DGView.Rows[index]; |
|||
} |
|||
else |
|||
{ |
|||
this.DGView.Rows.InsertCopy(0, 0); |
|||
row = DGView.Rows[0]; |
|||
} |
|||
//对datagridview赋值
|
|||
row.Cells["MATERIAL_NAME"].Value = item.MATERIAL_NAME; |
|||
row.Cells["PRODUCTCODE"].Value = item.PRODUCTCODE; |
|||
row.Cells["MAINCODE"].Value = item.MAINCODE; |
|||
row.Cells["CREATETIME"].Value = DateTime.Now; |
|||
|
|||
if (DGView.Rows.Count > 200) |
|||
{ |
|||
DGView.Rows.RemoveAt(200); |
|||
} |
|||
//班次信息
|
|||
string shiftCode = ClientContext.produceShift.PRODUCESHIFTTCODE; |
|||
item.ShiftCode = shiftCode; |
|||
|
|||
DGView.AutoGenerateColumns = false; |
|||
typeTem = item.PRINT_TEMPALTE_TEM; |
|||
typeData = item.PRINT_TEMPALTE_DATA; |
|||
//QM.Assist.LabelInfo ll = new QM.Assist.LabelInfo();
|
|||
//ll.BarCode = item.MATERIAL_NAME + "," + item.PRODUCTCODE + "," + item.MAINCODE + "," + shiftCode + "," + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|||
//QM.Assist.PrintUtil.LabelList2.Add(ll);
|
|||
PrintTemplate.InjectLabel label = new PrintTemplate.InjectLabel |
|||
{ |
|||
CreateDate = DateTime.Now, |
|||
//MachineCode = comMachine.SelectedValue + "",
|
|||
MaterialCode = item.PRODUCTCODE, |
|||
MaterialName = item.MATERIAL_NAME, |
|||
ModelCode = cbMould.SelectedValue + "", |
|||
SerialNumber = item.MAINCODE, |
|||
ShiftCode = shiftCode, |
|||
IsManualPrint = IsManual |
|||
}; |
|||
labels.Add(label); |
|||
} |
|||
string path = System.Configuration.ConfigurationManager.AppSettings["Template_Local_Path"]; |
|||
if (!System.IO.Directory.Exists(path)) |
|||
{ |
|||
System.IO.Directory.CreateDirectory(path); |
|||
} |
|||
FastReport.Report fr = new FastReport.Report(); |
|||
fr.RegisterData(labels, "Labels"); |
|||
if (!System.IO.File.Exists(string.Format("{0}\\{1}.frx", path, typeTem))) |
|||
{ |
|||
if (System.IO.File.Exists(string.Format("PrintTemplate\\{1}.frx", path, typeTem))) |
|||
{ |
|||
System.IO.File.Copy(string.Format("PrintTemplate\\{1}.frx", path, typeTem) |
|||
, string.Format("{0}\\{1}.frx", path, typeTem)); |
|||
} |
|||
else |
|||
{ |
|||
fr.FileName = string.Format("{0}\\{1}.frx", path, typeTem); |
|||
fr.Design(true); |
|||
fr.Save(string.Format("{0}\\{1}.frx", path, typeTem)); |
|||
} |
|||
} |
|||
fr.Load(string.Format("{0}\\{1}.frx", path, typeTem)); |
|||
|
|||
|
|||
if (cbTemplateDesign.Enabled && cbTemplateDesign.Checked) |
|||
{ |
|||
try |
|||
{ |
|||
fr.Design(true); |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
var ss = e.Message; |
|||
} |
|||
|
|||
} |
|||
else |
|||
{ |
|||
try |
|||
{ |
|||
fr.PrintSettings.ShowDialog = false; |
|||
fr.Print(); |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
var ss = e.Message; |
|||
} |
|||
|
|||
|
|||
#region 张松男20210802 修改 增加新版注塑投料条码绑定
|
|||
|
|||
foreach (var la in labels) |
|||
{ |
|||
var material_T = new BucketMaterialClass() { MaterialCode = la.MaterialCode }; |
|||
var List = _agent.InvokeServiceFunction<List<RawMaterial>>(B9BasicService.RawMaterialBLL_GetListTo.ToString(), material_T); |
|||
|
|||
if (List != null && List.Count > 0) |
|||
{ |
|||
foreach (var raw in List) |
|||
{ |
|||
var record = new RawMaterialRecord(); |
|||
record.MaterialCode = la.MaterialCode; |
|||
record.MaterialName = la.MaterialName; |
|||
record.ProductCode = la.SerialNumber; |
|||
record.RawMaterialPID = raw.PID; |
|||
record.MachineCode = la.MachineCode; |
|||
_agent.InvokeServiceFunction<DataResult<int>>(B9BasicService.RawMaterialRecordBLL_Insert.ToString(), record); |
|||
} |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
} |
|||
try |
|||
{ |
|||
fr.Dispose(); |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
var ss = e.Message; |
|||
} |
|||
|
|||
|
|||
|
|||
//QM.Assist.PrintUtil pu = new QM.Assist.PrintUtil();
|
|||
//pu.PrintLabel2(System.Configuration.ConfigurationManager.AppSettings["proPath"].ToString
|
|||
// (), System.Configuration.ConfigurationManager.AppSettings[typeTem + "temPath"].ToString
|
|||
// (), System.Configuration.ConfigurationManager.AppSettings[typeData + "dataPath"].ToString
|
|||
// ());
|
|||
} |
|||
|
|||
private List<Material> GetSelectedMaterials() |
|||
{ |
|||
List<Material> materialListInfo = new List<Material>(); |
|||
Material concationMaterial = new Material(); |
|||
//int i= Convert.ToInt32( this.txtNum.Text);
|
|||
|
|||
//if (this.radioButSignal.Checked == true)
|
|||
//{
|
|||
// string materialcode1 = this.txtMaterialCode.Text;
|
|||
// concationMaterial.MATERIAL_CODE = materialcode1;
|
|||
// materialListInfo.Add(concationMaterial);
|
|||
//}
|
|||
//else if (this.radioButDouble.Checked == true)
|
|||
//{
|
|||
// concationMaterial.MATERIAL_CODE = this.txtMaterialCode.Text;
|
|||
// materialListInfo.Add(concationMaterial);
|
|||
// if (!string.IsNullOrEmpty(this.comboxMaterial.SelectedValue.ToString()))
|
|||
// {
|
|||
// Material concationMaterial2 = new Material();
|
|||
// concationMaterial2.MATERIAL_CODE = this.comboxMaterial.SelectedValue.ToString();
|
|||
// materialListInfo.Add(concationMaterial2);
|
|||
// }
|
|||
//}
|
|||
//else if (this.radioButFourth.Checked == true)
|
|||
//{
|
|||
// concationMaterial.MATERIAL_CODE = this.txtMaterialCode.Text;
|
|||
// materialListInfo.Add(concationMaterial);
|
|||
|
|||
// if (!string.IsNullOrEmpty(this.txtMaterial2.Text))
|
|||
// {
|
|||
// Material concationMaterial3 = new Material();
|
|||
// concationMaterial3.MATERIAL_CODE = this.txtMaterial2.Text.Substring(this.txtMaterial2.Text.LastIndexOf(":") + 1);
|
|||
// materialListInfo.Add(concationMaterial3);
|
|||
// }
|
|||
|
|||
// if (!string.IsNullOrEmpty(this.txtMaterial3.Text))
|
|||
// {
|
|||
// Material concationMaterial4 = new Material();
|
|||
// concationMaterial4.MATERIAL_CODE = this.txtMaterial3.Text.Substring(this.txtMaterial3.Text.LastIndexOf(":") + 1);
|
|||
// materialListInfo.Add(concationMaterial4);
|
|||
// }
|
|||
// if (!string.IsNullOrEmpty(this.txtMaterial4.Text))
|
|||
// {
|
|||
// Material concationMaterial5 = new Material();
|
|||
// concationMaterial5.MATERIAL_CODE = this.txtMaterial4.Text.Substring(this.txtMaterial4.Text.LastIndexOf(":") + 1);
|
|||
// materialListInfo.Add(concationMaterial5);
|
|||
// }
|
|||
//}
|
|||
return materialListInfo; |
|||
} |
|||
#endregion
|
|||
|
|||
#region 校验
|
|||
/// <summary>
|
|||
/// 校验
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
private string ErrorCheck() |
|||
{ |
|||
#region
|
|||
string strMessage = ""; |
|||
|
|||
if (cbMould.Items.Count > 0 && cbMould.SelectedIndex < 0) |
|||
{ |
|||
strMessage += "请选择零件!" + "\r\n"; |
|||
} |
|||
|
|||
//注塑零件
|
|||
if (this.txtMaterialCode.Text == null || this.txtMaterialCode.Text == string.Empty) |
|||
{ |
|||
strMessage += Resource1.MaterialChoiceValidate + "\r\n"; |
|||
} |
|||
|
|||
|
|||
return strMessage; |
|||
#endregion
|
|||
} |
|||
#endregion
|
|||
|
|||
#region 窗体关闭
|
|||
/// <summary>
|
|||
/// 窗体关闭
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
private void tsbClose_Click(object sender, EventArgs e) |
|||
{ |
|||
this.Close(); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 点击选择零件信息
|
|||
/// <summary>
|
|||
/// 点击选择零件信息
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
private void btnChoiceMaterial_Click(object sender, EventArgs e) |
|||
{ |
|||
MaterialTreeForm materialForm = new MaterialTreeForm(); |
|||
var ret= materialForm.ShowDialog(); |
|||
if (ret == DialogResult.OK) |
|||
{ |
|||
this.txtMaterialCode.Text = materialForm.MaterialCode; |
|||
this.textMaterialName.Text = materialForm.MaterialName; |
|||
bool maintype = materialForm.MainType; |
|||
if (maintype) |
|||
{ |
|||
//this.groupBox3.Enabled = true;
|
|||
} |
|||
else |
|||
{ |
|||
//this.groupBox3.Enabled = false;
|
|||
} |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 所选零件发生改变
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
private void txtMaterialCode_TextChanged(object sender, EventArgs e) |
|||
{ |
|||
//radioButSignal.Checked = true;
|
|||
} |
|||
|
|||
|
|||
|
|||
private void btnStart_Click(object sender, EventArgs e) |
|||
{ |
|||
//窗体数据校验
|
|||
string errorMessae = ErrorCheck(); |
|||
if (errorMessae != "") |
|||
{ |
|||
MessageBox.Show(errorMessae, Resource1.ConfirmTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|||
return; |
|||
} |
|||
btnStart.Enabled = false; |
|||
btnStop.Enabled = true; |
|||
cbPrintCount.Enabled = false; |
|||
cbPrintSpan.Enabled = false; |
|||
lblLastCount.Text = cbPrintCount.Text; |
|||
tsbPrint.Enabled = false; |
|||
//btnChoiceMaterial.Enabled = false;
|
|||
//groupBox3.Enabled = false;
|
|||
printtimer = int.Parse(cbPrintSpan.Text.Trim('s')); |
|||
LockPrintMode(2); |
|||
|
|||
} |
|||
|
|||
private void btnStop_Click(object sender, EventArgs e) |
|||
{ |
|||
btnStart.Enabled = true; |
|||
btnStop.Enabled = false; |
|||
cbPrintCount.Enabled = true; |
|||
cbPrintSpan.Enabled = true; |
|||
//lblLastCount.Text = cbPrintCount.Text;
|
|||
tsbPrint.Enabled = true; |
|||
//btnChoiceMaterial.Enabled = true;
|
|||
//groupBox3.Enabled = true;
|
|||
LockPrintMode(-1); |
|||
} |
|||
|
|||
int printtimer = 0; |
|||
|
|||
private void timer2_Tick(object sender, EventArgs e) |
|||
{ |
|||
if (!btnStart.Enabled&&btnStop.Enabled) |
|||
{ |
|||
int span=int.Parse(cbPrintSpan.Text.Trim('s')); |
|||
if (printtimer >= span) |
|||
{ |
|||
CodeCreatePrint(); |
|||
printtimer = 0; |
|||
var lastcount = int.Parse(lblLastCount.Text) - 1; |
|||
lblLastCount.Text = lastcount + ""; |
|||
if (lastcount <= 0) |
|||
{ |
|||
btnStop_Click(sender, e); |
|||
} |
|||
|
|||
} |
|||
else |
|||
{ |
|||
printtimer++; |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
printtimer = 0; |
|||
} |
|||
} |
|||
|
|||
private void comMachine_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
//var selectmachine = comMachine.SelectedItem as MachineInfo;
|
|||
//if (selectmachine != null && !string.IsNullOrEmpty(selectmachine.PID))
|
|||
//{
|
|||
// var mouldList = _agent.InvokeServiceFunction<List<MachineInfoModels>>(B9BasicService.MachineInfoModelBLL_GetAllList.ToString(), new MachineInfoModels { MID = "INJ_MODEL" }).OrderBy(p => p.MODELCODE).ToList();
|
|||
// mouldList.Insert(0, new MachineInfoModels { });
|
|||
// cbMould.DisplayMember = "MODELNAME";
|
|||
// cbMould.ValueMember = "MODELCODE";
|
|||
// cbMould.DataSource = mouldList.ToList();
|
|||
|
|||
// if (selectmachine.ISCONTROL == "1")
|
|||
// {
|
|||
// HideTimerPrint(true);
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// HideTimerPrint(false);
|
|||
// }
|
|||
//}
|
|||
|
|||
} |
|||
|
|||
private void txtCode_KeyDown(object sender, KeyEventArgs e) |
|||
{ |
|||
if (e.KeyCode == Keys.Enter)//如果输入的是回车键
|
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
private void btnStartFileScan_Click(object sender, EventArgs e) |
|||
{ |
|||
//窗体数据校验
|
|||
string errorMessae = ErrorCheck(); |
|||
if (errorMessae != "") |
|||
{ |
|||
MessageBox.Show(errorMessae, Resource1.ConfirmTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|||
return; |
|||
} |
|||
//var selectmachine= comMachine.SelectedItem as MachineInfo;
|
|||
//if (selectmachine != null&&!string.IsNullOrEmpty(selectmachine.PID))
|
|||
//{
|
|||
// //txtFilePath.Text = selectmachine.EQUIPMENT_DIRECTORY;
|
|||
// var columns = _agent.InvokeServiceFunction<DataResult<List<ProcessParameter>>>("ProcessParameterBLL_GetAllList", new ProcessParameter { MACHINECODDE = selectmachine.MACHINECODDE }).Result;
|
|||
// if (columns != null)
|
|||
// {
|
|||
// paramcolumns = columns;
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// paramcolumns = new List<ProcessParameter>();
|
|||
// }
|
|||
// //lvParamRecords.Items.Clear();
|
|||
// //lvParamRecords.Columns.Clear();
|
|||
// //var c1=lvParamRecords.Columns.Add("扫描时间");
|
|||
// //c1.Width=180;
|
|||
// foreach (var col in paramcolumns)
|
|||
// {
|
|||
// //var c= lvParamRecords.Columns.Add(col.PARADESCRIBE);
|
|||
// }
|
|||
// if (selectmachine.EQUIPMENT_TYPE_CODE == "HaitianInjection")
|
|||
// {
|
|||
// sync = new FileSynchronizers.HaitianInjectionFileSynchronizer(selectmachine);
|
|||
// }
|
|||
// else if (selectmachine.EQUIPMENT_TYPE_CODE == "EngelInjection")
|
|||
// {
|
|||
// sync = new FileSynchronizers.EngelInjectionFileSynchronizer(selectmachine);
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// MessageBox.Show("注塑机型号未设定!", Resource1.ConfirmTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|||
// return;
|
|||
// }
|
|||
// sync.NewRecordFound += new EventHandler<FileSynchronizers.InjParamEventArgs>(sync_NewRecordFound);
|
|||
// sync.ExceptionCatched += new EventHandler<FileSynchronizers.InjParamEventArgs>(sync_ExceptionCatched);
|
|||
// //sync.Start(cbSkipHistory.Checked);
|
|||
// SetConnectState(1);
|
|||
// //btnStartFileScan.Enabled = false;
|
|||
// //btnStopFileScan.Enabled = true;
|
|||
// LockPrintMode(0);
|
|||
//}
|
|||
//else
|
|||
//{
|
|||
// MessageBox.Show("请选择注塑机!", Resource1.ConfirmTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|||
//}
|
|||
} |
|||
/// <summary>
|
|||
/// 设置连接状态
|
|||
/// </summary>
|
|||
/// <param name="state">0:停止 1:正常 2:断开</param>
|
|||
void SetConnectState(int state) |
|||
{ |
|||
switch (state) |
|||
{ |
|||
case 0: |
|||
{ |
|||
//txtConnectState.Text = "扫描停止";
|
|||
//picConnectState.Image = WinForm.Resource1.stop;
|
|||
break; |
|||
} |
|||
case 1: |
|||
{ |
|||
//txtConnectState.Text = "扫描正常";
|
|||
//picConnectState.Image = WinForm.Resource1.reload;
|
|||
break; |
|||
} |
|||
case 2: |
|||
{ |
|||
//txtConnectState.Text = "连接断开";
|
|||
//picConnectState.Image = WinForm.Resource1.no;
|
|||
break; |
|||
} |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 锁定打印模式
|
|||
/// </summary>
|
|||
/// <param name="mode">-1 解锁; 0 联机; 1 手动; 2 定时;</param>
|
|||
void LockPrintMode(int mode) |
|||
{ |
|||
for(int i=0;i<tpPrintMode.Controls.Count;i++) |
|||
{ |
|||
if(i==mode) |
|||
{ |
|||
tpPrintMode.Controls[i].Enabled = true; |
|||
} |
|||
else if (mode < 0) |
|||
{ |
|||
tpPrintMode.Controls[i].Enabled = true; |
|||
} |
|||
else |
|||
{ |
|||
tpPrintMode.Controls[i].Enabled = false; |
|||
} |
|||
} |
|||
plPrintSetting.Enabled = mode < 0; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 隐藏定时打印模式
|
|||
/// </summary>
|
|||
void HideTimerPrint(bool hide) |
|||
{ |
|||
if (hide) |
|||
{ |
|||
if (tpPrintMode.Controls.Contains(tpTimer)) |
|||
//tpPrintMode.Controls[tpTimer.Name].Visible = !hide;
|
|||
tpPrintMode.Controls.Remove(tpTimer); |
|||
} |
|||
else |
|||
{ |
|||
if (!tpPrintMode.Controls.Contains(tpTimer)) |
|||
//tpPrintMode.Controls[tpTimer.Name].Visible = !hide;
|
|||
tpPrintMode.Controls.Add(tpTimer); |
|||
} |
|||
} |
|||
|
|||
|
|||
private void InjectionCodePrint_FormClosed(object sender, FormClosedEventArgs e) |
|||
{ |
|||
if (sync != null) |
|||
{ |
|||
sync.Stop(); |
|||
} |
|||
} |
|||
|
|||
private void btnLockMachine_Click(object sender, EventArgs e) |
|||
{ |
|||
LockMachine(true); |
|||
|
|||
/* if (this.btnLockMachine.Tag.ToString().Equals("0")) |
|||
{ |
|||
|
|||
LockMachine(false); |
|||
} |
|||
else |
|||
{ |
|||
LockMachine(true); |
|||
}*/ |
|||
} |
|||
#region 设备锁定
|
|||
/// <summary>
|
|||
/// 设备锁定
|
|||
/// </summary>
|
|||
/// <param name="lockFlag"></param>
|
|||
private void LockMachine(bool lockFlag) |
|||
{ |
|||
//this.comMachine.Enabled = lockFlag;
|
|||
////this.comProductType.Enabled = lockFlag;
|
|||
//if (lockFlag)
|
|||
//{
|
|||
|
|||
// this.btnLockMachine.Text = "锁定";
|
|||
// this.btnLockMachine.Tag = "0";
|
|||
//}
|
|||
//else
|
|||
//{
|
|||
// ClientContext.MachineInfo = this.comMachine.SelectedItem as MachineInfo;
|
|||
// string locationfile = System.Configuration.ConfigurationManager.AppSettings["loactionfile"];
|
|||
// System.IO.File.WriteAllText(locationfile, this.comMachine.SelectedValue.ToString());
|
|||
// this.btnLockMachine.Text = "解锁";
|
|||
// this.btnLockMachine.Tag = "1";
|
|||
//}
|
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
private void cbMould_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
if (cbMould.SelectedValue != null && cbMould.SelectedValue.ToString() != "QMAPP.MD.Entity.Material") |
|||
{ |
|||
textMaterialName.Text = cbMould.Text; |
|||
txtMaterialCode.Text = cbMould.SelectedValue.ToString(); |
|||
} |
|||
else |
|||
{ |
|||
textMaterialName.Text = ""; |
|||
txtMaterialCode.Text = ""; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,138 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<root> |
|||
<!-- |
|||
Microsoft ResX Schema |
|||
|
|||
Version 2.0 |
|||
|
|||
The primary goals of this format is to allow a simple XML format |
|||
that is mostly human readable. The generation and parsing of the |
|||
various data types are done through the TypeConverter classes |
|||
associated with the data types. |
|||
|
|||
Example: |
|||
|
|||
... ado.net/XML headers & schema ... |
|||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|||
<resheader name="version">2.0</resheader> |
|||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|||
</data> |
|||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|||
<comment>This is a comment</comment> |
|||
</data> |
|||
|
|||
There are any number of "resheader" rows that contain simple |
|||
name/value pairs. |
|||
|
|||
Each data row contains a name, and value. The row also contains a |
|||
type or mimetype. Type corresponds to a .NET class that support |
|||
text/value conversion through the TypeConverter architecture. |
|||
Classes that don't support this are serialized and stored with the |
|||
mimetype set. |
|||
|
|||
The mimetype is used for serialized objects, and tells the |
|||
ResXResourceReader how to depersist the object. This is currently not |
|||
extensible. For a given mimetype the value must be set accordingly: |
|||
|
|||
Note - application/x-microsoft.net.object.binary.base64 is the format |
|||
that the ResXResourceWriter will generate, however the reader can |
|||
read any of the formats listed below. |
|||
|
|||
mimetype: application/x-microsoft.net.object.binary.base64 |
|||
value : The object must be serialized with |
|||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|||
: and then encoded with base64 encoding. |
|||
|
|||
mimetype: application/x-microsoft.net.object.soap.base64 |
|||
value : The object must be serialized with |
|||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|||
: and then encoded with base64 encoding. |
|||
|
|||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|||
value : The object must be serialized into a byte array |
|||
: using a System.ComponentModel.TypeConverter |
|||
: and then encoded with base64 encoding. |
|||
--> |
|||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|||
<xsd:element name="root" msdata:IsDataSet="true"> |
|||
<xsd:complexType> |
|||
<xsd:choice maxOccurs="unbounded"> |
|||
<xsd:element name="metadata"> |
|||
<xsd:complexType> |
|||
<xsd:sequence> |
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|||
</xsd:sequence> |
|||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|||
<xsd:attribute name="type" type="xsd:string" /> |
|||
<xsd:attribute name="mimetype" type="xsd:string" /> |
|||
<xsd:attribute ref="xml:space" /> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
<xsd:element name="assembly"> |
|||
<xsd:complexType> |
|||
<xsd:attribute name="alias" type="xsd:string" /> |
|||
<xsd:attribute name="name" type="xsd:string" /> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
<xsd:element name="data"> |
|||
<xsd:complexType> |
|||
<xsd:sequence> |
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|||
</xsd:sequence> |
|||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|||
<xsd:attribute ref="xml:space" /> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
<xsd:element name="resheader"> |
|||
<xsd:complexType> |
|||
<xsd:sequence> |
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|||
</xsd:sequence> |
|||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
</xsd:choice> |
|||
</xsd:complexType> |
|||
</xsd:element> |
|||
</xsd:schema> |
|||
<resheader name="resmimetype"> |
|||
<value>text/microsoft-resx</value> |
|||
</resheader> |
|||
<resheader name="version"> |
|||
<value>2.0</value> |
|||
</resheader> |
|||
<resheader name="reader"> |
|||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|||
</resheader> |
|||
<resheader name="writer"> |
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|||
</resheader> |
|||
<metadata name="MAINCODE.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
|||
<value>True</value> |
|||
</metadata> |
|||
<metadata name="MATERIAL_NAME.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
|||
<value>True</value> |
|||
</metadata> |
|||
<metadata name="PRODUCTCODE.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
|||
<value>True</value> |
|||
</metadata> |
|||
<metadata name="CREATETIME.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
|||
<value>True</value> |
|||
</metadata> |
|||
<metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|||
<value>107, 17</value> |
|||
</metadata> |
|||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
|||
<value>33</value> |
|||
</metadata> |
|||
</root> |
File diff suppressed because it is too large
Loading…
Reference in new issue