Commit 35d87eae 张东亮

料架打印添加站别

1 个父辈 20ca437b
......@@ -51,6 +51,10 @@
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.lblLabelInfo = new System.Windows.Forms.Label();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.textBox5 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
......@@ -58,35 +62,39 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 22);
this.label1.Location = new System.Drawing.Point(16, 28);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(71, 12);
this.label1.Size = new System.Drawing.Size(90, 15);
this.label1.TabIndex = 0;
this.label1.Text = "打印机名称:";
//
// txtIp
//
this.txtIp.Enabled = false;
this.txtIp.Location = new System.Drawing.Point(89, 18);
this.txtIp.Location = new System.Drawing.Point(119, 22);
this.txtIp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtIp.Name = "txtIp";
this.txtIp.Size = new System.Drawing.Size(165, 21);
this.txtIp.Size = new System.Drawing.Size(219, 25);
this.txtIp.TabIndex = 1;
//
// lblState
//
this.lblState.AutoSize = true;
this.lblState.BackColor = System.Drawing.Color.White;
this.lblState.Location = new System.Drawing.Point(279, 23);
this.lblState.Location = new System.Drawing.Point(372, 29);
this.lblState.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblState.Name = "lblState";
this.lblState.Size = new System.Drawing.Size(65, 12);
this.lblState.Size = new System.Drawing.Size(82, 15);
this.lblState.TabIndex = 2;
this.lblState.Text = "打印机状态";
//
// button1
//
this.button1.Location = new System.Drawing.Point(251, 21);
this.button1.Location = new System.Drawing.Point(335, 26);
this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(89, 28);
this.button1.Size = new System.Drawing.Size(119, 35);
this.button1.TabIndex = 3;
this.button1.Text = "标签编辑";
this.button1.UseVisualStyleBackColor = true;
......@@ -95,18 +103,20 @@
// lblLabelName
//
this.lblLabelName.AutoSize = true;
this.lblLabelName.Location = new System.Drawing.Point(526, 27);
this.lblLabelName.Location = new System.Drawing.Point(701, 34);
this.lblLabelName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblLabelName.Name = "lblLabelName";
this.lblLabelName.Size = new System.Drawing.Size(41, 12);
this.lblLabelName.Size = new System.Drawing.Size(52, 15);
this.lblLabelName.TabIndex = 4;
this.lblLabelName.Text = "标签名";
this.lblLabelName.Click += new System.EventHandler(this.lblLabelName_Click);
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(14, 137);
this.pictureBox1.Location = new System.Drawing.Point(19, 171);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(284, 195);
this.pictureBox1.Size = new System.Drawing.Size(379, 269);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 5;
this.pictureBox1.TabStop = false;
......@@ -115,9 +125,10 @@
//
this.checkBox1.AutoSize = true;
this.checkBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.checkBox1.Location = new System.Drawing.Point(47, 67);
this.checkBox1.Location = new System.Drawing.Point(19, 83);
this.checkBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(388, 23);
this.checkBox1.Size = new System.Drawing.Size(482, 28);
this.checkBox1.TabIndex = 6;
this.checkBox1.Text = "手动(选中后暂不接收服务端打印任务)";
this.checkBox1.UseVisualStyleBackColor = true;
......@@ -125,9 +136,10 @@
//
// button2
//
this.button2.Location = new System.Drawing.Point(123, 143);
this.button2.Location = new System.Drawing.Point(321, 186);
this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(100, 36);
this.button2.Size = new System.Drawing.Size(133, 45);
this.button2.TabIndex = 7;
this.button2.Text = "打印";
this.button2.UseVisualStyleBackColor = true;
......@@ -136,69 +148,81 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(10, 29);
this.label2.Location = new System.Drawing.Point(13, 36);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.Size = new System.Drawing.Size(52, 15);
this.label2.TabIndex = 8;
this.label2.Text = "料号:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(64, 20);
this.textBox1.Location = new System.Drawing.Point(85, 25);
this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(159, 21);
this.textBox1.Size = new System.Drawing.Size(211, 25);
this.textBox1.TabIndex = 9;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(64, 51);
this.textBox2.Location = new System.Drawing.Point(85, 64);
this.textBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(159, 21);
this.textBox2.Size = new System.Drawing.Size(211, 25);
this.textBox2.TabIndex = 11;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(10, 54);
this.label3.Location = new System.Drawing.Point(13, 68);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(41, 12);
this.label3.Size = new System.Drawing.Size(52, 15);
this.label3.TabIndex = 10;
this.label3.Text = "线别:";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(64, 78);
this.textBox3.Location = new System.Drawing.Point(85, 98);
this.textBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(159, 21);
this.textBox3.Size = new System.Drawing.Size(211, 25);
this.textBox3.TabIndex = 13;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(10, 81);
this.label4.Location = new System.Drawing.Point(13, 101);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(41, 12);
this.label4.Size = new System.Drawing.Size(52, 15);
this.label4.TabIndex = 12;
this.label4.Text = "面别:";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(64, 106);
this.textBox4.Location = new System.Drawing.Point(85, 132);
this.textBox4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(159, 21);
this.textBox4.Size = new System.Drawing.Size(211, 25);
this.textBox4.TabIndex = 15;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(10, 109);
this.label5.Location = new System.Drawing.Point(13, 136);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(41, 12);
this.label5.Size = new System.Drawing.Size(52, 15);
this.label5.TabIndex = 14;
this.label5.Text = "机台:";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox6);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.textBox5);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.button3);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.button2);
......@@ -211,18 +235,21 @@
this.groupBox1.Controls.Add(this.textBox2);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Enabled = false;
this.groupBox1.Location = new System.Drawing.Point(344, 137);
this.groupBox1.Location = new System.Drawing.Point(459, 171);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(394, 195);
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox1.Size = new System.Drawing.Size(525, 269);
this.groupBox1.TabIndex = 16;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "手动打印";
//
// button3
//
this.button3.Location = new System.Drawing.Point(6, 143);
this.button3.Location = new System.Drawing.Point(321, 86);
this.button3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(100, 36);
this.button3.Size = new System.Drawing.Size(133, 45);
this.button3.TabIndex = 16;
this.button3.Text = "预览";
this.button3.UseVisualStyleBackColor = true;
......@@ -235,9 +262,10 @@
// lblLabelInfo
//
this.lblLabelInfo.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lblLabelInfo.Location = new System.Drawing.Point(0, 356);
this.lblLabelInfo.Location = new System.Drawing.Point(0, 491);
this.lblLabelInfo.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblLabelInfo.Name = "lblLabelInfo";
this.lblLabelInfo.Size = new System.Drawing.Size(750, 128);
this.lblLabelInfo.Size = new System.Drawing.Size(1000, 114);
this.lblLabelInfo.TabIndex = 17;
this.lblLabelInfo.Text = "打印信息";
//
......@@ -248,11 +276,47 @@
this.notifyIcon1.Visible = true;
this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(83, 170);
this.textBox5.Margin = new System.Windows.Forms.Padding(4);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(211, 25);
this.textBox5.TabIndex = 18;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(11, 174);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(52, 15);
this.label6.TabIndex = 17;
this.label6.Text = "站位:";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(85, 212);
this.textBox6.Margin = new System.Windows.Forms.Padding(4);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(211, 25);
this.textBox6.TabIndex = 20;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(13, 216);
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(52, 15);
this.label7.TabIndex = 19;
this.label7.Text = "点位:";
//
// FrmShelfPrinterMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(750, 484);
this.ClientSize = new System.Drawing.Size(1000, 605);
this.Controls.Add(this.lblLabelInfo);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.checkBox1);
......@@ -262,7 +326,7 @@
this.Controls.Add(this.txtIp);
this.Controls.Add(this.label1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "FrmShelfPrinterMain";
this.Text = "料架打印机";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmShelfPrinterMain_FormClosing);
......@@ -297,6 +361,10 @@
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Label lblLabelInfo;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label6;
}
}
......@@ -81,6 +81,7 @@ namespace ShelfPrinter
text.Add("jt", label_LZ.station);
text.Add("xb", label_LZ.line);
text.Add("sj", label_LZ.shijian);
text.Add("zb", label_LZ.slot);
pictureBox1.Image = print.Print(text);
}
Dictionary<string, string> printview(Label_LZ label_LZ)
......@@ -91,6 +92,7 @@ namespace ShelfPrinter
text.Add("jt", label_LZ.station);
text.Add("xb", label_LZ.line);
text.Add("sj", label_LZ.shijian);
text.Add("zb", label_LZ.slot);
if (pictureBox1.Image != null)
{
pictureBox1.Image.Dispose();
......@@ -116,7 +118,7 @@ namespace ShelfPrinter
private void button2_Click(object sender, EventArgs e)
{
printLabel(new Label_LZ(textBox1.Text, textBox3.Text, textBox4.Text, textBox2.Text));
printLabel(new Label_LZ(textBox1.Text, textBox3.Text, textBox4.Text, textBox2.Text,textBox5.Text,textBox6.Text));
}
object handleObj = new object();
private void timer1_Tick(object sender, EventArgs e)
......
......@@ -11,12 +11,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public class Label_LZ
{
public Label_LZ(string liaohao, string mianbie, string jitai,string line)
public Label_LZ(string liaohao, string mianbie, string jitai, string line, string slot = "slot", string subslot = "subslot")
{
this.pn = $"料 号:{liaohao}";
this.side = $"{mianbie}";
this.line = $"线 别:{line} /{this.side}";
this.station = $"机 台:{jitai}";
this.slot = $"站 别:{slot}{subslot}";
this.shijian = $"时 间:{DateTime.Now.ToString()}";
}
public Label_LZ() { }
......@@ -24,6 +25,14 @@ namespace OnlineStore.DeviceLibrary
public string pn { get; set; } = "";
public string line { get; set; } = "";
/// <summary>
/// 站位
/// </summary>
public string slot { get; set; }
/// <summary>
/// 点位
/// </summary>
public string subslot { get; set; }
/// <summary>
/// 线别
/// </summary>
public string side { get; set; } = "";
......@@ -42,7 +51,21 @@ namespace OnlineStore.DeviceLibrary
public string ToStr()
{
return $"二维码:{barcode},需求单:{hSerial},料号:{pn},机台:{station},面别:{side},线别:{line}";
return $"二维码:{barcode},需求单:{hSerial},料号:{pn},机台:{station},面别:{side},线别:{line},站位:{slot},点位:{subslot}";
}
/// <summary>
/// 拷贝一个新的实例
/// </summary>
/// <returns></returns>
public Label_LZ ToCopy()
{
Label_LZ posInfo = new Label_LZ();
System.Reflection.PropertyInfo[] info1 = posInfo.GetType().GetProperties();
System.Reflection.PropertyInfo[] info2 = this.GetType().GetProperties();
for (int i = 0; i < info1.Length; i++)
info1[i].SetValue(posInfo, info2[i].GetValue(this));
return posInfo;
}
}
}
......@@ -199,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
return null;
}
#region 料架打印机接口
static string Addr_GetPrintInfo = "/service/store/innerBox/rack/getPrintInfo";
static string Addr_GetPrintInfo = ConfigAppSettings.GetValue("Addr_GetPrintInfo", "/service/store/innerBox/rack/getPrintInfo");
public static Label_LZ GetPrintInfo()
{
try
......@@ -237,7 +237,7 @@ namespace OnlineStore.DeviceLibrary
return null;
}
static string Addr_FinishPrint = "/service/store/innerBox/rack/finishPrint";
static string Addr_FinishPrint = ConfigAppSettings.GetValue("Addr_FinishPrint", "/service/store/innerBox/rack/finishPrint");
public static bool FinishPrint()
{
try
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!