import { SatObject } from '@app/js/api/keepTrackTypes' ; import { SpaceObjectType } from '@app/js/api/SpaceObjectType' ; import { ColorInformation , colorSchemeManager , Pickable } from '../colorSchemeManager' ; export const leoRules = ( sat ) : ColorInformation => { if ( sat . static && sat . type === SpaceObjectType . STAR ) { if ( sat . vmag >= 4.7 && colorSchemeManager . objectTypeFlags . starLow ) { return { color : colorSchemeManager . colorTheme . starLow , pickable : Pickable . Yes , } ; } else if ( sat . vmag >= 3.5 && sat . vmag < 4.7 && colorSchemeManager . objectTypeFlags . starMed ) { return { color : colorSchemeManager . colorTheme . starMed , pickable : Pickable . Yes , } ; } else if ( sat . vmag < 3.5 && colorSchemeManager . objectTypeFlags . starHi ) { return { color : colorSchemeManager . colorTheme . starHi , pickable : Pickable . Yes , } ; } else { return { color : colorSchemeManager . colorTheme . deselected , pickable : Pickable . No , } ; } } switch ( sat . type ) { case SpaceObjectType . INTERGOVERNMENTAL_ORGANIZATION : case SpaceObjectType . SUBORBITAL_PAYLOAD_OPERATOR : case SpaceObjectType . PAYLOAD_OWNER : case SpaceObjectType . METEOROLOGICAL_ROCKET_LAUNCH_AGENCY_OR_MANUFACTURER : case SpaceObjectType . PAYLOAD_MANUFACTURER : case SpaceObjectType . LAUNCH_AGENCY : case SpaceObjectType . LAUNCH_SITE : case SpaceObjectType . LAUNCH_POSITION : return { color : colorSchemeManager . colorTheme . facility , pickable : Pickable . Yes , } ; default : } if ( sat . static ) { return { color : colorSchemeManager . colorTheme . sensor , pickable : Pickable . Yes , } ; } var ap = sat . apogee ; if ( ap > 2000 ) { return { color : colorSchemeManager . colorTheme . transparent , pickable : Pickable . No , } ; } else { if ( sat . inView === 1 && colorSchemeManager . objectTypeFlags . inFOV === true ) { return { color : colorSchemeManager . colorTheme . inView , pickable : Pickable . Yes , } ; } else { return { color : colorSchemeManager . colorTheme . satLEO , pickable : Pickable . Yes , } ; } } } ;