Skip to content

Commit e19d3c2

Browse files
committed
[O2B-1533] Add JSDoc and other comment describing DetectorOrders priorities
1 parent e73826d commit e19d3c2

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

lib/public/domain/enums/DetectorOrders.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313

1414
import { DetectorType } from './DetectorTypes.js';
1515

16+
/**
17+
* Defines priority mappings for detector types.
18+
* Each key is a mapping between {@link DetectorType} values and their numeric priority
19+
* (larger values will appear first - see detectorsProvider LN88).
20+
*
21+
* - **DEFAULT**: Standard ordering used across most views.
22+
* - **RCT**: Ordering used in the Run Condition Table, which prioritizes PHYSICAL detectors.
23+
*/
1624
export const DetectorOrders = Object.freeze({
1725
DEFAULT: {
1826
[DetectorType.OTHER]: 0,

lib/public/services/detectors/detectorsProvider.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export class DetectorsProvider extends RemoteDataProvider {
8585
if (specialPair.includes(detector1.name) && specialPair.includes(detector2.name)) {
8686
return detector1.name === 'ZDC' ? 1 : -1;
8787
}
88+
// Note the negative sign to have larger priority types appear first
8889
return -(typeToOrderingKey(detector1.type) - typeToOrderingKey(detector2.type)) * 10 + detector1.name.localeCompare(detector2.name);
8990
};
9091

0 commit comments

Comments
 (0)