优化窗口大小更改时逻辑

This commit is contained in:
shefengchun 2023-01-13 09:27:00 +08:00
parent 4d967cb4ae
commit ff63d3dc67
6 changed files with 272 additions and 145 deletions

View File

@ -154,12 +154,12 @@ export default defineComponent({
setup() { setup() {
let $store = useStore(); let $store = useStore();
let $t = useI18n(); 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); let model = ref(null);
const div = ref(); const div = ref();
const isshowarray = ref([true, true, true, true, true, true, true, true, true, true]) 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 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 options = ref(['10', '20', '30', '40', '50']);
let config = JSON.parse($store.state.fusion_configuration).projectors[0]; let config = JSON.parse($store.state.fusion_configuration).projectors[0];
let Proportion = ref({ x: 0, y: 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] return $store.getters.GetTheCurrentlySelectedCamera[0] * serverconfig.col + $store.getters.GetTheCurrentlySelectedCamera[1]
}) })
const set_cache: any = ref([]); const set_cache: any = ref([]);
const ste_status =ref(0); const ste_status = ref(0);
// //
// //
const syncpoint = () => { const syncpoint = () => {
@ -180,7 +180,7 @@ export default defineComponent({
} }
const use_set_cache = () => { 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]); let tmp = JSON.parse(set_cache.value[selectedprojector.value]);
deepcopy(value, tmp) deepcopy(value, tmp)
syncpoint() syncpoint()
@ -211,33 +211,33 @@ export default defineComponent({
fortmp = JSON.parse(JSON.stringify(i)) fortmp = JSON.parse(JSON.stringify(i))
} }
} }
ste_status.value=1; ste_status.value = 1;
config = JSON.parse(JSON.stringify(fortmp)) config = JSON.parse(JSON.stringify(fortmp))
use_server_config() use_server_config()
use_set_cache() use_set_cache()
setTimeout(() => { setTimeout(() => {
ste_status.value=0; ste_status.value = 0;
}, 100); }, 100);
}, { deep: true }) }, { deep: true })
const initialization = () => { const initialization = () => {
ste_status.value=1; ste_status.value = 1;
for (let index = 0; index < config.hor_density.length; index++) { for (let index = 0; index < config.hor_density.length; index++) {
value[index].x = config.ver_density[index].x value[index].x = config.ver_density[index].x
value[index].y = config.ver_density[index].y value[index].y = config.ver_density[index].y
value[index].number = config.ver_density[index].number value[index].number = config.ver_density[index].number
value[index + 5].x = config.hor_density[index].x value[index + 5].x = config.hor_density[index].x
value[index + 5].y = config.hor_density[index].y 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){ if (sessionStorage.DensityCorrection && sessionStorage.DensityCorrection.length > 0) {
set_cache.value=JSON.parse(sessionStorage.DensityCorrection); set_cache.value = JSON.parse(sessionStorage.DensityCorrection);
use_set_cache() use_set_cache()
}else{ } else {
} }
syncpoint() syncpoint()
setTimeout(() => { setTimeout(() => {
ste_status.value=0; ste_status.value = 0;
}, 100); }, 100);
} }
@ -250,11 +250,11 @@ export default defineComponent({
if (index >= 5) { if (index >= 5) {
value[index].x = config.hor_density[index - 5].def_x value[index].x = config.hor_density[index - 5].def_x
value[index].y = config.hor_density[index - 5].def_y 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 { } else {
value[index].x = config.ver_density[index].def_x value[index].x = config.ver_density[index].def_x
value[index].y = config.ver_density[index].def_y 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 isshowarray.value[index] = true
}, 100); }, 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(); let set = GlobalData.getInstance().getCurrentClient();
const save = () => { const save = () => {
set?.SaveBlendingConfig("") set?.SaveBlendingConfig("")
@ -302,14 +302,14 @@ export default defineComponent({
save_set_cache() save_set_cache()
} }
const use_server_config=()=>{ const use_server_config = () => {
for (let index = 0; index < config.hor_density.length; index++) { for (let index = 0; index < config.hor_density.length; index++) {
value[index].x = config.ver_density[index].x value[index].x = config.ver_density[index].x
value[index].y = config.ver_density[index].y value[index].y = config.ver_density[index].y
value[index].number = config.ver_density[index].number value[index].number = config.ver_density[index].number
value[index + 5].x = config.hor_density[index].x value[index + 5].x = config.hor_density[index].x
value[index + 5].y = config.hor_density[index].y 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
} }
} }
@ -332,6 +332,29 @@ export default defineComponent({
}) })
//
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) => { const setdianposin = (index: number, x: number, y: number) => {
point_postion[index].x = x point_postion[index].x = x
point_postion[index].y = y point_postion[index].y = y
@ -343,7 +366,7 @@ export default defineComponent({
} }
// //
watch(() => value[0], (newVal, oldVal) => { watch(() => value[0], (newVal, oldVal) => {
send_configuration(0, newVal.y,newVal.number) send_configuration(0, newVal.y, newVal.number)
if (!isactivearray.value[0]) { if (!isactivearray.value[0]) {
let x = default_location[0].x; let x = default_location[0].x;
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -353,7 +376,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => value[1], (newVal, oldVal) => { watch(() => value[1], (newVal, oldVal) => {
send_configuration(1, newVal.y,newVal.number) send_configuration(1, newVal.y, newVal.number)
if (!isactivearray.value[1]) { if (!isactivearray.value[1]) {
let x = default_location[1].x; let x = default_location[1].x;
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -364,7 +387,7 @@ export default defineComponent({
watch(() => value[2], (newVal, oldVal) => { watch(() => value[2], (newVal, oldVal) => {
//x y //x y
send_configuration(2, newVal.y,newVal.number) send_configuration(2, newVal.y, newVal.number)
if (!isactivearray.value[2]) { if (!isactivearray.value[2]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -374,7 +397,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => value[3], (newVal, oldVal) => { watch(() => value[3], (newVal, oldVal) => {
send_configuration(3, newVal.y,newVal.number) send_configuration(3, newVal.y, newVal.number)
if (!isactivearray.value[3]) { if (!isactivearray.value[3]) {
let x = default_location[3].x; let x = default_location[3].x;
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -384,7 +407,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => value[4], (newVal, oldVal) => { watch(() => value[4], (newVal, oldVal) => {
send_configuration(4, newVal.y,newVal.number) send_configuration(4, newVal.y, newVal.number)
if (!isactivearray.value[4]) { if (!isactivearray.value[4]) {
let x = default_location[4].x; let x = default_location[4].x;
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -397,7 +420,7 @@ export default defineComponent({
/// ///
watch(() => value[5], (newVal, oldVal) => { watch(() => value[5], (newVal, oldVal) => {
send_configuration(5, newVal.x,newVal.number) send_configuration(5, newVal.x, newVal.number)
if (!isactivearray.value[5]) { if (!isactivearray.value[5]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = default_location[5].y let y = default_location[5].y
@ -407,7 +430,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => value[6], (newVal, oldVal) => { watch(() => value[6], (newVal, oldVal) => {
send_configuration(6, newVal.x,newVal.number) send_configuration(6, newVal.x, newVal.number)
if (!isactivearray.value[6]) { if (!isactivearray.value[6]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = default_location[6].y let y = default_location[6].y
@ -417,7 +440,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => value[7], (newVal, oldVal) => { watch(() => value[7], (newVal, oldVal) => {
send_configuration(7, newVal.x,newVal.number) send_configuration(7, newVal.x, newVal.number)
if (!isactivearray.value[7]) { if (!isactivearray.value[7]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = default_location[7].y let y = default_location[7].y
@ -427,7 +450,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => value[8], (newVal, oldVal) => { watch(() => value[8], (newVal, oldVal) => {
send_configuration(8, newVal.x,newVal.number) send_configuration(8, newVal.x, newVal.number)
if (!isactivearray.value[8]) { if (!isactivearray.value[8]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = default_location[8].y let y = default_location[8].y
@ -437,8 +460,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => value[9], (newVal, oldVal) => { 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]) { if (!isactivearray.value[9]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = default_location[9].y let y = default_location[9].y
@ -448,14 +470,13 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
/// ///
const send_configuration = (index: number, value: number,number:number) => { const send_configuration = (index: number, value: number, number: number) => {
if(ste_status.value==0){ if (ste_status.value == 0) {
//console.log("Send") if (index < 5) {
if(index < 5){ set?.SetBlendingVerDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index + 1, Number(value))
set?.SetBlendingVerDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index+1, Number(value)) } else {
}else{ set?.SetBlendingHorDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index - 4, Number(value));
set?.SetBlendingHorDensity($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], index-4, Number(value));
} }
} }
save_set_cache() save_set_cache()

View File

@ -70,7 +70,7 @@
import vue3ResizeDrag from "src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue"; import vue3ResizeDrag from "src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue";
import { dom } from 'quasar' 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 { useStore } from "src/store";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import ClientConnection from "src/common/ClientConnection" 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 }]);// 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 isshowarray = ref([true, true, true, true])
const isactivearray = ref([true, true, true, true]) const isactivearray = ref([true, true, true, true])
const ste_status =ref(0); const ste_status = ref(0);
const save = () => { const save = () => {
set?.SaveBlendingConfig("") set?.SaveBlendingConfig("")
setTimeout(() => { setTimeout(() => {
@ -114,7 +114,7 @@ export default defineComponent({
} }
/// ///
const use_set_cache = () => { 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]); let tmp = JSON.parse(set_cache.value[selectedprojector.value]);
deepcopy(four, tmp) deepcopy(four, tmp)
//four=JSON.parse(JSON.stringify(tmp)) //four=JSON.parse(JSON.stringify(tmp))
@ -135,8 +135,8 @@ export default defineComponent({
const save_set_cache = () => { const save_set_cache = () => {
set_cache.value[selectedprojector.value] = JSON.stringify(four); set_cache.value[selectedprojector.value] = JSON.stringify(four);
} }
onBeforeUnmount(()=>{ onBeforeUnmount(() => {
sessionStorage.FourPointCalibration=JSON.stringify(set_cache.value) sessionStorage.FourPointCalibration = JSON.stringify(set_cache.value)
}) })
/// ///
const activeMouseDown = (index: number) => { const activeMouseDown = (index: number) => {
@ -146,15 +146,15 @@ export default defineComponent({
isactivearray.value[index] = false isactivearray.value[index] = false
} }
onMounted(() => { onMounted(() => {
ste_status.value=1; ste_status.value = 1;
setpoa(); setpoa();
setTimeout(() => { setTimeout(() => {
ste_status.value=0; ste_status.value = 0;
}, 100); }, 100);
}) })
const use_server_config=()=>{ const use_server_config = () => {
for (let index = 0; index < fourpostion.value.length; index++) { for (let index = 0; index < fourpostion.value.length; index++) {
defaultfourpostion.value[index].x = fourpostion.value[index].x; defaultfourpostion.value[index].x = fourpostion.value[index].x;
defaultfourpostion.value[index].y = fourpostion.value[index].y; defaultfourpostion.value[index].y = fourpostion.value[index].y;
@ -203,17 +203,18 @@ export default defineComponent({
four[index].x = config.point4[index].x four[index].x = config.point4[index].x
four[index].y = config.point4[index].y four[index].y = config.point4[index].y
} }
if(sessionStorage.FourPointCalibration&&sessionStorage.FourPointCalibration.length>0){ if (sessionStorage.FourPointCalibration && sessionStorage.FourPointCalibration.length > 0) {
set_cache.value=JSON.parse(sessionStorage.FourPointCalibration); set_cache.value = JSON.parse(sessionStorage.FourPointCalibration);
use_set_cache() use_set_cache()
}else{ } else {
} }
set_point_x()
//syncpoint() //syncpoint()
} }
watch(() => four[0], (newVal, oldVal) => { 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]) { if (!isactivearray.value[0]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -229,7 +230,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => four[1], (newVal, oldVal) => { 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]) { if (!isactivearray.value[1]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -245,7 +246,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => four[2], (newVal, oldVal) => { 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]) { if (!isactivearray.value[2]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil((config.height / Proportion.value.y) - (newVal.y / Proportion.value.y)); let y = Math.ceil((config.height / Proportion.value.y) - (newVal.y / Proportion.value.y));
@ -261,7 +262,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => four[3], (newVal, oldVal) => { 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]) { if (!isactivearray.value[3]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil((config.height / Proportion.value.y) - (newVal.y / Proportion.value.y)); let y = Math.ceil((config.height / Proportion.value.y) - (newVal.y / Proportion.value.y));
@ -287,23 +288,53 @@ export default defineComponent({
fortmp = JSON.parse(JSON.stringify(i)) fortmp = JSON.parse(JSON.stringify(i))
} }
} }
ste_status.value=1; ste_status.value = 1;
config = JSON.parse(JSON.stringify(fortmp)) config = JSON.parse(JSON.stringify(fortmp))
//setpoa(); //setpoa();
use_server_config() use_server_config()
use_set_cache() use_set_cache()
setTimeout(() => { setTimeout(() => {
ste_status.value=0; ste_status.value = 0;
}, 100); }, 100);
set_point_x()
}, { deep: true }) }, { deep: true })
// //
const syncpoint=()=>{ const syncpoint = () => {
for (let index = 0; index < fourpostion.value.length; index++) { 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) => { const reset = (index: number) => {
fourpostion.value[index].x = defaultfourpostion.value[index].x; fourpostion.value[index].x = defaultfourpostion.value[index].x;
fourpostion.value[index].y = defaultfourpostion.value[index].y; fourpostion.value[index].y = defaultfourpostion.value[index].y;
@ -311,7 +342,7 @@ export default defineComponent({
four[index].x = config.point4[index].def_x four[index].x = config.point4[index].def_x
four[index].y = config.point4[index].def_y 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 isshowarray.value[index] = false
setTimeout(() => { setTimeout(() => {
@ -357,6 +388,20 @@ export default defineComponent({
four[3].y = y > config.height ? config.height : y && y < 0 ? 0 : y; four[3].y = y > config.height ? config.height : y && y < 0 ? 0 : y;
save_set_cache() save_set_cache()
} }
//
onMounted(() => {
//
window.onresize = () => {
return (() => {
ste_status.value = 1;
setpoa();
setTimeout(() => {
ste_status.value = 0;
}, 100);
})();
};
});
return { return {
div, div,
fourpostion, fourpostion,

View File

@ -12,8 +12,8 @@
<q-toggle class="float-right" v-model="array[0].isshow" label="" /> <q-toggle class="float-right" v-model="array[0].isshow" label="" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled type="number" :bg-color="group==0?'cyan-1':''" @focus="group = 0" v-model="array[0].value" <q-input filled type="number" :bg-color="group == 0 ? 'cyan-1' : ''" @focus="group = 0"
:label="$t('upper fusion zone parameters')" lazy-rules :rules="[ v-model="array[0].value" :label="$t('upper fusion zone parameters')" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || $t('Please enter a number'), (val !== null && val !== '') || $t('Please enter a number'),
(val) => (val) =>
@ -32,8 +32,8 @@
<q-toggle class="float-right" v-model="array[1].isshow" label="" /> <q-toggle class="float-right" v-model="array[1].isshow" label="" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled type="number" :bg-color="group==1?'cyan-1':''" @focus="group = 1" v-model="array[1].value" <q-input filled type="number" :bg-color="group == 1 ? 'cyan-1' : ''" @focus="group = 1"
:label="$t('Left fusion Band Parameters')" lazy-rules :rules="[ v-model="array[1].value" :label="$t('Left fusion Band Parameters')" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || $t('Please enter a number'), (val !== null && val !== '') || $t('Please enter a number'),
(val) => (val) =>
@ -48,8 +48,8 @@
<q-toggle class="float-right" v-model="array[2].isshow" label="" /> <q-toggle class="float-right" v-model="array[2].isshow" label="" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled type="number" :bg-color="group==2?'cyan-1':''" @focus="group = 2" v-model="array[2].value" <q-input filled type="number" :bg-color="group == 2 ? 'cyan-1' : ''" @focus="group = 2"
:label="$t('Right fusion Band Parameters')" lazy-rules :rules="[ v-model="array[2].value" :label="$t('Right fusion Band Parameters')" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || $t('Please enter a number'), (val !== null && val !== '') || $t('Please enter a number'),
(val) => (val) =>
@ -68,8 +68,8 @@
<q-toggle class="float-right" v-model="array[3].isshow" label="" /> <q-toggle class="float-right" v-model="array[3].isshow" label="" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled type="number" :bg-color="group==3?'cyan-1':''" @focus="group = 3" v-model="array[3].value" <q-input filled type="number" :bg-color="group == 3 ? 'cyan-1' : ''" @focus="group = 3"
:label="$t('Lower fusion Zone Parameters')" lazy-rules :rules="[ v-model="array[3].value" :label="$t('Lower fusion Zone Parameters')" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || $t('Please enter a number'), (val !== null && val !== '') || $t('Please enter a number'),
(val) => (val) =>
@ -83,7 +83,7 @@
</div> </div>
</div> </div>
<div class="col-4 offset-4"> <div class="col-4 offset-4" v-if="group != 4">
<p class="text-center">{{ $t('Set Fusion Band Parameters') }}</p> <p class="text-center">{{ $t('Set Fusion Band Parameters') }}</p>
<div style="display: flex; justify-content: space-evenly"> <div style="display: flex; justify-content: space-evenly">
<div> <div>
@ -137,7 +137,7 @@ export default defineComponent({
let set = GlobalData.getInstance().getCurrentClient(); let set = GlobalData.getInstance().getCurrentClient();
let $store = useStore(); let $store = useStore();
let $t = useI18n(); let $t = useI18n();
const group = ref(0); const group = ref(4);
const set_cache: any = ref([]); const set_cache: any = ref([]);
const enablefusion = ref(false); const enablefusion = ref(false);
let array: any = reactive([ 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 },
{ 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); let serverconfig = JSON.parse($store.state.fusion_configuration);
const selectedprojector = computed(() => { const selectedprojector = computed(() => {
@ -189,6 +190,7 @@ export default defineComponent({
setTimeout(() => { setTimeout(() => {
ste_status.value = 0; ste_status.value = 0;
}, 100); }, 100);
setnowindex()
}, { deep: true }) }, { deep: true })
const chang = (type: string) => { const chang = (type: string) => {
if (type == "alpha") { if (type == "alpha") {
@ -217,8 +219,34 @@ export default defineComponent({
} }
save_set_cache(); 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 = () => { 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].gamma = config.params[index].gamma.toFixed(2)
array[index].alpha = config.params[index].alpha.toFixed(2) array[index].alpha = config.params[index].alpha.toFixed(2)
array[index].p = config.params[index].power.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() if (sessionStorage.FusionLocale) set_cache.value = JSON.parse(sessionStorage.FusionLocale); use_set_cache()
} }
const use_server_config=()=>{ const use_server_config = () => {
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].gamma = config.params[index].gamma.toFixed(2)
array[index].alpha = config.params[index].alpha.toFixed(2) array[index].alpha = config.params[index].alpha.toFixed(2)
array[index].p = config.params[index].power.toFixed(2) array[index].p = config.params[index].power.toFixed(2)

View File

@ -57,32 +57,32 @@
<div class="col-8"> <div class="col-8">
<div ref="div" style="background-color: #7fffd4;height: 40vh;"> <div ref="div" style="background-color: #7fffd4;height: 40vh;">
<div style="position:absolute;"> <div style="position:absolute;">
<vue3ResizeDrag :isActive="isactivearray[0]" v-if="isshowarray[0]" :w="30" :h="20" :x="ninepostion[0].x" <vue3ResizeDrag :isActive="isactivearray[0]" v-if="isshowarray[0]" :w="30" :h="20"
:y="ninepostion[0].y" @mousedown="activeMouseDown(0)" :isResizable="false" :x="ninepostion[0].x" :y="ninepostion[0].y" @mousedown="activeMouseDown(0)" :isResizable="false"
@moveHandler="moveHandler_1"><span>{{ $t('point') }}1</span> </vue3ResizeDrag> @moveHandler="moveHandler_1"><span>{{ $t('point') }}1</span> </vue3ResizeDrag>
<vue3ResizeDrag :isActive="isactivearray[1]" v-if="isshowarray[1]" :w="30" :h="20" :x="ninepostion[1].x" <vue3ResizeDrag :isActive="isactivearray[1]" v-if="isshowarray[1]" :w="30" :h="20"
:y="ninepostion[1].y" @mousedown="activeMouseDown(1)" :isResizable="false" :x="ninepostion[1].x" :y="ninepostion[1].y" @mousedown="activeMouseDown(1)" :isResizable="false"
@moveHandler="moveHandler_2"><span>{{ $t('point') }}2</span> </vue3ResizeDrag> @moveHandler="moveHandler_2"><span>{{ $t('point') }}2</span> </vue3ResizeDrag>
<vue3ResizeDrag :isActive="isactivearray[2]" v-if="isshowarray[2]" :w="30" :h="20" :x="ninepostion[2].x" <vue3ResizeDrag :isActive="isactivearray[2]" v-if="isshowarray[2]" :w="30" :h="20"
:y="ninepostion[2].y" @mousedown="activeMouseDown(2)" :isResizable="false" :x="ninepostion[2].x" :y="ninepostion[2].y" @mousedown="activeMouseDown(2)" :isResizable="false"
@moveHandler="moveHandler_3"><span>{{ $t('point') }}3</span> </vue3ResizeDrag> @moveHandler="moveHandler_3"><span>{{ $t('point') }}3</span> </vue3ResizeDrag>
<vue3ResizeDrag :isActive="isactivearray[3]" v-if="isshowarray[3]" :w="30" :h="20" :x="ninepostion[3].x" <vue3ResizeDrag :isActive="isactivearray[3]" v-if="isshowarray[3]" :w="30" :h="20"
:y="ninepostion[3].y" @mousedown="activeMouseDown(3)" :isResizable="false" :x="ninepostion[3].x" :y="ninepostion[3].y" @mousedown="activeMouseDown(3)" :isResizable="false"
@moveHandler="moveHandler_4"><span>{{ $t('point') }}4</span> </vue3ResizeDrag> @moveHandler="moveHandler_4"><span>{{ $t('point') }}4</span> </vue3ResizeDrag>
<vue3ResizeDrag :isActive="isactivearray[4]" v-if="isshowarray[4]" :w="30" :h="20" :x="ninepostion[4].x" <vue3ResizeDrag :isActive="isactivearray[4]" v-if="isshowarray[4]" :w="30" :h="20"
:y="ninepostion[4].y" @mousedown="activeMouseDown(4)" :isResizable="false" :x="ninepostion[4].x" :y="ninepostion[4].y" @mousedown="activeMouseDown(4)" :isResizable="false"
@moveHandler="moveHandler_5"><span>{{ $t('point') }}5</span> </vue3ResizeDrag> @moveHandler="moveHandler_5"><span>{{ $t('point') }}5</span> </vue3ResizeDrag>
<vue3ResizeDrag :isActive="isactivearray[5]" v-if="isshowarray[5]" :w="30" :h="20" :x="ninepostion[5].x" <vue3ResizeDrag :isActive="isactivearray[5]" v-if="isshowarray[5]" :w="30" :h="20"
:y="ninepostion[5].y" @mousedown="activeMouseDown(5)" :isResizable="false" :x="ninepostion[5].x" :y="ninepostion[5].y" @mousedown="activeMouseDown(5)" :isResizable="false"
@moveHandler="moveHandler_6"><span>{{ $t('point') }}6</span> </vue3ResizeDrag> @moveHandler="moveHandler_6"><span>{{ $t('point') }}6</span> </vue3ResizeDrag>
<vue3ResizeDrag :isActive="isactivearray[6]" v-if="isshowarray[6]" :w="30" :h="20" :x="ninepostion[6].x" <vue3ResizeDrag :isActive="isactivearray[6]" v-if="isshowarray[6]" :w="30" :h="20"
:y="ninepostion[6].y" @mousedown="activeMouseDown(6)" :isResizable="false" :x="ninepostion[6].x" :y="ninepostion[6].y" @mousedown="activeMouseDown(6)" :isResizable="false"
@moveHandler="moveHandler_7"><span>{{ $t('point') }}7</span> </vue3ResizeDrag> @moveHandler="moveHandler_7"><span>{{ $t('point') }}7</span> </vue3ResizeDrag>
<vue3ResizeDrag :isActive="isactivearray[7]" v-if="isshowarray[7]" :w="30" :h="20" :x="ninepostion[7].x" <vue3ResizeDrag :isActive="isactivearray[7]" v-if="isshowarray[7]" :w="30" :h="20"
:y="ninepostion[7].y" @mousedown="activeMouseDown(7)" :isResizable="false" :x="ninepostion[7].x" :y="ninepostion[7].y" @mousedown="activeMouseDown(7)" :isResizable="false"
@moveHandler="moveHandler_8"><span>{{ $t('point') }}8</span> </vue3ResizeDrag> @moveHandler="moveHandler_8"><span>{{ $t('point') }}8</span> </vue3ResizeDrag>
<vue3ResizeDrag :isActive="isactivearray[8]" v-if="isshowarray[8]" :w="30" :h="20" :x="ninepostion[8].x" <vue3ResizeDrag :isActive="isactivearray[8]" v-if="isshowarray[8]" :w="30" :h="20"
:y="ninepostion[8].y" @mousedown="activeMouseDown(8)" :isResizable="false" :x="ninepostion[8].x" :y="ninepostion[8].y" @mousedown="activeMouseDown(8)" :isResizable="false"
@moveHandler="moveHandler_9"><span>{{ $t('point') }}9</span> </vue3ResizeDrag> @moveHandler="moveHandler_9"><span>{{ $t('point') }}9</span> </vue3ResizeDrag>
</div> </div>
</div> </div>
@ -100,8 +100,8 @@
</div> </div>
<div class="col-4"> <div class="col-4">
<div class="row"> <div class="row">
<div class="col-6"> <q-btn color="white" @click="resetall" text-color="black" <div class="col-6"> <q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall')" />
:label="$t('resetall')" /></div> </div>
<div class="col-3"> <q-input filled type="number" @focus="isactivearray[6] = false" class="q-pt-md" <div class="col-3"> <q-input filled type="number" @focus="isactivearray[6] = false" class="q-pt-md"
:dense="true" v-model="nine[6].x" label="x" lazy-rules /> :dense="true" v-model="nine[6].x" label="x" lazy-rules />
<q-input filled type="number" class="q-pt-md" @focus="isactivearray[6] = false" :dense="true" <q-input filled type="number" class="q-pt-md" @focus="isactivearray[6] = false" :dense="true"
@ -144,7 +144,7 @@
<script lang="ts"> <script lang="ts">
import vue3ResizeDrag from "/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue"; import vue3ResizeDrag from "/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue";
import GlobalData from "src/common/GlobalData"; 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 { useStore } from "src/store";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
@ -174,7 +174,7 @@ export default defineComponent({
}) })
const set_cache: any = ref([]); 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 isshowarray = ref([true, true, true, true, true, true, true, true, true,])
const isactivearray = 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 }]); 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 = () => { 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]); let tmp = JSON.parse(set_cache.value[selectedprojector.value]);
deepcopy(nine, tmp) deepcopy(nine, tmp)
} }
//console.log(nine)
syncpoint() syncpoint()
}; };
const deepcopy = (o1: any, o2: any) => { const deepcopy = (o1: any, o2: any) => {
@ -274,7 +273,7 @@ export default defineComponent({
set_cache.value[selectedprojector.value] = JSON.stringify(nine); set_cache.value[selectedprojector.value] = JSON.stringify(nine);
} }
onBeforeUnmount(() => { onBeforeUnmount(() => {
if(set_cache.value[selectedprojector.value]!=null){ if (set_cache.value[selectedprojector.value] != null) {
sessionStorage.SurfaceCorrection = JSON.stringify(set_cache.value) sessionStorage.SurfaceCorrection = JSON.stringify(set_cache.value)
} }
@ -289,16 +288,16 @@ export default defineComponent({
fortmp = JSON.parse(JSON.stringify(i)) fortmp = JSON.parse(JSON.stringify(i))
} }
} }
ste_status.value=1; ste_status.value = 1;
config = JSON.parse(JSON.stringify(fortmp)) config = JSON.parse(JSON.stringify(fortmp))
use_server_config() use_server_config()
use_set_cache() use_set_cache()
setTimeout(() => { setTimeout(() => {
ste_status.value=0; ste_status.value = 0;
}, 100); }, 100);
}, { deep: true }) }, { deep: true })
onMounted(() => { onMounted(() => {
ste_status.value=1; ste_status.value = 1;
startpostion(); startpostion();
for (let index = 0; index < defaultninepostion.value.length; index++) { for (let index = 0; index < defaultninepostion.value.length; index++) {
defaultninepostion.value[index].x = ninepostion.value[index].x; defaultninepostion.value[index].x = ninepostion.value[index].x;
@ -309,9 +308,32 @@ export default defineComponent({
setninepostion(); setninepostion();
syncpoint() syncpoint()
setTimeout(() => { setTimeout(() => {
ste_status.value=0; ste_status.value = 0;
}, 100); }, 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 = () => { const setninepostion = () => {
for (let index = 0; index < defaultninepostion.value.length; index++) { for (let index = 0; index < defaultninepostion.value.length; index++) {
nine[index].x = config.point9[index].x nine[index].x = config.point9[index].x
@ -358,15 +380,15 @@ export default defineComponent({
defaultnine.value[index].x = nine[index].x defaultnine.value[index].x = nine[index].x
defaultnine.value[index].y = nine[index].y defaultnine.value[index].y = nine[index].y
} }
if(sessionStorage.SurfaceCorrection&&sessionStorage.SurfaceCorrection.length>0){ if (sessionStorage.SurfaceCorrection && sessionStorage.SurfaceCorrection.length > 0) {
set_cache.value=JSON.parse(sessionStorage.SurfaceCorrection); set_cache.value = JSON.parse(sessionStorage.SurfaceCorrection);
use_set_cache() use_set_cache()
}else{ } else {
} }
syncpoint() syncpoint()
} }
const use_server_config=()=>{ const use_server_config = () => {
for (let index = 0; index < defaultninepostion.value.length; index++) { for (let index = 0; index < defaultninepostion.value.length; index++) {
defaultninepostion.value[index].x = ninepostion.value[index].x; defaultninepostion.value[index].x = ninepostion.value[index].x;
defaultninepostion.value[index].y = ninepostion.value[index].y; 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].x = config.point9[index].def_x
nine[index].y = config.point9[index].def_y 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 isshowarray.value[index] = false
setTimeout(() => { setTimeout(() => {
@ -394,7 +416,7 @@ export default defineComponent({
} }
} }
watch(() => nine[0], (newVal, oldVal) => { 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]) { if (!isactivearray.value[0]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
@ -405,7 +427,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => nine[1], (newVal, oldVal) => { 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]) { if (!isactivearray.value[1]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
@ -416,7 +438,7 @@ export default defineComponent({
}, { deep: true }) }, { deep: true })
watch(() => nine[2], (newVal, oldVal) => { 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]) { if (!isactivearray.value[2]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -425,7 +447,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => nine[3], (newVal, oldVal) => { 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]) { if (!isactivearray.value[3]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -434,7 +456,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => nine[4], (newVal, oldVal) => { 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]) { if (!isactivearray.value[4]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -443,7 +465,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => nine[5], (newVal, oldVal) => { 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]) { if (!isactivearray.value[5]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -452,7 +474,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => nine[6], (newVal, oldVal) => { 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]) { if (!isactivearray.value[6]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -461,7 +483,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => nine[7], (newVal, oldVal) => { 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]) { if (!isactivearray.value[7]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));
@ -470,7 +492,7 @@ export default defineComponent({
save_set_cache() save_set_cache()
}, { deep: true }) }, { deep: true })
watch(() => nine[8], (newVal, oldVal) => { 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]) { if (!isactivearray.value[8]) {
let x = Math.ceil(newVal.x / Proportion.value.x); let x = Math.ceil(newVal.x / Proportion.value.x);
let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y)); let y = Math.ceil(((config.height - newVal.y) / Proportion.value.y));

View File

@ -134,18 +134,17 @@ export default defineComponent({
show_dialog.value = true; show_dialog.value = true;
}; };
const resize = ref(true) const resize = ref(true)
// // //
onMounted(() => { // onMounted(() => {
// // //
window.onresize = () => { // window.onresize = () => {
return (() => { // return (() => {
console.log("resize") // resize.value = false; setTimeout(() => {
resize.value = false; setTimeout(() => { // resize.value = true
resize.value = true // }, 100);
}, 100); // })();
})(); // };
}; // });
});
// //
@ -185,6 +184,15 @@ export default defineComponent({
clear() 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); }) 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 = () => { const clear = () => {
sessionStorage.removeItem('DensityCorrection') sessionStorage.removeItem('DensityCorrection')
@ -195,6 +203,7 @@ export default defineComponent({
setTimeout(() => { setTimeout(() => {
sessionStorage.removeItem('FusionLocale') sessionStorage.removeItem('FusionLocale')
}, 500) }, 500)
getconfig()
} }
onBeforeMount(() => { onBeforeMount(() => {
@ -210,7 +219,7 @@ export default defineComponent({
} }
}, 500); }, 1000);
}) })
return { return {
resize, resize,

View File

@ -599,6 +599,7 @@ export default defineComponent({
const getconfig=()=>{ const getconfig=()=>{
try { try {
set?.GetBlendingConfig("").then((res)=>{}) 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) { } catch (error) {
} }