Commit f90ee823 张东亮

急停后复位rfid被关闭

1 个父辈 3142a26b
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
<?xml version="1.0"?>
<doc>
<assembly>
<name>Asa.RFID.ReadAll</name>
</assembly>
<members>
<member name="T:Asa.RFID.ReadAll">
<summary>
读取所有RFID
</summary>
</member>
<member name="M:Asa.RFID.ReadAll.#ctor(System.String)">
<summary>
读取所有RFID
</summary>
<param name="logName">日志名称</param>
</member>
<member name="P:Asa.RFID.ReadAll.Type">
<summary>
设备类型
</summary>
</member>
<member name="M:Asa.RFID.ReadAll.Start(System.Int32)">
<summary>
开始
</summary>
<param name="port">端口号</param>
</member>
<member name="M:Asa.RFID.ReadAll.Stop">
<summary>
停止
</summary>
</member>
<member name="M:Asa.RFID.ReadAll.Read(System.String,System.String)">
<summary>
读取
</summary>
<param name="ip">IP地址</param>
<param name="defaultID">没有找到时返回</param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReadAll.Read(System.String)">
<summary>
读取所有
</summary>
<param name="defaultID">没有数据时返回</param>
</member>
<member name="M:Asa.RFID.ReadAll.Clear(System.String,System.String)">
<summary>
清除缓存
</summary>
<param name="ip">IP地址</param>
<param name="defaultID">设置初始ID</param>
</member>
<member name="M:Asa.RFID.ReadAll.Clear(System.String)">
<summary>
清除所有缓存
</summary>
<param name="defaultID">设置初始ID</param>
</member>
<member name="T:Asa.RFID.DeviceType">
<summary>
RFID读卡器类型
</summary>
</member>
<member name="F:Asa.RFID.DeviceType.PuYue">
<summary>
普阅(新)
</summary>
</member>
<member name="F:Asa.RFID.DeviceType.HaoBin">
<summary>
浩斌(旧)
</summary>
</member>
</members>
</doc>
此文件类型无法预览
此文件类型无法预览
<?xml version="1.0"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
...@@ -78,4 +78,12 @@ ...@@ -78,4 +78,12 @@
</providers> </providers>
</roleManager> </roleManager>
</system.web> </system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>
\ No newline at end of file \ No newline at end of file
...@@ -53,17 +53,18 @@ ...@@ -53,17 +53,18 @@
<ApplicationIcon>DfIcon.ico</ApplicationIcon> <ApplicationIcon>DfIcon.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Client, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Agv">
<SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\SO775-DUOStore\dll\Agv.dll</HintPath>
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\dll\log4net.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
...@@ -106,6 +107,7 @@ ...@@ -106,6 +107,7 @@
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net472" />
</packages>
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace> <RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>Common</AssemblyName> <AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
...@@ -33,9 +33,8 @@ ...@@ -33,9 +33,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\..\packages\log4net.2.0.12\lib\net40\log4net.dll</HintPath>
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath>
...@@ -44,6 +43,7 @@ ...@@ -44,6 +43,7 @@
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
...@@ -66,6 +66,9 @@ ...@@ -66,6 +66,9 @@
<ItemGroup> <ItemGroup>
<WCFMetadata Include="Service References\" /> <WCFMetadata Include="Service References\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net40" requireReinstallation="true" />
</packages>
\ No newline at end of file \ No newline at end of file
...@@ -45,21 +45,18 @@ ...@@ -45,21 +45,18 @@
<Reference Include="Asa.IOModule.AIOBOX"> <Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath> <HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference> </Reference>
<Reference Include="Asa.RFID.HiStation"> <Reference Include="Asa.RFID.ReadAll">
<HintPath>..\..\dll\Asa.RFID.HiStation.dll</HintPath> <HintPath>..\..\dll\Asa.RFID.ReadAll.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID.IReadAll">
<HintPath>..\..\dll\Asa.RFID.IReadAll.dll</HintPath>
</Reference> </Reference>
<Reference Include="HFReader9CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64"> <Reference Include="HFReader9CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\RFID\HFReader9CSharp.dll</HintPath> <HintPath>..\..\dll\RFID\HFReader9CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
...@@ -98,9 +95,11 @@ ...@@ -98,9 +95,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="LineConfig\LineConfig.csv"> <None Include="LineConfig\LineConfig.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
...@@ -26,6 +26,6 @@ PRO,L1线入口节点名称,L1_In_AgvName,A2,,,,,,, ...@@ -26,6 +26,6 @@ PRO,L1线入口节点名称,L1_In_AgvName,A2,,,,,,,
PRO,L1线出口节点名称,L1_Out_AgvName,A1,,,,,,, PRO,L1线出口节点名称,L1_Out_AgvName,A1,,,,,,,
PRO,L2线入口节点名称,L2_In_AgvName,A4,,,,,,, PRO,L2线入口节点名称,L2_In_AgvName,A4,,,,,,,
PRO,L2线出口节点名称,L2_Out_AgvName,A3,,,,,,, PRO,L2线出口节点名称,L2_Out_AgvName,A3,,,,,,,
PRO,L1空料串线出口RFIDIP,L1_Out_RFIDIP,10.21.69.1,,,,,, , PRO,L1空料串线出口RFIDIP,L1_Out_RFIDIP,10.21.69.46,,,,,, ,
PRO,L2上料线出口RFIDIP,L2_Out_RFIDIP,10.21.69.46,,,,,, , PRO,L2上料线出口RFIDIP,L2_Out_RFIDIP,10.21.69.1,,,,,, ,
PRO,休眠秒数(秒),SleepSeconds,40,,,,,,, PRO,休眠秒数(秒),SleepSeconds,40,,,,,,,
...@@ -11,9 +11,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -11,9 +11,9 @@ namespace OnlineStore.DeviceLibrary
{ {
public class RFIDManager public class RFIDManager
{ {
private static Asa.RFID.ReadAll readAll =new Asa.RFID.ReadAll ("TheRFID"); private static Asa.RFID.ReadAll readAll = new Asa.RFID.ReadAll("TheRFID");
private static bool IsOpen = false; private static bool IsOpen = false;
// private static ConcurrentDictionary<string, string> LastRfidMap = new ConcurrentDictionary<string, string>(); // private static ConcurrentDictionary<string, string> LastRfidMap = new ConcurrentDictionary<string, string>();
public static void Open() public static void Open()
{ {
if (IsOpen) if (IsOpen)
...@@ -27,9 +27,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -27,9 +27,10 @@ namespace OnlineStore.DeviceLibrary
{ {
port = 13001; port = 13001;
} }
//readAll.Received += ReadAll_Received; //readAll.Received += ReadAll_Received;
// readAll.Log += ReadAll_Log; // readAll.Log += ReadAll_Log;
LogUtil.info("RFID Server Open,port=" + port); LogUtil.info("RFID Server Open,port=" + port);
readAll.Type = Asa.RFID.DeviceType.PuYue;
readAll.Start(port); readAll.Start(port);
IsOpen = true; IsOpen = true;
} }
...@@ -39,7 +40,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -39,7 +40,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private static string lastStr = ""; private static string lastStr = "";
private static void ReadAll_Log(string ip, string log) private static void ReadAll_Log(string ip, string log)
{ {
string str = "RFID : [" + ip + "] " + log; string str = "RFID : [" + ip + "] " + log;
...@@ -57,13 +58,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -57,13 +58,11 @@ namespace OnlineStore.DeviceLibrary
{ {
if (String.IsNullOrEmpty(ip).Equals(false)) if (String.IsNullOrEmpty(ip).Equals(false))
{ {
string outValue = readAll.Read(ip); string outValue = readAll.Read(ip, "000");
if (isClear) if (isClear)
{ {
readAll.Clear(ip); readAll.Clear(ip, "000");
} }
RFIDData data = new RFIDData(outValue); RFIDData data = new RFIDData(outValue);
return data; return data;
} }
...@@ -74,13 +73,28 @@ namespace OnlineStore.DeviceLibrary ...@@ -74,13 +73,28 @@ namespace OnlineStore.DeviceLibrary
} }
return new RFIDData(); return new RFIDData();
} }
public static void ClearRFID(string ip)
{
try
{
if (String.IsNullOrEmpty(ip).Equals(false))
{
readAll.Clear(ip, "000");
}
}
catch (Exception ex)
{
LogUtil.error("ClearRFID[" + ip + "] 出错:" + ex.ToString());
}
}
public static void Close() public static void Close()
{ {
try try
{ {
readAll.Stop(); readAll.Stop();
IsOpen = false;
LogUtil.error("关闭RFID");
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using Agv; using Agv;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
...@@ -11,14 +11,14 @@ using System.Threading; ...@@ -11,14 +11,14 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
public partial class LineBean public partial class LineBean
{ {
public LineConfig Config; public LineConfig Config;
public bool IsDebug = false; public bool IsDebug = false;
public string Name = ""; public string Name = "";
public bool isInSuddenDown = false; public bool isInSuddenDown = false;
public LineMoveInfo MoveInfo = null; public LineMoveInfo MoveInfo = null;
public AlarmType alarmType = AlarmType.None; public AlarmType alarmType = AlarmType.None;
public RunStatus runStatus = RunStatus.Wait; public RunStatus runStatus = RunStatus.Wait;
...@@ -36,13 +36,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -36,13 +36,13 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Interval = 300; mainTimer.Interval = 300;
mainTimer.AutoReset = true; mainTimer.AutoReset = true;
mainTimer.Enabled = false; mainTimer.Enabled = false;
mainTimer.Elapsed +=timersTimer_Elapsed; mainTimer.Elapsed += timersTimer_Elapsed;
//添加调试 //添加调试
IsDebug = ConfigAppSettings.GetIntValue(Setting_Init.IsInDebug).Equals(1); IsDebug = ConfigAppSettings.GetIntValue(Setting_Init.IsInDebug).Equals(1);
MoveInfo = new LineMoveInfo(); MoveInfo = new LineMoveInfo();
Name = ConfigAppSettings.GetValue(Setting_Init.App_Title).ToUpper(); Name = ConfigAppSettings.GetValue(Setting_Init.App_Title).ToUpper();
this.Config = config; this.Config = config;
IOManager.Init(); IOManager.Init();
IOManager.instance.ConnectionIOList(Config.DIODeviceNameList); IOManager.instance.ConnectionIOList(Config.DIODeviceNameList);
...@@ -58,7 +58,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -58,7 +58,7 @@ namespace OnlineStore.DeviceLibrary
} }
AgvClient.Init(); AgvClient.Init();
Thread.Sleep(300); Thread.Sleep(300);
//IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
} }
...@@ -97,13 +97,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -97,13 +97,13 @@ namespace OnlineStore.DeviceLibrary
{ {
isInSuddenDown = false; isInSuddenDown = false;
alarmType = AlarmType.None; alarmType = AlarmType.None;
SetWarnMsg(""); SetWarnMsg("");
//IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
MoveInfo.NextMoveStep(MoveStep.VMI_H_StopUp); MoveInfo.NextMoveStep(MoveStep.VMI_H_StopUp);
LogUtil.info(Name + " 开始复位:所有阻挡上升,设置状态为None"); LogUtil.info(Name + " 开始复位:所有阻挡上升,设置状态为None");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
IOManager.IOMove(IO_Type.L1_OutStopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.L1_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_OutStopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.L2_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_StopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.L1_StopDown, IO_VALUE.LOW);
...@@ -123,14 +123,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -123,14 +123,14 @@ namespace OnlineStore.DeviceLibrary
{ {
mainTimer.Enabled = false; mainTimer.Enabled = false;
serverConnectTimer.Enabled = false; serverConnectTimer.Enabled = false;
runStatus = RunStatus.Reset; runStatus = RunStatus.Reset;
MoveInfo.NewMove(LineMoveType.StoreReset); MoveInfo.NewMove(LineMoveType.StoreReset);
ReturnHome(); ReturnHome();
} }
else else
{ {
SetWarnMsg("复位失败:急停未开"); SetWarnMsg("复位失败:急停未开");
} }
} }
/// <summary> /// <summary>
/// 复位处理 /// 复位处理
...@@ -162,7 +162,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -162,7 +162,7 @@ namespace OnlineStore.DeviceLibrary
break; break;
default: break; default: break;
} }
} }
#endregion #endregion
...@@ -173,19 +173,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -173,19 +173,19 @@ namespace OnlineStore.DeviceLibrary
public void StopRun() public void StopRun()
{ {
WarnMsg = ""; WarnMsg = "";
RFIDManager.Close(); RFIDManager.Close();
mainTimer.Enabled = false; mainTimer.Enabled = false;
serverConnectTimer.Enabled = false; serverConnectTimer.Enabled = false;
StopMove(); StopMove();
runStatus = RunStatus.Wait; runStatus = RunStatus.Wait;
IOManager.instance.CloseAllDO(); IOManager.instance.CloseAllDO();
LogUtil.info(Name + ",停止运行"); LogUtil.info(Name + ",停止运行");
} }
public void Alarm(AlarmType alarmType) public void Alarm(AlarmType alarmType)
{ {
if (this.alarmType.Equals(alarmType) && alarmType != AlarmType.SuddenStop ) if (this.alarmType.Equals(alarmType) && alarmType != AlarmType.SuddenStop)
{ {
return; return;
} }
...@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + "收到急停信号,停止运行 "); LogUtil.error(Name + "收到急停信号,停止运行 ");
MoveInfo.EndMove(); MoveInfo.EndMove();
StopMove(); StopMove();
} }
} }
public void StopMove() public void StopMove()
...@@ -208,10 +208,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -208,10 +208,10 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.L1_StopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.L1_StopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L1_OutStopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.L1_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_StopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.L2_StopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.L2_OutStopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.L2_OutStopDown, IO_VALUE.LOW);
} }
private bool InProcess = false; private bool InProcess = false;
private Stopwatch stopwatch = new Stopwatch(); private Stopwatch stopwatch = new Stopwatch();
public bool MoveStop = false; public bool MoveStop = false;
protected void timersTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) protected void timersTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
...@@ -226,8 +226,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -226,8 +226,8 @@ namespace OnlineStore.DeviceLibrary
} }
try try
{ {
InProcess = true; InProcess = true;
stopwatch.Restart(); stopwatch.Restart();
IoCheckProcess(); IoCheckProcess();
if (runStatus >= RunStatus.HomeMoving) if (runStatus >= RunStatus.HomeMoving)
...@@ -242,9 +242,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -242,9 +242,9 @@ namespace OnlineStore.DeviceLibrary
ResetProcess(); ResetProcess();
} }
} }
else if (runStatus.Equals(RunStatus.Runing)) else if (runStatus.Equals(RunStatus.Runing) && !alarmType.Equals(AlarmType.SuddenStop))
{ {
if(IsDebug) if (IsDebug)
{ {
AgvClient.SetCancelState(true); AgvClient.SetCancelState(true);
} }
...@@ -281,7 +281,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -281,7 +281,7 @@ namespace OnlineStore.DeviceLibrary
private DateTime ol1_lastSendShelfTime = DateTime.Now; private DateTime ol1_lastSendShelfTime = DateTime.Now;
private DateTime ol2_lastSendShelfTime = DateTime.Now; private DateTime ol2_lastSendShelfTime = DateTime.Now;
private int StopDownMS = 1500; private int StopDownMS = 1000;
private DateTime il1_lastCallAgvTime = DateTime.Now.AddMinutes(-5); private DateTime il1_lastCallAgvTime = DateTime.Now.AddMinutes(-5);
private Stopwatch il1_outstopCheckWarch = new Stopwatch(); private Stopwatch il1_outstopCheckWarch = new Stopwatch();
/// <summary> /// <summary>
...@@ -289,11 +289,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -289,11 +289,11 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
private void EmptyLineTimerProcess() private void EmptyLineTimerProcess()
{ {
TimeSpan span = DateTime.Now - ol1_lastSendShelfTime; TimeSpan span = DateTime.Now - ol1_lastSendShelfTime;
//如果出口无料架,持续1000以上,放开阻挡放出一个料架 //如果出口无料架,持续1000以上,放开阻挡放出一个料架
//每次放料架时间间隔3秒 //每次放料架时间间隔3秒
if (IOManager.IOValue(IO_Type.L1_StopCheck).Equals(IO_VALUE.HIGH)&&IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.LOW) && span.TotalSeconds > 3) if (IOManager.IOValue(IO_Type.L1_StopCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.LOW) && span.TotalSeconds > 3)
{ {
//如果空料串线体出口无料架,放一个料架到出口 //如果空料串线体出口无料架,放一个料架到出口
if (LineManager.checkWatch(ol1_noshelfWatch, 1000)) if (LineManager.checkWatch(ol1_noshelfWatch, 1000))
...@@ -306,8 +306,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -306,8 +306,8 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalMilliseconds > StopDownMS) else if (span.TotalMilliseconds > StopDownMS)
{ {
ol1_noshelfWatch.Stop(); ol1_noshelfWatch.Stop();
IOManager.CIOMove(IO_Type.L1_StopDown, IO_VALUE.LOW); IOManager.CIOMove(IO_Type.L1_StopDown, IO_VALUE.LOW);
} }
TimeSpan span1 = DateTime.Now - il1_lastCallAgvTime; TimeSpan span1 = DateTime.Now - il1_lastCallAgvTime;
...@@ -316,14 +316,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -316,14 +316,14 @@ namespace OnlineStore.DeviceLibrary
//出口信号需要持续1秒钟 //出口信号需要持续1秒钟
if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && span1.TotalSeconds > 60) if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && span1.TotalSeconds > 60)
{ {
if (LastL1OutShelfId.Equals("000").Equals(false)) if (LastL1OutShelfId.StartsWith("0").Equals(false))
{ {
if (LineManager.checkWatch(il1_outstopCheckWarch, 1000)) if (LineManager.checkWatch(il1_outstopCheckWarch, 1000))
{ {
il1_lastCallAgvTime = DateTime.Now; il1_lastCallAgvTime = DateTime.Now;
LogUtil.info(" 空料串线体出口有料架" + LastL1OutShelfId + ",呼叫agv小车[" + Config.L1_Out_AgvName + "] [NeedLeave] "); LogUtil.info(" 空料串线体出口有料架" + LastL1OutShelfId + ",呼叫agv小车[" + Config.L1_Out_AgvName + "] [NeedLeave] ");
AgvClient.NeedLeave(Config.L1_Out_AgvName, LastL1OutShelfId); AgvClient.NeedLeave(Config.L1_Out_AgvName, LastL1OutShelfId,Agv.ClientShelf.Empty);
} }
} }
} }
...@@ -344,12 +344,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -344,12 +344,13 @@ namespace OnlineStore.DeviceLibrary
if (IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.L1_In_AgvName).Equals(ClientAction.None)) if (IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.L1_In_AgvName).Equals(ClientAction.None))
{ {
AgvClient.NeedEnter(Config.L1_In_AgvName, ""); AgvClient.NeedEnter(Config.L1_In_AgvName, "");
}else if(IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.HIGH) && AgvClient.GetAction(Config.L1_In_AgvName).Equals(ClientAction.NeedEnter)) }
else if (IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.HIGH) && AgvClient.GetAction(Config.L1_In_AgvName).Equals(ClientAction.NeedEnter))
{ {
AgvClient.SetToNone(Config.L1_In_AgvName, ""); AgvClient.SetToNone(Config.L1_In_AgvName, "");
} }
//如果是出口无料架,NeedLeave状态,改为None //如果是出口无料架,NeedLeave状态,改为None
if ((IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.LOW) || LastL1OutShelfId.Equals("000")) && if ((IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.LOW) || LastL1OutShelfId.StartsWith("0")) &&
AgvClient.GetAction(Config.L1_Out_AgvName).Equals(ClientAction.NeedLeave)) AgvClient.GetAction(Config.L1_Out_AgvName).Equals(ClientAction.NeedLeave))
{ {
il1_outstopCheckWarch.Stop(); il1_outstopCheckWarch.Stop();
...@@ -389,14 +390,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -389,14 +390,14 @@ namespace OnlineStore.DeviceLibrary
//出口信号需要持续1秒钟 //出口信号需要持续1秒钟
if (IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.HIGH) && span1.TotalSeconds > 60) if (IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.HIGH) && span1.TotalSeconds > 60)
{ {
if (LastL2OutShelfId.Equals("000").Equals(false)) if (LastL2OutShelfId.StartsWith("0").Equals(false))
{ {
if (LineManager.checkWatch(il2_outstopCheckWarch, 1000)) if (LineManager.checkWatch(il2_outstopCheckWarch, 1000))
{ {
il2_lastCallAgvTime = DateTime.Now; il2_lastCallAgvTime = DateTime.Now;
LogUtil.info(" 上料线体出口有料架" + LastL2OutShelfId + ",呼叫agv小车[" + Config.L2_Out_AgvName + "] [NeedLeave] "); LogUtil.info(" 上料线体出口有料架" + LastL2OutShelfId + ",呼叫agv小车[" + Config.L2_Out_AgvName + "] [NeedLeave] ");
AgvClient.NeedLeave(Config.L2_Out_AgvName, LastL2OutShelfId); AgvClient.NeedLeave(Config.L2_Out_AgvName, LastL2OutShelfId,ClientShelf.Full);
} }
} }
} }
...@@ -417,17 +418,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -417,17 +418,17 @@ namespace OnlineStore.DeviceLibrary
{ {
AgvClient.NeedEnter(Config.L2_In_AgvName, ""); AgvClient.NeedEnter(Config.L2_In_AgvName, "");
} }
else if(IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.HIGH) && AgvClient.GetAction(Config.L2_In_AgvName).Equals(ClientAction.NeedEnter)) else if (IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.HIGH) && AgvClient.GetAction(Config.L2_In_AgvName).Equals(ClientAction.NeedEnter))
{ {
AgvClient.SetToNone(Config.L2_In_AgvName, ""); AgvClient.SetToNone(Config.L2_In_AgvName, "");
} }
//如果是出口无料架,NeedLeave状态,改为None //如果是出口无料架,NeedLeave状态,改为None
if ((IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.LOW) || LastL2OutShelfId.Equals("000")) && if ((IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.LOW) || LastL2OutShelfId.StartsWith("0")) &&
AgvClient.GetAction(Config.L2_Out_AgvName).Equals(ClientAction.NeedLeave)) AgvClient.GetAction(Config.L2_Out_AgvName).Equals(ClientAction.NeedLeave))
{ {
il2_outstopCheckWarch.Stop(); il2_outstopCheckWarch.Stop();
LogUtil.info(" 上料线体出口无料架/rfid未读到,更改[" + Config.L2_Out_AgvName + "] 状态[None] "); LogUtil.info(" 上料线体出口无料架/rfid未读到,更改[" + Config.L2_Out_AgvName + "] 状态[None] ");
AgvClient.SetToNone(Config.L2_Out_AgvName, "" ); AgvClient.SetToNone(Config.L2_Out_AgvName, "");
} }
} }
...@@ -623,7 +624,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -623,7 +624,7 @@ namespace OnlineStore.DeviceLibrary
//} //}
} }
} }
private DateTime preIoTimerOutTime = DateTime.Now; private DateTime preIoTimerOutTime = DateTime.Now;
/// <summary> /// <summary>
/// io检测异常 /// io检测异常
...@@ -639,7 +640,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -639,7 +640,7 @@ namespace OnlineStore.DeviceLibrary
if (runStatus < RunStatus.Runing || isInSuddenDown) if (runStatus < RunStatus.Runing || isInSuddenDown)
{ {
return; return;
} }
if (alarmType.Equals(AlarmType.IoSingleTimeOut) && MoveInfo.IsInWait == false) if (alarmType.Equals(AlarmType.IoSingleTimeOut) && MoveInfo.IsInWait == false)
{ {
LogUtil.info(Name + "之前有IO超时报警,清理报警:" + WarnMsg); LogUtil.info(Name + "之前有IO超时报警,清理报警:" + WarnMsg);
...@@ -667,11 +668,28 @@ namespace OnlineStore.DeviceLibrary ...@@ -667,11 +668,28 @@ namespace OnlineStore.DeviceLibrary
isInProcess = true; isInProcess = true;
try try
{ {
//LastL1OutShelfId = RFIDManager.ReadRFID(Config.L1_Out_RFIDIP, true).NumStr();
//LastL2OutShelfId = RFIDManager.ReadRFID(Config.L2_Out_RFIDIP, true).NumStr();
//LedProcess(); //LedProcess();
// if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH))
LastL2OutShelfId = RFIDManager.ReadRFID(Config.L1_Out_RFIDIP,true).NumStr(); {
LastL1OutShelfId = RFIDManager.ReadRFID(Config.L2_Out_RFIDIP,true).NumStr(); LastL1OutShelfId = RFIDManager.ReadRFID(Config.L1_Out_RFIDIP, true).NumStr();
}
//else
//{
// //RFIDManager.ClearRFID(Config.L1_Out_RFIDIP);
//}
// if (IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.HIGH))
{
LastL2OutShelfId = RFIDManager.ReadRFID(Config.L2_Out_RFIDIP, true).NumStr();
}
//else
//{
// //RFIDManager.ClearRFID(Config.L2_Out_RFIDIP);
//}
//bool result = SendVmiRfid(LastL2OutShelfId); //bool result = SendVmiRfid(LastL2OutShelfId);
//if (result) //if (result)
//{ //{
...@@ -705,7 +723,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -705,7 +723,7 @@ namespace OnlineStore.DeviceLibrary
return path; return path;
} }
private string http_server = ConfigAppSettings.GetValue(Setting_Init.http_server); private string http_server = ConfigAppSettings.GetValue(Setting_Init.http_server);
private string api_communication = "/service/store/qisda/vmiRfid"; //流水线状态通信接口 private string api_communication = "/service/store/qisda/vmiRfid"; //流水线状态通信接口
private string lastLog = ""; private string lastLog = "";
public bool SendVmiRfid(string rfid) public bool SendVmiRfid(string rfid)
...@@ -714,13 +732,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -714,13 +732,13 @@ namespace OnlineStore.DeviceLibrary
{ {
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("rfid", rfid); paramMap.Add("rfid", rfid);
string addr = GetAddr(api_communication, paramMap ) ; string addr = GetAddr(api_communication, paramMap);
string resultStr = HttpHelper.Post(addr, ""); string resultStr = HttpHelper.Post(addr, "");
string log = "vmiRfid 【" + addr + "】【" + resultStr + "】"; string log = "vmiRfid 【" + addr + "】【" + resultStr + "】";
if (lastLog.Equals(log).Equals(false)) if (lastLog.Equals(log).Equals(false))
{ {
lastLog = log; lastLog = log;
LogUtil.info(log); LogUtil.info(log);
} }
if (resultStr.Equals("move")) if (resultStr.Equals("move"))
{ {
......
...@@ -151,7 +151,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -151,7 +151,10 @@ namespace OnlineStore.DeviceLibrary
} }
private void SleepTimerProcess() private void SleepTimerProcess()
{ {
if (alarmType.Equals(AlarmType.SuddenStop))
{
return;
}
if (needCheckList.Count <= 0) if (needCheckList.Count <= 0)
{ {
needCheckList.Add(IO_Type.L1_InCheck); needCheckList.Add(IO_Type.L1_InCheck);
...@@ -163,6 +166,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -163,6 +166,7 @@ namespace OnlineStore.DeviceLibrary
needCheckList.Add(IO_Type.L2_StopCheck); needCheckList.Add(IO_Type.L2_StopCheck);
needCheckList.Add(IO_Type.L2_OutCheck); needCheckList.Add(IO_Type.L2_OutCheck);
needCheckList.Add(IO_Type.L2_LoadSig); needCheckList.Add(IO_Type.L2_LoadSig);
needCheckList.Add(IO_Type.Pass_BTN);
needCheckList.Add(IO_Type.L2_StopDown); needCheckList.Add(IO_Type.L2_StopDown);
} }
bool agvBusy = false; bool agvBusy = false;
......
...@@ -60,14 +60,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -60,14 +60,14 @@ namespace OnlineStore.DeviceLibrary
string appPath = Application.StartupPath; string appPath = Application.StartupPath;
string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Line_Config); string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Line_Config);
LogUtil.info(LOGGER, " 开始加载VMI流水线配置:" + linefilePath); LogUtil.info(LOGGER, " 开始加载流水线配置:" + linefilePath);
RobotConfig storeConfig = CSVConfigReader.LoadConfig(linefilePath); RobotConfig storeConfig = CSVConfigReader.LoadConfig(linefilePath);
Config = (LineConfig)storeConfig; Config = (LineConfig)storeConfig;
Line = new LineBean(Config); Line = new LineBean(Config);
LogUtil.info(LOGGER, "加载VMI流水线完成!"); LogUtil.info(LOGGER, "加载流水线完成!");
return Line; return Line;
} }
......
...@@ -51,7 +51,28 @@ namespace OnlineStore.DeviceLibrary ...@@ -51,7 +51,28 @@ namespace OnlineStore.DeviceLibrary
private static void AgvClient_Received(Agv.Node node) private static void AgvClient_Received(Agv.Node node)
{ {
AgvClient_Ready(node.Name,node.RFID); switch(node.Action)
{
//case ClientAction.ReadyLeave:
// AgvClient_ReadyLeave(node.Name,node.RFID);
// break;
//case ClientAction.ReadyEnter:
// AgvClient_ReadyEnter(node.Name,node.RFID);
// break;
//default:
// log.info(node.ToText());
// break;
case ClientAction.Ready:
AgvClient_Ready(node.Name, node.RFID);
break;
case ClientAction.None:
log.debug("收到心跳包");
break;
default:
log.info(node.ToText());
break;
}
log.debug(node.ToText());
} }
/// <summary> /// <summary>
...@@ -63,7 +84,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,7 +84,7 @@ namespace OnlineStore.DeviceLibrary
agvClient.CancelState = cancel; agvClient.CancelState = cancel;
} }
public static void SetStatus(string id, string shelfId = "", Agv.ClientAction action = Agv.ClientAction.None, Agv.ClientLevel level = Agv.ClientLevel.Low) public static void SetStatus(string id, string shelfId = "", Agv.ClientAction action = Agv.ClientAction.None, Agv.ClientLevel level = Agv.ClientLevel.Low, Agv.ClientShelf shelf = ClientShelf.None)
{ {
// ClientAction currA = GetAction(id); // ClientAction currA = GetAction(id);
if (actionMap.ContainsKey(id)) if (actionMap.ContainsKey(id))
...@@ -75,7 +96,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -75,7 +96,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
agvClient.SetStatus(id, "",shelfId, action, level); agvClient.SetStatus(id, "",shelfId, action, level,shelf);
UpdateAction(id, action); UpdateAction(id, action);
} }
private static void AgvClient_Ready(string id, string rfid) private static void AgvClient_Ready(string id, string rfid)
...@@ -84,55 +105,48 @@ namespace OnlineStore.DeviceLibrary ...@@ -84,55 +105,48 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(logName); LogUtil.info(logName);
UpdateAction(id, Agv.ClientAction.Ready); UpdateAction(id, Agv.ClientAction.Ready);
if (id.Equals(LineManager.Config.L1_In_AgvName)) if (id.Equals(LineManager.Config.L1_Out_AgvName))
{ {
LineManager.Line.UpdateSleep(false); string shefId = LineManager.Line.LastL1OutShelfId;
if (IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH))
{ {
SetStatus(id, shefId, ClientAction.MayLeave);
LineManager.Line.UpdateSleep(false);
LineManager.Line.StopIOMove(IO_Type.L1_OutStopDown, 2000);
LogUtil.info(logName + "下降 L1_OutStopDown , " + shefId);
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
SetStatus(id, "", ClientAction.MayEnter);
LogUtil.info(logName + " ,等待L1_InCheck");
try
{
WaitUtil.Wait(60000, delegate
{
return IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.HIGH);
}, "等待L1_InCheck=HIGH");
}
catch (Exception ex)
{
LogUtil.error(logName + ":" + ex.ToString());
}
//两秒后改为离开状态 //两秒后改为离开状态
Thread.Sleep(3000); Thread.Sleep(5000);
LogUtil.info(logName + " ,调用 FinishEnter "); LogUtil.info(logName + " ,调用 FinishLeave " + shefId);
SetStatus(id, "", ClientAction.FinishEnter); SetStatus(id, shefId, ClientAction.FinishLeave);
Thread.Sleep(5000); Thread.Sleep(5000);
LogUtil.info(logName + " ,处理结束 更新状态为None "); LogUtil.info(logName + " ,处理结束 更新状态为None ");
SetStatus(id, "", ClientAction.None); SetStatus(id, "", ClientAction.None);
}); });
} }
else else
{ {
LogUtil.error(logName + " L1_InCheck 检测到有料架,AGV的料架无法进入"); LogUtil.error(logName + " L1_OutCheck 未检测到料架,无法将料架进入AGV");
SetStatus(id, "", ClientAction.None, ClientLevel.High); SetStatus(id, "", ClientAction.None, ClientLevel.High);
} }
} }
else if (id.Equals(LineManager.Config.L1_Out_AgvName)) else if (id.Equals(LineManager.Config.L2_Out_AgvName))
{ {
string shefId = LineManager.Line.LastL1OutShelfId; string shefId = LineManager.Line.LastL2OutShelfId;
if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.HIGH))
{ {
SetStatus(id, shefId, ClientAction.MayLeave); SetStatus(id, shefId, ClientAction.MayLeave);
LineManager.Line.UpdateSleep(false); LineManager.Line.UpdateSleep(false);
LineManager.Line.StopIOMove(IO_Type.L1_OutStopDown, 1500); LineManager.Line.StopIOMove(IO_Type.L2_OutStopDown, 2000);
//agvClient.MayLeave(id);
LogUtil.info(logName + "下降 L1_OutStopDown , " + shefId); LogUtil.info(logName + "下降 L2_OutStopDown , " + shefId);
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
...@@ -149,25 +163,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,25 +163,26 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
LogUtil.error(logName + " L1_OutCheck 未检测到料架,无法将料架进入AGV"); LogUtil.error(logName + " L2_OutCheck 未检测到料架,无法将料架进入AGV");
SetStatus(id, "", ClientAction.None, ClientLevel.High); SetStatus(id, "", ClientAction.None, ClientLevel.High);
} }
} }
else if (id.Equals(LineManager.Config.L2_In_AgvName))
if (id.Equals(LineManager.Config.L1_In_AgvName))
{ {
LineManager.Line.UpdateSleep(false); LineManager.Line.UpdateSleep(false);
if (IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.LOW))
{ {
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
SetStatus(id, "", ClientAction.MayEnter); SetStatus(id, "", ClientAction.MayEnter);
LogUtil.info(logName + " ,等待L2_InCheck"); LogUtil.info(logName + " ,等待L1_InCheck");
try try
{ {
WaitUtil.Wait(60000, delegate WaitUtil.Wait(60000, delegate
{ {
return IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.HIGH); return IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.HIGH);
}, "等待L2_InCheck=HIGH"); }, "等待L1_InCheck=HIGH");
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -187,44 +202,50 @@ namespace OnlineStore.DeviceLibrary ...@@ -187,44 +202,50 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
LogUtil.error(logName + " L2_InCheck 检测到有料架,AGV的料架无法进入"); LogUtil.error(logName + " L1_InCheck 检测到有料架,AGV的料架无法进入");
SetStatus(id, "", ClientAction.None, ClientLevel.High); SetStatus(id, "", ClientAction.None, ClientLevel.High);
} }
} }
else if (id.Equals(LineManager.Config.L2_Out_AgvName)) else if (id.Equals(LineManager.Config.L2_In_AgvName))
{ {
string shefId = LineManager.Line.LastL2OutShelfId; LineManager.Line.UpdateSleep(false);
if (IOManager.IOValue(IO_Type.L2_OutCheck).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))
{ {
SetStatus(id, shefId, ClientAction.MayLeave);
LineManager.Line.UpdateSleep(false);
LineManager.Line.StopIOMove(IO_Type.L2_OutStopDown, 1500);
//agvClient.MayLeave(id);
LogUtil.info(logName + "下降 L2_OutStopDown , " + shefId);
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
SetStatus(id, "", ClientAction.MayEnter);
LogUtil.info(logName + " ,等待L2_InCheck");
try
{
WaitUtil.Wait(60000, delegate
{
return IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.HIGH);
}, "等待L2_InCheck=HIGH");
}
catch (Exception ex)
{
LogUtil.error(logName + ":" + ex.ToString());
}
//两秒后改为离开状态 //两秒后改为离开状态
Thread.Sleep(5000); Thread.Sleep(3000);
LogUtil.info(logName + " ,调用 FinishLeave " + shefId); LogUtil.info(logName + " ,调用 FinishEnter ");
SetStatus(id, shefId, ClientAction.FinishLeave); SetStatus(id, "", ClientAction.FinishEnter);
Thread.Sleep(5000); Thread.Sleep(5000);
LogUtil.info(logName + " ,处理结束 更新状态为None "); LogUtil.info(logName + " ,处理结束 更新状态为None ");
SetStatus(id, "", ClientAction.None); SetStatus(id, "", ClientAction.None);
}); });
} }
else else
{ {
LogUtil.error(logName + " L2_OutCheck 未检测到料架,无法将料架进入AGV"); LogUtil.error(logName + " L2_InCheck 检测到有料架,AGV的料架无法进入");
SetStatus(id, "", ClientAction.None, ClientLevel.High); SetStatus(id, "", ClientAction.None, ClientLevel.High);
} }
} }
} }
public static bool SetToNone(string id, string shelfId = "") public static bool SetToNone(string id, string shelfId = "")
{ {
Agv.ClientAction currA = GetAction(id); Agv.ClientAction currA = GetAction(id);
...@@ -245,12 +266,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -245,12 +266,12 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
public static bool NeedLeave(string id, string shelfId) public static bool NeedLeave(string id, string shelfId,ClientShelf shelf = ClientShelf.None)
{ {
Agv.ClientAction currA = GetAction(id); Agv.ClientAction currA = GetAction(id);
if (currA.Equals(Agv.ClientAction.None) || currA.Equals(Agv.ClientAction.NeedLeave) || currA.Equals(Agv.ClientAction.NeedEnter)) if (currA.Equals(Agv.ClientAction.None) || currA.Equals(Agv.ClientAction.NeedLeave) || currA.Equals(Agv.ClientAction.NeedEnter))
{ {
SetStatus(id, shelfId, Agv.ClientAction.NeedLeave); SetStatus(id, shelfId, Agv.ClientAction.NeedLeave,ClientLevel.None,shelf);
return true; return true;
} }
return false; return false;
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net472" />
</packages>
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace> <RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName> <AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
...@@ -33,12 +33,13 @@ ...@@ -33,12 +33,13 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\..\packages\log4net.2.0.12\lib\net40\log4net.dll</HintPath>
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
...@@ -63,6 +64,9 @@ ...@@ -63,6 +64,9 @@
<Name>Common</Name> <Name>Common</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net40" requireReinstallation="true" />
</packages>
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!