diff --git a/src/components/FusionSettings/DensityCorrection.vue b/src/components/FusionSettings/DensityCorrection.vue index 249c38d..31f0034 100644 --- a/src/components/FusionSettings/DensityCorrection.vue +++ b/src/components/FusionSettings/DensityCorrection.vue @@ -154,12 +154,12 @@ export default defineComponent({ setup() { let $store = useStore(); let $t = useI18n(); - const value = reactive([{ x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}, { x: 0, y: 0 ,number:0}]); + const value = reactive([{ x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }, { x: 0, y: 0, number: 0 }]); let model = ref(null); const div = ref(); const isshowarray = ref([true, true, true, true, true, true, true, true, true, true]) const isactivearray = ref([true, true, true, true, true, true, true, true, true, true]) - const default_location: any = reactive([{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },]); + const default_location: any = reactive([{ x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 },]); let options = ref(['10', '20', '30', '40', '50']); let config = JSON.parse($store.state.fusion_configuration).projectors[0]; let Proportion = ref({ x: 0, y: 0 }); @@ -170,7 +170,7 @@ export default defineComponent({ return $store.getters.GetTheCurrentlySelectedCamera[0] * serverconfig.col + $store.getters.GetTheCurrentlySelectedCamera[1] }) const set_cache: any = ref([]); - const ste_status =ref(0); + const ste_status = ref(0); // //为了加载 缓存的配置时 同步点的位置 const syncpoint = () => { @@ -180,7 +180,7 @@ export default defineComponent({ } const use_set_cache = () => { - if (set_cache.value[selectedprojector.value]!=null) { + if (set_cache.value[selectedprojector.value] != null) { let tmp = JSON.parse(set_cache.value[selectedprojector.value]); deepcopy(value, tmp) syncpoint() @@ -211,33 +211,33 @@ export default defineComponent({ fortmp = JSON.parse(JSON.stringify(i)) } } - ste_status.value=1; + ste_status.value = 1; config = JSON.parse(JSON.stringify(fortmp)) use_server_config() use_set_cache() setTimeout(() => { - ste_status.value=0; + ste_status.value = 0; }, 100); }, { deep: true }) const initialization = () => { - ste_status.value=1; + ste_status.value = 1; for (let index = 0; index < config.hor_density.length; index++) { value[index].x = config.ver_density[index].x value[index].y = config.ver_density[index].y value[index].number = config.ver_density[index].number value[index + 5].x = config.hor_density[index].x value[index + 5].y = config.hor_density[index].y - value[index+5].number = config.hor_density[index].number + value[index + 5].number = config.hor_density[index].number } - if(sessionStorage.DensityCorrection&&sessionStorage.DensityCorrection.length>0){ - set_cache.value=JSON.parse(sessionStorage.DensityCorrection); + if (sessionStorage.DensityCorrection && sessionStorage.DensityCorrection.length > 0) { + set_cache.value = JSON.parse(sessionStorage.DensityCorrection); use_set_cache() - }else{ - + } else { + } syncpoint() setTimeout(() => { - ste_status.value=0; + ste_status.value = 0; }, 100); } @@ -250,11 +250,11 @@ export default defineComponent({ if (index >= 5) { value[index].x = config.hor_density[index - 5].def_x value[index].y = config.hor_density[index - 5].def_y - set?.SetBlendingVerDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index - 5+1, Number(value[index].x)); + set?.SetBlendingVerDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index - 5 + 1, Number(value[index].x)); } else { value[index].x = config.ver_density[index].def_x value[index].y = config.ver_density[index].def_y - set?.SetBlendingHorDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index+1, Number(value[index].y)) + set?.SetBlendingHorDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index + 1, Number(value[index].y)) } @@ -265,7 +265,7 @@ export default defineComponent({ isshowarray.value[index] = true }, 100); } - const point_postion: any = reactive([{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },{ x: 0, y: 0 },]) + const point_postion: any = reactive([{ x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 },]) let set = GlobalData.getInstance().getCurrentClient(); const save = () => { set?.SaveBlendingConfig("") @@ -293,7 +293,7 @@ export default defineComponent({ case 9: x = Math.ceil($event.left * Proportion.value.x); y = config.height / 2 - Math.ceil(($event.top - default_location[index].y) * Proportion.value.y); - + break; default: } @@ -302,19 +302,19 @@ export default defineComponent({ save_set_cache() } - const use_server_config=()=>{ + const use_server_config = () => { for (let index = 0; index < config.hor_density.length; index++) { value[index].x = config.ver_density[index].x value[index].y = config.ver_density[index].y value[index].number = config.ver_density[index].number value[index + 5].x = config.hor_density[index].x value[index + 5].y = config.hor_density[index].y - value[index+5].number = config.hor_density[index].number + value[index + 5].number = config.hor_density[index].number } } onMounted(() => { - + initialization() Proportion.value.x = config.width / (div.value.offsetWidth - 25) Proportion.value.y = config.height / (div.value.offsetHeight - 25) @@ -329,9 +329,32 @@ export default defineComponent({ point_postion[index].x = default_location[index].x = Width * (index - 5) } } - + }) + //窗口变动重新渲染 + onMounted(() => { + //监听窗口变化 + window.onresize = () => { + return (() => { + initialization() + Proportion.value.x = config.width / (div.value.offsetWidth - 25) + Proportion.value.y = config.height / (div.value.offsetHeight - 25) + let Width = (div.value.offsetWidth - 25) / 4 + let Height = (div.value.offsetHeight - 25) / 4 + for (let index = 0; index < config.hor_density.length + config.ver_density.length; index++) { + if (index < 5) { + point_postion[index].y = default_location[index].y = Height * index + point_postion[index].x = default_location[index].x = Width * 2 + } else { + point_postion[index].y = default_location[index].y = Height * 2 + point_postion[index].x = default_location[index].x = Width * (index - 5) + } + } + })(); + }; + }); + const setdianposin = (index: number, x: number, y: number) => { point_postion[index].x = x point_postion[index].y = y @@ -343,7 +366,7 @@ export default defineComponent({ } // watch(() => value[0], (newVal, oldVal) => { - send_configuration(0, newVal.y,newVal.number) + send_configuration(0, newVal.y, newVal.number) if (!isactivearray.value[0]) { let x = default_location[0].x; let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -353,7 +376,7 @@ export default defineComponent({ }, { deep: true }) watch(() => value[1], (newVal, oldVal) => { - send_configuration(1, newVal.y,newVal.number) + send_configuration(1, newVal.y, newVal.number) if (!isactivearray.value[1]) { let x = default_location[1].x; let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -364,7 +387,7 @@ export default defineComponent({ watch(() => value[2], (newVal, oldVal) => { //发送x y 唯一一个 - send_configuration(2, newVal.y,newVal.number) + send_configuration(2, newVal.y, newVal.number) if (!isactivearray.value[2]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -374,7 +397,7 @@ export default defineComponent({ }, { deep: true }) watch(() => value[3], (newVal, oldVal) => { - send_configuration(3, newVal.y,newVal.number) + send_configuration(3, newVal.y, newVal.number) if (!isactivearray.value[3]) { let x = default_location[3].x; let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -384,7 +407,7 @@ export default defineComponent({ }, { deep: true }) watch(() => value[4], (newVal, oldVal) => { - send_configuration(4, newVal.y,newVal.number) + send_configuration(4, newVal.y, newVal.number) if (!isactivearray.value[4]) { let x = default_location[4].x; let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -397,7 +420,7 @@ export default defineComponent({ /// watch(() => value[5], (newVal, oldVal) => { - send_configuration(5, newVal.x,newVal.number) + send_configuration(5, newVal.x, newVal.number) if (!isactivearray.value[5]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = default_location[5].y @@ -407,7 +430,7 @@ export default defineComponent({ }, { deep: true }) watch(() => value[6], (newVal, oldVal) => { - send_configuration(6, newVal.x,newVal.number) + send_configuration(6, newVal.x, newVal.number) if (!isactivearray.value[6]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = default_location[6].y @@ -417,7 +440,7 @@ export default defineComponent({ }, { deep: true }) watch(() => value[7], (newVal, oldVal) => { - send_configuration(7, newVal.x,newVal.number) + send_configuration(7, newVal.x, newVal.number) if (!isactivearray.value[7]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = default_location[7].y @@ -427,7 +450,7 @@ export default defineComponent({ }, { deep: true }) watch(() => value[8], (newVal, oldVal) => { - send_configuration(8, newVal.x,newVal.number) + send_configuration(8, newVal.x, newVal.number) if (!isactivearray.value[8]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = default_location[8].y @@ -437,8 +460,7 @@ export default defineComponent({ }, { deep: true }) watch(() => value[9], (newVal, oldVal) => { - //console.log(newVal) - send_configuration(9, newVal.x,newVal.number) + send_configuration(9, newVal.x, newVal.number) if (!isactivearray.value[9]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = default_location[9].y @@ -448,14 +470,13 @@ export default defineComponent({ }, { deep: true }) /// - const send_configuration = (index: number, value: number,number:number) => { - - if(ste_status.value==0){ - //console.log("Send") - if(index < 5){ - set?.SetBlendingVerDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index+1, Number(value)) - }else{ - set?.SetBlendingHorDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index-4, Number(value)); + const send_configuration = (index: number, value: number, number: number) => { + + if (ste_status.value == 0) { + if (index < 5) { + set?.SetBlendingVerDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index + 1, Number(value)) + } else { + set?.SetBlendingHorDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index - 4, Number(value)); } } save_set_cache() diff --git a/src/components/FusionSettings/FourPointCalibration.vue b/src/components/FusionSettings/FourPointCalibration.vue index 7367a77..b072b48 100644 --- a/src/components/FusionSettings/FourPointCalibration.vue +++ b/src/components/FusionSettings/FourPointCalibration.vue @@ -70,7 +70,7 @@ import vue3ResizeDrag from "src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue"; import { dom } from 'quasar' -import { defineComponent, ref, watch, computed, defineProps, withDefaults, onMounted, reactive,onBeforeUnmount } from "vue"; +import { defineComponent, ref, watch, computed, defineProps, withDefaults, onMounted, reactive, onBeforeUnmount } from "vue"; import { useStore } from "src/store"; import { useI18n } from "vue-i18n"; import ClientConnection from "src/common/ClientConnection" @@ -105,7 +105,7 @@ export default defineComponent({ let points = reactive([{ x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }]);//点的位置 const isshowarray = ref([true, true, true, true]) const isactivearray = ref([true, true, true, true]) - const ste_status =ref(0); + const ste_status = ref(0); const save = () => { set?.SaveBlendingConfig("") setTimeout(() => { @@ -114,11 +114,11 @@ export default defineComponent({ } /// const use_set_cache = () => { - if (set_cache.value[selectedprojector.value]!=null) { + if (set_cache.value[selectedprojector.value] != null) { let tmp = JSON.parse(set_cache.value[selectedprojector.value]); deepcopy(four, tmp) //four=JSON.parse(JSON.stringify(tmp)) - + } syncpoint() }; @@ -135,8 +135,8 @@ export default defineComponent({ const save_set_cache = () => { set_cache.value[selectedprojector.value] = JSON.stringify(four); } - onBeforeUnmount(()=>{ - sessionStorage.FourPointCalibration=JSON.stringify(set_cache.value) + onBeforeUnmount(() => { + sessionStorage.FourPointCalibration = JSON.stringify(set_cache.value) }) /// const activeMouseDown = (index: number) => { @@ -146,15 +146,15 @@ export default defineComponent({ isactivearray.value[index] = false } onMounted(() => { - ste_status.value=1; + ste_status.value = 1; setpoa(); setTimeout(() => { - ste_status.value=0; + ste_status.value = 0; }, 100); }) - const use_server_config=()=>{ + const use_server_config = () => { for (let index = 0; index < fourpostion.value.length; index++) { defaultfourpostion.value[index].x = fourpostion.value[index].x; defaultfourpostion.value[index].y = fourpostion.value[index].y; @@ -166,7 +166,7 @@ export default defineComponent({ } const setpoa = () => { - + points[0].x = 0 points[0].y = 0 @@ -203,17 +203,18 @@ export default defineComponent({ four[index].x = config.point4[index].x four[index].y = config.point4[index].y } - if(sessionStorage.FourPointCalibration&&sessionStorage.FourPointCalibration.length>0){ - set_cache.value=JSON.parse(sessionStorage.FourPointCalibration); + if (sessionStorage.FourPointCalibration && sessionStorage.FourPointCalibration.length > 0) { + set_cache.value = JSON.parse(sessionStorage.FourPointCalibration); use_set_cache() - }else{ - + } else { + } + set_point_x() //syncpoint() - + } watch(() => four[0], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, 1, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, 1, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[0]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -224,12 +225,12 @@ export default defineComponent({ setTimeout(() => { isshowarray.value[0] = true }, 100); - + } save_set_cache() }, { deep: true }) watch(() => four[1], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, 2, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, 2, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[1]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -240,12 +241,12 @@ export default defineComponent({ setTimeout(() => { isshowarray.value[1] = true }, 100); - + } save_set_cache() }, { deep: true }) watch(() => four[2], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, 3, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, 3, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[2]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil((config.height / Proportion.value.y) - (newVal.y / Proportion.value.y)); @@ -256,12 +257,12 @@ export default defineComponent({ setTimeout(() => { isshowarray.value[2] = true }, 100); - + } save_set_cache() }, { deep: true }) watch(() => four[3], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, 4, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, 4, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[3]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil((config.height / Proportion.value.y) - (newVal.y / Proportion.value.y)); @@ -272,7 +273,7 @@ export default defineComponent({ setTimeout(() => { isshowarray.value[3] = true }, 100); - + } save_set_cache() }, { deep: true }) @@ -287,23 +288,53 @@ export default defineComponent({ fortmp = JSON.parse(JSON.stringify(i)) } } - ste_status.value=1; + ste_status.value = 1; config = JSON.parse(JSON.stringify(fortmp)) //setpoa(); use_server_config() use_set_cache() setTimeout(() => { - ste_status.value=0; + ste_status.value = 0; }, 100); + set_point_x() }, { deep: true }) //为了加载 缓存的配置时 同步点的位置 - const syncpoint=()=>{ + const syncpoint = () => { for (let index = 0; index < fourpostion.value.length; index++) { - isactivearray.value[index]=false + isactivearray.value[index] = false } } + //手动同步 我裂开 + const set_point_x = () => { + //console.log("kaishi jisuan ") + let x = Math.ceil(four[0].x/ Proportion.value.x); + let y = Math.ceil(((config.height - four[0].y) / Proportion.value.y)); + set_point(0,x,y); + x = Math.ceil(four[1].x / Proportion.value.x); + y = Math.ceil(((config.height - four[1].y) / Proportion.value.y)); + set_point(1,x,y); + + x = Math.ceil(four[2].x / Proportion.value.x); + y = Math.ceil((config.height / Proportion.value.y) - (four[2].y / Proportion.value.y)); + set_point(2,x,y); + + x = Math.ceil(four[3].x / Proportion.value.x); + y = Math.ceil((config.height / Proportion.value.y) - (four[3].y / Proportion.value.y)); + set_point(3,x,y); + } + + const set_point = (index:number,x:number,y:number) => { + + points[index].x = x + points[index].y = y + isshowarray.value[index] = false + isactivearray.value[index] = false + setTimeout(() => { + isshowarray.value[index] = true + }, 100); + } const reset = (index: number) => { fourpostion.value[index].x = defaultfourpostion.value[index].x; fourpostion.value[index].y = defaultfourpostion.value[index].y; @@ -311,20 +342,20 @@ export default defineComponent({ four[index].x = config.point4[index].def_x four[index].y = config.point4[index].def_y - set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, index+1, Number(config.point4[index].def_x), Number(config.point4[index].def_y)); + set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 4, index + 1, Number(config.point4[index].def_x), Number(config.point4[index].def_y)); isshowarray.value[index] = false setTimeout(() => { isshowarray.value[index] = true }, 100); - + } const resetall = () => { for (let index = 0; index < fourpostion.value.length; index++) { reset(index) } - + } const moveHandler_1 = (data: any) => { @@ -357,6 +388,20 @@ export default defineComponent({ four[3].y = y > config.height ? config.height : y && y < 0 ? 0 : y; save_set_cache() } + //窗口变动重新渲染 + onMounted(() => { + //监听窗口变化 + window.onresize = () => { + return (() => { + ste_status.value = 1; + setpoa(); + + setTimeout(() => { + ste_status.value = 0; + }, 100); + })(); + }; + }); return { div, fourpostion, diff --git a/src/components/FusionSettings/FusionLocale.vue b/src/components/FusionSettings/FusionLocale.vue index c2e8d87..698e93a 100644 --- a/src/components/FusionSettings/FusionLocale.vue +++ b/src/components/FusionSettings/FusionLocale.vue @@ -9,11 +9,11 @@
- +
-
-
-
- +

{{ $t('Set Fusion Band Parameters') }}

@@ -137,7 +137,7 @@ export default defineComponent({ let set = GlobalData.getInstance().getCurrentClient(); let $store = useStore(); let $t = useI18n(); - const group = ref(0); + const group = ref(4); const set_cache: any = ref([]); const enablefusion = ref(false); let array: any = reactive([ @@ -145,6 +145,7 @@ export default defineComponent({ { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, + { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, ]); let serverconfig = JSON.parse($store.state.fusion_configuration); const selectedprojector = computed(() => { @@ -182,13 +183,14 @@ export default defineComponent({ } } ste_status.value = 1; - + config = JSON.parse(JSON.stringify(fortmp)) use_server_config() use_set_cache() setTimeout(() => { ste_status.value = 0; }, 100); + setnowindex() }, { deep: true }) const chang = (type: string) => { if (type == "alpha") { @@ -217,8 +219,34 @@ export default defineComponent({ } save_set_cache(); }; + + const setnowindex = () => { + let sum = 0; + let indexx = 4; + for (let index = 0; index < array.length - 1; index++) { + if (array[index].isshow && Number(array[index].value) > 0) { + sum++; + indexx = index; + } + } + if (sum == 1) { + group.value = indexx + } else { + group.value = 4 + } + } + + const getconfig = () => { + try { + set?.GetBlendingConfig("").then((res) => { }) + set?.GetBlendingConfig("").then((res) => { let tmp = JSON.parse(res ? res.config : ""); $store.commit("setEnablefusion", tmp.enable); $store.commit("setfusion_configuration", res?.config); }) + } catch (error) { + + } + + } const startconfig = () => { - for (let index = 0; index < array.length; index++) { + for (let index = 0; index < array.length - 1; index++) { array[index].gamma = config.params[index].gamma.toFixed(2) array[index].alpha = config.params[index].alpha.toFixed(2) array[index].p = config.params[index].power.toFixed(2) @@ -228,8 +256,9 @@ export default defineComponent({ if (sessionStorage.FusionLocale) set_cache.value = JSON.parse(sessionStorage.FusionLocale); use_set_cache() } - const use_server_config=()=>{ - for (let index = 0; index < array.length; index++) { + const use_server_config = () => { + + for (let index = 0; index < array.length - 1; index++) { array[index].gamma = config.params[index].gamma.toFixed(2) array[index].alpha = config.params[index].alpha.toFixed(2) array[index].p = config.params[index].power.toFixed(2) diff --git a/src/components/FusionSettings/SurfaceCorrection.vue b/src/components/FusionSettings/SurfaceCorrection.vue index be4fa82..49927a5 100644 --- a/src/components/FusionSettings/SurfaceCorrection.vue +++ b/src/components/FusionSettings/SurfaceCorrection.vue @@ -57,32 +57,32 @@
- {{ $t('point') }}1 - {{ $t('point') }}2 - {{ $t('point') }}3 - {{ $t('point') }}4 - {{ $t('point') }}5 - {{ $t('point') }}6 - {{ $t('point') }}7 - {{ $t('point') }}8 - {{ $t('point') }}9
@@ -100,8 +100,8 @@
-
+
+
import vue3ResizeDrag from "/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue"; import GlobalData from "src/common/GlobalData"; -import { defineComponent, ref, watch, computed, defineProps, withDefaults, onMounted ,onBeforeUnmount ,reactive} from "vue"; +import { defineComponent, ref, watch, computed, defineProps, withDefaults, onMounted, onBeforeUnmount, reactive } from "vue"; import { useStore } from "src/store"; import { useI18n } from "vue-i18n"; @@ -174,7 +174,7 @@ export default defineComponent({ }) const set_cache: any = ref([]); // - const ste_status =ref(0); + const ste_status = ref(0); const isshowarray = ref([true, true, true, true, true, true, true, true, true,]) const isactivearray = ref([true, true, true, true, true, true, true, true, true,]) let ninepostion: any = ref([{ x: 0, y: 1920 }, { x: 960, y: 1920 }, { x: 1080, y: 1920 }, { x: 0, y: 540 }, { x: 960, y: 540 }, { x: 1080, y: 540 }, { x: 0, y: 0 }, { x: 540, y: 0 }, { x: 1080, y: 0 }]); @@ -252,12 +252,11 @@ export default defineComponent({ } const use_set_cache = () => { - if (set_cache.value[selectedprojector.value]!=null) { + if (set_cache.value[selectedprojector.value] != null) { let tmp = JSON.parse(set_cache.value[selectedprojector.value]); deepcopy(nine, tmp) - + } - //console.log(nine) syncpoint() }; const deepcopy = (o1: any, o2: any) => { @@ -274,10 +273,10 @@ export default defineComponent({ set_cache.value[selectedprojector.value] = JSON.stringify(nine); } onBeforeUnmount(() => { - if(set_cache.value[selectedprojector.value]!=null){ + if (set_cache.value[selectedprojector.value] != null) { sessionStorage.SurfaceCorrection = JSON.stringify(set_cache.value) } - + }) watch(() => configselsect, (newVal, oldVal) => { @@ -289,16 +288,16 @@ export default defineComponent({ fortmp = JSON.parse(JSON.stringify(i)) } } - ste_status.value=1; + ste_status.value = 1; config = JSON.parse(JSON.stringify(fortmp)) use_server_config() use_set_cache() setTimeout(() => { - ste_status.value=0; + ste_status.value = 0; }, 100); }, { deep: true }) onMounted(() => { - ste_status.value=1; + ste_status.value = 1; startpostion(); for (let index = 0; index < defaultninepostion.value.length; index++) { defaultninepostion.value[index].x = ninepostion.value[index].x; @@ -309,9 +308,32 @@ export default defineComponent({ setninepostion(); syncpoint() setTimeout(() => { - ste_status.value=0; + ste_status.value = 0; }, 100); }) + + //窗口变动重新渲染 + onMounted(() => { + //监听窗口变化 + window.onresize = () => { + return (() => { + ste_status.value = 1; + startpostion(); + for (let index = 0; index < defaultninepostion.value.length; index++) { + defaultninepostion.value[index].x = ninepostion.value[index].x; + defaultninepostion.value[index].y = ninepostion.value[index].y; + defaultnine.value[index].x = config.point9[index].def_x + defaultnine.value[index].y = config.point9[index].def_y + } + setninepostion(); + syncpoint() + setTimeout(() => { + ste_status.value = 0; + }, 100); + })(); + }; + }); + const setninepostion = () => { for (let index = 0; index < defaultninepostion.value.length; index++) { nine[index].x = config.point9[index].x @@ -358,15 +380,15 @@ export default defineComponent({ defaultnine.value[index].x = nine[index].x defaultnine.value[index].y = nine[index].y } - if(sessionStorage.SurfaceCorrection&&sessionStorage.SurfaceCorrection.length>0){ - set_cache.value=JSON.parse(sessionStorage.SurfaceCorrection); + if (sessionStorage.SurfaceCorrection && sessionStorage.SurfaceCorrection.length > 0) { + set_cache.value = JSON.parse(sessionStorage.SurfaceCorrection); use_set_cache() - }else{ - + } else { + } syncpoint() } - const use_server_config=()=>{ + const use_server_config = () => { for (let index = 0; index < defaultninepostion.value.length; index++) { defaultninepostion.value[index].x = ninepostion.value[index].x; defaultninepostion.value[index].y = ninepostion.value[index].y; @@ -381,7 +403,7 @@ export default defineComponent({ nine[index].x = config.point9[index].def_x nine[index].y = config.point9[index].def_y - set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, index+1, Number(config.point9[index].def_x), Number(config.point9[index].def_y)); + set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, index + 1, Number(config.point9[index].def_x), Number(config.point9[index].def_y)); isshowarray.value[index] = false setTimeout(() => { @@ -394,7 +416,7 @@ export default defineComponent({ } } watch(() => nine[0], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 1, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 1, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[0]) { let x = Math.ceil(newVal.x / Proportion.value.x); @@ -405,7 +427,7 @@ export default defineComponent({ }, { deep: true }) watch(() => nine[1], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 2, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 2, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[1]) { let x = Math.ceil(newVal.x / Proportion.value.x); @@ -416,7 +438,7 @@ export default defineComponent({ }, { deep: true }) watch(() => nine[2], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 3, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 3, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[2]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -425,7 +447,7 @@ export default defineComponent({ save_set_cache() }, { deep: true }) watch(() => nine[3], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 4, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 4, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[3]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -434,7 +456,7 @@ export default defineComponent({ save_set_cache() }, { deep: true }) watch(() => nine[4], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 5, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 5, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[4]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -443,7 +465,7 @@ export default defineComponent({ save_set_cache() }, { deep: true }) watch(() => nine[5], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 6, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 6, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[5]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -452,7 +474,7 @@ export default defineComponent({ save_set_cache() }, { deep: true }) watch(() => nine[6], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 7, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 7, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[6]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -461,7 +483,7 @@ export default defineComponent({ save_set_cache() }, { deep: true }) watch(() => nine[7], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 8, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 8, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[7]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -470,7 +492,7 @@ export default defineComponent({ save_set_cache() }, { deep: true }) watch(() => nine[8], (newVal, oldVal) => { - if ($store.state.enablefusion&&ste_status.value==0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 9, Number(newVal.x), Number(newVal.y)); + if ($store.state.enablefusion && ste_status.value == 0) set?.setBlendingCorrection($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 9, 9, Number(newVal.x), Number(newVal.y)); if (!isactivearray.value[8]) { let x = Math.ceil(newVal.x / Proportion.value.x); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); @@ -488,7 +510,7 @@ export default defineComponent({ setTimeout(() => { isshowarray.value[index] = true }, 100); - + } const save = () => { set?.SaveBlendingConfig("") diff --git a/src/components/FusionSettingsDialog.vue b/src/components/FusionSettingsDialog.vue index 51fbe48..f6b4dce 100644 --- a/src/components/FusionSettingsDialog.vue +++ b/src/components/FusionSettingsDialog.vue @@ -134,18 +134,17 @@ export default defineComponent({ show_dialog.value = true; }; const resize = ref(true) - //窗口变动重新渲染 - onMounted(() => { - //监听窗口变化 - window.onresize = () => { - return (() => { - console.log("resize") - resize.value = false; setTimeout(() => { - resize.value = true - }, 100); - })(); - }; - }); + // //窗口变动重新渲染 + // onMounted(() => { + // //监听窗口变化 + // window.onresize = () => { + // return (() => { + // resize.value = false; setTimeout(() => { + // resize.value = true + // }, 100); + // })(); + // }; + // }); //投影机数量 @@ -185,6 +184,15 @@ export default defineComponent({ clear() set?.GetBlendingConfig("").then((res) => { let tmp = JSON.parse(res ? res.config : ""); EnableBlending.value = tmp.enable; $store.commit("setEnablefusion", tmp.enable); config.value.col = tmp.col; config.value.row = tmp.row; $store.commit("setfusion_configuration", res?.config); }) } + const getconfig=()=>{ + try { + set?.GetBlendingConfig("").then((res)=>{}) + set?.GetBlendingConfig("").then((res) => { let tmp = JSON.parse(res ? res.config : ""); $store.commit("setEnablefusion", tmp.enable); $store.commit("setfusion_configuration", res?.config); }) + } catch (error) { + + } + + } const clear = () => { sessionStorage.removeItem('DensityCorrection') @@ -195,6 +203,7 @@ export default defineComponent({ setTimeout(() => { sessionStorage.removeItem('FusionLocale') }, 500) + getconfig() } onBeforeMount(() => { @@ -210,7 +219,7 @@ export default defineComponent({ } - }, 500); + }, 1000); }) return { resize, diff --git a/src/pages/TopToolBar.vue b/src/pages/TopToolBar.vue index 31baac0..52151ba 100644 --- a/src/pages/TopToolBar.vue +++ b/src/pages/TopToolBar.vue @@ -599,6 +599,7 @@ export default defineComponent({ const getconfig=()=>{ try { set?.GetBlendingConfig("").then((res)=>{}) + set?.GetBlendingConfig("").then((res) => { let tmp = JSON.parse(res ? res.config : ""); $store.commit("setEnablefusion", tmp.enable); $store.commit("setfusion_configuration", res?.config); }) } catch (error) { }