Commit 4d308cee LN

增加自动入库配置。

1 个父辈 b430fed8
...@@ -93,8 +93,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -93,8 +93,11 @@ namespace OnlineStore.DeviceLibrary
private DateTime lastProTimer = DateTime.Now; private DateTime lastProTimer = DateTime.Now;
public void TimerProcess() public void TimerProcess()
{ {
if (runStatus <= RunStatus.Wait)
{
return;
}
OnTimerProcess(); OnTimerProcess();
TimeSpan span = DateTime.Now - lastProTimer; TimeSpan span = DateTime.Now - lastProTimer;
if (isInPro && span.TotalSeconds < TimerMaxSeconds) if (isInPro && span.TotalSeconds < TimerMaxSeconds)
{ {
...@@ -103,7 +106,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,7 +106,7 @@ namespace OnlineStore.DeviceLibrary
isInPro = true; isInPro = true;
lastProTimer = DateTime.Now; lastProTimer = DateTime.Now;
try try
{ {
if (IsDebug && runStatus <= RunStatus.Wait) if (IsDebug && runStatus <= RunStatus.Wait)
{ {
isInPro = false; isInPro = false;
...@@ -125,6 +128,32 @@ namespace OnlineStore.DeviceLibrary ...@@ -125,6 +128,32 @@ namespace OnlineStore.DeviceLibrary
isInPro = false; isInPro = false;
} }
} }
protected void AutoStartProcess()
{
DateTime time = DateTime.Now;
if (runStatus.Equals(RunStatus.Wait))
{
//取新的Io状态
IO_VALUE fuweiValue = IOValue(IO_Type.Reset_BTN);
IO_VALUE lastFuwei = DILastValueMap[IO_Type.Reset_BTN];
addLastDI(IO_Type.Reset_BTN, fuweiValue);
bool isAutoStart = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun) == 1;
//收到复位信号后启动
if (isAutoStart && fuweiValue.Equals(IO_VALUE.HIGH) && lastFuwei.Equals(IO_VALUE.LOW))
{
//没有启动时收到启动按钮
LogUtil.info(Name + "没有启动时收到启动按钮,开始调用启动方法!");
bool isOk = StartRun();
if (!isOk)
{
LogUtil.error("启动失败,等待下次启动");
}
}
return;
}
}
protected virtual void OnTimerProcess() protected virtual void OnTimerProcess()
{ {
......
...@@ -298,7 +298,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -298,7 +298,7 @@ namespace OnlineStore.DeviceLibrary
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "LineTimerPro 出错:", ex); LogUtil.error(Name + "LineTimerPro 出错:", ex);
} }
busyPro = false; busyPro = false;
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -120,7 +120,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -120,7 +120,9 @@ namespace OnlineStore.DeviceLibrary
StopMove(); StopMove();
} }
string msg = ""; string msg = "";
if (!BatchAxis.Open(true, out msg)) bool axisOpen = BatchAxis.Open(true, out msg);
WorkLog("批量轴打开结果:" + axisOpen);
if (!axisOpen)
{ {
BatchAxis.SuddenStop(); BatchAxis.SuddenStop();
BatchAxis.ServoOff(); BatchAxis.ServoOff();
...@@ -277,7 +279,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -277,7 +279,7 @@ namespace OnlineStore.DeviceLibrary
} }
public void StopUp(DeviceMoveInfo moveInfo = null) public void StopUp(DeviceMoveInfo moveInfo = null)
{ {
Robot.IOMove(Config.IO_Shelf_StopDown, IO_VALUE.HIGH); Robot.IOMove(Config.IO_Shelf_StopDown, IO_VALUE.LOW);
Robot.IOMove(Config.IO_Shelf_StopUp, IO_VALUE.HIGH); Robot.IOMove(Config.IO_Shelf_StopUp, IO_VALUE.HIGH);
if (moveInfo != null) if (moveInfo != null)
{ {
......
...@@ -54,7 +54,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -54,7 +54,11 @@ namespace OnlineStore.DeviceLibrary
BatchMove_A = new BatchMoveBean(Config, BatchAxis_A, 1); BatchMove_A = new BatchMoveBean(Config, BatchAxis_A, 1);
BatchMove_B = new BatchMoveBean(config, BatchAxis_B, 2); BatchMove_B = new BatchMoveBean(config, BatchAxis_B, 2);
runStatus = RunStatus.Wait;
addLastDI(IO_Type.Airpressure_Check, IO_VALUE.LOW);
addLastDI(IO_Type.SuddenStop_BTN, IO_VALUE.LOW);
addLastDI(IO_Type.Reset_BTN, IO_VALUE.LOW);
runStatus = RunStatus.Wait;
} }
#region 启动,复位,停止 处理 #region 启动,复位,停止 处理
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<add key="RfidServer_Port" value="12001" /> <add key="RfidServer_Port" value="12001" />
<add key ="TrayHeightList" value ="8;12;16;20;24;28;36;48"/> <add key ="TrayHeightList" value ="8;12;16;20;24;28;36;48"/>
<add key ="AutoInput" value ="1"/>
<!--夹爪夹紧时忽略的料号列表,多个用#分割--> <!--夹爪夹紧时忽略的料号列表,多个用#分割-->
<add key ="PNList" value ="3402021720#3402021721#3402021100#3402021101#3402021102#3402021103#3402021104#3402021105#3402021106#3402021107#3402021108#3402021109#3402021112#3402021122"/> <add key ="PNList" value ="3402021720#3402021721#3402021100#3402021101#3402021102#3402021103#3402021104#3402021105#3402021106#3402021107#3402021108#3402021109#3402021112#3402021122"/>
</appSettings> </appSettings>
......
...@@ -316,7 +316,7 @@ ...@@ -316,7 +316,7 @@
this.lblAgvInfo.AutoSize = true; this.lblAgvInfo.AutoSize = true;
this.lblAgvInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblAgvInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblAgvInfo.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblAgvInfo.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblAgvInfo.Location = new System.Drawing.Point(5, 89); this.lblAgvInfo.Location = new System.Drawing.Point(5, 81);
this.lblAgvInfo.Name = "lblAgvInfo"; this.lblAgvInfo.Name = "lblAgvInfo";
this.lblAgvInfo.Size = new System.Drawing.Size(61, 17); this.lblAgvInfo.Size = new System.Drawing.Size(61, 17);
this.lblAgvInfo.TabIndex = 282; this.lblAgvInfo.TabIndex = 282;
......
...@@ -42,7 +42,7 @@ namespace OnlineStore.XLRStore ...@@ -42,7 +42,7 @@ namespace OnlineStore.XLRStore
} }
lblWarnMsg.Text = moveBean.WarnMsg; lblWarnMsg.Text = moveBean.WarnMsg;
lblCurrInfo.Text = moveBean.GetMoveStr(); lblCurrInfo.Text = moveBean.GetMoveStr();
lblAgvInfo.Text = "AGV " + moveBean.Config.AgvName + " :" + AgvClient.GetAction(moveBean.Config.AgvName); string text = "AGV " + moveBean.Config.AgvName + " :" + AgvClient.GetAction(moveBean.Config.AgvName);
if (StoreManager.XLRStore.inputEquip.runStatus > RunStatus.Wait) if (StoreManager.XLRStore.inputEquip.runStatus > RunStatus.Wait)
{ {
btnReset.Enabled = true; btnReset.Enabled = true;
...@@ -50,7 +50,10 @@ namespace OnlineStore.XLRStore ...@@ -50,7 +50,10 @@ namespace OnlineStore.XLRStore
else else
{ {
btnReset.Enabled = true; btnReset.Enabled = true;
} }
text += "\r\n" + moveBean.MoveInfo.MoveType + "_" + moveBean.MoveInfo.MoveStep;
lblAgvInfo.Text = text;
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -93,6 +93,7 @@ namespace OnlineStore.XLRStore ...@@ -93,6 +93,7 @@ namespace OnlineStore.XLRStore
this.btnStop = new System.Windows.Forms.Button(); this.btnStop = new System.Windows.Forms.Button();
this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox6 = new System.Windows.Forms.GroupBox();
this.groupBox12 = new System.Windows.Forms.GroupBox(); this.groupBox12 = new System.Windows.Forms.GroupBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.cmbOutstorePos = new System.Windows.Forms.ComboBox(); this.cmbOutstorePos = new System.Windows.Forms.ComboBox();
this.cmbInstorePos = new System.Windows.Forms.ComboBox(); this.cmbInstorePos = new System.Windows.Forms.ComboBox();
this.btnOutStoreTest = new System.Windows.Forms.Button(); this.btnOutStoreTest = new System.Windows.Forms.Button();
...@@ -1036,6 +1037,7 @@ namespace OnlineStore.XLRStore ...@@ -1036,6 +1037,7 @@ namespace OnlineStore.XLRStore
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox6.Controls.Add(this.checkBox1);
this.groupBox6.Controls.Add(this.groupBox12); this.groupBox6.Controls.Add(this.groupBox12);
this.groupBox6.Controls.Add(this.lblwidth); this.groupBox6.Controls.Add(this.lblwidth);
this.groupBox6.Controls.Add(this.lblMoveInfo); this.groupBox6.Controls.Add(this.lblMoveInfo);
...@@ -1066,6 +1068,18 @@ namespace OnlineStore.XLRStore ...@@ -1066,6 +1068,18 @@ namespace OnlineStore.XLRStore
this.groupBox12.TabStop = false; this.groupBox12.TabStop = false;
this.groupBox12.Text = "取料机构测试"; this.groupBox12.Text = "取料机构测试";
// //
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.checkBox1.Location = new System.Drawing.Point(10, 328);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(154, 24);
this.checkBox1.TabIndex = 291;
this.checkBox1.Text = "检测到料串自动入库";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// cmbOutstorePos // cmbOutstorePos
// //
this.cmbOutstorePos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbOutstorePos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
...@@ -1371,6 +1385,7 @@ namespace OnlineStore.XLRStore ...@@ -1371,6 +1385,7 @@ namespace OnlineStore.XLRStore
private System.Windows.Forms.ComboBox cmbOutStartP; private System.Windows.Forms.ComboBox cmbOutStartP;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox cmbOutShelf; private System.Windows.Forms.ComboBox cmbOutShelf;
protected System.Windows.Forms.CheckBox checkBox1;
} }
} }
...@@ -332,6 +332,7 @@ namespace OnlineStore.XLRStore ...@@ -332,6 +332,7 @@ namespace OnlineStore.XLRStore
FrmBatchMove frmMove2 = new FrmBatchMove(inputEquip.BatchMove_B); FrmBatchMove frmMove2 = new FrmBatchMove(inputEquip.BatchMove_B);
AddForm(tabControl1, " " + inputEquip.BatchMove_B.Name + " ", frmMove2); AddForm(tabControl1, " " + inputEquip.BatchMove_B.Name + " ", frmMove2);
PointEditEnable(false); PointEditEnable(false);
checkBox1.Checked = inputEquip.AutoInput;
LoadPoint(); LoadPoint();
IsLoad = true; IsLoad = true;
} }
...@@ -710,6 +711,43 @@ namespace OnlineStore.XLRStore ...@@ -710,6 +711,43 @@ namespace OnlineStore.XLRStore
cmb.SelectedIndex = 0; cmb.SelectedIndex = 0;
} }
} }
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
if (checkBox1.Checked)
{
if (!inputEquip.AutoInput)
{
DialogResult result = MessageBox.Show("检测到料串自动入库?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result.Equals(DialogResult.Yes))
{
checkBox1.Checked = true;
inputEquip.AutoInput = true ;
ConfigAppSettings.SaveValue(Setting_Init.AutoInput, 1);
LogUtil.info(inputEquip.Name + "检测到料串自动入库= "+ checkBox1.Checked);
}
}
}
else
{
if (inputEquip.AutoInput)
{
DialogResult result = MessageBox.Show("关闭检测到料串自动入库?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result.Equals(DialogResult.Yes))
{
checkBox1.Checked = false;
inputEquip.AutoInput = false;
ConfigAppSettings.SaveValue(Setting_Init.AutoInput, 0);
LogUtil.info(inputEquip.Name + "检测到料串自动入库= " + checkBox1.Checked);
}
}
}
}
} }
} }
......
...@@ -178,6 +178,19 @@ namespace OnlineStore.XLRStore ...@@ -178,6 +178,19 @@ namespace OnlineStore.XLRStore
btnAddMove.Text = "点动+(放松)"; btnAddMove.Text = "点动+(放松)";
btnDelMove.Text = "点动-(夹紧)"; btnDelMove.Text = "点动-(夹紧)";
break; break;
case "取料旋转轴":
btnAddMove.Text = "点动+(向左)";
btnDelMove.Text = "点动-(向右)";
break;
case "取料升降轴":
btnAddMove.Text = "点动+(下降)";
btnDelMove.Text = "点动-(上升)";
break;
case "A料口提升轴":
case "B料口提升轴":
btnAddMove.Text = "点动+(上升)";
btnDelMove.Text = "点动-(下降)";
break;
default: default:
btnAddMove.Text = "点动+"; btnAddMove.Text = "点动+";
btnDelMove.Text = "点动-"; btnDelMove.Text = "点动-";
......
...@@ -15,3 +15,6 @@ AA:第3和第4位存储机构A面或B面,AA或者BB ...@@ -15,3 +15,6 @@ AA:第3和第4位存储机构A面或B面,AA或者BB
旋转轴回待机点P1 旋转轴回待机点P1
升降轴回P1 升降轴回P1
点击复位按钮自动启动。
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!