Skip to content

Commit e40c8fb

Browse files
authored
Calibration card and PV input styling (#1695)
Images are before and after comparison. Does the following: - Fixes several styling issues with pv-* input elements, including top padding, vertical alignment, and allocated input width ![image](https://github.com/user-attachments/assets/70d37e65-e0cd-4c71-8ea1-941ec2175850) ![image](https://github.com/user-attachments/assets/031d008d-3cce-4ed2-bc88-5fbecf20c94f) - Conforms the calibration details modal to overall styling and spacing standards ![image](https://github.com/user-attachments/assets/18281551-f924-4e12-9ad4-d2ec470dbc70) ![image](https://github.com/user-attachments/assets/db772325-7650-467d-8521-252c7d38601f) (left the blank table there on empty calibrations to give the user a sense of what they might see if they don't have any)
1 parent 27684ee commit e40c8fb

File tree

14 files changed

+140
-106
lines changed

14 files changed

+140
-106
lines changed

photon-client/src/components/cameras/CameraCalibrationCard.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
218218
<v-card class="mb-3" color="primary" dark>
219219
<v-card-title class="pa-6 pb-3">Camera Calibration</v-card-title>
220220
<v-card-text v-show="!isCalibrating">
221-
<v-card-subtitle class="pt-3 pl-2 pb-3">Current Calibration</v-card-subtitle>
221+
<v-card-subtitle class="pt-3 pl-2 pb-4 white--text">Current Calibration</v-card-subtitle>
222222
<v-simple-table fixed-header height="100%" dense>
223223
<thead>
224224
<tr>
@@ -252,7 +252,9 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
252252
</v-simple-table>
253253
</v-card-text>
254254
<v-card-text v-if="useCameraSettingsStore().isConnected" class="d-flex flex-column pa-6 pt-0">
255-
<v-card-subtitle v-show="!isCalibrating" class="pl-0">Configure New Calibration</v-card-subtitle>
255+
<v-card-subtitle v-show="!isCalibrating" class="pl-0 pb-3 pt-3 white--text"
256+
>Configure New Calibration</v-card-subtitle
257+
>
256258
<v-form ref="form" v-model="settingsValid">
257259
<!-- TODO: the default videoFormatIndex is 0, but the list of unique video mode indexes might not include 0. getUniqueVideoResolutionStrings indexing is also different from the normal video mode indexing -->
258260
<pv-select

photon-client/src/components/cameras/CameraCalibrationInfoCard.vue

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,13 @@ const calibrationImageURL = (index: number) =>
9090
</script>
9191

9292
<template>
93-
<v-card color="primary" class="pa-6" dark>
94-
<v-row>
95-
<v-col cols="12" md="5">
96-
<v-card-title class="pl-0 ml-0"
97-
><span class="text-no-wrap" style="white-space: pre !important">Calibration Details: </span
98-
><span class="text-no-wrap"
99-
>{{ useCameraSettingsStore().currentCameraName }}@{{ getResolutionString(videoFormat.resolution) }}</span
100-
></v-card-title
101-
>
93+
<v-card color="primary" dark>
94+
<div class="d-flex flex-wrap pr-md-3">
95+
<v-col cols="12" md="6">
96+
<v-card-title class="pl-3 pb-0 pb-md-4"> Calibration Details </v-card-title>
10297
</v-col>
103-
<v-col>
104-
<v-btn color="secondary" class="mt-4" style="width: 100%" @click="openUploadPhotonCalibJsonPrompt">
98+
<v-col cols="6" md="3" class="d-flex align-center pt-0 pt-md-3 pl-6 pl-md-3">
99+
<v-btn color="secondary" style="width: 100%" @click="openUploadPhotonCalibJsonPrompt">
105100
<v-icon left> mdi-import</v-icon>
106101
<span>Import</span>
107102
</v-btn>
@@ -113,10 +108,9 @@ const calibrationImageURL = (index: number) =>
113108
@change="importCalibration"
114109
/>
115110
</v-col>
116-
<v-col>
111+
<v-col cols="6" md="3" class="d-flex align-center pt-0 pt-md-3 pr-6 pr-md-3">
117112
<v-btn
118113
color="secondary"
119-
class="mt-4"
120114
:disabled="!currentCalibrationCoeffs"
121115
style="width: 100%"
122116
@click="openExportCalibrationPrompt"
@@ -131,10 +125,17 @@ const calibrationImageURL = (index: number) =>
131125
target="_blank"
132126
/>
133127
</v-col>
134-
</v-row>
135-
<v-row v-if="currentCalibrationCoeffs" class="pt-2">
136-
<v-card-subtitle>Calibration Details</v-card-subtitle>
137-
<v-simple-table dense style="width: 100%" class="pl-2 pr-2">
128+
</div>
129+
<v-card-title class="pt-0 pb-3"
130+
>{{ useCameraSettingsStore().currentCameraName }}@{{ getResolutionString(videoFormat.resolution) }}</v-card-title
131+
>
132+
<v-card-text v-if="!currentCalibrationCoeffs">
133+
<v-banner rounded color="secondary" text-color="white" class="mt-3" icon="mdi-alert-circle-outline">
134+
The selected video format has not been calibrated.
135+
</v-banner>
136+
</v-card-text>
137+
<v-card-text>
138+
<v-simple-table dense style="width: 100%">
138139
<template #default>
139140
<thead>
140141
<tr>
@@ -238,15 +239,16 @@ const calibrationImageURL = (index: number) =>
238239
</tbody>
239240
</template>
240241
</v-simple-table>
241-
<hr style="width: 100%" class="ma-6" />
242-
<v-card-subtitle>Per Observation Details</v-card-subtitle>
242+
</v-card-text>
243+
<v-card-title v-if="currentCalibrationCoeffs" class="pt-0">Individual Observations</v-card-title>
244+
<v-card-text v-if="currentCalibrationCoeffs">
243245
<v-data-table
244246
dense
245247
style="width: 100%"
246-
class="pl-2 pr-2"
247248
:headers="[
248249
{ text: 'Observation Id', value: 'index' },
249-
{ text: 'Mean Reprojection Error', value: 'mean' }
250+
{ text: 'Mean Reprojection Error', value: 'mean' },
251+
{ text: '', value: 'data-table-expand' }
250252
]"
251253
:items="getObservationDetails()"
252254
item-key="index"
@@ -261,10 +263,7 @@ const calibrationImageURL = (index: number) =>
261263
</td>
262264
</template>
263265
</v-data-table>
264-
</v-row>
265-
<v-row v-else class="pt-2 mb-0 pb-0">
266-
The selected video format doesn't have any additional information as it has yet to be calibrated.
267-
</v-row>
266+
</v-card-text>
268267
</v-card>
269268
</template>
270269

@@ -275,7 +274,6 @@ const calibrationImageURL = (index: number) =>
275274
.snapshot-preview {
276275
max-width: 55%;
277276
}
278-
279277
@media only screen and (max-width: 512px) {
280278
.snapshot-preview {
281279
max-width: 100%;

photon-client/src/components/cameras/CamerasView.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ th {
134134
text-align: center;
135135
}
136136
137+
.v-input--switch {
138+
margin-top: 0;
139+
}
140+
137141
.stream-container {
138142
display: flex;
139143
justify-content: center;

photon-client/src/components/common/pv-input.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,8 @@ const handleKeydown = ({ key }) => {
6969
</v-col>
7070
</div>
7171
</template>
72+
<style scoped>
73+
.v-text-field {
74+
margin-top: 0px;
75+
}
76+
</style>

photon-client/src/components/common/pv-radio.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@ const localValue = computed({
4747
</v-col>
4848
</div>
4949
</template>
50+
<style scoped>
51+
.v-input--radio-group {
52+
padding-top: 0;
53+
margin-top: 0;
54+
}
55+
</style>

photon-client/src/components/common/pv-select.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ const items = computed<SelectItem[]>(() => {
6969
</v-col>
7070
</div>
7171
</template>
72-
<style>
72+
<style scoped>
7373
.v-select {
7474
padding-top: 0px;
75+
margin-top: 0px;
7576
}
7677
</style>

photon-client/src/components/common/pv-slider.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ const localValue = computed({
4646

4747
<template>
4848
<div class="d-flex">
49-
<v-col :cols="12 - sliderCols - 1" class="pl-0 d-flex align-center">
49+
<v-col :cols="12 - sliderCols" class="pl-0 d-flex align-center">
5050
<tooltipped-label :tooltip="tooltip" :label="label" />
5151
</v-col>
52-
<v-col :cols="sliderCols">
52+
<v-col :cols="sliderCols - 1">
5353
<v-slider
5454
v-model="localValue"
5555
dark

photon-client/src/components/common/pv-switch.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const localValue = computed({
4141
</v-col>
4242
</div>
4343
</template>
44-
<style>
44+
<style scoped>
4545
.v-input--selection-controls {
4646
margin-top: 0px;
4747
}

photon-client/src/components/dashboard/CamerasCard.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ const performanceRecommendation = computed<string>(() => {
9090
</template>
9191

9292
<style scoped>
93+
.v-input--switch {
94+
margin-top: 0;
95+
}
9396
.stream-viewer-container {
9497
display: flex;
9598
justify-content: center;

photon-client/src/components/dashboard/tabs/ContoursTab.vue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ const interactiveCols = computed(() =>
6969
(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourTargetOrientation: value }, false)
7070
"
7171
/>
72+
<pv-select
73+
v-model="useCameraSettingsStore().currentPipelineSettings.contourSortMode"
74+
label="Target Sort"
75+
tooltip="Chooses the sorting mode used to determine the 'best' targets to provide to user code"
76+
:select-cols="interactiveCols"
77+
:items="['Largest', 'Smallest', 'Highest', 'Lowest', 'Rightmost', 'Leftmost', 'Centermost']"
78+
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourSortMode: value }, false)"
79+
/>
7280
<pv-range-slider
7381
v-model="contourArea"
7482
label="Area"
@@ -169,6 +177,7 @@ const interactiveCols = computed(() =>
169177
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourShape: value }, false)"
170178
/>
171179
<pv-slider
180+
v-if="currentPipelineSettings.contourShape >= 1"
172181
v-model="currentPipelineSettings.accuracyPercentage"
173182
:disabled="currentPipelineSettings.contourShape < 1"
174183
label="Shape Simplification"
@@ -179,6 +188,7 @@ const interactiveCols = computed(() =>
179188
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ accuracyPercentage: value }, false)"
180189
/>
181190
<pv-slider
191+
v-if="currentPipelineSettings.contourShape === 0"
182192
v-model="currentPipelineSettings.circleDetectThreshold"
183193
:disabled="currentPipelineSettings.contourShape !== 0"
184194
label="Circle match distance"
@@ -191,6 +201,7 @@ const interactiveCols = computed(() =>
191201
"
192202
/>
193203
<pv-slider
204+
v-if="currentPipelineSettings.contourShape === 0"
194205
v-model="currentPipelineSettings.maxCannyThresh"
195206
:disabled="currentPipelineSettings.contourShape !== 0"
196207
label="Max Canny Threshold"
@@ -200,6 +211,7 @@ const interactiveCols = computed(() =>
200211
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ maxCannyThresh: value }, false)"
201212
/>
202213
<pv-slider
214+
v-if="currentPipelineSettings.contourShape === 0"
203215
v-model="currentPipelineSettings.circleAccuracy"
204216
:disabled="currentPipelineSettings.contourShape !== 0"
205217
label="Circle Accuracy"
@@ -209,6 +221,7 @@ const interactiveCols = computed(() =>
209221
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ circleAccuracy: value }, false)"
210222
/>
211223
<pv-range-slider
224+
v-if="currentPipelineSettings.contourShape === 0"
212225
v-model="contourRadius"
213226
:disabled="currentPipelineSettings.contourShape !== 0"
214227
label="Radius"
@@ -218,13 +231,5 @@ const interactiveCols = computed(() =>
218231
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourRadius: value }, false)"
219232
/>
220233
</template>
221-
<pv-select
222-
v-model="useCameraSettingsStore().currentPipelineSettings.contourSortMode"
223-
label="Target Sort"
224-
tooltip="Chooses the sorting mode used to determine the 'best' targets to provide to user code"
225-
:select-cols="interactiveCols"
226-
:items="['Largest', 'Smallest', 'Highest', 'Lowest', 'Rightmost', 'Leftmost', 'Centermost']"
227-
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourSortMode: value }, false)"
228-
/>
229234
</div>
230235
</template>

0 commit comments

Comments
 (0)