Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 83 additions & 30 deletions web-client/src/components/SrElevationPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import SrAtl08Colors from '@/components/SrAtl08Colors.vue'
import SrAtl24Colors from './SrAtl24Colors.vue'
import SrCustomTooltip from '@/components/SrCustomTooltip.vue'
import Dialog from 'primevue/dialog'
import Button from 'primevue/button'
import type { AppendToType } from '@/types/SrTypes'
import { processSelectedElPnt } from '@/utils/SrMapUtils'
import SrCycleSelect from '@/components/SrCycleSelect.vue'
Expand All @@ -56,6 +57,8 @@ const tooltipRef = ref()
const currentTooltipContent = ref<string>('')
const showContextMenu = ref(false)
const contextMenuPosition = ref({ x: 0, y: 0 })
const showAtl08Dialog = ref(false)
const pendingRunContext = ref<any>(null)

const props = defineProps({
startingReqId: {
Expand Down Expand Up @@ -586,6 +589,42 @@ const messageClass = computed(() => {
}
})

async function handleAtl08DialogConfirm() {
if (!pendingRunContext.value) return

const runContext = pendingRunContext.value
const parentReqIdStr = runContext.parentReqId.toString()

await useAutoReqParamsStore().presetForScatterPlotOverlay(runContext.parentReqId)
await processRunSlideRuleClicked(runContext) // worker is started here

if (runContext.reqId > 0) {
const thisReqIdStr = runContext.reqId.toString()
initDataBindingsToChartStore([thisReqIdStr]) //after run gives us a reqId
chartStore.setSavedColorEncodeData(
parentReqIdStr,
chartStore.getSelectedColorEncodeData(parentReqIdStr)
)
chartStore.setSelectedColorEncodeData(parentReqIdStr, 'solid')
await initSymbolSize(runContext.reqId) // for new record
initializeColorEncoding(runContext.reqId, 'atl03x')
} else {
logger.error('watch atlChartFilterStore.showPhotonCloud: processRunSlideRuleClicked failed')
}

const msg = `Click 'Hide Photon Cloud Overlay' to remove highlighted track Photon Cloud data from the plot`
requestsStore.setConsoleMsg(msg)

showAtl08Dialog.value = false
pendingRunContext.value = null
}

function handleAtl08DialogCancel() {
atlChartFilterStore.showPhotonCloud = false
showAtl08Dialog.value = false
pendingRunContext.value = null
}

watch(
() => atlChartFilterStore.showPhotonCloud,
async (newShowPhotonCloud, oldShowPhotonCloud) => {
Expand All @@ -604,51 +643,27 @@ watch(
const isAtl03sp = recTreeStore.findApiForReqId(runContext.reqId) === 'atl03sp' //because it is deprecated
if (runContext.reqId <= 0 || isAtl03sp) {
// need to fetch the data because atl03sp is deprecated
//console.log('showPhotonCloud runContext.reqId:', runContext.reqId, ' runContext.parentReqId:', runContext.parentReqId, 'runContext.trackFilter:', runContext.trackFilter);
await useAutoReqParamsStore().presetForScatterPlotOverlay(runContext.parentReqId)
await processRunSlideRuleClicked(runContext) // worker is started here
//console.log('SrElevationPlot watch atlChartFilterStore.showPhotonCloud runContext:',runContext, 'reqId:', runContext.reqId, parentReqIdStr, ' parentFuncStr:', parentFuncStr);
if (runContext.reqId > 0) {
const thisReqIdStr = runContext.reqId.toString()
initDataBindingsToChartStore([thisReqIdStr]) //after run gives us a reqId
chartStore.setSavedColorEncodeData(
parentReqIdStr,
chartStore.getSelectedColorEncodeData(parentReqIdStr)
)
chartStore.setSelectedColorEncodeData(parentReqIdStr, 'solid')
await initSymbolSize(runContext.reqId) // for new record
initializeColorEncoding(runContext.reqId, 'atl03x')
// The worker will now fetch the data from the server
// and write the opfs file then update
// the map selected layer and the chart
} else {
logger.error(
'watch atlChartFilterStore.showPhotonCloud: processRunSlideRuleClicked failed'
)
}
// Show dialog to ask user about ATL08 inclusion
pendingRunContext.value = runContext
showAtl08Dialog.value = true
} else {
// we already have the data
initializeColorEncoding(runContext.reqId, parentFuncStr)
const sced = chartStore.getSelectedColorEncodeData(parentReqIdStr)
//console.log('sced:', sced, ' reqIdStr:', parentReqIdStr);
chartStore.setSavedColorEncodeData(parentReqIdStr, sced)
chartStore.setSelectedColorEncodeData(parentReqIdStr, 'solid')
await prepareDbForReqId(runContext.reqId)
await callPlotUpdateDebounced('from watch atlChartFilterStore.showPhotonCloud TRUE')
const msg = `Click 'Hide Photon Cloud Overlay' to remove highlighted track Photon Cloud data from the plot`
requestsStore.setConsoleMsg(msg)
}
const msg = `Click 'Hide Photon Cloud Overlay' to remove highlighted track Photon Cloud data from the plot`
requestsStore.setConsoleMsg(msg)
} else {
chartStore.setInitLegendUnselected(recTreeStore.selectedReqIdStr, false)
//console.log(`calling chartStore.getSavedColorEncodeData(${recTreeStore.selectedReqIdStr})`)
const sced = chartStore.getSavedColorEncodeData(recTreeStore.selectedReqIdStr)
//console.log(`called chartStore.getSavedColorEncodeData(${recTreeStore.selectedReqIdStr}) sced:${sced}`)
if (sced && sced != 'unset') {
//console.log('Restoring to sced:', sced, ' reqIdStr:', recTreeStore.selectedReqIdStr);
chartStore.setSelectedColorEncodeData(recTreeStore.selectedReqIdStr, sced)
chartStore.setSavedColorEncodeData(recTreeStore.selectedReqIdStr, 'unset')
}
//console.log('SrElevationPlot handlePhotonCloudChange - showPhotonCloud FALSE');
atlChartFilterStore.setSelectedOverlayedReqIds([])
await callPlotUpdateDebounced('from watch atlChartFilterStore.showPhotonCloud FALSE')
}
Expand Down Expand Up @@ -951,6 +966,31 @@ watch(
</div>
</div>
</div>
<!-- ATL08 Dialog -->
<Dialog
v-model:visible="showAtl08Dialog"
header="Photon Cloud Options"
:modal="true"
:closable="false"
:style="{ width: '30rem' }"
>
<div class="atl08-dialog-content">
<p>Would you like to include ATL08 classification in the photon cloud overlay?</p>
<div class="atl08-dialog-checkbox">
<Checkbox
v-model="atlChartFilterStore.includeAtl08"
binary
inputId="dialogAtl08Checkbox"
size="small"
/>
<label for="dialogAtl08Checkbox" class="sr-checkbox-label">Include atl08</label>
</div>
</div>
<template #footer>
<Button label="Cancel" text @click="handleAtl08DialogCancel" />
<Button label="Continue" @click="handleAtl08DialogConfirm" />
</template>
</Dialog>
</div>
</template>

Expand Down Expand Up @@ -1147,9 +1187,22 @@ watch(
margin-left: 0rem;
}

.atl08-dialog-content {
display: flex;
flex-direction: column;
gap: 1rem;
}

.atl08-dialog-checkbox {
display: flex;
flex-direction: row;
align-items: center;
gap: 0.5rem;
}

.sr-checkbox-label {
margin-left: 0.5rem;
font-size: 1rem; /* or match your app's font size */
font-size: 0.875rem;
cursor: pointer;
}

Expand Down
1 change: 1 addition & 0 deletions web-client/src/stores/atlChartFilterStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const useAtlChartFilterStore = defineStore('atlChartFilter', {
isWarning: true as boolean,
showMessage: false as boolean,
showPhotonCloud: false as boolean,
includeAtl08: false as boolean, // Include ATL08 classification in photon cloud
xZoomStart: 0 as number,
xZoomEnd: 100 as number,
yZoomStart: 0 as number,
Expand Down
23 changes: 15 additions & 8 deletions web-client/src/stores/reqParamsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSlideruleDefaults } from '@/stores/defaultsStore'
import { useGeoJsonStore } from './geoJsonStore'
import { useChartStore } from '@/stores/chartStore'
import { useRasterParamsStore } from '@/stores/rasterParamsStore'
import { useAtlChartFilterStore } from '@/stores/atlChartFilterStore'
import { createLogger } from '@/utils/logger'

const logger = createLogger('ReqParamsStore')
Expand Down Expand Up @@ -285,14 +286,20 @@ const createReqParamsStore = (id: string) =>
this.isAtl24PhotonOverlay = true
} else {
this.enableAtl24Classification = false
this.enableAtl08Classification = true
this.atl08LandType = [
'atl08_noise',
'atl08_ground',
'atl08_canopy',
'atl08_top_of_canopy',
'atl08_unclassified'
]
// Check the includeAtl08 checkbox state
const includeAtl08 = useAtlChartFilterStore().includeAtl08
this.enableAtl08Classification = includeAtl08
if (includeAtl08) {
this.atl08LandType = [
'atl08_noise',
'atl08_ground',
'atl08_canopy',
'atl08_top_of_canopy',
'atl08_unclassified'
]
} else {
this.atl08LandType = []
}
this.useDatum = false
this.isAtl24PhotonOverlay = false
}
Expand Down