修复四点校正重置错误的问题

This commit is contained in:
shefengchun 2023-02-09 10:17:41 +08:00
parent b00fb02efb
commit 34aba5bcf4
6 changed files with 107 additions and 123 deletions

View File

@ -22,25 +22,25 @@
<div class="col-8">
<div ref="div" style="background-color: #646464; height: 40vh">
<div style="position: absolute">
<vue3ResizeDrag style="border: 0;" :class="[now_index == 0 ? 'action' : '']" v-if="isshowarray[0]"
<vue3ResizeDrag style="border: 0;" :class="[now_index == 0 ? 'action' : 'point']" v-if="isshowarray[0]"
:isActive="isactivearray[0]" @mousedown="activeMouseDown(0)" @mouseUpHandler="mouseUpHandler(0)" :w="20"
:h="20" :x="points[0].x" :y="points[0].y" :isResizable="false" @moveHandler="moveHandler_1">
<div class="point">1</div>
<div >1</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index == 1 ? 'action' : '']" v-if="isshowarray[1]"
<vue3ResizeDrag style="border: 0;" :class="[now_index == 1 ? 'action' : 'point']" v-if="isshowarray[1]"
:isActive="isactivearray[1]" @mousedown="activeMouseDown(1)" @mouseUpHandler="mouseUpHandler(1)" :w="20"
:h="20" :x="points[1].x" :y="points[1].y" :isResizable="false" @moveHandler="moveHandler_2">
<div class="point">2</div>
<div >2</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index == 2 ? 'action' : '']" v-if="isshowarray[2]"
<vue3ResizeDrag style="border: 0;" :class="[now_index == 2 ? 'action' : 'point']" v-if="isshowarray[2]"
:isActive="isactivearray[2]" @mousedown="activeMouseDown(2)" @mouseUpHandler="mouseUpHandler(2)" :w="20"
:h="20" :x="points[2].x" :y="points[2].y" :isResizable="false" @moveHandler="moveHandler_3">
<div class="point">3</div>
<div >3</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index == 3 ? 'action' : '']" v-if="isshowarray[3]"
<vue3ResizeDrag style="border: 0;" :class="[now_index == 3 ? 'action' : 'point']" v-if="isshowarray[3]"
:isActive="isactivearray[3]" @mousedown="activeMouseDown(3)" @mouseUpHandler="mouseUpHandler(3)" :w="20"
:h="20" :x="points[3].x" :y="points[3].y" :isResizable="false" @moveHandler="moveHandler_4">
<div class="point">4</div>
<div >4</div>
</vue3ResizeDrag>
</div>
</div>
@ -59,7 +59,7 @@
<q-btn size="sm" dense color="white" @click="resetall" text-color="black" :label="$t('resetall')" />
</div>
<div class="col-2">
<q-input filled type="number" class="" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].x"
<q-input filled type="number" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].x"
label="x" lazy-rules />
<q-input filled type="number" class="q-pt-md" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].y"
label="y" lazy-rules />
@ -71,14 +71,13 @@
<style scoped>
.point {
width: 100%;
height: 100%;
border-radius: 50%;
background: #0000ff;
color: aliceblue;
}
.action {
border-radius: 50%;
background-color: aqua;
}
</style>
@ -202,12 +201,6 @@ export default defineComponent({
const keyDown = () => {
document.onkeydown = (e) => {
// let x = Math.ceil(four[now_index.value].x / Proportion.value.x);
// let y = Math.ceil((config.height - four[now_index.value].y) / Proportion.value.y);
// points[now_index.value].x!=x?points[now_index.value].x = x:''
// points[now_index.value].y!= y?points[now_index.value].y = y:''
let e1 = e || window.event || arguments.callee.caller.arguments[0]
switch (e.code) {
case "KeyW":
@ -491,6 +484,7 @@ export default defineComponent({
}, 100);
};
const reset = (index: number) => {
isactivearray.value[index] = false;
fourpostion.value[index].x = defaultfourpostion.value[index].x;
fourpostion.value[index].y = defaultfourpostion.value[index].y;

View File

@ -97,48 +97,47 @@
<div>
<q-slider v-model="array[group].alpha" :min="0.0" @change="chang('alpha')" :max="1" :step="0.01" color="green"
vertical reverse label-always />
<div> <q-input dense filled type="number" max="1" min="0" step="0.1" @update:model-value="chang('alpha')" v-model="array[group].alpha" label="alpha"
lazy-rules :rules="[
<div> <q-input dense filled type="number" max="1" min="0" step="0.1" @update:model-value="chang('alpha')"
v-model="array[group].alpha" label="Alpha" lazy-rules :rules="[
(val) =>
(val !== null && val !== '') ||
$t('Please enter a number'),
(val) =>
(val >= 0 && val <= 1) || $t('Please enter a value within the range'),
]" /></div>
<p class="text-center">alpha</p>
]" /><q-btn color="white" @click="reset('alpha')" text-color="black" :label="$t('reset')" /></div>
</div>
<div>
<q-slider v-model="array[group].p" :min="0" @change="chang('p')" :max="16" :step="0.01" color="green"
<q-slider v-model="array[group].p" :min="0" @change="chang('p')" :max="16" :step="0.01" color="green" vertical
reverse label-always />
<div> <q-input dense filled type="number" max="16" min="0" step="0.1" @update:model-value="chang('p')"
v-model="array[group].p" label="Power" lazy-rules :rules="[
(val) =>
(val !== null && val !== '') ||
$t('Please enter a number'),
(val) =>
(val >= 0 && val <= 16) || $t('Please enter a value within the range'),
]" /><q-btn color="white" @click="reset('p')" text-color="black" :label="$t('reset')" /></div>
</div>
<div>
<q-slider v-model="array[group].gamma" :min="0" @change="chang('gamma')" :max="16" :step="0.01" color="green"
vertical reverse label-always />
<div> <q-input dense filled type="number" max="16" min="0" step="0.1" @update:model-value="chang('p')" v-model="array[group].p" label="p"
lazy-rules :rules="[
<div> <q-input dense filled type="number" max="16" min="0" step="0.1" @update:model-value="chang('gamma')"
v-model="array[group].gamma" label="Gamma" lazy-rules :rules="[
(val) =>
(val !== null && val !== '') ||
$t('Please enter a number'),
(val) =>
(val >= 0 && val <= 16) || $t('Please enter a value within the range'),
]" /></div>
<p class="text-center">p</p>
]" /><q-btn color="white" @click="reset('gamma')" text-color="black" :label="$t('reset')" /></div>
</div>
</div>
</div>
</div>
<div>
<q-slider v-model="array[group].gamma" :min="0" @change="chang('gamma')" :max="16" :step="0.01" color="green" vertical reverse label-always />
<div> <q-input dense filled type="number" max="16" min="0" step="0.1" @update:model-value="chang('gamma')" v-model="array[group].gamma" label="gamma"
lazy-rules :rules="[
(val) =>
(val !== null && val !== '') ||
$t('Please enter a number'),
(val) =>
(val >= 0 && val <= 16) || $t('Please enter a value within the range'),
]" /></div>
<p class="text-center">gamma</p>
</div>
</div>
</div>
</div>
<div>
<q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall')" />
<div style="position: relative;">
<q-checkbox left-label v-model="auxiliary_line" @update:model-value="(value, evt)=>{send_auxiliary_line(value)}" :label="$t('auxiliary lines')"/>
</div>
</template>
@ -146,13 +145,18 @@
.boder {
border: 2px solid #0000;
}
.btn_bottom {
margin-bottom: 0.5rem;
}
.btn_top {
margin-top: 0.3rem;
}
p {
margin: 0;
}
</style>
<script lang="ts">
@ -190,6 +194,10 @@ export default defineComponent({
{ alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
]);
const auto_sync = ref(false)
const auxiliary_line = ref(false)
const send_auxiliary_line=(val:boolean)=>{
set?.SetBlendingOption("blending_grids_assistant_lines",val?"1":"0");
}
//
let arr = [1, 0, 2, 3];
let serverconfig = JSON.parse($store.state.fusion_configuration);
@ -199,43 +207,21 @@ export default defineComponent({
$store.getters.GetTheCurrentlySelectedCamera[1]
);
});
const add = (type: string) => {
let tmp: Number;
tmp = 0.01;
const reset = (type: string) => {
switch (type) {
case "alpha":
array[group.value].alpha = Number((array[group.value].alpha += tmp).toFixed(2))
case 'gamma':
array[group.value].gamma=Number(config.params[group.value].def_gamma.toFixed(2));
break;
case "p":
array[group.value].p = Number((array[group.value].p += tmp).toFixed(2))
case 'p':
array[group.value].p=Number(config.params[group.value].def_power.toFixed(2));
break;
case "gamma":
array[group.value].gamma = Number((array[group.value].gamma += tmp).toFixed(2))
case 'alpha':
array[group.value].alpha=Number(config.params[group.value].def_alpha.toFixed(2));
break;
default:
break;
}
chang(type)
save_set_cache()
}
const reduce = (type: string) => {
let tmp: Number;
tmp = -0.01;
switch (type) {
case "alpha":
array[group.value].alpha = Number((array[group.value].alpha += tmp).toFixed(2))
break;
case "p":
array[group.value].p = Number((array[group.value].p += tmp).toFixed(2))
break;
case "gamma":
array[group.value].gamma = Number((array[group.value].gamma += tmp).toFixed(2))
break;
default:
break;
}
chang(type)
save_set_cache()
}
const ste_status = ref(0);
const use_set_cache = () => {
@ -599,6 +585,7 @@ export default defineComponent({
}
}
return {
send_auxiliary_line,
group,
array,
chang,
@ -607,8 +594,8 @@ export default defineComponent({
selectedprojector,
resetall,
set_cache,
reduce,
add,
auxiliary_line,
reset,
auto_sync,
config
};

View File

@ -193,7 +193,7 @@ export default defineComponent({
model[2] = server_conf.blending_grids_line_width ?? 6;
color[0] = server_conf.blending_grids_line_color ?? "#ffffff"
color[1] = server_conf.blending_grids_background_color ?? "#00ff5e"
color[2] = server_conf.blending_grids_center_line_color ?? "#3358de"
color[2] = server_conf.blending_grids_center_line_color ?? "#00000"
RowsColumns[0] = server_conf.blending_grids_show_row === "false" ? false : true
RowsColumns[1] = server_conf.blending_grids_show_column === "false" ? false : true
RowsColumns[2] = server_conf.blending_grids_show_center_line === "false" ? false : true

View File

@ -6,7 +6,7 @@
<div class="col-6">
<q-input filled type="number" class="q-pb-xs q-pt-md" @focus="isactivearray[0] = false" :dense="true"
v-model="nine[0].x" label="x" lazy-rules />
<q-input filled type="number" class="" @focus="isactivearray[0] = false" :dense="true"
<q-input filled type="number" @focus="isactivearray[0] = false" :dense="true"
v-model="nine[0].y" label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(0)" text-color="black" :label="$t('reset') + $t('point') + '1'" />
</div>
@ -18,7 +18,7 @@
<div class="col-4">
<q-input filled type="number" class="q-pb-xs q-pt-md" @focus="isactivearray[1] = false" :dense="true"
v-model="nine[1].x" label="x" lazy-rules />
<q-input filled type="number" class="" @focus="isactivearray[1] = false" :dense="true"
<q-input filled type="number" @focus="isactivearray[1] = false" :dense="true"
v-model="nine[1].y" label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(1)" text-color="black" :label="$t('reset') + $t('point') + '2'" />
</div>
@ -26,7 +26,7 @@
<div class="col-4" style="padding-left: 2px">
<q-input filled type="number" class="q-pb-xs q-pt-md" :dense="true" v-model="nine[4].x" label="x"
@focus="isactivearray[4] = false" lazy-rules />
<q-input filled type="number" class="" :dense="true" v-model="nine[4].y" label="y"
<q-input filled type="number" :dense="true" v-model="nine[4].y" label="y"
@focus="isactivearray[4] = false" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(4)" text-color="black" :label="$t('reset') + $t('point') + '5'" />
</div>
@ -38,7 +38,7 @@
<div class="col-6">
<q-input filled type="number" @focus="isactivearray[2] = false" class="q-pb-xs q-pt-md" :dense="true"
v-model="nine[2].x" label="x" lazy-rules />
<q-input filled type="number" class="" @focus="isactivearray[2] = false" :dense="true"
<q-input filled type="number" @focus="isactivearray[2] = false" :dense="true"
v-model="nine[2].y" label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(2)" text-color="black" :label="$t('reset') + $t('point') + '3'" />
</div>
@ -50,7 +50,7 @@
<div class="col-10">
<q-input filled type="number" @focus="isactivearray[3] = false" class="q-pb-xs q-pt-md" :dense="true"
v-model="nine[3].x" label="x" lazy-rules />
<q-input filled type="number" class="" @focus="isactivearray[3] = false" :dense="true"
<q-input filled type="number" @focus="isactivearray[3] = false" :dense="true"
v-model="nine[3].y" label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(3)" text-color="black" :label="$t('reset') + $t('point') + '4'" />
</div>
@ -59,41 +59,41 @@
<div class="col-8">
<div ref="div" style="background-color: #646464; height: 40vh">
<div style="position: absolute">
<vue3ResizeDrag style="border: 0;" :class="[now_index==0?'action':'']" :isActive="isactivearray[0]" v-if="isshowarray[0]" :w="20" :h="20" :x="ninepostion[0].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==0?'action':'point']" :isActive="isactivearray[0]" v-if="isshowarray[0]" :w="20" :h="20" :x="ninepostion[0].x"
:y="ninepostion[0].y" @mousedown="activeMouseDown(0)" :isResizable="false" @moveHandler="moveHandler_1">
<div class="point">1</div>
<div >1</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index==1?'action':'']" :isActive="isactivearray[1]" v-if="isshowarray[1]" :w="20" :h="20" :x="ninepostion[1].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==1?'action':'point']" :isActive="isactivearray[1]" v-if="isshowarray[1]" :w="20" :h="20" :x="ninepostion[1].x"
:y="ninepostion[1].y" @mousedown="activeMouseDown(1)" :isResizable="false" @moveHandler="moveHandler_2">
<div class="point">2</div>
<div >2</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index==2?'action':'']" :isActive="isactivearray[2]" v-if="isshowarray[2]" :w="20" :h="20" :x="ninepostion[2].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==2?'action':'point']" :isActive="isactivearray[2]" v-if="isshowarray[2]" :w="20" :h="20" :x="ninepostion[2].x"
:y="ninepostion[2].y" @mousedown="activeMouseDown(2)" :isResizable="false" @moveHandler="moveHandler_3">
<div class="point">3</div>
<div >3</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index==3?'action':'']" :isActive="isactivearray[3]" v-if="isshowarray[3]" :w="20" :h="20" :x="ninepostion[3].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==3?'action':'point']" :isActive="isactivearray[3]" v-if="isshowarray[3]" :w="20" :h="20" :x="ninepostion[3].x"
:y="ninepostion[3].y" @mousedown="activeMouseDown(3)" :isResizable="false" @moveHandler="moveHandler_4">
<div class="point">4</div>
<div >4</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index==4?'action':'']" :isActive="isactivearray[4]" v-if="isshowarray[4]" :w="20" :h="20" :x="ninepostion[4].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==4?'action':'point']" :isActive="isactivearray[4]" v-if="isshowarray[4]" :w="20" :h="20" :x="ninepostion[4].x"
:y="ninepostion[4].y" @mousedown="activeMouseDown(4)" :isResizable="false" @moveHandler="moveHandler_5">
<div class="point">5</div>
<div >5</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index==5?'action':'']" :isActive="isactivearray[5]" v-if="isshowarray[5]" :w="20" :h="20" :x="ninepostion[5].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==5?'action':'point']" :isActive="isactivearray[5]" v-if="isshowarray[5]" :w="20" :h="20" :x="ninepostion[5].x"
:y="ninepostion[5].y" @mousedown="activeMouseDown(5)" :isResizable="false" @moveHandler="moveHandler_6">
<div class="point">6</div>
<div >6</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index==6?'action':'']" :isActive="isactivearray[6]" v-if="isshowarray[6]" :w="20" :h="20" :x="ninepostion[6].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==6?'action':'point']" :isActive="isactivearray[6]" v-if="isshowarray[6]" :w="20" :h="20" :x="ninepostion[6].x"
:y="ninepostion[6].y" @mousedown="activeMouseDown(6)" :isResizable="false" @moveHandler="moveHandler_7">
<div class="point">7</div>
<div >7</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index==7?'action':'']" :isActive="isactivearray[7]" v-if="isshowarray[7]" :w="20" :h="20" :x="ninepostion[7].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==7?'action':'point']" :isActive="isactivearray[7]" v-if="isshowarray[7]" :w="20" :h="20" :x="ninepostion[7].x"
:y="ninepostion[7].y" @mousedown="activeMouseDown(7)" :isResizable="false" @moveHandler="moveHandler_8">
<div class="point">8</div>
<div >8</div>
</vue3ResizeDrag>
<vue3ResizeDrag style="border: 0;" :class="[now_index==8?'action':'']" :isActive="isactivearray[8]" v-if="isshowarray[8]" :w="20" :h="20" :x="ninepostion[8].x"
<vue3ResizeDrag style="border: 0;" :class="[now_index==8?'action':'point']" :isActive="isactivearray[8]" v-if="isshowarray[8]" :w="20" :h="20" :x="ninepostion[8].x"
:y="ninepostion[8].y" @mousedown="activeMouseDown(8)" :isResizable="false" @moveHandler="moveHandler_9">
<div class="point">9</div>
<div >9</div>
</vue3ResizeDrag>
</div>
</div>
@ -103,7 +103,7 @@
<div class="col-10">
<q-input filled type="number" @focus="isactivearray[5] = false" class="q-pb-xs" :dense="true"
v-model="nine[5].x" label="x" lazy-rules />
<q-input filled type="number" class="" @focus="isactivearray[5] = false" :dense="true"
<q-input filled type="number" @focus="isactivearray[5] = false" :dense="true"
v-model="nine[5].y" label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(5)" text-color="black" :label="$t('reset') + $t('point') + '6'" />
</div>
@ -117,7 +117,7 @@
<div class="col-6">
<q-input filled type="number" @focus="isactivearray[6] = false" class="q-pb-xs" :dense="true"
v-model="nine[6].x" label="x" lazy-rules />
<q-input filled type="number" class="" @focus="isactivearray[6] = false" :dense="true"
<q-input filled type="number" @focus="isactivearray[6] = false" :dense="true"
v-model="nine[6].y" label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(6)" text-color="black" :label="$t('reset') + $t('point') + '7'" />
</div>
@ -129,7 +129,7 @@
<div class="col-6">
<q-input filled type="number" @focus="isactivearray[7] = false" class="q-pb-xs" :dense="true"
v-model="nine[7].x" label="x" lazy-rules />
<q-input filled type="number" class="" @focus="isactivearray[7] = false" :dense="true"
<q-input filled type="number" @focus="isactivearray[7] = false" :dense="true"
v-model="nine[7].y" label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(7)" text-color="black" :label="$t('reset') + $t('point') + '8'" />
</div>
@ -141,7 +141,7 @@
<div class="col-6">
<q-input filled type="number" @focus="isactivearray[8] = false" class="q-pb-xs" :dense="true"
v-model="nine[8].x" label="x" lazy-rules />
<q-input filled type="number" class="" @focus="isactivearray[8] = false" :dense="true"
<q-input filled type="number" @focus="isactivearray[8] = false" :dense="true"
v-model="nine[8].y" label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(8)" text-color="black" :label="$t('reset') + $t('point') + '9'" />
</div>
@ -152,9 +152,10 @@
<style scoped>
.point{
width: 100%;height: 100%;border-radius: 50%;background: #00ff00;color: aliceblue;
border-radius: 50%;background: #00ff00;color: aliceblue;
}
.action{
border-radius: 50%;
background-color: aqua;
}
</style>

View File

@ -452,5 +452,6 @@ export default {
"horizontal correction":"horizontal correction",
"line width":"line width",
"level":"level",
"vertical":"vertical"
"vertical":"vertical",
"auxiliary lines":"auxiliary lines"
};

View File

@ -721,5 +721,6 @@ export default {
"horizontal correction":"水平校正",
"line width":"线宽",
"level":"水平",
"vertical":"垂直"
"vertical":"垂直",
"auxiliary lines":"辅助线"
};