Commit 9d2a7c0d 几米阳光

出入库失败的消息也发送给服务器

1 个父辈 c5bf45f1
...@@ -7,13 +7,15 @@ ...@@ -7,13 +7,15 @@
<!--是否开机自动启动料仓--> <!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1" /> <add key="App_AutoRun" value="1" />
<add key="App_Title" value="料仓_批量上下料" /> <add key="App_Title" value="料仓_批量上下料" />
<add key="Server_Log_Open" value="0" />
<add key="scanner_start_command" value="S" /> <add key="scanner_start_command" value="S" />
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)--> <!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<add key="StartBlowValue" value="4" /> <add key="StartBlowValue" value="4" />
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)--> <!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<add key="StopBlowValue" value="4" /> <add key="StopBlowValue" value="4" />
<!--Server address--> <!--Server address-->
<add key="http.server" value="http://192.168.1.187/myproject/"/> <add key="http.server" value="" />
<!--<add key="http.server" value="http://192.168.1.187/myproject/" /> -->
<!--storeType--> <!--storeType-->
<add key="store_count" value="1" /> <add key="store_count" value="1" />
<!--start one store config--> <!--start one store config-->
...@@ -25,16 +27,16 @@ ...@@ -25,16 +27,16 @@
<!--摄像机名称列表配置,用#分割--> <!--摄像机名称列表配置,用#分割-->
<add key="CameraName" value="GigE:MV-CE100-30GC (00C69898477)" /> <add key="CameraName" value="GigE:MV-CE100-30GC (00C69898477)" />
<!--二维码类型列表配置,用#分割--> <!--二维码类型列表配置,用#分割-->
<add key="CodeType" value="Data Matrix ECC 200#QR Code" /> <add key="CodeType" value="QR Code" />
<!--<add key="CodeType" value="Data Matrix ECC 200"/>--> <!--<add key="CodeType" value="Data Matrix ECC 200#QR Code"/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" /> <add key="CodeParamPath" value="\CodeParam\" />
<add key="InOutDefaultPosition" value="10000" /> <add key="InOutDefaultPosition" value="10000" />
<add key="Config_Pwd" value="123456" /> <add key="Config_Pwd" value="123456" />
<!--批量上下料轴5000脉冲对应1mm--> <!--5000脉冲对应1mm-->
<add key="AxisChangeValue" value="5000" /> <add key="AxisChangeValue" value="5000" />
<!--压紧轴计量检测信号亮1次的脉冲值--> <!--压紧轴计量检测信号亮1次的脉冲值-->
<add key ="ComAxisChangeValue" value ="2400"/> <add key="ComAxisChangeValue" value="10000" />
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -83,14 +83,10 @@ ...@@ -83,14 +83,10 @@
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblAxisStatus = new System.Windows.Forms.Label(); this.lblAxisStatus = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button();
this.axis_5_Alarm = new UserFromControl.IOStatusControl();
this.txtBatchTarget = new System.Windows.Forms.TextBox(); this.txtBatchTarget = new System.Windows.Forms.TextBox();
this.lblCountPulse5 = new System.Windows.Forms.TextBox(); this.lblCountPulse5 = new System.Windows.Forms.TextBox();
this.lblOutPulse5 = new System.Windows.Forms.TextBox(); this.lblOutPulse5 = new System.Windows.Forms.TextBox();
this.label20 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label();
this.axis_1_Alarm = new UserFromControl.IOStatusControl();
this.axis_3_Alarm = new UserFromControl.IOStatusControl();
this.axis_2_Alarm = new UserFromControl.IOStatusControl();
this.label38 = new System.Windows.Forms.Label(); this.label38 = new System.Windows.Forms.Label();
this.txtMiddleTarget = new System.Windows.Forms.TextBox(); this.txtMiddleTarget = new System.Windows.Forms.TextBox();
this.txtInoutTarget = new System.Windows.Forms.TextBox(); this.txtInoutTarget = new System.Windows.Forms.TextBox();
...@@ -245,6 +241,10 @@ ...@@ -245,6 +241,10 @@
this.btnGetOutTray = new System.Windows.Forms.Button(); this.btnGetOutTray = new System.Windows.Forms.Button();
this.lblDoorStatus = new System.Windows.Forms.Label(); this.lblDoorStatus = new System.Windows.Forms.Label();
this.btnBatchInStore = new System.Windows.Forms.Button(); this.btnBatchInStore = new System.Windows.Forms.Button();
this.axis_5_Alarm = new UserFromControl.IOStatusControl();
this.axis_1_Alarm = new UserFromControl.IOStatusControl();
this.axis_3_Alarm = new UserFromControl.IOStatusControl();
this.axis_2_Alarm = new UserFromControl.IOStatusControl();
this.groupBox5.SuspendLayout(); this.groupBox5.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
...@@ -989,16 +989,6 @@ ...@@ -989,16 +989,6 @@
this.button3.UseVisualStyleBackColor = true; this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click); this.button3.Click += new System.EventHandler(this.button3_Click);
// //
// axis_5_Alarm
//
this.axis_5_Alarm.IOName = "";
this.axis_5_Alarm.IOValue = 0;
this.axis_5_Alarm.isCanClick = false;
this.axis_5_Alarm.Location = new System.Drawing.Point(418, 37);
this.axis_5_Alarm.Name = "axis_5_Alarm";
this.axis_5_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_5_Alarm.TabIndex = 271;
//
// txtBatchTarget // txtBatchTarget
// //
this.txtBatchTarget.Location = new System.Drawing.Point(395, 139); this.txtBatchTarget.Location = new System.Drawing.Point(395, 139);
...@@ -1033,36 +1023,6 @@ ...@@ -1033,36 +1023,6 @@
this.label20.TabIndex = 267; this.label20.TabIndex = 267;
this.label20.Text = "批量出入料轴"; this.label20.Text = "批量出入料轴";
// //
// axis_1_Alarm
//
this.axis_1_Alarm.IOName = "";
this.axis_1_Alarm.IOValue = 0;
this.axis_1_Alarm.isCanClick = false;
this.axis_1_Alarm.Location = new System.Drawing.Point(116, 37);
this.axis_1_Alarm.Name = "axis_1_Alarm";
this.axis_1_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_1_Alarm.TabIndex = 264;
//
// axis_3_Alarm
//
this.axis_3_Alarm.IOName = "";
this.axis_3_Alarm.IOValue = 0;
this.axis_3_Alarm.isCanClick = false;
this.axis_3_Alarm.Location = new System.Drawing.Point(318, 37);
this.axis_3_Alarm.Name = "axis_3_Alarm";
this.axis_3_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_3_Alarm.TabIndex = 266;
//
// axis_2_Alarm
//
this.axis_2_Alarm.IOName = "";
this.axis_2_Alarm.IOValue = 0;
this.axis_2_Alarm.isCanClick = false;
this.axis_2_Alarm.Location = new System.Drawing.Point(213, 37);
this.axis_2_Alarm.Name = "axis_2_Alarm";
this.axis_2_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_2_Alarm.TabIndex = 265;
//
// label38 // label38
// //
this.label38.AutoSize = true; this.label38.AutoSize = true;
...@@ -2643,7 +2603,6 @@ ...@@ -2643,7 +2603,6 @@
// //
// groupBox6 // groupBox6
// //
this.groupBox6.Controls.Add(this.lblOutInfo);
this.groupBox6.Controls.Add(this.lblBatchMsg); this.groupBox6.Controls.Add(this.lblBatchMsg);
this.groupBox6.Controls.Add(this.btnOpenDoor); this.groupBox6.Controls.Add(this.btnOpenDoor);
this.groupBox6.Controls.Add(this.lblWaitTragGo); this.groupBox6.Controls.Add(this.lblWaitTragGo);
...@@ -2655,6 +2614,7 @@ ...@@ -2655,6 +2614,7 @@
this.groupBox6.Controls.Add(this.btnGetOutTray); this.groupBox6.Controls.Add(this.btnGetOutTray);
this.groupBox6.Controls.Add(this.lblDoorStatus); this.groupBox6.Controls.Add(this.lblDoorStatus);
this.groupBox6.Controls.Add(this.btnBatchInStore); this.groupBox6.Controls.Add(this.btnBatchInStore);
this.groupBox6.Controls.Add(this.lblOutInfo);
this.groupBox6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox6.Location = new System.Drawing.Point(7, 124); this.groupBox6.Location = new System.Drawing.Point(7, 124);
this.groupBox6.Name = "groupBox6"; this.groupBox6.Name = "groupBox6";
...@@ -2665,14 +2625,14 @@ ...@@ -2665,14 +2625,14 @@
// //
// lblOutInfo // lblOutInfo
// //
this.lblOutInfo.AutoSize = true;
this.lblOutInfo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblOutInfo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblOutInfo.ForeColor = System.Drawing.Color.Green; this.lblOutInfo.ForeColor = System.Drawing.Color.Green;
this.lblOutInfo.Location = new System.Drawing.Point(127, 105); this.lblOutInfo.Location = new System.Drawing.Point(19, 105);
this.lblOutInfo.Name = "lblOutInfo"; this.lblOutInfo.Name = "lblOutInfo";
this.lblOutInfo.Size = new System.Drawing.Size(106, 22); this.lblOutInfo.Size = new System.Drawing.Size(446, 22);
this.lblOutInfo.TabIndex = 234; this.lblOutInfo.TabIndex = 234;
this.lblOutInfo.Text = "累积出库信息"; this.lblOutInfo.Text = "累积出库信息";
this.lblOutInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// lblBatchMsg // lblBatchMsg
// //
...@@ -2794,6 +2754,46 @@ ...@@ -2794,6 +2754,46 @@
this.btnBatchInStore.UseVisualStyleBackColor = true; this.btnBatchInStore.UseVisualStyleBackColor = true;
this.btnBatchInStore.Click += new System.EventHandler(this.btnBatchInStore_Click); this.btnBatchInStore.Click += new System.EventHandler(this.btnBatchInStore_Click);
// //
// axis_5_Alarm
//
this.axis_5_Alarm.IOName = "";
this.axis_5_Alarm.IOValue = 0;
this.axis_5_Alarm.isCanClick = false;
this.axis_5_Alarm.Location = new System.Drawing.Point(418, 37);
this.axis_5_Alarm.Name = "axis_5_Alarm";
this.axis_5_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_5_Alarm.TabIndex = 271;
//
// axis_1_Alarm
//
this.axis_1_Alarm.IOName = "";
this.axis_1_Alarm.IOValue = 0;
this.axis_1_Alarm.isCanClick = false;
this.axis_1_Alarm.Location = new System.Drawing.Point(116, 37);
this.axis_1_Alarm.Name = "axis_1_Alarm";
this.axis_1_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_1_Alarm.TabIndex = 264;
//
// axis_3_Alarm
//
this.axis_3_Alarm.IOName = "";
this.axis_3_Alarm.IOValue = 0;
this.axis_3_Alarm.isCanClick = false;
this.axis_3_Alarm.Location = new System.Drawing.Point(318, 37);
this.axis_3_Alarm.Name = "axis_3_Alarm";
this.axis_3_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_3_Alarm.TabIndex = 266;
//
// axis_2_Alarm
//
this.axis_2_Alarm.IOName = "";
this.axis_2_Alarm.IOValue = 0;
this.axis_2_Alarm.isCanClick = false;
this.axis_2_Alarm.Location = new System.Drawing.Point(213, 37);
this.axis_2_Alarm.Name = "axis_2_Alarm";
this.axis_2_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_2_Alarm.TabIndex = 265;
//
// FrmStoreBox // FrmStoreBox
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......
...@@ -313,10 +313,11 @@ namespace OnlineStore.AutoInOutStore ...@@ -313,10 +313,11 @@ namespace OnlineStore.AutoInOutStore
lblDoorStatus.Text = "仓门状态:打开"; lblDoorStatus.Text = "仓门状态:打开";
UpdateFormDoorStats(true); UpdateFormDoorStats(true);
} }
lblOutInfo.Visible = AutomaticBaiting.BatchOutStoreHeight>0;
lblOutInfo.Text = "累积出库: " + AutomaticBaiting.BatchOutStoreCount + "盘, 高" + AutomaticBaiting.BatchOutStoreHeight + "mm";
}
}
lblOutInfo.Visible = !lblWaitTragGo.Visible;
lblOutInfo.Text ="累积处理 入库:"+AutomaticBaiting.BatchInStoreCount+"盘共"+AutomaticBaiting.BatchInStoreHeight+"mm,"+
"出库: " + AutomaticBaiting.BatchOutStoreCount + "盘共" + AutomaticBaiting.BatchOutStoreHeight + "mm";
if (HumitureController.IsRun) if (HumitureController.IsRun)
{ {
btnSelTemp.Enabled = true; btnSelTemp.Enabled = true;
......
...@@ -79,6 +79,15 @@ X22_气压检测: ...@@ -79,6 +79,15 @@ X22_气压检测:
压紧轴改为同步返回数据模式,压紧轴增加计量检测功能。 压紧轴改为同步返回数据模式,压紧轴增加计量检测功能。
20121226
出库状态下,如果复位未开门锁,不能清理出库信息
出入库增加统计,增加气压检测功能。
出入库失败信息发个服务器
......
...@@ -34,6 +34,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -34,6 +34,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
private Dictionary<string, AxisAlarmInfo> AxisAlarmCodeMap = new Dictionary<string, AxisAlarmInfo>(); private Dictionary<string, AxisAlarmInfo> AxisAlarmCodeMap = new Dictionary<string, AxisAlarmInfo>();
private IO_VALUE preAirValue = IO_VALUE.HIGH;
private bool IsHasCompress_Axis = true; private bool IsHasCompress_Axis = true;
public AC_SA_BoxBean(AUTO_SA_Config config) public AC_SA_BoxBean(AUTO_SA_Config config)
{ {
...@@ -112,11 +113,47 @@ namespace OnlineStore.DeviceLibrary ...@@ -112,11 +113,47 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
//气压检测,如果气压持续3秒没有信号,报气压报警
AirCheckProcess();
//光栅处理 //光栅处理
//SafetyLightProcess(); //SafetyLightProcess();
} }
} }
} }
private void AirCheckProcess()
{
IO_VALUE currAirValue = KND.IOValue(IO_Type.Airpressure_Check);
if (isInSuddenDown)
{
return;
}
if (currAirValue.Equals(IO_VALUE.LOW))
{
//判断是否持续了3秒
if (preAirValue.Equals(IO_VALUE.LOW) )
{
TimeSpan span = DateTime.Now - lastAirCloseTime;
if (span.TotalSeconds > Config.AirCheckSeconds)
{
WarnMsg = "未检测到气压信号";
preAirValue = IO_VALUE.LOW;
LogUtil.info("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警");
Alarm(StoreAlarmType.NoAirCheck, "2", WarnMsg, StoreMoveType.None);
return;
}
}
else
{
lastAirCloseTime = DateTime.Now;
isNoAirCheck = false;
}
}
else
{
isNoAirCheck = false;
}
preAirValue = currAirValue;
}
/// <summary> /// <summary>
/// 配置速度,加减速时间 /// 配置速度,加减速时间
/// </summary> /// </summary>
...@@ -700,7 +737,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -700,7 +737,7 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Wait; storeRunStatus = StoreRunStatus.Wait;
mainTimer.Enabled = false; mainTimer.Enabled = false;
AutomaticBaiting.StopRun();
KNDManager.CloseAllDO(); KNDManager.CloseAllDO();
if (IsHasCompress_Axis) if (IsHasCompress_Axis)
{ {
...@@ -1357,7 +1394,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1357,7 +1394,7 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作 #region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作
private string CodeMsg = ""; public string CodeOrInoutMsg = "";
private bool isInProcess = false; private bool isInProcess = false;
private void server_connect_timer_Tick(object sender, EventArgs e) private void server_connect_timer_Tick(object sender, EventArgs e)
{ {
...@@ -1421,10 +1458,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -1421,10 +1458,10 @@ namespace OnlineStore.DeviceLibrary
} }
if (boxStatus.msg.Equals("")) if (boxStatus.msg.Equals(""))
{ {
boxStatus.msg = CodeMsg; boxStatus.msg = CodeOrInoutMsg;
lineOperation.msg = CodeMsg; lineOperation.msg = CodeOrInoutMsg;
} }
if (CodeMsg.Equals("")) if (CodeOrInoutMsg.Equals(""))
{ {
if (storeRunStatus.Equals(StoreRunStatus.Runing)&&AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing) if (storeRunStatus.Equals(StoreRunStatus.Runing)&&AutomaticBaiting.AutoBaitingStatus.Equals(StoreRunStatus.Runing)
&& KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) && KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
...@@ -1433,7 +1470,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1433,7 +1470,7 @@ namespace OnlineStore.DeviceLibrary
lineOperation.msg = "叉子料盘检测有料,请检查"; lineOperation.msg = "叉子料盘检测有料,请检查";
} }
} }
CodeMsg = ""; CodeOrInoutMsg = "";
//WarnMsg = ""; //WarnMsg = "";
//状态 //状态
boxStatus.status = (int)storeStatus; boxStatus.status = (int)storeStatus;
......
...@@ -35,6 +35,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -35,6 +35,9 @@ namespace OnlineStore.DeviceLibrary
public static int BatchOutStoreCount = 0; public static int BatchOutStoreCount = 0;
public static int BatchOutStoreHeight = 0; public static int BatchOutStoreHeight = 0;
public static int BatchInStoreCount = 0;
public static int BatchInStoreHeight = 0;
/// <summary> /// <summary>
/// 初始化数据 /// 初始化数据
/// </summary> /// </summary>
...@@ -86,22 +89,32 @@ namespace OnlineStore.DeviceLibrary ...@@ -86,22 +89,32 @@ namespace OnlineStore.DeviceLibrary
return msg; return msg;
} }
public static void ClearOutStoreInfo()
private static void ClearInOutInfo()
{ {
BatchOutStoreCount = 0; BatchOutStoreCount = 0;
BatchOutStoreHeight = 0; BatchOutStoreHeight = 0;
BatchInStoreCount = 0;
BatchInStoreHeight = 0;
}
private static void ClearInStoreInfo()
{
LastCode = ""; LastCode = "";
LastPosId = ""; LastPosId = "";
LastHeight = 0; LastHeight = 0;
LastSize = 0; LastSize = 0;
} }
public static void StopRun()
{
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
ClearInStoreInfo();
ClearOutStoreInfo();
}
public static void StopMove() public static void StopMove()
{ {
StoreMove.EndMove(); StoreMove.EndMove();
ClearInOutInfo(); ClearInStoreInfo();
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW); KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false); CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false);
BatchDoorClose(false); BatchDoorClose(false);
...@@ -127,7 +140,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -127,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
StopMove(); StopMove();
} }
WarnMsg = ""; WarnMsg = "";
ClearInOutInfo(); ClearInStoreInfo();
DoorStatus = 2; DoorStatus = 2;
AutoBaitingStatus = StoreRunStatus.Reset; AutoBaitingStatus = StoreRunStatus.Reset;
StoreMove.NewMove(StoreMoveType.StoreReset); StoreMove.NewMove(StoreMoveType.StoreReset);
...@@ -318,14 +331,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -318,14 +331,10 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I08_GetPosId); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I08_GetPosId);
//计算高度
EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
LastHeight = Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue;
LogUtil.info(Name + "入料: 计算高度:上升前位置【" + StartMovePosition + "】实时位置【" + EndMovePosition + "】,计算后高度【" + LastHeight + "】");
if (LastHeight > 12) { LastHeight = 24; }
else if (LastHeight >= 8) { LastHeight = 12; }
else if (LastHeight > 0) { LastHeight = 8; }
LastSize = StoreManager.Config.Default_TrayWidth; LastSize = StoreManager.Config.Default_TrayWidth;
LastHeight = GetHeight();
BatchInStoreCount++;
BatchInStoreHeight += LastHeight;
LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + LastSize + "*" + LastHeight + "】二维码【" + LastCode + "】"); LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + LastSize + "*" + LastHeight + "】二维码【" + LastCode + "】");
GetInStorePosId(ProcessMsg()); GetInStorePosId(ProcessMsg());
...@@ -376,6 +385,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -376,6 +385,29 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private static int GetHeight()
{
//计算高度
EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
LastHeight = (int)Math.Ceiling(1F * (EndMovePosition - StartMovePosition) / AxisChangeValue);
LogUtil.info(Name + "入料: 计算盘高:上升前【" + StartMovePosition + "】实时【" + EndMovePosition + "】计算后高度【" + LastHeight + "】");
if (StoreManager.Config.Default_TrayWidth.Equals(7))
{
if (LastHeight <= 8) { LastHeight = 8; }
else if (LastHeight <= 12) { LastHeight = 12; }
else { LastHeight = 24; }
}
else
{
if (LastHeight <= 8) { LastHeight = 8; }
else
{
LastHeight = (int)Math.Ceiling(1F * LastHeight / 4) * 4;
}
}
return LastHeight;
}
private static void SendTrayOut() private static void SendTrayOut()
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I10_WaitTrayGo); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I10_WaitTrayGo);
...@@ -470,7 +502,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -470,7 +502,8 @@ namespace OnlineStore.DeviceLibrary
} }
public static void BatchDoorOpen(bool isWait) public static void BatchDoorOpen(bool isWait)
{ {
ClearInOutInfo(); ClearInStoreInfo();
ClearOutStoreInfo();
DoorStatus = 1; DoorStatus = 1;
KND.IOMove(IO_Type.BatchDoor_Close, IO_VALUE.LOW); KND.IOMove(IO_Type.BatchDoor_Close, IO_VALUE.LOW);
KND.IOMove(IO_Type.BatchDoor_Open, IO_VALUE.HIGH); KND.IOMove(IO_Type.BatchDoor_Open, IO_VALUE.HIGH);
...@@ -483,7 +516,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -483,7 +516,8 @@ namespace OnlineStore.DeviceLibrary
public static void BatchDoorClose(bool isWait) public static void BatchDoorClose(bool isWait)
{ {
ClearInOutInfo(); ClearInStoreInfo();
ClearOutStoreInfo();
DoorStatus = 2; DoorStatus = 2;
if (isWait) if (isWait)
{ {
......
...@@ -299,6 +299,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -299,6 +299,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (LastCode.Equals("")) if (LastCode.Equals(""))
{ {
StoreManager.Store.CodeOrInoutMsg = "未扫到二维码,需要将料盘送出";
LogUtil.error("未扫到二维码,需要将料盘送出"); LogUtil.error("未扫到二维码,需要将料盘送出");
} }
else else
...@@ -444,5 +445,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -444,5 +445,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + ex.StackTrace); LogUtil.error(Name + ex.StackTrace);
} }
} }
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!