Commit 232d4f2f 张东亮

1

1 个父辈 5ad947ef
......@@ -92,6 +92,12 @@
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="FrmLabelEdit.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmLabelEdit.Designer.cs">
<DependentUpon>FrmLabelEdit.cs</DependentUpon>
</Compile>
<Compile Include="IOControl.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -146,6 +152,9 @@
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmLabelEdit.resx">
<DependentUpon>FrmLabelEdit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="IOControl.resx">
<DependentUpon>IOControl.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -57,15 +57,18 @@ namespace AutoScanAndLabel
this.listView1 = new System.Windows.Forms.ListView();
this.btn_stop = new System.Windows.Forms.Button();
this.btn_run = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.menuStrip1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.BackColor = System.Drawing.Color.Transparent;
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.设备操作ToolStripMenuItem,
this.语言toolStripMenuItem,
......@@ -73,7 +76,7 @@ namespace AutoScanAndLabel
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new System.Windows.Forms.Padding(7, 2, 0, 2);
this.menuStrip1.Size = new System.Drawing.Size(1008, 29);
this.menuStrip1.Size = new System.Drawing.Size(1008, 35);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
......@@ -87,37 +90,37 @@ namespace AutoScanAndLabel
this.退出ToolStripMenuItem});
this.设备操作ToolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.设备操作ToolStripMenuItem.Name = "设备操作ToolStripMenuItem";
this.设备操作ToolStripMenuItem.Size = new System.Drawing.Size(86, 25);
this.设备操作ToolStripMenuItem.Size = new System.Drawing.Size(106, 31);
this.设备操作ToolStripMenuItem.Text = "设备操作";
//
// 启用调试模式ToolStripMenuItem
//
this.启用调试模式ToolStripMenuItem.Name = "启用调试模式ToolStripMenuItem";
this.启用调试模式ToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
this.启用调试模式ToolStripMenuItem.Size = new System.Drawing.Size(238, 32);
this.启用调试模式ToolStripMenuItem.Text = "启用配置模式";
this.启用调试模式ToolStripMenuItem.Click += new System.EventHandler(this.启用调试模式ToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(189, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(235, 6);
//
// 二维码识别调试ToolStripMenuItem
//
this.二维码识别调试ToolStripMenuItem.Name = "二维码识别调试ToolStripMenuItem";
this.二维码识别调试ToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
this.二维码识别调试ToolStripMenuItem.Size = new System.Drawing.Size(238, 32);
this.二维码识别调试ToolStripMenuItem.Text = "二维码识别调试";
this.二维码识别调试ToolStripMenuItem.Click += new System.EventHandler(this.二维码识别调试ToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(189, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(235, 6);
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(238, 32);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
//
......@@ -129,13 +132,13 @@ namespace AutoScanAndLabel
this.englishToolStripMenuItem});
this.语言toolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.语言toolStripMenuItem.Name = "语言toolStripMenuItem";
this.语言toolStripMenuItem.Size = new System.Drawing.Size(54, 25);
this.语言toolStripMenuItem.Size = new System.Drawing.Size(66, 31);
this.语言toolStripMenuItem.Text = "语言";
//
// 简体中文ToolStripMenuItem
//
this.简体中文ToolStripMenuItem.Name = "简体中文ToolStripMenuItem";
this.简体中文ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.简体中文ToolStripMenuItem.Size = new System.Drawing.Size(178, 32);
this.简体中文ToolStripMenuItem.Tag = "not";
this.简体中文ToolStripMenuItem.Text = "简体中文";
this.简体中文ToolStripMenuItem.Click += new System.EventHandler(this.简体中文ToolStripMenuItem_Click);
......@@ -143,7 +146,7 @@ namespace AutoScanAndLabel
// 日本语ToolStripMenuItem
//
this.日本语ToolStripMenuItem.Name = "日本语ToolStripMenuItem";
this.日本语ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.日本语ToolStripMenuItem.Size = new System.Drawing.Size(178, 32);
this.日本语ToolStripMenuItem.Tag = "not";
this.日本语ToolStripMenuItem.Text = "日本語";
this.日本语ToolStripMenuItem.Click += new System.EventHandler(this.日本语ToolStripMenuItem_Click);
......@@ -151,7 +154,7 @@ namespace AutoScanAndLabel
// englishToolStripMenuItem
//
this.englishToolStripMenuItem.Name = "englishToolStripMenuItem";
this.englishToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.englishToolStripMenuItem.Size = new System.Drawing.Size(178, 32);
this.englishToolStripMenuItem.Tag = "not";
this.englishToolStripMenuItem.Text = "English";
this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click);
......@@ -160,7 +163,7 @@ namespace AutoScanAndLabel
//
this.关于ToolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.关于ToolStripMenuItem.Name = "关于ToolStripMenuItem";
this.关于ToolStripMenuItem.Size = new System.Drawing.Size(54, 25);
this.关于ToolStripMenuItem.Size = new System.Drawing.Size(66, 31);
this.关于ToolStripMenuItem.Text = "关于";
this.关于ToolStripMenuItem.Click += new System.EventHandler(this.关于ToolStripMenuItem_Click);
//
......@@ -179,6 +182,7 @@ namespace AutoScanAndLabel
//
// tabPage1
//
this.tabPage1.Controls.Add(this.pictureBox1);
this.tabPage1.Controls.Add(this.btn_PauseBuzzer);
this.tabPage1.Controls.Add(this.cb_EnableBuzzer);
this.tabPage1.Controls.Add(this.btn_leftempty);
......@@ -188,9 +192,9 @@ namespace AutoScanAndLabel
this.tabPage1.Controls.Add(this.cb_IgnoreGratingSignal);
this.tabPage1.Controls.Add(this.cb_IgnoreSafecheck);
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Location = new System.Drawing.Point(4, 30);
this.tabPage1.Location = new System.Drawing.Point(4, 36);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(1000, 542);
this.tabPage1.Size = new System.Drawing.Size(1000, 536);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "信息";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -212,7 +216,7 @@ namespace AutoScanAndLabel
this.cb_EnableBuzzer.AutoSize = true;
this.cb_EnableBuzzer.Location = new System.Drawing.Point(653, 42);
this.cb_EnableBuzzer.Name = "cb_EnableBuzzer";
this.cb_EnableBuzzer.Size = new System.Drawing.Size(109, 25);
this.cb_EnableBuzzer.Size = new System.Drawing.Size(134, 31);
this.cb_EnableBuzzer.TabIndex = 5;
this.cb_EnableBuzzer.Text = "使用蜂鸣器";
this.cb_EnableBuzzer.UseVisualStyleBackColor = true;
......@@ -264,7 +268,7 @@ namespace AutoScanAndLabel
this.cb_IgnoreGratingSignal.AutoSize = true;
this.cb_IgnoreGratingSignal.Location = new System.Drawing.Point(653, 104);
this.cb_IgnoreGratingSignal.Name = "cb_IgnoreGratingSignal";
this.cb_IgnoreGratingSignal.Size = new System.Drawing.Size(125, 25);
this.cb_IgnoreGratingSignal.Size = new System.Drawing.Size(154, 31);
this.cb_IgnoreGratingSignal.TabIndex = 2;
this.cb_IgnoreGratingSignal.Text = "忽略安全光栅";
this.cb_IgnoreGratingSignal.UseVisualStyleBackColor = true;
......@@ -275,7 +279,7 @@ namespace AutoScanAndLabel
this.cb_IgnoreSafecheck.AutoSize = true;
this.cb_IgnoreSafecheck.Location = new System.Drawing.Point(653, 73);
this.cb_IgnoreSafecheck.Name = "cb_IgnoreSafecheck";
this.cb_IgnoreSafecheck.Size = new System.Drawing.Size(215, 25);
this.cb_IgnoreSafecheck.Size = new System.Drawing.Size(268, 31);
this.cb_IgnoreSafecheck.TabIndex = 2;
this.cb_IgnoreSafecheck.Text = "忽略安全检查(含安全光栅)";
this.cb_IgnoreSafecheck.UseVisualStyleBackColor = true;
......@@ -284,7 +288,7 @@ namespace AutoScanAndLabel
// groupBox1
//
this.groupBox1.Controls.Add(this.stateView);
this.groupBox1.Location = new System.Drawing.Point(21, 32);
this.groupBox1.Location = new System.Drawing.Point(8, 26);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(611, 225);
this.groupBox1.TabIndex = 1;
......@@ -297,10 +301,10 @@ namespace AutoScanAndLabel
this.stateView.Dock = System.Windows.Forms.DockStyle.Fill;
this.stateView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.stateView.HideSelection = false;
this.stateView.Location = new System.Drawing.Point(3, 25);
this.stateView.Location = new System.Drawing.Point(3, 30);
this.stateView.MultiSelect = false;
this.stateView.Name = "stateView";
this.stateView.Size = new System.Drawing.Size(605, 197);
this.stateView.Size = new System.Drawing.Size(605, 192);
this.stateView.TabIndex = 0;
this.stateView.Tag = "not";
this.stateView.UseCompatibleStateImageBehavior = false;
......@@ -343,9 +347,21 @@ namespace AutoScanAndLabel
this.btn_run.UseVisualStyleBackColor = true;
this.btn_run.Click += new System.EventHandler(this.btn_run_Click);
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(11, 257);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(388, 262);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 7;
this.pictureBox1.TabStop = false;
this.pictureBox1.Visible = false;
this.pictureBox1.DoubleClick += new System.EventHandler(this.pictureBox1_DoubleClick);
this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1008, 689);
......@@ -367,6 +383,7 @@ namespace AutoScanAndLabel
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -401,6 +418,7 @@ namespace AutoScanAndLabel
private System.Windows.Forms.ToolStripMenuItem 简体中文ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 日本语ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem englishToolStripMenuItem;
private System.Windows.Forms.PictureBox pictureBox1;
}
}
......@@ -66,20 +66,6 @@ namespace AutoScanAndLabel
启用调试模式ToolStripMenuItem.Text = !RobotManage.IsDebug ? crc.GetString("Res0101", "启用配置模式") : crc.GetString("Res0012", "停用配置模式");
if (RobotManage.isRunning)
{
if (userpause)
{
btn_run.BackColor = Color.LightGreen;
btn_run.Text = crc.GetString("Res0014", "恢复运行");
}
else
{
btn_run.Text = crc.GetString("Res0013", "暂停运行");
btn_run.BackColor = Color.Yellow;
}
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
......@@ -153,7 +139,52 @@ namespace AutoScanAndLabel
AddForm("Res0007", crc.GetString("Res0007", "日志"), lc);
RobotManage.Init();
RobotManage.UserPauseSet += RobotManage_UserPauseSet;
Common.LabelResult += Common_LabelResult;
OnlineStore.CodeResourceControl.RefreshLanguageEvent += CodeResourceControl_RefreshLanguageEvent;
}
private void CodeResourceControl_RefreshLanguageEvent()
{
if(RobotManage.isRunning)
{
if (userpause)
{
(btn_run as Button).Text = crc.GetString("Res0014", "恢复运行");
}
else
{
(btn_run as Button).Text = crc.GetString("Res0013", "暂停运行");
}
}
}
private void Common_LabelResult(LabelResult args)
{
if (ConfigHelper.Config.Get("ShowLabelResultImg", true))
try
{
if (pictureBox1.InvokeRequired)
{
pictureBox1.Invoke(new Action(() =>
{
pictureBox1.Visible = true;
pictureBox1.Image = args.Bitmap;
}
));
}
else
{
pictureBox1.Visible = true;
pictureBox1.Image = args.Bitmap;
}
}
catch (Exception ex)
{
LogUtil.error("Common_LabelResult", ex);
}
}
private void RobotManage_UserPauseSet(object sender, bool e)
{
if (this.InvokeRequired)
......@@ -262,8 +293,6 @@ namespace AutoScanAndLabel
(sender as ToolStripMenuItem).Text = !RobotManage.IsDebug ? crc.GetString("Res0101", "设备操作") : crc.GetString("Res0012", "停用配置模式");
//RobotManage.Init();
if (RobotManage.IsDebug)
{
RobotManage.Config = (Robot_Config)CSVConfigReader.LoadConfig(RobotManage.Config);
......@@ -284,6 +313,7 @@ namespace AutoScanAndLabel
private void MainMachine_ProcessMsgEvent(List<Msg> msgs)
{
var d = new setmsgdelegate(SetMsg);
if (this.IsHandleCreated)
this.Invoke(d, msgs);
}
......@@ -570,5 +600,24 @@ namespace AutoScanAndLabel
crc.CurrLanguage = Config.Get("Default_Language");
crc.LanguageChange();
}
private void pictureBox1_DoubleClick(object sender, EventArgs e)
{
var obj = sender as PictureBox;
if (obj.Dock == DockStyle.Fill)
obj.Dock = DockStyle.None;
else
{
obj.BringToFront();
obj.Dock = DockStyle.Fill;
}
}
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
var obj = sender as PictureBox;
if (obj.Dock == DockStyle.Fill)
obj.Dock = DockStyle.None;
}
}
}
\ No newline at end of file
namespace PrintLabel
{
partial class FrmLabelEdit
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmLabelEdit));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.btnCalculate = new System.Windows.Forms.Button();
this.btnAcquire = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.lblAngle = new System.Windows.Forms.Label();
this.txtX = new System.Windows.Forms.TextBox();
this.txtY = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.lblCodePos = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtRelativeAngle = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtLabel_R_Angle_Diff = new System.Windows.Forms.TextBox();
this.lblLabelAngle = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(16, 215);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(556, 498);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// pictureBox2
//
this.pictureBox2.Location = new System.Drawing.Point(600, 215);
this.pictureBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(556, 498);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox2.TabIndex = 1;
this.pictureBox2.TabStop = false;
//
// btnCalculate
//
this.btnCalculate.Location = new System.Drawing.Point(520, 8);
this.btnCalculate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnCalculate.Name = "btnCalculate";
this.btnCalculate.Size = new System.Drawing.Size(128, 52);
this.btnCalculate.TabIndex = 3;
this.btnCalculate.Text = "计算贴标位置";
this.btnCalculate.UseVisualStyleBackColor = true;
this.btnCalculate.Click += new System.EventHandler(this.btnCalculate_Click);
//
// btnAcquire
//
this.btnAcquire.Location = new System.Drawing.Point(335, 8);
this.btnAcquire.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAcquire.Name = "btnAcquire";
this.btnAcquire.Size = new System.Drawing.Size(128, 52);
this.btnAcquire.TabIndex = 5;
this.btnAcquire.Text = "相机采集";
this.btnAcquire.UseVisualStyleBackColor = true;
this.btnAcquire.Click += new System.EventHandler(this.btnAcquire_Click);
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(15, 15);
this.comboBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(297, 23);
this.comboBox1.TabIndex = 7;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(15, 719);
this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(1153, 130);
this.textBox1.TabIndex = 8;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(844, 8);
this.textBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(311, 25);
this.textBox2.TabIndex = 9;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(785, 11);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(31, 15);
this.label2.TabIndex = 10;
this.label2.Text = "PN:";
//
// lblAngle
//
this.lblAngle.AutoSize = true;
this.lblAngle.Location = new System.Drawing.Point(729, 130);
this.lblAngle.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblAngle.Name = "lblAngle";
this.lblAngle.Size = new System.Drawing.Size(67, 15);
this.lblAngle.TabIndex = 11;
this.lblAngle.Text = "旋转角度";
//
// txtX
//
this.txtX.Location = new System.Drawing.Point(119, 74);
this.txtX.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtX.Name = "txtX";
this.txtX.Size = new System.Drawing.Size(132, 25);
this.txtX.TabIndex = 12;
this.txtX.Text = "2600";
//
// txtY
//
this.txtY.Location = new System.Drawing.Point(119, 141);
this.txtY.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtY.Name = "txtY";
this.txtY.Size = new System.Drawing.Size(132, 25);
this.txtY.TabIndex = 13;
this.txtY.Text = "1600";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 85);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(90, 15);
this.label1.TabIndex = 14;
this.label1.Text = "料盘中心X:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 152);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(90, 15);
this.label3.TabIndex = 15;
this.label3.Text = "料盘中心Y:";
//
// lblCodePos
//
this.lblCodePos.AutoSize = true;
this.lblCodePos.Location = new System.Drawing.Point(729, 49);
this.lblCodePos.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblCodePos.Name = "lblCodePos";
this.lblCodePos.Size = new System.Drawing.Size(82, 15);
this.lblCodePos.TabIndex = 16;
this.lblCodePos.Text = "二维码角度";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(332, 85);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(142, 15);
this.label4.TabIndex = 18;
this.label4.Text = "相对二维码的角度:";
//
// txtRelativeAngle
//
this.txtRelativeAngle.Location = new System.Drawing.Point(491, 74);
this.txtRelativeAngle.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtRelativeAngle.Name = "txtRelativeAngle";
this.txtRelativeAngle.Size = new System.Drawing.Size(132, 25);
this.txtRelativeAngle.TabIndex = 17;
this.txtRelativeAngle.Text = "150";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(351, 141);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(112, 15);
this.label5.TabIndex = 20;
this.label5.Text = "标签起始角度:";
//
// txtLabel_R_Angle_Diff
//
this.txtLabel_R_Angle_Diff.Location = new System.Drawing.Point(491, 130);
this.txtLabel_R_Angle_Diff.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtLabel_R_Angle_Diff.Name = "txtLabel_R_Angle_Diff";
this.txtLabel_R_Angle_Diff.Size = new System.Drawing.Size(132, 25);
this.txtLabel_R_Angle_Diff.TabIndex = 19;
this.txtLabel_R_Angle_Diff.Text = "190";
//
// lblLabelAngle
//
this.lblLabelAngle.AutoSize = true;
this.lblLabelAngle.Location = new System.Drawing.Point(729, 85);
this.lblLabelAngle.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblLabelAngle.Name = "lblLabelAngle";
this.lblLabelAngle.Size = new System.Drawing.Size(67, 15);
this.lblLabelAngle.TabIndex = 21;
this.lblLabelAngle.Text = "标签角度";
//
// button1
//
this.button1.Location = new System.Drawing.Point(1028, 74);
this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(128, 52);
this.button1.TabIndex = 22;
this.button1.Text = "保存参数";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// FrmLabelEdit
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1171, 852);
this.Controls.Add(this.button1);
this.Controls.Add(this.lblLabelAngle);
this.Controls.Add(this.label5);
this.Controls.Add(this.txtLabel_R_Angle_Diff);
this.Controls.Add(this.label4);
this.Controls.Add(this.txtRelativeAngle);
this.Controls.Add(this.lblCodePos);
this.Controls.Add(this.label3);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtY);
this.Controls.Add(this.txtX);
this.Controls.Add(this.lblAngle);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.btnAcquire);
this.Controls.Add(this.btnCalculate);
this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.pictureBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "FrmLabelEdit";
this.Text = "标签调试";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Button btnCalculate;
private System.Windows.Forms.Button btnAcquire;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label lblAngle;
private System.Windows.Forms.TextBox txtX;
private System.Windows.Forms.TextBox txtY;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lblCodePos;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtRelativeAngle;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtLabel_R_Angle_Diff;
private System.Windows.Forms.Label lblLabelAngle;
private System.Windows.Forms.Button button1;
}
}
\ No newline at end of file
using CodeLibrary;
using DeviceLibrary;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
using JsonHelper = OnlineStore.Common.JsonHelper;
namespace PrintLabel
{
public partial class FrmLabelEdit : Form
{
public FrmLabelEdit()
{
InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
loadCames();
}
void loadCames()
{
comboBox1.Items.AddRange(CodeManager.cameraNameList.ToArray());
if (comboBox1.Items.Count > 0)
comboBox1.SelectedIndex = 0;
}
string filename = "";
List<CodeInfo> codeinfo = null;
Dictionary<string, string> keyword;
private void btnAcquire_Click(object sender, EventArgs e)
{
Task.Factory.StartNew(delegate
{
(codeinfo, keyword, filename)= CodeManager.CameraScan(new List<string>() { comboBox1.SelectedItem.ToString() });
if (string.IsNullOrEmpty(filename)) return;
pictureBox1.Image = new Bitmap(filename);
});
}
LabelParam labelparam = new LabelParam();
private void btnCalculate_Click(object sender, EventArgs e)
{
//if (string.IsNullOrEmpty(filename)) return;
//labelparam.BitmapFilename = filename;
//labelparam.LabelContent = new LabelContent();
//labelparam.LabelContent.codeInfos = codeinfo;
//labelparam.LabelContent.PN = textBox2.Text;
//labelparam.TrayCenterInImg_X = int.Parse(txtX.Text);
//labelparam.TrayCenterInImg_Y = int.Parse(txtY.Text);
//labelparam.LabelInImgAngle = int.Parse(txtLabel_R_Angle_Diff.Text);
//labelparam.RelativeAngle = int.Parse(txtRelativeAngle.Text);
//(string resFile, int codeAngle, int labelAngle, int needRound) res = LabelManager.CalcLabelAngle(labelparam, true);
//lblCodePos.Text = $"二维码角度:{res.codeAngle}°";
//lblAngle.Text = $"旋转角度:{res.needRound}°";
//lblLabelAngle.Text = $"标签角度:{res.labelAngle}°";
//pictureBox2.Image = new Bitmap(res.resFile);
//textBox1.Text = JsonHelper.SerializeObject(codeinfo);
}
private void load(int side = 0)
{
if (side == 0)
{
//txtX.Text = ConfigAppSettings.GetValue(Setting_Init.TrayCenterInImg_X_CamA,"2600");
//txtY.Text = ConfigAppSettings.GetValue(Setting_Init.TrayCenterInImg_Y_CamA,"1700");
//txtLabel_R_Angle_Diff.Text = ConfigAppSettings.GetValue(Setting_Init.LabelInImgAngle_CamA,"190");
//txtRelativeAngle.Text = ConfigAppSettings.GetValue(Setting_Init.RelativeAngle_CamA,"150");
}
}
private void save(int side = 0)
{
//if (side == 0)
//{
// ConfigAppSettings.SaveValue(Setting_Init.TrayCenterInImg_X_CamA, txtX.Text);
// ConfigAppSettings.SaveValue(Setting_Init.TrayCenterInImg_Y_CamA, txtY.Text);
// ConfigAppSettings.SaveValue(Setting_Init.LabelInImgAngle_CamA, txtLabel_R_Angle_Diff.Text);
// ConfigAppSettings.SaveValue(Setting_Init.RelativeAngle_CamA, txtRelativeAngle.Text);
//}
//else if (side == 1)
//{
// ConfigAppSettings.SaveValue(Setting_Init.TrayCenterInImg_X_CamB, txtX.Text);
// ConfigAppSettings.SaveValue(Setting_Init.TrayCenterInImg_Y_CamB, txtY.Text);
// ConfigAppSettings.SaveValue(Setting_Init.LabelInImgAngle_CamB, txtLabel_R_Angle_Diff.Text);
// ConfigAppSettings.SaveValue(Setting_Init.RelativeAngle_CamB, txtRelativeAngle.Text);
//}
//else
// return;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
load(comboBox1.SelectedIndex);
}
private void button1_Click(object sender, EventArgs e)
{
save(comboBox1.SelectedIndex);
}
}
}
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAMDAAAAEAIACoJQAAFgAAACgAAAAwAAAAYAAAAAEAIAAAAAAAACQAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA8XgvAPF4MADxeDAA8XgwAPFxNADxdzAl8XcwgfF3L8/xdy/r8ncv2PF3L57xeDBR8HcvGOhx
KQHvdi4A73YuAO92LgDvdi4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADwdy8A8HgvAPF4LwDxeDAA8ZJ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AAAAAAAAAAAAAAAAAO92
LgDvdi4A73YuAO92LgD3ejIA73YuH/B2LoDxdy/h8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv4fB2LoDvdi4f+HoyAO92LgDvdi4A73YuAO92
LgAAAAAA73YuAO92LgDvdi4A73YuAPd6MgDvdi4f8HYugPF3L+Hxdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L+Hwdi6A73YuH/d6
MgDvdi4A73YuAO92LgDvdi4A73YuAO92LgDvdi4A+HoyAO92Lh/wdi6A8Xcv4fF3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy/h8HYugO92Lh/4ejIA73YuAO92LgDvdi4A73YuAO92LgD3ejIA73YuH/B2LoDxdy/h8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv4fB2LoDvdi4f+HoyAO92LgDvdi4A73YuAPd6MgDvdi4f8HYugPF3
L+Hxdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L+Hwdi6A73YuHth1HgDvdi4A+HoyAO92
Lh/wdi6A8Xcv4fF3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy/h8HYvffB2
Lx3odCwB73YuH/B2LoDxdy/h8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv1vF2L2zxdi4X8HYufPF3L+Hxdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv9PF3L8Xydy9E8XcvzfF3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv+/F3L+zxdy9y8Xcv4/F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv+/F3L+7xdy+U8Xcv6fF3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv9vF3
L8/xdy+f8Xcv6/F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv3fF3MIHxdy+k8Xcv7PF3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy/p8XcwjvF3MCXxdy+q8Xcv7fF3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L+rxdi+V8XYvJ/F9OgDxdy+w8Xcv7/F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv6fF2MJTxdi8o8V8SAPF2LwDxdy618Xcv8PF3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy/p8XYvk/F2MCfxsAAA8XYwAPF2
LwDydy+78Xcv8fF3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdi7/8XYu//F2Lv/xdi7/8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L+jxdi+S8XYvJ/GZ
ZQDxdjAA8XYwAPF2MADxeC/A8Xcv8vF3L//xdy//8Xcv//F3L//xdy//8XYu//F3L//yfjb/8oM7//KC
Ov/yfTX/8Xcv//F2Lv/xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv6PJ3
L5Dxdy8m//8uAPF2LwDxdi8A8XYwAPF2MADxdy/G8Xcv8/F3L//xdy//8Xcv//F3L//xdy//8n41//SR
SP/2r2X/+MN4//jBdv/2rGP/9I9H//J8NP/xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy/n8ncvj/J3LybNYS8A8nYvAPF2LwDxdi8A8XYvAAAAAADwdzDM8Xcv9PF3L//xdy//8Xcv//F3
L//ygTj/9qpf//vajv/976P//fWo//31qP/976L/+9iM//akWv/yfTT/8XYu//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L+fxdzCO8XYwJbtiRADydy8A8ncvAPJ2LwDxdi8AAAAAAAAAAADxdy/S8Xcv9vF3
L//xdy//8XYu//F7M//1o1n//OSY//77rv/+/bD//v2w//79sP/+/bD//vuu//vglP/0mE7/8Xkx//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv5/F3L43xdzAl/8UAAPF2MADydy8A8ncvAPJ3LwAAAAAAAAAAAAAA
AADwdi/X8Xcv9/F3L//xdy//8XUu//KFPP/5yn///vir//79sP/+/K///vyv//78r//+/K///v2w//32
qf/4xHn/8oM6//F2Lv/xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy/o8Xcvj/F3LyXEVDkA8XcwAPF2MADxdjAA8ncvAAAA
AAAAAAAAAAAAAAAAAADxdy7d8Xcv+PF3L//xdy//8XYu//OQR//84pf//v2w//78r//+/K///vyv//78
r//+/K///vyv//77rv/724//84lA//F1Lf/xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L+jxeC6R8HcuJv+nFgDxeC8A8XcvAPF3
MADwdjAAAAAAAAAAAAAAAAAAAAAAAAAAAADxdy/j8Xcv+fF3L//xdy//8Xkx//ScU//865///v6x//78
r//+/K///vyv//78r//+/K///vyv//79sP/845f/84tD//F1Lf/xdy//8Xcv//F3L//xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv6fF3L5Lxdy8myQ2ZAPB4
LgDwdy8A8XgvAPJ4LwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxdy/o8Xcv+vF3L//xdy//8XYu//OQ
R//84pf//v2w//78r//+/K///vyv//78r//+/K///vyv//77rv/724//84lA//F1Lf/xdy//8Xcv//F3
L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy/q8XcvlPF3
LyfxmQ0A8XguAPF4LgDweC4A8HcvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxdy/u8Xcv+/F3
L//xdy//8XYu//KEO//5yH3//vir//79sP/+/K///vyv//78r//+/K///v2w//31qP/4wnf/8oM6//F2
Lv/xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3L//xdy//8Xcv//F3
L+vydi+W8XYvKP8ANgDxdy8A8XcvAPF4LgDxeC4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AADxeC/z8Xcv/fF3L//xdy//8Xcv//F6Mv/1m1L/+96T//75rP/+/bD//v2w//79sP/+/bD//ver//vU
if/0kEf/8Xgw//F3L//xdy//8Xcv//F3L//xdy//8Xcv//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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB
AAAAAAAAAAMAAAAAAAAABwAAAAAAAAAPAAAAAAAAAB8AAAAAAAAAPwAAAAAAAAB/AAAAAAAAAP8AAAAA
AAAB/wAAAAAAAAP/AAAAAAAAB/8AAAAAAAAP/wAAAAAAAB//AAAAAAAAP/8AAAAAAAB//wAAAAAAAP//
AAA=
</value>
</data>
</root>
\ No newline at end of file
......@@ -6,6 +6,7 @@ using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
......@@ -36,6 +37,8 @@ namespace AutoScanAndLabel
public int showCount = 30;
private void ShowLogPro(string msg, Color color)
{
if(Monitor.TryEnter(logBox))
{
try
{
if (logList.Count >= showCount)
......@@ -45,7 +48,7 @@ namespace AutoScanAndLabel
DateTime now = DateTime.Now;
logList.Add(now.ToLongTimeString() + " " + msg + Environment.NewLine);
logBox.Text= string.Join("", logList);
logBox.Text = string.Join("", logList);
logBox.Select(logBox.Text.Length, 0);
logBox.ScrollToCaret();
......@@ -54,6 +57,12 @@ namespace AutoScanAndLabel
{
LogUtil.error("出错:" + ex.ToString());
}
finally
{
Monitor.Exit(logBox);
}
}
}
private void LogControl_Load(object sender, EventArgs e)
......
......@@ -75,7 +75,7 @@ namespace AutoScanAndLabel
private void btn_labeledit_Click(object sender, EventArgs e)
{
var keys = File.ReadAllLines("NeoScan\\config\\MacroKey.txt");
var keys = File.ReadAllLines("NeoScan\\Config\\MacroKey.txt");
//RobotManage.PrintBean.EditLabel();
PrintLabel.FrmLabel frmLabel = new PrintLabel.FrmLabel();
......
......@@ -15,6 +15,8 @@ namespace DeviceLibrary
{
public class Common
{
public delegate void LabelResultEventHandler(LabelResult args);
public static event LabelResultEventHandler LabelResult;
/**获取角度*/
// 求3点形成的夹角
public static float getAngle2(Point pt1, Point pt2, Point pt0)
......@@ -87,7 +89,8 @@ namespace DeviceLibrary
/// <param name="angle">角度</param>
/// <param name="distance">距离</param>
/// <returns></returns>
public static Point PointWithAngle(Point p1, double angle, double distance) {
public static Point PointWithAngle(Point p1, double angle, double distance)
{
var x2 = p1.X + distance * Math.Cos(angle / 180 * Math.PI);
var y2 = p1.Y + distance * Math.Sin(angle / 180 * Math.PI);
return new Point((int)x2, (int)y2);
......@@ -100,12 +103,15 @@ namespace DeviceLibrary
/// <param name="Label_R_Offset">贴标臂偏移</param>
/// <param name="labelAngle">贴标角度</param>
/// <returns></returns>
public static Point CalcLabelPoint(LabelParam labelParam, Point org,int Label_R_Offset, int Label_R_Angle_Diff, out int labelAngle) {
SolidBrush blue = new SolidBrush(Color.BlueViolet);
public static Point CalcLabelPoint(LabelParam labelParam, Point org, int Label_R_Offset, int Label_R_Angle_Diff, out int labelAngle)
{
//标签位置
SolidBrush blue = new SolidBrush(Color.DarkBlue);
//料盘中心点
SolidBrush red = new SolidBrush(Color.Red);
SolidBrush tmpPlace = new SolidBrush(Color.BlueViolet);
//贴标位置
SolidBrush yeelow = new SolidBrush(Color.Yellow);
SolidBrush AliceBlue = new SolidBrush(Color.AliceBlue);
Font font = new Font(FontFamily.GenericSansSerif, 60);
Pen Greenpen = new Pen(Color.Green, 10);
......@@ -114,7 +120,8 @@ namespace DeviceLibrary
{
srcbitmap = new Bitmap(labelParam.bitmapfilename);
}
else {
else
{
srcbitmap = new Bitmap(3648, 3648);
}
......@@ -126,30 +133,23 @@ namespace DeviceLibrary
int srcbitmap_Width = srcbitmap.Width;
srcbitmap.Dispose();
//bitmap.RotateFlip(RotateFlipType.Rotate270FlipNone);//格力
//bitmap.RotateFlip(RotateFlipType.Rotate180FlipNone);
Size pointsize = new Size(30, 30);
Size pointsize = new Size(60, 60);
int widthOffset = 0;
//Point Right_Batch_Point = new Point(RobotManage.Config.Right_Batch_X, RobotManage.Config.Right_Batch_Y);
Point Right_Batch_Point = org;
g.FillEllipse(blue, new Rectangle(Right_Batch_Point, pointsize));
g.FillEllipse(red, new Rectangle(Right_Batch_Point, pointsize));
List<int> angles = new List<int>();
labelParam.codeInfos.ForEach((c) => {
//var x = c.Y;
//var y = srcbitmap_Width - c.X;
//c.X = x;
//c.Y = y;
List<int> widthOffsets = new List<int>();
labelParam.codeInfos.ForEach((c) =>
{
if (true)
{
Point op = new Point(c.X, c.Y);
g.FillEllipse(blue, new Rectangle(op, pointsize));
var a = (int)getAngle(Right_Batch_Point, op);
a = a < 0 ? 360 + a : a;
//g.FillEllipse(red, new Rectangle(PointRotate(org, op, a), pointsize));
angles.Add(a);
widthOffset = (int)Common.distance(org, op);
widthOffsets.Add(widthOffset);
LogUtil.info($"angles:{a}, widthOffset:{widthOffset}");
}
......@@ -163,20 +163,23 @@ namespace DeviceLibrary
if (labelParam.PlateW == 15)
{
labelAngle = angles[0] + 120;
}else if (labelParam.PlateW == 13)
}
else if (labelParam.PlateW == 13)
{
labelAngle = angles[0] + 180;
}
else
{
//labelAngle = bigangles + biglen / 2;
labelAngle = angles[0]+180;
labelAngle = angles[0] + 180;
}
labelAngle = labelAngle > 360 ? labelAngle- 360 : labelAngle;
labelAngle = labelAngle > 360 ? labelAngle- 360 : labelAngle;
widthOffset = widthOffsets.Max();
LogUtil.info($"use widthOffset:{widthOffset}");
labelAngle = labelAngle > 360 ? labelAngle - 360 : labelAngle;
labelAngle = labelAngle > 360 ? labelAngle - 360 : labelAngle;
LogUtil.info($"labelAngle1:{labelAngle}");
var p1 = PointWithAngle(org, labelAngle, widthOffset);
g.FillEllipse(tmpPlace, new Rectangle(p1, pointsize));
//匹配照片角度与贴标旋转轴的角度差
labelAngle += 83;
LogUtil.info($"labelAngle2:{labelAngle}");
......@@ -187,7 +190,7 @@ namespace DeviceLibrary
//贴标偏移
var p3 = PointWithAngle(p2, labelAngle, Label_R_Offset);
labelAngle -= 83;
labelAngle = labelAngle > 360 ? labelAngle - 360 : labelAngle;
labelAngle = 360 - labelAngle;
LogUtil.info($"labelAngle4:{labelAngle}");
......@@ -195,13 +198,15 @@ namespace DeviceLibrary
labelAngle += Label_R_Angle_Diff;
labelAngle = labelAngle > 360 ? labelAngle - 360 : labelAngle;
LogUtil.info($"labelAngle5:{labelAngle}");
g.FillEllipse(red, new Rectangle(p3, pointsize));
g.FillEllipse(yeelow, new Rectangle(p3, pointsize));
g.Save();
g.Dispose();
string dir = "/image/labeldebug/";
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
bitmap.Save(dir+DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") +".jpg",ImageFormat.Jpeg);
string filepath = dir + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + ".jpg";
bitmap.Save(filepath, ImageFormat.Jpeg);
LabelResult?.Invoke(new LabelResult() { Bitmap = (Bitmap)bitmap.Clone() });
bitmap.Dispose();
return p3;
......@@ -209,11 +214,13 @@ namespace DeviceLibrary
static IdWorker id = new IdWorker(1, 1);
static string[] pnreglist;
static string[] qtyreglist;
public static void LoadMatchList() {
public static void LoadMatchList()
{
pnreglist = File.ReadAllLines("config\\pn.list").ToList().FindAll((s) => { return !string.IsNullOrWhiteSpace(s); }).ToArray();
qtyreglist = File.ReadAllLines("config\\qty.list").ToList().FindAll((s) => { return !string.IsNullOrWhiteSpace(s); }).ToArray();
}
public static bool codeProcess(LabelParam labelParam,out string debugmsg) {
public static bool codeProcess(LabelParam labelParam, out string debugmsg)
{
debugmsg = "";
return labelParam.codeInfos.Count > 0;
if (pnreglist == null)
......@@ -232,7 +239,8 @@ namespace DeviceLibrary
foreach (var qtyreg in pnreglist)
{
var partrules = qtyreg.Split('%');
if (partrules.Length == 2) {
if (partrules.Length == 2)
{
if (ci.CodeType != partrules[1])
break;
}
......@@ -286,7 +294,7 @@ namespace DeviceLibrary
//labelParam.codeInfos = newcodeInfos;
labelParam.FC = "985022";
labelParam.RI = "AL"+DateTime.Now.ToString("yyMMddHHmmssf");
labelParam.RI = "AL" + DateTime.Now.ToString("yyMMddHHmmssf");
labelParam.Batch = DateTime.Now.ToString("MMdd");
labelParam.WareCode = labelParam.RI;
LogUtil.info($"匹配成功:{labelParam.PN},{labelParam.QTY},{labelParam.RI}");
......@@ -306,6 +314,11 @@ namespace DeviceLibrary
return dstobject;
}
}
public class LabelResult : EventArgs
{
public string ImgPath { get; set; }
public Bitmap Bitmap { get; set; }
}
public class Msg
{
public static List<Msg> msg = new List<Msg>();
......@@ -313,8 +326,10 @@ namespace DeviceLibrary
public MsgLevel msgLevel;
public DateTime datetime;
public static List<Msg> get() {
if (_setlogones) {
public static List<Msg> get()
{
if (_setlogones)
{
_setlogones = false;
foreach (var m in msg)
LogUtil.info(m.msgtxt);
......@@ -324,7 +339,7 @@ namespace DeviceLibrary
}
public static void add(string m, MsgLevel ml)
{
msg.Add(new Msg { msgtxt = m, msgLevel = ml, datetime=DateTime.Now });
msg.Add(new Msg { msgtxt = m, msgLevel = ml, datetime = DateTime.Now });
}
static bool _setlogones = false;
internal static void setlogones()
......@@ -337,7 +352,8 @@ namespace DeviceLibrary
msg.Clear();
}
}
public enum MsgLevel {
public enum MsgLevel
{
warning,
info
......
......@@ -118,10 +118,12 @@ namespace DeviceLibrary
//计算像素点位与中心点的差
Label_p3 = new Point(p.X - Right_Batch_Point.X, p.Y - Right_Batch_Point.Y);
//计算像素*脉冲像素比得到脉冲值+中心点基准脉冲
Label_p3.X = (int)(Label_p3.X * Config.Cam_Pixel_X_Ratio) + Config.Label_X_P3;
Label_p3.Y = (int)(Label_p3.Y * Config.Cam_Pixel_Y_Ratio) + Config.Label_Y_P3;
int xDiff = (int)(Label_p3.X * Config.Cam_Pixel_X_Ratio);
int yDiff = (int)(Label_p3.Y * Config.Cam_Pixel_Y_Ratio);
Label_p3.X = xDiff + Config.Label_X_P3;
Label_p3.Y = yDiff + Config.Label_Y_P3;
LabelMoveInfo.log($"计算贴标像素点位为{p},轴点位为{Label_p3},角度{labelAngle},R轴{labelAxisPos},盘宽{LabelMoveInfo.MoveParam.PlateW}");
LabelMoveInfo.log($"计算贴标像素点位为{p},轴点位为{Label_p3},X脉冲差值={xDiff},Y脉冲差值={yDiff},角度{labelAngle},R轴{labelAxisPos},盘宽{LabelMoveInfo.MoveParam.PlateW}");
LabelMoveInfo.NextMoveStep(MoveStep.Lbl10_1);
Label_X_Axis.AbsMove(LabelMoveInfo, Config.Label_X_P1, Config.Label_X_P1_speed);
Label_R_Axis.AbsMove(LabelMoveInfo, labelAxisPos, Config.Label_R_P2_speed);
......
......@@ -240,26 +240,27 @@ namespace DeviceLibrary
ResetMoveInfo.log("正在回原");
SafeReleaseLeftShelf = false;
Label_Z_Axis.HomeMove(ResetMoveInfo);
Left_Batch_Axis.HomeMove(ResetMoveInfo);
Right_Batch_Axis.HomeMove(ResetMoveInfo);
clampTool.HomeReset();
break;
case MoveStep.H02_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
ResetMoveInfo.log("正在回原");
Label_Z_Axis.AbsMove(ResetMoveInfo, Config.Label_Z_P1, Config.Label_Z_P1_speed);
Left_Batch_Axis.HomeMove(ResetMoveInfo);
Right_Batch_Axis.HomeMove(ResetMoveInfo);
Label_R_Axis.HomeMove(ResetMoveInfo);
Label_X_Axis.HomeMove(ResetMoveInfo);
Label_Y_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H03_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
ResetMoveInfo.log("正在回原");
Label_X_Axis.HomeMove(ResetMoveInfo);
Label_Y_Axis.HomeMove(ResetMoveInfo);
Label_Z_Axis.AbsMove(ResetMoveInfo, Config.Label_Z_P1, Config.Label_Z_P1_speed);
Label_R_Axis.AbsMove(ResetMoveInfo, Config.Label_R_P1, Config.Label_R_P1_speed);
break;
case MoveStep.H04_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
ResetMoveInfo.log("正在回原");
Label_R_Axis.AbsMove(ResetMoveInfo, Config.Label_R_P1, Config.Label_R_P1_speed);
Take_UpDown_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break;
......@@ -268,20 +269,19 @@ namespace DeviceLibrary
Take_Middle_Axis.HomeMove(ResetMoveInfo);
Label_X_Axis.AbsMove(ResetMoveInfo, Config.Label_X_P1, Config.Label_X_P1_speed);
Label_Y_Axis.AbsMove(ResetMoveInfo, Config.Label_Y_P1, Config.Label_Y_P1_speed);
Right_Batch_Axis.AbsMove(ResetMoveInfo, Config.Right_Batch_P1, Config.Right_Batch_P1_speed);
Left_Batch_Axis.AbsMove(ResetMoveInfo, Config.Left_Batch_P1, Config.Left_Batch_P1_speed);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H06_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
ResetMoveInfo.log("正在回原");
Take_UpDown_Axis.AbsMove(ResetMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed);
Right_Batch_Axis.AbsMove(ResetMoveInfo, Config.Right_Batch_P1, Config.Right_Batch_P1_speed);
Left_Batch_Axis.AbsMove(ResetMoveInfo, Config.Left_Batch_P1, Config.Left_Batch_P1_speed);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break;
case MoveStep.H07_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset);
Take_Middle_Axis.AbsMove(ResetMoveInfo, Config.Take_Middle_P1, Config.Take_Middle_P1_speed);
ResetMoveInfo.log("正在回原 进出料口滚筒正转10秒");
ResetMoveInfo.log("正在回原 进出料口滚筒正转5秒");
IOMove(IO_Type.LeftMoto_Reverse, IO_VALUE.LOW);
IOMove(IO_Type.RightMoto_Reverse, IO_VALUE.LOW);
IOMove(IO_Type.LeftMoto_Run, IO_VALUE.HIGH);
......
......@@ -109,13 +109,12 @@ namespace DeviceLibrary
mainMachine?.ServerCM?.StopConnectServer();
mainMachine?.Stop();
mainMachine.UserPause = false;
//IOManager.CloseAllConnection();
//electricGripper.ClosePort();
isRunning = false;
}
public static void ShutDown()
{
LogUtil.info("开始关闭系统.");
IOManager.CloseAllDO();
IOManager.CloseAllConnection();
clampTool.Close();
}
......
......@@ -36,7 +36,10 @@ namespace DeviceLibrary
electricGripper.ClosePort();
return true;
}
return true;
else
{
return SuckerRelease();
}
}
public void HomeReset()
{
......@@ -44,6 +47,10 @@ namespace DeviceLibrary
{
electricGripper.HomeReset();
}
else
{
SuckerRelease();
}
}
/// <summary>
/// 释放
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!