Skip to content

Commit aa38619

Browse files
authored
Max N Count Support (#1493)
* initial functionality * timeline track vs detection, filter types by frame, filter tracks by frame, gotoMaxFrame for types * add lock camera seetings * collapsing panels * localStorage test fixes * remove mocklocalStorage * updating documentation
1 parent 3db45f0 commit aa38619

33 files changed

+929
-209
lines changed

client/dive-common/components/ControlsContainer.vue

Lines changed: 120 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script lang="ts">
22
import {
33
defineComponent, ref, PropType, computed, watch,
4+
Ref,
5+
reactive,
46
} from 'vue';
57
import type { DatasetType } from 'dive-common/apispec';
68
import FileNameTimeDisplay from 'vue-media-annotator/components/controls/FileNameTimeDisplay.vue';
@@ -11,6 +13,7 @@ import {
1113
LineChart,
1214
Timeline,
1315
} from 'vue-media-annotator/components';
16+
import { clientSettings } from 'dive-common/store/settings';
1417
import { useAttributesFilters, useCameraStore, useSelectedCamera } from '../../src/provides';
1518
1619
export default defineComponent({
@@ -49,6 +52,13 @@ export default defineComponent({
4952
const cameraStore = useCameraStore();
5053
const multiCam = ref(cameraStore.camMap.value.size > 1);
5154
const selectedCamera = useSelectedCamera();
55+
const activeCountSettings = ref(false);
56+
const countView: Ref<'tracks' | 'detections'> = ref(clientSettings.timelineCountSettings.defaultView);
57+
const help = reactive({
58+
countType: 'Swap between counting tracks vs counting detections',
59+
showTotal: 'In the graph show a line for the total counts',
60+
});
61+
5262
const hasGroups = computed(
5363
() => !!cameraStore.camMap.value.get(selectedCamera.value)?.groupStore.sorted.value.length,
5464
);
@@ -84,6 +94,16 @@ export default defineComponent({
8494
toggleView('Events');
8595
}
8696
});
97+
98+
const toggleCountView = () => {
99+
if (countView.value === 'detections') {
100+
countView.value = 'tracks';
101+
} else {
102+
countView.value = 'detections';
103+
}
104+
clientSettings.timelineCountSettings.defaultView = countView.value;
105+
};
106+
87107
const {
88108
maxFrame, frame, seek, volume, setVolume, setSpeed, speed,
89109
} = injectAggregateController().value;
@@ -102,6 +122,11 @@ export default defineComponent({
102122
hasGroups,
103123
attributeData,
104124
timelineEnabled,
125+
activeCountSettings,
126+
clientSettings,
127+
countView,
128+
help,
129+
toggleCountView,
105130
};
106131
},
107132
});
@@ -130,17 +155,102 @@ export default defineComponent({
130155
</template>
131156
<span>Collapse/Expand Timeline</span>
132157
</v-tooltip>
133-
<v-btn
134-
class="ml-1"
135-
:class="{ 'timeline-button': currentView !== 'Detections' || collapsed }"
136-
depressed
137-
:outlined="currentView === 'Detections' && !collapsed"
138-
x-small
139-
tab-index="-1"
140-
@click="toggleView('Detections')"
158+
159+
<v-menu
160+
v-model="activeCountSettings"
161+
:nudge-top="28"
162+
top
163+
:close-on-content-click="false"
164+
open-on-hover
165+
open-delay="750"
166+
close-delay="500"
141167
>
142-
Detections
143-
</v-btn>
168+
<template #activator="{ on, attrs }">
169+
<v-btn
170+
class="ml-1"
171+
:class="{ 'timeline-button': currentView !== 'Detections' || collapsed }"
172+
depressed
173+
:outlined="currentView === 'Detections' && !collapsed"
174+
x-small
175+
tab-index="-1"
176+
v-bind="attrs"
177+
v-on="on"
178+
@click="toggleView('Detections')"
179+
>
180+
<span class="mr-1"># of</span>{{ countView }}
181+
</v-btn>
182+
</template>
183+
<v-card
184+
outlined
185+
class="pa-2 pr-4"
186+
color="blue-grey darken-3"
187+
style="overflow-y: none"
188+
>
189+
<v-card-title>
190+
Count Settings
191+
</v-card-title>
192+
<v-card-text>
193+
<v-row>
194+
<v-col class="py-1">
195+
<v-btn small @click="toggleCountView()">
196+
Swap to {{ countView === 'detections' ? 'Tracks' : 'Detections' }}
197+
</v-btn>
198+
</v-col>
199+
<v-col
200+
cols="2"
201+
class="py-1"
202+
align="right"
203+
>
204+
<v-tooltip
205+
open-delay="200"
206+
bottom
207+
>
208+
<template #activator="{ on }">
209+
<v-icon
210+
small
211+
v-on="on"
212+
>
213+
mdi-help
214+
</v-icon>
215+
</template>
216+
<span>{{ help.countType }}</span>
217+
</v-tooltip>
218+
</v-col>
219+
</v-row>
220+
<v-row>
221+
<v-col class="py-1">
222+
<v-switch
223+
v-model="clientSettings.timelineCountSettings.totalCount"
224+
label="Show Total Count"
225+
class="my-0 ml-1 pt-0"
226+
dense
227+
hide-details
228+
/>
229+
</v-col>
230+
<v-col
231+
cols="2"
232+
class="py-1"
233+
align="right"
234+
>
235+
<v-tooltip
236+
open-delay="200"
237+
bottom
238+
>
239+
<template #activator="{ on }">
240+
<v-icon
241+
small
242+
v-on="on"
243+
>
244+
mdi-help
245+
</v-icon>
246+
</template>
247+
<span>{{ help.showTotal }}</span>
248+
</v-tooltip>
249+
</v-col>
250+
</v-row>
251+
</v-card-text>
252+
</v-card>
253+
</v-menu>
144254
<v-btn
145255
class="ml-1"
146256
:class="{ 'timeline-button': currentView !== 'Events' || collapsed }"

client/dive-common/components/TrackSettingsPanel.vue

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export default defineComponent({
3030
interpolate: 'Whether new tracks should have interpolation enabled by default',
3131
continuous: 'Immediately stay in detection creation mode after creating a new track. Hit Esc to exit.',
3232
prompt: 'Prompt user before deleting a track?',
33+
filterTracksByFrame: 'Filter the track list by those with detections in the current frame',
34+
autoZoom: 'Automatically zoom to the track when selected',
3335
});
3436
const modes = ref(['Track', 'Detection']);
3537
// Add unknown as the default type to the typeList
@@ -281,6 +283,45 @@ export default defineComponent({
281283
</v-tooltip>
282284
</v-col>
283285
</v-row>
286+
<v-divider class="my-2" />
287+
<div class="subheading">
288+
Track List Settings
289+
</div>
290+
<v-row
291+
align="end"
292+
dense
293+
>
294+
<v-col class="py-1">
295+
<v-switch
296+
v-model="clientSettings.trackSettings.trackListSettings.filterDetectionsByFrame"
297+
class="my-0 ml-1 pt-0"
298+
dense
299+
label="Filter Detections By Frame"
300+
hide-details
301+
/>
302+
</v-col>
303+
<v-col
304+
cols="2"
305+
class="py-1"
306+
align="right"
307+
>
308+
<v-tooltip
309+
open-delay="200"
310+
max-width="200"
311+
bottom
312+
>
313+
<template #activator="{ on }">
314+
<v-icon
315+
small
316+
v-on="on"
317+
>
318+
mdi-help
319+
</v-icon>
320+
</template>
321+
<span>{{ help.filterTracksByFrame }}</span>
322+
</v-tooltip>
323+
</v-col>
324+
</v-row>
284325
</v-card>
285326
</div>
286327
</template>

0 commit comments

Comments
 (0)