master
zby 2 months ago
parent 7a4cd6cb77
commit 025d0b8d28

@ -101,14 +101,13 @@ public class RfidApi
public static async Task<RfidReadModel?> ReadRfid() public static async Task<RfidReadModel?> ReadRfid()
{ {
Log.Info("RfidApi ReadRfid"); Log.Info("RfidApi ReadRfid");
string readUrl = BASE_URL + "/Api/BeginRead"; string readUrl = BASE_URL + "/Api/BeginRead";
string url = BASE_URL + "/Api/ReadRfidData"; string url = BASE_URL + "/Api/ReadRfidData";
Log.Info($"url={url}"); Log.Info($"url={url}");
try try
{ {
var vBeginRead = await _httpClient.GetStringAsync(readUrl); var vBeginRead = await _httpClient.GetStringAsync(readUrl);
string s = await _httpClient.GetStringAsync(url); string s = await _httpClient.GetStringAsync(url);
Log.Info($"ReadRfid resp={s}"); Log.Info($"ReadRfid resp={s}");
if (s != String.Empty) if (s != String.Empty)

@ -79,6 +79,7 @@ public class StationReadyState : IState
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.Plc, _CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.Plc,
machine); machine);
//手动模式 //手动模式
if (StaticStationInfo.VehicleManually == 1) if (StaticStationInfo.VehicleManually == 1)
{ {
@ -106,7 +107,6 @@ public class StationReadyState : IState
} }
} }
return new StateResult() return new StateResult()
{ {
SwappingState = SwappingState.CarPrepare, SwappingState = SwappingState.CarPrepare,
@ -252,7 +252,7 @@ public class StationReadyState : IState
return Invoker.Invoke(" BeginRead read rfid", 1000, 20, machine.IsCanceled, return Invoker.Invoke(" BeginRead read rfid", 1000, 20, machine.IsCanceled,
() => machine.BeginRfidReadFlag, () => () => machine.BeginRfidReadFlag, () =>
{ {
Task<bool> open = RfidApi.Connect(); // Task<bool> open = RfidApi.Connect();
Task<bool> beginRead = RfidApi.BeginRead(); Task<bool> beginRead = RfidApi.BeginRead();
beginRead.Wait(); beginRead.Wait();
if (!beginRead.Result) if (!beginRead.Result)

@ -74,211 +74,211 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler<SummaryFail
return; return;
}*/ }*/
lstEquipAlarmDefine = EquipAlarmDefineRepository.QueryListByClause(i => i.EquipCode == "plc"); //lstEquipAlarmDefine = EquipAlarmDefineRepository.QueryListByClause(i => i.EquipCode == "plc");
List<string> lstAlarm = new List<string>(); //List<string> lstAlarm = new List<string>();
if (msg.ScreenEmergencyStop) //if (msg.ScreenEmergencyStop)
Alarm("1"); // Alarm("1");
if (msg.PassageEmergencyStop) //if (msg.PassageEmergencyStop)
Alarm("2"); // Alarm("2");
if (msg.RobotEmergencyStop) //if (msg.RobotEmergencyStop)
Alarm("3"); // Alarm("3");
if (msg.FaultyRelays) //if (msg.FaultyRelays)
Alarm("4"); // Alarm("4");
if (msg.TelecommFailures) //if (msg.TelecommFailures)
Alarm("5"); // Alarm("5");
if (msg.MasterFailures) //if (msg.MasterFailures)
Alarm("6"); // Alarm("6");
if (msg.TitleFailures) //if (msg.TitleFailures)
Alarm("7"); // Alarm("7");
if (msg.TitleXFailures) //if (msg.TitleXFailures)
Alarm("8"); // Alarm("8");
if (msg.TitleYFailures) //if (msg.TitleYFailures)
Alarm("9"); // Alarm("9");
if (msg.TitleZFailures) //if (msg.TitleZFailures)
Alarm("10"); // Alarm("10");
if (msg.TitleMFailures) //if (msg.TitleMFailures)
Alarm("11"); // Alarm("11");
if (msg.WireBroken0) //if (msg.WireBroken0)
Alarm("12"); // Alarm("12");
if (msg.WireBroken1) //if (msg.WireBroken1)
Alarm("13"); // Alarm("13");
if (msg.WireBroken2) //if (msg.WireBroken2)
Alarm("14"); // Alarm("14");
if (msg.WireBroken3) //if (msg.WireBroken3)
Alarm("15"); // Alarm("15");
if (msg.XPositiveLimit) //if (msg.XPositiveLimit)
Alarm("16"); // Alarm("16");
if (msg.XNegativeLimit) //if (msg.XNegativeLimit)
Alarm("17"); // Alarm("17");
if (msg.YPositiveLimit) //if (msg.YPositiveLimit)
Alarm("18"); // Alarm("18");
if (msg.YNegativeLimit) //if (msg.YNegativeLimit)
Alarm("19"); // Alarm("19");
if (msg.ZPositiveLimit) //if (msg.ZPositiveLimit)
Alarm("20"); // Alarm("20");
if (msg.ZNegativeLimit) //if (msg.ZNegativeLimit)
Alarm("21"); // Alarm("21");
if (msg.MPositiveLimit) //if (msg.MPositiveLimit)
Alarm("22"); // Alarm("22");
if (msg.MNegativeLimit) //if (msg.MNegativeLimit)
Alarm("23"); // Alarm("23");
if (msg.XDriveFailure) //if (msg.XDriveFailure)
Alarm("24"); // Alarm("24");
if (msg.YDriveFailure) //if (msg.YDriveFailure)
Alarm("25"); // Alarm("25");
if (msg.ZDriveFailure) //if (msg.ZDriveFailure)
Alarm("26"); // Alarm("26");
if (msg.MDriveFailure) //if (msg.MDriveFailure)
Alarm("27"); // Alarm("27");
if (msg.DoorLeft) //if (msg.DoorLeft)
Alarm("28"); // Alarm("28");
if (msg.DoorcloseLeft) //if (msg.DoorcloseLeft)
Alarm("29"); // Alarm("29");
if (msg.DoorRight) //if (msg.DoorRight)
Alarm("30"); // Alarm("30");
if (msg.DoorcloseRight) //if (msg.DoorcloseRight)
Alarm("31"); // Alarm("31");
if (msg.DoorRepaiDhambers) //if (msg.DoorRepaiDhambers)
Alarm("32"); // Alarm("32");
if (msg.DoorcloseRepairChambers) //if (msg.DoorcloseRepairChambers)
Alarm("33"); // Alarm("33");
if (msg.DoorRepaiCabinet) //if (msg.DoorRepaiCabinet)
Alarm("34"); // Alarm("34");
if (msg.DoorRowFrames) //if (msg.DoorRowFrames)
Alarm("35"); // Alarm("35");
if (msg.X1RetractionFailure) //if (msg.X1RetractionFailure)
Alarm("36"); // Alarm("36");
if (msg.X1StickingFault) //if (msg.X1StickingFault)
Alarm("37"); // Alarm("37");
if (msg.X2RetractionFailure) //if (msg.X2RetractionFailure)
Alarm("38"); // Alarm("38");
if (msg.X2StickingFault) //if (msg.X2StickingFault)
Alarm("39"); // Alarm("39");
if (msg.LocalBattIncorrect) //if (msg.LocalBattIncorrect)
Alarm("40"); // Alarm("40");
if (msg.NoLocalBattery) //if (msg.NoLocalBattery)
Alarm("41"); // Alarm("41");
if (msg.LocalStorageBatteries) //if (msg.LocalStorageBatteries)
Alarm("42"); // Alarm("42");
if (msg.RemoteBattIncorrect) //if (msg.RemoteBattIncorrect)
Alarm("43"); // Alarm("43");
if (msg.RemoteBattery) //if (msg.RemoteBattery)
Alarm("44"); // Alarm("44");
if (msg.RemoteStorageBatteries) //if (msg.RemoteStorageBatteries)
Alarm("45"); // Alarm("45");
if (msg.RemoteMoveLibraryBattery) //if (msg.RemoteMoveLibraryBattery)
Alarm("46"); // Alarm("46");
if (msg.RemoteLibraryBatteries) //if (msg.RemoteLibraryBatteries)
Alarm("47"); // Alarm("47");
if (msg.RemoteAreBatteries) //if (msg.RemoteAreBatteries)
Alarm("48"); // Alarm("48");
if (msg.RemoteMoveElectLibrary) //if (msg.RemoteMoveElectLibrary)
Alarm("49"); // Alarm("49");
if (msg.RemoteelectrLibrary) //if (msg.RemoteelectrLibrary)
Alarm("50"); // Alarm("50");
if (msg.RemoteelectrAreBatteries) //if (msg.RemoteelectrAreBatteries)
Alarm("51"); // Alarm("51");
if (msg.RemoteStorageLibrary) //if (msg.RemoteStorageLibrary)
Alarm("52"); // Alarm("52");
if (msg.RemotStorageAreBatteries) //if (msg.RemotStorageAreBatteries)
Alarm("53"); // Alarm("53");
if (msg.RemoteOutboundLibrary) //if (msg.RemoteOutboundLibrary)
Alarm("54"); // Alarm("54");
if (msg.RemotOutboundAreBatteries) //if (msg.RemotOutboundAreBatteries)
Alarm("55"); // Alarm("55");
if (msg.RemoteBackupLibrary) //if (msg.RemoteBackupLibrary)
Alarm("56"); // Alarm("56");
if (msg.RemotBackupAreBatteries) //if (msg.RemotBackupAreBatteries)
Alarm("57"); // Alarm("57");
if (msg.BatteryCompartAbnormal01) //if (msg.BatteryCompartAbnormal01)
Alarm("58"); // Alarm("58");
if (msg.BatteryCompartAbnormal02) //if (msg.BatteryCompartAbnormal02)
Alarm("59"); // Alarm("59");
if (msg.BatteryCompartAbnormal03) //if (msg.BatteryCompartAbnormal03)
Alarm("60"); // Alarm("60");
if (msg.BatteryCompartAbnormal04) //if (msg.BatteryCompartAbnormal04)
Alarm("61"); // Alarm("61");
if (msg.BatteryCompartAbnormal05) //if (msg.BatteryCompartAbnormal05)
Alarm("62"); // Alarm("62");
if (msg.BatteryCompartAbnormal06) //if (msg.BatteryCompartAbnormal06)
Alarm("63"); // Alarm("63");
if (msg.BatteryCompartAbnormal07) //if (msg.BatteryCompartAbnormal07)
Alarm("64"); // Alarm("64");
if (msg.BatteryCompartAbnormal08) //if (msg.BatteryCompartAbnormal08)
Alarm("65"); // Alarm("65");
if (msg.BatteryCompartAbnormal09) //if (msg.BatteryCompartAbnormal09)
Alarm("66"); // Alarm("66");
if (msg.BatteryWasDetectCompartment) //if (msg.BatteryWasDetectCompartment)
Alarm("67"); // Alarm("67");
if (msg.RepairWasDetectCompartment) //if (msg.RepairWasDetectCompartment)
Alarm("68"); // Alarm("68");
if (msg.WasDetectCompartment214) //if (msg.WasDetectCompartment214)
Alarm("69"); // Alarm("69");
if (msg.ZSpreaderForceSensor) //if (msg.ZSpreaderForceSensor)
Alarm("70"); // Alarm("70");
if (msg.YZSafetyBitAlarm) //if (msg.YZSafetyBitAlarm)
Alarm("71"); // Alarm("71");
if (msg.YZSafetyWarehouseBitAlarm) //if (msg.YZSafetyWarehouseBitAlarm)
Alarm("72"); // Alarm("72");
//查询当前PLC的实时报警信息 ////查询当前PLC的实时报警信息
var lstNowEquipAlarmRecord = EquipAlarmRecordRepository.QueryListByClause(i => i.EquipCode == "plc"); //var lstNowEquipAlarmRecord = EquipAlarmRecordRepository.QueryListByClause(i => i.EquipCode == "plc");
var sqllstAlarm = lstNowEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList(); //当前报警列表 //var sqllstAlarm = lstNowEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList(); //当前报警列表
// 找出实时报警中存在但数据库中不存在的元素 //// 找出实时报警中存在但数据库中不存在的元素
List<string> uniqueToList1 = lstAlarm.Except(sqllstAlarm).ToList(); //List<string> uniqueToList1 = lstAlarm.Except(sqllstAlarm).ToList();
// 找出数据库中存在但实时报警中不存在的元素 //// 找出数据库中存在但实时报警中不存在的元素
List<string> uniqueToList2 = sqllstAlarm.Except(lstAlarm).ToList(); //List<string> uniqueToList2 = sqllstAlarm.Except(lstAlarm).ToList();
if (uniqueToList1.Count > 0) //if (uniqueToList1.Count > 0)
{ //{
//这里要添加新的报警数据 // //这里要添加新的报警数据
foreach (var errorCode in uniqueToList1) // foreach (var errorCode in uniqueToList1)
{ // {
EquipAlarmDefine? alarmDefine = // EquipAlarmDefine? alarmDefine =
EquipAlarmDefineRepository.QueryByClause(i => i.ErrorCode == errorCode); // EquipAlarmDefineRepository.QueryByClause(i => i.ErrorCode == errorCode);
if (alarmDefine != null) // if (alarmDefine != null)
{ // {
EquipAlarmRecord record = new EquipAlarmRecord() // EquipAlarmRecord record = new EquipAlarmRecord()
{ // {
EquipTypeCode = alarmDefine.EquipTypeCode, // EquipTypeCode = alarmDefine.EquipTypeCode,
EquipCode = "plc", // EquipCode = "plc",
ErrorCode = errorCode, // ErrorCode = errorCode,
ErrorLevel = alarmDefine.ErrorLevel, // ErrorLevel = alarmDefine.ErrorLevel,
ErrorMsg = alarmDefine.ErrorMsg, // ErrorMsg = alarmDefine.ErrorMsg,
ProcessMethod = alarmDefine.ProcessMethod, // ProcessMethod = alarmDefine.ProcessMethod,
StartTime = DateTime.Now // StartTime = DateTime.Now
}; // };
EquipAlarmRecordRepository.Insert(record); // EquipAlarmRecordRepository.Insert(record);
} // }
} // }
} //}
else if (uniqueToList2.Count > 0) //else if (uniqueToList2.Count > 0)
{ //{
//这些是要清除实时报警,并且处理记录的。 // //这些是要清除实时报警,并且处理记录的。
// 使用LINQ找出ErrorCode在uniqueToList2中的EquipAlarmRecord对象 // // 使用LINQ找出ErrorCode在uniqueToList2中的EquipAlarmRecord对象
List<EquipAlarmRecord> filteredObjectList = lstNowEquipAlarmRecord // List<EquipAlarmRecord> filteredObjectList = lstNowEquipAlarmRecord
.Where(obj => uniqueToList2.Contains(obj.ErrorCode)) // .Where(obj => uniqueToList2.Contains(obj.ErrorCode))
.ToList(); // .ToList();
foreach (var VARIABLE in filteredObjectList) // foreach (var VARIABLE in filteredObjectList)
{ // {
EquipAlarmProcessRecord EquipAlarmProcessRecord = new EquipAlarmProcessRecord(); // EquipAlarmProcessRecord EquipAlarmProcessRecord = new EquipAlarmProcessRecord();
EquipAlarmProcessRecord.EquipTypeCode = VARIABLE.EquipTypeCode; // EquipAlarmProcessRecord.EquipTypeCode = VARIABLE.EquipTypeCode;
EquipAlarmProcessRecord.EquipCode = VARIABLE.EquipCode; // EquipAlarmProcessRecord.EquipCode = VARIABLE.EquipCode;
EquipAlarmProcessRecord.ErrorCode = VARIABLE.ErrorCode; // EquipAlarmProcessRecord.ErrorCode = VARIABLE.ErrorCode;
EquipAlarmProcessRecord.ErrorLevel = VARIABLE.ErrorLevel; // EquipAlarmProcessRecord.ErrorLevel = VARIABLE.ErrorLevel;
EquipAlarmProcessRecord.ErrorMsg = VARIABLE.ErrorMsg; // EquipAlarmProcessRecord.ErrorMsg = VARIABLE.ErrorMsg;
EquipAlarmProcessRecord.ProcessMethod = VARIABLE.ProcessMethod; // EquipAlarmProcessRecord.ProcessMethod = VARIABLE.ProcessMethod;
EquipAlarmProcessRecord.StartTime = VARIABLE.StartTime; // EquipAlarmProcessRecord.StartTime = VARIABLE.StartTime;
EquipAlarmProcessRecord.ProcessTime = DateTime.Now; // EquipAlarmProcessRecord.ProcessTime = DateTime.Now;
EquipAlarmProcessRecordRepository.Insert(EquipAlarmProcessRecord); // EquipAlarmProcessRecordRepository.Insert(EquipAlarmProcessRecord);
} // }
EquipAlarmRecordRepository.Delete(filteredObjectList); // EquipAlarmRecordRepository.Delete(filteredObjectList);
} //}
ClientMgr.PlcClient.Auto = msg.T3 == 1; ClientMgr.PlcClient.Auto = msg.T3 == 1;

@ -10,7 +10,7 @@
"Url": "http://121.4.95.243:8090/Updates/AutoUpdaterStarter.xml" "Url": "http://121.4.95.243:8090/Updates/AutoUpdaterStarter.xml"
}, },
"Redis": { "Redis": {
"Connection": "127.0.0.1:6379,password=12345", "Connection": "127.0.0.1:6379,password=123456",
"InstanceName": "local", "InstanceName": "local",
"DefaultDB": "8" "DefaultDB": "8"
}, },

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("WebStarter")] [assembly: System.Reflection.AssemblyCompanyAttribute("WebStarter")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e86c8971179fbf600196da8db1bd2db37c2bc45a")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7a4cd6cb77076f93c20d2a7e8baa5b1a1dad3b90")]
[assembly: System.Reflection.AssemblyProductAttribute("WebStarter")] [assembly: System.Reflection.AssemblyProductAttribute("WebStarter")]
[assembly: System.Reflection.AssemblyTitleAttribute("WebStarter")] [assembly: System.Reflection.AssemblyTitleAttribute("WebStarter")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
367ff986bed887dd07b57dfbcc0e5fb5f4968d413bf3c6ceb8edd2e0883cb376 77da7ee31a7818cee6653f2860fe7f0be2aa423335f9c89cf24b68008a0b2653

@ -17,11 +17,11 @@ build_property._SupportedPlatformList = Linux,macOS,Windows
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = WebStarter build_property.RootNamespace = WebStarter
build_property.RootNamespace = WebStarter build_property.RootNamespace = WebStarter
build_property.ProjectDir = D:\桌面\nyx\WholeProcess\WebStarter\ build_property.ProjectDir = D:\桌面\sterma\WebStarter\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.RazorLangVersion = 6.0 build_property.RazorLangVersion = 6.0
build_property.SupportLocalizedComponentNames = build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes = build_property.GenerateRazorMetadataSourceChecksumAttributes =
build_property.MSBuildProjectDirectory = D:\桌面\nyx\WholeProcess\WebStarter build_property.MSBuildProjectDirectory = D:\桌面\sterma\WebStarter
build_property._RazorSourceGeneratorDebug = build_property._RazorSourceGeneratorDebug =

@ -50,9 +50,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Form2.cs"> <Compile Update="Form2.cs" />
<SubType>Form</SubType>
</Compile>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -2,6 +2,9 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup /> <PropertyGroup />
<ItemGroup> <ItemGroup>
<Compile Update="Form2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPlc.cs"> <Compile Update="FrmPlc.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("WinFormStarter")] [assembly: System.Reflection.AssemblyCompanyAttribute("WinFormStarter")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e86c8971179fbf600196da8db1bd2db37c2bc45a")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("WinFormStarter")] [assembly: System.Reflection.AssemblyProductAttribute("WinFormStarter")]
[assembly: System.Reflection.AssemblyTitleAttribute("WinFormStarter")] [assembly: System.Reflection.AssemblyTitleAttribute("WinFormStarter")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
b00b8e92ae25e09e2081494bb5885f166436b0d5f129604e7e60578a50110aee e927a79293d807146064f50a391eec4be7cb611c75ca9df1f3fd8a2bf8ff393c

@ -22,6 +22,6 @@ build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = WinFormStarter build_property.RootNamespace = WinFormStarter
build_property.ProjectDir = D:\桌面\nyx\WholeProcess\WinFormStarter\ build_property.ProjectDir = D:\桌面\sterma\WinFormStarter\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =

Loading…
Cancel
Save