Commit 3220004e LN

增加暂停运动功能

1 个父辈 84a6bac7
......@@ -14,8 +14,8 @@ using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public partial class EquipBean : EquipBase
{
{
public bool MoveStop = false;
public static bool IsRun = false;
public string CID = "";
public EquipConfig Config;
......@@ -742,31 +742,37 @@ namespace OnlineStore.DeviceLibrary
{
doorCheckWatch.Stop();
}
if (MoveInfo.MoveType != StoreMoveType.None)
if (MoveStop)
{
BusyMoveProcess();
ShowTimeLog("BusyMoveProcess");
}
else if (storeRunStatus.Equals(StoreRunStatus.Runing))
else
{
IOTimeOutProcess();
ShowTimeLog("IOTimeOutProcess");
InShelfProcess();
if (MoveInfo.MoveType != StoreMoveType.None)
{
BusyMoveProcess();
ShowTimeLog("BusyMoveProcess");
}
else if (storeRunStatus.Equals(StoreRunStatus.Runing))
{
IOTimeOutProcess();
ShowTimeLog("IOTimeOutProcess");
InShelfProcess();
AutoResetProcess();
}
AutoResetProcess();
}
//检查运动轴报警
if (storeRunStatus > StoreRunStatus.Wait && (!isInSuddenDown) && (!isNoAirCheck))
{
CheckAxisAlarm();
ShowTimeLog("轴报警检测完成");
}
//检查运动轴报警
if (storeRunStatus > StoreRunStatus.Wait && (!isInSuddenDown) && (!isNoAirCheck))
{
CheckAxisAlarm();
ShowTimeLog("轴报警检测完成");
}
foreach (WorkStation shelf in StationMap.Values)
{
shelf.TimerProcess();
foreach (WorkStation shelf in StationMap.Values)
{
shelf.TimerProcess();
}
}
}
}
......@@ -776,10 +782,18 @@ namespace OnlineStore.DeviceLibrary
}
}
public TrayInfo CurrTray = null;
private DateTime LastGTime = DateTime.Now;
private void InShelfProcess()
{
//2秒钟获取一次
TimeSpan span = DateTime.Now - LastGTime;
if (span.TotalSeconds < 2)
{
return;
}
try
{
LastGTime = DateTime.Now;
if ((!CanStarInOut()))
{
return;
......@@ -806,9 +820,10 @@ namespace OnlineStore.DeviceLibrary
string outMsg = "";
CurrTray = HttpServer.GetLocation(LineConnect.DoorPosInfo.barcode, shelfRfid, out outMsg);
//需要取放料,且料架已准备好
if (String.IsNullOrEmpty(CurrTray.getP).Equals(false) && outMsg.Equals(""))
{
ClearWarnMsg("getLocation");
if (outMsg.Equals(""))
//if (String.IsNullOrEmpty(CurrTray.getP).Equals(false) && outMsg.Equals(""))
{
ClearWarnMsg("getLocation");
string targetP = GetShelfPosId();
if (!String.IsNullOrEmpty(targetP))
{
......@@ -863,9 +878,13 @@ namespace OnlineStore.DeviceLibrary
{
if (shelf.IsReady())
{
str += shelf.CurrShelf.RealShelf + ",";
str += shelf.CurrShelf.RealShelf + ";";
}
}
if (str.EndsWith(";"))
{
str = str.Substring(0, str.Length - 1);
}
return str;
}
private void StartMove()
......@@ -977,7 +996,7 @@ namespace OnlineStore.DeviceLibrary
}
public string GetMoveStr()
{
string msg = LineConnect.DoorPosInfo?.ToStr();
string msg = LineConnect.DoorPosInfo?.ToStr() + "\r\n";
foreach (WorkStation shelf in StationMap.Values)
{
......@@ -1093,7 +1112,7 @@ namespace OnlineStore.DeviceLibrary
isNeedAlarmLed = true;
}
if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore))
if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore) || LineConnect.DoorPosInfo != null)
{
isInOut = true;
}
......
......@@ -193,7 +193,7 @@ namespace OnlineStore.DeviceLibrary
public bool CanStartOut()
{
TimeSpan span = DateTime.Now - LastUpdateTime;
if (span.TotalSeconds < ClientKeepSecond && CanOutStore)
if ((span.TotalSeconds < ClientKeepSecond) && CanOutStore)
{
return true;
}
......
......@@ -185,10 +185,10 @@ namespace OnlineStore.DeviceLibrary
{
string url = httpAddr + api + "?barcode=" + barcode + "&rfid=" + currRFID;
string logName = "http :URL:" + url + " , ";
string logName = "http :URL:" + url + "";
DateTime startTime = DateTime.Now;
string json = HttpHelper.Post(url, "", 10000);
LogUtil.info(logName + ",Response:" + json + ",耗时【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】");
LogUtil.info(logName + "Response:" + json + ",耗时【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】");
if (string.IsNullOrWhiteSpace(json))
{
return tray;
......@@ -248,7 +248,7 @@ namespace OnlineStore.DeviceLibrary
public class TrayInfo
{
//public int robotNum = 0;
public string getP = "";
//public string getP = "";
public int shelfP = 0;
public string rfid = "";
public string realRFID = "";
......@@ -256,7 +256,7 @@ namespace OnlineStore.DeviceLibrary
public string usedRfidList = "";
public string ToStr()
{
return " [" + barcode + "] [" + getP + "] [" + shelfP + "] [" + rfid + "] [" + realRFID + "] [" + usedRfidList + "] [" + updateTime.ToLongTimeString() + "]";
return " [" + barcode + "] [" + shelfP + "] [" + rfid + "] [" + realRFID + "] [" + usedRfidList + "] [" + updateTime.ToLongTimeString() + "]";
}
public DateTime updateTime = DateTime.Now;
......
......@@ -136,6 +136,7 @@
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer2 = new System.Windows.Forms.Timer(this.components);
this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -175,6 +176,7 @@
//
// tabPage2
//
this.tabPage2.Controls.Add(this.chbMoveStop);
this.tabPage2.Controls.Add(this.checkBox3);
this.tabPage2.Controls.Add(this.checkBox2);
this.tabPage2.Controls.Add(this.checkBox1);
......@@ -241,7 +243,7 @@
this.lblMoveEquipInfo.AutoSize = true;
this.lblMoveEquipInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveEquipInfo.ForeColor = System.Drawing.Color.Green;
this.lblMoveEquipInfo.Location = new System.Drawing.Point(717, 15);
this.lblMoveEquipInfo.Location = new System.Drawing.Point(687, 18);
this.lblMoveEquipInfo.Name = "lblMoveEquipInfo";
this.lblMoveEquipInfo.Size = new System.Drawing.Size(107, 17);
this.lblMoveEquipInfo.TabIndex = 283;
......@@ -252,7 +254,7 @@
this.btnS3Reset.BackColor = System.Drawing.Color.White;
this.btnS3Reset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnS3Reset.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnS3Reset.Location = new System.Drawing.Point(423, 150);
this.btnS3Reset.Location = new System.Drawing.Point(549, 150);
this.btnS3Reset.Name = "btnS3Reset";
this.btnS3Reset.Size = new System.Drawing.Size(132, 39);
this.btnS3Reset.TabIndex = 282;
......@@ -265,7 +267,7 @@
this.btnS2Reset.BackColor = System.Drawing.Color.White;
this.btnS2Reset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnS2Reset.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnS2Reset.Location = new System.Drawing.Point(285, 150);
this.btnS2Reset.Location = new System.Drawing.Point(411, 150);
this.btnS2Reset.Name = "btnS2Reset";
this.btnS2Reset.Size = new System.Drawing.Size(132, 39);
this.btnS2Reset.TabIndex = 281;
......@@ -278,7 +280,7 @@
this.btnS1Reset.BackColor = System.Drawing.Color.White;
this.btnS1Reset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnS1Reset.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnS1Reset.Location = new System.Drawing.Point(147, 150);
this.btnS1Reset.Location = new System.Drawing.Point(273, 150);
this.btnS1Reset.Name = "btnS1Reset";
this.btnS1Reset.Size = new System.Drawing.Size(132, 39);
this.btnS1Reset.TabIndex = 280;
......@@ -291,7 +293,7 @@
this.btnClearDoor.BackColor = System.Drawing.Color.White;
this.btnClearDoor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClearDoor.Location = new System.Drawing.Point(9, 150);
this.btnClearDoor.Location = new System.Drawing.Point(135, 150);
this.btnClearDoor.Name = "btnClearDoor";
this.btnClearDoor.Size = new System.Drawing.Size(132, 39);
this.btnClearDoor.TabIndex = 279;
......@@ -1506,6 +1508,18 @@
//
this.timer2.Interval = 1000;
//
// chbMoveStop
//
this.chbMoveStop.AutoSize = true;
this.chbMoveStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbMoveStop.Location = new System.Drawing.Point(29, 157);
this.chbMoveStop.Name = "chbMoveStop";
this.chbMoveStop.Size = new System.Drawing.Size(84, 24);
this.chbMoveStop.TabIndex = 288;
this.chbMoveStop.Text = "暂停运动";
this.chbMoveStop.UseVisualStyleBackColor = true;
this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged);
//
// FrmEquip
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
......@@ -1653,6 +1667,7 @@
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.CheckBox checkBox1;
protected System.Windows.Forms.CheckBox chbMoveStop;
}
}
......@@ -168,7 +168,7 @@ namespace OnlineStore.ACSingleStore
chbDebug.Checked = equip.IsDebug;
LoadOk = true;
}
lblMoveEquipInfo.Text = "移栽状态:" + (equip.lineConn.CanStartOut() ? "可出库" : "不可出库") + " " + equip.lineConn.LastUpdateTime.ToLongTimeString() + "";
lblMoveEquipInfo.Text = "" + (equip.lineConn.CanStartOut() ? "可取料" : "不可取料") + " " + equip.lineConn.LastUpdateTime.ToLongTimeString() + "";
lblThisSta.Text = equip.GetRunStr();
lblMoveStr.Text = equip.GetMoveStr();
//ReadPosistion();
......@@ -1217,5 +1217,16 @@ namespace OnlineStore.ACSingleStore
int num = 3;
DisS(num, checkBox3);
}
private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
equip.MoveStop = chbMoveStop.Checked;
LogUtil.info(equip.Name + "用户切换是否暂停: " + equip.MoveStop);
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!