22import { computed , ref } from " vue" ;
33import { useCameraSettingsStore } from " @/stores/settings/CameraSettingsStore" ;
44import { CalibrationBoardTypes , CalibrationTagFamilies , type VideoFormat } from " @/types/SettingTypes" ;
5- import JsPDF from " jspdf" ;
6- import { font as PromptRegular } from " @/assets/fonts/PromptRegular" ;
75import MonoLogo from " @/assets/images/logoMono.png" ;
86import CharucoImage from " @/assets/images/ChArUco_Marker8x8.png" ;
97import PvSlider from " @/components/common/pv-slider.vue" ;
@@ -15,6 +13,8 @@ import { WebsocketPipelineType } from "@/types/WebsocketDataTypes";
1513import { getResolutionString , resolutionsAreEqual } from " @/lib/PhotonUtils" ;
1614import CameraCalibrationInfoCard from " @/components/cameras/CameraCalibrationInfoCard.vue" ;
1715import { useSettingsStore } from " @/stores/settings/GeneralSettingsStore" ;
16+ const PromptRegular = import (" @/assets/fonts/PromptRegular" );
17+ const jspdf = import (" jspdf" );
1818
1919const settingsValid = ref (true );
2020
@@ -88,10 +88,12 @@ const tooManyPoints = computed(
8888 () => useStateStore ().calibrationData .imageCount * patternWidth .value * patternHeight .value > 700000
8989);
9090
91- const downloadCalibBoard = () => {
92- const doc = new JsPDF ({ unit: " in" , format: " letter" });
91+ const downloadCalibBoard = async () => {
92+ const { jsPDF } = await jspdf ;
93+ const { font } = await PromptRegular ;
94+ const doc = new jsPDF ({ unit: " in" , format: " letter" });
9395
94- doc .addFileToVFS (" Prompt-Regular.tff" , PromptRegular );
96+ doc .addFileToVFS (" Prompt-Regular.tff" , font );
9597 doc .addFont (" Prompt-Regular.tff" , " Prompt-Regular" , " normal" );
9698 doc .setFont (" Prompt-Regular" );
9799 doc .setFontSize (12 );
@@ -216,39 +218,41 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
216218 <div >
217219 <v-card class =" mb-3" color =" primary" dark >
218220 <v-card-title >Camera Calibration</v-card-title >
219- <v-card-text v-show =" !isCalibrating" >
220- <v-card-subtitle class =" pt-0 pl-0 pr-0 text-white" >Current Calibration</v-card-subtitle >
221- <v-table fixed-header height =" 100%" density =" compact" >
222- <thead >
223- <tr >
224- <th >Resolution</th >
225- <th >Mean Error</th >
226- <th >Horizontal FOV</th >
227- <th >Vertical FOV</th >
228- <th >Diagonal FOV</th >
229- <th >Info</th >
230- </tr >
231- </thead >
232- <tbody style =" cursor : pointer " >
233- <tr v-for =" (value, index) in getUniqueVideoFormatsByResolution()" :key =" index" >
234- <td >{{ getResolutionString(value.resolution) }}</td >
235- <td >
236- {{ value.mean !== undefined ? (isNaN(value.mean) ? "Unknown" : value.mean.toFixed(2) + "px") : "-" }}
237- </td >
238- <td >{{ value.horizontalFOV !== undefined ? value.horizontalFOV.toFixed(2) + "°" : "-" }}</td >
239- <td >{{ value.verticalFOV !== undefined ? value.verticalFOV.toFixed(2) + "°" : "-" }}</td >
240- <td >{{ value.diagonalFOV !== undefined ? value.diagonalFOV.toFixed(2) + "°" : "-" }}</td >
241- <v-tooltip location =" bottom" >
242- <template #activator =" { props } " >
243- <td v-bind =" props" @click =" setSelectedVideoFormat(value)" >
244- <v-icon size =" small" >mdi-information</v-icon >
245- </td >
246- </template >
247- <span >Click for more info on this calibration.</span >
248- </v-tooltip >
249- </tr >
250- </tbody >
251- </v-table >
221+ <v-card-text >
222+ <div v-show =" !isCalibrating" >
223+ <v-card-subtitle class =" pt-0 pl-0 pr-0 text-white" >Current Calibration</v-card-subtitle >
224+ <v-table fixed-header height =" 100%" density =" compact" >
225+ <thead >
226+ <tr >
227+ <th >Resolution</th >
228+ <th >Mean Error</th >
229+ <th >Horizontal FOV</th >
230+ <th >Vertical FOV</th >
231+ <th >Diagonal FOV</th >
232+ <th >Info</th >
233+ </tr >
234+ </thead >
235+ <tbody style =" cursor : pointer " >
236+ <tr v-for =" (value, index) in getUniqueVideoFormatsByResolution()" :key =" index" >
237+ <td >{{ getResolutionString(value.resolution) }}</td >
238+ <td >
239+ {{ value.mean !== undefined ? (isNaN(value.mean) ? "Unknown" : value.mean.toFixed(2) + "px") : "-" }}
240+ </td >
241+ <td >{{ value.horizontalFOV !== undefined ? value.horizontalFOV.toFixed(2) + "°" : "-" }}</td >
242+ <td >{{ value.verticalFOV !== undefined ? value.verticalFOV.toFixed(2) + "°" : "-" }}</td >
243+ <td >{{ value.diagonalFOV !== undefined ? value.diagonalFOV.toFixed(2) + "°" : "-" }}</td >
244+ <v-tooltip location =" bottom" >
245+ <template #activator =" { props } " >
246+ <td v-bind =" props" @click =" setSelectedVideoFormat(value)" >
247+ <v-icon size =" small" >mdi-information</v-icon >
248+ </td >
249+ </template >
250+ <span >Click for more info on this calibration.</span >
251+ </v-tooltip >
252+ </tr >
253+ </tbody >
254+ </v-table >
255+ </div >
252256 <div v-if =" useCameraSettingsStore().isConnected" class =" d-flex flex-column" >
253257 <v-card-subtitle v-show =" !isCalibrating" class =" pl-0 pb-3 pt-3 text-white"
254258 >Configure New Calibration</v-card-subtitle
0 commit comments