Browse Source

fix hwilk触发 log输出是哪个di触发的动作

jiangjy 1 month ago
parent
commit
af4c437f94
1 changed files with 25 additions and 7 deletions
  1. 25 7
      Furnace/FurnaceRT/Equipments/PMs/PMAlarmCondition.cs

+ 25 - 7
Furnace/FurnaceRT/Equipments/PMs/PMAlarmCondition.cs

@@ -662,7 +662,7 @@ namespace FurnaceRT.Equipments.PMs
                 item.FilterCheckerAlarm.Monitor(sensorItem.Value);
                 item.FilterCheckerAlarm.Monitor(sensorItem.Value);
 
 
                 if (item.FilterCheckerAlarm.Trig)
                 if (item.FilterCheckerAlarm.Trig)
-                    ProcessAlarmConditionErrorCommand(item.DIParameter.Command, () => alarmItem.Set());
+                    ProcessAlarmConditionErrorCommand(item.DIParameter.Command, () => alarmItem.Set(), sensorItem.Name);
             }
             }
         }
         }
         private void MonitorAPCAlarmCondition()
         private void MonitorAPCAlarmCondition()
@@ -962,7 +962,7 @@ namespace FurnaceRT.Equipments.PMs
                 }
                 }
             }
             }
         }
         }
-        private void ProcessAlarmConditionErrorCommand(string command, Action eventHandler = null)
+        private void ProcessAlarmConditionErrorCommand(string command, Action eventHandler = null, string sensorName = "")
         {
         {
             var recipe = "";
             var recipe = "";
             var recipeType = "";
             var recipeType = "";
@@ -977,7 +977,12 @@ namespace FurnaceRT.Equipments.PMs
                     recipeType = "Reset";
                     recipeType = "Reset";
                     RecipeExecEntryEnumValue = RecipeExecEntryEnum.AlarmConditonTrigger;
                     RecipeExecEntryEnumValue = RecipeExecEntryEnum.AlarmConditonTrigger;
                     CheckToPostMessage((int)MSG.RunOtherRecipe, recipe, recipeType);
                     CheckToPostMessage((int)MSG.RunOtherRecipe, recipe, recipeType);
-                    LOG.Write($"Alarm condition: command={command} recipe={recipe}");
+
+                    var log = $"Alarm condition: command={command} recipe={recipe}";
+                    if (!string.IsNullOrEmpty(sensorName))
+                        log = $"{log} ,sensorName={sensorName}";
+
+                    LOG.Write(log);
                     break;
                     break;
                 case "End":
                 case "End":
                     if (_isAlarmConditionHasRecipeCommand)
                     if (_isAlarmConditionHasRecipeCommand)
@@ -1002,26 +1007,39 @@ namespace FurnaceRT.Equipments.PMs
                         CheckToPostMessage((int)MSG.AlarmConditionJumpStep, RecipeRunningInfo.RecipeStepList.Count - 1);
                         CheckToPostMessage((int)MSG.AlarmConditionJumpStep, RecipeRunningInfo.RecipeStepList.Count - 1);
                     }
                     }
 
 
-                    LOG.Write($"Alarm condition: command={command} step name={RecipeRunningInfo.RecipeStepList[RecipeRunningInfo.RecipeStepList.Count - 1].StepName}");
+                    log = $"Alarm condition: command={command} step name={RecipeRunningInfo.RecipeStepList[RecipeRunningInfo.RecipeStepList.Count - 1].StepName}";
+                    if (!string.IsNullOrEmpty(sensorName))
+                        log = $"{log} ,sensorName={sensorName}";
+
+                    LOG.Write(log);
                     break;
                     break;
                 case "Hold":
                 case "Hold":
                     if (_isAlarmConditionHasRecipeCommand)
                     if (_isAlarmConditionHasRecipeCommand)
                         break;
                         break;
                     _isAlarmConditionHasRecipeCommand = true;
                     _isAlarmConditionHasRecipeCommand = true;
                     _processRoutine.PauseRecipe();
                     _processRoutine.PauseRecipe();
-                    LOG.Write($"Alarm condition: command={command}");
+                     log = $"Alarm condition: command={command}";
+                    if (!string.IsNullOrEmpty(sensorName))
+                        log = $"{log} ,sensorName={sensorName}";
+                    LOG.Write(log);
                     break;
                     break;
                 case "Monitor"://蜂鸣器不需要响
                 case "Monitor"://蜂鸣器不需要响
                     eventHandler?.Invoke();
                     eventHandler?.Invoke();
                     DEVICE.GetDevice<SignalTowerBase>("System.SignalTower")?.SwitchOffBuzzer(true);
                     DEVICE.GetDevice<SignalTowerBase>("System.SignalTower")?.SwitchOffBuzzer(true);
                     Singleton<EquipmentManager>.Instance.IsAlarmConditionBuzzerOn = false;
                     Singleton<EquipmentManager>.Instance.IsAlarmConditionBuzzerOn = false;
-                    LOG.Write($"Alarm condition: command={command}");
+                    log = $"Alarm condition: command={command}";
+                    if (!string.IsNullOrEmpty(sensorName))
+                        log = $"{log} ,sensorName={sensorName}";
+                    LOG.Write(log);
                     break;
                     break;
                 case "Buzzer"://蜂鸣器需要响且报警
                 case "Buzzer"://蜂鸣器需要响且报警
                     eventHandler?.Invoke();
                     eventHandler?.Invoke();
                     DEVICE.GetDevice<SignalTowerBase>("System.SignalTower")?.SwitchOffBuzzer(false);
                     DEVICE.GetDevice<SignalTowerBase>("System.SignalTower")?.SwitchOffBuzzer(false);
                     Singleton<EquipmentManager>.Instance.IsAlarmConditionBuzzerOn = true;
                     Singleton<EquipmentManager>.Instance.IsAlarmConditionBuzzerOn = true;
-                    LOG.Write($"Alarm condition: command={command}");
+                    log = $"Alarm condition: command={command}";
+                    if (!string.IsNullOrEmpty(sensorName))
+                        log = $"{log} ,sensorName={sensorName}";
+                    LOG.Write(log);
                     break;
                     break;
                 default:
                 default:
                     if (_isAlarmConditionHasRecipeCommand)
                     if (_isAlarmConditionHasRecipeCommand)