@@ -40,6 +40,7 @@ import SrAtl08Colors from '@/components/SrAtl08Colors.vue'
4040import SrAtl24Colors from ' ./SrAtl24Colors.vue'
4141import SrCustomTooltip from ' @/components/SrCustomTooltip.vue'
4242import Dialog from ' primevue/dialog'
43+ import Button from ' primevue/button'
4344import type { AppendToType } from ' @/types/SrTypes'
4445import { processSelectedElPnt } from ' @/utils/SrMapUtils'
4546import SrCycleSelect from ' @/components/SrCycleSelect.vue'
@@ -56,6 +57,8 @@ const tooltipRef = ref()
5657const currentTooltipContent = ref <string >(' ' )
5758const showContextMenu = ref (false )
5859const contextMenuPosition = ref ({ x: 0 , y: 0 })
60+ const showAtl08Dialog = ref (false )
61+ const pendingRunContext = ref <any >(null )
5962
6063const props = defineProps ({
6164 startingReqId: {
@@ -586,6 +589,42 @@ const messageClass = computed(() => {
586589 }
587590})
588591
592+ async function handleAtl08DialogConfirm() {
593+ if (! pendingRunContext .value ) return
594+
595+ const runContext = pendingRunContext .value
596+ const parentReqIdStr = runContext .parentReqId .toString ()
597+
598+ await useAutoReqParamsStore ().presetForScatterPlotOverlay (runContext .parentReqId )
599+ await processRunSlideRuleClicked (runContext ) // worker is started here
600+
601+ if (runContext .reqId > 0 ) {
602+ const thisReqIdStr = runContext .reqId .toString ()
603+ initDataBindingsToChartStore ([thisReqIdStr ]) // after run gives us a reqId
604+ chartStore .setSavedColorEncodeData (
605+ parentReqIdStr ,
606+ chartStore .getSelectedColorEncodeData (parentReqIdStr )
607+ )
608+ chartStore .setSelectedColorEncodeData (parentReqIdStr , ' solid' )
609+ await initSymbolSize (runContext .reqId ) // for new record
610+ initializeColorEncoding (runContext .reqId , ' atl03x' )
611+ } else {
612+ logger .error (' watch atlChartFilterStore.showPhotonCloud: processRunSlideRuleClicked failed' )
613+ }
614+
615+ const msg = ` Click 'Hide Photon Cloud Overlay' to remove highlighted track Photon Cloud data from the plot `
616+ requestsStore .setConsoleMsg (msg )
617+
618+ showAtl08Dialog .value = false
619+ pendingRunContext .value = null
620+ }
621+
622+ function handleAtl08DialogCancel() {
623+ atlChartFilterStore .showPhotonCloud = false
624+ showAtl08Dialog .value = false
625+ pendingRunContext .value = null
626+ }
627+
589628watch (
590629 () => atlChartFilterStore .showPhotonCloud ,
591630 async (newShowPhotonCloud , oldShowPhotonCloud ) => {
@@ -604,51 +643,27 @@ watch(
604643 const isAtl03sp = recTreeStore .findApiForReqId (runContext .reqId ) === ' atl03sp' // because it is deprecated
605644 if (runContext .reqId <= 0 || isAtl03sp ) {
606645 // need to fetch the data because atl03sp is deprecated
607- // console.log('showPhotonCloud runContext.reqId:', runContext.reqId, ' runContext.parentReqId:', runContext.parentReqId, 'runContext.trackFilter:', runContext.trackFilter);
608- await useAutoReqParamsStore ().presetForScatterPlotOverlay (runContext .parentReqId )
609- await processRunSlideRuleClicked (runContext ) // worker is started here
610- // console.log('SrElevationPlot watch atlChartFilterStore.showPhotonCloud runContext:',runContext, 'reqId:', runContext.reqId, parentReqIdStr, ' parentFuncStr:', parentFuncStr);
611- if (runContext .reqId > 0 ) {
612- const thisReqIdStr = runContext .reqId .toString ()
613- initDataBindingsToChartStore ([thisReqIdStr ]) // after run gives us a reqId
614- chartStore .setSavedColorEncodeData (
615- parentReqIdStr ,
616- chartStore .getSelectedColorEncodeData (parentReqIdStr )
617- )
618- chartStore .setSelectedColorEncodeData (parentReqIdStr , ' solid' )
619- await initSymbolSize (runContext .reqId ) // for new record
620- initializeColorEncoding (runContext .reqId , ' atl03x' )
621- // The worker will now fetch the data from the server
622- // and write the opfs file then update
623- // the map selected layer and the chart
624- } else {
625- logger .error (
626- ' watch atlChartFilterStore.showPhotonCloud: processRunSlideRuleClicked failed'
627- )
628- }
646+ // Show dialog to ask user about ATL08 inclusion
647+ pendingRunContext .value = runContext
648+ showAtl08Dialog .value = true
629649 } else {
630650 // we already have the data
631651 initializeColorEncoding (runContext .reqId , parentFuncStr )
632652 const sced = chartStore .getSelectedColorEncodeData (parentReqIdStr )
633- // console.log('sced:', sced, ' reqIdStr:', parentReqIdStr);
634653 chartStore .setSavedColorEncodeData (parentReqIdStr , sced )
635654 chartStore .setSelectedColorEncodeData (parentReqIdStr , ' solid' )
636655 await prepareDbForReqId (runContext .reqId )
637656 await callPlotUpdateDebounced (' from watch atlChartFilterStore.showPhotonCloud TRUE' )
657+ const msg = ` Click 'Hide Photon Cloud Overlay' to remove highlighted track Photon Cloud data from the plot `
658+ requestsStore .setConsoleMsg (msg )
638659 }
639- const msg = ` Click 'Hide Photon Cloud Overlay' to remove highlighted track Photon Cloud data from the plot `
640- requestsStore .setConsoleMsg (msg )
641660 } else {
642661 chartStore .setInitLegendUnselected (recTreeStore .selectedReqIdStr , false )
643- // console.log(`calling chartStore.getSavedColorEncodeData(${recTreeStore.selectedReqIdStr})`)
644662 const sced = chartStore .getSavedColorEncodeData (recTreeStore .selectedReqIdStr )
645- // console.log(`called chartStore.getSavedColorEncodeData(${recTreeStore.selectedReqIdStr}) sced:${sced}`)
646663 if (sced && sced != ' unset' ) {
647- // console.log('Restoring to sced:', sced, ' reqIdStr:', recTreeStore.selectedReqIdStr);
648664 chartStore .setSelectedColorEncodeData (recTreeStore .selectedReqIdStr , sced )
649665 chartStore .setSavedColorEncodeData (recTreeStore .selectedReqIdStr , ' unset' )
650666 }
651- // console.log('SrElevationPlot handlePhotonCloudChange - showPhotonCloud FALSE');
652667 atlChartFilterStore .setSelectedOverlayedReqIds ([])
653668 await callPlotUpdateDebounced (' from watch atlChartFilterStore.showPhotonCloud FALSE' )
654669 }
@@ -951,6 +966,31 @@ watch(
951966 </div >
952967 </div >
953968 </div >
969+ <!-- ATL08 Dialog -->
970+ <Dialog
971+ v-model:visible =" showAtl08Dialog"
972+ header =" Photon Cloud Options"
973+ :modal =" true"
974+ :closable =" false"
975+ :style =" { width: '30rem' }"
976+ >
977+ <div class =" atl08-dialog-content" >
978+ <p >Would you like to include ATL08 classification in the photon cloud overlay?</p >
979+ <div class =" atl08-dialog-checkbox" >
980+ <Checkbox
981+ v-model =" atlChartFilterStore.includeAtl08"
982+ binary
983+ inputId =" dialogAtl08Checkbox"
984+ size =" small"
985+ />
986+ <label for =" dialogAtl08Checkbox" class =" sr-checkbox-label" >Include atl08</label >
987+ </div >
988+ </div >
989+ <template #footer >
990+ <Button label =" Cancel" text @click =" handleAtl08DialogCancel" />
991+ <Button label =" Continue" @click =" handleAtl08DialogConfirm" />
992+ </template >
993+ </Dialog >
954994 </div >
955995</template >
956996
@@ -1147,9 +1187,22 @@ watch(
11471187 margin-left : 0rem ;
11481188}
11491189
1190+ .atl08-dialog-content {
1191+ display : flex ;
1192+ flex-direction : column ;
1193+ gap : 1rem ;
1194+ }
1195+
1196+ .atl08-dialog-checkbox {
1197+ display : flex ;
1198+ flex-direction : row ;
1199+ align-items : center ;
1200+ gap : 0.5rem ;
1201+ }
1202+
11501203.sr-checkbox-label {
11511204 margin-left : 0.5rem ;
1152- font-size : 1 rem ; /* or match your app's font size */
1205+ font-size : 0.875 rem ;
11531206 cursor : pointer ;
11541207}
11551208
0 commit comments