增加单独调试页面

This commit is contained in:
shefengchun 2023-02-02 15:48:40 +08:00
parent 1bee760998
commit f44f60d038
6 changed files with 190 additions and 43 deletions

View File

@ -0,0 +1,82 @@
<template>
<div>
<q-list dense bordered separator>
<q-item clickable v-ripple v-for="(item, index) in data">
<q-item-section >
<DebuggingItem :name="Object.keys(item)[0]" :value="Object.values(item)[0]">
</DebuggingItem>
</q-item-section>
</q-item>
<q-item clickable v-ripple v-for="(item, index) in btn">
<q-item-section >
<div><q-btn color="white" text-color="black" @click="send_btn(Object.keys(item)[0])" :label="$t(btn_name(Object.keys(item)[0]))" /></div>
</q-item-section>
</q-item>
</q-list>
</div>
</template>
<script lang="ts">
import {
defineComponent,
ref,
watch,
computed,
defineProps,
withDefaults,
reactive,
onMounted,
onBeforeUnmount,
} from "vue";
import { useStore } from "src/store";
import { useI18n } from "vue-i18n";
import vue3ResizeDrag from "/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue";
import GlobalData from "src/common/GlobalData";
import DebuggingItem from "src/components/FusionSettings/DebuggingItem.vue";
export default defineComponent({
name: "Debugging",
components: {
vue3ResizeDrag,
DebuggingItem
},
setup() {
let set = GlobalData.getInstance().getCurrentClient();
let $store = useStore();
let $t = useI18n();
const data = computed(() => {
let array = [];
let tmp = JSON.parse($store.state.fusion_configuration).options
for (let key in tmp) {
if (key.indexOf("@") != -1&&key.indexOf("@btn") == -1) {
array.push({ [key]: tmp[key] })
}
}
return array
})
const btn = computed(() => {
let array = [];
let tmp = JSON.parse($store.state.fusion_configuration).options
for (let key in tmp) {
if (key.indexOf("@btn") != -1) {
array.push({ [key]: tmp[key] })
}
}
return array
})
const btn_name=(name:string):string=>{
return name.split("@")[2]
}
const send_btn=(name:string)=>{
set?.SetBlendingOption(name,"1");
}
return {
btn_name,
send_btn,
data,
btn
}
}
})
</script>

View File

@ -0,0 +1,63 @@
<template>
<div><span>{{ $t(show_name) }}</span> <q-checkbox v-model="val" @click="send" /></div>
</template>
<script lang="ts">
import {
defineComponent,
ref,
watch,
computed,
defineProps,
withDefaults,
reactive,
onMounted,
onBeforeUnmount,
} from "vue";
import { useStore } from "src/store";
import { useI18n } from "vue-i18n";
import vue3ResizeDrag from "/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue";
import GlobalData from "src/common/GlobalData";
export default defineComponent({
name: "DebuggingItem",
components: {
vue3ResizeDrag,
},
props: {
name: {
type: String,
default: ''
},
value: {
type: String,
default: ''
}
},
setup(props) {
let set = GlobalData.getInstance().getCurrentClient();
let $store = useStore();
let $t = useI18n();
const val = ref(false)
const show_name = computed(() => {
let tmp=""
if(props.name.indexOf("@") != -1){
tmp=props.name.split("@")[1]
}else{
tmp=props.name
}
return tmp
})
val.value=props.value=="1"?true:false
const send = () => {
set?.SetBlendingOption(props.name, val.value ? "1" : "0");
}
return {
send,
val,
show_name,
...props
}
}
})
</script>

View File

@ -676,11 +676,6 @@ export default defineComponent({
}
save_set_cache();
};
const creat_svg=(index:Number,type:string):string=>{
//btoa(unescape(encodeURIComponent(str)))
//'data:image/svg+xml;base64,'+btoa(`<svg width="50" height="50"xmlns="http://www.w3.org/2000/svg"><text font-size="14" fill="#d50000"><tspan x="3" y="10"></tspan><tspan x="0" y="20">v${index}</tspan><tspan x="3" y="30"></tspan></text></svg>`)
return type=='h'?`data:image/svg+xml,%3Csvg width='50' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='50%25' y='50%25' font-size='14' fill='%2300c853' font-family='system-ui, sans-serif' text-anchor='middle' dominant-baseline='middle'%3E←h${index}→%3C/text%3E%3C/svg%3E`:'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iNTAiCiAgICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHRleHQgZm9udC1zaXplPSIxNCIgZmlsbD0iI2Q1MDAwMCI+CiAgICAgICAgPHRzcGFuIHg9IjMiIHk9IjEwIj7ihpE8L3RzcGFuPgogICAgICAgIDx0c3BhbiB4PSIwIiB5PSIyMCI+djE8L3RzcGFuPgogICAgICAgIDx0c3BhbiB4PSIzIiB5PSIzMCI+4oaTPC90c3Bhbj4KICAgIDwvdGV4dD4KPC9zdmc+'
}
initialization();
return {
model,
@ -694,7 +689,6 @@ export default defineComponent({
isshowarray,
isactivearray,
save,
creat_svg
};
},
});

View File

@ -64,6 +64,10 @@
},
{ label: $t('GridSettings'), value: 'GridSettings' },
]" />
<q-btn-toggle v-show="isdebug" no-caps v-model="options" toggle-color="primary"
:options="[
{ label: $t('debugging'), value: 'Debugging' }
]" />
</div>
<div style="min-height: 72vh">
<component :is="options" />
@ -75,8 +79,6 @@
<q-separator />
<q-card-actions align="right">
<span v-show="isdebug">{{ $t("Whether to hide the desktop") }}</span><q-checkbox v-show="isdebug"
style="justify-content: flex-start" v-model="hide_desktop_value" @click="send_hide_desktop" />
<span>{{ $t("disable blending params") }}</span>
<q-checkbox style="justify-content: flex-start" v-model="disable_blending_params"
@click="send_disable_blending_params" />
@ -84,8 +86,7 @@
<q-checkbox style="justify-content: flex-start" v-model="show_blending_grids"
@click="send_show_blending_grids" />
<div class="q-space" data-v-39efcd1f=""></div>
<div v-show="!isdebug" class="q-space" data-v-39efcd1f=""></div>
<div v-show="!isdebug" class="q-space" data-v-39efcd1f=""></div>
<div class="q-space" data-v-39efcd1f=""></div>
<q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall config')" />
<div class="q-space" data-v-39efcd1f=""></div>
<q-btn flat :label="$t('Select saved configuration')" no-caps color="primary"
@ -203,6 +204,7 @@ import FourPointCalibration from "src/components/FusionSettings/FourPointCalibra
import GridSettings from "src/components/FusionSettings/GridSettings.vue";
import SurfaceCorrection from "src/components/FusionSettings/SurfaceCorrection.vue";
import DensityCorrection from "src/components/FusionSettings/DensityCorrection.vue";
import Debugging from "src/components/FusionSettings/Debugging.vue";
export default defineComponent({
name: "ComponentFusionSettingsDialog",
@ -213,6 +215,7 @@ export default defineComponent({
GridSettings,
SurfaceCorrection,
DensityCorrection,
Debugging
},
setup() {
let set = GlobalData.getInstance().getCurrentClient();
@ -227,9 +230,9 @@ export default defineComponent({
const select_configuration = ref(false)
const del_dialog = ref(false)
const select_configuration_name = ref("")
const send_hide_desktop = () => {
set?.SetBlendingOption(hide_desktop_value_id.value, hide_desktop_value.value ? "1" : "0");
};
// const send_hide_desktop = () => {
// set?.SetBlendingOption(hide_desktop_value_id.value, hide_desktop_value.value ? "1" : "0");
// };
const send_disable_blending_params = () => {
set?.SetBlendingOption(disable_blending_params_id.value, disable_blending_params.value ? "1" : "0");
};
@ -243,8 +246,8 @@ export default defineComponent({
const EnableBlending = ref(false);
let optionsstr = ref();
optionsstr.value = "FusionLocale";
const hide_desktop_value_id = ref("debug@show_mask");
const hide_desktop_value = ref(false);
// const hide_desktop_value_id = ref("debug@show_mask");
// const hide_desktop_value = ref(false);
const disable_blending_params_id = ref("1");
const disable_blending_params = ref(false);
const show_blending_grids_id = ref("blending_grids_show");
@ -302,6 +305,7 @@ export default defineComponent({
sessionStorage.removeItem("FourPointCalibration");
sessionStorage.removeItem("GridSettings");
}, 500);
options.value="FusionLocale"
};
@ -318,14 +322,7 @@ export default defineComponent({
onBeforeMount(() => {
setTimeout(() => {
try {
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);
});
} catch (error) {
erroe();
}
@ -336,7 +333,7 @@ export default defineComponent({
set?.GetBlendingConfig("").then((res) => {
let tmp = JSON.parse(res ? res.config : "");
let local_options = [
[hide_desktop_value_id, hide_desktop_value],
// [hide_desktop_value_id, hide_desktop_value],
[disable_blending_params_id, disable_blending_params],
[show_blending_grids_id, show_blending_grids]
];
@ -348,17 +345,21 @@ export default defineComponent({
local_opt[1].value = ("0" == opt || "false" == opt.toLowerCase() ? false : true);
}
}
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);
});
}, 1000);
});
const save_cover_name = ref("")
const plan_list = [
'1'
''
]
const apply_the_selected_configuration = () => {
//
//console.log(select_configuration_name.value)
set?.ApplyBlendingScene(select_configuration_name.value).then((res) => {
let tmp = JSON.parse(res ? res.config : "");
EnableBlending.value = tmp.enable;
@ -370,7 +371,6 @@ export default defineComponent({
let tmp = options.value
options.value = ""
//getconfig()
$store.commit("setSelectedProjector", "0/0");
setTimeout(() => {
sessionStorage.removeItem("FusionLocale");
@ -380,9 +380,6 @@ export default defineComponent({
sessionStorage.removeItem("GridSettings");
options.value = tmp
}, 800);
// setTimeout(() => {
// options.value = tmp
// }, 100);
}
const plan_list_op = ref(plan_list)
const filterFn = (val: any, update: any, abort: any) => {
@ -400,16 +397,17 @@ export default defineComponent({
set?.SaveBlendingConfig(save_cover_name.value);
clear();
save_cover_name.value = save_name.value = ''
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);
// });
$store.commit("setSelectedProjector", "0/0");
}
const isdebug = computed(() => {
let tmp = JSON.parse($store.state.fusion_configuration)
let str = 'debug@show_mask'
@ -431,8 +429,8 @@ export default defineComponent({
del_scenes,
filterFn,
setModel,
send_hide_desktop,
hide_desktop_value,
// send_hide_desktop,
// hide_desktop_value,
send_disable_blending_params,
disable_blending_params,
send_show_blending_grids,

View File

@ -440,5 +440,10 @@ export default {
"New Please enter a name":"New Please enter a name",
"Please select an override":"Please select an override",
"confirm delete":"confirm delete",
"delete or not":"delete or not"
"delete or not":"delete or not",
"debugging":"debugging",
"disable_blending":"disable blending",
"disable_clip":"disable clip",
"show_mask":"show desktop",
"save_bmp":"save bmp"
};

View File

@ -709,5 +709,10 @@ export default {
"New Please enter a name":"新建 请输入名称",
"Please select an override":"请选择覆盖",
"confirm delete":"确定删除",
"Whether to delete":"是否删除"
"Whether to delete":"是否删除",
"debugging":"调试",
"disable_blending":"禁用混合",
"disable_clip":"禁用裁剪",
"show_mask":"显示桌面",
"save_bmp":"保存BMP"
};