Skip to content

Commit 21959da

Browse files
authored
create track full frame action (#232)
* create track full frame action * opacity version of endpoint and path key added to metadata * transfer configuration * version increment
1 parent aea839d commit 21959da

17 files changed

Lines changed: 752 additions & 52 deletions

File tree

.github/workflows/workflow-dive-dsa-slicer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
name: Build and push web
2626
uses: docker/build-push-action@v3
2727
with:
28-
context: ./dive-dsa-slicer
28+
context: ./dive-dsa-slicer/example-docker-containers
2929
file: ./dive-dsa-slicer/example-docker-containers/Dockerfile
3030
tags: ghcr.io/digitalslidearchive/dive-dsa/dive-dsa-slicer-examples:latest
3131
push: true

client/dive-common/components/ActionEditors/ActionEditor.vue

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ import {
44
defineComponent, ref, Ref, PropType,
55
} from 'vue';
66
import {
7-
DIVEAction, TrackSelectAction,
7+
CreateTrackAction, DIVEAction, TrackSelectAction, CreateFullFrameTrackAction,
88
} from 'dive-common/use/useActions';
99
import {
1010
useAttributes, useTrackStyleManager,
1111
} from 'vue-media-annotator/provides';
1212
import TrackFilter from './TrackFilter.vue';
13+
import CreateTrackActionEditor from './CreateTrackActionEditor.vue';
14+
import CreateFullFrameTrackActionEditor from './CreateFullFrameTrackActionEditor.vue';
1315
1416
export default defineComponent({
1517
name: 'ActionEditorSettings',
1618
components: {
1719
TrackFilter,
20+
CreateTrackActionEditor,
21+
CreateFullFrameTrackActionEditor,
1822
},
1923
props: {
2024
value: {
@@ -26,13 +30,13 @@ export default defineComponent({
2630
const typeStylingRef = useTrackStyleManager().typeStyling;
2731
const attributesList = useAttributes();
2832
const editingAction: Ref<DIVEAction> = ref(props.value);
29-
const addEditActionType: Ref<'TrackSelection' | 'GoToFrame'> = ref(props.value.action.type);
33+
const addEditActionType: Ref<'TrackSelection' | 'GoToFrame' | 'CreateTrackAction' | 'CreateFullFrameTrackAction'> = ref(props.value.action.type);
3034
31-
const saveAction = (action: TrackSelectAction, type: DIVEAction['action']['type']) => {
35+
const saveAction = (action: TrackSelectAction | CreateTrackAction | CreateFullFrameTrackAction, type: DIVEAction['action']['type']) => {
3236
let diveAction: DIVEAction = {
3337
action,
3438
};
35-
if (type === 'GoToFrame' && action) {
39+
if (type === 'GoToFrame' && action.type === 'TrackSelection') {
3640
diveAction = {
3741
action: {
3842
track: action,
@@ -62,6 +66,27 @@ export default defineComponent({
6266
},
6367
};
6468
}
69+
if (addEditActionType.value === 'CreateTrackAction') {
70+
editingAction.value = {
71+
action: {
72+
type: 'CreateTrackAction',
73+
geometryType: 'rectangle',
74+
editableType: true,
75+
selectTrackAfter: false,
76+
},
77+
};
78+
}
79+
if (addEditActionType.value === 'CreateFullFrameTrackAction') {
80+
editingAction.value = {
81+
action: {
82+
type: 'CreateFullFrameTrackAction',
83+
geometryType: 'rectangle',
84+
trackType: 'unknown',
85+
useExisting: true,
86+
selectTrackAfter: true,
87+
},
88+
};
89+
}
6590
};
6691
6792
const getAttributeColor = (item: string) => {
@@ -103,10 +128,10 @@ export default defineComponent({
103128
<v-card-text>
104129
<div>
105130
<h2>Create/Edit Action</h2>
106-
<v-row>
131+
<v-row class="pt-4">
107132
<v-select
108133
v-model="addEditActionType"
109-
:items="['GoToFrame', 'TrackSelection']"
134+
:items="['GoToFrame', 'TrackSelection', 'CreateTrackAction', 'CreateFullFrameTrackAction']"
110135
label="Action Type"
111136
@change="changeType"
112137
/>
@@ -127,6 +152,20 @@ export default defineComponent({
127152
@cancel="$emit('cancel')"
128153
/>
129154
</v-row>
155+
<v-row v-else-if="addEditActionType === 'CreateTrackAction' && editingAction.action.type === 'CreateTrackAction'">
156+
<CreateTrackActionEditor
157+
:action="editingAction.action"
158+
@update:action="saveAction($event, addEditActionType)"
159+
@cancel="$emit('cancel')"
160+
/>
161+
</v-row>
162+
<v-row v-else-if="addEditActionType === 'CreateFullFrameTrackAction' && editingAction.action.type === 'CreateFullFrameTrackAction'">
163+
<CreateFullFrameTrackActionEditor
164+
:action="editingAction.action"
165+
@update:action="saveAction($event, addEditActionType)"
166+
@cancel="$emit('cancel')"
167+
/>
168+
</v-row>
130169
</div>
131170
</v-card-text>
132171
</v-card>

client/dive-common/components/ActionEditors/ActionEditorSettings.vue

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default defineComponent({
4444
const typeStylingRef = useTrackStyleManager().typeStyling;
4545
const attributesList = useAttributes();
4646
const editingAction: Ref<null | DIVEAction> = ref(null);
47-
const addEditActionType: Ref<'TrackSelection' | 'GoToFrame'> = ref('TrackSelection');
47+
const addEditActionType: Ref<'TrackSelection' | 'GoToFrame' | 'CreateTrackAction' | 'CreateFullFrameTrackAction'> = ref('TrackSelection');
4848
const editAction = (index?: number) => {
4949
addEditAction.value = true;
5050
if (index !== undefined) {
@@ -97,6 +97,27 @@ export default defineComponent({
9797
},
9898
};
9999
}
100+
if (addEditActionType.value === 'CreateTrackAction') {
101+
editingAction.value = {
102+
action: {
103+
type: 'CreateTrackAction',
104+
geometryType: 'rectangle',
105+
editableType: true,
106+
selectTrackAfter: true,
107+
},
108+
};
109+
}
110+
if (addEditActionType.value === 'CreateFullFrameTrackAction') {
111+
editingAction.value = {
112+
action: {
113+
type: 'CreateFullFrameTrackAction',
114+
trackType: 'unknown',
115+
geometryType: 'rectangle',
116+
useExisting: true,
117+
selectTrackAfter: true,
118+
},
119+
};
120+
}
100121
};
101122
102123
const removeAction = (index: number) => {
@@ -172,9 +193,11 @@ export default defineComponent({
172193
:key="`ActionItem_${index}`"
173194
dense
174195
style="border: 1px gray solid; margin:2px"
196+
align="center"
197+
justify="center"
175198
>
176-
<v-col cols="2">
177-
{{ item.action.type }}
199+
<v-col cols="3">
200+
<span style="font-size: 10px">{{ item.action.type }}</span>
178201
</v-col>
179202
<v-col v-if="item.action.type === 'TrackSelection'">
180203
<v-row
@@ -191,6 +214,26 @@ export default defineComponent({
191214
{{ trackType }}
192215
</v-row>
193216
</v-col>
217+
<v-col v-if="item.action.type === 'CreateFullFrameTrackAction'">
218+
<v-row dense>
219+
<span class="mr-2">{{ item.action.trackType }}:</span>
220+
<div
221+
class="type-color-box"
222+
:style="{
223+
backgroundColor: typeStylingRef.color(item.action.trackType),
224+
}"
225+
/>
226+
</v-row>
227+
<v-row dense>
228+
<span>Geometry: {{ item.action.geometryType }}</span>
229+
</v-row>
230+
</v-col>
231+
<v-col v-if="item.action.type === 'CreateFullFrameTrackAction'">
232+
<span class="mr-1"> Use Existing: </span>
233+
<v-icon> {{ item.action.useExisting ? 'mdi-checkbox-outline' : 'mdi-checkobx-blank-outline' }}</v-icon>
234+
<span class="ml-3 mr-1"> Select Track After: </span>
235+
<v-icon> {{ item.action.selectTrackAfter ? 'mdi-checkbox-outline' : 'mdi-checkobx-blank-outline' }}</v-icon>
236+
</v-col>
194237
<v-col v-if="item.action.type === 'GoToFrame' && item.action.track">
195238
<v-row
196239
v-for="trackType in item.action.track.typeFilter"
@@ -221,6 +264,7 @@ export default defineComponent({
221264
{{ data.name }}: {{ data.opVal }}
222265
</v-row>
223266
</v-col>
267+
<v-spacer />
224268
<v-col cols="1">
225269
<v-icon @click="editAction(index)">
226270
mdi-pencil

client/dive-common/components/ActionEditors/ActionShortcuts.vue

Lines changed: 88 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default defineComponent({
4949
const typeStylingRef = useTrackStyleManager().typeStyling;
5050
const attributesList = useAttributes();
5151
const editingShortcut: Ref<null | DIVEActionShortcut> = ref(null);
52-
const addEditActionType: Ref<'TrackSelection' | 'GoToFrame'> = ref('TrackSelection');
52+
const addEditActionType: Ref<'TrackSelection' | 'GoToFrame' | 'CreateTrackAction' | 'CreateFullFrameTrackAction'> = ref('TrackSelection');
5353
const actionList: Ref<DIVEAction[]> = ref([]);
5454
const updateActionList = () => {
5555
actionList.value = editingShortcut.value?.actions || [];
@@ -160,10 +160,9 @@ export default defineComponent({
160160
161161
const saveShortcutDisabled = computed(() => {
162162
if (editingShortcut.value) {
163-
const { key } = editingShortcut.value.shortcut;
164163
const { description } = editingShortcut.value;
165164
const actionLength = editingShortcut.value.actions.length;
166-
return !(key && description && actionLength);
165+
return !(description && actionLength);
167166
}
168167
return false;
169168
});
@@ -216,18 +215,58 @@ export default defineComponent({
216215
<v-card-title>Action Shortcut Editor</v-card-title>
217216
<v-card-text>
218217
<div v-if="!addEditShortcut">
219-
<v-row dnese>
218+
<v-row dense class="pb-3">
220219
<v-btn @click="editShortcut()">
221220
Add Shortcut
222221
</v-btn>
223222
</v-row>
223+
<v-row dense style="border-bottom: 1px solid gray;">
224+
<v-col>
225+
<span>
226+
<v-icon class="mr-2">mdi-keyboard-outline</v-icon><b>Keyboard</b>
227+
</span>
228+
</v-col>
229+
<v-col>
230+
<span>
231+
<v-icon class="mr-2">mdi-button-cursor</v-icon><b>Button</b>
232+
</span>
233+
</v-col>
234+
<v-col>
235+
<span>
236+
<b>Description</b>
237+
</span>
238+
</v-col>
239+
<v-col>
240+
<span>
241+
<b>Actions</b>
242+
</span>
243+
</v-col>
244+
<v-col cols="1">
245+
<span>
246+
<b>Edit</b>
247+
</span>
248+
</v-col>
249+
</v-row>
250+
224251
<v-row
225252
v-for="item, index in shortcutList"
226253
:key="`shortcut_${item.shortcut.key}_${index}`"
227254
dense
255+
align="center"
256+
justify="center"
228257
>
229258
<v-col>
230-
{{ item.shortcut.key }}{{ item.shortcut.modifiers && item.shortcut.modifiers.length ? `+${item.shortcut.modifiers.join('+')}` : '' }}
259+
<span v-if="item.shortcut.key">
260+
<v-icon class="mr-2">mdi-keyboard-outline</v-icon>{{ item.shortcut.key }}{{ item.shortcut.modifiers && item.shortcut.modifiers.length ? `+${item.shortcut.modifiers.join('+')}` : '' }}
261+
</span>
262+
</v-col>
263+
<v-col>
264+
<span v-if="item.button">
265+
<v-icon class="mr-2">mdi-button-cursor</v-icon>
266+
<v-icon v-if="item.button.iconPrepend">{{ item.button.iconPrepend }}</v-icon>
267+
<span v-if="item.button.buttonText">{{ item.button.buttonText }}</span>
268+
<v-icon v-if="item.button.iconAppend">{{ item.button.iconAppend }}</v-icon>
269+
</span>
231270
</v-col>
232271
<v-col>
233272
{{ item.description }}
@@ -272,7 +311,7 @@ export default defineComponent({
272311
dense
273312
style="border: 1px gray solid; margin:2px"
274313
>
275-
<v-col cols="2">
314+
<v-col cols="3">
276315
{{ item.action.type }}
277316
</v-col>
278317
<v-col v-if="item.action.type === 'TrackSelection'">
@@ -320,6 +359,33 @@ export default defineComponent({
320359
{{ data.name }}: {{ data.opVal }}
321360
</v-row>
322361
</v-col>
362+
<v-col v-if="item.action.type === 'CreateTrackAction'">
363+
<div v-if="item.action.editableType">
364+
<b class="mr-2">Editable Type:</b><v-icon v-if="item.action.editableType" color="success">
365+
mdi-check
366+
</v-icon><v-icon v-else color="error">
367+
mdi-close
368+
</v-icon>
369+
</div>
370+
<div v-if="item.action.editableTypeList?.length">
371+
<b class="mr-2">Types:</b><span>{{ item.action.editableTypeList.join(', ') }}</span>
372+
</div>
373+
<div v-if="item.action.trackType">
374+
<b class="mr-2">Type:</b><span>{{ item.action.trackType }}</span>
375+
</div>
376+
<div v-if="item.action.geometryType">
377+
<b class="mr-2">Geometry:</b><span>{{ item.action.geometryType }}</span>
378+
</div>
379+
380+
<div>
381+
<b class="mr-2">Select Track After:</b><v-icon v-if="item.action.selectTrackAfter" color="success">
382+
mdi-check
383+
</v-icon><v-icon v-else color="error">
384+
mdi-close
385+
</v-icon>
386+
</div>
387+
</v-col>
388+
<v-spacer />
323389
<v-col cols="1">
324390
<v-icon @click="editAction(index)">
325391
mdi-pencil
@@ -380,18 +446,22 @@ export default defineComponent({
380446
</v-row>
381447
</v-card-text>
382448
<v-card-actions>
383-
<v-btn
384-
x-small
385-
@click="generalDialog = false; editingShortcut = null; addEditShortcut = false"
386-
>
387-
Cancel
388-
</v-btn>
389-
<v-btn
390-
color="primary"
391-
@click="save()"
392-
>
393-
Save
394-
</v-btn>
449+
<v-row dense>
450+
<v-spacer />
451+
<v-btn
452+
class="mx-2"
453+
@click="generalDialog = false; editingShortcut = null; addEditShortcut = false"
454+
>
455+
Cancel
456+
</v-btn>
457+
<v-btn
458+
class="mx-2"
459+
color="primary"
460+
@click="save()"
461+
>
462+
Save
463+
</v-btn>
464+
</v-row>
395465
</v-card-actions>
396466
</v-card>
397467
</v-dialog>

0 commit comments

Comments
 (0)