Commit b9ac6aa1 LN

增加料架自动入库配置项

1 个父辈 6fa92b60
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
<!--AGV调度服务器地址--> <!--AGV调度服务器地址-->
<add key="AgvServerIp" value="192.168.103.22" /> <add key="AgvServerIp" value="192.168.103.22" />
<add key ="CodeCount" value ="2"/> <add key ="CodeCount" value ="2"/>
<!--检测到料架后自动开始入库-->
<add key ="AutoShelfInstore" value ="1"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStore)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStore));
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.chbAutoShelfInstore = new System.Windows.Forms.CheckBox();
this.chbUseBuzzer = new System.Windows.Forms.CheckBox(); this.chbUseBuzzer = new System.Windows.Forms.CheckBox();
this.chkDebug = new System.Windows.Forms.CheckBox(); this.chkDebug = new System.Windows.Forms.CheckBox();
this.chbAutoRun = new System.Windows.Forms.CheckBox(); this.chbAutoRun = new System.Windows.Forms.CheckBox();
...@@ -88,6 +89,7 @@ ...@@ -88,6 +89,7 @@
// //
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.chbAutoShelfInstore);
this.tabPage1.Controls.Add(this.chbUseBuzzer); this.tabPage1.Controls.Add(this.chbUseBuzzer);
this.tabPage1.Controls.Add(this.chkDebug); this.tabPage1.Controls.Add(this.chkDebug);
this.tabPage1.Controls.Add(this.chbAutoRun); this.tabPage1.Controls.Add(this.chbAutoRun);
...@@ -101,11 +103,23 @@ ...@@ -101,11 +103,23 @@
this.tabPage1.Text = " 日志信息 "; this.tabPage1.Text = " 日志信息 ";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// chbAutoShelfInstore
//
this.chbAutoShelfInstore.AutoSize = true;
this.chbAutoShelfInstore.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoShelfInstore.Location = new System.Drawing.Point(751, 13);
this.chbAutoShelfInstore.Name = "chbAutoShelfInstore";
this.chbAutoShelfInstore.Size = new System.Drawing.Size(154, 24);
this.chbAutoShelfInstore.TabIndex = 196;
this.chbAutoShelfInstore.Text = "检测到料架自动入库";
this.chbAutoShelfInstore.UseVisualStyleBackColor = true;
this.chbAutoShelfInstore.CheckedChanged += new System.EventHandler(this.chbAutoShelfInstore_CheckedChanged);
//
// chbUseBuzzer // chbUseBuzzer
// //
this.chbUseBuzzer.AutoSize = true; this.chbUseBuzzer.AutoSize = true;
this.chbUseBuzzer.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbUseBuzzer.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbUseBuzzer.Location = new System.Drawing.Point(623, 13); this.chbUseBuzzer.Location = new System.Drawing.Point(621, 13);
this.chbUseBuzzer.Name = "chbUseBuzzer"; this.chbUseBuzzer.Name = "chbUseBuzzer";
this.chbUseBuzzer.Size = new System.Drawing.Size(98, 24); this.chbUseBuzzer.Size = new System.Drawing.Size(98, 24);
this.chbUseBuzzer.TabIndex = 195; this.chbUseBuzzer.TabIndex = 195;
...@@ -117,7 +131,7 @@ ...@@ -117,7 +131,7 @@
// //
this.chkDebug.AutoSize = true; this.chkDebug.AutoSize = true;
this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkDebug.Location = new System.Drawing.Point(285, 12); this.chkDebug.Location = new System.Drawing.Point(285, 13);
this.chkDebug.Name = "chkDebug"; this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(132, 24); this.chkDebug.Size = new System.Drawing.Size(132, 24);
this.chkDebug.TabIndex = 194; this.chkDebug.TabIndex = 194;
...@@ -129,7 +143,7 @@ ...@@ -129,7 +143,7 @@
// //
this.chbAutoRun.AutoSize = true; this.chbAutoRun.AutoSize = true;
this.chbAutoRun.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbAutoRun.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRun.Location = new System.Drawing.Point(437, 12); this.chbAutoRun.Location = new System.Drawing.Point(449, 13);
this.chbAutoRun.Name = "chbAutoRun"; this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(140, 24); this.chbAutoRun.Size = new System.Drawing.Size(140, 24);
this.chbAutoRun.TabIndex = 94; this.chbAutoRun.TabIndex = 94;
...@@ -141,7 +155,7 @@ ...@@ -141,7 +155,7 @@
// //
this.btnCopyLog.BackColor = System.Drawing.Color.White; this.btnCopyLog.BackColor = System.Drawing.Color.White;
this.btnCopyLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCopyLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyLog.Location = new System.Drawing.Point(19, 7); this.btnCopyLog.Location = new System.Drawing.Point(19, 8);
this.btnCopyLog.Name = "btnCopyLog"; this.btnCopyLog.Name = "btnCopyLog";
this.btnCopyLog.Size = new System.Drawing.Size(105, 35); this.btnCopyLog.Size = new System.Drawing.Size(105, 35);
this.btnCopyLog.TabIndex = 191; this.btnCopyLog.TabIndex = 191;
...@@ -153,7 +167,7 @@ ...@@ -153,7 +167,7 @@
// //
this.btnClearLog.BackColor = System.Drawing.Color.White; this.btnClearLog.BackColor = System.Drawing.Color.White;
this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearLog.Location = new System.Drawing.Point(130, 7); this.btnClearLog.Location = new System.Drawing.Point(130, 8);
this.btnClearLog.Name = "btnClearLog"; this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(105, 35); this.btnClearLog.Size = new System.Drawing.Size(105, 35);
this.btnClearLog.TabIndex = 190; this.btnClearLog.TabIndex = 190;
...@@ -285,31 +299,31 @@ ...@@ -285,31 +299,31 @@
// toolStripMenuItem2 // toolStripMenuItem2
// //
this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 26); this.toolStripMenuItem2.Size = new System.Drawing.Size(160, 26);
this.toolStripMenuItem2.Text = "启用调试"; this.toolStripMenuItem2.Text = "启用调试";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
// //
// toolStripSeparator6 // toolStripSeparator6
// //
this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator6.Size = new System.Drawing.Size(157, 6);
// //
// 二维码学习ToolStripMenuItem // 二维码学习ToolStripMenuItem
// //
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem"; this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习"; this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click); this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
// //
// toolStripSeparator7 // toolStripSeparator7
// //
this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator7.Size = new System.Drawing.Size(157, 6);
// //
// 托盘编码ToolStripMenuItem // 托盘编码ToolStripMenuItem
// //
this.托盘编码ToolStripMenuItem.Name = "托盘编码ToolStripMenuItem"; this.托盘编码ToolStripMenuItem.Name = "托盘编码ToolStripMenuItem";
this.托盘编码ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.托盘编码ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.托盘编码ToolStripMenuItem.Text = "托盘编码"; this.托盘编码ToolStripMenuItem.Text = "托盘编码";
this.托盘编码ToolStripMenuItem.Click += new System.EventHandler(this.托盘编码ToolStripMenuItem_Click); this.托盘编码ToolStripMenuItem.Click += new System.EventHandler(this.托盘编码ToolStripMenuItem_Click);
// //
...@@ -436,6 +450,7 @@ ...@@ -436,6 +450,7 @@
private System.Windows.Forms.CheckBox chbUseBuzzer; private System.Windows.Forms.CheckBox chbUseBuzzer;
private System.Windows.Forms.ToolStripMenuItem 托盘编码ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 托盘编码ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.CheckBox chbAutoShelfInstore;
} }
} }
...@@ -51,13 +51,13 @@ namespace OnlineStore.ACPackingStore ...@@ -51,13 +51,13 @@ namespace OnlineStore.ACPackingStore
} }
chbAutoRun.Checked = store.UseBuzzer; chbAutoRun.Checked = store.UseBuzzer;
chbAutoShelfInstore.Checked = store.AutoShelfInstore;
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title); this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
chbAutoRun.Checked = ConfigAppSettings.GetValue(Setting_Init.App_AutoRun).Equals(1); chbAutoRun.Checked = ConfigAppSettings.GetValue(Setting_Init.App_AutoRun).Equals(1);
// LogUtil.logBox = this.logBox; // LogUtil.logBox = this.logBox;
// HideForm(); // HideForm();
LoadOk = true; LoadOk = true;
LogUtil.logBox = this.logBox; LogUtil.logBox = this.logBox;
this.timer1.Start(); this.timer1.Start();
} }
...@@ -442,5 +442,26 @@ namespace OnlineStore.ACPackingStore ...@@ -442,5 +442,26 @@ namespace OnlineStore.ACPackingStore
FrmRFIPEdit frm = new FrmRFIPEdit(); FrmRFIPEdit frm = new FrmRFIPEdit();
frm.ShowDialog(); frm.ShowDialog();
} }
private void chbAutoShelfInstore_CheckedChanged(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
if (chbAutoShelfInstore.Checked)
{
store.AutoShelfInstore = true;
ConfigAppSettings.SaveValue(Setting_Init.AutoShelfInstore, 1);
LogUtil.info("勾选:检测到料架自动入库");
}
else
{
store.AutoShelfInstore = false;
ConfigAppSettings.SaveValue(Setting_Init.AutoShelfInstore, 0);
LogUtil.info("去掉:检测到料架自动入库");
}
}
} }
} }
...@@ -100,5 +100,6 @@ namespace OnlineStore.Common ...@@ -100,5 +100,6 @@ namespace OnlineStore.Common
public static string AgvServerIp = "AgvServerIp"; public static string AgvServerIp = "AgvServerIp";
public static string CodeCount = "CodeCount"; public static string CodeCount = "CodeCount";
public static string AutoShelfInstore = "AutoShelfInstore";
} }
} }
...@@ -675,8 +675,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -675,8 +675,9 @@ namespace OnlineStore.DeviceLibrary
ShowTimeLog("IOTimeOutProcess"); ShowTimeLog("IOTimeOutProcess");
//如果入口有料架需要入库 //如果入口有料架需要入库
if (MoveInfo.MoveType.Equals(StoreMoveType.None) if (StoreManager.Store.AutoShelfInstore&&
&& (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.HIGH))) MoveInfo.MoveType.Equals(StoreMoveType.None) &&
(IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.HIGH)))
{ {
StartShelfInStore(); StartShelfInStore();
} }
......
...@@ -281,7 +281,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -281,7 +281,7 @@ namespace OnlineStore.DeviceLibrary
private void StartSendTray(string str = "扫码失败") private void StartSendTray(string str = "扫码失败")
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_71_ToNGDoor); MoveInfo.NextMoveStep(StoreMoveStep.BI_71_ToNGDoor);
InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":" + str + ",升降轴移动到NG料门口上端,旋转轴移动到NG料门口"); InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":" + str + ",升降轴移动到NG料门口上端P12,旋转轴移动到NG料门口P11");
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P12, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P12, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P11, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P11, Config.MiddleAxis_P1_Speed);
...@@ -549,8 +549,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -549,8 +549,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_73_InoutToNGDoor)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_73_InoutToNGDoor))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_74_UpdownDown); MoveInfo.NextMoveStep(StoreMoveStep.BI_74_UpdownDown);
InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":升降轴到P12,压紧轴到P3,放下料盘"); InOutStoreLog("送出料盘 " + MoveInfo.SLog + ":升降轴到P11,压紧轴到P3,放下料盘");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P12, Config.UpDownAxis_P2_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P11, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Comp_Axis, moveP.ComPress_P3, Config.CompAxis_P3_Speed); ACAxisMove(Config.Comp_Axis, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_74_UpdownDown)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_74_UpdownDown))
......
...@@ -48,14 +48,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -48,14 +48,14 @@ namespace OnlineStore.DeviceLibrary
LastMoveDO = moveDO; LastMoveDO = moveDO;
LastCheckDI = checkDI; LastCheckDI = checkDI;
LogUtil.debug("写入信号:" + moveDO + ",等待信号:" + checkDI + ""); LogUtil.debug("写入信号:" + moveDO + ",等待信号:" + checkDI + "");
//if (moveDO.Equals(IO_Type.EntranceDoor_Open)) if (moveDO.Equals(IO_Type.EntranceDoor_Open))
//{ {
// IOManager.IOMove(IO_Type.EntranceDoor_Close, IO_VALUE.LOW, subType); IOManager.IOMove(IO_Type.EntranceDoor_Close, IO_VALUE.LOW, subType);
//} }
//else else
//{ {
// IOManager.IOMove(IO_Type.EntranceDoor_Open, IO_VALUE.LOW, subType); IOManager.IOMove(IO_Type.EntranceDoor_Open, IO_VALUE.LOW, subType);
//} }
IOManager.IOMove(moveDO, IO_VALUE.HIGH, subType); IOManager.IOMove(moveDO, IO_VALUE.HIGH, subType);
Thread.Sleep(50); Thread.Sleep(50);
...@@ -103,7 +103,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,7 +103,7 @@ namespace OnlineStore.DeviceLibrary
public bool StartOpen(StoreMoveInfo moveInfo) public bool StartOpen(StoreMoveInfo moveInfo)
{ {
// return false; return false;
if (moveInfo != null) if (moveInfo != null)
{ {
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.EntranceDoor_Open, IO_VALUE.HIGH)); moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.EntranceDoor_Open, IO_VALUE.HIGH));
...@@ -114,7 +114,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -114,7 +114,7 @@ namespace OnlineStore.DeviceLibrary
} }
public bool StartClose(StoreMoveInfo moveInfo) public bool StartClose(StoreMoveInfo moveInfo)
{ {
// return false; return false;
if (moveInfo != null) if (moveInfo != null)
{ {
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.EntranceDoor_Close, IO_VALUE.HIGH)); moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.EntranceDoor_Close, IO_VALUE.HIGH));
......
...@@ -31,6 +31,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -31,6 +31,7 @@ namespace OnlineStore.DeviceLibrary
public Store_Config Config { get; set; } public Store_Config Config { get; set; }
public bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1); public bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1);
public bool AutoShelfInstore = ConfigAppSettings.GetIntValue(Setting_Init.AutoShelfInstore).Equals(1);
#region 初始化 #region 初始化
internal bool canStart = false; internal bool canStart = false;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!