Commit 55647fbd 贾鹏旭

1

1 个父辈 c39c8e47
正在显示 62 个修改的文件 包含 925 行增加648 行删除
......@@ -50,8 +50,8 @@ namespace AutoScanAndLabel
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel.Location = new System.Drawing.Point(12, 10);
this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel.Location = new System.Drawing.Point(14, 12);
this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tableLayoutPanel.Name = "tableLayoutPanel";
this.tableLayoutPanel.RowCount = 6;
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
......@@ -60,17 +60,17 @@ namespace AutoScanAndLabel
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.Size = new System.Drawing.Size(556, 306);
this.tableLayoutPanel.Size = new System.Drawing.Size(624, 367);
this.tableLayoutPanel.TabIndex = 0;
//
// labelProductName
//
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProductName.Location = new System.Drawing.Point(80, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 20);
this.labelProductName.Location = new System.Drawing.Point(90, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(9, 0, 4, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 24);
this.labelProductName.Name = "labelProductName";
this.labelProductName.Size = new System.Drawing.Size(472, 20);
this.labelProductName.Size = new System.Drawing.Size(530, 24);
this.labelProductName.TabIndex = 19;
this.labelProductName.Text = "产品名称";
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -78,11 +78,11 @@ namespace AutoScanAndLabel
// labelVersion
//
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.Location = new System.Drawing.Point(80, 30);
this.labelVersion.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 20);
this.labelVersion.Location = new System.Drawing.Point(90, 36);
this.labelVersion.Margin = new System.Windows.Forms.Padding(9, 0, 4, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 24);
this.labelVersion.Name = "labelVersion";
this.labelVersion.Size = new System.Drawing.Size(472, 20);
this.labelVersion.Size = new System.Drawing.Size(530, 24);
this.labelVersion.TabIndex = 0;
this.labelVersion.Tag = "not";
this.labelVersion.Text = "版本";
......@@ -92,11 +92,11 @@ namespace AutoScanAndLabel
// labelCopyright
//
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCopyright.Location = new System.Drawing.Point(80, 60);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 20);
this.labelCopyright.Location = new System.Drawing.Point(90, 72);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(9, 0, 4, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 24);
this.labelCopyright.Name = "labelCopyright";
this.labelCopyright.Size = new System.Drawing.Size(472, 20);
this.labelCopyright.Size = new System.Drawing.Size(530, 24);
this.labelCopyright.TabIndex = 21;
this.labelCopyright.Text = "版权";
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -104,11 +104,11 @@ namespace AutoScanAndLabel
// labelCompanyName
//
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCompanyName.Location = new System.Drawing.Point(80, 90);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 20);
this.labelCompanyName.Location = new System.Drawing.Point(90, 108);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(9, 0, 4, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 24);
this.labelCompanyName.Name = "labelCompanyName";
this.labelCompanyName.Size = new System.Drawing.Size(472, 20);
this.labelCompanyName.Size = new System.Drawing.Size(530, 24);
this.labelCompanyName.TabIndex = 22;
this.labelCompanyName.Text = "公司名称";
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -116,13 +116,13 @@ namespace AutoScanAndLabel
// textBoxDescription
//
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxDescription.Location = new System.Drawing.Point(80, 124);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4);
this.textBoxDescription.Location = new System.Drawing.Point(90, 149);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(9, 5, 4, 5);
this.textBoxDescription.Multiline = true;
this.textBoxDescription.Name = "textBoxDescription";
this.textBoxDescription.ReadOnly = true;
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxDescription.Size = new System.Drawing.Size(472, 145);
this.textBoxDescription.Size = new System.Drawing.Size(530, 173);
this.textBoxDescription.TabIndex = 23;
this.textBoxDescription.TabStop = false;
this.textBoxDescription.Text = "说明";
......@@ -131,10 +131,10 @@ namespace AutoScanAndLabel
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(452, 277);
this.okButton.Margin = new System.Windows.Forms.Padding(4);
this.okButton.Location = new System.Drawing.Point(508, 332);
this.okButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(100, 25);
this.okButton.Size = new System.Drawing.Size(112, 30);
this.okButton.TabIndex = 24;
this.okButton.Text = "确定(&O)";
this.okButton.Click += new System.EventHandler(this.okButton_Click);
......@@ -142,16 +142,16 @@ namespace AutoScanAndLabel
// AboutBox1
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(580, 326);
this.ClientSize = new System.Drawing.Size(652, 391);
this.Controls.Add(this.tableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(4);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutBox1";
this.Padding = new System.Windows.Forms.Padding(12, 10, 12, 10);
this.Padding = new System.Windows.Forms.Padding(14, 12, 14, 12);
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
......
......@@ -63,7 +63,7 @@ namespace AutoScanAndLabel
{
int days = Convert.ToInt32(strArray[2]);
int seconds = Convert.ToInt32(strArray[3]);
DateTime d1 = DateTime.Parse("2023-11-10");
DateTime d1 = DateTime.Parse("2024-01-25");
var newData = d1.AddDays(days);
newData = newData.AddSeconds(seconds * 2);
updatetime = $"{crc.GetString("Res0220", "最后更新时间:")}" + newData.ToString("yyyy-MM-dd HH:mm:ss");
......
......@@ -15,7 +15,7 @@
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/AutoScanAndLabel.log"/>
<file value="logs/NS200.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
......
......@@ -41,19 +41,29 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.PrintLabel">
<HintPath>..\dll\Asa.PrintLabel.dll</HintPath>
<Reference Include="Asa.PrintLabel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\PrinLable-2\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\dll\CodeLibrary.dll</HintPath>
<Reference Include="CodeLibrary, Version=1.0.8734.29351, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\CameraLibraryProject\CameraLibraryProject\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper">
<HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="DeviceLibrary, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DeviceLibrary\bin\Debug\DeviceLibrary.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="MvCameraControl.Net">
<HintPath>..\..\..\CameraLibraryProject\CameraLibraryProject\CodeLibraryProject\编译好的DLL\MvCameraControl.Net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
<Reference Include="RmaxisV2, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\RmaxisV2\bin\Debug\RmaxisV2.dll</HintPath>
......@@ -98,12 +108,6 @@
<Compile Include="FrmLabelEdit.Designer.cs">
<DependentUpon>FrmLabelEdit.cs</DependentUpon>
</Compile>
<Compile Include="Homepage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Homepage.Designer.cs">
<DependentUpon>Homepage.cs</DependentUpon>
</Compile>
<Compile Include="IOControl.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -161,9 +165,6 @@
<EmbeddedResource Include="FrmLabelEdit.resx">
<DependentUpon>FrmLabelEdit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Homepage.resx">
<DependentUpon>Homepage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="IOControl.resx">
<DependentUpon>IOControl.cs</DependentUpon>
</EmbeddedResource>
......@@ -225,10 +226,6 @@
<Project>{43cdd09e-fcf3-4960-a01d-3bbfe9933122}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\DeviceLibrary\DeviceLibrary.csproj">
<Project>{bb23296c-aa1d-45c6-9fa6-5a37b2abfe9b}</Project>
<Name>DeviceLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\DL.StandardRobots\DL.StandardRobots.csproj">
<Project>{F85A7412-B5B3-4291-A448-A10564602E1A}</Project>
<Name>DL.StandardRobots</Name>
......
......@@ -42,25 +42,25 @@ namespace AutoScanAndLabel
this.关于ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.退出ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.cb_IgnoreSafecheck = new System.Windows.Forms.CheckBox();
this.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.btn_leftempty = new System.Windows.Forms.Button();
this.btn_maulstart = new System.Windows.Forms.Button();
this.btn_releaserightshelf = new System.Windows.Forms.Button();
this.btn_releaseleftshelf = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.stateView = new System.Windows.Forms.ListView();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.btn_stop = new System.Windows.Forms.Button();
this.btn_run = new System.Windows.Forms.Button();
this.listView1 = new System.Windows.Forms.ListView();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.panel1 = new System.Windows.Forms.Panel();
this.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.cb_IgnoreSafecheck = new System.Windows.Forms.CheckBox();
this.menuStrip1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.tabControl1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
......@@ -114,6 +114,7 @@ namespace AutoScanAndLabel
this.条码规则ToolStripMenuItem.Name = "条码规则ToolStripMenuItem";
this.条码规则ToolStripMenuItem.Size = new System.Drawing.Size(106, 31);
this.条码规则ToolStripMenuItem.Text = "条码规则";
this.条码规则ToolStripMenuItem.Click += new System.EventHandler(this.条码规则ToolStripMenuItem_Click);
//
// 语言toolStripMenuItem
//
......@@ -183,17 +184,28 @@ namespace AutoScanAndLabel
this.tabPage1.Text = "信息";
this.tabPage1.UseVisualStyleBackColor = true;
//
// pictureBox1
// cb_IgnoreSafecheck
//
this.pictureBox1.Location = new System.Drawing.Point(600, 26);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(388, 278);
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);
this.cb_IgnoreSafecheck.AutoSize = true;
this.cb_IgnoreSafecheck.Location = new System.Drawing.Point(8, 310);
this.cb_IgnoreSafecheck.Name = "cb_IgnoreSafecheck";
this.cb_IgnoreSafecheck.Size = new System.Drawing.Size(268, 31);
this.cb_IgnoreSafecheck.TabIndex = 8;
this.cb_IgnoreSafecheck.Text = "忽略安全检查(含安全光栅)";
this.cb_IgnoreSafecheck.UseVisualStyleBackColor = true;
this.cb_IgnoreSafecheck.CheckedChanged += new System.EventHandler(this.cb_IgnoreSafecheck_CheckedChanged);
//
// btn_PauseBuzzer
//
this.btn_PauseBuzzer.BackColor = System.Drawing.Color.OrangeRed;
this.btn_PauseBuzzer.Location = new System.Drawing.Point(277, 307);
this.btn_PauseBuzzer.Name = "btn_PauseBuzzer";
this.btn_PauseBuzzer.Size = new System.Drawing.Size(201, 40);
this.btn_PauseBuzzer.TabIndex = 6;
this.btn_PauseBuzzer.Text = "本次暂停警报器响声";
this.btn_PauseBuzzer.UseVisualStyleBackColor = false;
this.btn_PauseBuzzer.Visible = false;
this.btn_PauseBuzzer.Click += new System.EventHandler(this.btn_PauseBuzzer_Click);
//
// btn_leftempty
//
......@@ -201,7 +213,7 @@ namespace AutoScanAndLabel
this.btn_leftempty.Name = "btn_leftempty";
this.btn_leftempty.Size = new System.Drawing.Size(200, 65);
this.btn_leftempty.TabIndex = 3;
this.btn_leftempty.Text = "左侧手动清空";
this.btn_leftempty.Text = "左侧手动上料";
this.btn_leftempty.UseVisualStyleBackColor = true;
this.btn_leftempty.Click += new System.EventHandler(this.btn_leftempty_Click);
//
......@@ -228,7 +240,7 @@ namespace AutoScanAndLabel
// btn_releaseleftshelf
//
this.btn_releaseleftshelf.BackColor = System.Drawing.Color.Transparent;
this.btn_releaseleftshelf.Location = new System.Drawing.Point(12, 350);
this.btn_releaseleftshelf.Location = new System.Drawing.Point(8, 350);
this.btn_releaseleftshelf.Name = "btn_releaseleftshelf";
this.btn_releaseleftshelf.Size = new System.Drawing.Size(200, 65);
this.btn_releaseleftshelf.TabIndex = 3;
......@@ -260,6 +272,18 @@ namespace AutoScanAndLabel
this.stateView.Tag = "not";
this.stateView.UseCompatibleStateImageBehavior = false;
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(600, 26);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(388, 278);
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);
//
// tabControl1
//
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
......@@ -308,7 +332,6 @@ namespace AutoScanAndLabel
this.listView1.TabIndex = 2;
this.listView1.Tag = "not";
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// groupBox2
//
......@@ -327,28 +350,6 @@ namespace AutoScanAndLabel
this.panel1.Size = new System.Drawing.Size(1029, 619);
this.panel1.TabIndex = 6;
//
// btn_PauseBuzzer
//
this.btn_PauseBuzzer.BackColor = System.Drawing.Color.OrangeRed;
this.btn_PauseBuzzer.Location = new System.Drawing.Point(277, 307);
this.btn_PauseBuzzer.Name = "btn_PauseBuzzer";
this.btn_PauseBuzzer.Size = new System.Drawing.Size(201, 40);
this.btn_PauseBuzzer.TabIndex = 6;
this.btn_PauseBuzzer.Text = "本次暂停警报器响声";
this.btn_PauseBuzzer.UseVisualStyleBackColor = false;
this.btn_PauseBuzzer.Visible = false;
this.btn_PauseBuzzer.Click += new System.EventHandler(this.btn_PauseBuzzer_Click);
//
// cb_IgnoreSafecheck
//
this.cb_IgnoreSafecheck.AutoSize = true;
this.cb_IgnoreSafecheck.Location = new System.Drawing.Point(3, 310);
this.cb_IgnoreSafecheck.Name = "cb_IgnoreSafecheck";
this.cb_IgnoreSafecheck.Size = new System.Drawing.Size(268, 31);
this.cb_IgnoreSafecheck.TabIndex = 8;
this.cb_IgnoreSafecheck.Text = "忽略安全检查(含安全光栅)";
this.cb_IgnoreSafecheck.UseVisualStyleBackColor = true;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F);
......@@ -372,8 +373,8 @@ namespace AutoScanAndLabel
this.menuStrip1.PerformLayout();
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.tabControl1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
......
......@@ -11,6 +11,13 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using AutoScanAndLabel.UC;
using OnlineStore.LoadCSVLibrary;
using System.Diagnostics;
using System.IO;
using System.ComponentModel;
using static RemoteDecodeHelper_mod;
using Newtonsoft.Json;
using System.Drawing.Imaging;
using PrintLabel;
namespace AutoScanAndLabel
{
......@@ -18,6 +25,7 @@ namespace AutoScanAndLabel
{
public Form1()
{
LogUtil.info("开始加载From1");
crc.OpenResourceLog = true;
InitializeComponent();
this.FormClosing += Form1_FormClosing;
......@@ -30,6 +38,7 @@ namespace AutoScanAndLabel
t1.Start();
GC.KeepAlive(t1);
this.Shown += Form1_Shown;
//设计时panel1是在顶层的,所以加载时需要放置底层,否则groupBox2切换显示时会有问题;
panel1.SendToBack();
}
private void SetControlBackColor(Control control, Color color)
......@@ -364,7 +373,7 @@ namespace AutoScanAndLabel
private void btn_run_Click(object sender, EventArgs e)
{
if (!RobotManage.isRunning)
{
{
RobotManage.Start();
userpause = false;
if (RobotManage.isRunning)
......@@ -440,7 +449,7 @@ namespace AutoScanAndLabel
CodeLibrary.CodeResourceControl.GetLanguageEvent += Crc_GetLanguageEvent;
CodeLibrary.FrmCodeDecode frm = new CodeLibrary.FrmCodeDecode();
frm.CurrLanguage = Crc_GetLanguageEvent();
frm.chbZxing.Checked = false;
//frm.chbZxing.Checked = false;
try
{
frm.ShowDialog();
......@@ -632,16 +641,16 @@ namespace AutoScanAndLabel
obj.Dock = DockStyle.None;
}
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
#region 新按钮功能
private void aGVToolStripMenuItem_Click(object sender, EventArgs e)
{
//AgvControl agv = new AgvControl();
crc.LanguageProcess(agv);
panel1.BringToFront();
panel1.Controls.Clear();
//crc.GetString("Res0070", "Agv调试");
panel1.Controls.Add(agv);
}
private void 相机条码ToolStripMenuItem_Click(object sender, EventArgs e)
......@@ -650,7 +659,7 @@ namespace AutoScanAndLabel
CodeLibrary.CodeResourceControl.GetLanguageEvent += Crc_GetLanguageEvent;
CodeLibrary.FrmCodeDecode frm = new CodeLibrary.FrmCodeDecode();
frm.CurrLanguage = Crc_GetLanguageEvent();
frm.chbZxing.Checked = false;
//frm.chbZxing.Checked = false;
//设置子窗口不显示为顶级窗口
frm.TopLevel = false;
//设置子窗口的样式,没有上面的标题栏
......@@ -700,13 +709,74 @@ namespace AutoScanAndLabel
RobotManage.Stop();
RobotManage.ShutDown();
Thread.Sleep(2000);
Application.Exit();
KillProcess("Neo Scan");
try
{
Application.Exit();
}
catch (Exception)
{
Environment.Exit(0);
}
}
}
private void cb_EnableBuzzer_CheckedChanged(object sender, EventArgs e)
private void 条码规则ToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
Process proes = new Process();
LogUtil.info("客户点击条码规则,打开Neo Scan;");
var f = ConfigHelper.Config.Get("Display_GetDataAppPath");
string path = Path.Combine(Application.StartupPath,f);
if (!File.Exists(path))
{
LogUtil.error("未找到服务文件!");
return;
}
proes.StartInfo = new ProcessStartInfo
{
FileName = path,
//WorkingDirectory = System.IO.Path.Combine(Application.StartupPath, "\\NeoScan"),
Verb = "runas" // 这里设置为 "runas" 表示以管理员身份运行
};
proes.StartInfo.UseShellExecute = false;
proes.Start();
}
catch (Exception ex)
{
LogUtil.error("启动服务失败:"+ex);
}
}
/// <summary>
/// 退出时关闭ns100exe
/// </summary>
/// <param name="processName"></param>
public static void KillProcess(string processName)
{
try
{
Process[] processes = Process.GetProcessesByName(processName);
if (processes.Length<=0)
{
return;
}
foreach (Process process in processes)
{
process.Kill();
process.WaitForExit(); // 可以加上超时参数
}
}
catch (Win32Exception e)
{
}
catch (InvalidOperationException e)
{
}
}
#endregion
}
}
\ No newline at end of file
......@@ -27,11 +27,13 @@ namespace PrintLabel
string filename = "";
List<CodeInfo> codeinfo = null;
Dictionary<string, string> keyword;
bool[] amatch = null;
Dictionary<string, int> newpointanlge;
private void btnAcquire_Click(object sender, EventArgs e)
{
Task.Factory.StartNew(delegate
{
(codeinfo, keyword, filename)= CodeManager.CameraScan(new List<string>() { comboBox1.SelectedItem.ToString() });
(codeinfo, keyword, filename, newpointanlge) = CodeManager.CameraScan(new List<string>() { comboBox1.SelectedItem.ToString() },7);
if (string.IsNullOrEmpty(filename)) return;
pictureBox1.Image = new Bitmap(filename);
});
......
<?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>
</root>
\ No newline at end of file
......@@ -72,7 +72,8 @@ namespace AutoScanAndLabel
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + crc.GetString(ioValue.ProName, ioValue.Explain), ioValue.ProName);
control.Dock= DockStyle.Top;
control.Width = 20;
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
DIControlList.Add(ioValue.ProName, control);
......@@ -90,7 +91,9 @@ namespace AutoScanAndLabel
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + crc.GetString(ioValue.ProName, ioValue.Explain), ioValue.ProName);
control.Click += Control_Click;
control.Dock = DockStyle.Top;
this.tableLayoutPanel2.Controls.Add(control, 0, roleindex);
//this.tableLayoutPanel2.Controls.d
roleindex++;
DOControlList.Add(ioValue.ProName, control);
}
......
......@@ -19,7 +19,7 @@ namespace AutoScanAndLabel
CheckForIllegalCrossThreadCalls = false;
InitializeComponent();
showLogProDelegate = new ShowLogProDelegate(ShowLogPro);
LogUtil.ShowLog += LogUtil_ShowLog;
//LogUtil.ShowLog += LogUtil_ShowLog;
}
delegate void ShowLogProDelegate(string msg, Color color);
......@@ -30,7 +30,6 @@ namespace AutoScanAndLabel
this.Invoke(showLogProDelegate, msg, color);
else
ShowLogPro(msg, color);
}
private List<string> logList = new List<string>();
......
......@@ -19,41 +19,46 @@ namespace AutoScanAndLabel
[STAThread]
static void Main()
{
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
DeviceLibrary.LabelParam labelParam = new DeviceLibrary.LabelParam();
labelParam.codeInfos = new List<CodeLibrary.CodeInfo>();
//##340093060037##01410000441770##012100000224##Q3000
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("Y38072732TLP785(D4GHTR6,F (C 2000A0132G0 2000ZUY0HG1U8501F2A Y0HG1U 2124 2124TWCN 69 T2", 0, 0));
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("[)>P1PTLV7022DGKR6P2PAQ25000V00333171T0557736ZEW4WTKYD210631T1032393ASH20LRFB21LUSA22LASH23LCHNEG43Z1/260C/UNLIM;//;022121L18087KN01", 0, 0));
labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("99700736000619EM6H38.125008625", 0, 0));
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("CK7T0H.125002115", 0, 0));
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("Y38073304TLP385(D4GREETRE (T 00003000A0149T 03000WT0HBGCC8210B3F-5595 2009 2009JPTH 00 67 91432487 02Q", 0, 0));
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("01410000441770", 0, 0));
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("012100000224", 0, 0));
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("Q3000", 0, 0));
labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("340093060037", 0, 0, "Code 128"));
DeviceLibrary.Common.codeProcess(labelParam, out string debugmsg);
Console.WriteLine(debugmsg);
_ = new Mutex(true, Application.ProductName, out bool ret);
if (!ret)
try
{
IntPtr formhwnd = FindWindow(null, Config.Get(Setting_Init.App_Title));
ShowWindow(formhwnd, SW_RESTORE);
SwitchToThisWindow(formhwnd, true);
//MessageBox.Show("该程序已经启动", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
Environment.CurrentDirectory = Application.StartupPath;
XmlConfigurator.Configure();
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
//DeviceLibrary.LabelParam labelParam = new DeviceLibrary.LabelParam();
//labelParam.codeInfos = new List<CodeLibrary.CodeInfo>();
////##340093060037##01410000441770##012100000224##Q3000
////labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("Y38072732TLP785(D4GHTR6,F (C 2000A0132G0 2000ZUY0HG1U8501F2A Y0HG1U 2124 2124TWCN 69 T2", 0, 0));
////labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("[)>P1PTLV7022DGKR6P2PAQ25000V00333171T0557736ZEW4WTKYD210631T1032393ASH20LRFB21LUSA22LASH23LCHNEG43Z1/260C/UNLIM;//;022121L18087KN01", 0, 0));
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("99700736000619EM6H38.125008625", 0, 0));
////labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("CK7T0H.125002115", 0, 0));
////labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("Y38073304TLP385(D4GREETRE (T 00003000A0149T 03000WT0HBGCC8210B3F-5595 2009 2009JPTH 00 67 91432487 02Q", 0, 0));
////labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("01410000441770", 0, 0));
////labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("012100000224", 0, 0));
////labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("Q3000", 0, 0));
//labelParam.codeInfos.Add(new CodeLibrary.CodeInfo("340093060037", 0, 0, "Code 128"));
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
//DeviceLibrary.Common.codeProcess(labelParam, out string debugmsg);
//Console.WriteLine(debugmsg);
_ = new Mutex(true, Application.ProductName, out bool ret);
if (!ret)
{
IntPtr formhwnd = FindWindow(null, Config.Get(Setting_Init.App_Title));
ShowWindow(formhwnd, SW_RESTORE);
SwitchToThisWindow(formhwnd, true);
//MessageBox.Show("该程序已经启动", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
Environment.CurrentDirectory = Application.StartupPath;
XmlConfigurator.Configure();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
catch (Exception ex)
{
LogUtil.error(ex.Message);
throw new Exception(ex.Message); ;
}
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
......
......@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
[assembly: AssemblyVersion("1.5.0.0")]
[assembly: AssemblyVersion("2.3.*")]
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
......@@ -44,11 +44,11 @@ namespace AutoScanAndLabel
this.label_matchdebugstring = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.button1 = new System.Windows.Forms.Button();
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.cb_IgnoreGratingSignal = new System.Windows.Forms.CheckBox();
this.uC_U11 = new AutoScanAndLabel.UC_U1();
this.listEditControl1 = new AutoScanAndLabel.UC.ListEditControl();
this.listEdit_pn = new AutoScanAndLabel.UC.ListEditControl();
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.cb_IgnoreGratingSignal = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -102,7 +102,7 @@ namespace AutoScanAndLabel
this.cb_labelselect.FormattingEnabled = true;
this.cb_labelselect.Location = new System.Drawing.Point(134, 75);
this.cb_labelselect.Name = "cb_labelselect";
this.cb_labelselect.Size = new System.Drawing.Size(198, 23);
this.cb_labelselect.Size = new System.Drawing.Size(198, 26);
this.cb_labelselect.TabIndex = 0;
this.cb_labelselect.SelectedIndexChanged += new System.EventHandler(this.cb_labelselect_SelectedIndexChanged);
//
......@@ -111,23 +111,23 @@ namespace AutoScanAndLabel
this.cb_printerselect.FormattingEnabled = true;
this.cb_printerselect.Location = new System.Drawing.Point(134, 37);
this.cb_printerselect.Name = "cb_printerselect";
this.cb_printerselect.Size = new System.Drawing.Size(198, 23);
this.cb_printerselect.Size = new System.Drawing.Size(198, 26);
this.cb_printerselect.TabIndex = 0;
this.cb_printerselect.SelectedIndexChanged += new System.EventHandler(this.cb_printerselect_SelectedIndexChanged);
//
// chbAutoRun
//
this.chbAutoRun.AutoSize = true;
this.chbAutoRun.Location = new System.Drawing.Point(3, 185);
this.chbAutoRun.Location = new System.Drawing.Point(3, 169);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(104, 19);
this.chbAutoRun.Size = new System.Drawing.Size(124, 22);
this.chbAutoRun.TabIndex = 1;
this.chbAutoRun.Text = "开机自启动";
this.chbAutoRun.UseVisualStyleBackColor = true;
//
// btn_labelDebug
//
this.btn_labelDebug.Location = new System.Drawing.Point(154, 551);
this.btn_labelDebug.Location = new System.Drawing.Point(402, 163);
this.btn_labelDebug.Name = "btn_labelDebug";
this.btn_labelDebug.Size = new System.Drawing.Size(140, 28);
this.btn_labelDebug.TabIndex = 2;
......@@ -162,7 +162,7 @@ namespace AutoScanAndLabel
//
this.txt_code.Location = new System.Drawing.Point(6, 24);
this.txt_code.Name = "txt_code";
this.txt_code.Size = new System.Drawing.Size(264, 25);
this.txt_code.Size = new System.Drawing.Size(264, 28);
this.txt_code.TabIndex = 5;
//
// btn_codetest
......@@ -197,7 +197,7 @@ namespace AutoScanAndLabel
//
// button1
//
this.button1.Location = new System.Drawing.Point(41, 556);
this.button1.Location = new System.Drawing.Point(36, 553);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 10;
......@@ -206,14 +206,36 @@ namespace AutoScanAndLabel
this.button1.Visible = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// cb_EnableBuzzer
//
this.cb_EnableBuzzer.AutoSize = true;
this.cb_EnableBuzzer.Location = new System.Drawing.Point(124, 169);
this.cb_EnableBuzzer.Name = "cb_EnableBuzzer";
this.cb_EnableBuzzer.Size = new System.Drawing.Size(124, 22);
this.cb_EnableBuzzer.TabIndex = 13;
this.cb_EnableBuzzer.Text = "使用蜂鸣器";
this.cb_EnableBuzzer.UseVisualStyleBackColor = true;
this.cb_EnableBuzzer.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged);
//
// cb_IgnoreGratingSignal
//
this.cb_IgnoreGratingSignal.AutoSize = true;
this.cb_IgnoreGratingSignal.Location = new System.Drawing.Point(254, 169);
this.cb_IgnoreGratingSignal.Name = "cb_IgnoreGratingSignal";
this.cb_IgnoreGratingSignal.Size = new System.Drawing.Size(142, 22);
this.cb_IgnoreGratingSignal.TabIndex = 11;
this.cb_IgnoreGratingSignal.Text = "忽略安全光栅";
this.cb_IgnoreGratingSignal.UseVisualStyleBackColor = true;
this.cb_IgnoreGratingSignal.CheckedChanged += new System.EventHandler(this.cb_IgnoreGratingSignal_CheckedChanged);
//
// uC_U11
//
this.uC_U11.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.uC_U11.Location = new System.Drawing.Point(3, 246);
this.uC_U11.Location = new System.Drawing.Point(0, 198);
this.uC_U11.Margin = new System.Windows.Forms.Padding(4);
this.uC_U11.Name = "uC_U11";
this.uC_U11.Size = new System.Drawing.Size(591, 187);
this.uC_U11.Size = new System.Drawing.Size(678, 150);
this.uC_U11.TabIndex = 9;
//
// listEditControl1
......@@ -221,10 +243,10 @@ namespace AutoScanAndLabel
this.listEditControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listEditControl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listEditControl1.ListFile = "config/qty.list";
this.listEditControl1.Location = new System.Drawing.Point(3, 21);
this.listEditControl1.Location = new System.Drawing.Point(3, 24);
this.listEditControl1.Margin = new System.Windows.Forms.Padding(5);
this.listEditControl1.Name = "listEditControl1";
this.listEditControl1.Size = new System.Drawing.Size(354, 204);
this.listEditControl1.Size = new System.Drawing.Size(354, 201);
this.listEditControl1.TabIndex = 3;
this.listEditControl1.DataRefresh += new System.EventHandler(this.listEdit_pn_DataRefresh);
//
......@@ -233,35 +255,13 @@ namespace AutoScanAndLabel
this.listEdit_pn.Dock = System.Windows.Forms.DockStyle.Fill;
this.listEdit_pn.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listEdit_pn.ListFile = "config/pn.list";
this.listEdit_pn.Location = new System.Drawing.Point(3, 21);
this.listEdit_pn.Location = new System.Drawing.Point(3, 24);
this.listEdit_pn.Margin = new System.Windows.Forms.Padding(5);
this.listEdit_pn.Name = "listEdit_pn";
this.listEdit_pn.Size = new System.Drawing.Size(354, 154);
this.listEdit_pn.Size = new System.Drawing.Size(354, 151);
this.listEdit_pn.TabIndex = 3;
this.listEdit_pn.DataRefresh += new System.EventHandler(this.listEdit_pn_DataRefresh);
//
// cb_EnableBuzzer
//
this.cb_EnableBuzzer.AutoSize = true;
this.cb_EnableBuzzer.Location = new System.Drawing.Point(403, 13);
this.cb_EnableBuzzer.Name = "cb_EnableBuzzer";
this.cb_EnableBuzzer.Size = new System.Drawing.Size(104, 19);
this.cb_EnableBuzzer.TabIndex = 13;
this.cb_EnableBuzzer.Text = "使用蜂鸣器";
this.cb_EnableBuzzer.UseVisualStyleBackColor = true;
this.cb_EnableBuzzer.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged);
//
// cb_IgnoreGratingSignal
//
this.cb_IgnoreGratingSignal.AutoSize = true;
this.cb_IgnoreGratingSignal.Location = new System.Drawing.Point(403, 44);
this.cb_IgnoreGratingSignal.Name = "cb_IgnoreGratingSignal";
this.cb_IgnoreGratingSignal.Size = new System.Drawing.Size(119, 19);
this.cb_IgnoreGratingSignal.TabIndex = 11;
this.cb_IgnoreGratingSignal.Text = "忽略安全光栅";
this.cb_IgnoreGratingSignal.UseVisualStyleBackColor = true;
this.cb_IgnoreGratingSignal.CheckedChanged += new System.EventHandler(this.cb_IgnoreGratingSignal_CheckedChanged);
//
// SettingControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -276,7 +276,7 @@ namespace AutoScanAndLabel
this.Controls.Add(this.chbAutoRun);
this.Controls.Add(this.groupBox1);
this.Name = "SettingControl";
this.Size = new System.Drawing.Size(1024, 740);
this.Size = new System.Drawing.Size(1280, 925);
this.Load += new System.EventHandler(this.SettingControl_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
......
......@@ -3,6 +3,7 @@ using ConfigHelper;
using DeviceLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.Common.util;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
......@@ -51,8 +52,6 @@ namespace AutoScanAndLabel
string labelName = ConfigHelper.Config.Get(Setting_Init.LabelName);
cb_printerselect.Text = PrintName;
cb_labelselect.Text = labelName;
}
......@@ -75,15 +74,15 @@ namespace AutoScanAndLabel
private void btn_labeledit_Click(object sender, EventArgs e)
{
var keys = File.ReadAllLines("NeoScan\\Config\\MacroKey.txt");
var keys = File.ReadAllLines(Application.StartupPath+ "\\NeoScan\\Config\\MacroKey.txt");
//RobotManage.PrintBean.EditLabel();
PrintLabel.FrmLabel frmLabel = new PrintLabel.FrmLabel();
//crc.CurrLanguage = "";
frmLabel.Text = crc.GetString("FrmLabel_Text", "标签编辑");
crc.LanguageProcess(frmLabel, "FrmLabel");
//frmLabel.KeyWord.AddRange(keys);
frmLabel.ShowDialog();
frmLabel.KeyWord.AddRange(keys);
frmLabel.Show();
RobotManage_LoadFinishEvent(true, "");
RobotManage.LoadPrintSetting();
}
......@@ -125,29 +124,59 @@ namespace AutoScanAndLabel
private void btn_labelDebug_Click(object sender, EventArgs e)
{
LabelParam la = new LabelParam();
Common.RenderedImage(la, new Point(500,500), new Point(1000,1000));
//UnifiedDataHandler.RecordPrintNg(false,true,out string[] s);
//UnifiedDataHandler.RecordEmsData(false,"78945699999");
//Dictionary<string, string> dic = new Dictionary<string, string>();
//dic.Add("cid","NS01_1");
//Bitmap bitmap = new Bitmap("C:\\Users\\Neotel\\Desktop\\lQLPKdvOHVK-69fNAdjNAsSwG8ONhvwwiG8Fi4NMZw68AQ_708_472.png");
//_ = UnifiedDataHandler.PostSmfImageAsync(bitmap, dic, bitmap.Width, bitmap.Height);
//Bitmap bitmap1 = new Bitmap("C:\\Users\\Neotel\\Desktop\\lQLPJyGyZ6lafJfNDkDNFUCwiSqya_VMap0Fi4NMZw68AA_5440_3648.png");
//Dictionary<string, string> dic1 = new Dictionary<string, string>();
//dic1.Add("cid", "NS01_2");
//_ = UnifiedDataHandler.PostSmfImageAsync(bitmap1, dic1);
//Bitmap bitmap = new Bitmap("16-51-26-94.bmp");
//List<CodeInfo> tlci = EyemDecode2.Decoder(ref bitmap);
//bitmap.Dispose();
List<CodeInfo> tlci = new List<CodeInfo>();
tlci.Add(new CodeInfo("", 413, 1809));
LabelParam labelParam = new LabelParam();
labelParam.codeInfos = tlci;
labelParam.bitmapfilename = @"D:\logs\827\15-02-40-402.bmp";
//bitmap.Dispose();622-X:1928;Y:1231
//4781-x: 1838; y: 2292
//List<CodeInfo> tlci = new List<CodeInfo>();
//tlci.Add(new CodeInfo("", 1928, 1231));
////tlci.Add(new CodeInfo("", 3110, 1654));
//LabelParam labelParam = new LabelParam();
//labelParam.codeInfos = tlci;
//labelParam.PlateW = 15;
//labelParam.bitmapfilename = "D:\\Desktop\\软件日志\\ns200苏州工厂\\12-29-贴标是歪的\\2023-12-29-16-12-27622.bmp";
//LabelParam aaa = labelParam.clone();
//Point Right_Batch_Point = new Point(RobotManage.Config.Right_Batch_X, RobotManage.Config.Right_Batch_Y);
////Point p = Common.CalcLabelPoint(labelParam, Right_Batch_Point, RobotManage.Config.Label_R_Offset, RobotManage.Config.Label_R_Angle_Diff, out int labelAngle);
//Point p = Common.Customlabeling(labelParam, Right_Batch_Point, out int labelAngle);
LabelParam aaa = labelParam.clone();
Point Right_Batch_Point = new Point(RobotManage.Config.Right_Batch_X, RobotManage.Config.Right_Batch_Y);
// //计算贴标角度的脉冲值
// int labelAxisPos = RobotManage.Config.Label_R_360 / 360 * labelAngle;
Point p = Common.CalcLabelPoint(labelParam, Right_Batch_Point, RobotManage.Config.Label_R_Offset, RobotManage.Config.Label_R_Angle_Diff, out int labelAngle);
// //计算像素点位与中心点的差
// Point p1 = new Point(p.X - Right_Batch_Point.X, p.Y - Right_Batch_Point.Y);
// //计算像素*脉冲像素比得到脉冲值+中心点基准脉冲
// p1.X = (int)(p1.X * RobotManage.Config.Cam_Pixel_X_Ratio) + RobotManage.Config.Label_X_Base;
// p1.Y = (int)(p1.Y * RobotManage.Config.Cam_Pixel_Y_Ratio) + RobotManage.Config.Label_Y_Base;
//计算贴标角度的脉冲值
int labelAxisPos = RobotManage.Config.Label_R_360 / 360 * labelAngle;
}
static bool IsPointInTriangle(Point p, Point[] triangle)
{
int s1 = (triangle[0].X * (triangle[1].Y - triangle[2].Y) + triangle[1].X * (triangle[2].Y - triangle[0].Y) + triangle[2].X * (triangle[0].Y - triangle[1].Y)) / 2;
int s2 = (p.X * (triangle[1].Y - triangle[2].Y) + triangle[1].X * (triangle[2].Y - p.Y) + triangle[2].X * (p.Y - triangle[1].Y)) / 2;
int s3 = (triangle[0].X * (p.Y - triangle[2].Y) + p.X * (triangle[2].Y - triangle[0].Y) + triangle[2].X * (triangle[0].Y - p.Y)) / 2;
int s4 = (triangle[0].X * (triangle[1].Y - p.Y) + triangle[1].X * (p.Y - triangle[0].Y) + p.X * (triangle[0].Y - triangle[1].Y)) / 2;
//计算像素点位与中心点的差
Point p1 = new Point(p.X - Right_Batch_Point.X, p.Y - Right_Batch_Point.Y);
//计算像素*脉冲像素比得到脉冲值+中心点基准脉冲
p1.X = (int)(p1.X * RobotManage.Config.Cam_Pixel_X_Ratio) + RobotManage.Config.Label_X_Base;
p1.Y = (int)(p1.Y * RobotManage.Config.Cam_Pixel_Y_Ratio) + RobotManage.Config.Label_Y_Base;
int totalArea = Math.Abs(s1 + s2 + s3 + s4);
return totalArea == s1 + s2 + s3 + s4; // 如果点在三角形内,两者应该相等
}
private void listEdit_pn_DataRefresh(object sender, EventArgs e)
......@@ -167,7 +196,7 @@ namespace AutoScanAndLabel
private void button1_Click(object sender, EventArgs e)
{
RemoteDecodeHelper_mod.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper_mod.RemoteDecodeParam();
var bmp = new Bitmap("d:\\17-09-05-154.bmp");
var bmp = new Bitmap("D:\\Desktop\\001.jpg");
var cc = RemoteDecodeHelper_mod.DecodeRequest(bmp, remoteDecodeParam);
}
......
......@@ -280,6 +280,9 @@ namespace AutoScanAndLabel
}
}
CSVConfigReader.SaveConfig(Config.ConfigFilePath, Config);
Config.DIList.Clear();
Config.DOList.Clear();
RobotManage.mainMachine.Config = (Robot_Config)CSVConfigReader.LoadConfig(Config);
}
}
}
\ No newline at end of file
......@@ -41,11 +41,14 @@ namespace AutoScanAndLabel
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Location = new System.Drawing.Point(3, 3);
this.groupBox3.Location = new System.Drawing.Point(4, 4);
this.groupBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(628, 461);
this.groupBox3.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.groupBox3.Size = new System.Drawing.Size(942, 692);
this.groupBox3.TabIndex = 108;
this.groupBox3.TabStop = false;
this.groupBox3.Tag = "not";
this.groupBox3.Text = "点位列表";
//
// tableLayoutPanel1
......@@ -60,19 +63,21 @@ namespace AutoScanAndLabel
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 14);
this.tableLayoutPanel1.Location = new System.Drawing.Point(9, 21);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(616, 441);
this.tableLayoutPanel1.Size = new System.Drawing.Size(924, 662);
this.tableLayoutPanel1.TabIndex = 102;
//
// btnSavePos
//
this.btnSavePos.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSavePos.Location = new System.Drawing.Point(3, 470);
this.btnSavePos.Location = new System.Drawing.Point(4, 705);
this.btnSavePos.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnSavePos.Name = "btnSavePos";
this.btnSavePos.Size = new System.Drawing.Size(133, 31);
this.btnSavePos.Size = new System.Drawing.Size(200, 46);
this.btnSavePos.TabIndex = 109;
this.btnSavePos.Text = "全部保存";
this.btnSavePos.UseVisualStyleBackColor = true;
......@@ -80,12 +85,13 @@ namespace AutoScanAndLabel
//
// ConfigControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnSavePos);
this.Controls.Add(this.groupBox3);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "ConfigControl";
this.Size = new System.Drawing.Size(1096, 504);
this.Size = new System.Drawing.Size(1644, 756);
this.Load += new System.EventHandler(this.ConfigControl_Load);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
......
......@@ -42,20 +42,20 @@ namespace AutoScanAndLabel
this.label_dir.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label_dir.AutoSize = true;
this.label_dir.Location = new System.Drawing.Point(4, 66);
this.label_dir.Location = new System.Drawing.Point(4, 57);
this.label_dir.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label_dir.Name = "label_dir";
this.label_dir.Size = new System.Drawing.Size(105, 15);
this.label_dir.Size = new System.Drawing.Size(125, 18);
this.label_dir.TabIndex = 16;
this.label_dir.Text = "图像保存目录:";
//
// btn_selectdir
//
this.btn_selectdir.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_selectdir.Location = new System.Drawing.Point(480, 92);
this.btn_selectdir.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btn_selectdir.Location = new System.Drawing.Point(541, 80);
this.btn_selectdir.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.btn_selectdir.Name = "btn_selectdir";
this.btn_selectdir.Size = new System.Drawing.Size(87, 29);
this.btn_selectdir.Size = new System.Drawing.Size(98, 28);
this.btn_selectdir.TabIndex = 15;
this.btn_selectdir.Text = "浏览";
this.btn_selectdir.UseVisualStyleBackColor = true;
......@@ -63,11 +63,11 @@ namespace AutoScanAndLabel
//
// txt_reelphotodir
//
this.txt_reelphotodir.Location = new System.Drawing.Point(4, 92);
this.txt_reelphotodir.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txt_reelphotodir.Location = new System.Drawing.Point(8, 80);
this.txt_reelphotodir.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_reelphotodir.Name = "txt_reelphotodir";
this.txt_reelphotodir.ReadOnly = true;
this.txt_reelphotodir.Size = new System.Drawing.Size(460, 25);
this.txt_reelphotodir.Size = new System.Drawing.Size(517, 28);
this.txt_reelphotodir.TabIndex = 14;
//
// cb_exportreephoto
......@@ -75,10 +75,10 @@ namespace AutoScanAndLabel
this.cb_exportreephoto.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cb_exportreephoto.AutoSize = true;
this.cb_exportreephoto.Location = new System.Drawing.Point(8, 25);
this.cb_exportreephoto.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cb_exportreephoto.Location = new System.Drawing.Point(9, 30);
this.cb_exportreephoto.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.cb_exportreephoto.Name = "cb_exportreephoto";
this.cb_exportreephoto.Size = new System.Drawing.Size(330, 19);
this.cb_exportreephoto.Size = new System.Drawing.Size(394, 22);
this.cb_exportreephoto.TabIndex = 13;
this.cb_exportreephoto.Text = "自动拍摄并保存料盘图像. 勾选后仅本次有效";
this.cb_exportreephoto.UseVisualStyleBackColor = true;
......@@ -91,22 +91,22 @@ namespace AutoScanAndLabel
this.gb.Controls.Add(this.txt_reelphotodir);
this.gb.Dock = System.Windows.Forms.DockStyle.Fill;
this.gb.Location = new System.Drawing.Point(0, 0);
this.gb.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gb.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.gb.Name = "gb";
this.gb.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gb.Size = new System.Drawing.Size(575, 185);
this.gb.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.gb.Size = new System.Drawing.Size(647, 222);
this.gb.TabIndex = 17;
this.gb.TabStop = false;
this.gb.Text = "料盘图像导出";
//
// UC_U1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.gb);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "UC_U1";
this.Size = new System.Drawing.Size(575, 185);
this.Size = new System.Drawing.Size(647, 222);
this.Load += new System.EventHandler(this.UC_U1_Load);
this.gb.ResumeLayout(false);
this.gb.PerformLayout();
......
......@@ -192,7 +192,7 @@ Form1_tabControl1_tabPage1_cb_EnableBuzzer_Text 使用蜂鸣器 ブザーを起
Form1_tabControl1_tabPage1_cb_IgnoreGratingSignal_Text 忽略安全光栅 セーフティライトカーテンを無視する
Form1_tabControl1_tabPage1_cb_IgnoreSafecheck_Text 忽略安全检查(含安全光栅) セーフティチックを無視する(セーフティライトカーテン含み)
Form1_tabControl1_tabPage1_groupBox1_Text 运行状态 実行状況
Form1_tabControl1_tabPage1_Text 信息 情報
Form1_tabControl1_tabPage1_Text 信息 メッセージ
FrmCodeDecode_btnAn_Text 变暗 暗くする
FrmCodeDecode_btnbarCode_Text 一维码识别 1次元バーコードの認識
FrmCodeDecode_btnCameraImage_Text 相机获取图片 カメラから画像
......@@ -213,6 +213,10 @@ FrmCodeDecode_label3_Text 条码类型: バーコードタイプ:
FrmCodeDecode_label4_Text 参数路径 パスパラメータ
FrmCodeDecode_lblCount_Text 条码数量: バーコード数:
FrmCodeDecode_Text 二维码识别 QRコード識別
FrmCodeDecode_label6_Text 图片识别结果 Image recognition results:
FrmCodeDecode_butt_cameracode_Text 获取相机图片及条码 Obtain camera images and barcodes
FrmCodeDecode_check_issaveimage_Text 是否保存图片 Is Image Save
FrmCodeDecode_button_optionfeil_Text 选择文件夹 Option Folder
FrmLabel_BtnFieldAdd_Text 字段添加 フィールド追加
FrmLabel_BtnFieldDel_Text 字段删除 フィールド削除
FrmLabel_BtnFieldFont_Text 字段字体 フィールド字体
......@@ -223,6 +227,8 @@ FrmLabel_BtnRename_Text 重命名 重命名
FrmLabel_BtnSave_Text 保存 保存
FrmLabel_grpDsc_Text 字段说明 フィールド説明
FrmLabel_Text 标签编辑 ラベル編集
FrmLabel_label_labelsize_Text 标签尺寸: Label size
FrmLabel_groupBox1_Text 字段说明 Description
menuStrip1_关于ToolStripMenuItem_Text 关于 詳しい情報
menuStrip1_设备操作ToolStripMenuItem_Text 设备操作 操作
menuStrip1_语言toolStripMenuItem_Text 语言 言語
......@@ -464,9 +470,42 @@ Res0217 标签打印机打开失败 ラベルプリンタを開くのに失敗
Res0218 有料串,已提取{0}张料盘 リール串がシリアルで、{0}枚のリールが提出されました
Res0219 版权 © 2021 著作権© 2021
Res0220 最后更新时间: 最終更新日時:
Res0221 未检测到打印标签 印刷ラベルが検出されませんでした
Res0222 贴标时未检测到打印标签 ラベルがラベルで検出されませんでした
Res0223 未知数 未知数
Res0224 上一个标签尚未移走 前のラベルは移動されていません
FeedAGV_Feed 进料口AGV送料串请求 フィードポートAGVフィードストリング要求
FeedAGV_Receiving 进料口AGV收料串请求 供給口AGV受入ストリング要求
DischargeAGV_Feeding 出料口AGV送料串请求 排出口AGV送り列要求
DischargeAGV_Receiving 出料口AGV收料串请求 排出口AGV受入ストリング要求
AgvRequest_ FeedPort 进料口AGV请求应答 供給口AGV要求応答
AgvRequest_ Outlet 出料口AGV请求应答 排出口AGV要求応答
AgvRequest_FeedPort 进料口AGV请求应答 供給口AGV要求応答
AgvRequest_Outlet 出料口AGV请求应答 排出口AGV要求応答
Form1_groupBox2_Text 消息 Message
menuStrip1_相机条码ToolStripMenuItem_Text 条码识别(相机) Barcode recognition (camera)
menuStrip1_条码规则ToolStripMenuItem_Text 条码规则 Barcode Rules
menuStrip1_退出ToolStripMenuItem1_Text 退出 Exit
AgvControl_checkBox1_Text 手动 Manual Operation
AgvControl_groupBox_left_button_Leftleavefull_Text 满料串取出 Request Loaded Stacker
AgvControl_groupBox_left_button_leftneedempty_Text 空料串送入 Request Loaded Stacker
AgvControl_groupBox_left_Text 出口 Unloading Port
AgvControl_groupBox_right_button_rightleavefull_Text 空料串取出 Request Unloaded Stacker
AgvControl_groupBox_right_button_rightneedempty_Text 满料串送入 Request Loaded Stacker
AgvControl_groupBox_right_Text 入口 Loading Port
AgvControl_groupBox2_lblCurMissionId_Text 当前的mission id Current Task ID
AgvControl_groupBox2_lblCurRunMissionId_Text 正在运行的mission id Running Task ID
AgvControl_groupBox2_lblMissionResult_Text mission运行结果 Task Run Results
AgvControl_groupBox2_lblMissionRunstate_Text mission运行状态 Task Run Status
AgvControl_groupBox3_button1_Text 任务测试 Manual Task Test
AgvControl_groupBox3_button2_Text 重置呼叫 Reset Call Status
AgvControl_groupBox3_label1_Text 去待机点任务编号: Standby Task ID
AgvControl_groupBox3_label3_Text 去入口任务编号: Move To LP Task ID:
AgvControl_groupBox3_label4_Text 去出口任务编号: Move To UP Task ID:
AgvControl_groupBox3_label5_Text 流出AGV任务编号: AGV Stacker Outflow ID
AgvControl_groupBox3_label6_Text 流入AGV任务编号: AGV Stacker Inflow ID
AgvControl_groupBox3_label7_Text 任务编号: Task ID:
AgvControl_groupBox3_Text 手动任务 Manually Send Task
AgvControl_groupBox2_Text 任务状态[127.0.0.1] AGV Status [127.0.0.1]
AxisMoveControl_groupAxis_groupBox2_lblINP_Text 到位 In place
Form1_tabControl1_Res0010__SettingControl_cb_EnableBuzzer_Text 使用蜂鸣器 Use Buzzer
Form1_tabControl1_Res0010__SettingControl_cb_IgnoreGratingSignal_Text 忽略安全光栅 Ignore Safety Light Curtain
Form1_tabControl1_Res0010__SettingControl_btn_labelDebug_Text 贴标调试 Label Config.
......@@ -33,6 +33,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="ConfigHelper">
<HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
......@@ -43,6 +46,7 @@
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
......@@ -68,6 +72,7 @@
<Compile Include="util\CTcpClient.cs" />
<Compile Include="util\TcpServer.cs" />
<Compile Include="util\UdpServer.cs" />
<Compile Include="util\UnifiedDataHandler.cs" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
......
......@@ -2,11 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
namespace OnlineStore.Common
{
public class LineGetPosOp
{
public LineGetPosOp(string cids, string code)
......@@ -72,11 +72,11 @@ namespace OnlineStore.Common
get { return _data; }
set { _data = value; }
}
public Dictionary<String, Dictionary<String, String>> mimoOpMap = new Dictionary<string, Dictionary<string, string>>();
//public Dictionary<String, Dictionary<String, String>> mimoOpMap = new Dictionary<string, Dictionary<string, string>>();
/// <summary>
/// agv的日志信息
/// </summary>
public List<AgvLogInfo> logList = new List<AgvLogInfo>();
//public List<AgvLogInfo> logList = new List<AgvLogInfo>();
/// <summary>
/// 整体料仓状态
/// 1=正常运行中
......@@ -94,7 +94,7 @@ namespace OnlineStore.Common
/// 警告:出库盘到达工位但是没有工人操作
/// </summary>
public string msg { get; set; }
// public Dictionary<string, string> msgData { get; set; } = new Dictionary<string, string>() { {"zh","" },{ "en", "" }, { "jp", "" } };
//public Dictionary<string, string> msgData { get; set; } = new Dictionary<string, string>() { {"zh","" },{ "en", "" }, { "jp", "" } };
public Dictionary<string, string> msgData { get; set; } = new Dictionary<string, string>();
public string msgParam { get; set; }
public string msgCode { get; set; }
......@@ -103,11 +103,14 @@ namespace OnlineStore.Common
/// <summary>
/// 包含的多个 BOX 的状态信息
/// </summary>
public Dictionary<int, BoxStatus> boxStatus = new Dictionary<int, BoxStatus>();
//public Dictionary<int, BoxStatus> boxStatus = new Dictionary<int, BoxStatus>();
/// <summary>
/// 报警集合
/// </summary>
public List<AlarmInfo> alarmList = new List<AlarmInfo>();
public List<EquipMsg> showLogs = new List<EquipMsg>();
public String type { get; set; } = "NEOSCAN";
}
/**
* agv日志信息
......@@ -173,6 +176,7 @@ namespace OnlineStore.Common
/// <summary>
/// 操作相关数据,
/// 出库完成后发送posId库位编号给服务器
/// 需要将打印数量和ng数量发送给服务器
/// </summary>
private Dictionary<string, string> _data = new Dictionary<string, string>();
public Dictionary<string, string> data
......@@ -310,4 +314,59 @@ namespace OnlineStore.Common
public static string disable = "disable";
public static string enable = "enable";
}
/// <summary>
/// 步骤消息类
/// </summary>
public class EquipMsg
{
/// <summary>
/// 设备模块
/// </summary>
public String module;
/// <summary>
/// 消息类型,为:INFO,WARNING,ERROR,DATA
/// </summary>
//private String type;
/// <summary>
/// 中英文字符串 key
/// </summary>
public String msgCode;
/// <summary>
/// 消息内容
/// </summary>
public String msg;
/// <summary>
/// 参数
/// </summary>
public String[] msgParams;
}
public class NsMesInfo
{
private String status = "OK";
private DateTime time;
private String request = "";
private String response = "";
}
public enum ShelfEnum
{
IDLE ,//= 空闲;
LOADING,//= 入库中;
UNLOADING,//= 出库中;
NEED_EMPTY,//= 需要空料串出库;
EMPTY_OUT,//= 空料串需要取走
FULL_OUT,//= 满料串需要取走
}
public enum ShelfType
{
smallReel,
bigReel,
tray
}
}
using System;
using System.Configuration;
using System.Threading;
using System.Xml;
using System.Windows.Forms;
using System.Xml;
namespace OnlineStore.Common
{
......@@ -204,6 +204,6 @@ namespace OnlineStore.Common
{
LogUtil.error( "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + ",",ex);
}
}
}
}
}
......@@ -14,7 +14,7 @@ namespace OnlineStore.Common
/// </summary>
/// <param name="o">对象</param>
/// <returns>json字符串</returns>
public static string SerializeObject(object o)
public static string SerializeObject (object o)
{
string json = JsonConvert.SerializeObject(o);
return json;
......
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
namespace DL.Utils
{
......@@ -51,7 +46,5 @@ namespace DL.Utils
return false;
}
}
}
}
......@@ -4,95 +4,95 @@ using Newtonsoft.Json;
namespace DL.Utils
{
/// <summary>
/// Json帮助类
/// </summary>
public class JsonHelper
{
/// <summary>
/// Json帮助类
/// 将对象序列化为JSON格式
/// </summary>
public class JsonHelper
/// <param name="o">对象</param>
/// <returns>json字符串</returns>
public static string SerializeObject(object o)
{
/// <summary>
/// 将对象序列化为JSON格式
/// </summary>
/// <param name="o">对象</param>
/// <returns>json字符串</returns>
public static string SerializeObject(object o)
{
string json = JsonConvert.SerializeObject(o);
return json;
}
string json = JsonConvert.SerializeObject(o);
return json;
}
/// <summary>
/// 解析JSON字符串生成对象实体
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json字符串(eg.{"ID":"112","Name":"石子儿"})</param>
/// <returns>对象实体</returns>
public static T DeserializeJsonToObject<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
T t = o as T;
return t;
}
/// <summary>
/// 解析JSON字符串生成对象实体
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json字符串(eg.{"ID":"112","Name":"石子儿"})</param>
/// <returns>对象实体</returns>
public static T DeserializeJsonToObject<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
T t = o as T;
return t;
}
/// <summary>
/// 解析JSON数组生成对象实体集合
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json数组字符串(eg.[{"ID":"112","Name":"石子儿"}])</param>
/// <returns>对象实体集合</returns>
public static List<T> DeserializeJsonToList<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
List<T> list = o as List<T>;
return list;
}
/// <summary>
/// 解析JSON数组生成对象实体集合
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json数组字符串(eg.[{"ID":"112","Name":"石子儿"}])</param>
/// <returns>对象实体集合</returns>
public static List<T> DeserializeJsonToList<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
List<T> list = o as List<T>;
return list;
}
/// <summary>
/// 反序列化JSON到给定的匿名对象.
/// </summary>
/// <typeparam name="T">匿名对象类型</typeparam>
/// <param name="json">json字符串</param>
/// <param name="anonymousTypeObject">匿名对象</param>
/// <returns>匿名对象</returns>
public static T DeserializeAnonymousType<T>(string json, T anonymousTypeObject)
{
T t = JsonConvert.DeserializeAnonymousType(json, anonymousTypeObject);
return t;
}
/// <summary>
/// 反序列化JSON到给定的匿名对象.
/// </summary>
/// <typeparam name="T">匿名对象类型</typeparam>
/// <param name="json">json字符串</param>
/// <param name="anonymousTypeObject">匿名对象</param>
/// <returns>匿名对象</returns>
public static T DeserializeAnonymousType<T>(string json, T anonymousTypeObject)
{
T t = JsonConvert.DeserializeAnonymousType(json, anonymousTypeObject);
return t;
}
///// <summary>
///// 与服务器通信用对象
///// </summary>
//public class Operation
//{
// private string _cid = "";
// public string cid
// {
// get { return _cid; }
// set { _cid = value; }
// }
}
///// <summary>
///// 与服务器通信用对象
///// </summary>
//public class Operation
//{
// private string _cid = "";
// public string cid
// {
// get { return _cid; }
// set { _cid = value; }
// }
// public int seq { get; set; }
// public int op { get; set; }
// public int status { get; set; }
// private string _error = "";
// public string error
// {
// get { return _error; }
// set { _error = value; }
// }
// public int seq { get; set; }
// public int op { get; set; }
// public int status { get; set; }
// private Dictionary<string, string> _data = new Dictionary<string,string>();
// public Dictionary<string, string> data {
// get { return _data; }
// set { _data = value; }
// }
// private string _error = "";
// public string error
// {
// get { return _error; }
// set { _error = value; }
// }
// private Dictionary<string, string> _data = new Dictionary<string,string>();
// public Dictionary<string, string> data {
// get { return _data; }
// set { _data = value; }
// }
//}
//}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
......
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using static System.Net.Mime.MediaTypeNames;
namespace DL.Utils
{
......@@ -45,8 +48,7 @@ namespace DL.Utils
stringBuilder.Append(data.ToString("x2"));
stringBuilder.Append("】");
return stringBuilder.ToString();
}
}
public static byte[] StrToHexByte(string hexString)
{
hexString = hexString.Replace(" ", "");
......@@ -116,6 +118,6 @@ namespace DL.Utils
}
sb.Append("}");
return sb.ToString();
}
}
}
}
......@@ -245,7 +245,7 @@ namespace DeviceLibrary
/// 判断轴运动是否安全
/// </summary>
/// <returns></returns>
public bool IsSafe(int Targetpos,out string msg) {
public bool IsSafe(int Targetpos,out string msg){
msg = "";
if (interference == null)
return true;
......@@ -254,7 +254,6 @@ namespace DeviceLibrary
return !result;
}
#region 匀速上升处理
private System.Timers.Timer axisCheckTimer = null;
internal string TargetIoType = "";
......@@ -269,7 +268,7 @@ namespace DeviceLibrary
{
axisCheckTimer = new System.Timers.Timer();
axisCheckTimer.AutoReset = true;
axisCheckTimer.Interval += 30;
axisCheckTimer.Interval += 15;
axisCheckTimer.Elapsed += CheckTimer_Elapsed;
axisCheckTimer.Enabled = false;
}
......@@ -296,7 +295,6 @@ namespace DeviceLibrary
if (IsInProcess && pan.TotalMilliseconds < 100) { return; }
try
{
IsInProcess = true;
lastOkTime = DateTime.Now;
if (IOManager.IOValue(TargetIoType).Equals(TargetIoValue))
......@@ -349,7 +347,6 @@ namespace DeviceLibrary
Thread.Sleep(10);
}
}
}
}
\ No newline at end of file
using CodeLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
......@@ -37,6 +38,7 @@ namespace DeviceLibrary
public List<CodeInfo> codeInfos { get; set; }
public Dictionary<string,string> Keyword { get; set; }
public Dictionary<string, int> NewXYAngle { get; set; }
/// <summary>
/// 料盘高度
/// </summary>
......@@ -101,7 +103,5 @@ namespace DeviceLibrary
return "[" + WareCode + "], [" + PlateW + "x" + PlateH + "]";
}
}
}
}
......@@ -14,39 +14,71 @@ namespace DeviceLibrary
partial class MainMachine
{
void BtnProcess()
{
//右侧按钮按下,有料,出料
if (RightMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightCar_Check).Equals(IO_VALUE.HIGH))
{
string isskiptest = ConfigHelper.Config.Get("Hardwareversion","V2");
if (isskiptest=="V2")
{
RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
}
//右侧按钮按下,无料,阻挡下降
else if (RightMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.RightStopUP).Equals(IO_VALUE.LOW))
{
CylinderMove(null, IO_Type.RightStopUP, IO_Type.RightStopDown);
}
if (LeftMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftCar_Check).Equals(IO_VALUE.HIGH))
{
LeftMoveInfo.NewMove(MoveStep.L50_OutShelf);
//硬件v2版本,已经去除料车检测X11的io
if ((RightMoveInfo.IsStep(MoveStep.Wait)|| RightMoveInfo.IsStep(MoveStep.REND))
&& IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH))
{
//有料,出料,无料,进料
if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH))
{
RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
}
else
{
RightMoveInfo.NewMove(MoveStep.R40_InShelf);
}
}
if ((LeftMoveInfo.IsStep(MoveStep.Wait) || LeftMoveInfo.IsStep(MoveStep.REND))
&& IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH))
{
if (IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.HIGH))
{
LeftMoveInfo.NewMove(MoveStep.L50_OutShelf);
}
else
{
LeftMoveInfo.NewMove(MoveStep.L60_InShelf);
}
}
}
else if (LeftMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.LeftStopUP).Equals(IO_VALUE.LOW))
else
{
CylinderMove(null, IO_Type.LeftStopUP, IO_Type.LeftStopDown);
}
//右侧按钮按下,有料,出料
if (RightMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightCar_Check).Equals(IO_VALUE.HIGH))
{
RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
}
//右侧按钮按下,无料,阻挡下降
else if (RightMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.RightStopUP).Equals(IO_VALUE.LOW))
{
CylinderMove(null, IO_Type.RightStopUP, IO_Type.RightStopDown);
}
if (LeftMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftCar_Check).Equals(IO_VALUE.HIGH))
{
LeftMoveInfo.NewMove(MoveStep.L50_OutShelf);
}
else if (LeftMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.LeftStopUP).Equals(IO_VALUE.LOW))
{
CylinderMove(null, IO_Type.LeftStopUP, IO_Type.LeftStopDown);
}
}
}
}
}
......@@ -24,7 +24,6 @@ namespace DeviceLibrary
public void OpenAllServo()
{
AxisBean.RunMultiAxis(true, out _, AxisBean.List);
}
int logType = 1000;
string WarnMsg = "";
......@@ -58,6 +57,7 @@ namespace DeviceLibrary
string msg = "";
if (wait.IsHomeMove)
{
LogUtil.info($"回原记录:{wait.ToStr()}");
wait.IsEnd = AxisBean.HomeMoveIsEnd(MoveInfo, wait.AxisInfo, out msg);
}
else
......@@ -151,7 +151,7 @@ namespace DeviceLibrary
}
}
if (wait.IsEnd)
{
{
if (MoveInfo.OneWaitCanEndStep)
{
isOk = true;
......@@ -174,6 +174,7 @@ namespace DeviceLibrary
}
else if (span.TotalSeconds > MoveInfo.TimeOutSeconds)
{
LogUtil.error($"MoveInfo.MoveStep:{span.TotalSeconds}>{MoveInfo.TimeOutSeconds}");
WarnMsg = Name + "[" + MoveInfo.MoveStep + "]"+crc.GetString("Res0104","等待") + NotOkMsg + crc.GetString("Res0105","超时")+"[" + Math.Round(span.TotalSeconds, 1) + "]"+crc.GetString("Res0106","秒");
int second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10;
......@@ -284,8 +285,5 @@ namespace DeviceLibrary
});
}
}
}
}
\ No newline at end of file
using OnlineStore;
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary
{
......@@ -16,6 +8,38 @@ namespace DeviceLibrary
{
void IOMonitor()
{
//agv感应io处理逻辑
string isskiptest = ConfigHelper.Config.Get("Hardwareversion", "V2");
if (isskiptest == "V2")
{
if ((RightMoveInfo.IsStep(MoveStep.Wait) || RightMoveInfo.IsStep(MoveStep.REND)))
{
// && IOValue(IO_Type.FeedAGV_Feed).Equals(IO_VALUE.LOW) && IOValue(IO_Type.FeedAGV_Feed).Equals(IO_VALUE.LOW)
if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.FeedAGV_Feed).Equals(IO_VALUE.LOW))
{
//Msg.add("入料口有料串,请将料串先取出!", MsgLevel.warning);
RightMoveInfo.NewMove(MoveStep.R40_InShelf);
}
else if(IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.FeedAGV_Receiving).Equals(IO_VALUE.LOW))
{
RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
}
}
if ((LeftMoveInfo.IsStep(MoveStep.Wait) || LeftMoveInfo.IsStep(MoveStep.REND)))
{
//&& && IOValue(IO_Type.DischargeAGV_Receiving).Equals(IO_VALUE.LOW)
if (IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.LOW)&& IOValue(IO_Type.DischargeAGV_Feeding).Equals(IO_VALUE.LOW))
{
LeftMoveInfo.NewMove(MoveStep.L60_InShelf);
}
else if(IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.DischargeAGV_Receiving).Equals(IO_VALUE.LOW))
{
LeftMoveInfo.NewMove(MoveStep.L50_OutShelf);
}
}
}
if (RightMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.RightFornt_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.LOW))
......
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary
{
......
......@@ -56,7 +56,7 @@ namespace DeviceLibrary
//LeftMoveInfo.log($"批量轴已下降一张料盘位置,等待料盘放入,needpos={currpos}");
}
break;
case MoveStep.L10_WaitReelPut:
case MoveStep.L10_WaitReelPut:
Msg.add(crc.GetString("Res0095", "左侧空闲中"), MsgLevel.info);
break;
case MoveStep.L11_ReelPutted:
......@@ -64,6 +64,7 @@ namespace DeviceLibrary
LeftMoveInfo.NextMoveStep(MoveStep.L12);
//LeftBatchAxisToP1();
LeftBatchAxisDown();
LabelMoveInfo.MoveParam = LeftMoveInfo.MoveParam.clone();
//LeftMoveInfo.log($"料盘已放入,批量轴上升,LeftStartMovePosition={LeftStartMovePosition}");
LeftMoveInfo.log($"左侧料盘已放入,批量轴下降固定值");
break;
......@@ -73,11 +74,11 @@ namespace DeviceLibrary
LeftMoveInfo.log($"批量轴上升到P2位置,LeftStartMovePosition={LeftStartMovePosition}");
break;
case MoveStep.L13:
LabelMoveInfo.MoveParam = LeftMoveInfo.MoveParam.clone();
//LabelMoveInfo.MoveParam = LeftMoveInfo.MoveParam.clone();
LeftMoveInfo.NextMoveStep(MoveStep.L20_WaitLabel);
LeftMoveInfo.log($"批量轴完成上升,等待贴标");
break;
case MoveStep.L20_WaitLabel:
case MoveStep.L20_WaitLabel:
break;
case MoveStep.L30_LabelFinish:
if (SafeReleaseLeftShelf)
......@@ -239,7 +240,7 @@ namespace DeviceLibrary
}
LeftMoveInfo.log("BatchAxisToP2 目标P2: " + targetP2 + "(" + currPosition + ")");
}
targetSpeed = Config.Left_Batch_P2_speed;
targetSpeed = (int)(Config.Left_Batch_P2_speed*0.7);
}
LeftMoveInfo.TimeOutSeconds = 200;
LeftMoveInfo.CanWhileCount = 0;
......@@ -276,6 +277,11 @@ namespace DeviceLibrary
{
int targetP1 = Left_Batch_Axis.GetAclPosition() - ConfigHelper.Config.Get("LeftAxisDownValue", 50) * Config.Left_Batch_ChangeValue;
int targetSpeed = Config.Left_Batch_P1_speed;
if (targetP1<=0)
{
LeftMoveInfo.log("出料提升机构,下降固定值小于0,设置回到0原点。");
targetP1 = 0;
}
Left_Batch_Axis.AbsMove(LeftMoveInfo, targetP1, targetSpeed);
}
}
......
......@@ -7,12 +7,13 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using OnlineStore.Common.util;
namespace DeviceLibrary
{
partial class MainMachine
{
void MiddleProcess()
{
if (CheckWait(MiddleMoveInfo))
......@@ -58,6 +59,9 @@ namespace DeviceLibrary
case MoveStep.M05:
if (clampTool.IsClamp() || IOValue(IO_Type.RightTop_Check).Equals(IO_VALUE.LOW))
{
bool isclamp = clampTool.IsClamp();
bool che = IOValue(IO_Type.RightTop_Check).Equals(IO_VALUE.LOW);
MiddleMoveInfo.log($"取起物料状态{isclamp};io状态{che}");
MiddleMoveInfo.NextMoveStep(MoveStep.M06);
RightMoveInfo.NextMoveStep(MoveStep.R11_NextReel);
MiddleMoveInfo.MoveParam.PlateW = GetTrayWidth();
......@@ -102,9 +106,8 @@ namespace DeviceLibrary
//else if (RightMoveInfo.MoveStep >= MoveStep.R06_GettedReelHigh && RightMoveInfo.MoveStep <= MoveStep.R10_WaitReelLeave)
else //if (LastHeightPos > 0)
{
MiddleMoveInfo.NextMoveStep(MoveStep.M07);
MiddleMoveInfo.NextMoveStep(MoveStep.M07);
MiddleMoveInfo.log($"开始往左侧料串移栽,{MiddleMoveInfo.MoveParam.ToStr()}");
}
//else if (MiddleMoveInfo.IsTimeOut(60))
//{
......@@ -112,30 +115,36 @@ namespace DeviceLibrary
//}
break;
case MoveStep.M07:
if (!Take_Middle_Axis.IsSafe(Config.Take_Middle_P3,out string msg))
if (!Take_Middle_Axis.IsSafe(Config.Take_Middle_P3, out string msg))
{
Msg.add(msg, MsgLevel.info);
}
else if (LeftMoveInfo.MoveStep == MoveStep.L10_WaitReelPut)
else if(LeftMoveInfo.MoveStep == MoveStep.L10_WaitReelPut)
{
if (true || clampTool.IsClamp())
if (clampTool.IsClamp())
{
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P3, Config.Take_Middle_P3_speed);
MiddleMoveInfo.log("左侧允许放料,旋转轴P3");
//MiddleMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftArm_Check, IO_VALUE.HIGH));
//调用标签打印
var kv = MiddleMoveInfo.MoveParam.Keyword.Select(k => $"{k.Key}={k.Value}").ToArray();
LogUtil.info("调用 PrintLabel 打印标签 StartPrintLabel ,[" + string.Join(", ", kv) + "] 开始");
string labelName = ConfigHelper.Config.Get(Setting_Init.LabelName);
if (RobotManage.printerHelper.Print(labelName, MiddleMoveInfo.MoveParam.Keyword, out msg))
MiddleMoveInfo.CanWhileCount--;
if (RobotManage.printerHelper.Print(labelName, MiddleMoveInfo.MoveParam.Keyword, out msg))
{
MiddleMoveInfo.NextMoveStep(MoveStep.M08);
UnifiedDataHandler.RecordPrintNg(false, true, out string[] strarrys);
}
else if (MiddleMoveInfo.CanWhileCount <= 0)
{
RobotManage.UserPause("打印失败超过五次,机器暂停,请检查打印机;");
Msg.add(msg, MsgLevel.warning);
}
else
{
Msg.add(msg, MsgLevel.warning);
}
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P3, Config.Take_Middle_P3_speed);
MiddleMoveInfo.log("左侧允许放料,旋转轴P3");
LogUtil.info("PrintLabel 打印标签 StartPrintLabel 结束 " + msg);
}
else
......@@ -144,12 +153,16 @@ namespace DeviceLibrary
//Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed);
MiddleMoveInfo.log("没有抓到料,继续下一步");
}
bool isclamp = clampTool.IsClamp();
bool che = IOValue(IO_Type.RightTop_Check).Equals(IO_VALUE.LOW);
MiddleMoveInfo.log($"取起物料状态{isclamp};io状态{che}");
}
else if (MiddleMoveInfo.IsTimeOut(60))
{
MiddleMoveInfo.log("等待左侧允许放料");
Msg.add(crc.GetString("Res0098","等待左侧允许放料"), MsgLevel.info);
Msg.add(crc.GetString("Res0098", "等待左侧允许放料"), MsgLevel.info);
}
break;
case MoveStep.M08:
MiddleMoveInfo.NextMoveStep(MoveStep.M09);
......@@ -162,8 +175,8 @@ namespace DeviceLibrary
MiddleMoveInfo.NextMoveStep(MoveStep.M10);
LeftMoveInfo.MoveParam = MiddleMoveInfo.MoveParam.clone();
LeftMoveInfo.NextMoveStep(MoveStep.L11_ReelPutted);
MiddleMoveInfo.log("取料夹爪放松,通知左侧料串已放入,左侧等待3秒");
LeftMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MiddleMoveInfo.log("取料夹爪放松,通知左侧料串已放入,左侧等待1秒");
LeftMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
else if (MiddleMoveInfo.IsTimeOut(10))
{
......@@ -238,6 +251,5 @@ namespace DeviceLibrary
return state;
}
}
}
\ No newline at end of file
using OnlineStore;
using CodeLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.Common.util;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Threading.Tasks;
namespace DeviceLibrary
{
......@@ -57,7 +55,7 @@ namespace DeviceLibrary
RightMoveInfo.NextMoveStep(MoveStep.R06_GettedReelInfo);
//GetHeight();
ScanCode();
RightMoveInfo.log($"开始扫码");//并获取上一盘料高度,LastHeight={LastHeight}
RightMoveInfo.log($"扫码开始");//并获取上一盘料高度,LastHeight={LastHeight}
}
}
else
......@@ -85,7 +83,7 @@ namespace DeviceLibrary
case MoveStep.R06_GettedReelInfo:
if (RightScanTask.IsCompleted)
{
var (x, k, s) = RightScanTask.Result;
var (x, k, s,b) = RightScanTask.Result;
if (ConfigHelper.Config.Get(Setting_Init.SaveReelPhoto, false))
{
string d = ConfigHelper.Config.Get(Setting_Init.ReelPhotoSaveDir);
......@@ -93,18 +91,22 @@ namespace DeviceLibrary
string df = Path.Combine(d, fn);
File.Copy(s, df);
}
if (x.Count == 0)
int pointX=-1; int pointY=-1;
b.TryGetValue("PointX", out pointX);
b.TryGetValue("PointY", out pointY);
if (x.Count == 0|| pointX<=0||pointY<=0)
{
RightMoveInfo.log($"未识别到有效二维码,转入NG箱");
RightMoveInfo.log($"未识别到有效二维码,转入NG箱;pointX={pointX};pointY={pointY}");
RightMoveInfo.MoveParam.IsNg = true;
UnifiedDataHandler.RecordPrintNg(false,false,out string[] strarrys);
}
else
{
RightMoveInfo.MoveParam.IsNg = false;
RightMoveInfo.MoveParam.codeInfos = x;
RightMoveInfo.MoveParam.Keyword = k;
RightMoveInfo.MoveParam.bitmapfilename = s;
RightMoveInfo.MoveParam.NewXYAngle = b;
if (!Common.codeProcess(RightMoveInfo.MoveParam, out string debugmsg))
{
RightMoveInfo.log($"未识别到有效码,转入NG箱" + debugmsg);
......@@ -116,7 +118,7 @@ namespace DeviceLibrary
}
RightMoveInfo.NextMoveStep(MoveStep.R10_WaitReelLeave);
}
else if (RightMoveInfo.IsTimeOut(10))
else if (RightMoveInfo.IsTimeOut(300))
{
RightMoveInfo.log($"等待扫码超时");
}
......@@ -251,17 +253,16 @@ namespace DeviceLibrary
{
state += string.Format(crc.GetString("Res0123.d86f0192","有料串,已提取{0}张料盘"), RightCount);
if (RightShelfNoTray)
state += crc.GetString("Res0100", ",料串已清空. ");
state += crc.GetString("Res0100", ",料串已清空. ")+"\r\n";
else
state += ".";
state += crc.GetString("Res0045", "当前ReelID:") + RightMoveInfo.MoveParam.WareCode;
}
}
else
{
return crc.GetString("Res0046", "无料串");
}
return state;
}
public bool IsScanRunning()
......@@ -274,7 +275,7 @@ namespace DeviceLibrary
/// <summary>
/// 扫码线程
/// </summary>
Task<(List<CodeInfo>, Dictionary<string, string>, string)> RightScanTask;
Task<(List<CodeInfo>, Dictionary<string, string>, string, Dictionary<string, int>)> RightScanTask;
void ScanCode()
{
RightMoveInfo.log("开始扫码");
......@@ -283,26 +284,27 @@ namespace DeviceLibrary
//RightMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
try
{
RightScanTask = Task.Run(new Func<(List<CodeInfo>, Dictionary<string, string>, string)>(() =>
RightScanTask = Task.Run(new Func<(List<CodeInfo>, Dictionary<string, string>, string, Dictionary<string, int>)>(() =>
{
IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
string filename;
Task.Delay(10).Wait();
List<CodeInfo> LastCodeList, LastCodeList2;
List<CodeInfo> LastCodeList;
Dictionary<string, string> keyword;
(LastCodeList, keyword, filename) = CodeManager.CameraScan(new List<string> { Config.RightCameraName });
LabelParam labelParam = new LabelParam();
labelParam.codeInfos = new List<CodeInfo>(LastCodeList);
if (!Common.codeProcess(labelParam, out _))
{
Task.Delay(500).Wait();
(LastCodeList2, keyword, filename) = CodeManager.CameraScan(new List<string> { Config.RightCameraName });
LastCodeList.AddRange(LastCodeList2);
}
Dictionary<string, int> newpointangle;
int plantw = GetTrayWidth();
(LastCodeList, keyword, filename, newpointangle) = CodeManager.CameraScan(new List<string> { Config.RightCameraName }, plantw);
//LabelParam labelParam = new LabelParam();
//labelParam.codeInfos = new List<CodeInfo>(LastCodeList);
//if (!Common.codeProcess(labelParam, out _))
//{
// Task.Delay(500).Wait();
// (LastCodeList2, keyword, filename) = CodeManager.CameraScan(new List<string> { Config.RightCameraName });
// LastCodeList.AddRange(LastCodeList2);
//}
//IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
return (LastCodeList, keyword, filename);
return (LastCodeList, keyword, filename, newpointangle);
}));
}
catch (Exception ex)
......@@ -341,7 +343,6 @@ namespace DeviceLibrary
//开始检测信号
Right_Batch_Axis.BatchAxisStartCheck(IO_Type.RightTop_Check, IO_VALUE.HIGH);
}
int RightEndMovePosition = 0;
int RightEndMovePosition = 0;
}
}
\ No newline at end of file
......@@ -34,14 +34,14 @@ namespace DeviceLibrary
public bool UserPause { get; set; } = false;
MoveInfo ResetMoveInfo;
public MoveInfo ResetMoveInfo { get; set; }
/// <summary>
/// 右侧移动信息
/// </summary>
public MoveInfo RightMoveInfo;
public MoveInfo LeftMoveInfo;
MoveInfo LabelMoveInfo;
MoveInfo MiddleMoveInfo;
public MoveInfo RightMoveInfo { get; set; }
public MoveInfo LeftMoveInfo { get; set; }
public MoveInfo LabelMoveInfo { get; set; }
public MoveInfo MiddleMoveInfo { get; set; }
public delegate void ProcessMsg(List<Msg> msg);
public event ProcessMsg ProcessMsgEvent;
......@@ -108,7 +108,8 @@ namespace DeviceLibrary
Label_Y_Axis.interference += Label_Y_Axis_interference;
Take_Middle_Axis.interference += Take_Middle_Axis_interference;
clampTool = RobotManage.clampTool;
CodeManager.LoadCamera(true);
//在LoadConfig中已经加载过了,此处不需要重复加载相机
//CodeManager.LoadCamera(true);
AlarmBuzzer.SetOnOffAction(() => { IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.HIGH); }, () => { IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW); });
LedProcessInit();
......@@ -320,6 +321,13 @@ namespace DeviceLibrary
get => LeftMoveInfo.MoveStep >= MoveStep.L60_InShelf || LeftMoveInfo.MoveStep >= MoveStep.L50_OutShelf
|| RightMoveInfo.MoveStep >= MoveStep.R30_OutShelf || RightMoveInfo.MoveStep >= MoveStep.R40_InShelf;
}
bool isManualfeeding
{
get => RightMoveInfo.MoveStep >= MoveStep.R40_InShelf || RightMoveInfo.MoveStep> MoveStep.R30_OutShelf
|| LeftMoveInfo.MoveStep >= MoveStep.L60_InShelf || LeftMoveInfo.MoveStep >= MoveStep.L50_OutShelf;
}
public bool IgnoreSafecheck = false;
public bool IgnoreGratingSignal = false;
......@@ -335,7 +343,7 @@ namespace DeviceLibrary
}
else if (IOValue(IO_Type.GratingSignal_Check).Equals(IO_VALUE.LOW))
{
if (!IgnoreSafecheck && !IgnoreGratingSignal && !isAgvRun
if (!IgnoreSafecheck && !IgnoreGratingSignal && !isAgvRun&&!isManualfeeding
&& IOValue(IO_Type.RightCar_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.LeftCar_Check).Equals(IO_VALUE.LOW))
{
......@@ -343,18 +351,17 @@ namespace DeviceLibrary
DeviceSuddenStop();
}
Msg.add(crc.GetString("Res0058", "安全光栅被遮挡") + (ok ? crc.GetString("Res0061", "[已忽略]") : ""), MsgLevel.warning);
}
if (IOValue(IO_Type.HasNgBox).Equals(IO_VALUE.LOW))
{
Msg.add(crc.GetString("Res0062", "没有检测到NG料箱"), MsgLevel.warning);
ok = false;
}
if (IOValue(IO_Type.HasPrinter).Equals(IO_VALUE.LOW))
{
Msg.add(crc.GetString("Res0063", "没有检测打印机"), MsgLevel.warning);
ok = false;
}
//if (IOValue(IO_Type.HasPrinter).Equals(IO_VALUE.LOW))
//{
// Msg.add(crc.GetString("Res0063", "没有检测打印机"), MsgLevel.warning);
// ok = false;
//}
if (IOValue(IO_Type.LeftBackDoor_Check).Equals(IO_VALUE.LOW))
{
if (!IgnoreSafecheck)
......@@ -458,6 +465,5 @@ namespace DeviceLibrary
}
return ok;
}
}
}
\ No newline at end of file
......@@ -105,7 +105,7 @@ namespace DeviceLibrary
TimeSpan span = DateTime.Now - LastSetpTime;
return span;
}
string lastmsg = "";
public string lastmsg = "";
public void log(string msg) {
msg = $"[{Name}][{moveStep}][{MoveParam.WareCode}]{msg}";
......
......@@ -32,7 +32,6 @@ namespace DeviceLibrary
try
{
mainMachine = null;
string msg = "";
string configFile = Path.Combine(baseDir, "config\\Config.csv");
Config = new Robot_Config(0, "", configFile);
......@@ -65,7 +64,6 @@ namespace DeviceLibrary
// IOManager.IOMove(IO_Type.Device_Led, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
LoadFinishEvent?.Invoke(IsDebug ? IsDebug : IsLoadOk, msg);
}
catch (Exception ex)
{
......@@ -103,10 +101,14 @@ namespace DeviceLibrary
public static void Stop()
{
LogUtil.info("开始停止系统.");
mainMachine?.ServerCM?.StopConnectServer();
mainMachine?.Stop();
mainMachine.UserPause = false;
isRunning = false;
if (mainMachine!=null)
{
mainMachine?.ServerCM?.StopConnectServer();
mainMachine?.Stop();
mainMachine.UserPause = false;
isRunning = false;
}
}
public static void ShutDown()
{
......
......@@ -34,10 +34,11 @@
<ItemGroup>
<Reference Include="Asa.PrintLabel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Asa.PrintLabel.dll</HintPath>
<HintPath>..\..\..\PrinLable-2\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\dll\CodeLibrary.dll</HintPath>
<Reference Include="CodeLibrary, Version=1.0.8498.33726, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\CameraLibraryProject\CameraLibraryProject\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="ConfigHelper">
<HintPath>..\dll\ConfigHelper.dll</HintPath>
......@@ -98,6 +99,7 @@
<Compile Include="AGVService\Schemas\RtnData.cs" />
<Compile Include="AutoScanAndLabel\AxisBean.cs" />
<Compile Include="AutoScanAndLabel\Common.cs" />
<Compile Include="AutoScanAndLabel\LabelingPosition.cs" />
<Compile Include="AutoScanAndLabel\LabelParam.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _IOMonitor.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _LedProcess.cs" />
......
......@@ -115,6 +115,5 @@ namespace DeviceLibrary
Thread.Sleep(100);
return IOManager.IOValue(IO_Type.Sucker_Release).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.Sucker_Clamp).Equals(IO_VALUE.LOW);
}
}
}
using OnlineStore.Common;
using Asa;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.Common.util;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -13,24 +17,31 @@ namespace DeviceLibrary
public Asa.PrintLabel print;
ZebraPrinterHelper.ZebraManger zebraManger;
string Port;
public bool istscprin = ConfigHelper.Config.Get("Hardwareversion", "V2") == "V2";
public PrinterHelper()
{
print = new Asa.PrintLabel(Application.StartupPath + "\\Label");
print = new Asa.PrintLabel(Application.StartupPath + "\\Label",300);
}
public static CustPrinterStatus LastPrintStatus = CustPrinterStatus.Unknown;
public bool Connection(string port)
{
Port = port;
//zebraManger = new ZebraPrinterHelper.ZebraManger(Port, ZebraPrinterHelper.ConnectionType.Network);
zebraManger = new ZebraPrinterHelper.ZebraManger("", ZebraPrinterHelper.ConnectionType.UsbDirect);
if (!zebraManger.Connection(out string msg))
if (istscprin)
{
LogUtil.error(msg);
return false;
print = new Asa.PrintLabel(Application.StartupPath + "\\Label", 300);
return true;
}
else
{
print = new Asa.PrintLabel(Application.StartupPath + "\\Label");
{
//默认使用老打印机
zebraManger = new ZebraPrinterHelper.ZebraManger("", ZebraPrinterHelper.ConnectionType.UsbDirect);
//zebraManger = new ZebraPrinterHelper.ZebraManger(Port, ZebraPrinterHelper.ConnectionType.Network);
if (!zebraManger.Connection(out string msg))
{
LogUtil.error(msg);
return false;
}
return true;
}
}
......@@ -49,16 +60,45 @@ namespace DeviceLibrary
public bool Print(string labelname, Dictionary<string, string> data, out string msg)
{
print.LoadLabel(labelname);
var bmp = print.PrintPreview(data);
if (!zebraManger.PrintImage(bmp, out msg))
if (istscprin)
{
LogUtil.error(msg);
return false;
LogUtil.error($"TSC_打印数据:{JsonHelper.SerializeObject(data)}" );
TscConfig tscConfig = new TscConfig();
tscConfig.Offset = ConfigHelper.Config.Get("Tsc_Offset", -17D);
tscConfig.Speed = ConfigHelper.Config.Get("Tsc_Speed", 9);
tscConfig.Density = ConfigHelper.Config.Get("Tsc_Density", 12);
tscConfig.GapOffset = ConfigHelper.Config.Get("Tsc_GapOffset", 0);
tscConfig.Gap = ConfigHelper.Config.Get("Tsc_Gap", 3);
if (!print.PrintToTsc_New(data,tscConfig, out TscStauts tscStauts,out Bitmap bmp))
{
msg = $"打印失败:{tscStauts.ToString()}";
LogUtil.error("打印失败原因:" + tscStauts.ToString());
return false;
}
if (bmp!=null)
{
string cid = ConfigHelper.Config.Get("CID");
_ = UnifiedDataHandler.PostSmfImageAsync(bmp,new Dictionary<string, string> { {"cid",cid+"_2" } }, bmp.Width, bmp.Height);
}
msg = $"打印成功";
return true;
}
bmp.Dispose();
return true;
else
{
var bmp = print.PrintPreview(data);
if (!zebraManger.PrintImage(bmp, out msg))
{
if (msg== "上一个标签尚未移走")
{
msg = crc.GetString("Res0224", "上一个标签尚未移走");
}
LogUtil.error(msg);
return false;
}
bmp.Dispose();
return true;
}
}
public Task<(bool, string)> IsLabelOnPeeler()
......
using HalconDotNet;
using Newtonsoft.Json;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.Common.util;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Security.Policy;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrackBar;
namespace DeviceLibrary
{
......@@ -49,7 +57,6 @@ namespace DeviceLibrary
if (!server.StartsWith("http"))
return;
SendLineStatus();
}
public void StartConnectServer()
{
......@@ -73,7 +80,7 @@ namespace DeviceLibrary
lineOperation.status = 1;
lineOperation.data = new Dictionary<string, string>();
lineOperation.data = lineOperation.data.Concat(GetAgvBtnStatus()).ToDictionary(x => x.Key, v => v.Value);
//lineOperation.data = lineOperation.data.Concat(GetAgvBtnStatus()).ToDictionary(x => x.Key, v => v.Value);
lineOperation.status = (int)storeStatus;
BoxStatus boxStatus = new BoxStatus();
......@@ -113,11 +120,13 @@ namespace DeviceLibrary
lineOperation.msgEn = lineOperation.msg;
lineOperation.msgJp = lineOperation.msg;
lineOperation.boxStatus.Add(StoreID, boxStatus);
//lineOperation.boxStatus.Add(StoreID, boxStatus);
lineOperation.data= lineOperation.data.Union(UnifiedDataHandler.PrintNgMESData()).ToDictionary(x=>x.Key,x=>x.Value);
lineOperation.showLogs = StepInformation(out Dictionary<string,string> dic);
lineOperation.data =lineOperation.data.Union(dic).ToDictionary(x => x.Key, x => x.Value);
return lineOperation;
}
private static string api_communication = "rest/djk/labeling/communication"; //流水线状态通信接口
private static string api_communication = "service/equipment/communication"; //流水线状态通信接口
public static string GetPostApi()
{
var host = server;
......@@ -182,14 +191,18 @@ namespace DeviceLibrary
}
public bool SendAgvLog(string msg)
{
if (!server.ToLower().StartsWith("http"))
{
return false;
}
lock (serverclock)
{
Operation operation = getLineBoxStatus();
operation.logList = new List<AgvLogInfo>
{
new AgvLogInfo(msg)
};
//operation.logList = new List<AgvLogInfo>
//{
// new AgvLogInfo(msg)
//};
//LogUtil.info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000);
......@@ -206,18 +219,22 @@ namespace DeviceLibrary
string mimoCid = ConfigHelper.Config.Get("MIMO_CID", "01");
public bool OpMIMO(string msg, Dictionary<string, string> operate)
{
if (!server.ToLower().StartsWith("http"))
{
return false;
}
lock (serverclock)
{
Operation operation = getLineBoxStatus();
operation.mimoOpMap = new Dictionary<string, Dictionary<string, string>>();
//operation.mimoOpMap = new Dictionary<string, Dictionary<string, string>>();
//Dictionary<string, string> op = new Dictionary<string, string>
//{
// { "Y10", "open" }
//};
//operation.mimoOpMap.Add("1", op);
operation.mimoOpMap.Add(mimoCid, operate);
//operation.mimoOpMap.Add(mimoCid, operate);
LogUtil.info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 1000);
......@@ -292,33 +309,33 @@ namespace DeviceLibrary
}
}
if (resultOperation.mimoOpMap != null)
{
foreach (var item in resultOperation.mimoOpMap)
{
Dictionary<string, string> dataMap = item.Value;
if (dataMap.ContainsKey(ParamDefine.SendEmptyShelf) && dataMap[ParamDefine.SendEmptyShelf].Equals(ParamDefine.doit))
{
AGVManager.CreateAGVTask(STDTaskType.MIMO_UNLOAD);
LogUtil.info(StoreName + $"收到服务器命令:MIMO({item.Key}) SendEmptyShelf=doit");
}
else if (dataMap.ContainsKey(ParamDefine.NeedEmptySHelf) && dataMap[ParamDefine.NeedEmptySHelf].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + $"收到服务器命令:MIMO({item.Key}) NeedEmptySHelf=doit 不执行");
}
else if (dataMap.ContainsKey(ParamDefine.SendFullShelf) && dataMap[ParamDefine.SendFullShelf].Equals(ParamDefine.doit))
{
AGVManager.CreateAGVTask(STDTaskType.MIMO_UNLOAD);
LogUtil.info(StoreName + $"收到服务器命令:MIMO({item.Key}) SendFullShelf=doit");
}
else if (dataMap.ContainsKey(ParamDefine.NeedFullShelf) && dataMap[ParamDefine.NeedFullShelf].Equals(ParamDefine.doit))
{
AGVManager.CreateAGVTask(STDTaskType.MIMO_LOAD);
LogUtil.info(StoreName + $"收到服务器命令:MIMO({item.Key}) NeedFullShelf=doit");
}
}
}
//if (resultOperation.mimoOpMap != null)
//{
// foreach (var item in resultOperation.mimoOpMap)
// {
// Dictionary<string, string> dataMap = item.Value;
// if (dataMap.ContainsKey(ParamDefine.SendEmptyShelf) && dataMap[ParamDefine.SendEmptyShelf].Equals(ParamDefine.doit))
// {
// AGVManager.CreateAGVTask(STDTaskType.MIMO_UNLOAD);
// LogUtil.info(StoreName + $"收到服务器命令:MIMO({item.Key}) SendEmptyShelf=doit");
// }
// else if (dataMap.ContainsKey(ParamDefine.NeedEmptySHelf) && dataMap[ParamDefine.NeedEmptySHelf].Equals(ParamDefine.doit))
// {
// LogUtil.info(StoreName + $"收到服务器命令:MIMO({item.Key}) NeedEmptySHelf=doit 不执行");
// }
// else if (dataMap.ContainsKey(ParamDefine.SendFullShelf) && dataMap[ParamDefine.SendFullShelf].Equals(ParamDefine.doit))
// {
// AGVManager.CreateAGVTask(STDTaskType.MIMO_UNLOAD);
// LogUtil.info(StoreName + $"收到服务器命令:MIMO({item.Key}) SendFullShelf=doit");
// }
// else if (dataMap.ContainsKey(ParamDefine.NeedFullShelf) && dataMap[ParamDefine.NeedFullShelf].Equals(ParamDefine.doit))
// {
// AGVManager.CreateAGVTask(STDTaskType.MIMO_LOAD);
// LogUtil.info(StoreName + $"收到服务器命令:MIMO({item.Key}) NeedFullShelf=doit");
// }
// }
//}
}
......@@ -371,8 +388,60 @@ namespace DeviceLibrary
path = path.Substring(0, path.Length - 1);
return path;
}
/// <summary>
/// 获取模板信息
/// </summary>
/// <returns></returns>
public List<EquipMsg> StepInformation(out Dictionary<string,string> dic)
{
dic = new Dictionary<string,string>();
List<EquipMsg> equipMsgs = new List<EquipMsg>();
try
{
PropertyInfo[] properties = typeof(DeviceLibrary.MainMachine).GetProperties();
foreach (var property in properties)
{
if (property.PropertyType == typeof(MoveInfo))
{
EquipMsg msg = new EquipMsg();
MoveInfo addressValue = (MoveInfo)property.GetValue(RobotManage.mainMachine);
if (addressValue.Name != crc.GetString("Res0053", "重置"))
{
//msg.msgCode = lang;
msg.module = addressValue.Name;
//msg.msg = addressValue.MoveStep.ToString();
//msg.msgParams = new string[1] { addressValue.lastmsg };
//msg.msgParams = new string[] { addressValue.GetStateStr() };
msg.msg = addressValue.GetStateStr();
equipMsgs.Add(msg);
if (addressValue.Name== crc.GetString("Res0039", "右侧取料"))
{
dic.Add("inShelfType", ShelfType.smallReel.ToString());
dic.Add("inShelfStatus", UnifiedDataHandler.ShelfStatus(true,Convert.ToInt32(addressValue.MoveStep)));
}
if (addressValue.Name== crc.GetString("Res0051", "左侧放料"))
{
dic.Add("outShelfType", ShelfType.smallReel.ToString());
dic.Add("outShelfStatus", UnifiedDataHandler.ShelfStatus(false, Convert.ToInt32(addressValue.MoveStep)));
}
}
}
}
var printstatus = PrinterHelper.LastPrintStatus;
EquipMsg equip = new EquipMsg()
{
module = crc.GetString("Res0216", "打印机"),
msg = (printstatus == CustPrinterStatus.Unknown) ? "Wait" : printstatus.ToString(),
};
}
catch (Exception ex)
{
LogUtil.error($"获取模块信息出错:{ex}!");
}
return equipMsgs;
}
}
public class ResultData
{
......
......@@ -362,7 +362,7 @@ namespace DeviceLibrary
else
{
string mode = HCBoardManager.AxisPrfMode(modeValue);
lblAxisPrfMode.Text = mode;
lblAxisPrfMode.Text = string.IsNullOrWhiteSpace(mode)&&mode.Length>0?mode[0].ToString().Replace("=",""): crc.GetString("Res0223", "未知数");
}
......@@ -398,7 +398,7 @@ namespace DeviceLibrary
short value = HCBoardManager.GetHomeStatus(axisNo);
string homesstr = HCBoardManager.AxisHomeSts(value);
lblhomeSts.Text = homesstr;
lblhomeSts.Text = homesstr!=null&&homesstr.Length>0?homesstr[0].ToString().Replace("=", "") : crc.GetString("Res0223", "未知数");
}
private void ShowlbSts(Label lbl, int value,bool isAlarm=false )
{
......
......@@ -13,7 +13,7 @@ namespace OnlineStore.LoadCSVLibrary
public class CSVReaderBase
{
public static char Spilt_Char = ',';
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// 获取一个类所有的《字段,AttributeName列名》集合
/// </summary>
......@@ -34,7 +34,6 @@ namespace OnlineStore.LoadCSVLibrary
}
}
}
return proCsvMap;
}
/// <summary>
......@@ -169,5 +168,4 @@ namespace OnlineStore.LoadCSVLibrary
return titleIndex;
}
}
}
......@@ -82,16 +82,16 @@ namespace OnlineStore.LoadCSVLibrary
List<string> checkFiledList = new List<string>(proNameList);
Dictionary<string, int> proIndexMap = new Dictionary<string, int>();
for (int i = 0; i<cvsTitleList.Count; i++)
for (int i = 0; i<cvsTitleList.Count; i++)
{
proIndexMap.Add(cvsTitleList[i], i);
proIndexMap.Add(cvsTitleList[i], i);
}
foreach (string key in cvsTitleList)
foreach (string key in cvsTitleList)
{
try
{
if (allTitleIndex.ContainsKey(key))
{
{
try
{
int titIndex = allTitleIndex[key];
......@@ -138,7 +138,7 @@ namespace OnlineStore.LoadCSVLibrary
public static DeviceConfig LoadConfig(DeviceConfig config)
{
LogUtil.info("开始读取文件:" + config.ConfigFilePath);
LogUtil.info("开始读取文件加载io:" + config.ConfigFilePath);
if (config == null || config.ConfigFilePath.Equals(""))
{
throw new Exception("没有配置配置文件路径");
......
......@@ -172,7 +172,8 @@ namespace OnlineStore.LoadCSVLibrary
{
get
{
return ElectricalDefinition + "-" + Explain + "-" + ProName + "";
//return ElectricalDefinition + "-" + Explain + "-" + ProName + "";
return ElectricalDefinition + "-" + ProName + "";
}
set
{
......
......@@ -262,8 +262,5 @@ namespace OnlineStore.LoadCSVLibrary
public static string OutputDevice = "OutputDevice";
public static string InputDevice = "InputDevice";
}
}
......@@ -131,11 +131,11 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// DI,0,吸嘴气缸前进端,LabelCylinder_Fwd,25,HC,X25,,,,,,,,,,
/// </summary>
//public static string LabelCylinder_Fwd = "LabelCylinder_Fwd";
public static string LabelCylinder_Fwd = "LabelCylinder_Fwd";
/// <summary>
/// DI,0,吸嘴气缸后退端,LabelCylinder_Bck,26,HC,X26,,,,,,,,,,
/// </summary>
// public static string LabelCylinder_Bck = "LabelCylinder_Bck";
public static string LabelCylinder_Bck = "LabelCylinder_Bck";
#endregion
#region X25/26内容
/// <summary>
......
......@@ -418,6 +418,16 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("Label_Y_P3_speed")]
public int Label_Y_P3_speed { get; set; }
/// <summary>
/// PRO,0,贴标覆盖X轴偏移量,Label_XOffset,200,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("Label_XOffset")]
public int Label_XOffset { get; set; }
/// <summary>
/// PRO,0,贴标覆盖X轴偏移量,Label_YOffset,200,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("Label_YOffset")]
public int Label_YOffset { get; set; }
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!