diff --git a/src/main/java/alice/dip/DipMessagesProcessor.java b/src/main/java/alice/dip/DipMessagesProcessor.java index 1578198..6d4effc 100644 --- a/src/main/java/alice/dip/DipMessagesProcessor.java +++ b/src/main/java/alice/dip/DipMessagesProcessor.java @@ -236,24 +236,24 @@ public void processNextInQueue(MessageItem messageItem) { case "dip/acc/LHC/RunControl/SafeBeam": handleSafeBeamMessage(messageItem.data); break; - case "dip/acc/LHC/Beam/Energy": - handleEnergyMessage(messageItem.data); - break; case "dip/acc/LHC/RunControl/BeamMode": handleBeamModeMessage(messageItem.data); break; + case "dip/acc/LHC/Beam/Energy": + handleEnergyMessage(messageItem.data); + break; case "dip/acc/LHC/Beam/BetaStar/Bstar2": handleBetaStarMessage(messageItem.data); break; case "dip/ALICE/MCS/Solenoid/Current": handleL3CurrentMessage(messageItem.data); break; - case "dip/ALICE/MCS/Dipole/Current": - handleDipoleCurrentMessage(messageItem.data); - break; case "dip/ALICE/MCS/Solenoid/Polarity": handleL3PolarityMessage(messageItem.data); break; + case "dip/ALICE/MCS/Dipole/Current": + handleDipoleCurrentMessage(messageItem.data); + break; case "dip/ALICE/MCS/Dipole/Polarity": handleDipolePolarityMessage(messageItem.data); break; @@ -308,7 +308,7 @@ private void handleRunConfigurationMessage(DipData dipData) throws BadParameter, } private void handleSafeBeamMessage(DipData dipData) throws BadParameter, TypeMismatch { - var safeBeamPayload = dipData.extractInt("payload"); + var safeBeamPayload = dipData.extractInt("PAYLOAD"); var time = dipData.extractDipTime().getAsMillis(); @@ -342,11 +342,11 @@ private void handleSafeBeamMessage(DipData dipData) throws BadParameter, TypeMis } private void handleEnergyMessage(DipData dipData) throws BadParameter, TypeMismatch { - var energyPayload = dipData.extractInt("payload"); + var energyPayload = dipData.extractInt("PAYLOAD"); // Per documentation, value has to be multiplied by 120 go get MeV // https://confluence.cern.ch/display/expcomm/Energy var energy = 0.12f * energyPayload; - + AliDip2BK.log(1, "ProcData.dispach", " New Energy = " + energy + " TeV"); var time = dipData.extractDipTime().getAsMillis(); if (currentFill != null) { @@ -371,13 +371,18 @@ private void handleBeamModeMessage(DipData dipData) throws BadParameter, TypeMis newBeamMode(time, beamMode); } + /** + * Handles the Beta Star message, extracts the value, converts it to meters and updates the current fill information accordingly. + * Source: https://confluence.cern.ch/pages/viewpage.action?spaceKey=expcomm&title=BetaStar + * @param dipData - the DipData object containing the Beta Star information + */ private void handleBetaStarMessage(DipData dipData) throws BadParameter, TypeMismatch { - var betaStarPayload = dipData.extractInt("payload"); + var betaStarPayload = dipData.extractInt("PAYLOAD"); // Per documentation, value is in cm, we convert it to m var betaStar = betaStarPayload / 100.f; // in m var time = dipData.extractDipTime().getAsMillis(); - + AliDip2BK.log(1, "ProcData.dispach", " New Beta Star = " + betaStar); if (currentFill != null) { currentFill.setLHCBetaStar(time, betaStar); } diff --git a/src/main/proto/events.proto b/src/main/proto/events.proto index 2ec26e6..870524f 100644 --- a/src/main/proto/events.proto +++ b/src/main/proto/events.proto @@ -160,4 +160,4 @@ message Event { // Events produced by other systems, but natively supported and defined by AliECS Ev_BeamModeEvent beamModeEvent = 200; } -} \ No newline at end of file +} diff --git a/src/main/proto/protos/common.proto b/src/main/proto/protos/common.proto index f1e7787..1942c36 100644 --- a/src/main/proto/protos/common.proto +++ b/src/main/proto/protos/common.proto @@ -40,6 +40,15 @@ message User { string name = 3; } +// Production and staging BKP recognizes these special user IDs. +// They are used to associate certain actions (e.g. EOR) with certain subsystem +// or AliECS component rather than a human user. +enum SpecialUserId { + INVALID = 0; + LHC = 60; + TIMER = 65; +} + message WorkflowTemplateInfo { string name = 1; string description = 2; @@ -55,10 +64,8 @@ message BeamInfo { int64 stableBeamsEnd = 2; // milliseconds since epoch when stable beams ended int32 fillNumber = 3; // LHC fill number string fillingSchemeName = 4; // LHC filling scheme name e.g. 25ns_2460b_2448_2089_2227_144bpi_20inj - float beam1Energy = 5; // in GeV - float beam2Energy = 6; // in GeV - string beamType = 7; // e.g. PROTON-PROTON, O8-O8, Pb-Pb, p-Pb, Pb-p - BeamMode beamMode = 8; + string beamType = 5; // e.g. PROTON-PROTON, O8-O8, Pb-Pb, p-Pb, Pb-p + BeamMode beamMode = 6; } /**