增加同步操作选项

This commit is contained in:
shefengchun 2023-01-29 13:34:54 +08:00
parent 0148c2e3e4
commit ee4166abc3
4 changed files with 238 additions and 84 deletions

View File

@ -61,6 +61,7 @@
(val > -1 && val < 1920) || $t('Please enter 0-100'),
]" />
</div>
<div class="col-3"><span>{{$t('Whether to operate synchronously')}}</span><q-checkbox v-model="auto_sync" /></div>
</div>
</div>
</div>
@ -96,7 +97,7 @@
<div><q-btn color="white" @click="add('alpha')" text-color="black" label="↑" /></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-btn color="white" @click="reduce('alpha')" text-color="black" label="↓" /></div>
<div><q-btn color="white" @click="reduce('alpha')" text-color="black" label="↓" /></div>
<p class="text-center">alpha</p>
</div>
@ -104,7 +105,7 @@
<div><q-btn color="white" @click="add('p')" text-color="black" label="↑" /></div>
<q-slider v-model="array[group].p" :min="0" @change="chang('p')" :max="2.5" :step="0.01" color="green"
vertical reverse label-always />
<div><q-btn color="white" @click="reduce('p')" text-color="black" label="↓" /></div>
<div><q-btn color="white" @click="reduce('p')" text-color="black" label="↓" /></div>
<p class="text-center">p</p>
</div>
@ -112,7 +113,7 @@
<div><q-btn color="white" @click="add('gamma')" text-color="black" label="↑" /></div>
<q-slider v-model="array[group].gamma" :min="0" @change="chang('gamma')" :max="2.5" :step="0.01" color="green"
vertical reverse label-always />
<div><q-btn color="white" @click="reduce('gamma')" text-color="black" label="↓" /></div>
<div><q-btn color="white" @click="reduce('gamma')" text-color="black" label="↓" /></div>
<p class="text-center">gamma</p>
</div>
</div>
@ -162,6 +163,7 @@ export default defineComponent({
{ alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
{ alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
]);
const auto_sync=ref(false)
//
let arr = [1, 0, 2, 3];
let serverconfig = JSON.parse($store.state.fusion_configuration);
@ -172,34 +174,34 @@ export default defineComponent({
);
});
const add = (type: string) => {
let tmp:Number;
tmp=0.01;
let tmp: Number;
tmp = 0.01;
switch (type) {
case "alpha":
array[group.value].alpha=Number((array[group.value].alpha+=tmp).toFixed(2))
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))
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))
array[group.value].gamma = Number((array[group.value].gamma += tmp).toFixed(2))
break;
default:
break;
}
}
const reduce = (type: string) => {
let tmp:Number;
tmp=-0.01;
let tmp: Number;
tmp = -0.01;
switch (type) {
case "alpha":
array[group.value].alpha=Number((array[group.value].alpha+=tmp).toFixed(2))
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))
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))
array[group.value].gamma = Number((array[group.value].gamma += tmp).toFixed(2))
break;
default:
break;
@ -368,6 +370,7 @@ export default defineComponent({
array[0].isshow,
Number(array[0].value)
);
save_set_cache();
},
{ deep: true }
@ -383,6 +386,7 @@ export default defineComponent({
array[1].isshow,
Number(array[1].value)
);
if(auto_sync.value)left_right_auto_add(newVal-oldVal);
save_set_cache();
},
{ deep: true }
@ -398,6 +402,7 @@ export default defineComponent({
array[2].isshow,
Number(array[2].value)
);
if(auto_sync.value)left_right_auto_add(newVal-oldVal);
save_set_cache();
},
{ deep: true }
@ -445,6 +450,7 @@ export default defineComponent({
array[1].isshow,
Number(array[1].value)
);
if(auto_sync.value)left_right_auto_add(0);
save_set_cache();
},
{ deep: true }
@ -460,6 +466,7 @@ export default defineComponent({
array[2].isshow,
Number(array[2].value)
);
if(auto_sync.value)left_right_auto_add(0);
save_set_cache();
},
{ deep: true }
@ -503,6 +510,48 @@ export default defineComponent({
console.log("ResetBlendingConfig error");
}
};
const left_right_auto_add = (difference: number) => {
let tmpobjall = JSON.parse($store.state.fusion_configuration)
if ($store.getters.GetTheCurrentlySelectedCamera[1] == 0) {
let tmp = set_cache.value[1] == null ? tmpobjall.projectors[1].params : JSON.parse(set_cache.value[1]);
let set_cache_tmp: any = []
if (tmp[1].hasOwnProperty("power")) {
for (let index = 0; index < 4; index++) {
let tmpobj = { alpha: Number(tmp[arr[index]].alpha.toFixed(2)), p: Number(tmp[arr[index]].power.toFixed(2)), gamma: Number(tmp[arr[index]].gamma.toFixed(2)), isshow: tmp[arr[index]].enable, value: Number(tmp[arr[index]].size) }
set_cache_tmp.push(tmpobj)
}
} else {
set_cache_tmp = tmp
}
if (ste_status.value == 0) {
set_cache_tmp[1].value = Number(set_cache_tmp[1].value) + difference
set_cache_tmp[1].isshow = array[2].isshow
set?.SetBlendingOverlap(0, 1, 0, set_cache_tmp[1].isshow, Number(set_cache_tmp[1].value));
set_cache.value[1] = JSON.stringify(set_cache_tmp);
}
}
if ($store.getters.GetTheCurrentlySelectedCamera[1] == 1) {
let tmp = set_cache.value[0] == null ? tmpobjall.projectors[0].params : JSON.parse(set_cache.value[0]);
let set_cache_tmp: any = []
if (tmp[0].hasOwnProperty("power")) {
for (let index = 0; index < 4; index++) {
let tmpobj = { alpha: Number(tmp[arr[index]].alpha.toFixed(2)), p: Number(tmp[arr[index]].power.toFixed(2)), gamma: Number(tmp[arr[index]].gamma.toFixed(2)), isshow: tmp[arr[index]].enable, value: Number(tmp[arr[index]].size) }
set_cache_tmp.push(tmpobj)
}
} else {
set_cache_tmp = tmp
}
if (ste_status.value == 0) {
set_cache_tmp[2].value = Number(set_cache_tmp[2].value) + difference
set_cache_tmp[2].isshow = array[1].isshow
set?.SetBlendingOverlap(0, 0, 2, set_cache_tmp[2].isshow , Number(set_cache_tmp[2].value));
set_cache.value[0] = JSON.stringify(set_cache_tmp);
}
}
}
return {
group,
array,
@ -513,7 +562,8 @@ export default defineComponent({
resetall,
set_cache,
reduce,
add
add,
auto_sync
};
},
});

View File

@ -1,86 +1,182 @@
<template>
<div class="row">
<div class="row">
<div class="col-12">
<div class="row">
<div class="col-12">
<div class="row">
<div class="col-12">
<div class="row">
<div class="col-4"></div>
<div class="col-4 q-pt-sm"><q-select outlined v-model="model[0]" :options="options" :dense="true"
:options-dense="true" label="单元行数" /> </div><q-checkbox v-model="RowsColumns[0]" />
</div>
</div>
<div class="col-12">
<div class="row">
<div class="col-4"></div>
<div class="col-4 q-pt-sm"><q-select outlined v-model="model[1]" :options="options" :dense="true"
:options-dense="true" label="单元列数" /> </div><q-checkbox v-model="RowsColumns[1]" />
</div>
</div>
<div class="col-12">
<div class="row" style="min-height: 40px;">
<div class="col-4"></div>
<div class="col-4 q-pt-sm"><div class="row"><div class="col-4"><span>网格颜色</span></div><div class="col-8" @click="isshowhex=true;index=0" :style="{'background-color':color[0]}"></div></div></div>
</div>
</div>
<div class="col-12">
<div class="row" style="min-height: 40px;">
<div class="col-4"></div>
<div class="col-4 q-pt-sm"><div class="row"><div class="col-4"><span>背景颜色</span></div><div class="col-8" @click="isshowhex=true;index=1" :style="{'background-color':color[1]}"></div></div></div>
</div>
</div>
<div class="col-12">
<div class="row" style="min-height: 40px;">
<div class="col-4"></div>
<div class="col-4 q-pt-sm"><div class="row"><div class="col-4"><span>中心线颜色</span></div><div class="col-8" @click="isshowhex=true;index=2" :style="{'background-color':color[2]}"></div></div></div><q-checkbox v-model="RowsColumns[2]" />
</div>
</div>
<div class="col-12">
<div class="row" style="min-height: 40px;">
<div class="col-4"></div>
<div class="col-4 q-pt-sm"><div class="row"><div class="col-4"><span>中心圆颜色</span></div><div class="col-8" @click="isshowhex=true;index=3" :style="{'background-color':color[3]}"></div></div></div><q-checkbox v-model="RowsColumns[3]" />
</div>
</div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col-4 q-pt-sm"><q-select outlined v-model="model[0]"
@update:model-value="update_row_col(0, model[0])" :options="options" :dense="true" :options-dense="true"
:label="$t('wall row')" /> </div><q-checkbox @update:model-value="send_off(0)"
v-model="RowsColumns[0]" />
</div>
</div>
<div v-if="isshowhex" style="margin: 0 auto;text-align: center;"><q-color no-header-tabs no-footer v-model="color[index]" class="my-picker" /> <q-btn style="margin-top: 0.5rem;" color="white" @click="isshowhex=false" class=" q-pt-sm" text-color="black" label="提交" /></div>
<div class="col-12">
<div class="row">
<div class="col-4"></div>
<div class="col-4 q-pt-sm"><q-select outlined v-model="model[1]"
@update:model-value="update_row_col(1, model[1])" :options="options" :dense="true" :options-dense="true"
:label="$t('wall col')" /> </div><q-checkbox @update:model-value="send_off(1)"
v-model="RowsColumns[1]" />
</div>
</div>
<div class="col-12">
<div class="row" style="min-height: 40px;">
<div class="col-4"></div>
<div class="col-4 q-pt-sm">
<div class="row">
<div class="col-4"><span>{{ $t('line color') }}</span></div>
<div class="col-8 border" @click="isshowhex = true; index = 0" :style="{ 'background-color': color[0] }"></div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="row" style="min-height: 40px;">
<div class="col-4"></div>
<div class="col-4 q-pt-sm">
<div class="row">
<div class="col-4"><span>{{ $t('background color') }}</span></div>
<div class="col-8 border" @click="isshowhex = true; index = 1" :style="{ 'background-color': color[1] }"></div>
</div>
</div>
</div>
</div>
<!-- <div class="col-12">
<div class="row" style="min-height: 40px;">
<div class="col-4"></div>
<div class="col-4 q-pt-sm">
<div class="row">
<div class="col-4"><span>{{ $t('center line color') }}</span></div>
<div class="col-8 border" @click="isshowhex = true; index = 2" :style="{ 'background-color': color[2] }"></div>
</div>
</div>
<div><q-checkbox v-model="RowsColumns[2]" @update:model-value="send_off(2)" /></div>
</div>
</div> -->
<!-- <div class="col-12">
<div class="row" style="min-height: 40px;">
<div class="col-4"></div>
<div class="col-4 q-pt-sm">
<div class="row">
<div class="col-4"><span>{{ $t('center circle color') }}</span></div>
<div class="col-8 border" @click="isshowhex = true; index = 3" :style="{ 'background-color': color[3] }"></div>
</div>
</div>
<div><q-checkbox v-model="RowsColumns[3]" @update:model-value="send_off(3)" /></div>
</div>
</div> -->
</div>
</div>
<div v-if="isshowhex" style="margin: 0 auto;text-align: center;"><q-color no-header-tabs no-footer
v-model="color[index]" class="my-picker" /> <q-btn style="margin-top: 0.5rem;" color="white" @click="submit"
class=" q-pt-sm" text-color="black" :label="$t('submit')" /></div>
</div>
</template>
<style scoped>
.border{
border: 1px solid;
}
</style>
<script lang="ts">
import vue3ResizeDrag from "/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue";
import { defineComponent, ref,reactive } from "vue";
import { defineComponent, ref, reactive } from "vue";
import { useStore } from "src/store";
import { useI18n } from "vue-i18n";
import GlobalData from "src/common/GlobalData";
export default defineComponent({
name: "ComponentGridSettings",
components:{
vue3ResizeDrag
},
setup() {
let $store = useStore();
let $t = useI18n();
const RowsColumns=reactive([false,false,false,false]);
const hex=ref("")
const isshowhex=ref(false);
const index=ref(0);
const color=reactive(["#000","#000","#000","#000"]);
let model = reactive([10,10]);
let options = ref(['10', '20', '30', '40', '50']);
return {
model,
options,
hex,
RowsColumns,
isshowhex,
index,
color,
};
},
name: "ComponentGridSettings",
components: {
vue3ResizeDrag
},
setup() {
let set = GlobalData.getInstance().getCurrentClient();
let $store = useStore();
let $t = useI18n();
const RowsColumns = reactive([false, false, false, false]);
const hex = ref("")
const isshowhex = ref(false);
const index = ref(0);
const color = reactive(["#ffffff", "#CCCCCC", "#000", "#000"]);
let model = reactive([20, 40]);
let options = ref([10, 20, 30, 40, 50]);
const submit = () => {
isshowhex.value = false
switch (index.value) {
case 0:
set?.SetBlendingOption("blending_grids_line_color", color[index.value]);
break;
case 1:
set?.SetBlendingOption("blending_grids_background_color", color[index.value]);
break;
case 2:
//set?.SetBlendingOption("blending_grids_line_color",color[index.value]);
break;
case 3:
//set?.SetBlendingOption("blending_grids_line_color",color[index.value]);
break;
default:
break;
}
}
const update_row_col = (type: number, value: number) => {
switch (type) {
case 0:
set?.SetBlendingOption("blending_grids_row", value + "");
break;
case 1:
set?.SetBlendingOption("blending_grids_column", value + "");
break;
default:
break;
}
}
const send_off = (type: number) => {
setTimeout(() => {
switch (type) {
case 0:
set?.SetBlendingOption("blending_grids_hide_row", RowsColumns[type] + "");
break;
case 1:
if (!RowsColumns[1]) RowsColumns[2] = false; RowsColumns[3] = false
set?.SetBlendingOption("blending_grids_hide_column", RowsColumns[type] + "");
break;
case 2:
break;
case 3:
break;
default:
break;
}
}, 100);
}
const use_server_config =()=>{
let server_conf=JSON.parse($store.state.fusion_configuration).options
model[0]=Number(server_conf.blending_grids_row)
model[1]=Number(server_conf.blending_grids_column)
color[0]=server_conf.blending_grids_line_color
RowsColumns[0]=server_conf.blending_grids_hide_row==="false"?false:true
RowsColumns[1]=server_conf.blending_grids_hide_column==="false"?false:true
}
use_server_config()
return {
model,
options,
hex,
submit,
RowsColumns,
isshowhex,
index,
color,
update_row_col,
send_off
};
},
});
</script>
</script>

View File

@ -428,4 +428,8 @@ export default {
"resetall config":"resetall config",
"disable blending params":"Dsable blending params",
"show blending grids":"show grids",
"line color":"line color",
"center line color":"center line color",
"center circle color":"center circle color",
"Whether to operate synchronously":"Whether to operate synchronously"
};

View File

@ -697,4 +697,8 @@ export default {
"resetall config":"重置所有配置",
"disable blending params":"禁用融合参数",
"show blending grids":"显示网格",
"line color":"线条颜色",
"center line color":"中心线颜色",
"center circle color":"中心圆颜色",
"Whether to operate synchronously":"是否同步操作"
};