增加交互增加设置分辨率

This commit is contained in:
shefengchun 2023-02-16 16:31:29 +08:00
parent 3fcd25ec96
commit b4338153f9
6 changed files with 56 additions and 25 deletions

View File

@ -194,6 +194,7 @@ export default defineComponent({
});
//
let allconfig = JSON.parse($store.state.fusion_configuration);
let serverconfig = JSON.parse($store.state.fusion_configuration);
const selectedprojector = computed(() => {
return (
@ -449,7 +450,7 @@ export default defineComponent({
*/
const coordinate_transformation_value_to_xy = (x: number, y: number): { x: number, y: number } => {
x = x / Proportion.value.x
y = (config.height - y) / Proportion.value.y
y = (allconfig.projector_height - y) / Proportion.value.y
return { x, y }
}
@ -515,8 +516,8 @@ export default defineComponent({
}
start()
onMounted(() => {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h)
Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
options_value_h_point_amount.value = Object.keys(config.multi_hor_density)
options_value_v_point_amount.value = Object.keys(config.multi_ver_density)
let tmp = JSON.parse($store.state.fusion_configuration).options;
@ -723,8 +724,8 @@ export default defineComponent({
*/
const recalculate_coordinates = () => {
try {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h)
Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
max.value.x = div.value.offsetWidth
max.value.y = div.value.offsetHeight
for (let index = 0; index < value_v_point_amount.value; index++) {

View File

@ -88,6 +88,7 @@ export default defineComponent({
let $store = useStore();
let $t = useI18n();
const ste_status = ref(0);
let allconfig = JSON.parse($store.state.fusion_configuration);
let config = JSON.parse($store.state.fusion_configuration).projectors[0];
const configselsect = computed(() => {
return $store.state.selected_projector;
@ -245,7 +246,7 @@ export default defineComponent({
*/
const coordinate_transformation_value_to_xy = (x: number, y: number): { x: number, y: number } => {
x = x / Proportion.value.x
y = (config.height - y) / Proportion.value.y
y = (allconfig.projector_height - y) / Proportion.value.y
return { x, y }
}
@ -291,8 +292,8 @@ export default defineComponent({
}
start()
onMounted(() => {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h)
Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
start_point()
start()
use_server_config()
@ -319,8 +320,6 @@ export default defineComponent({
const reset = (index: number, send: boolean, type: string) => {
value.value[index].x = value.value[index].def_x
value.value[index].y = value.value[index].def_y
// value_point.value[index].x = value_point.value[index].def_x
// value_point.value[index].y = value_point.value[index].def_y
chang(index, value.value[index].def_y, type)
save_set_cache()
}
@ -336,14 +335,13 @@ export default defineComponent({
let tmp = coordinate_transformation_value_to_xy(value.value[index].x, value.value[index].y)
value_point.value[index].y = Math.round(tmp.y)
value_point.value[index].x = Math.round(tmp.x)
//reset(index, true, 'v')
}
send_value(-2,0,0)
}
const recalculate_coordinates = () => {
try {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h)
Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
max.value.x = div.value.offsetWidth
max.value.y = div.value.offsetHeight
for (let index = 0; index < value.value.length; index++) {

View File

@ -124,6 +124,7 @@ export default defineComponent({
let $store = useStore();
let $t = useI18n();
const ste_status = ref(0);
let allconfig = JSON.parse($store.state.fusion_configuration);
let config = JSON.parse($store.state.fusion_configuration).projectors[0];
const configselsect = computed(() => {
return $store.state.selected_projector;
@ -297,7 +298,7 @@ export default defineComponent({
*/
const coordinate_transformation_value_to_xy = (x: number, y: number): { x: number, y: number } => {
x = x / Proportion.value.x
y = (config.height - y) / Proportion.value.y
y = (allconfig.projector_height - y) / Proportion.value.y
return { x, y }
}
@ -340,8 +341,8 @@ export default defineComponent({
}
start()
onMounted(() => {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h)
Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
start_point(9)
start()
use_server_config()
@ -389,8 +390,8 @@ export default defineComponent({
}
const recalculate_coordinates = () => {
try {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h)
Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
max.value.x = div.value.offsetWidth
max.value.y = div.value.offsetHeight
for (let index = 0; index < value.value.length; index++) {

View File

@ -48,7 +48,7 @@
}}<q-checkbox v-model="EnableBlending" />
</div>
<div class="col-3 q-px-md"> <q-select class="q-pt-md " :label="$t('change resolution')"
@update:model-value="(val) => { now_resolution = val }" :dense="true" filled v-model="now_resolution"
@update:model-value="(val) => { set_resolution(val) }" :dense="true" filled v-model="now_resolution"
:options="options_resolution" emit-value map-options /></div>
</div>
<div class="col-10">
@ -238,7 +238,7 @@ export default defineComponent({
const send_disable_blending_params = () => {
set?.SetBlendingOption(disable_blending_params_id.value, disable_blending_params.value ? "1" : "0");
};
const now_resolution=ref("")
const now_resolution=ref(1)
// let allconfig = JSON.parse($store.state.fusion_configuration);
let allconfig = JSON.parse("{\"resolution\": [{\"width\": 1024,\"height\": 768}]}");
const options_resolution = computed(() => {
@ -290,10 +290,8 @@ export default defineComponent({
set?.SetBlendingOption("blending_grids_select_point", `9:${child.value!.options_model+1}`)
break;
case 'DensityCorrection':
//console.log(child.value!.now_v_h)
if(child.value!.now_v_h=='vertical'){
set?.SetBlendingOption("blending_grids_select_point", `${child.value!.options_model_v+1}`)
//value_h_point_amount
set?.SetBlendingOption("blending_grids_control_point_count", `${child.value!.value_v_point_amount}`)
}else{
set?.SetBlendingOption("blending_grids_select_point", `${child.value!.options_model_h+1}`)
@ -357,6 +355,27 @@ export default defineComponent({
{ deep: true }
);
const set_resolution=(index:number)=>{
//SetProjectorResolution
$q.loading.show({
message: 'Loading please wait'
})
let w =allconfig.resolution[index].width
let h =allconfig.resolution[index].height
set?.SetProjectorResolution(w,h).then((res)=>{
$store.commit("setfusion_configuration", res?.config);
})
let tmp = options.value
options.value = ""
$store.commit("setSelectedProjector", "0/0");
setTimeout(() => {
clear_sessionStorage()
options.value = tmp
$q.loading.hide()
}, 800);
getconfig()
}
watch(() => optionsstr,
(newVal) => {
let tmp = ""
@ -441,6 +460,11 @@ export default defineComponent({
config.value.row = tmp.row;
$store.commit("setfusion_configuration", res?.config);
allconfig = JSON.parse($store.state.fusion_configuration);
for (let index = 0; index < allconfig.resolution.length; index++) {
if(allconfig.resolution.width==allconfig.projector_width&&allconfig.resolution.height==allconfig.projector_height){
now_resolution.value=index
}
}
});
get_scenes()
set?.SetBlendingOption("blending_grids_select_ui", "blending")
@ -451,6 +475,9 @@ export default defineComponent({
''
]
const apply_the_selected_configuration = () => {
$q.loading.show({
message: 'Loading please wait'
})
set?.ApplyBlendingScene(select_configuration_name.value).then((res) => {
let tmp = JSON.parse(res ? res.config : "{}");
EnableBlending.value = tmp.enable;
@ -466,6 +493,7 @@ export default defineComponent({
setTimeout(() => {
clear_sessionStorage()
options.value = tmp
$q.loading.hide()
}, 800);
getconfig()
}
@ -543,7 +571,8 @@ export default defineComponent({
del_dialog,
child,
options_resolution,
now_resolution
now_resolution,
set_resolution
};
},
});

View File

@ -490,5 +490,6 @@ export default {
"raster graph": "Raster Graph",
"the folder name cannot start with a '.'":
"The Folder Name Cannot Start With a '.'",
"change resolution":"change resolution"
"change resolution":"change resolution",
"Loading please wait":"Loading please wait"
};

View File

@ -755,5 +755,6 @@ export default {
"export magic": "导出",
"raster graph": "栅格图",
"the folder name cannot start with a '.'": "文件夹名称不能以“.” 开头",
"change resolution":"更改分辨率"
"change resolution":"更改分辨率",
"Loading please wait":"加载中 请稍等"
};