From 9b677d7828f0a005abe46c7114d40721789f2d84 Mon Sep 17 00:00:00 2001 From: shefengchun <1077478963@qq.com> Date: Tue, 14 Mar 2023 14:19:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=9B=B2=E9=9D=A2?= =?UTF-8?q?=E6=A0=A1=E6=AD=A3=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=90=8E=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=82=B9=E6=95=B0=E9=87=8F=E4=B8=8D=E5=8F=91?= =?UTF-8?q?=E9=80=81=20=E6=B7=BB=E5=8A=A0=E6=95=B4=E4=B8=AA=E8=9E=8D?= =?UTF-8?q?=E5=90=88=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FusionSettings/DensityCorrection.vue | 176 +++++++++++++++--- .../FusionSettings/FourPointCalibration.vue | 68 +++++-- .../FusionSettings/FusionLocale.vue | 39 +++- .../FusionSettings/GridSettings.vue | 21 +++ .../FusionSettings/SurfaceCorrection.vue | 152 ++++++++++++--- src/components/FusionSettingsDialog.vue | 131 ++++++++++++- 6 files changed, 522 insertions(+), 65 deletions(-) diff --git a/src/components/FusionSettings/DensityCorrection.vue b/src/components/FusionSettings/DensityCorrection.vue index 92b9866..72ebe9b 100644 --- a/src/components/FusionSettings/DensityCorrection.vue +++ b/src/components/FusionSettings/DensityCorrection.vue @@ -361,7 +361,9 @@ export default defineComponent({ let $store = useStore(); let $t = useI18n(); const ste_status = ref(0); - + /** + * 计算当前的投影机 + */ const configselsect = computed(() => { return $store.state.selected_projector; }); @@ -383,15 +385,43 @@ export default defineComponent({ $store.getters.GetTheCurrentlySelectedCamera[1] ); }); + /** + * 当前的参数 + */ let config = JSON.parse($store.state.fusion_configuration).projectors[selectedprojector.value]; + /** + * 控制页面上当前显示垂直校正还是水平 + */ const now_v_h = ref("") + /** + * 水平校正 点的个数 默认取配置文件的第一个参数 + */ const value_h_point_amount = ref(Number(Object.keys(config.multi_hor_density)[0])) + /** + * 垂直校正 点的个数 默认取配置文件的第一个参数 + */ const value_v_point_amount = ref(Number(Object.keys(config.multi_ver_density)[0])) + /** + * 添加点的弹窗 + */ const add_dialog = ref(false) + /** + * 当前数量 好像没有用 + */ const now_amount = ref(0) - + /** + * 可供选择的 水平 点的数量 绑定 select + */ const options_value_h_point_amount = ref([]) + /** + * 可供选择的 垂直 点的数量 绑定 select + */ const options_value_v_point_amount = ref([]) + /** + * 深度copy + * @param o1 + * @param o2 + */ const deepcopy = (o1: any, o2: any) => { for (let k in o2) { if (typeof o2[k] === "object") { @@ -402,7 +432,9 @@ export default defineComponent({ } } }; - + /** + * 使用服务器端的配置 + */ const use_server_config = () => { value_h_point_amount.value = Number(Object.keys(config.multi_hor_density)[0]) value_v_point_amount.value = Number(Object.keys(config.multi_ver_density)[0]) @@ -443,7 +475,9 @@ export default defineComponent({ } } - + /** + * 使用缓存的配置 + */ const use_set_cache = () => { if (set_cache.value[selectedprojector.value] != null) { let tmp = JSON.parse(set_cache.value[selectedprojector.value]); @@ -461,11 +495,16 @@ export default defineComponent({ } } - + /** + * 保存缓存配置 + */ const save_set_cache = () => { let tmp = { value_h: value_h.value, value_v: value_v.value, value_v_point_amount: value_v_point_amount.value, value_h_point_amount: value_h_point_amount.value, value_v_point: value_v_point.value, value_h_point: value_h_point.value } set_cache.value[selectedprojector.value] = JSON.stringify(tmp); } + /** + * 是否开启辅助线 变量 + */ const auxiliary_line = ref(false) watch( () => configselsect, @@ -495,25 +534,48 @@ export default defineComponent({ ); - + /** + * 缓存 变量 + */ const set_cache: any = ref([]); - //值 + /** + * 垂直点的值 + */ let value_h = ref([]); + /** + * 水平点的值 + */ let value_v = ref([]); - //位置 + /** + * 水平点的位置 + */ let value_h_point = ref([]); + /** + * 垂直点的位置 + */ let value_v_point = ref([]); /** - * 当前选中的点的索引 + * 当前选中 垂直的点的索引 */ const options_model_v = ref(0) + /** + * 当前选中 水平的点的索引 + */ const options_model_h = ref(0) const div = ref(); + /** + * 用于限制分辨率最大值 会在渲染时 自动赋值 + */ const max = ref({ x: 0, y: 0 }) + /** + * 点的大小 + */ const point = ref({ w: 20, h: 20 }) - + /** + * 监听垂直和水平界面切换 + */ watch(() => now_v_h, (newval, oldval) => { if (newval.value == 'level') { set?.SetBlendingOption("blending_grids_select_ui", "hor_density") @@ -525,6 +587,9 @@ export default defineComponent({ set?.SetBlendingOption("blending_grids_select_point", `${options_model_v.value + 1}`) } }, { deep: true }) + /** + * 监听垂直点 的数量 + */ watch(() => value_v_point_amount, (newval, oldval) => { setTimeout(() => { @@ -537,6 +602,9 @@ export default defineComponent({ save_set_cache() }, 100); }, { deep: true }) + /** + * 监听水平点的数量 + */ watch(() => value_h_point_amount, (newval, oldval) => { setTimeout(() => { @@ -549,10 +617,15 @@ export default defineComponent({ }, 100); }, { deep: true }) - + /** + * 发送 select 选择的水平点数 + */ watch(() => options_model_h, (newval, oldval) => { set?.SetBlendingOption("blending_grids_select_point", `${value_h_point.value[newval.value].control_point}`) }, { deep: true }) + /** + * 发送 select 选择的垂直点数 + */ watch(() => options_model_v, (newval, oldval) => { set?.SetBlendingOption("blending_grids_select_point", `${value_v_point.value[newval.value].control_point}`) }, { deep: true }) @@ -571,7 +644,12 @@ export default defineComponent({ start_point(val, type) save_set_cache() } - + /** + * 拖拽组件移动回调 + * @param $event + * @param index + * @param type + */ const dragStartHandle = ($event: any, index: number, type: string) => { let obj_x = $event.x let obj_y = $event.y @@ -644,7 +722,11 @@ export default defineComponent({ y = (max.value.y - y - point.value.h) * Proportion.value.y return { x, y } } - + /** + * 给初始点赋值 + * @param a + * @param type + */ const start_point = (a: number, type: string) => { if (type == 'h' || type == 'all') { value_h.value = [] @@ -695,6 +777,9 @@ export default defineComponent({ } start() onMounted(() => { + /** + * 计算比例 + */ Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w) Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h) options_value_h_point_amount.value = Object.keys(config.multi_hor_density) @@ -724,7 +809,12 @@ export default defineComponent({ onBeforeUnmount(() => { sessionStorage.DensityCorrection = JSON.stringify(set_cache.value); }); - + /** + * 重置单个点的数据 + * @param index 索引 + * @param send + * @param type + */ const reset = (index: number, send: boolean, type: string) => { if (type == 'v') { value_v.value[index].x = value_v.value[index].def_x @@ -738,6 +828,13 @@ export default defineComponent({ } save_set_cache() } + /** + * 发送数据 + * @param index + * @param type + * @param value + * @param send + */ const send_value = (index: number, type: string, value: number, send: boolean = true) => { if (!send) return; let row = $store.getters.GetTheCurrentlySelectedCamera[0] @@ -749,6 +846,9 @@ export default defineComponent({ set?.SetBlendingHorDensity(row, col, Number(value_h_point_amount.value), index + 1, Number(value)); } } + /** + * 重置 多点数据 + */ const resetall = () => { switch (now_v_h.value) { case 'vertical': @@ -805,9 +905,17 @@ export default defineComponent({ break; } } + /** + * 删除点 弹窗 + */ const del_dialog = ref(false) + /** + * 添加点 + * @param amount + * @param type + */ const add_control_points = (amount: number, type: string) => { - if (amount < 5) return + if (amount < 5||amount >=60) return let tmpconfig: any = null let row = $store.getters.GetTheCurrentlySelectedCamera[0] let col = $store.getters.GetTheCurrentlySelectedCamera[1] @@ -935,7 +1043,11 @@ export default defineComponent({ } } - + /** + * 删除 点数配置 + * @param amount + * @param type + */ const reduce_control_points = (amount: number, type: string) => { if (amount <= 5) return let tmpconfig: any = null @@ -1110,7 +1222,7 @@ export default defineComponent({ } /** - * v数据 + * v数据 滚轮交互 */ const details_selsect_val = (details: any, type: string) => { @@ -1135,10 +1247,13 @@ export default defineComponent({ } } - + /** + * 增加 垂直校正点数 + * @param val 数量 + */ const preview_v = (val: number) => { val = Number(val) - if (val < 5) return + if (val < 5 ||val>=60) return let width = allconfig.projector_width / (val - 1) let height = allconfig.projector_height / (val - 1) value_v.value = [] @@ -1164,9 +1279,13 @@ export default defineComponent({ value_v_point_amount.value = val options_model_v.value = 1 } + /** + * 水平校正点的数量 + * @param val 数量 + */ const preview_h = (val: number) => { val = Number(val) - if (val < 5) return + if (val < 5 ||val>=60) return let width = allconfig.projector_width / (val - 1) let height = allconfig.projector_height / (val - 1) value_h.value = [] @@ -1278,11 +1397,17 @@ export default defineComponent({ - + /** + * 手写长按和的那几实现 + */ let loop_start: NodeJS.Timeout let loop_finish: NodeJS.Timeout - + /** + * 平板弹出来的操作 函数 + * @param fun 加法还是减法+ - + * @param type x or y + */ const mousedown = (fun: string, type: string) => { loop_start = setTimeout(() => { loop_finish = setInterval(() => { @@ -1335,8 +1460,13 @@ export default defineComponent({ clearInterval(loop_finish) } - + /** + * 控制 自定义 input x 箭头的显示 + */ const input_x_focus=ref(false) + /** + * 控制 自定义 input y 箭头的显示 + */ const input_y_focus=ref(false) diff --git a/src/components/FusionSettings/FourPointCalibration.vue b/src/components/FusionSettings/FourPointCalibration.vue index f910522..77c77b3 100644 --- a/src/components/FusionSettings/FourPointCalibration.vue +++ b/src/components/FusionSettings/FourPointCalibration.vue @@ -205,10 +205,20 @@ export default defineComponent({ $store.getters.GetTheCurrentlySelectedCamera[1] ); }); + /** + * 当前配置文件 + */ let config = JSON.parse($store.state.fusion_configuration).projectors[selectedprojector.value]; + /** + * 当前点的数量 + */ const value_point_amount = ref(5) - + /** + * 深度copy函数 + * @param o1 + * @param o2 + */ const deepcopy = (o1: any, o2: any) => { for (let k in o2) { if (typeof o2[k] === "object") { @@ -219,7 +229,9 @@ export default defineComponent({ } } }; - + /** + * 使用服务器配置 + */ const use_server_config = () => { value.value = [] value_point.value = [] @@ -239,7 +251,9 @@ export default defineComponent({ value_point.value.push(tmp_point) } } - + /** + * 使用缓存 + */ const use_set_cache = () => { if (set_cache.value[selectedprojector.value] != null) { let tmp = JSON.parse(set_cache.value[selectedprojector.value]); @@ -248,12 +262,16 @@ export default defineComponent({ recalculate_coordinates() } } - + /** + * 保存缓存 + */ const save_set_cache = () => { let tmp = { value: value.value, value_point: value_point.value } set_cache.value[selectedprojector.value] = JSON.stringify(tmp); } - + /** + * 监听是否切换了投影机 + */ watch( () => configselsect, (newVal, oldVal) => { @@ -280,7 +298,9 @@ export default defineComponent({ ); - + /** + * 缓存 变量 + */ const set_cache: any = ref([]); //值 let value = ref([]); @@ -290,11 +310,21 @@ export default defineComponent({ * 当前选中的点的索引 */ const options_model = ref(0) - + /** + * html div元素用来计算 + */ const div = ref(); + /** + * 最大值 + */ const max = ref({ x: 0, y: 0 }) + /** + * 点大小 + */ const point = ref({ w: 20, h: 20 }) - + /** + * 监听点的切换 + */ watch(() => options_model, (newval, oldval) => { set?.SetBlendingOption("blending_grids_select_point", `4:${options_model.value + 1}`) }, { deep: true }) @@ -307,7 +337,9 @@ export default defineComponent({ max.value.x = div.value.offsetWidth max.value.y = div.value.offsetHeight }) - + /** + * 计算可供选择的点 + */ const options = computed(() => { let tmp = [] for (let index = 0; index < value_point.value.length; index++) { @@ -318,11 +350,18 @@ export default defineComponent({ } return tmp }) - + /** + * 修改点数量函数 + * @param val + */ const chang_point_amount = (val: number) => { start_point() } - + /** + * 小点移动回调 + * @param $event + * @param index + */ const dragStartHandle = ($event: any, index: number) => { let obj_x = $event.x let obj_y = $event.y @@ -347,7 +386,12 @@ export default defineComponent({ send_value(index, value.value[index].x , value.value[index].y) save_set_cache() } - + /** + * 点的数据发生修改时计算位置 + * @param index + * @param $event + * @param type + */ const chang = (index: number, $event: any, type: string) => { index = Number(index) if (now_selsect_projector?.value == '0-0'&&props.col=='2') { diff --git a/src/components/FusionSettings/FusionLocale.vue b/src/components/FusionSettings/FusionLocale.vue index 18c3f82..a14d9bb 100644 --- a/src/components/FusionSettings/FusionLocale.vue +++ b/src/components/FusionSettings/FusionLocale.vue @@ -432,6 +432,10 @@ export default defineComponent({ let url = window.location.href; return url.indexOf("pad") != -1 }) + /** + * 重置数据 + * @param type + */ const reset = (type: string) => { switch (type) { case 'gamma': @@ -448,13 +452,24 @@ export default defineComponent({ } chang(type) } + /** + * 是否在切换数据 避免切换投影机是发送不该发送的数据 + */ const ste_status = ref(0); + /** + * 使用缓存 + */ const use_set_cache = () => { if (set_cache.value[selectedprojector.value] != null) { let tmp = JSON.parse(set_cache.value[selectedprojector.value]); deepcopy(array, tmp); } }; + /** + * 深度拷贝 + * @param o1 + * @param o2 + */ const deepcopy = (o1: any, o2: any) => { for (let k in o2) { if (typeof o2[k] === "object") { @@ -465,14 +480,23 @@ export default defineComponent({ } } }; + /** + * 保存缓存 + */ const save_set_cache = () => { set_cache.value[selectedprojector.value] = JSON.stringify(array); }; let config = JSON.parse($store.state.fusion_configuration).projectors[selectedprojector.value]; + /** + * 当前选择的投影机 + */ const configselsect = computed(() => { return $store.state.selected_projector; }); + /** + * 监听投影机切换 + */ watch( () => configselsect, (newVal, oldVal) => { @@ -503,7 +527,10 @@ export default defineComponent({ }, { deep: true } ); - + /** + * 输入inpu数据 时发送到后端 + * @param type + */ const chang = (type: string) => { if (ste_status.value == 1) return if (type == "alpha") { @@ -582,6 +609,9 @@ export default defineComponent({ }, 100); setnowindex(); }; + /** + * 初始化赋值 + */ const startconfig = () => { for (let index = 0; index < array.length - 1; index++) { array[arr[index]].gamma = Number(config.params[index].gamma.toFixed(2)); @@ -596,6 +626,9 @@ export default defineComponent({ use_set_cache(); setnowindex(); }; + /** + * 使用服务端配置 + */ const use_server_config = () => { for (let index = 0; index < array.length - 1; index++) { array[arr[index]].gamma = Number(config.params[index].gamma.toFixed(2)); @@ -933,7 +966,9 @@ export default defineComponent({ // const ["上","左","右","下"] - + /** + * 可供选择的 + */ const options = [{ label: $t.t('up'), value: 0 diff --git a/src/components/FusionSettings/GridSettings.vue b/src/components/FusionSettings/GridSettings.vue index 2d3896c..6d23f6d 100644 --- a/src/components/FusionSettings/GridSettings.vue +++ b/src/components/FusionSettings/GridSettings.vue @@ -110,6 +110,9 @@ export default defineComponent({ let model = reactive([20, 40, 20]); let options = ref([10, 20, 30, 40, 50, 60 ,80]); let line_width_options = ref([2,4,6,8,10, 20, 30, 40, 50]); + /** + * 发送颜色 根据index不同确定是那个接口 + */ const submit = () => { switch (index.value) { case 0: @@ -128,6 +131,11 @@ export default defineComponent({ break; } } + /** + * 修改 横纵 线的数量 + * @param type 类型 + * @param value 值 + */ const update_row_col = (type: number, value: number) => { switch (type) { case 0: @@ -143,6 +151,10 @@ export default defineComponent({ break; } } + /** + * 修改 单选 发送数据 使用switch 匹配多个 + * @param type + */ const send_off = (type: number) => { setTimeout(() => { switch (type) { @@ -164,6 +176,9 @@ export default defineComponent({ } }, 100); } + /** + * 使用服务端配置 + */ const use_server_config = () => { let server_conf = JSON.parse($store.state.fusion_configuration).options model[0] = server_conf.blending_grids_row ?? 20; @@ -181,10 +196,16 @@ export default defineComponent({ onBeforeUnmount(() => { set_sessionStorage() }); + /** + * 保存缓存到sessionStorage + */ const set_sessionStorage = () => { let tmp = { RowsColumns: RowsColumns, color: color, model: model } sessionStorage.GridSettings = JSON.stringify(tmp) } + /** + * 获取sessionStorage + */ const get_sessionStorage = () => { let tmp = JSON.parse(sessionStorage.GridSettings) for (let index = 0; index < tmp.RowsColumns.length; index++) { diff --git a/src/components/FusionSettings/SurfaceCorrection.vue b/src/components/FusionSettings/SurfaceCorrection.vue index 25e6b68..ce395d8 100644 --- a/src/components/FusionSettings/SurfaceCorrection.vue +++ b/src/components/FusionSettings/SurfaceCorrection.vue @@ -272,13 +272,35 @@ export default defineComponent({ $store.getters.GetTheCurrentlySelectedCamera[1] ); }); + /** + * 当前投影机的数据 + */ let config = JSON.parse($store.state.fusion_configuration).projectors[selectedprojector.value]; + /** + * 当前点的个数 + */ const value_point_amount = ref(9) + /** + * 删除 弹窗 + */ const del_dialog = ref(false) + /** + * 添加弹窗 + */ const add_dialog = ref(false) + /** + * 当前点的个数 + */ const now_amount = ref(9) + /** + * 可以选择点数的列表 + */ const options_value_point_amount = ref([]) - + /** + * 深度copy + * @param o1 + * @param o2 + */ const deepcopy = (o1: any, o2: any) => { for (let k in o2) { if (typeof o2[k] === "object") { @@ -290,7 +312,9 @@ export default defineComponent({ } } }; - + /** + * 使用服务端获取的配置 + */ const use_server_config = () => { value_point_amount.value = Number(Object.keys(config.multi_curved_surface)[0]) let a = value_point_amount.value @@ -311,7 +335,9 @@ export default defineComponent({ value_point.value.push(tmp_point) } } - + /** + * 使用本地缓存配置 + */ const use_set_cache = () => { if (set_cache.value[selectedprojector.value] != null) { let tmp = JSON.parse(set_cache.value[selectedprojector.value]); @@ -321,13 +347,17 @@ export default defineComponent({ recalculate_coordinates() } } - + /** + * 保存本地缓存 + */ const save_set_cache = () => { let tmp = { value: value.value, value_point_amount: value_point_amount.value, value_point: value_point.value } set_cache.value[selectedprojector.value] = JSON.stringify(tmp); } - + /** + * 监听投影机是否切换 + */ watch( () => configselsect, (newVal, oldVal) => { @@ -357,7 +387,9 @@ export default defineComponent({ { deep: true } ); - + /** + * 缓存 变量 + */ const set_cache: any = ref([]); //值 let value = ref([]); @@ -369,13 +401,23 @@ export default defineComponent({ const options_model = ref(0) const div = ref(); + /** + * 分辨率最大值 + */ const max = ref({ x: 0, y: 0 }) + /** + * 点的大小 + */ const point = ref({ w: 20, h: 20 }) - + /** + * 发送当前选择的点 + */ watch(() => options_model, (newval, oldval) => { set?.SetBlendingOption("blending_grids_select_point", `9:${newval.value + 1}`) }, { deep: true }) - + /** + * 发送当前点的数量 + */ watch(() => value_point_amount, (newval, oldval) => { if (ste_status.value == 0) set?.SetBlendingOption("blending_grids_control_point_count", `${newval.value}`) options_model.value = 0 @@ -391,12 +433,19 @@ export default defineComponent({ max.value.y = div.value.offsetHeight }) - + /** + * 变更点数 + * @param val + */ const chang_point_amount = (val: number) => { start_point(val) //use_set_cache() } - + /** + * 拖拽组件移动回调 + * @param $event + * @param index + */ const dragStartHandle = ($event: any, index: number) => { let obj_x = $event.x let obj_y = $event.y @@ -406,7 +455,12 @@ export default defineComponent({ send_value(index, Math.trunc(tmp.x), Math.trunc(tmp.y)) save_set_cache() } - + /** + * 修改input 手动计算拖拽组件的位置 + * @param index + * @param $event + * @param type + */ const chang = (index: number, $event: any, type: string) => { index = Number(index) let tmp = coordinate_transformation_value_to_xy(value.value[index].x, value.value[index].y) @@ -416,6 +470,9 @@ export default defineComponent({ save_set_cache() } + /** + * 计算可供选择的点 + */ const options = computed(() => { let tmp = [] for (let index = 0; index < value_point.value.length; index++) { @@ -450,7 +507,10 @@ export default defineComponent({ y = (max.value.y - (y + point.value.h)) * Proportion.value.y return { x, y } } - + /** + * 初始化 赋值 + * @param a + */ const start_point = (a: number) => { value.value = [] value_point.value = [] @@ -471,7 +531,9 @@ export default defineComponent({ save_set_cache() } - + /** + * 用于模拟数据让dom先渲染 + */ const start = () => { let tmp: DensityCorrectionPoint = { control_point: 0, x: 0, y: 0, def_x: 0, def_y: 0 }; value.value.push(tmp) @@ -479,6 +541,9 @@ export default defineComponent({ } start() onMounted(() => { + /** + * 计算比例 + */ Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w) Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h) @@ -502,22 +567,38 @@ export default defineComponent({ })(); }; }) - + /** + * 注销组件时 把当前修改的数据存入sessionStorage + */ onBeforeUnmount(() => { sessionStorage.SurfaceCorrection = JSON.stringify(set_cache.value); }); - + /** + * 重置 + * @param index 索引 + * @param send 是否发送给后端 + * @param type + */ const reset = (index: number, send: boolean, type: string) => { value.value[index].x = value.value[index].def_x value.value[index].y = value.value[index].def_y chang(index, value.value[index].def_y, type) save_set_cache() } + /** + * 发送点的数据 + * @param index 当前点的索引 + * @param x x值 + * @param y y值 + */ const send_value = (index: number, x: number, y: number) => { let row = $store.getters.GetTheCurrentlySelectedCamera[0] let col = $store.getters.GetTheCurrentlySelectedCamera[1] set?.setBlendingCorrection(row, col, 9, value_point.value.length, index + 1, Number(x), Number(y)); } + /** + * 重置全部点的参数 + */ const resetall = () => { for (let index = 0; index < value_point.value.length; index++) { value.value[index].x = value.value[index].def_x @@ -529,6 +610,9 @@ export default defineComponent({ send_value(-1, 0, 0) save_set_cache() } + /** + * 重置所有配置方案的 配置 + */ const resetall_all = () => { let amount_tmp = value_point_amount.value for (let index = 0; index < value_point.value.length; index++) { @@ -551,6 +635,9 @@ export default defineComponent({ start_point(Number(value_point_amount.value)) } + /** + * 窗口改变大小时重新计算 比例 + */ const recalculate_coordinates = () => { try { Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w) @@ -569,8 +656,12 @@ export default defineComponent({ } } + /** + * 增加点数 + * @param amount 数量 平方 + */ const add_control_points = (amount: number) => { - if (amount < 9) return + if (amount < 9 ||amount>=169) return let cardinality = Math.sqrt(amount) amount = (cardinality + 1) ** 2 let tmpconfig: any = null @@ -616,9 +707,14 @@ export default defineComponent({ } value_point.value.push(tmp_point) } + ste_status.value = 0; }); save_set_cache() } + /** + * 删除点数量 + * @param amount + */ const del_control_points = (amount: number) => { let tmp = amount if (amount <= 9) return @@ -668,6 +764,7 @@ export default defineComponent({ } value_point.value.push(tmp_point) } + ste_status.value = 0; }); save_set_cache() @@ -716,13 +813,18 @@ export default defineComponent({ } value_point.value.push(tmp_point) } + ste_status.value = 0; }); set?.SetBlendingOption("blending_grids_control_point_count", `${value_point_amount.value}`) save_set_cache() } + /** + * 预览增加点的效果 + * @param val + */ const preview = (val: number) => { val = Number(val) - if (val < 3) return + if (val < 3||val>=13) return let width = allconfig.projector_width / (val - 1) let height = allconfig.projector_height / (val - 1) value.value = [] @@ -873,13 +975,17 @@ export default defineComponent({ } } - + /** + * 判断是否是平板 + */ const ispad = computed(() => { let url = window.location.href; return url.indexOf("pad") != -1 }) - + /** + * 针对平板的 手动实现单机和长按 + */ let loop_start: NodeJS.Timeout let loop_finish: NodeJS.Timeout @@ -931,8 +1037,13 @@ export default defineComponent({ clearInterval(loop_finish) } - + /** + * 控制是否显示 input x 的自定义监听 + */ const input_x_focus=ref(false) + /** + * 控制是否显示 input y 的自定义监听 + */ const input_y_focus=ref(false) @@ -943,7 +1054,6 @@ export default defineComponent({ - defineExpose({ options_model, }); diff --git a/src/components/FusionSettingsDialog.vue b/src/components/FusionSettingsDialog.vue index f0286cd..fee5a12 100644 --- a/src/components/FusionSettingsDialog.vue +++ b/src/components/FusionSettingsDialog.vue @@ -276,6 +276,9 @@ export default defineComponent({ * 当前平板是否全屏 */ const is_pad_screen = ref(false); + /** + * 计算平板和pc的样式 + */ const is_pad_style = computed(() => { let url = window.location.href if (url.indexOf("pad") != -1 && $t.locale.value == "en-US") { @@ -286,19 +289,40 @@ export default defineComponent({ } return "60vw" }) + /** + * 选择配置的弹窗 + */ const select_configuration = ref(false) + /** + * 删除配置时弹窗 + */ const del_dialog = ref(false) + /** + * 后端获取的配置 + */ const config_projectors = ref(null) + /** + * 选择配置文件的名称 + */ const select_configuration_name = ref("") + /** + * 发送是否禁用融合参数 + */ const send_disable_blending_params = () => { set?.SetBlendingOption(disable_blending_params_id.value, disable_blending_params.value ? "1" : "0"); }; + /** + * 当前分辨率 在配置文件中的索引 + */ const now_resolution = ref(1) // let allconfig = JSON.parse($store.state.fusion_configuration); /** * 模拟数据完成dom渲染再次获取真实后台数据 */ let allconfig = JSON.parse("{\"resolution\": [{\"width\": 1920,\"height\": 1080}]}"); + /** + * 计算可供选择的分辨率 + */ const options_resolution = computed(() => { let tmp = []; if (allconfig.resolution) { @@ -311,6 +335,9 @@ export default defineComponent({ } return tmp }) + /** + * 子组件 + */ const child: any = ref(null); /** * 开启网格时发送全部参数 @@ -403,15 +430,35 @@ export default defineComponent({ sessionStorage.removeItem("Debugging"); sessionStorage.removeItem("FusionLocale_async"); } - + /** + * 从配置文件中获取的行和列 + */ const config = ref({ col: 0, row: 0 }); + /** + * 是否开启融合 + */ const EnableBlending = ref(false); let optionsstr = ref(); optionsstr.value = ""; + /** + * 是否禁用融合参数 的参数名称 + */ const disable_blending_params_id = ref("blending@disable_blending_params"); + /** + * 是否禁用融合参数 + */ const disable_blending_params = ref(false); + /** + * 是否开启网格的参数名称 + */ const show_blending_grids_id = ref("blending_grids_show"); + /** + * 是否开启网格 + */ const show_blending_grids = ref(true); + /** + * 是否保存配置弹窗 + */ const medium = ref(false); const options = computed({ get() { @@ -516,6 +563,9 @@ export default defineComponent({ }); } catch (error) { } }; + /** + * 点击页面取消时调用 恢复默认参数 + */ const clear = () => { record_times.value = 0 // show_blending_grids.value = false; @@ -573,6 +623,9 @@ export default defineComponent({ $store.commit("setfusion_configuration", res?.config); optionsstr.value = "FourPointCalibration"; allconfig = JSON.parse($store.state.fusion_configuration); + /** + * 匹配当前分辨率的索引 没有匹配到自动加入当前分辨率 + */ if (allconfig.resolution) { for (let index = 0; index < allconfig.resolution.length; index++) { if (allconfig.resolution[index].width == allconfig.projector_width && allconfig.resolution[index].height == allconfig.projector_height) { @@ -584,7 +637,9 @@ export default defineComponent({ allconfig = { resolution: [{ width: tmp.projector_width, height: tmp.projector_height }] }; now_resolution.value = 0 } - + /** + * 计算当前可供选择的 投影机布局 + */ projectorlayout.value = [] let cont = 0 for (let index = 1; index <= tmp.max_projector_count; index++) { @@ -598,7 +653,9 @@ export default defineComponent({ } } } - + /** + * 匹配当前投影机布局 + */ for (let index = 0; index < projectorlayout.value.length; index++) { let arr = projectorlayout.value[index].label.split('x'); if (tmp.col == Number(arr[1]) && tmp.row == Number(arr[0])) { @@ -616,11 +673,19 @@ export default defineComponent({ }, 1000); // console.log("已经挂载 ") }); - + /** + * 保存配置的名称 + */ const save_cover_name = ref("") + /** + * + */ const plan_list = [ '' ] + /** + * 应用当前选择的配置文件 + */ const apply_the_selected_configuration = () => { $q.loading.show({ message: 'Loading please wait' @@ -662,12 +727,20 @@ export default defineComponent({ getconfig() } const plan_list_op = ref(plan_list) + /** + * select 自动提示函数 + * @param val + * @param update + */ const filterFn = (val: any, update: any) => { update(() => { const needle = val.toLocaleLowerCase() plan_list_op.value = plan_list.filter(v => v.toLocaleLowerCase().indexOf(needle) > -1) }) } + /** + * 当前按下ctrl 次数 + */ const record_times = ref(0) const setModel = (val: string) => { save_cover_name.value = val @@ -677,7 +750,9 @@ export default defineComponent({ set?.SaveBlendingConfig(save_cover_name.value); medium.value = false } - + /** + * 是否开启debug页面 + */ const isdebug = computed(() => { try { return record_times.value > 2 @@ -686,11 +761,21 @@ export default defineComponent({ } }) + /** + * 需要删除的配置 名称 + */ const name_to_be_deleted = ref(""); + /** + * 待删除配置函数 + * @param name 待删除的名称 + */ const del_scenes = (name: string) => { del_dialog.value = true; name_to_be_deleted.value = name; } + /** + * 正式删除配置的函数 + */ const dialog_del_scenes = () => { set?.DeleteBlendingScene(name_to_be_deleted.value); plan_list.splice(plan_list.findIndex(item => item === name_to_be_deleted.value), 1) @@ -698,7 +783,14 @@ export default defineComponent({ select_configuration_name.value = '' save_cover_name.value = '' } + /** + * 当前选择的投影机 + */ const now_selsect_projector = ref("0-0") + /** + * 发送当前选择的投影机 + * @param value + */ const currently_selected_projector = (value: string) => { set?.SetBlendingOption('blending_grids_select_projector', value); now_selsect_projector.value = value @@ -708,10 +800,17 @@ export default defineComponent({ * 依赖注入 */ provide("now_selsect_projector", now_selsect_projector); + /** + * 可以供选择的布局 变量 + */ let projectorlayout = ref([{ label: '1x1', value: 0 }, { label: '1x2', value: 1 }]) let projectorlayout_tmp = ref([]) const now_select_projectorlayout = ref(0) const now_select_projectorlayout_tmp = ref("") + /** + * 发送当前选择的布局 + * @param val + */ const send_projectorlayout = (val: number) => { let arr = projectorlayout.value[val].label.split('x'); set?.SetProjectorLayout(Number(arr[0]), Number(arr[1])).then(res => { @@ -742,7 +841,10 @@ export default defineComponent({ getconfig() }) } - + /** + * 发送当前选择的布局 + * @param val + */ const send_projectorlayout2 = (val: string) => { let arr = val.split('x'); set?.SetProjectorLayout(Number(arr[0]), Number(arr[1])).then(res => { @@ -878,15 +980,30 @@ export default defineComponent({ interface projectorlayoutarray { label: string; value: number; } + /** + * 经过筛选的 投影机布局 + */ const show_projectorlayout = ref([]) + /** + * 筛选投影机函数 + * @param val + * @param update + */ const filterFn_projector = (val: any, update: any) => { update(() => { const needle = val.toLowerCase() show_projectorlayout.value = projectorlayout.value.filter(v => v.label.toLowerCase().indexOf(needle) > -1) }) } - + /** + * 经过筛选的 投影机布局 + */ const show_projectorlayout2 = ref([]) + /** + * 筛选投影机函数 + * @param val + * @param update + */ const filterFn_projector2 = (val: any, update: any) => { update(() => { const needle = val.toLowerCase()