Commit 86ebf9cf LN

入库失败时蜂鸣器响,且不再扫码入库

1 个父辈 46d84b6a
......@@ -53,12 +53,6 @@
<ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference>
......
......@@ -30,9 +30,9 @@
{
this.btnNext = new System.Windows.Forms.Button();
this.btnCopy = new System.Windows.Forms.Button();
this.lblCodeName = new System.Windows.Forms.Label();
this.lblTime = new System.Windows.Forms.Label();
this.lblVersion = new System.Windows.Forms.Label();
this.lblCodeName1 = new System.Windows.Forms.Label();
this.lblTime1 = new System.Windows.Forms.Label();
this.lblVersion1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnNext
......@@ -58,38 +58,38 @@
this.btnCopy.UseVisualStyleBackColor = true;
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// lblCodeName
// lblCodeName1
//
this.lblCodeName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.lblCodeName1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblCodeName.Location = new System.Drawing.Point(11, 114);
this.lblCodeName.Name = "lblCodeName";
this.lblCodeName.Size = new System.Drawing.Size(529, 23);
this.lblCodeName.TabIndex = 282;
this.lblCodeName.Text = "软件编号:43 6F 64 65 4C 69 62 72 61 72 79 50 72 6F 6A 65 63 74 ";
this.lblCodeName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblCodeName1.Location = new System.Drawing.Point(11, 114);
this.lblCodeName1.Name = "lblCodeName1";
this.lblCodeName1.Size = new System.Drawing.Size(529, 23);
this.lblCodeName1.TabIndex = 282;
this.lblCodeName1.Text = "软件编号:43 6F 64 65 4C 69 62 72 61 72 79 50 72 6F 6A 65 63 74 ";
this.lblCodeName1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblTime
// lblTime1
//
this.lblTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.lblTime1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblTime.Location = new System.Drawing.Point(80, 80);
this.lblTime.Name = "lblTime";
this.lblTime.Size = new System.Drawing.Size(379, 23);
this.lblTime.TabIndex = 281;
this.lblTime.Text = "更新时间:0000-00-00 00:00:00";
this.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblTime1.Location = new System.Drawing.Point(80, 80);
this.lblTime1.Name = "lblTime1";
this.lblTime1.Size = new System.Drawing.Size(379, 23);
this.lblTime1.TabIndex = 281;
this.lblTime1.Text = "更新时间:0000-00-00 00:00:00";
this.lblTime1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblVersion
// lblVersion1
//
this.lblVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.lblVersion1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblVersion.Location = new System.Drawing.Point(11, 50);
this.lblVersion.Name = "lblVersion";
this.lblVersion.Size = new System.Drawing.Size(529, 23);
this.lblVersion.TabIndex = 280;
this.lblVersion.Text = "版本号:1.1.0000.0000";
this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblVersion1.Location = new System.Drawing.Point(11, 50);
this.lblVersion1.Name = "lblVersion1";
this.lblVersion1.Size = new System.Drawing.Size(529, 23);
this.lblVersion1.TabIndex = 280;
this.lblVersion1.Text = "版本号:1.1.0000.0000";
this.lblVersion1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// FrmAbout
//
......@@ -97,9 +97,9 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(564, 250);
this.Controls.Add(this.btnCopy);
this.Controls.Add(this.lblCodeName);
this.Controls.Add(this.lblTime);
this.Controls.Add(this.lblVersion);
this.Controls.Add(this.lblCodeName1);
this.Controls.Add(this.lblTime1);
this.Controls.Add(this.lblVersion1);
this.Controls.Add(this.btnNext);
this.MaximizeBox = false;
this.MinimizeBox = false;
......@@ -113,8 +113,8 @@
#endregion
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.Button btnCopy;
private System.Windows.Forms.Label lblCodeName;
private System.Windows.Forms.Label lblTime;
private System.Windows.Forms.Label lblVersion;
private System.Windows.Forms.Label lblCodeName1;
private System.Windows.Forms.Label lblTime1;
private System.Windows.Forms.Label lblVersion1;
}
}
\ No newline at end of file
......@@ -22,9 +22,9 @@ namespace OnlineStore.ACSingleStore
private void FrmPwd_Load(object sender, EventArgs e)
{
this.DialogResult = DialogResult.None;
lblTime.Text = "更新时间:" + GetVersion();
lblVersion.Text = "版本号:"+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
lblCodeName.Text ="软件编号:"+ GetCodeNum();
lblTime1.Text = "" + GetVersion();
lblVersion1.Text = ""+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
lblCodeName1.Text =""+ GetCodeNum();
}
private void btnNext_Click(object sender, EventArgs e)
......
......@@ -13,7 +13,7 @@ namespace OnlineStore.ACSingleStore
{
public partial class FrmBase : Form
{
internal static string GetVersion(bool isShow = false)
internal static string GetVersion(bool IsShow = false)
{
string str = "";
string version = "";
......@@ -38,7 +38,7 @@ namespace OnlineStore.ACSingleStore
str = version;
LogUtil.error("解析版本号【" + str + "】出错:" + ex.ToString());
}
if (isShow)
if (IsShow)
{
LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]");
}
......
......@@ -162,8 +162,7 @@
this.轴卡点动ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.扫码测试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.学习二维码ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.配置信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.轴运动配置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
......@@ -1866,8 +1865,8 @@
this.轴卡点动ToolStripMenuItem,
this.toolStripSeparator9,
this.扫码测试ToolStripMenuItem,
this.toolStripSeparator10,
this.学习二维码ToolStripMenuItem});
this.toolStripSeparator10
});
this.设备调试ToolStripMenuItem.Name = "设备调试ToolStripMenuItem";
this.设备调试ToolStripMenuItem.Size = new System.Drawing.Size(100, 29);
this.设备调试ToolStripMenuItem.Text = "设备调试";
......@@ -1895,13 +1894,7 @@
//
this.toolStripSeparator10.Name = "toolStripSeparator10";
this.toolStripSeparator10.Size = new System.Drawing.Size(176, 6);
//
// 学习二维码ToolStripMenuItem
//
this.学习二维码ToolStripMenuItem.Name = "学习二维码ToolStripMenuItem";
this.学习二维码ToolStripMenuItem.Size = new System.Drawing.Size(179, 30);
this.学习二维码ToolStripMenuItem.Text = "学习二维码";
this.学习二维码ToolStripMenuItem.Click += new System.EventHandler(this.学习二维码ToolStripMenuItem_Click);
//
// 配置信息ToolStripMenuItem
//
......@@ -2070,8 +2063,7 @@
private System.Windows.Forms.ToolStripMenuItem 显示ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 学习二维码ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
......
......@@ -15,8 +15,7 @@ using System.Reflection;
using log4net;
using OnlineStore.DeviceLibrary;
using System.IO.Ports;
using OnlineStore.LoadCSVLibrary;
using CodeLibrary;
using OnlineStore.LoadCSVLibrary;
namespace OnlineStore.ACSingleStore
{
......@@ -176,6 +175,7 @@ namespace OnlineStore.ACSingleStore
public static string warn = ResourceCulture.GetString("警告");
private string StartCycle = ResourceCulture.GetString("开始循环出库");
private string StopCycle = ResourceCulture.GetString("停止循环出库");
private string SafetyErrorMsg = ResourceCulture.GetString("光栅被遮挡");
private DateTime preReadModblsTime = DateTime.Now;
private void timer1_Tick(object sender, EventArgs e)
{
......@@ -184,7 +184,7 @@ namespace OnlineStore.ACSingleStore
return;
}
lblTempStr.Text = store.currTempStr;
ShowMsg();
//ReadPosistion();
if (store.storeRunStatus > StoreRunStatus.Wait)
{
......@@ -222,35 +222,7 @@ namespace OnlineStore.ACSingleStore
}
}
}
if (CurrLanguage.Equals(ResourceCulture.China))
{
lblWarnMsg.Text = store.WarnObj.WarnMsg;
}
else
{
lblWarnMsg.Text = store.WarnObj.WarnMsgEn;
}
if (store.Config.IsHasDoorLimit.Equals(1))
{
if (IOManager.IOValue(IO_Type.Door_Limit).Equals(IO_VALUE.LOW))
{
lblWarnMsg.Text = lblWarnMsg.Text + " "+dooropen;
}
else if (store.Config.StoreDIList.ContainsKey(IO_Type.Door_LeftLimit)&& IOManager.IOValue(IO_Type.Door_LeftLimit).Equals(IO_VALUE.LOW))
{
lblWarnMsg.Text = lblWarnMsg.Text + " "+ldooropen;
}
else if (store.Config.StoreDIList.ContainsKey(IO_Type.Door_RightLimit) && IOManager.IOValue(IO_Type.Door_RightLimit).Equals(IO_VALUE.LOW))
{
lblWarnMsg.Text = lblWarnMsg.Text + " "+rdooropen;
}
}
//如果不在出入库中,且叉子上有信号,需要提示检查叉子
if (store.storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
lblWarnMsg.Text = lblWarnMsg.Text + " "+ HasWare;
}
//if (store.TempOrHumidityIsAlarm)
//{
// lblWarnMsg.Text = lblWarnMsg.Text + " 温湿度报警[" + store.TempAlarmTime.ToLongTimeString() + "]";
......@@ -287,11 +259,47 @@ namespace OnlineStore.ACSingleStore
else
{
lblThisSta.Text = WaitStart;
lblWarnMsg.Text = "";
//lblWarnMsg.Text = "";
btnStartAuTo.Text = StartAuto;
}
}
private void ShowMsg()
{
if (CurrLanguage.Equals(ResourceCulture.China))
{
lblWarnMsg.Text = store.WarnObj.WarnMsg;
}
else
{
lblWarnMsg.Text = store.WarnObj.WarnMsgEn;
}
if (store.Config.IsHasDoorLimit.Equals(1))
{
if (IOManager.IOValue(IO_Type.Door_Limit).Equals(IO_VALUE.LOW))
{
lblWarnMsg.Text = lblWarnMsg.Text + " " + dooropen;
}
else if (store.Config.StoreDIList.ContainsKey(IO_Type.Door_LeftLimit) && IOManager.IOValue(IO_Type.Door_LeftLimit).Equals(IO_VALUE.LOW))
{
lblWarnMsg.Text = lblWarnMsg.Text + " " + ldooropen;
}
else if (store.Config.StoreDIList.ContainsKey(IO_Type.Door_RightLimit) && IOManager.IOValue(IO_Type.Door_RightLimit).Equals(IO_VALUE.LOW))
{
lblWarnMsg.Text = lblWarnMsg.Text + " " + rdooropen;
}
}
//如果不在出入库中,且叉子上有信号,需要提示检查叉子
if (store.storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
lblWarnMsg.Text = lblWarnMsg.Text + " " + HasWare;
}
if (IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW))
{
lblWarnMsg.Text = lblWarnMsg.Text + " " + SafetyErrorMsg;
}
}
private void FrmTest_FormClosing(object sender, FormClosingEventArgs e)
{
......@@ -966,12 +974,12 @@ namespace OnlineStore.ACSingleStore
private void 学习二维码ToolStripMenuItem_Click(object sender, EventArgs e)
{
// if (CodeManager.DeCodeType.Equals(0))
{
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
CodeLibrary.FrmCodeDecode frm = new FrmCodeDecode();
frm.ShowDialog();
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
}
//{
// IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
// CodeLibrary.FrmCodeDecode frm = new FrmCodeDecode();
// frm.ShowDialog();
// IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
//}
}
private void btnTempInit_Click(object sender, EventArgs e)
......@@ -1140,6 +1148,7 @@ namespace OnlineStore.ACSingleStore
StopCycle = ResourceCulture.GetString("停止循环出库");
ldooropen = ResourceCulture.GetString("左侧门未关");
rdooropen = ResourceCulture.GetString("右侧门未关");
SafetyErrorMsg = ResourceCulture.GetString("光栅被遮挡");
显示ToolStripMenuItem.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, 显示ToolStripMenuItem.Name), 显示ToolStripMenuItem.Text);
toolStripMenuItem1.Text = ResourceCulture.GetString(ResourceCulture.GetTextIdStr(className, toolStripMenuItem1.Name), toolStripMenuItem1.Text);
......
......@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
......@@ -51,7 +51,7 @@ namespace OnlineStore
ResourceControl.GetStringEvent += GetString;
CSVResourceControl.GetStrEvent += GetString;
CSVResourceControl.GetStringEvent += GetString;
CodeLibrary.CodeResourceControl.GetLanguageEvent += CodeResourceControl_GetLanguageEvent;
// CodeLibrary.CodeResourceControl.GetLanguageEvent += CodeResourceControl_GetLanguageEvent;
//string englishPath = Application.StartupPath + @"\resource\en-US.resource";
//string chinaPath = Application.StartupPath + @"\resource\zh-CN.resource";
//Dictionary<string, string> ChinaMap = LoadDataMap(chinaPath);
......
......@@ -298,4 +298,5 @@ trayHeight,料盘高度,Reel height,
出库{0}叉子从库位退出后,未检测到料盘有料,出库{0}叉子从库位退出后,未检测到料盘有料,Outgoing {0} after the fork exits from the storage,no material on the tray is detected
左侧门未关,左侧门未关,Left door open
右侧门未关,右侧门未关,Right door open
FrmStoreBox_chbIsDebug_Text,调试状态,debug mode
\ No newline at end of file
FrmStoreBox_chbIsDebug_Text,调试状态,debug mode
光栅被遮挡,光栅被遮挡,Grating blocked
\ No newline at end of file
......@@ -129,3 +129,5 @@ DeCodeType=解码类型,0=halcon,1=zxing解码 西安料仓解析方式。2=
入库失败时蜂鸣器响
20200306
门未关闭且遮挡光栅时不继续出入库
......@@ -439,6 +439,15 @@ namespace OnlineStore.DeviceLibrary
}
}
private bool DoorIsClose()
{
if (IOManager.IOValue(IO_Type.Door_Down).Equals(IO_VALUE.HIGH) &&
IOManager.IOValue(IO_Type.Door_Up).Equals(IO_VALUE.LOW))
{
return true;
}
return false;
}
private void OpenDoorAndWait()
{
Thread.Sleep(60);
......@@ -924,17 +933,14 @@ namespace OnlineStore.DeviceLibrary
}
//判断急停
else if (storeRunStatus >= StoreRunStatus.HomeMoving)
{
//取新的Io状态
IO_VALUE suddenBtn = IOManager.IOValue(IO_Type.SuddenStop_BTN);
IO_VALUE resetBtn = IOManager.IOValue(IO_Type.Reset_BTN);
{
//急停按钮
if (suddenBtn.Equals(IO_VALUE.LOW))
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
AirCheckProcess();
return;
}
else if (resetBtn.Equals(IO_VALUE.HIGH))
else if (IOManager.IOValue(IO_Type.Reset_BTN).Equals(IO_VALUE.HIGH))
{
//收到复位信号,若报警直接复位,若不报警且无操作,回到待机点
if (alarmType.Equals(StoreAlarmType.None) && isInSuddenDown.Equals(false) && isNoAirCheck.Equals(false))
......@@ -967,6 +973,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
AirCheckProcess();
}
//ShowTimeLog("复位和启动按钮");
......@@ -1055,7 +1062,7 @@ namespace OnlineStore.DeviceLibrary
//判断料门口是否有料
if ((checkIO.Equals(IO_VALUE.HIGH)) && height > 0 )
{
if (!CanStartCode() || IsDebug || IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
if (!CanStartCode() || IsDebug || InStoreFail || IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
return;
}
......@@ -1063,7 +1070,7 @@ namespace OnlineStore.DeviceLibrary
if (isWaitScan)
{
TimeSpan span = DateTime.Now - StartWaitScanTime;
if (span.TotalSeconds > 1)
if (span.TotalSeconds > 1 && CanStartCode())
{
isWaitScan = false;
IsScanCode = true;
......
......@@ -300,6 +300,10 @@ namespace OnlineStore.DeviceLibrary
}
protected override void InStoreProcess()
{
if (!DoorIsClose() && IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW))
{
return;
}
LineMoveP moveP = StoreMove.MoveParam.MoveP;
if (StoreMove.IsInWait)
{
......@@ -319,7 +323,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_01 定位气缸下降");
StoreMove.NextMoveStep(StoreMoveStep.SI_01_LocationCylinderDown);
LocationDownAndWait();
LocationDownAndWait();
}
}
if (StoreMove.MoveStep == StoreMoveStep.SI_01_LocationCylinderDown)
......@@ -400,7 +404,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("入库:SI_08 检测叉子料盘检测信号 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_08_CheckTray);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
}
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_08_CheckTray)
{
......@@ -472,10 +476,11 @@ namespace OnlineStore.DeviceLibrary
else
{
InStoreLog("入库:SI_14 放料完成,等待TrayCheck_Fixture=LOW");
StoreMove.NextMoveStep(StoreMoveStep.SI_14_CheckTray);
StoreMove.NextMoveStep(StoreMoveStep.SI_14_CheckTray);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
}
}else if(StoreMove.MoveStep == StoreMoveStep.SI_14_CheckTray)
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_14_CheckTray)
{
InStoreLog("入库:SI_15 返回待机点,轴2/轴1/轴4动作至P1(待机点)),检测门关闭");
StoreMove.NextMoveStep(StoreMoveStep.SI_15_GoBack);
......@@ -556,6 +561,10 @@ namespace OnlineStore.DeviceLibrary
}
protected override void OutStoreProcess()
{
if (!DoorIsClose() && IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW))
{
return;
}
LineMoveP moveP = StoreMove.MoveParam.MoveP;
if (StoreMove.IsInWait)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!