Skip to content

Commit

Permalink
Merge pull request #104 from LCOGT/feature/datasession_analysis
Browse files Browse the repository at this point in the history
Feature/datasession analysis
  • Loading branch information
jnation3406 authored Sep 16, 2024
2 parents 02672d9 + 1a31085 commit ac62e4b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
27 changes: 27 additions & 0 deletions src/components/Global/ImageGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ref, watch } from 'vue'
import { useThumbnailsStore } from '@/stores/thumbnails'
import { useConfigurationStore } from '@/stores/configuration'
import FilterBadge from './FilterBadge.vue'
import ImageAnalyzer from '../Project/ImageAnalysis/ImageAnalyzer.vue'
const props = defineProps({
images: {
Expand All @@ -27,7 +28,28 @@ let imageDetails = ref({})
const configurationStore = useConfigurationStore()
const thumbnailsStore = useThumbnailsStore()
const emit = defineEmits(['selectImage'])
const showAnalysisDialog = ref(false)
const currLargeImage = ref({})
const launchAnalysis = (image) => {
const url = image.large_url || image.largeThumbUrl || ''
if (image.basename) {
if (!image.largeCachedUrl) {
image.largeCachedUrl = ref('')
if (url || image.source == 'archive') {
thumbnailsStore.cacheImage('large', configurationStore.archiveType, url, image.basename).then((cachedUrl) => {
image.largeCachedUrl = cachedUrl
currLargeImage.value = image
showAnalysisDialog.value = true
})
}
}
else {
currLargeImage.value = image
showAnalysisDialog.value = true
}
}
}
const isSelected = (index) => {
return props.selectedImages.includes(index)
Expand Down Expand Up @@ -63,6 +85,7 @@ watch(() => props.images, () => {
:class="{ 'selected-image': isSelected(index) }"
aspect-ratio="1"
@click="emit('selectImage', index)"
@dblclick="launchAnalysis(image)"
>
<filter-badge
v-if="image.filter"
Expand All @@ -75,6 +98,10 @@ watch(() => props.images, () => {
</v-img>
</v-col>
</v-row>
<image-analyzer
v-model="showAnalysisDialog"
:image="currLargeImage"
/>
</template>

<style scoped>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Project/ImageAnalysis/ImageAnalyzer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function handleAnalysisOutput(response, action, action_callback){
<v-toolbar
class="analysis-toolbar"
density="comfortable"
:title="image.target_name"
:title="image.target_name || 'N/A'"
>
<image-download-menu
:image="image"
Expand All @@ -105,8 +105,8 @@ function handleAnalysisOutput(response, action, action_callback){
<p>Instrument: {{ image.instrument_id }}</p>
<span>Filter:
<filter-badge
v-if="image.FILTER"
:filter="image.FILTER"
v-if="image.FILTER || image.filter"
:filter="image.FILTER || image.filter"
/>
</span>
</v-sheet>
Expand Down

0 comments on commit ac62e4b

Please sign in to comment.