Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
srimanachanta committed Oct 9, 2023
1 parent d042aa0 commit ab95d17
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
41 changes: 22 additions & 19 deletions photon-client/src/components/cameras/CamerasView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import PhotonCameraStream from "@/components/app/photon-camera-stream.vue";
import {computed, getCurrentInstance} from "vue";
import { computed } from "vue";
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
import { PipelineType } from "@/types/PipelineTypes";
import { useStateStore } from "@/stores/StateStore";
Expand Down Expand Up @@ -38,7 +38,6 @@ const fpsTooLow = computed<boolean>(() => {
return currFPS - targetFPS < -5 && currFPS !== 0 && !driverMode && gpuAccel && isReflective;
});
</script>

<template>
Expand All @@ -54,32 +53,36 @@ const fpsTooLow = computed<boolean>(() => {
</div>
<div>
<v-chip
label
:color="fpsTooLow ? 'error' : 'transparent'"
:text-color="fpsTooLow ? '#C7EA46' : '#ff4d00'"
style="font-size: 1rem; padding: 0; margin: 0"
label
:color="fpsTooLow ? 'error' : 'transparent'"
:text-color="fpsTooLow ? '#C7EA46' : '#ff4d00'"
style="font-size: 1rem; padding: 0; margin: 0"
>
<span class="pr-1">
{{ Math.round(useStateStore().pipelineResults?.fps || 0) }}&nbsp;FPS &ndash;
{{ Math.min(Math.round(useStateStore().pipelineResults?.latency || 0), 9999) }} ms latency
</span>
<span class="pr-1">
{{ Math.round(useStateStore().pipelineResults?.fps || 0) }}&nbsp;FPS &ndash;
{{ Math.min(Math.round(useStateStore().pipelineResults?.latency || 0), 9999) }} ms latency
</span>
</v-chip>
</div>
</div>
<div>
<v-switch
v-model="driverMode"
:disabled="useCameraSettingsStore().isCalibrationMode"
label="Driver Mode"
style="margin-left: auto"
color="accent"
class="pt-2"
v-model="driverMode"
:disabled="useCameraSettingsStore().isCalibrationMode"
label="Driver Mode"
style="margin-left: auto"
color="accent"
class="pt-2"
/>
</div>
</div>
<div class="pb-2" style="display: flex; gap: 16px; width: 100%; justify-content: center; flex-wrap: wrap">
<v-btn color="secondary" class="snapshot-btn" @click="useCameraSettingsStore().saveInputSnapshot()">Save Input Snapshot</v-btn>
<v-btn color="secondary" class="snapshot-btn" @click="useCameraSettingsStore().saveOutputSnapshot()">Save Output Snapshot</v-btn>
<v-btn color="secondary" class="snapshot-btn" @click="useCameraSettingsStore().saveInputSnapshot()"
>Save Input Snapshot</v-btn
>
<v-btn color="secondary" class="snapshot-btn" @click="useCameraSettingsStore().saveOutputSnapshot()"
>Save Output Snapshot</v-btn
>
</div>
</v-card-title>
<div class="stream-container pb-4">
Expand Down Expand Up @@ -162,7 +165,7 @@ th {
}
}

@media only screen and (max-width: 562px) {
@media only screen and (max-width: 562px) {
.snapshot-btn {
width: 100%;
}
Expand Down
15 changes: 8 additions & 7 deletions photon-client/src/components/dashboard/CamerasCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ const fpsTooLow = computed<boolean>(() => {

<template>
<v-card color="primary" height="100%" style="display: flex; flex-direction: column" dark>
<v-card-title
class="pb-0 mb-0 pl-4 pt-1"
style="display: flex; flex-direction: column; width: 100%"
>
<v-card-title class="pb-0 mb-0 pl-4 pt-1" style="display: flex; flex-direction: column; width: 100%">
<div style="min-height: 50px; justify-content: space-between; align-content: center; display: flex; width: 100%">
<div class="pt-2">
<span class="mr-4">Cameras</span>
Expand Down Expand Up @@ -70,9 +67,13 @@ const fpsTooLow = computed<boolean>(() => {
<v-switch v-model="driverMode" label="Driver Mode" style="margin-left: auto" color="accent" class="pt-2" />
</div>
</div>
<div class="pb-2" style="display: flex; gap: 16px; flex-wrap: wrap;">
<v-btn color="secondary" class="snapshot-btn" @click="useCameraSettingsStore().saveInputSnapshot()">Save Input Snapshot</v-btn>
<v-btn color="secondary" class="snapshot-btn" @click="useCameraSettingsStore().saveOutputSnapshot()">Save Output Snapshot</v-btn>
<div class="pb-2" style="display: flex; gap: 16px; flex-wrap: wrap">
<v-btn color="secondary" class="snapshot-btn" @click="useCameraSettingsStore().saveInputSnapshot()"
>Save Input Snapshot</v-btn
>
<v-btn color="secondary" class="snapshot-btn" @click="useCameraSettingsStore().saveOutputSnapshot()"
>Save Output Snapshot</v-btn
>
</div>
</v-card-title>
<v-divider style="border-color: white" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,17 +278,17 @@ public void onBinaryMessage(WsBinaryMessageContext context) {
break;
}
case SMT_SAVEOUTPUTSNAPSHOT:
{
var takeOutputSnapshotEvent =
new IncomingWebSocketEvent<>(
DataChangeDestination.DCD_ACTIVEMODULE,
"saveOutputSnapshot",
0,
cameraIndex,
context);
dcService.publishEvent(takeOutputSnapshotEvent);
break;
}
{
var takeOutputSnapshotEvent =
new IncomingWebSocketEvent<>(
DataChangeDestination.DCD_ACTIVEMODULE,
"saveOutputSnapshot",
0,
cameraIndex,
context);
dcService.publishEvent(takeOutputSnapshotEvent);
break;
}
case SMT_TAKECALIBRATIONSNAPSHOT:
{
var takeCalSnapshotEvent =
Expand Down

0 comments on commit ab95d17

Please sign in to comment.