This commit is contained in:
miao 2023-02-17 14:29:46 +08:00
commit 1ce66817d4
11 changed files with 3848 additions and 2571 deletions

View File

@ -18,6 +18,7 @@
"babel-loader": "^9.1.2",
"core-js": "^3.21.0",
"element-resize-detector": "^1.2.4",
"konva": "^8.4.2",
"qrcode.vue": "^3.3.3",
"quasar": "^2.11.6",
"reconnecting-websocket": "^4.4.0",
@ -28,6 +29,7 @@
"v-viewer": "^3.0.9",
"vue": "^3.0.0",
"vue-i18n": "^9.1.9",
"vue-konva": "^3.0.2",
"vue-router": "^4.0.0",
"vue3-draggable-resizable": "^1.6.5",
"vuex": "^4.0.1",

View File

@ -41,11 +41,6 @@ module.exports = configure(function (ctx) {
// Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
build: {
vueRouterMode: "hash", // available values: 'hash', 'history'
uglifyOptions: {
compress: {
drop_console: true,
},
},
// transpile: false,
@ -57,7 +52,7 @@ module.exports = configure(function (ctx) {
// rtl: true, // https://v2.quasar.dev/options/rtl-support
// preloadChunks: true,
// showProgress: false,
gzip: true,
// gzip: true,
// analyze: true,
// Options below are automatically set depending on the env, set them if you want to override
@ -75,17 +70,6 @@ module.exports = configure(function (ctx) {
https: false,
port: 8080,
open: true, // opens browser window automatically
headers: {
"Access-Control-Allow-Methods": "POST,GET,PUT,DELETE",
"Access-Control-Allow-Credentials": true,
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "*",
},
proxy: {
"/get_websocket_port": "http://192.168.2.102",
"/media_control_client_product.js": "http://192.168.2.102",
"/media_control_client_language.js": "http://192.168.2.102",
},
},
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework

View File

@ -1551,6 +1551,24 @@ export default class ClientConnection {
);
}
public async SetProjectorResolution(
width: number,
height: number
) {
return await this.doRpc<Protocol.GetBlendingConfigResponseEntity>(
new Protocol.SetProjectorResolutionRequestEntity(width, height)
);
}
public async SetProjectorLayout(
row: number,
column: number
) {
return await this.doRpc<Protocol.GetBlendingConfigResponseEntity>(
new Protocol.SetProjectorResolutionRequestEntity(row, column)
);
}
public async setCloudServerSetting(
cloud_server_address: string,
cloud_server_verify_key: string,

View File

@ -4,22 +4,20 @@
<div class="col-10 q-pt-md">
<div ref="div" style="width: 100%; background-color: #646464; height: 40vh">
<div style="position: absolute">
<Vue3DraggableResizable v-show="now_v_h == 'vertical'"
:class="[options_model_v == index ? 'action' : 'point']" v-for="(item, index) in value_v_point.length"
:initW="point.w" :initH="point.h" :resizable="false" :x="0" v-model:y="value_v_point[index].y"
@activated="options_model_v = index; now_v_h = 'vertical'"
<Vue3DraggableResizable v-show="now_v_h == 'vertical'" :class="[options_model_v == index ? 'action' : 'point']"
v-for="(item, index) in value_v_point.length" :initW="point.w" :initH="point.h" :resizable="false" :x="0"
v-model:y="value_v_point[index].y" @activated="options_model_v = index; now_v_h = 'vertical'"
@click="options_model_v = index; now_v_h = 'vertical'" @dragging="dragStartHandle($event, index, 'v')">
<span>v{{
index+ 1
index + 1
}}</span>
</Vue3DraggableResizable>
<Vue3DraggableResizable v-show="now_v_h == 'vertical'"
:class="[options_model_v == index ? 'action' : 'point']" v-for="(item, index) in value_v_point.length"
:initW="point.w" :initH="point.h" :resizable="false" :x="max.x - 20"
@click="options_model_v = index; now_v_h = 'vertical'" v-model:y="value_v_point[index].y"
<Vue3DraggableResizable v-show="now_v_h == 'vertical'" :class="[options_model_v == index ? 'action' : 'point']"
v-for="(item, index) in value_v_point.length" :initW="point.w" :initH="point.h" :resizable="false"
:x="max.x - 20" @click="options_model_v = index; now_v_h = 'vertical'" v-model:y="value_v_point[index].y"
@activated="options_model_v = index; now_v_h = 'vertical'" @dragging="dragStartHandle($event, index, 'v')">
<span>v{{
index+ 1
index + 1
}}</span>
</Vue3DraggableResizable>
<Vue3DraggableResizable v-show="now_v_h == 'level'" :class="[options_model_h == index ? 'action' : 'point']"
@ -27,7 +25,7 @@
v-model:x="value_h_point[index].x" :y="0" @activated="options_model_h = index; now_v_h = 'level'"
@click="options_model_h = index; now_v_h = 'level'" @dragging="dragStartHandle($event, index, 'h')">
<span>h{{
index+ 1
index + 1
}}</span>
</Vue3DraggableResizable>
<Vue3DraggableResizable v-show="now_v_h == 'level'" :class="[options_model_h == index ? 'action' : 'point']"
@ -35,7 +33,7 @@
v-model:x="value_h_point[index].x" @activated="options_model_h = index; now_v_h = 'level'" :y="max.y - 20"
@click="options_model_h = index; now_v_h = 'level'" @dragging="dragStartHandle($event, index, 'h')">
<span>h{{
index+ 1
index + 1
}}</span>
</Vue3DraggableResizable>
</div>
@ -50,47 +48,68 @@
</div>
<div class="col-5"><q-radio v-model="now_v_h" val="vertical" :label="$t('vertical')" /></div>
</div>
<div class="row" v-show="now_v_h == 'vertical'">
<div class="col-1"></div>
<div class="col-2"> <q-select class="q-pt-md" :label="$t('vertical')"
@update:model-value="(val) => { options_v = val }" :dense="true" filled v-model="options_model_v"
:options="options_v" emit-value map-options /></div>
<div class="col-2"> <q-input v-if="value_v[options_model_v]" filled type="number" class="q-pt-md" :dense="true"
v-model="value_v[options_model_v].y" @update:model-value="chang(options_model_v, $event, 'v')" lazy-rules />
</div>
<div class="q-pt-md col-2">
<q-btn color="white" @click="reset(options_model_v, true, 'v')" text-color="black" :label="$t('reset')" />
</div>
<div class="col-2"> <q-select class="q-pt-md" :label="$t('vertical point')"
<div class="col-3 q-px-md"> <q-select class="q-pt-md" :label="$t('vertical point')"
@update:model-value="(val) => { chang_point_amount(val, 'v') }" :dense="true" filled
v-model="value_v_point_amount" :options="options_value_v_point_amount" emit-value map-options /></div>
<div class="col-1 q-pt-md "><q-btn color="white"
@click="add_dialog=true" text-color="black"
<div class="col-3 q-pt-md q-px-md"><q-btn color="white" @click="add_dialog = true" text-color="black"
:label="$t('add control points')" /></div>
<div class="col-1 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }" :disable="value_v_point_amount<=5" text-color="black"
:label="$t('reduce control points')" /></div>
<div class="col-3 q-pt-md q-px-md"><q-btn color="white" @click="() => { del_dialog = true }"
:disable="value_v_point_amount <= 5" text-color="black" :label="$t('reduce control points')" /></div>
</div>
<div class="row" v-show="now_v_h == 'vertical'">
<div class="col-1"></div>
<div class="col-3 q-px-md"> <q-select class="q-pt-md " :label="$t('vertical')"
@update:model-value="(val) => { options_v = val }" :dense="true" filled v-model="options_model_v"
:options="options_v" emit-value map-options /></div>
<div class="col-3 q-px-md"> <q-input v-if="value_v[options_model_v]" filled type="number" class="q-pt-md"
:dense="true" v-model="value_v[options_model_v].y" @update:model-value="chang(options_model_v, $event, 'v')"
lazy-rules />
</div>
<div class="q-pt-md col-3">
<q-btn color="white" @click="reset(options_model_v, true, 'v')" text-color="black" :label="$t('reset')" />
</div>
</div>
<div class="row" v-show="now_v_h == 'level'">
<div class="col-1"></div>
<div class="col-2"> <q-select class="q-pt-md" :label="$t('level')"
@update:model-value="(val) => { options_h = val }" :dense="true" filled v-model="options_model_h"
:options="options_h" emit-value map-options /></div>
<div class="col-2"> <q-input v-if="value_h[options_model_h]" filled type="number" class="q-pt-md" :dense="true"
v-model="value_h[options_model_h].x" @update:model-value="chang(options_model_h, $event, 'h')" lazy-rules />
</div>
<div class="q-pt-md col-2">
<q-btn color="white" @click="reset(options_model_h, true, 'h')" text-color="black" :label="$t('reset')" />
</div>
<div class="col-2"> <q-select class="q-pt-md" :label="$t('level point')"
<div class="col-3 q-px-md"> <q-select class="q-pt-md" :label="$t('level point')"
@update:model-value="(val) => { chang_point_amount(val, 'h') }" :dense="true" filled
v-model="value_h_point_amount" :options="options_value_h_point_amount" emit-value map-options /></div>
<div class="col-1 q-pt-md "><q-btn color="white"
@click="add_dialog=true" text-color="black"
<div class="col-3 q-pt-md "><q-btn color="white" @click="add_dialog = true" text-color="black"
:label="$t('add control points')" /></div>
<div class="col-1 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }" :disable="value_h_point_amount<=5" text-color="black"
:label="$t('reduce control points')" /></div>
<div class="col-3 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }"
:disable="value_h_point_amount <= 5" text-color="black" :label="$t('reduce control points')" /></div>
</div>
<div class="row" v-show="now_v_h == 'level'">
<div class="col-1"></div>
<div class="col-3 q-px-md"> <q-select class="q-pt-md" :label="$t('level')"
@update:model-value="(val) => { options_h = val }" :dense="true" filled v-model="options_model_h"
:options="options_h" emit-value map-options /></div>
<div class="col-3 q-px-md"> <q-input v-if="value_h[options_model_h]" filled type="number" class="q-pt-md"
:dense="true" v-model="value_h[options_model_h].x" @update:model-value="chang(options_model_h, $event, 'h')"
lazy-rules />
</div>
<div class="q-pt-md col-3">
<q-btn color="white" @click="reset(options_model_h, true, 'h')" text-color="black" :label="$t('reset')" />
</div>
</div>
<div class="row">
<div class="col-1"></div>
<div class="q-pt-md q-px-md col-5"> <q-btn color="white" @click="resetall" text-color="black"
:label="$t('Reset the current program control point')" /></div>
<div class="q-pt-md q-px-md col-5"> <q-btn color="white" @click="resetall_all" text-color="black"
:label="$t('Reset all program control points')" /></div>
</div>
<div class="q-pt-md"> <q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall')" /></div>
</div>
<div style="position: absolute;bottom: 0;">
<q-checkbox v-model="auxiliary_line" @update:model-value="(value, evt) => { send_auxiliary_line(value) }"
@ -126,8 +145,7 @@
<q-btn flat :label="$t('ok')" @click="add" color="primary" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
</q-dialog>
</template>
<style scoped>
@ -182,6 +200,7 @@ export default defineComponent({
});
//
let allconfig = JSON.parse($store.state.fusion_configuration);
let serverconfig = JSON.parse($store.state.fusion_configuration);
const selectedprojector = computed(() => {
return (
@ -192,8 +211,8 @@ export default defineComponent({
const now_v_h = ref("")
const value_h_point_amount = ref(5)
const value_v_point_amount = ref(5)
const add_dialog=ref(false)
const now_amount=ref(0)
const add_dialog = ref(false)
const now_amount = ref(0)
const options_value_h_point_amount = ref(<string[]>[])
const options_value_v_point_amount = ref(<string[]>[])
@ -331,8 +350,12 @@ export default defineComponent({
watch(() => now_v_h, (newval, oldval) => {
if (newval.value == 'level') {
set?.SetBlendingOption("blending_grids_select_ui", "hor_density")
set?.SetBlendingOption("blending_grids_control_point_count", `${value_h_point_amount.value}`)
set?.SetBlendingOption("blending_grids_select_point", `${options_model_h.value + 1}`)
} else {
set?.SetBlendingOption("blending_grids_select_ui", "ver_density")
set?.SetBlendingOption("blending_grids_control_point_count", `${value_v_point_amount.value}`)
set?.SetBlendingOption("blending_grids_select_point", `${options_model_v.value + 1}`)
}
}, { deep: true })
watch(() => value_v_point_amount, (newval, oldval) => {
@ -391,7 +414,7 @@ export default defineComponent({
save_set_cache()
}
const chang = (index: number, $event: any, type: string, send: boolean) => {
const chang = (index: number, $event: any, type: string, send?: boolean) => {
$event = Number($event)
if (type == 'v') {
let tmp = coordinate_transformation_value_to_xy(0, $event)
@ -433,7 +456,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 }
}
@ -499,8 +522,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;
@ -541,7 +564,7 @@ export default defineComponent({
save_set_cache()
}
const send_value = (index: number, type: string, value: number, send: boolean = true) => {
if (!send) return;
if (!send) return;
let row = $store.getters.GetTheCurrentlySelectedCamera[0]
let col = $store.getters.GetTheCurrentlySelectedCamera[1]
if (type == 'v') {
@ -557,16 +580,52 @@ export default defineComponent({
for (let index = 0; index < value_v_point_amount.value; index++) {
reset(index, false, 'v')
}
send_value(-1, 'v', 0);
break;
case 'level':
for (let index = 0; index < value_h_point_amount.value; index++) {
reset(index, false, 'h')
}
send_value(-1, 'h', 0);
break;
default:
break;
}
send_value(-1, 'v', 0);
}
/**
* 重置全部为默认值
*/
const resetall_all = () => {
switch (now_v_h.value) {
case 'vertical':
for (let key in config.multi_ver_density) {
for (let index = 0; index < config.multi_ver_density[key].length; index++) {
config.multi_ver_density[key][index].x = config.multi_ver_density[key][index].def_x
config.multi_ver_density[key][index].y = config.multi_ver_density[key][index].def_y
}
start_point(Number(key), 'v')
}
value_v_point_amount.value = 5
start_point(Number(5), 'v')
send_value(-2, 'v', 0);
break;
case 'level':
for (let key in config.multi_hor_density) {
for (let index = 0; index < config.multi_hor_density[key].length; index++) {
config.multi_hor_density[key][index].x = config.multi_hor_density[key][index].def_x
config.multi_hor_density[key][index].y = config.multi_hor_density[key][index].def_y
}
start_point(Number(key), 'h')
}
value_h_point_amount.value = 5
start_point(Number(5), 'h')
send_value(-2, 'h', 0);
break;
default:
break;
}
send_value(-2, 'v', 0);
}
const del_dialog = ref(false)
const add_control_points = (amount: number, type: string) => {
@ -598,8 +657,6 @@ export default defineComponent({
options_value_v_point_amount.value.push(key)
}
// console.log(amount)
// console.log(tmpconfig.multi_ver_density)
value_v_point_amount.value = amount
$store.commit("setfusion_configuration", res?.config);
value_v.value = []
@ -673,8 +730,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++) {
@ -726,8 +783,8 @@ export default defineComponent({
for (let key in tmpconfig.multi_ver_density) {
options_value_v_point_amount.value.push(key)
}
value_v_point_amount.value = Number(options_value_v_point_amount.value[options_value_v_point_amount.value.length-1])
amount=Number(options_value_v_point_amount.value[options_value_v_point_amount.value.length-1])
value_v_point_amount.value = Number(options_value_v_point_amount.value[options_value_v_point_amount.value.length - 1])
amount = Number(options_value_v_point_amount.value[options_value_v_point_amount.value.length - 1])
// console.log(tmpconfig.multi_ver_density)
// console.log(value_v_point_amount.value)
// console.log(amount,'a')
@ -749,7 +806,7 @@ export default defineComponent({
}
value_v_point.value.push(tmp_point)
}
options_model_v.value=0
options_model_v.value = 0
});
break;
case 'h':
@ -773,8 +830,8 @@ export default defineComponent({
for (let key in tmpconfig.multi_hor_density) {
options_value_h_point_amount.value.push(key)
}
value_h_point_amount.value = Number(options_value_h_point_amount.value[options_value_h_point_amount.value.length-1])
amount=Number(options_value_h_point_amount.value[options_value_h_point_amount.value.length-1])
value_h_point_amount.value = Number(options_value_h_point_amount.value[options_value_h_point_amount.value.length - 1])
amount = Number(options_value_h_point_amount.value[options_value_h_point_amount.value.length - 1])
//value_h_point_amount.value = amount
$store.commit("setfusion_configuration", res?.config);
value_h.value = []
@ -795,7 +852,7 @@ export default defineComponent({
}
value_h_point.value.push(tmp_point)
}
options_model_h.value=0
options_model_h.value = 0
});
break;
default:
@ -872,7 +929,8 @@ export default defineComponent({
del_dialog,
add_dialog,
now_amount,
set_cache
set_cache,
resetall_all
}
}
})

View File

@ -88,12 +88,15 @@ 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;
});
//
/**
* 用于计算当前投影仪的索引
*/
let serverconfig = JSON.parse($store.state.fusion_configuration);
const selectedprojector = computed(() => {
return (
@ -231,10 +234,8 @@ export default defineComponent({
const chang = (index: number, $event: any, type: string) => {
index = Number(index)
let tmp = coordinate_transformation_value_to_xy(value.value[index].x, value.value[index].y)
console.log(tmp)
value_point.value[index].y = Math.round(tmp.y)
value_point.value[index].x = Math.round(tmp.x)
console.log(value_point.value[index])
send_value(index, Math.round(value.value[index].x), Math.round(value.value[index].y))
save_set_cache()
@ -247,7 +248,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 }
}
@ -293,8 +294,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()
@ -321,8 +322,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()
}
@ -333,13 +332,18 @@ export default defineComponent({
}
const resetall = () => {
for (let index = 0; index < value_point.value.length; index++) {
reset(index, true, 'v')
value.value[index].x = value.value[index].def_x
value.value[index].y = value.value[index].def_y
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)
}
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;
@ -140,9 +141,7 @@ export default defineComponent({
const value_point_amount = ref(9)
const del_dialog = ref(false)
// const options_value_point_amount = computed(() => {
// return Object.keys(config.multi_curved_surface)
// })
const options_value_point_amount = ref(<string[]>[])
@ -299,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 }
}
@ -342,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()
@ -381,14 +380,18 @@ export default defineComponent({
}
const resetall = () => {
for (let index = 0; index < value_point.value.length; index++) {
reset(index, true, 'v')
value.value[index].x = value.value[index].def_x
value.value[index].y = value.value[index].def_y
let tmp = coordinate_transformation_value_to_xy(value.value[index].x, value.value[index].y)
value_point.value[index].y = Math.trunc(tmp.y)
value_point.value[index].x = Math.trunc(tmp.x)
}
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

@ -40,11 +40,16 @@
@click="currently_selected_projector(index_row + '-' + index_col)"></projector-item>
</div>
<div class="col-12" style="text-align: center">
{{
$t("Whether to enable integration")
}}<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) => { set_resolution(val) }" :dense="true" filled v-model="now_resolution"
:options="options_resolution" emit-value map-options /></div>
</div>
<div class="col-10">
<div class="q-ta-md">
@ -111,9 +116,6 @@
<q-item-section>
<q-item-label v-html="opt" />
</q-item-section>
<q-item-section side>
<q-icon name="clear" @click="del_scenes(opt)"></q-icon>
</q-item-section>
</q-item>
</template>
</q-select>
@ -147,7 +149,7 @@
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn flat :label="$t('Cancel')" color="primary" v-close-popup />
<q-btn flat :label="$t('apply')" @click="apply_the_selected_configuration" color="primary" v-close-popup />
<q-btn flat :label="$t('load')" @click="apply_the_selected_configuration" color="primary" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
@ -233,7 +235,27 @@ 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(1)
// let allconfig = JSON.parse($store.state.fusion_configuration);
/**
* 模拟数据完成dom渲染再次获取真实后台数据
*/
let allconfig = JSON.parse("{\"resolution\": [{\"width\": 1024,\"height\": 768}]}");
const options_resolution = computed(() => {
let tmp=[];
for (let index = 0; index < allconfig.resolution.length; index++) {
tmp.push({
label: `${allconfig.resolution[index].width}*${allconfig.resolution[index].height}`,
value: index,
})
}
return tmp
})
const child :any = ref(null);
/**
* 开启网格时发送全部参数
*
*/
const send_show_blending_grids = () => {
let tmp = ""
switch (optionsstr.value) {
@ -272,11 +294,12 @@ 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}`)
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}`)
set?.SetBlendingOption("blending_grids_control_point_count", `${child.value!.value_h_point_amount}`)
}
break;
default:
@ -284,6 +307,9 @@ export default defineComponent({
}
};
/**
* 重置全部参数
*/
const resetall = () => {
set?.ResetBlendingConfig().then((res) => {
let tmp = JSON.parse(res ? res.config : "");
@ -301,6 +327,9 @@ export default defineComponent({
options.value = tmp
}, 300);
}
/**
* 清除sessionStorage缓存
*/
const clear_sessionStorage = () => {
sessionStorage.removeItem("FusionLocale");
sessionStorage.removeItem("SurfaceCorrection");
@ -327,6 +356,9 @@ export default defineComponent({
optionsstr.value = newValue;
},
});
/**
* 监听是否开启融合
*/
watch(
() => EnableBlending,
(newVal, oldVal) => {
@ -336,6 +368,32 @@ export default defineComponent({
{ deep: true }
);
/**
* 设置分辨率
* @param index 索引号
*/
const set_resolution=(index:number)=>{
$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()
}
/**
* 监听ui切换
*/
watch(() => optionsstr,
(newVal) => {
let tmp = ""
@ -366,6 +424,9 @@ export default defineComponent({
//
get_scenes()
};
/**
* 读取服务器配置
*/
const getconfig = () => {
try {
set?.GetBlendingConfig("").then((res) => {
@ -387,7 +448,9 @@ export default defineComponent({
options.value = "FusionLocale"
};
/**
* 读取服务器场景
*/
const get_scenes = () => {
set?.EnumBlendingScene().then((res) => {
if (res == null || res.scenes.length == 0) return
@ -419,7 +482,12 @@ export default defineComponent({
config.value.col = tmp.col;
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")
@ -430,6 +498,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;
@ -445,6 +516,7 @@ export default defineComponent({
setTimeout(() => {
clear_sessionStorage()
options.value = tmp
$q.loading.hide()
}, 800);
getconfig()
}
@ -520,7 +592,10 @@ export default defineComponent({
saveconfig,
isdebug,
del_dialog,
child
child,
options_resolution,
now_resolution,
set_resolution
};
},
});

View File

@ -548,6 +548,12 @@ export namespace Protocol {
public static get kDelBlendingCtrlPoint() {
return Commands.PROTOCOL_PREFIX + "DelBlendingCtrlPoint";
}
public static get kSetProjectorResolution() {
return Commands.PROTOCOL_PREFIX + "SetProjectorResolution";
}
public static get kSetProjectorLayout() {
return Commands.PROTOCOL_PREFIX + "SetProjectorLayout";
}
public static get kRpcFileManagerGetFileList() {
return Commands.PROTOCOL_PREFIX + "RpcFileManagerGetFileList";
}
@ -701,6 +707,8 @@ export namespace Protocol {
Commands.kDeleteBlendingScene,
Commands.kAddBlendingCtrlPoint,
Commands.kDelBlendingCtrlPoint,
Commands.kSetProjectorResolution,
Commands.kSetProjectorLayout,
Commands.kRpcSetMagicWallGridState,
Commands.kRpcGetMagicWallGridState,
Commands.kRpcFileManagerGetFileList,
@ -3672,6 +3680,45 @@ export namespace Protocol {
column = 0;
count = 0; //控制点数量
}
export class SetProjectorResolutionRequestEntity extends PacketEntity {
constructor(
width: number,
height: number,
rpc_id = 0
) {
super();
super.command = Commands.kSetProjectorResolution;
super.flag = PacketEntity.FLAG_REQUEST;
super.rpc_id = rpc_id;
this.width = width ?? 0;
this.height = height ?? 0;
}
width = 0;
height = 0;
}
export class SetProjectorLayoutRequestEntity extends PacketEntity {
constructor(
row: number,
column: number,
rpc_id = 0
) {
super();
super.command = Commands.kSetProjectorResolution;
super.flag = PacketEntity.FLAG_REQUEST;
super.rpc_id = rpc_id;
this.row = row ?? 0;
this.column = column ?? 0;
}
row = 0;
column = 0;
}
export class RpcFileManagerGetFileListRequest extends PacketEntity {
dir_path: string = "";
constructor(dir_path: string, rpc_id = 0) {

View File

@ -170,6 +170,7 @@ export default {
advanced: "Advanced",
"revert and exit": "Revert And Exit",
apply: "Apply",
load: "Load",
"current real resolution": "Current Real Resolution",
"output type": "Output Type",
"target resolution": "Target Resolution",
@ -436,8 +437,8 @@ export default {
"center line color": "center line color",
"center circle color": "center circle color",
"Whether to operate synchronously": "Whether to operate synchronously",
"Select saved configuration": "Select saved Configuration",
"read saved configuration": "read saved configuration",
"Select saved configuration": "Configuration list",
"read saved configuration": "Configuration list",
"please choose": "please choose",
save: "Save",
"Whether to save the configuration": "Whether to save the configuration",
@ -469,6 +470,8 @@ export default {
"Please enter the points you need to add":
"Please enter the points you need to add",
"Whether to add control points": "Whether to add control points",
"Reset all program control points":"Reset all program control points",
"Reset the current program control point":"Reset the current program control point",
"device verify key": "Device Verify Key",
"use wss": "Use Wss",
"server address": "Server Address",
@ -487,5 +490,7 @@ export default {
"export magic": "Export",
"raster graph": "Raster Graph",
"the folder name cannot start with a '.'":
"The Folder Name Cannot Start With a '.'",
"The Folder Name Cannot Start With a '.'",
"change resolution":"change resolution",
"Loading please wait":"Loading please wait"
};

View File

@ -218,6 +218,7 @@ export default {
disable: "禁用",
enable: "启用",
apply: "应用",
load: "加载",
"apply and exit": "应用并退出",
revert: "恢复",
"revert and exit": "不保存退出",
@ -704,8 +705,8 @@ export default {
"center line color": "中心线颜色",
"center circle color": "中心圆颜色",
"Whether to operate synchronously": "是否同步操作",
"Select saved configuration": "选择保存的配置",
"read saved configuration": "读取保存的配置",
"Select saved configuration": "配置列表",
"read saved configuration": "融合配置列表",
"please choose": "请选择",
save: "保存",
"Whether to save the configuration": "是否保存配置",
@ -735,6 +736,8 @@ export default {
"确定删除你将失去现在调整的数据",
"Please enter the points you need to add": "请输入你所需要添加的点数",
"Whether to add control points": "是否添加控制点",
"Reset all program control points":"重置全部方案控制点",
"Reset the current program control point":"重置当前方案控制点",
"device verify key": "设备校验码",
"use wss": "使用Wss",
"server address": "服务器地址",
@ -753,4 +756,6 @@ export default {
"export magic": "导出",
"raster graph": "栅格图",
"the folder name cannot start with a '.'": "文件夹名称不能以“.” 开头",
"change resolution":"更改分辨率",
"Loading please wait":"加载中 请稍等"
};

5992
yarn.lock

File diff suppressed because it is too large Load Diff