Commit b99a1c3f 夏萍

1

1 个父辈 1ad17547
...@@ -50,8 +50,7 @@ namespace AutoScanAndLabel ...@@ -50,8 +50,7 @@ namespace AutoScanAndLabel
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel.Location = new System.Drawing.Point(14, 12); this.tableLayoutPanel.Location = new System.Drawing.Point(9, 8);
this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tableLayoutPanel.Name = "tableLayoutPanel"; this.tableLayoutPanel.Name = "tableLayoutPanel";
this.tableLayoutPanel.RowCount = 6; this.tableLayoutPanel.RowCount = 6;
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, 10F));
...@@ -60,17 +59,17 @@ namespace AutoScanAndLabel ...@@ -60,17 +59,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, 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, 50F));
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, 10F));
this.tableLayoutPanel.Size = new System.Drawing.Size(624, 367); this.tableLayoutPanel.Size = new System.Drawing.Size(417, 245);
this.tableLayoutPanel.TabIndex = 0; this.tableLayoutPanel.TabIndex = 0;
// //
// labelProductName // labelProductName
// //
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProductName.Location = new System.Drawing.Point(90, 0); this.labelProductName.Location = new System.Drawing.Point(60, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(9, 0, 4, 0); this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 24); this.labelProductName.MaximumSize = new System.Drawing.Size(0, 16);
this.labelProductName.Name = "labelProductName"; this.labelProductName.Name = "labelProductName";
this.labelProductName.Size = new System.Drawing.Size(530, 24); this.labelProductName.Size = new System.Drawing.Size(354, 16);
this.labelProductName.TabIndex = 19; this.labelProductName.TabIndex = 19;
this.labelProductName.Text = "产品名称"; this.labelProductName.Text = "产品名称";
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
...@@ -78,11 +77,11 @@ namespace AutoScanAndLabel ...@@ -78,11 +77,11 @@ namespace AutoScanAndLabel
// labelVersion // labelVersion
// //
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.Location = new System.Drawing.Point(90, 36); this.labelVersion.Location = new System.Drawing.Point(60, 24);
this.labelVersion.Margin = new System.Windows.Forms.Padding(9, 0, 4, 0); this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 24); this.labelVersion.MaximumSize = new System.Drawing.Size(0, 16);
this.labelVersion.Name = "labelVersion"; this.labelVersion.Name = "labelVersion";
this.labelVersion.Size = new System.Drawing.Size(530, 24); this.labelVersion.Size = new System.Drawing.Size(354, 16);
this.labelVersion.TabIndex = 0; this.labelVersion.TabIndex = 0;
this.labelVersion.Tag = "not"; this.labelVersion.Tag = "not";
this.labelVersion.Text = "版本"; this.labelVersion.Text = "版本";
...@@ -92,11 +91,11 @@ namespace AutoScanAndLabel ...@@ -92,11 +91,11 @@ namespace AutoScanAndLabel
// labelCopyright // labelCopyright
// //
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCopyright.Location = new System.Drawing.Point(90, 72); this.labelCopyright.Location = new System.Drawing.Point(60, 48);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(9, 0, 4, 0); this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 24); this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 16);
this.labelCopyright.Name = "labelCopyright"; this.labelCopyright.Name = "labelCopyright";
this.labelCopyright.Size = new System.Drawing.Size(530, 24); this.labelCopyright.Size = new System.Drawing.Size(354, 16);
this.labelCopyright.TabIndex = 21; this.labelCopyright.TabIndex = 21;
this.labelCopyright.Text = "版权"; this.labelCopyright.Text = "版权";
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
...@@ -104,11 +103,11 @@ namespace AutoScanAndLabel ...@@ -104,11 +103,11 @@ namespace AutoScanAndLabel
// labelCompanyName // labelCompanyName
// //
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCompanyName.Location = new System.Drawing.Point(90, 108); this.labelCompanyName.Location = new System.Drawing.Point(60, 72);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(9, 0, 4, 0); this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 24); this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 16);
this.labelCompanyName.Name = "labelCompanyName"; this.labelCompanyName.Name = "labelCompanyName";
this.labelCompanyName.Size = new System.Drawing.Size(530, 24); this.labelCompanyName.Size = new System.Drawing.Size(354, 16);
this.labelCompanyName.TabIndex = 22; this.labelCompanyName.TabIndex = 22;
this.labelCompanyName.Text = "公司名称"; this.labelCompanyName.Text = "公司名称";
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
...@@ -116,13 +115,13 @@ namespace AutoScanAndLabel ...@@ -116,13 +115,13 @@ namespace AutoScanAndLabel
// textBoxDescription // textBoxDescription
// //
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxDescription.Location = new System.Drawing.Point(90, 149); this.textBoxDescription.Location = new System.Drawing.Point(60, 99);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(9, 5, 4, 5); this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.textBoxDescription.Multiline = true; this.textBoxDescription.Multiline = true;
this.textBoxDescription.Name = "textBoxDescription"; this.textBoxDescription.Name = "textBoxDescription";
this.textBoxDescription.ReadOnly = true; this.textBoxDescription.ReadOnly = true;
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxDescription.Size = new System.Drawing.Size(530, 173); this.textBoxDescription.Size = new System.Drawing.Size(354, 116);
this.textBoxDescription.TabIndex = 23; this.textBoxDescription.TabIndex = 23;
this.textBoxDescription.TabStop = false; this.textBoxDescription.TabStop = false;
this.textBoxDescription.Text = "说明"; this.textBoxDescription.Text = "说明";
...@@ -131,10 +130,9 @@ namespace AutoScanAndLabel ...@@ -131,10 +130,9 @@ namespace AutoScanAndLabel
// //
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(508, 332); this.okButton.Location = new System.Drawing.Point(339, 222);
this.okButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.okButton.Name = "okButton"; this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(112, 30); this.okButton.Size = new System.Drawing.Size(75, 20);
this.okButton.TabIndex = 24; this.okButton.TabIndex = 24;
this.okButton.Text = "确定(&O)"; this.okButton.Text = "确定(&O)";
this.okButton.Click += new System.EventHandler(this.okButton_Click); this.okButton.Click += new System.EventHandler(this.okButton_Click);
...@@ -142,16 +140,15 @@ namespace AutoScanAndLabel ...@@ -142,16 +140,15 @@ namespace AutoScanAndLabel
// AboutBox1 // AboutBox1
// //
this.AcceptButton = this.okButton; this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(652, 391); this.ClientSize = new System.Drawing.Size(435, 261);
this.Controls.Add(this.tableLayoutPanel); this.Controls.Add(this.tableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "AboutBox1"; this.Name = "AboutBox1";
this.Padding = new System.Windows.Forms.Padding(14, 12, 14, 12); this.Padding = new System.Windows.Forms.Padding(9, 8, 9, 8);
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
......
...@@ -18,6 +18,7 @@ using static RemoteDecodeHelper_mod; ...@@ -18,6 +18,7 @@ using static RemoteDecodeHelper_mod;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using PrintLabel; using PrintLabel;
using OnlineStore.Common.util;
namespace AutoScanAndLabel namespace AutoScanAndLabel
{ {
...@@ -403,6 +404,7 @@ namespace AutoScanAndLabel ...@@ -403,6 +404,7 @@ namespace AutoScanAndLabel
else if (!userpause) else if (!userpause)
{ {
userpause = true; userpause = true;
btn_stop.Enabled = true;
RobotManage.UserPause(userpause); RobotManage.UserPause(userpause);
LogUtil.info("用户按下暂停1"); LogUtil.info("用户按下暂停1");
} }
...@@ -410,6 +412,7 @@ namespace AutoScanAndLabel ...@@ -410,6 +412,7 @@ namespace AutoScanAndLabel
{ {
userpause = false; userpause = false;
RobotManage.UserPause(userpause); RobotManage.UserPause(userpause);
btn_stop.Enabled = true;
LogUtil.info("用户取消暂停2"); LogUtil.info("用户取消暂停2");
} }
...@@ -820,11 +823,15 @@ namespace AutoScanAndLabel ...@@ -820,11 +823,15 @@ namespace AutoScanAndLabel
tabControl1.TabPages[tc - i].Parent = null; tabControl1.TabPages[tc - i].Parent = null;
} }
} }
int LeftCount = 0;
private void btnUploadTest_Click(object sender, EventArgs e) private void btnUploadTest_Click(object sender, EventArgs e)
{ {
FrmUploadTest frmUploadTest = new FrmUploadTest(); //FrmUploadTest frmUploadTest = new FrmUploadTest();
frmUploadTest.ShowDialog(); //frmUploadTest.ShowDialog();
//UnifiedDataHandler.RecordPrintNg(false, false, out string[] strarrys);
//int Xoffset = RobotManage.Config.Label_XOffset;
//int Yoffset = RobotManage.Config.Label_YOffset;
ConfigHelper.Config.Set<int>("LeftCount", LeftCount++);
} }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,7 @@ using System.Collections.Generic; ...@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
...@@ -36,15 +37,17 @@ namespace OnlineStore.Common.util ...@@ -36,15 +37,17 @@ namespace OnlineStore.Common.util
{ {
string json = File.ReadAllText(txtpath); string json = File.ReadAllText(txtpath);
if (!string.IsNullOrWhiteSpace(json)) if (!string.IsNullOrWhiteSpace(json)&& !json.All(c=>c=='\0'))
{ {
string[] strings = JsonConvert.DeserializeObject<string[]>(json); string[] strings = JsonConvert.DeserializeObject<string[]>(json);
if (strings.Length > 0)
if (strings[0] == DateTime.Today.ToString("dd-MM-yyyy"))
{ {
strs[0] = strings[0]; if (strings[0] == DateTime.Today.ToString("dd-MM-yyyy"))
strs[1] = strings[1]; {
strs[2] = strings[2]; strs[0] = strings[0];
strs[1] = strings[1];
strs[2] = strings[2];
}
} }
} }
} }
......
...@@ -173,6 +173,8 @@ namespace DeviceLibrary ...@@ -173,6 +173,8 @@ namespace DeviceLibrary
else else
{ {
RobotManage.mainMachine.RightMoveInfo.NewMove(MoveStep.R30_OutShelf);//等待agv到位后执行,启动料串离开 RobotManage.mainMachine.RightMoveInfo.NewMove(MoveStep.R30_OutShelf);//等待agv到位后执行,启动料串离开
LogUtil.info("AGVManager:下料请求,等待agv到位后执行,启动料串离开");
} }
} }
else if (DeviceCheckDto.UNLOAD_DONE.Equals(deviceCheckDto.operate))//下料完成 else if (DeviceCheckDto.UNLOAD_DONE.Equals(deviceCheckDto.operate))//下料完成
...@@ -349,23 +351,29 @@ namespace DeviceLibrary ...@@ -349,23 +351,29 @@ namespace DeviceLibrary
} }
static void sendAgvLog(string msg) static void sendAgvLog(string msg)
{ {
Task.Factory.StartNew(() => if (ServerCommunication.EnableHttpServer)
{
Task.Factory.StartNew(() =>
{ {
while (!RobotManage.mainMachine.ServerCM.SendAgvLog(msg)) while (!RobotManage.mainMachine.ServerCM.SendAgvLog(msg))
{ {
Thread.Sleep(500); Thread.Sleep(500);
} }
}); });
}
} }
static void sendOpMimoCmd(string opMsg, Dictionary<string, string> op) static void sendOpMimoCmd(string opMsg, Dictionary<string, string> op)
{ {
Task.Factory.StartNew(() => if (ServerCommunication.EnableHttpServer)
{ {
while (!RobotManage.mainMachine.ServerCM.OpMIMO(opMsg, op)) Task.Factory.StartNew(() =>
{ {
Thread.Sleep(500); while (!RobotManage.mainMachine.ServerCM.OpMIMO(opMsg, op))
} {
}); Thread.Sleep(500);
}
});
}
} }
/// <summary> /// <summary>
/// 创建AGV运输任务 /// 创建AGV运输任务
......
...@@ -15,22 +15,24 @@ namespace DeviceLibrary ...@@ -15,22 +15,24 @@ namespace DeviceLibrary
{ {
void BtnProcess() void BtnProcess()
{ {
string isskiptest = ConfigHelper.Config.Get("Hardwareversion","V2"); string isskiptest = ConfigHelper.Config.Get("Hardwareversion", "V2");
if (isskiptest=="V2") string newagvdispose = ConfigHelper.Config.Get("HardwareversionofAGV", "V2");
if (isskiptest == "V2")
{ {
//硬件v2版本,已经去除料车检测X11的io //硬件v2版本,已经去除料车检测X11的io
if ((RightMoveInfo.IsStep(MoveStep.Wait)|| RightMoveInfo.IsStep(MoveStep.REND)) if ((RightMoveInfo.IsStep(MoveStep.Wait) || RightMoveInfo.IsStep(MoveStep.REND))
&& IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH)) && IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH))
{ {
//有料,出料,无料,进料 //有料,出料,无料,进料
if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH))
{ {
RightMoveInfo.NewMove(MoveStep.R30_OutShelf); RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
LogUtil.info("BtnProcess:进料串感应到有料,进料口确认");
} }
else else
{ {
RightMoveInfo.NewMove(MoveStep.R40_InShelf); RightMoveInfo.NewMove(MoveStep.R40_InShelf);
} }
} }
if ((LeftMoveInfo.IsStep(MoveStep.Wait) || LeftMoveInfo.IsStep(MoveStep.LEND) || LeftMoveInfo.IsStep(MoveStep.L10_WaitReelPut)) if ((LeftMoveInfo.IsStep(MoveStep.Wait) || LeftMoveInfo.IsStep(MoveStep.LEND) || LeftMoveInfo.IsStep(MoveStep.L10_WaitReelPut))
...@@ -43,7 +45,39 @@ namespace DeviceLibrary ...@@ -43,7 +45,39 @@ namespace DeviceLibrary
else else
{ {
LeftMoveInfo.NewMove(MoveStep.L60_InShelf); LeftMoveInfo.NewMove(MoveStep.L60_InShelf);
} }
}
}
else if (newagvdispose == "V2")
{
if ((RightMoveInfo.IsStep(MoveStep.Wait) || RightMoveInfo.IsStep(MoveStep.REND))
&& IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightCar_Check).Equals(IO_VALUE.HIGH))
{
//有料,出料,无料,进料
if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH))
{
RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
LogUtil.info("BtnProcess:进料串感应到有料,进料口确认");
}
else
{
RightMoveInfo.NewMove(MoveStep.R40_InShelf);
}
}
if ((LeftMoveInfo.IsStep(MoveStep.Wait) || LeftMoveInfo.IsStep(MoveStep.LEND) || LeftMoveInfo.IsStep(MoveStep.L10_WaitReelPut))
&& IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftCar_Check).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 else
...@@ -55,6 +89,7 @@ namespace DeviceLibrary ...@@ -55,6 +89,7 @@ namespace DeviceLibrary
&& IOValue(IO_Type.RightCar_Check).Equals(IO_VALUE.HIGH)) && IOValue(IO_Type.RightCar_Check).Equals(IO_VALUE.HIGH))
{ {
RightMoveInfo.NewMove(MoveStep.R30_OutShelf); RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
LogUtil.info("BtnProcess:进料串感应到有料,进料口确认,检测到小车");
} }
//右侧按钮按下,无料,阻挡下降 //右侧按钮按下,无料,阻挡下降
else if (RightMoveInfo.IsStep(MoveStep.Wait) else if (RightMoveInfo.IsStep(MoveStep.Wait)
...@@ -78,7 +113,7 @@ namespace DeviceLibrary ...@@ -78,7 +113,7 @@ namespace DeviceLibrary
{ {
CylinderMove(null, IO_Type.LeftStopUP, IO_Type.LeftStopDown); CylinderMove(null, IO_Type.LeftStopUP, IO_Type.LeftStopDown);
} }
} }
} }
} }
} }
...@@ -10,36 +10,79 @@ namespace DeviceLibrary ...@@ -10,36 +10,79 @@ namespace DeviceLibrary
{ {
//agv感应io处理逻辑 //agv感应io处理逻辑
string isskiptest = ConfigHelper.Config.Get("Hardwareversion", "V2"); string isskiptest = ConfigHelper.Config.Get("Hardwareversion", "V2");
//新的AGV信号处理逻辑
string newagvdispose = ConfigHelper.Config.Get("HardwareversionofAGV", "V2");
if (isskiptest == "V2") if (isskiptest == "V2")
{ {
if ((RightMoveInfo.IsStep(MoveStep.Wait) || RightMoveInfo.IsStep(MoveStep.REND))) 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) // && IOValue(IO_Type.FeedAGV_Feed).Equals(IO_VALUE.LOW) && IOValue(IO_Type.FeedAGV_Feed).Equals(IO_VALUE.LOW)
//无料且无agv送料请求转到进料步骤
if (IOValue(IO_Type.RightEnd_Check).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); //Msg.add("入料口有料串,请将料串先取出!", MsgLevel.warning);
RightMoveInfo.NewMove(MoveStep.R40_InShelf); RightMoveInfo.NewMove(MoveStep.R40_InShelf);
} }
//有料无AGV进料请求转到出料步骤
else if(IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.FeedAGV_Receiving).Equals(IO_VALUE.LOW)) 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); RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
LogUtil.info("IOMonitor:进料串感应到有料");
} }
} }
if ((LeftMoveInfo.IsStep(MoveStep.Wait) || LeftMoveInfo.IsStep(MoveStep.LEND))) if ((LeftMoveInfo.IsStep(MoveStep.Wait) || LeftMoveInfo.IsStep(MoveStep.LEND)))
{ {
//&& && IOValue(IO_Type.DischargeAGV_Receiving).Equals(IO_VALUE.LOW) //&& && IOValue(IO_Type.DischargeAGV_Receiving).Equals(IO_VALUE.LOW)
//无料且无agv收料请求转到进料步骤
if (IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.LOW)&& IOValue(IO_Type.DischargeAGV_Feeding).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); 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)) //有料无AGV收料请求转到出料步骤
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); LeftMoveInfo.NewMove(MoveStep.L50_OutShelf);
} }
} }
} }
if (newagvdispose == "V2")
{
if ((RightMoveInfo.IsStep(MoveStep.Wait) || RightMoveInfo.IsStep(MoveStep.REND)))
{
//按下确认按钮有料串出没有进
if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.RightCar_Check).Equals(IO_VALUE.HIGH)
&& (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.DischargeAGV_Feeding).Equals(IO_VALUE.HIGH)))
{
RightMoveInfo.NewMove(MoveStep.R40_InShelf);
}
else if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightCar_Check).Equals(IO_VALUE.HIGH)
&& (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.FeedAGV_Receiving).Equals(IO_VALUE.HIGH)))
{
RightMoveInfo.NewMove(MoveStep.R30_OutShelf);
}
}
if ((LeftMoveInfo.IsStep(MoveStep.Wait) || LeftMoveInfo.IsStep(MoveStep.LEND)))
{
if (IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.LeftCar_Check).Equals(IO_VALUE.HIGH)
&& (IOValue(IO_Type.DischargeAGV_Feeding).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)))
{
LeftMoveInfo.NewMove(MoveStep.L60_InShelf);
}
else if (IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftCar_Check).Equals(IO_VALUE.HIGH)
&& (IOValue(IO_Type.DischargeAGV_Receiving).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH)))
{
LeftMoveInfo.NewMove(MoveStep.L50_OutShelf);
}
}
}
//等待步骤且进料前端有料后端无料进入进料步骤
if (RightMoveInfo.IsStep(MoveStep.Wait) if (RightMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.RightFornt_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.RightFornt_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.LOW)) && IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.LOW))
...@@ -47,6 +90,7 @@ namespace DeviceLibrary ...@@ -47,6 +90,7 @@ namespace DeviceLibrary
RightMoveInfo.NewMove(MoveStep.R40_InShelf); RightMoveInfo.NewMove(MoveStep.R40_InShelf);
LogUtil.info("IOMonitor:右侧检测到入料信号"); LogUtil.info("IOMonitor:右侧检测到入料信号");
} }
//等待步骤且料串到位且并非料盘取完的步骤转到上料步骤
if (RightMoveInfo.IsStep(MoveStep.Wait) if (RightMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH)
&& !RightShelfNoTray) && !RightShelfNoTray)
...@@ -55,7 +99,7 @@ namespace DeviceLibrary ...@@ -55,7 +99,7 @@ namespace DeviceLibrary
LogUtil.info("IOMonitor:右侧有新料,准备上料"); LogUtil.info("IOMonitor:右侧有新料,准备上料");
} }
//等待步骤且前端有料后端无料进入进料步骤
if (LeftMoveInfo.IsStep(MoveStep.Wait) if (LeftMoveInfo.IsStep(MoveStep.Wait)
&& IOValue(IO_Type.LeftFornt_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.LeftFornt_Check).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.LOW)) && IOValue(IO_Type.LeftEnd_Check).Equals(IO_VALUE.LOW))
......
...@@ -17,6 +17,26 @@ namespace DeviceLibrary ...@@ -17,6 +17,26 @@ namespace DeviceLibrary
int LeftCount = 0; int LeftCount = 0;
public bool SafeReleaseLeftShelf = false; public bool SafeReleaseLeftShelf = false;
int Uppre = -1000;
int Uplast = -1000;
int step = 0;
/// <summary>
/// 料盘高度单位脉冲
/// </summary>
public int PlwHight
{
get
{
int hight = 0;
//if (Uppre != -1000 && Uplast != -1000&&step==3)
if (Uppre != -1000 && Uplast != -1000 && step == 2)
{
hight = Math.Abs(Uplast - Uppre) + 2000;
RightMoveInfo.log($"料盘高度计算:hight:{hight},Uppre:{Uppre},Uplast:{Uplast}");
}
return hight;
}
}
void LeftProcess() void LeftProcess()
{ {
if (CheckWait(LeftMoveInfo)) if (CheckWait(LeftMoveInfo))
...@@ -24,6 +44,7 @@ namespace DeviceLibrary ...@@ -24,6 +44,7 @@ namespace DeviceLibrary
switch (LeftMoveInfo.MoveStep) switch (LeftMoveInfo.MoveStep)
{ {
//阻挡上升,轴到p2
case MoveStep.L01: case MoveStep.L01:
LeftCount = 0; LeftCount = 0;
LeftShelfNoTray = false; LeftShelfNoTray = false;
...@@ -31,17 +52,22 @@ namespace DeviceLibrary ...@@ -31,17 +52,22 @@ namespace DeviceLibrary
CylinderMove(null, IO_Type.LeftStopDown, IO_Type.LeftStopUP); CylinderMove(null, IO_Type.LeftStopDown, IO_Type.LeftStopUP);
LeftBatchAxisToP2(true); LeftBatchAxisToP2(true);
LeftMoveInfo.log($"批量轴上升到P2位置,第一次提升,LeftStartMovePosition={LeftStartMovePosition}"); LeftMoveInfo.log($"批量轴上升到P2位置,第一次提升,LeftStartMovePosition={LeftStartMovePosition}");
step = 1;
break; break;
//没有这个步骤
case MoveStep.L02: case MoveStep.L02:
LeftMoveInfo.NextMoveStep(MoveStep.L03); LeftMoveInfo.NextMoveStep(MoveStep.L03);
LeftBatchAxisToP2(false); LeftBatchAxisToP2(false);
LeftMoveInfo.log($"批量轴上升到P2位置,二次提升,LeftStartMovePosition={LeftStartMovePosition}"); LeftMoveInfo.log($"批量轴上升到P2位置,二次提升,LeftStartMovePosition={LeftStartMovePosition}");
break; break;
//轴下降一点
case MoveStep.L03: case MoveStep.L03:
LeftMoveInfo.NextMoveStep(MoveStep.L04); LeftMoveInfo.NextMoveStep(MoveStep.L04);
//int currpot = Left_Batch_Axis.GetAclPosition();
LeftBatchAxisDown(); LeftBatchAxisDown();
LeftMoveInfo.log($"批量轴下降固定值"); LeftMoveInfo.log($"批量轴下降固定值");
break; break;
//根据轴位置判断去料串满步骤还是不满步骤
case MoveStep.L04: case MoveStep.L04:
var currpos = Left_Batch_Axis.GetAclPosition(); var currpos = Left_Batch_Axis.GetAclPosition();
if (currpos <= Config.Left_Batch_P1) if (currpos <= Config.Left_Batch_P1)
...@@ -54,16 +80,26 @@ namespace DeviceLibrary ...@@ -54,16 +80,26 @@ namespace DeviceLibrary
LeftMoveInfo.NextMoveStep(MoveStep.L10_WaitReelPut); LeftMoveInfo.NextMoveStep(MoveStep.L10_WaitReelPut);
} }
break; break;
//等中间步骤抓盘
case MoveStep.L10_WaitReelPut: case MoveStep.L10_WaitReelPut:
Msg.add(crc.GetString("Res0095", "左侧空闲中"), MsgLevel.info); Msg.add(crc.GetString("Res0095", "左侧空闲中"), MsgLevel.info);
break; break;
//中间步骤给盘,下降一点,获取盘信息
case MoveStep.L11_ReelPutted: case MoveStep.L11_ReelPutted:
LeftCount++; if (step == 2)
LeftMoveInfo.NextMoveStep(MoveStep.L12); {
LeftBatchAxisDown(); LeftCount++;
LabelMoveInfo.MoveParam = LeftMoveInfo.MoveParam.clone(); LeftMoveInfo.NextMoveStep(MoveStep.L12);
LeftMoveInfo.log($"左侧料盘已放入,批量轴下降固定值"); LeftBatchAxisDown();
LabelMoveInfo.MoveParam = LeftMoveInfo.MoveParam.clone();
LeftMoveInfo.log($"左侧料盘已放入,批量轴下降固定值");
}
else
{
LeftMoveInfo.NextMoveStep(MoveStep.L11_ReelPutted);
}
break; break;
//防意外
case MoveStep.L12: case MoveStep.L12:
LeftMoveInfo.NextMoveStep(MoveStep.L13); LeftMoveInfo.NextMoveStep(MoveStep.L13);
//LeftBatchAxisToP2(false); //LeftBatchAxisToP2(false);
...@@ -72,10 +108,23 @@ namespace DeviceLibrary ...@@ -72,10 +108,23 @@ namespace DeviceLibrary
break; break;
case MoveStep.L13: case MoveStep.L13:
LeftMoveInfo.NextMoveStep(MoveStep.L20_WaitLabel); LeftMoveInfo.NextMoveStep(MoveStep.L20_WaitLabel);
LeftMoveInfo.log($"批量轴完成上升,等待贴标"); int currpot = Left_Batch_Axis.GetAclPosition();
//if (step == 1)
//{
// Uppre = currpot;
// step = 2;
//}
//else if (step == 2)
//{
// Uplast = currpot;
// step = 3;
//}
LeftMoveInfo.log($"批量轴完成上升,等待贴标当前位置{currpot},步骤step:{step},Uppre:{Uppre},Uplast:{Uplast}");
break; break;
//等贴标,由贴标流程跳出
case MoveStep.L20_WaitLabel: case MoveStep.L20_WaitLabel:
break; break;
//贴标完成,没有释放料串时进入判断料串满/不满流程
case MoveStep.L30_LabelFinish: case MoveStep.L30_LabelFinish:
if (SafeReleaseLeftShelf) if (SafeReleaseLeftShelf)
{ {
...@@ -86,11 +135,19 @@ namespace DeviceLibrary ...@@ -86,11 +135,19 @@ namespace DeviceLibrary
} }
else else
{ {
LeftMoveInfo.NextMoveStep(MoveStep.L04); if (step == 2)
LeftBatchAxisDown(); {
LeftMoveInfo.log($"贴标完成,批量轴下降固定值"); LeftMoveInfo.NextMoveStep(MoveStep.L04);
LeftBatchAxisDown();
LeftMoveInfo.log($"贴标完成,批量轴下降固定值");
}
else
{
LeftMoveInfo.NextMoveStep(MoveStep.L30_LabelFinish);
}
} }
break; break;
//满了下降到p1点,没有agv运输时挡停下降
case MoveStep.L40_ShelfFull: case MoveStep.L40_ShelfFull:
LeftShelfNoTray = true; LeftShelfNoTray = true;
LeftMoveInfo.NextMoveStep(MoveStep.LEND); LeftMoveInfo.NextMoveStep(MoveStep.LEND);
...@@ -110,7 +167,7 @@ namespace DeviceLibrary ...@@ -110,7 +167,7 @@ namespace DeviceLibrary
LeftMoveInfo.log($"结束运动"); LeftMoveInfo.log($"结束运动");
break; break;
//} //}
//料串出料流程 //料串出料流程,下降到p1,挡停下降,滚筒反转到后端检测低电平再转10秒,到前端检测低电平再转10秒,再等3秒,再等0.5秒后反转停止
//switch (LeftMoveInfo.MoveStep) //switch (LeftMoveInfo.MoveStep)
//{ //{
case MoveStep.L50_OutShelf: case MoveStep.L50_OutShelf:
...@@ -148,7 +205,7 @@ namespace DeviceLibrary ...@@ -148,7 +205,7 @@ namespace DeviceLibrary
LeftMoveInfo.log($"电滚停止"); LeftMoveInfo.log($"电滚停止");
break; break;
//} //}
//料串入料流程 //料串入料流程,轴下降到p1,挡停下降,滚筒正转到后端检测高电平后再转60秒,再转1秒,再转0.5秒停止,进入上料流程
//switch (LeftMoveInfo.MoveStep) //switch (LeftMoveInfo.MoveStep)
//{ //{
case MoveStep.L60_InShelf: case MoveStep.L60_InShelf:
...@@ -270,7 +327,15 @@ namespace DeviceLibrary ...@@ -270,7 +327,15 @@ namespace DeviceLibrary
/// </summary> /// </summary>
void LeftBatchAxisDown() void LeftBatchAxisDown()
{ {
int targetP1 = Left_Batch_Axis.GetAclPosition() - ConfigHelper.Config.Get("LeftAxisDownValue", 50) * Config.Left_Batch_ChangeValue; int targetP1 = Left_Batch_Axis.GetAclPosition() - ConfigHelper.Config.Get("LeftAxisDownValue", 50) * Config.Left_Batch_ChangeValue;
if (PlwHight > 5000)
{
int currpoint = Left_Batch_Axis.GetAclPosition();
int countPleHight= PlwHight / Config.Right_Batch_ChangeValue * Config.Left_Batch_ChangeValue;
targetP1 = currpoint - countPleHight;
LeftMoveInfo.log($"出料提升机构,获取到料盘高度脉冲{PlwHight},当前位置{currpoint},计算盘高{countPleHight}");
}
int targetSpeed = Config.Left_Batch_P1_speed; int targetSpeed = Config.Left_Batch_P1_speed;
if (targetP1 <= 0) if (targetP1 <= 0)
{ {
...@@ -284,15 +349,15 @@ namespace DeviceLibrary ...@@ -284,15 +349,15 @@ namespace DeviceLibrary
/// <summary> /// <summary>
/// 下降在上升以后,上升指定阈值,防止感应器失效 /// 下降在上升以后,上升指定阈值,防止感应器失效
/// </summary> /// </summary>
void LeftAxisRiseMax() void LeftAxisRiseMax()
{ {
//1.获取当前私服下降后的脉冲 //1.获取当前私服下降后的脉冲
LeftStartMovePosition = Left_Batch_Axis.GetAclPosition(); LeftStartMovePosition = Left_Batch_Axis.GetAclPosition();
//2.获取下降的高度、冗余高度、一毫米的脉冲值 //2.获取下降的高度、冗余高度、一毫米的脉冲值
int downvalue = ConfigHelper.Config.Get("LeftAxisDownValue", 50); int downvalue = ConfigHelper.Config.Get("LeftAxisDownValue", 50);
int redundancy= ConfigHelper.Config.Get("LeftAxisRiseRedundancyValue", 10); int redundancy = ConfigHelper.Config.Get("LeftAxisRiseRedundancyValue", 10);
int change = Config.Left_Batch_ChangeValue; int change = Config.Left_Batch_ChangeValue;
int totalpulse=(downvalue+ redundancy)*change; int totalpulse = (downvalue + redundancy) * change;
int targetP2 = LeftStartMovePosition + totalpulse; int targetP2 = LeftStartMovePosition + totalpulse;
LeftMoveInfo.log($"下降固定值后提升,感应器亮或提升固定值:当前私服高度={LeftStartMovePosition},下降的固定高度={downvalue}," + LeftMoveInfo.log($"下降固定值后提升,感应器亮或提升固定值:当前私服高度={LeftStartMovePosition},下降的固定高度={downvalue}," +
$"上升最大高度={redundancy},每毫米脉冲={change},上升脉冲为{targetP2},P2={Config.Left_Batch_P2}"); $"上升最大高度={redundancy},每毫米脉冲={change},上升脉冲为{targetP2},P2={Config.Left_Batch_P2}");
...@@ -300,7 +365,7 @@ namespace DeviceLibrary ...@@ -300,7 +365,7 @@ namespace DeviceLibrary
LeftMoveInfo.TimeOutSeconds = 200; LeftMoveInfo.TimeOutSeconds = 200;
LeftMoveInfo.CanWhileCount = 0; LeftMoveInfo.CanWhileCount = 0;
// 需要增加定时器,获取验证信号并停止伺服 // 需要增加定时器,获取验证信号并停止伺服
LeftMoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxisMove(Config.Left_Batch_Axis, targetP2, targetSpeed)); LeftMoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxisMove(Config.Left_Batch_Axis, targetP2, targetSpeed));
Config.Left_Batch_Axis.TargetPosition = targetP2; Config.Left_Batch_Axis.TargetPosition = targetP2;
Left_Batch_Axis.AbsMove(null, targetP2, targetSpeed); Left_Batch_Axis.AbsMove(null, targetP2, targetSpeed);
......
...@@ -22,6 +22,7 @@ namespace DeviceLibrary ...@@ -22,6 +22,7 @@ namespace DeviceLibrary
switch (MiddleMoveInfo.MoveStep) switch (MiddleMoveInfo.MoveStep)
{ {
case MoveStep.M_Standby: case MoveStep.M_Standby:
//如果右侧可取料那么那么移动轴到p2点,夹爪释放。获取右侧的标签信息,右侧标签信息复位,否则等待
if (RightMoveInfo.MoveStep == MoveStep.R10_WaitReelLeave) if (RightMoveInfo.MoveStep == MoveStep.R10_WaitReelLeave)
{ {
MiddleMoveInfo.NextMoveStep(MoveStep.M02); MiddleMoveInfo.NextMoveStep(MoveStep.M02);
...@@ -39,6 +40,7 @@ namespace DeviceLibrary ...@@ -39,6 +40,7 @@ namespace DeviceLibrary
MiddleMoveInfo.log("等待右侧可以取料"); MiddleMoveInfo.log("等待右侧可以取料");
} }
break; break;
//z轴移动到p3点,抓取,返回p2点
case MoveStep.M02: case MoveStep.M02:
MiddleMoveInfo.NextMoveStep(MoveStep.M03); MiddleMoveInfo.NextMoveStep(MoveStep.M03);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P3, Config.Take_UpDown_P3_speed); Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P3, Config.Take_UpDown_P3_speed);
...@@ -56,6 +58,7 @@ namespace DeviceLibrary ...@@ -56,6 +58,7 @@ namespace DeviceLibrary
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P2, Config.Take_UpDown_P2_speed); Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P2, Config.Take_UpDown_P2_speed);
MiddleMoveInfo.log("上下轴返回P2点"); MiddleMoveInfo.log("上下轴返回P2点");
break; break;
//如果抓取完成或者定位低电平,进入下一步,右侧进行下一盘;如果左侧空闲,存在NG或抓取失败人工处理,如果右侧进料确认右侧进入继续取料步骤,如果中间ng轴会p1点否则继续下一个流程
case MoveStep.M05: case MoveStep.M05:
if (clampTool.IsClamp() || IOValue(IO_Type.RightTop_Check).Equals(IO_VALUE.LOW)) if (clampTool.IsClamp() || IOValue(IO_Type.RightTop_Check).Equals(IO_VALUE.LOW))
{ {
...@@ -72,10 +75,12 @@ namespace DeviceLibrary ...@@ -72,10 +75,12 @@ namespace DeviceLibrary
if (MiddleMoveInfo.MoveParam.IsNg) if (MiddleMoveInfo.MoveParam.IsNg)
{ {
Msg.add(crc.GetString("Res0096","抓料失败请手动处理,请将料盘放入:NG箱,按右侧按钮继续"), MsgLevel.alarm); Msg.add(crc.GetString("Res0096","抓料失败请手动处理,请将料盘放入:NG箱,按右侧按钮继续"), MsgLevel.alarm);
MiddleMoveInfo.log("抓料失败请手动处理,请将料盘放入:NG箱,按右侧按钮继续");
} }
else else
{ {
Msg.add(crc.GetString("Res0097","抓料失败请手动处理,请将料盘放入: 左侧料串,按右侧按钮继续"), MsgLevel.alarm); Msg.add(crc.GetString("Res0097","抓料失败请手动处理,请将料盘放入: 左侧料串,按右侧按钮继续"), MsgLevel.alarm);
MiddleMoveInfo.log("抓料失败请手动处理,请将料盘放入: 左侧料串,按右侧按钮继续");
} }
if (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH))
...@@ -96,6 +101,7 @@ namespace DeviceLibrary ...@@ -96,6 +101,7 @@ namespace DeviceLibrary
MiddleMoveInfo.log("抓料失败,等待左侧允许放料"); MiddleMoveInfo.log("抓料失败,等待左侧允许放料");
} }
break; break;
//NG料进入NG流程,正常入正常流程
case MoveStep.M06: case MoveStep.M06:
if (MiddleMoveInfo.MoveParam.IsNg) if (MiddleMoveInfo.MoveParam.IsNg)
{ {
...@@ -119,6 +125,7 @@ namespace DeviceLibrary ...@@ -119,6 +125,7 @@ namespace DeviceLibrary
{ {
Msg.add(msg, MsgLevel.info); Msg.add(msg, MsgLevel.info);
} }
//左侧空闲,等待贴标流程为打印标签,复制信息给标签流程,进入下一步,移动旋转轴到p3
else if(LeftMoveInfo.MoveStep == MoveStep.L10_WaitReelPut) else if(LeftMoveInfo.MoveStep == MoveStep.L10_WaitReelPut)
{ {
if (true || clampTool.IsClamp()) if (true || clampTool.IsClamp())
...@@ -150,11 +157,13 @@ namespace DeviceLibrary ...@@ -150,11 +157,13 @@ namespace DeviceLibrary
Msg.add(crc.GetString("Res0098", "等待左侧允许放料"), MsgLevel.info); Msg.add(crc.GetString("Res0098", "等待左侧允许放料"), MsgLevel.info);
} }
break; break;
//z轴到p4
case MoveStep.M08: case MoveStep.M08:
MiddleMoveInfo.NextMoveStep(MoveStep.M09); MiddleMoveInfo.NextMoveStep(MoveStep.M09);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P4, Config.Take_UpDown_P4_speed); Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P4, Config.Take_UpDown_P4_speed);
MiddleMoveInfo.log("左侧允许放料,上下轴到P4"); MiddleMoveInfo.log("左侧允许放料,上下轴到P4");
break; break;
//夹爪释放复制信息给左侧流程,左侧进入到收到料流程
case MoveStep.M09: case MoveStep.M09:
if (clampTool.Release()) if (clampTool.Release())
{ {
...@@ -171,6 +180,7 @@ namespace DeviceLibrary ...@@ -171,6 +180,7 @@ namespace DeviceLibrary
} }
Msg.add(crc.GetString("Res0050","等待夹爪放松"), MsgLevel.info); Msg.add(crc.GetString("Res0050","等待夹爪放松"), MsgLevel.info);
break; break;
//待机流程
case MoveStep.M10: case MoveStep.M10:
MiddleMoveInfo.NextMoveStep(MoveStep.M_ReturnToP1); MiddleMoveInfo.NextMoveStep(MoveStep.M_ReturnToP1);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed); Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed);
...@@ -181,7 +191,13 @@ namespace DeviceLibrary ...@@ -181,7 +191,13 @@ namespace DeviceLibrary
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P1, Config.Take_Middle_P1_speed); Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P1, Config.Take_Middle_P1_speed);
MiddleMoveInfo.log("放料完成,旋转轴返回待机点"); MiddleMoveInfo.log("放料完成,旋转轴返回待机点");
break; break;
//NG流程
case MoveStep.M20_ToNgBox: case MoveStep.M20_ToNgBox:
MiddleMoveInfo.NextMoveStep(MoveStep.M20_1_ToNgBox);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed);
MiddleMoveInfo.log("NG时上下轴转到P1");
break;
case MoveStep.M20_1_ToNgBox:
MiddleMoveInfo.NextMoveStep(MoveStep.M21); MiddleMoveInfo.NextMoveStep(MoveStep.M21);
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P5, Config.Take_Middle_P5_speed); Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P5, Config.Take_Middle_P5_speed);
MiddleMoveInfo.log("旋转轴转到P5 NG位置"); MiddleMoveInfo.log("旋转轴转到P5 NG位置");
......
...@@ -6,6 +6,7 @@ using OnlineStore.LoadCSVLibrary; ...@@ -6,6 +6,7 @@ using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
...@@ -15,6 +16,7 @@ namespace DeviceLibrary ...@@ -15,6 +16,7 @@ namespace DeviceLibrary
public bool RightShelfNoTray = false; public bool RightShelfNoTray = false;
int RightCount = 0; int RightCount = 0;
public volatile bool SafeReleaseRightShelf = false; public volatile bool SafeReleaseRightShelf = false;
void RightProcess() void RightProcess()
{ {
if (CheckWait(RightMoveInfo)) if (CheckWait(RightMoveInfo))
...@@ -22,6 +24,7 @@ namespace DeviceLibrary ...@@ -22,6 +24,7 @@ namespace DeviceLibrary
//常规上料扫码流程 //常规上料扫码流程
switch (RightMoveInfo.MoveStep) switch (RightMoveInfo.MoveStep)
{ {
//进料口阻挡下降,提升轴先快速上升后缓速调整位置
case MoveStep.R01: case MoveStep.R01:
RightCount = 0; RightCount = 0;
RightShelfNoTray = false; RightShelfNoTray = false;
...@@ -32,15 +35,22 @@ namespace DeviceLibrary ...@@ -32,15 +35,22 @@ namespace DeviceLibrary
break; break;
case MoveStep.R02: case MoveStep.R02:
RightMoveInfo.NextMoveStep(MoveStep.R03); RightMoveInfo.NextMoveStep(MoveStep.R03);
Uppre = Right_Batch_Axis.GetAclPosition();
step = 1;
RightBatchAxisToP2(false); RightBatchAxisToP2(false);
RightMoveInfo.log($"批量轴上升到P2位置,二次提升,RightStartMovePosition={RightStartMovePosition}"); RightMoveInfo.log($"批量轴上升到P2位置,二次提升,RightStartMovePosition={RightStartMovePosition}");
break; break;
case MoveStep.R03: case MoveStep.R03:
RightMoveInfo.NextMoveStep(MoveStep.R04); RightMoveInfo.NextMoveStep(MoveStep.R04);
Uplast = Right_Batch_Axis.GetAclPosition();
step = 2;
RightMoveInfo.log($"批量轴上升到P2位置到位,当前位置{Uplast}");
break; break;
//如果定位上升并且特定中间步骤偶,开始扫码
case MoveStep.R04: case MoveStep.R04:
if (IOValue(IO_Type.RightTop_Check).Equals(IO_VALUE.HIGH) && RightShelfNoTray.Equals(false)) if (IOValue(IO_Type.RightTop_Check).Equals(IO_VALUE.HIGH) && RightShelfNoTray.Equals(false))
{ {
if (MiddleMoveInfo.MoveStep >= MoveStep.M09 || MiddleMoveInfo.MoveStep < MoveStep.M02) if (MiddleMoveInfo.MoveStep >= MoveStep.M09 || MiddleMoveInfo.MoveStep < MoveStep.M02)
{ {
RightMoveInfo.NextMoveStep(MoveStep.R06_GettedReelInfo); RightMoveInfo.NextMoveStep(MoveStep.R06_GettedReelInfo);
...@@ -50,6 +60,7 @@ namespace DeviceLibrary ...@@ -50,6 +60,7 @@ namespace DeviceLibrary
} }
else else
{ {
//不是结束取料,当误差过大时消除误差
if (RightShelfNoTray.Equals(false)) if (RightShelfNoTray.Equals(false))
{ {
//判断当前位置是否在指定的位置 //判断当前位置是否在指定的位置
...@@ -64,16 +75,19 @@ namespace DeviceLibrary ...@@ -64,16 +75,19 @@ namespace DeviceLibrary
return; return;
} }
} }
//否则进入无料步骤
//无料盘 //无料盘
//RightShelfNoTray = true; //RightShelfNoTray = true;
RightMoveInfo.NextMoveStep(MoveStep.R12_ShelfNoTray); RightMoveInfo.NextMoveStep(MoveStep.R12_ShelfNoTray);
RightMoveInfo.log($"批量轴已上升到顶,料串已空."); RightMoveInfo.log($"批量轴已上升到顶,料串已空.");
} }
break; break;
//正常扫码流程,获取扫码信息,标记是否NG,进入取盘流程
case MoveStep.R06_GettedReelInfo: case MoveStep.R06_GettedReelInfo:
if (RightScanTask.IsCompleted) if (RightScanTask.IsCompleted)
{ {
var (x, k, s,b) = RightScanTask.Result; //返回扫码信息,关键字,图片路径,坐标
var (x, k, s, b) = RightScanTask.Result;
if (ConfigHelper.Config.Get(Setting_Init.SaveReelPhoto, false)) if (ConfigHelper.Config.Get(Setting_Init.SaveReelPhoto, false))
{ {
string d = ConfigHelper.Config.Get(Setting_Init.ReelPhotoSaveDir); string d = ConfigHelper.Config.Get(Setting_Init.ReelPhotoSaveDir);
...@@ -81,16 +95,26 @@ namespace DeviceLibrary ...@@ -81,16 +95,26 @@ namespace DeviceLibrary
string df = Path.Combine(d, fn); string df = Path.Combine(d, fn);
File.Copy(s, df); File.Copy(s, df);
} }
int pointX=-1; int pointY=-1; int pointX = -1; int pointY = -1;
b.TryGetValue("PointX", out pointX); b.TryGetValue("PointX", out pointX);
b.TryGetValue("PointY", out pointY); b.TryGetValue("PointY", out pointY);
if (x.Count == 0|| pointX<=0||pointY<=0) if (x.Count == 0 || pointX <= 0 || pointY <= 0)
{ {
RightMoveInfo.log($"未识别到有效二维码,转入NG箱;pointX={pointX};pointY={pointY}"); RightMoveInfo.log($"未识别到有效二维码,转入NG箱;pointX={pointX};pointY={pointY}");
RightMoveInfo.MoveParam.IsNg = true; RightMoveInfo.MoveParam.IsNg = true;
ServerCM.SendNGInfo(crc.GetString("Res0128.e5d9ef10", "模版匹配失败")); if (ServerCommunication.EnableHttpServer)
UnifiedDataHandler.RecordPrintNg(false,false,out string[] strarrys); {
if (Monitor.TryEnter(ServerCM.serverclock, TimeSpan.FromSeconds(5)))
{
ServerCM.SendNGInfo(crc.GetString("Res0128.e5d9ef10", "模版匹配失败"));
}
else
{
RightMoveInfo.log($"上传服务器NG状态超时");
}
}
UnifiedDataHandler.RecordPrintNg(false, false, out string[] strarrys);
} }
else else
{ {
...@@ -115,11 +139,13 @@ namespace DeviceLibrary ...@@ -115,11 +139,13 @@ namespace DeviceLibrary
RightMoveInfo.log($"等待扫码超时"); RightMoveInfo.log($"等待扫码超时");
} }
break; break;
//等待中间流程跳出这个步骤
case MoveStep.R10_WaitReelLeave: case MoveStep.R10_WaitReelLeave:
Msg.add(crc.GetString("Res0099", "等待料盘取走"), MsgLevel.info); Msg.add(crc.GetString("Res0099", "等待料盘取走"), MsgLevel.info);
break; break;
case MoveStep.R11_NextReel: case MoveStep.R11_NextReel:
RightCount++; RightCount++;
//处于释放状态转到无料料流程,否则回到取料流程
if (SafeReleaseRightShelf) if (SafeReleaseRightShelf)
{ {
SafeReleaseRightShelf = false; SafeReleaseRightShelf = false;
...@@ -133,6 +159,7 @@ namespace DeviceLibrary ...@@ -133,6 +159,7 @@ namespace DeviceLibrary
RightMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); RightMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
} }
break; break;
//无料流程,轴下降到P1点,如果用AGV运输料串那么进料口阻挡下降,进入到结束流程(会进入到出料串流程)
case MoveStep.R12_ShelfNoTray: case MoveStep.R12_ShelfNoTray:
RightShelfNoTray = true; RightShelfNoTray = true;
ConfigHelper.Config.Set(Setting_Init.SaveReelPhoto, false); ConfigHelper.Config.Set(Setting_Init.SaveReelPhoto, false);
...@@ -146,14 +173,14 @@ namespace DeviceLibrary ...@@ -146,14 +173,14 @@ namespace DeviceLibrary
{ {
CylinderMove(LeftMoveInfo, IO_Type.RightStopUP, IO_Type.RightStopDown); CylinderMove(LeftMoveInfo, IO_Type.RightStopUP, IO_Type.RightStopDown);
RightMoveInfo.log($"料串已取完, 批量轴下降到P1,阻挡下降"); RightMoveInfo.log($"料串已取完, 批量轴下降到P1,阻挡下降");
} }
break; break;
case MoveStep.REND: case MoveStep.REND:
RightMoveInfo.log($"结束运动"); RightMoveInfo.log($"结束运动");
RightMoveInfo.EndMove(); RightMoveInfo.EndMove();
break; break;
//} //}
//料串出料流程 //料串出料流程,下降到P1点,阻挡下降,滚筒反转,等待到位后端检测为低电平延时3秒,等待到位前端检测为低电平延时3秒,延时0.5秒反转停止,进入结束步骤
//switch (RightMoveInfo.MoveStep) //switch (RightMoveInfo.MoveStep)
//{ //{
case MoveStep.R30_OutShelf: case MoveStep.R30_OutShelf:
...@@ -187,7 +214,7 @@ namespace DeviceLibrary ...@@ -187,7 +214,7 @@ namespace DeviceLibrary
RightMoveInfo.log($"电滚停止"); RightMoveInfo.log($"电滚停止");
break; break;
//} //}
//料串入料流程 //料串入料流程,轴下降到P1点,阻挡下降,滚筒正转,等待后端到位检测高电平延时5秒,0.5秒后滚筒正转停,阻挡上升,进入上料料流程
//switch (RightMoveInfo.MoveStep) //switch (RightMoveInfo.MoveStep)
//{ //{
case MoveStep.R40_InShelf: case MoveStep.R40_InShelf:
...@@ -205,7 +232,7 @@ namespace DeviceLibrary ...@@ -205,7 +232,7 @@ namespace DeviceLibrary
IOMove(IO_Type.RightMoto_Reverse, IO_VALUE.LOW); IOMove(IO_Type.RightMoto_Reverse, IO_VALUE.LOW);
IOMove(IO_Type.RightMoto_Run, IO_VALUE.HIGH); IOMove(IO_Type.RightMoto_Run, IO_VALUE.HIGH);
RightMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightEnd_Check, IO_VALUE.HIGH)); RightMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightEnd_Check, IO_VALUE.HIGH));
RightMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5*1000)); RightMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5 * 1000));
//RightMoveInfo.TimeOutSeconds = 60; //RightMoveInfo.TimeOutSeconds = 60;
//RightMoveInfo.OneWaitCanEndStep = true; //RightMoveInfo.OneWaitCanEndStep = true;
RightMoveInfo.log($"等待料串到位"); RightMoveInfo.log($"等待料串到位");
...@@ -242,14 +269,14 @@ namespace DeviceLibrary ...@@ -242,14 +269,14 @@ namespace DeviceLibrary
string state = ""; string state = "";
if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.RightEnd_Check).Equals(IO_VALUE.HIGH))
{ {
state += string.Format(crc.GetString("Res0123.d86f0192","有料串,已提取{0}张料盘"), RightCount); state += string.Format(crc.GetString("Res0123.d86f0192", "有料串,已提取{0}张料盘"), RightCount);
if (RightShelfNoTray) if (RightShelfNoTray)
state += crc.GetString("Res0100", ",料串已清空. ")+"\r\n"; state += crc.GetString("Res0100", ",料串已清空. ") + "\r\n";
else else
state += "."; state += ".";
state += crc.GetString("Res0045", "当前ReelID:") + RightMoveInfo.MoveParam.WareCode; state += crc.GetString("Res0045", "当前ReelID:") + RightMoveInfo.MoveParam.WareCode;
} }
else else
{ {
return crc.GetString("Res0046", "无料串"); return crc.GetString("Res0046", "无料串");
...@@ -322,6 +349,6 @@ namespace DeviceLibrary ...@@ -322,6 +349,6 @@ namespace DeviceLibrary
//开始检测信号 //开始检测信号
Right_Batch_Axis.BatchAxisStartCheck(IO_Type.RightTop_Check, IO_VALUE.HIGH); Right_Batch_Axis.BatchAxisStartCheck(IO_Type.RightTop_Check, IO_VALUE.HIGH);
} }
int RightEndMovePosition = 0; int RightEndMovePosition = 0;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -250,52 +250,84 @@ namespace DeviceLibrary ...@@ -250,52 +250,84 @@ namespace DeviceLibrary
switch (ResetMoveInfo.MoveStep) switch (ResetMoveInfo.MoveStep)
{ {
case MoveStep.H01_HomeReset: case MoveStep.H01_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H01_1_HomeReset);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); ResetMoveInfo.log("正在回原H01_HomeReset");
ResetMoveInfo.log("正在回原");
SafeReleaseLeftShelf = false; SafeReleaseLeftShelf = false;
Label_Z_Axis.HomeMove(ResetMoveInfo); Take_UpDown_Axis.HomeMove(ResetMoveInfo);
IOMove(IO_Type.Device_Led, IO_VALUE.HIGH); IOMove(IO_Type.Device_Led, IO_VALUE.HIGH);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
break;
case MoveStep.H01_1_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H01_2_HomeReset);
ResetMoveInfo.log("正在回原H01_1_HomeReset");
Take_Middle_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
break;
case MoveStep.H01_2_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
ResetMoveInfo.log("正在回原H01_2_HomeReset");
Label_Z_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.H02_HomeReset: case MoveStep.H02_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H02_1_HomeReset);
ResetMoveInfo.log("正在回原"); ResetMoveInfo.log("正在回原H02_HomeReset");
Label_Z_Axis.AbsMove(ResetMoveInfo, Config.Label_Z_P1, Config.Label_Z_P1_speed); Label_Z_Axis.AbsMove(ResetMoveInfo, Config.Label_Z_P1, Config.Label_Z_P1_speed);
Left_Batch_Axis.HomeMove(ResetMoveInfo); Left_Batch_Axis.HomeMove(ResetMoveInfo);
Right_Batch_Axis.HomeMove(ResetMoveInfo); Right_Batch_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break;
case MoveStep.H02_1_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H02_2_HomeReset);
ResetMoveInfo.log("正在回原H02_1_HomeReset");
Label_R_Axis.HomeMove(ResetMoveInfo); Label_R_Axis.HomeMove(ResetMoveInfo);
Label_X_Axis.HomeMove(ResetMoveInfo); Label_X_Axis.HomeMove(ResetMoveInfo);
//Label_Y_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case MoveStep.H02_2_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H02_3_HomeReset);
ResetMoveInfo.log("正在回原H02_2_HomeReset");
Label_R_Axis.AbsMove(ResetMoveInfo, Config.Label_R_P1, Config.Label_R_P1_speed);
Label_X_Axis.AbsMove(ResetMoveInfo, Config.Label_X_P1, Config.Label_X_P1_speed);
//Label_Y_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
break;
case MoveStep.H02_3_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
ResetMoveInfo.log("正在回原H02_3_HomeReset");
Label_Y_Axis.HomeMove(ResetMoveInfo); Label_Y_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break; break;
case MoveStep.H03_HomeReset: case MoveStep.H03_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
ResetMoveInfo.log("正在回原"); ResetMoveInfo.log("正在回原H03_HomeReset");
Label_R_Axis.AbsMove(ResetMoveInfo, Config.Label_R_P1, Config.Label_R_P1_speed); Label_Y_Axis.AbsMove(ResetMoveInfo, Config.Label_Y_P1, Config.Label_Y_P1_speed);
break; break;
case MoveStep.H04_HomeReset: case MoveStep.H04_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
ResetMoveInfo.log("正在回原"); ResetMoveInfo.log("正在回原H04_HomeReset");
Take_UpDown_Axis.HomeMove(ResetMoveInfo); //Take_UpDown_Axis.HomeMove(ResetMoveInfo);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.H05_HomeReset: case MoveStep.H05_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H06_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
Take_Middle_Axis.HomeMove(ResetMoveInfo); ResetMoveInfo.log("正在回原H05_HomeReset");
Label_X_Axis.AbsMove(ResetMoveInfo, Config.Label_X_P1, Config.Label_X_P1_speed); //Take_Middle_Axis.HomeMove(ResetMoveInfo);
Label_Y_Axis.AbsMove(ResetMoveInfo, Config.Label_Y_P1, Config.Label_Y_P1_speed); //Label_X_Axis.AbsMove(ResetMoveInfo, Config.Label_X_P1, Config.Label_X_P1_speed);
//Label_Y_Axis.AbsMove(ResetMoveInfo, Config.Label_Y_P1, Config.Label_Y_P1_speed);
Right_Batch_Axis.AbsMove(ResetMoveInfo, Config.Right_Batch_P1, Config.Right_Batch_P1_speed); Right_Batch_Axis.AbsMove(ResetMoveInfo, Config.Right_Batch_P1, Config.Right_Batch_P1_speed);
Left_Batch_Axis.AbsMove(ResetMoveInfo, Config.Left_Batch_P1, Config.Left_Batch_P1_speed); Left_Batch_Axis.AbsMove(ResetMoveInfo, Config.Left_Batch_P1, Config.Left_Batch_P1_speed);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break; break;
case MoveStep.H06_HomeReset: case MoveStep.H06_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H07_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
ResetMoveInfo.log("正在回原"); ResetMoveInfo.log("正在回原H06_HomeReset");
Take_UpDown_Axis.AbsMove(ResetMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed); Take_UpDown_Axis.AbsMove(ResetMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed);
break; break;
case MoveStep.H07_HomeReset: case MoveStep.H07_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H08_HomeReset);
ResetMoveInfo.log("正在回原H07_HomeReset");
Take_Middle_Axis.AbsMove(ResetMoveInfo, Config.Take_Middle_P1, Config.Take_Middle_P1_speed); Take_Middle_Axis.AbsMove(ResetMoveInfo, Config.Take_Middle_P1, Config.Take_Middle_P1_speed);
ResetMoveInfo.log("正在回原 进出料口滚筒正转5秒"); ResetMoveInfo.log("正在回原 进出料口滚筒正转5秒");
IOMove(IO_Type.LeftMoto_Reverse, IO_VALUE.LOW); IOMove(IO_Type.LeftMoto_Reverse, IO_VALUE.LOW);
...@@ -306,6 +338,7 @@ namespace DeviceLibrary ...@@ -306,6 +338,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.H08_HomeReset: case MoveStep.H08_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset);
ResetMoveInfo.log("正在回原H08_HomeReset");
ResetMoveInfo.log("正在回原 阻挡气缸判断"); ResetMoveInfo.log("正在回原 阻挡气缸判断");
IOMove(IO_Type.LeftMoto_Run, IO_VALUE.LOW); IOMove(IO_Type.LeftMoto_Run, IO_VALUE.LOW);
IOMove(IO_Type.RightMoto_Run, IO_VALUE.LOW); IOMove(IO_Type.RightMoto_Run, IO_VALUE.LOW);
......
...@@ -12,7 +12,12 @@ namespace DeviceLibrary ...@@ -12,7 +12,12 @@ namespace DeviceLibrary
Wait, Wait,
//回原流程 //回原流程
H01_HomeReset, H01_HomeReset,
H01_1_HomeReset,
H01_2_HomeReset,
H02_HomeReset, H02_HomeReset,
H02_1_HomeReset,
H02_2_HomeReset,
H02_3_HomeReset,
H03_HomeReset, H03_HomeReset,
H04_HomeReset, H04_HomeReset,
H05_HomeReset, H05_HomeReset,
...@@ -92,6 +97,7 @@ namespace DeviceLibrary ...@@ -92,6 +97,7 @@ namespace DeviceLibrary
M09, M09,
M10, M10,
M20_ToNgBox, M20_ToNgBox,
M20_1_ToNgBox,
M21, M21,
M22, M22,
M23, M23,
......
...@@ -23,7 +23,7 @@ namespace DeviceLibrary ...@@ -23,7 +23,7 @@ namespace DeviceLibrary
public class CodeManager public class CodeManager
{ {
public static string CodeType = ConfigAppSettings.GetValue(Setting_Init.CodeType); public static string CodeType = ConfigAppSettings.GetValue(Setting_Init.CodeType);
private static int QRCodeCount = ConfigAppSettings.GetIntValue(Setting_Init.QRCodeCount); //private static int QRCodeCount = ConfigAppSettings.GetIntValue(Setting_Init.QRCodeCount);
public static List<string> cameraNameList = new List<string>(); public static List<string> cameraNameList = new List<string>();
public static List<string> codeTypeList = new List<string>(); public static List<string> codeTypeList = new List<string>();
public static List<string> hikNameList = new List<string>(); public static List<string> hikNameList = new List<string>();
...@@ -108,7 +108,7 @@ namespace DeviceLibrary ...@@ -108,7 +108,7 @@ namespace DeviceLibrary
} }
Camera.Type = cameraType; Camera.Type = cameraType;
Camera._cam.Load(); Camera._cam.Load();
LogUtil.error($"本次加载相机类型为:{camname}"); LogUtil.info($"本次加载相机类型为:{camname}");
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -168,7 +168,7 @@ namespace DeviceLibrary ...@@ -168,7 +168,7 @@ namespace DeviceLibrary
string con = line; string con = line;
fileContainer.CreateFile(fileName, con); fileContainer.CreateFile(fileName, con);
lastFileInfo = "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]: " + fileName + "\t" + line; lastFileInfo = "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]: " + fileName + "\t" + line;
LogUtil.error($"共享文件夹{smb_path} 创建文件{fileName}完成 "); LogUtil.info($"共享文件夹{smb_path} 创建文件{fileName}完成 ");
} }
else else
......
...@@ -21,7 +21,9 @@ namespace DeviceLibrary ...@@ -21,7 +21,9 @@ namespace DeviceLibrary
int dpi = 100; int dpi = 100;
public static bool istscprin = ConfigHelper.Config.Get("Hardwareversion", "V2")=="V2"; public static bool istscprin = ConfigHelper.Config.Get("Hardwareversion", "V2")=="V2";
public PrintDevice printDevice = ConfigHelper.Config.Get("PrintDevice", istscprin ? PrintDevice.TSC : PrintDevice.Zebra); public static bool newistscprin = ConfigHelper.Config.Get("HardwareversionofAGV", "V2") == "V2";
//public PrintDevice printDevice = ConfigHelper.Config.Get("PrintDevice", istscprin ? PrintDevice.TSC : PrintDevice.Zebra);
public PrintDevice printDevice = ConfigHelper.Config.Get("PrintDevice", istscprin ? PrintDevice.TSC : (newistscprin? PrintDevice.TSC : PrintDevice.Zebra));
public enum PrintDevice { public enum PrintDevice {
TSC, TSC,
Zebra, Zebra,
......
using CodeLibrary; using CodeLibrary;
using DeviceLibrary; using DeviceLibrary;
using HalconDotNet; using HalconDotNet;
using IDHIKCamera;
using Newtonsoft.Json; using Newtonsoft.Json;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
...@@ -92,11 +93,22 @@ public class RemoteDecodeHelper_mod ...@@ -92,11 +93,22 @@ public class RemoteDecodeHelper_mod
} }
#region 扫码相机请求ns100方法 #region 扫码相机请求ns100方法
public static WebResultCode NeoSacnRequest(Bitmap bitmap, List<CodeInfo> codeInfos,int PlateW) public static WebResultCode NeoSacnRequest(Bitmap bitmap, List<CodeLibrary.CodeInfo> codeInfos,int PlateW)
{ {
WebResultCode resultCode = null; WebResultCode resultCode = null;
try try
{ {
var deg = codeInfos[0].Orientation;
//if (codeInfos[0].CodeType == "QR Code")
//{
// deg += 90;
// if (deg > 360)
// deg = deg - 360;
// LogUtil.info("QR Code转换后角度:" + deg);
//}
//codeInfos[0].Orientation = deg;
CheckAndRunServer(); CheckAndRunServer();
BitmapData bitmapData = new BitmapData(); BitmapData bitmapData = new BitmapData();
string iamgestr = BitmapToBase64(bitmap); string iamgestr = BitmapToBase64(bitmap);
......
using ConfigHelper;
using HalconDotNet; using HalconDotNet;
using Newtonsoft.Json; using Newtonsoft.Json;
using OnlineStore; using OnlineStore;
...@@ -24,6 +25,7 @@ namespace DeviceLibrary ...@@ -24,6 +25,7 @@ namespace DeviceLibrary
public class ServerCommunication public class ServerCommunication
{ {
volatile StoreStatus _storeStatus = StoreStatus.Debugging; volatile StoreStatus _storeStatus = StoreStatus.Debugging;
public static bool EnableHttpServer = Config.Get<bool>("EnableHttpServer", true);
public StoreStatus storeStatus public StoreStatus storeStatus
{ {
get => _storeStatus; get => _storeStatus;
...@@ -42,7 +44,7 @@ namespace DeviceLibrary ...@@ -42,7 +44,7 @@ namespace DeviceLibrary
string WarnMsg = ""; string WarnMsg = "";
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer(); private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
object serverclock = new object(); public object serverclock = new object();
public ServerCommunication() public ServerCommunication()
{ {
serverConnectTimer.Interval = 1000; serverConnectTimer.Interval = 1000;
...@@ -60,8 +62,18 @@ namespace DeviceLibrary ...@@ -60,8 +62,18 @@ namespace DeviceLibrary
if (!RobotManage.isRunning) if (!RobotManage.isRunning)
return; return;
if (ServerCommunication.EnableHttpServer)
SendLineStatus(); {
if (Monitor.TryEnter(serverclock, TimeSpan.FromSeconds(5)))
{
SendLineStatus();
}
else
{
LogUtil.error("上传SendLineStatus超时");
}
}
} }
public void ProcessMsg(List<Msg> msg) public void ProcessMsg(List<Msg> msg)
...@@ -226,62 +238,78 @@ namespace DeviceLibrary ...@@ -226,62 +238,78 @@ namespace DeviceLibrary
} }
public bool SendAgvLog(string msg) public bool SendAgvLog(string msg)
{ {
if (!server.ToLower().StartsWith("http")) if (Monitor.TryEnter(serverclock, TimeSpan.FromSeconds(5)))
{
return false;
}
lock (serverclock)
{ {
Operation operation = getLineBoxStatus(); if (!server.ToLower().StartsWith("http"))
{
return false;
}
lock (serverclock)
{
Operation operation = getLineBoxStatus();
//operation.logList = new List<AgvLogInfo> //operation.logList = new List<AgvLogInfo>
//{ //{
// new AgvLogInfo(msg) // new AgvLogInfo(msg)
//}; //};
//LogUtil.info(JsonHelper.SerializeObject(operation)); //LogUtil.info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000); Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000);
if (resultOperation == null) if (resultOperation == null)
{ {
LogUtil.info($"SendAgvLog error:{msg}"); LogUtil.info($"SendAgvLog error:{msg}");
return false; return false;
}
LogUtil.info($"SendAgvLog success:{msg}");
} }
LogUtil.info($"SendAgvLog success:{msg}"); return true;
}
else
{
LogUtil.info($"SendAgvLog 超时");
return false;
} }
return true;
} }
string mimoCid = ConfigHelper.Config.Get("MIMO_CID", "01"); string mimoCid = ConfigHelper.Config.Get("MIMO_CID", "01");
public bool OpMIMO(string msg, Dictionary<string, string> operate) public bool OpMIMO(string msg, Dictionary<string, string> operate)
{ {
if (!server.ToLower().StartsWith("http")) if (Monitor.TryEnter(serverclock, TimeSpan.FromSeconds(5)))
{ {
return false; if (!server.ToLower().StartsWith("http"))
} {
lock (serverclock) return false;
{ }
Operation operation = getLineBoxStatus(); 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> //Dictionary<string, string> op = new Dictionary<string, string>
//{ //{
// { "Y10", "open" } // { "Y10", "open" }
//}; //};
//operation.mimoOpMap.Add("1", op); //operation.mimoOpMap.Add("1", op);
//operation.mimoOpMap.Add(mimoCid, operate); //operation.mimoOpMap.Add(mimoCid, operate);
LogUtil.info(JsonHelper.SerializeObject(operation)); LogUtil.info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 1000); Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 1000);
if (resultOperation == null) if (resultOperation == null)
{ {
LogUtil.info($"OpMIMO error:{msg}"); LogUtil.info($"OpMIMO error:{msg}");
return false; return false;
}
LogUtil.info($"OpMIMO success:{msg}");
} }
LogUtil.info($"OpMIMO success:{msg}"); return true;
}
else
{
LogUtil.info($"OpMIMO超时");
return false;
} }
return true;
} }
public int queueTaskCount = -1; public int queueTaskCount = -1;
ConcurrentQueue<string> commandResultMsg = new ConcurrentQueue<string>(); ConcurrentQueue<string> commandResultMsg = new ConcurrentQueue<string>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!