feat(iace): lifecycle phases in patterns + broader robot cell scenarios

- ApplicableLifecycles field in HazardPattern: patterns now declare which
  lifecycle phases the hazard applies to (Output, not just filter)
- Init handler writes first applicable lifecycle into Hazard.LifecyclePhase
- Robot cell patterns HP1600-1601 broadened: "Betrieb, Einrichten, Reinigung,
  Wartung, Fehlersuche" instead of only "Teach-Betrieb"
- All robot cell patterns get ApplicableLifecycles for proper phase display

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-14 22:38:02 +02:00
parent e4431da8d2
commit 4b9317b4fd
4 changed files with 28 additions and 12 deletions
@@ -204,6 +204,12 @@ func (h *IACEHandler) InitializeProject(c *gin.Context) {
}
}
// Join applicable lifecycles for the LifecyclePhase field
lifecycleStr := ""
if len(mp.ApplicableLifecycles) > 0 {
lifecycleStr = mp.ApplicableLifecycles[0]
}
hz, cerr := h.store.CreateHazard(ctx, iace.CreateHazardRequest{
ProjectID: projectID,
ComponentID: compID,
@@ -212,6 +218,7 @@ func (h *IACEHandler) InitializeProject(c *gin.Context) {
Category: cat,
Scenario: mp.ScenarioDE,
Function: iace.EncodeOpStates(mp.OperationalStates),
LifecyclePhase: lifecycleStr,
TriggerEvent: mp.TriggerDE,
PossibleHarm: mp.HarmDE,
AffectedPerson: mp.AffectedDE,