master
zby 2 months ago
parent 7a4cd6cb77
commit 025d0b8d28

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

@ -79,6 +79,7 @@ public class StationReadyState : IState
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.Plc,
machine);
//手动模式
if (StaticStationInfo.VehicleManually == 1)
{
@ -106,7 +107,6 @@ public class StationReadyState : IState
}
}
return new StateResult()
{
SwappingState = SwappingState.CarPrepare,
@ -252,7 +252,7 @@ public class StationReadyState : IState
return Invoker.Invoke(" BeginRead read rfid", 1000, 20, machine.IsCanceled,
() => machine.BeginRfidReadFlag, () =>
{
Task<bool> open = RfidApi.Connect();
// Task<bool> open = RfidApi.Connect();
Task<bool> beginRead = RfidApi.BeginRead();
beginRead.Wait();
if (!beginRead.Result)
@ -269,7 +269,7 @@ public class StationReadyState : IState
{
machine.LedTool.WriteProgramContent(InfoEnum.SwapInfo.ErrorReadRfid.GetLed());
SoundClient = AppInfo.Container.Resolve<SoundClient>();
}, false, () => { machine.ExceptionReason = ExceptionReason.ReadRfidError; }
, 3, InvokeStatus.None);
}
@ -330,7 +330,7 @@ public class StationReadyState : IState
//新增小步
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.RfidReadFlag,
machine);
//RfidApi.StopRead();
_log.Info("stop read rfid");
// RfidApi.DisConnect();

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

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

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("WebStarter")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[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.AssemblyTitleAttribute("WebStarter")]
[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.RootNamespace = WebStarter
build_property.RootNamespace = WebStarter
build_property.ProjectDir = D:\桌面\nyx\WholeProcess\WebStarter\
build_property.ProjectDir = D:\桌面\sterma\WebStarter\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.RazorLangVersion = 6.0
build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes =
build_property.MSBuildProjectDirectory = D:\桌面\nyx\WholeProcess\WebStarter
build_property.MSBuildProjectDirectory = D:\桌面\sterma\WebStarter
build_property._RazorSourceGeneratorDebug =

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

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

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("WinFormStarter")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[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.AssemblyTitleAttribute("WinFormStarter")]
[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.RootNamespace = WinFormStarter
build_property.ProjectDir = D:\桌面\nyx\WholeProcess\WinFormStarter\
build_property.ProjectDir = D:\桌面\sterma\WinFormStarter\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

Loading…
Cancel
Save