修复逻辑错误

This commit is contained in:
shefengchun 2023-01-12 16:06:00 +08:00
parent 9545a4c45d
commit 2a74a78e99
5 changed files with 74 additions and 25 deletions

View File

@ -213,6 +213,7 @@ export default defineComponent({
}
ste_status.value=1;
config = JSON.parse(JSON.stringify(fortmp))
use_server_config()
use_set_cache()
setTimeout(() => {
ste_status.value=0;
@ -301,6 +302,17 @@ export default defineComponent({
save_set_cache()
}
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
}
}
onMounted(() => {
initialization()

View File

@ -154,6 +154,17 @@ export default defineComponent({
}, 100);
})
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;
defaultfour.value[index].x = config.point4[index].def_x
defaultfour.value[index].y = config.point4[index].def_y
four[index].x = config.point4[index].x
four[index].y = config.point4[index].y
}
}
const setpoa = () => {
points[0].x = 0
@ -279,6 +290,7 @@ export default defineComponent({
ste_status.value=1;
config = JSON.parse(JSON.stringify(fortmp))
//setpoa();
use_server_config()
use_set_cache()
setTimeout(() => {
ste_status.value=0;

View File

@ -2,16 +2,17 @@
<div class="row">
<div class="col-12">
<!-- <p class="text-center">{{ $t('Set the fusion band width') }}</p> -->
<div style="height: 1rem;"></div>
<div class="row">
<div class="col-12">
<div class="row">
<div class="col-4 offset-4">
<div class="row">
<div class="col-6">
<div class="col-3">
<q-toggle class="float-right" v-model="array[0].isshow" label="" />
</div>
<div class="col-6">
<q-input filled type="number" @focus="group = 0" v-model="array[0].value"
<q-input filled type="number" :bg-color="group==0?'cyan-1':''" @focus="group = 0" v-model="array[0].value"
:label="$t('upper fusion zone parameters')" lazy-rules :rules="[
(val) =>
(val !== null && val !== '') || $t('Please enter a number'),
@ -27,11 +28,11 @@
<div class="row">
<div class="col-6">
<div class="row">
<div class="col-6">
<div class="col-3">
<q-toggle class="float-right" v-model="array[1].isshow" label="" />
</div>
<div class="col-6">
<q-input filled type="number" @focus="group = 1" v-model="array[1].value"
<q-input filled type="number" :bg-color="group==1?'cyan-1':''" @focus="group = 1" v-model="array[1].value"
:label="$t('Left fusion Band Parameters')" lazy-rules :rules="[
(val) =>
(val !== null && val !== '') || $t('Please enter a number'),
@ -43,11 +44,11 @@
</div>
<div class="col-6">
<div class="row">
<div class="col-6">
<div class="col-3">
<q-toggle class="float-right" v-model="array[2].isshow" label="" />
</div>
<div class="col-6">
<q-input filled type="number" @focus="group = 2" v-model="array[2].value"
<q-input filled type="number" :bg-color="group==2?'cyan-1':''" @focus="group = 2" v-model="array[2].value"
:label="$t('Right fusion Band Parameters')" lazy-rules :rules="[
(val) =>
(val !== null && val !== '') || $t('Please enter a number'),
@ -63,11 +64,11 @@
<div class="row">
<div class="col-4 offset-4">
<div class="row">
<div class="col-6">
<div class="col-3">
<q-toggle class="float-right" v-model="array[3].isshow" label="" />
</div>
<div class="col-6">
<q-input filled type="number" @focus="group = 3" v-model="array[3].value"
<q-input filled type="number" :bg-color="group==3?'cyan-1':''" @focus="group = 3" v-model="array[3].value"
:label="$t('Lower fusion Zone Parameters')" lazy-rules :rules="[
(val) =>
(val !== null && val !== '') || $t('Please enter a number'),
@ -154,7 +155,6 @@ export default defineComponent({
if (set_cache.value[selectedprojector.value] != null) {
let tmp = JSON.parse(set_cache.value[selectedprojector.value]);
deepcopy(array, tmp)
//console.log(set_cache.value,"use")
}
};
const deepcopy = (o1: any, o2: any) => {
@ -182,8 +182,9 @@ export default defineComponent({
}
}
ste_status.value = 1;
config = JSON.parse(JSON.stringify(fortmp))
//startconfig()
use_server_config()
use_set_cache()
setTimeout(() => {
ste_status.value = 0;
@ -218,15 +219,24 @@ export default defineComponent({
};
const startconfig = () => {
for (let index = 0; index < array.length; index++) {
array[index].gamma = config.params[index].gamma
array[index].alpha = config.params[index].alpha
array[index].p = config.params[index].power
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)
array[index].isshow = config.params[index].enable
array[index].value = Number(config.params[index].size)
}
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++) {
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)
array[index].isshow = config.params[index].enable
array[index].value = Number(config.params[index].size)
}
}
startconfig()
onBeforeUnmount(() => {
sessionStorage.FusionLocale = JSON.stringify(set_cache.value)
@ -236,9 +246,6 @@ export default defineComponent({
() => array[0],
(newVal, oldVal) => {
if ($store.state.enablefusion) set?.SetBlendingOverlap($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 1, array[0].isshow, Number(array[0].value));
// if (!array[0].isshow) {
// array[0].value = 0
// }
save_set_cache()
},
{ deep: true }
@ -247,9 +254,6 @@ export default defineComponent({
() => array[1],
(newVal, oldVal) => {
if ($store.state.enablefusion) set?.SetBlendingOverlap($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 0, array[1].isshow, Number(array[1].value));
// if (!array[1].isshow) {
// array[1].value = 0
// }
save_set_cache()
},
{ deep: true }
@ -258,9 +262,6 @@ export default defineComponent({
() => array[2],
(newVal, oldVal) => {
if ($store.state.enablefusion) set?.SetBlendingOverlap($store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[1], 2, array[2].isshow, Number(array[2].value));
// if (!array[2].isshow) {
// array[2].value = 0
// }
save_set_cache()
},
{ deep: true }

View File

@ -291,6 +291,7 @@ export default defineComponent({
}
ste_status.value=1;
config = JSON.parse(JSON.stringify(fortmp))
use_server_config()
use_set_cache()
setTimeout(() => {
ste_status.value=0;
@ -365,6 +366,14 @@ export default defineComponent({
}
syncpoint()
}
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;
defaultnine.value[index].x = nine[index].x
defaultnine.value[index].y = nine[index].y
}
}
const reset = (index: number) => {
ninepostion.value[index].x = defaultninepostion.value[index].x;
ninepostion.value[index].y = defaultninepostion.value[index].y;

View File

@ -15,7 +15,7 @@
</div>
<q-space />
<q-btn flat round icon="close" color="red" v-close-popup>
<q-btn flat round icon="close" color="red" @click="clear()" v-close-popup>
<q-tooltip>
{{ $t("close") }}
</q-tooltip>
@ -26,7 +26,7 @@
<q-separator />
<!-- height: 80vh -->
<q-card-section class="scroll" style="width: 90vw">
<q-card-section class="scroll" style="width: 70vw">
<div class="row" style="border: 1px solid;text-align: center;">
<div class="col-3" style="border-right: 1px solid;">
<p class="text-center">{{ $t("Projector") }}</p>
@ -165,7 +165,21 @@ export default defineComponent({
const save = () => {
set?.SaveBlendingConfig("")
show_dialog.value = false
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 clear=()=>{
sessionStorage.removeItem('DensityCorrection')
sessionStorage.removeItem('FourPointCalibration')
sessionStorage.removeItem('SurfaceCorrection')
setTimeout(()=>{
sessionStorage.removeItem('FusionLocale')
},500)
}
onBeforeMount(() => {
setTimeout(() => {
try {
@ -181,6 +195,7 @@ export default defineComponent({
}, 500);
})
return {
clear,
show_dialog,
options,
copyToClipboard,