Commit 181d32e7 LN

出入库逻辑

1 个父辈 c1af307d
......@@ -109,6 +109,7 @@ namespace OnlineStore.DUOStore
this.btnStoreStart = new System.Windows.Forms.Button();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.lblThisSta = new System.Windows.Forms.Label();
this.lblCanOut = new System.Windows.Forms.Label();
this.groupBox4.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
......@@ -1238,6 +1239,7 @@ namespace OnlineStore.DUOStore
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.lblCanOut);
this.groupBox3.Controls.Add(this.lblMoveEquipInfo);
this.groupBox3.Controls.Add(this.btnSotreReset);
this.groupBox3.Controls.Add(this.btnStoreStop);
......@@ -1303,7 +1305,7 @@ namespace OnlineStore.DUOStore
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(407, 14);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(662, 84);
this.lblWarnMsg.Size = new System.Drawing.Size(662, 50);
this.lblWarnMsg.TabIndex = 224;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
......@@ -1318,6 +1320,17 @@ namespace OnlineStore.DUOStore
this.lblThisSta.TabIndex = 216;
this.lblThisSta.Text = "等待启动";
//
// lblCanOut
//
this.lblCanOut.AutoSize = true;
this.lblCanOut.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCanOut.ForeColor = System.Drawing.Color.Green;
this.lblCanOut.Location = new System.Drawing.Point(949, 74);
this.lblCanOut.Name = "lblCanOut";
this.lblCanOut.Size = new System.Drawing.Size(51, 19);
this.lblCanOut.TabIndex = 273;
this.lblCanOut.Text = "可出库";
//
// FrmBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -1442,6 +1455,7 @@ namespace OnlineStore.DUOStore
public System.Windows.Forms.Button btnUpDownP4;
private System.Windows.Forms.Button btnSingleOut;
private System.Windows.Forms.Button btnNgPro;
private System.Windows.Forms.Label lblCanOut;
}
}
......@@ -132,6 +132,7 @@ namespace OnlineStore.DUOStore
lblMoveEquipInfo.Text = "";
// lblMoveEquipInfo.Text = "";
}
lblCanOut.Text = StoreManager.Store.CanOut() ? "可出库" : "不可出库";
//ReadPosistion();
if (BoxBean.runStatus > StoreRunStatus.Wait)
{
......@@ -660,9 +661,9 @@ namespace OnlineStore.DUOStore
private void btnSelTemp_Click(object sender, EventArgs e)
{
// HumitureParam param = BoxBean.humBean.QueryData();
// txtTemp.Text = param.Temperate.ToString();
// txtHum.Text = param.Humidity.ToString();
HumitureParam param = BoxBean.humBean.QueryData();
txtTemp.Text = param.Temperate.ToString();
txtHum.Text = param.Humidity.ToString();
}
internal void DebugStatus(bool isDebug)
......
多料仓软件。
有温湿度传感器,不需要吹氮气。
......
......@@ -16,19 +16,15 @@ namespace OnlineStore.DeviceLibrary
{
public partial class BoxBean : EquipBase
{
private bool IsIntSlvBlock = false;
public AutoInoutInfo AutoInout = new AutoInoutInfo();
public string CID = "";
public BOX_Config Config;
public string lastPosId = "";
public StoreStatus lastPosIdStatus = StoreStatus.StoreOnline;
public List<ConfigMoveAxis> moveAxisList = new List<ConfigMoveAxis>();
private List<ConfigMoveAxis> moveAxisList = new List<ConfigMoveAxis>();
public List<string> PositionNumList = new List<string>();
public HumitureBean humBean = null;
public AxisBean UpdownAxis = null;
public AxisBean MiddleAxis = null;
public AxisBean ComAxis = null;
......@@ -94,7 +90,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
public void MoveAxisConfig()
internal void MoveAxisConfig()
{
Config.UpDown_Axis.BreakOnDO = IO_Type.UpdownAxis_Break;
moveAxisList = new List<ConfigMoveAxis>();
......@@ -103,6 +99,8 @@ namespace OnlineStore.DeviceLibrary
moveAxisList.Add(Config.InOut_Axis);
moveAxisList.Add(Config.Comp_Axis);
}
public override bool StartRun(bool isDebug = false)
{
if (!StoreManager.Store.canStart)
......@@ -281,6 +279,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - StartTime;
LogInfo(",停止运行,总运行时间:" + span.ToString());
}
public override void Alarm(AlarmType alarmType, string alarmDetial = "", string alarmMsg = "", MoveType storeMoveType = MoveType.None)
{
base.Alarm(alarmType, alarmDetial, alarmMsg, storeMoveType);
......
......@@ -34,15 +34,26 @@ namespace OnlineStore.DeviceLibrary
lastConTime = DateTime.Now;
try
{
//HumitureController.QueryData();
humBean.HumidityProcess(this);
if (StoreManager.IsConnectServer)
{
SendLineStatus();
}
//出料口状态灯处理
OutDoorLedProcess();
}
catch (Exception ex)
{
LogUtil.error(Name + "定时SendLineStatus出错:" + ex.ToString());
}
finally
{
isInProcess = false;
}
}
private void OutDoorLedProcess()
{
if (OutDoorReelType.Equals(1))
{
IOMove(IO_Type.DoorLed_Red, IO_VALUE.LOW, true);
......@@ -73,15 +84,6 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.DoorLed_Red, IO_VALUE.LOW, true);
}
}
catch (Exception ex)
{
LogUtil.error(Name + "定时SendLineStatus出错:" + ex.ToString());
}
finally
{
isInProcess = false;
}
}
/// <summary>
/// 获取整个料仓的状态
......
......@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
{
public partial class DUOStoreBean : EquipBase
{
public Dictionary<int, BOX_Config> BoxConfigMap { get; set; }
internal Dictionary<int, BOX_Config> BoxConfigMap { get; set; }
public Dictionary<int, BoxBean> BoxMap = new Dictionary<int, BoxBean>();
public Store_Config Config { get; set; }
......@@ -149,11 +149,9 @@ namespace OnlineStore.DeviceLibrary
//停止运动
MoveInfo.EndMove();
runStatus = StoreRunStatus.Reset;
StartResetMove();
foreach (BoxBean equip in BoxMap.Values)
{
if (!equip.alarmType.Equals(AlarmType.None))
......@@ -188,7 +186,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop2_Work, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop3_Buffer, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_Stop4_Out, IO_VALUE.LOW));
}
protected override void ResetProcess()
......@@ -221,7 +218,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LR_03_BatchAxisHome))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_04_BatchToP1);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :提升轴到P1点,上下轴到待机点P2");
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :提升轴到P1点["+ Config.BatchAxis_P1 + "],上下轴到待机点P2["+ Config.UpdownAxis_P2 + "]");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P1Speed);
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P2, Config.UpdownAxis_P2Speed);
......@@ -238,10 +235,10 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LR_05_Hoister_Back))
{
MoveInfo.NextMoveStep(StoreMoveStep.LR_06_TopDown);
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :顶升气缸下降,旋转轴到待机点P1");
LogUtil.info(Name + "复位 " + MoveInfo.MoveStep + " :顶升气缸下降,旋转轴到待机点P1["+ Config.MiddleAxis_P1 + "]");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P2, Config.MiddleAxis_P2Speed);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LR_06_TopDown))
{
......@@ -329,7 +326,7 @@ namespace OnlineStore.DeviceLibrary
DateTime time = DateTime.Now;
bool isNeedAlarmLed = false;
bool isInOut = false;
StoreRunStatus runs = StoreRunStatus.Wait;
bool isReset = false;
foreach (BoxBean box in BoxMap.Values)
{
......@@ -341,14 +338,14 @@ namespace OnlineStore.DeviceLibrary
{
isInOut = true;
}
if (box.runStatus > runs)
if (box.runStatus.Equals(StoreRunStatus.HomeMoving) || box.runStatus.Equals(StoreRunStatus.Reset))
{
runs = box.runStatus;
isReset = true;
}
}
//黄灯
if (runs.Equals(StoreRunStatus.HomeMoving) || runs.Equals(StoreRunStatus.Reset))
//复位过程中黄灯闪烁
if (runStatus.Equals(StoreRunStatus.HomeMoving) || runStatus.Equals(StoreRunStatus.Reset)||isReset )
{
//开机执行中时黄灯闪烁
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
......@@ -367,10 +364,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
}
}
if (alarmType.Equals(AlarmType.None).Equals(false) || isNoAirCheck || isInSuddenDown )
{
isNeedAlarmLed = true;
}
//忙碌中,判断是否有移栽在出入库执行,绿灯闪烁
if (isInOut)
{
......@@ -389,6 +383,10 @@ namespace OnlineStore.DeviceLibrary
}
//报警中 ,红灯闪烁
if (alarmType.Equals(AlarmType.None).Equals(false) || isNoAirCheck || isInSuddenDown )
{
isNeedAlarmLed = true;
}
if (isNeedAlarmLed)
{
if (IsDoValue(IO_Type.Alarm_HddLed, IO_VALUE.LOW))
......@@ -420,7 +418,6 @@ namespace OnlineStore.DeviceLibrary
private IO_VALUE preAirValue = IO_VALUE.HIGH;
private void AirCheckProcess()
{
IO_VALUE currAirValue = IOValue(IO_Type.Airpressure_Check);
if (isInSuddenDown)
{
......@@ -545,22 +542,20 @@ namespace OnlineStore.DeviceLibrary
ShowTimeLog("IOTimeOutProcess");
//判断是否需要处理料架入库
StartInStoreP();
}
//检查运动轴报警
if (runStatus > StoreRunStatus.Wait && (!isInSuddenDown) && (!isNoAirCheck))
{
ShowTimeLog("开始检测轴报警");
CheckAxisAlarm(new AxisBean[] { T1_BatchAxis,T2_MiddleAxis,T3_UpdownAxis});
CheckAxisAlarm(new AxisBean[] { T1_BatchAxis, T2_MiddleAxis, T3_UpdownAxis });
ShowTimeLog("轴报警检测完成");
}
if (runStatus.Equals(StoreRunStatus.Runing) || runStatus.Equals(StoreRunStatus.Busy))
{
ShelfOutProcess();
ShowTimeLog("ShelfOutProcess");
}
}
catch (Exception ex)
......
......@@ -69,32 +69,29 @@ namespace OnlineStore.DeviceLibrary
public string currTempStr = "";
internal void HumidityProcess(BoxBean box)
{
//try
//{
// if ((DateTime.Now - preLogTime).TotalSeconds > 10)
// {
// preLogTime = DateTime.Now;
// //用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
// //温湿度
// //ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
// HumitureParam param = QueryData();
// double humidity = 0;
// double temp = 0;
// if (param != null)
// {
// humidity = param.Humidity;
// temp = param.Temperate;
// currTempStr = Name + ("湿度:" + humidity.ToString() + ",温度:" + temp);
// }
// //double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
// double currMaxHumidity = param.Humidity;
// float startBlowHumidity = Max_Humidity - StartBlowValue;
// float stopBlowHumidity = Max_Humidity - StopBlowValue;
try
{
if ((DateTime.Now - preLogTime).TotalSeconds > 10)
{
preLogTime = DateTime.Now;
HumitureParam param = QueryData();
double humidity = 0;
double temp = 0;
if (param != null)
{
humidity = param.Humidity;
temp = param.Temperate;
currTempStr = Name + ("湿度:" + humidity.ToString() + ",温度:" + temp);
}
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue;
float stopBlowHumidity = Max_Humidity - StopBlowValue;
// //判断是否需要吹气
// if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
// {
////判断是否需要吹气
//if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
//{
// //判断是否距离上次结束指定的时间
// TimeSpan span = DateTime.Now - LastEndBlowTime;
// if (span.TotalMinutes > StoreManager.Config.BlowAir_Interval)
......@@ -106,17 +103,17 @@ namespace OnlineStore.DeviceLibrary
// LastBeginBlowTime = DateTime.Now;
// LastEndBlowTime = DateTime.Now;
// }
// }
//}
// if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
// {
//if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
//{
// LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",停止吹气湿度:" + stopBlowHumidity + ",停止吹气!");
// IsInBlowing = false;
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// LastEndBlowTime = DateTime.Now;
// }
// if (IsInBlowing)
// {
//}
//if (IsInBlowing)
//{
// //判断是否需要结束吹气
// TimeSpan span = DateTime.Now - LastBeginBlowTime;
// if (span.TotalMinutes > StoreManager.Config.BlowAir_Time)
......@@ -127,44 +124,42 @@ namespace OnlineStore.DeviceLibrary
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// LastEndBlowTime = DateTime.Now;
// }
// }
// bool needAlarm = false;
// //如果开始吹气并且当前达到报警值
// if (IsInBlowing && humidity > Max_Humidity)
// {
// needAlarm = true;
// }
// else if (temp > Max_Temperature && Max_Temperature > 0)
// {
// LogUtil.info(Name + "当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
// needAlarm = true;
// //Thread.Sleep(100);
//}
bool needAlarm = false;
//如果开始吹气并且当前达到报警值
if (IsInBlowing && humidity > Max_Humidity)
{
needAlarm = true;
}
else if (temp > Max_Temperature && Max_Temperature > 0)
{
LogUtil.info(Name + "当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
needAlarm = true;
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// }
// else if (temp < Max_Temperature)
// {
// if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
// {
// LogUtil.info(Name + "不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
// TempOrHumidityIsAlarm = false;
// //Thread.Sleep(100);
}
else if (temp < Max_Temperature)
{
if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
{
LogUtil.info(Name + "不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
TempOrHumidityIsAlarm = false;
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// }
// }
// else
// {
// TempOrHumidityIsAlarm = false;
// }
// if (needAlarm)
// {
// HTAlarm();
// }
// }
//}
//catch (Exception ex)
//{
// LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
//}
}
}
else
{
TempOrHumidityIsAlarm = false;
}
if (needAlarm)
{
HTAlarm();
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
}
}
private void HTAlarm()
{
......
......@@ -75,9 +75,7 @@ namespace OnlineStore.DeviceLibrary
positionIndex = newIndex;
string posid = boxBean.PositionNumList[positionIndex];
InOutParam param = new InOutParam(MoveType.OutStore, "AutoOut", posid);
//param.NeedOutShelf = false;
//param.NeedEnterShelf = false;
InOutParam param = new InOutParam(MoveType.OutStore, "AutoOut", posid,1);
//判断是否需要重置
if (CurrInOutACount >= StoreManager.Config.Box_ResetACount)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!