From 800dfec98d2513e61b1af8646e86b5fbb11380a1 Mon Sep 17 00:00:00 2001 From: shefengchun <1077478963@qq.com> Date: Thu, 23 Feb 2023 17:10:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A8=E6=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=B6=E9=87=8D=E7=BD=AE=E5=85=A8=E9=83=A8=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FusionSettings/DensityCorrection.vue | 118 ++++++++++++++++-- .../FusionSettings/SurfaceCorrection.vue | 19 +-- src/components/FusionSettingsDialog.vue | 72 +++++++++-- src/i18n/en-US/index.ts | 3 +- src/i18n/zh-CN/index.ts | 3 +- 5 files changed, 185 insertions(+), 30 deletions(-) diff --git a/src/components/FusionSettings/DensityCorrection.vue b/src/components/FusionSettings/DensityCorrection.vue index 143d74b..a1e9511 100644 --- a/src/components/FusionSettings/DensityCorrection.vue +++ b/src/components/FusionSettings/DensityCorrection.vue @@ -50,12 +50,12 @@
-
+
-
@@ -82,12 +82,12 @@
-
+
-
@@ -134,7 +134,7 @@ - + + + + +
{{ $t('Whether to add control points') }}
+
+ +
+
+
+
+
+
+
+
+ +
+ + + + +
@@ -603,6 +629,7 @@ export default defineComponent({ const resetall_all = () => { switch (now_v_h.value) { case 'vertical': + let tmp =value_v_point_amount.value for (let key in config.multi_ver_density) { for (let index = 0; index < config.multi_ver_density[key].length; index++) { config.multi_ver_density[key][index].x = config.multi_ver_density[key][index].def_x @@ -610,11 +637,12 @@ export default defineComponent({ } start_point(Number(key), 'v') } - value_v_point_amount.value = 5 - start_point(Number(5), 'v') + value_v_point_amount.value = tmp + start_point(Number(tmp), 'v') send_value(-2, 'v', 0); break; case 'level': + let tmpp =value_h_point_amount.value for (let key in config.multi_hor_density) { for (let index = 0; index < config.multi_hor_density[key].length; index++) { config.multi_hor_density[key][index].x = config.multi_hor_density[key][index].def_x @@ -622,8 +650,8 @@ export default defineComponent({ } start_point(Number(key), 'h') } - value_h_point_amount.value = 5 - start_point(Number(5), 'h') + value_h_point_amount.value = tmpp + start_point(Number(tmpp), 'h') send_value(-2, 'h', 0); break; default: @@ -636,6 +664,8 @@ export default defineComponent({ let tmpconfig: any = null let row = $store.getters.GetTheCurrentlySelectedCamera[0] let col = $store.getters.GetTheCurrentlySelectedCamera[1] + + switch (type) { case 'v': set?.AddBlendingCtrlPoint('ver_density', row, col, Number(amount)).then((res) => { @@ -788,9 +818,6 @@ export default defineComponent({ } value_v_point_amount.value = Number(options_value_v_point_amount.value[options_value_v_point_amount.value.length - 1]) amount = Number(options_value_v_point_amount.value[options_value_v_point_amount.value.length - 1]) - // console.log(tmpconfig.multi_ver_density) - // console.log(value_v_point_amount.value) - // console.log(amount,'a') $store.commit("setfusion_configuration", res?.config); value_v.value = [] value_v_point.value = [] @@ -894,7 +921,8 @@ export default defineComponent({ } const add = () => { let tmp = now_v_h.value == "vertical" ? "v" : "h" - add_control_points(Number(now_amount.value), tmp); + let amount = now_v_h.value == "vertical" ? value_v_point_amount.value : value_h_point_amount.value + add_control_points(Number(amount), tmp); } /** @@ -961,12 +989,76 @@ export default defineComponent({ } + const preview_v = (val: number) => { + val = Number(val) + if (val < 5) return + let width = allconfig.projector_width / (val - 1) + let height = allconfig.projector_height / (val - 1) + value_v.value = [] + value_v_point.value = [] + for (let index = 0; index < val; index++) { + + let y = allconfig.projector_height - height * index + let x = width * index + let tmp: DensityCorrectionPoint = { x, y, def_x: x, def_y: y, control_point: index + 1 }; + value_v.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_v_point.value.push(tmp_point) + + } + value_v_point_amount.value = val + options_model_v.value = 1 + } + const preview_h = (val: number) => { + val = Number(val) + if (val < 5) return + let width = allconfig.projector_width / (val - 1) + let height = allconfig.projector_height / (val - 1) + value_h.value = [] + value_h_point.value = [] + for (let index = 0; index < val; index++) { + let y = allconfig.projector_height - height * index + let x = width * index + let tmp: DensityCorrectionPoint = { x, y, def_x: x, def_y: y, control_point:index + 1 }; + value_h.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_h_point.value.push(tmp_point) + } + value_h_point_amount.value = val + options_model_h.value = 1 + } + /** + * 在增加时 实现回退 + */ + const value_point_amount_tmp_v = ref(0) + const value_point_amount_tmp_h = ref(0) defineExpose({ now_v_h, options_model_v, options_model_h }); return { + config, + value_point_amount_tmp_v, + value_point_amount_tmp_h, + preview_v, + preview_h, resetall, div, max, diff --git a/src/components/FusionSettings/SurfaceCorrection.vue b/src/components/FusionSettings/SurfaceCorrection.vue index 2bbd2c2..8948a5b 100644 --- a/src/components/FusionSettings/SurfaceCorrection.vue +++ b/src/components/FusionSettings/SurfaceCorrection.vue @@ -17,7 +17,7 @@
-
+
-
@@ -95,7 +95,7 @@ - + @@ -419,6 +419,7 @@ export default defineComponent({ save_set_cache() } const resetall_all = () => { + let amount_tmp=value_point_amount.value for (let index = 0; index < value_point.value.length; index++) { value.value[index].x = value.value[index].def_x value.value[index].y = value.value[index].def_y @@ -435,8 +436,8 @@ export default defineComponent({ } start_point(Number(key)) } - value_point_amount.value = 9 - start_point(Number(9)) + value_point_amount.value = amount_tmp + start_point(Number(value_point_amount.value)) } const recalculate_coordinates = () => { @@ -480,7 +481,7 @@ export default defineComponent({ } ste_status.value = 1; tmpconfig = JSON.parse(JSON.stringify(fortmp)); - config = JSON.parse(JSON.stringify(fortmp)); + config = fortmp options_value_point_amount.value = [] for (let key in tmpconfig.multi_curved_surface) { options_value_point_amount.value.push(key) @@ -680,11 +681,15 @@ export default defineComponent({ } chang(options_model.value,"","") } - + /** + * 在增加时 实现回退 + */ + const value_point_amount_tmp=ref(0) defineExpose({ options_model, }); return { + value_point_amount_tmp, details_selsect, resetall_all, resetall, diff --git a/src/components/FusionSettingsDialog.vue b/src/components/FusionSettingsDialog.vue index 094501d..431b9fd 100644 --- a/src/components/FusionSettingsDialog.vue +++ b/src/components/FusionSettingsDialog.vue @@ -50,10 +50,10 @@
@@ -165,6 +165,22 @@ + + + + +
{{ $t('Do you confirm the modification') }}
+
+ + {{ $t('Whether to delete') + name_to_be_deleted }} + + + + + +
+
+ @@ -450,7 +466,11 @@ export default defineComponent({ clear_sessionStorage() }, 500); //getconfig() - options.value = "FusionLocale" + if (config.value.col == 1 && config.value.row == 1) { + optionsstr.value = "FourPointCalibration" + } else { + optionsstr.value = "FusionLocale"; + } }; /** @@ -488,8 +508,12 @@ export default defineComponent({ config.value.col = tmp.col; config.value.row = tmp.row; $store.commit("setfusion_configuration", res?.config); - config.value.col=tmp.col - config.value.row=tmp.row + + if(config.value.col==1&&config.value.row==1){ + optionsstr.value = "FourPointCalibration" + }else{ + optionsstr.value = "FusionLocale"; + } allconfig = JSON.parse($store.state.fusion_configuration); if(allconfig.resolution){ for (let index = 0; index < allconfig.resolution.length; index++) { @@ -511,7 +535,7 @@ export default defineComponent({ }); get_scenes() set?.SetBlendingOption("blending_grids_select_ui", "blending") - optionsstr.value = "FusionLocale"; + }, 1000); }); const save_cover_name = ref("") @@ -624,13 +648,13 @@ export default defineComponent({ const btn_options = computed(() => { let tmp=[] + tmp.push({label: $t.t('FourPointCalibration'), value: 'FourPointCalibration'}) + tmp.push({label: $t.t('SurfaceCorrection'),value: 'SurfaceCorrection',}) if(now_select_projectorlayout.value!=0){ tmp.push({ label: $t.t('FusionLocale'), value: 'FusionLocale' }) }else{ optionsstr.value = "FourPointCalibration"; } - tmp.push({label: $t.t('FourPointCalibration'), value: 'FourPointCalibration'}) - tmp.push({label: $t.t('SurfaceCorrection'),value: 'SurfaceCorrection',}) tmp.push({label: $t.t('DensityCorrection'),value: 'DensityCorrection',}) tmp.push({ label: $t.t('GridSettings'), value: 'GridSettings' }) return tmp @@ -643,7 +667,39 @@ export default defineComponent({ let col = allconfig.projectors.length return {col} }) + /** + * 弹窗 + * 浅拷贝 + */ + const confirm=ref(false) + let dialog_data:any=null + const dialog=(parameter:any,fun:any)=>{ + confirm.value=true + dialog_data={parameter,fun} + } + const trigger_dialog=()=>{ + dialog_data.fun(dialog_data.parameter) + } + const re_match_data=()=>{ + let tmp=allconfig + for (let index = 0; index < options_resolution.value.length; index++) { + let arr = options_resolution.value[index].label.split('*'); + if(tmp.projector_width==Number(arr[0])&&tmp.projector_height==Number(arr[1])){ + now_resolution.value=index + } + } + for (let index = 0; index < projectorlayout.length; index++) { + let arr = projectorlayout[index].label.split('x'); + if(tmp.row==Number(arr[0])&&tmp.col==Number(arr[1])){ + now_select_projectorlayout.value=index + } + } + } return { + re_match_data, + trigger_dialog, + confirm, + dialog, currently_selected_projector, name_to_be_deleted, dialog_del_scenes, diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index b7341fc..4941719 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -499,5 +499,6 @@ export default { "fusion out": "Out", "Please enter the square number": "Please enter the square number", "Change projector layout": "Change projector layout", - "reset all":"reset all" + "reset all":"reset all", + "Do you confirm the modification":"Do you confirm the modification" }; diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index 0c83077..634f544 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -766,5 +766,6 @@ export default { "fusion out": "出", "Please enter the square number":"请输入平方数", "Change projector layout":"更改投影机布局", - "reset all":"重置所有" + "reset all":"重置所有", + "Do you confirm the modification":"是否确认修改" };