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", "babel-loader": "^9.1.2",
"core-js": "^3.21.0", "core-js": "^3.21.0",
"element-resize-detector": "^1.2.4", "element-resize-detector": "^1.2.4",
"konva": "^8.4.2",
"qrcode.vue": "^3.3.3", "qrcode.vue": "^3.3.3",
"quasar": "^2.11.6", "quasar": "^2.11.6",
"reconnecting-websocket": "^4.4.0", "reconnecting-websocket": "^4.4.0",
@ -28,6 +29,7 @@
"v-viewer": "^3.0.9", "v-viewer": "^3.0.9",
"vue": "^3.0.0", "vue": "^3.0.0",
"vue-i18n": "^9.1.9", "vue-i18n": "^9.1.9",
"vue-konva": "^3.0.2",
"vue-router": "^4.0.0", "vue-router": "^4.0.0",
"vue3-draggable-resizable": "^1.6.5", "vue3-draggable-resizable": "^1.6.5",
"vuex": "^4.0.1", "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 // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
build: { build: {
vueRouterMode: "hash", // available values: 'hash', 'history' vueRouterMode: "hash", // available values: 'hash', 'history'
uglifyOptions: {
compress: {
drop_console: true,
},
},
// transpile: false, // transpile: false,
@ -57,7 +52,7 @@ module.exports = configure(function (ctx) {
// rtl: true, // https://v2.quasar.dev/options/rtl-support // rtl: true, // https://v2.quasar.dev/options/rtl-support
// preloadChunks: true, // preloadChunks: true,
// showProgress: false, // showProgress: false,
gzip: true, // gzip: true,
// analyze: true, // analyze: true,
// Options below are automatically set depending on the env, set them if you want to override // 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, https: false,
port: 8080, port: 8080,
open: true, // opens browser window automatically 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 // 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( public async setCloudServerSetting(
cloud_server_address: string, cloud_server_address: string,
cloud_server_verify_key: string, cloud_server_verify_key: string,

View File

@ -4,19 +4,17 @@
<div class="col-10 q-pt-md"> <div class="col-10 q-pt-md">
<div ref="div" style="width: 100%; background-color: #646464; height: 40vh"> <div ref="div" style="width: 100%; background-color: #646464; height: 40vh">
<div style="position: absolute"> <div style="position: absolute">
<Vue3DraggableResizable v-show="now_v_h == 'vertical'" <Vue3DraggableResizable v-show="now_v_h == 'vertical'" :class="[options_model_v == index ? 'action' : 'point']"
:class="[options_model_v == index ? 'action' : 'point']" v-for="(item, index) in value_v_point.length" v-for="(item, index) in value_v_point.length" :initW="point.w" :initH="point.h" :resizable="false" :x="0"
:initW="point.w" :initH="point.h" :resizable="false" :x="0" v-model:y="value_v_point[index].y" v-model:y="value_v_point[index].y" @activated="options_model_v = index; now_v_h = 'vertical'"
@activated="options_model_v = index; now_v_h = 'vertical'"
@click="options_model_v = index; now_v_h = 'vertical'" @dragging="dragStartHandle($event, index, 'v')"> @click="options_model_v = index; now_v_h = 'vertical'" @dragging="dragStartHandle($event, index, 'v')">
<span>v{{ <span>v{{
index + 1 index + 1
}}</span> }}</span>
</Vue3DraggableResizable> </Vue3DraggableResizable>
<Vue3DraggableResizable v-show="now_v_h == 'vertical'" <Vue3DraggableResizable v-show="now_v_h == 'vertical'" :class="[options_model_v == index ? 'action' : 'point']"
:class="[options_model_v == index ? 'action' : 'point']" v-for="(item, index) in value_v_point.length" v-for="(item, index) in value_v_point.length" :initW="point.w" :initH="point.h" :resizable="false"
:initW="point.w" :initH="point.h" :resizable="false" :x="max.x - 20" :x="max.x - 20" @click="options_model_v = index; now_v_h = 'vertical'" v-model:y="value_v_point[index].y"
@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')"> @activated="options_model_v = index; now_v_h = 'vertical'" @dragging="dragStartHandle($event, index, 'v')">
<span>v{{ <span>v{{
index + 1 index + 1
@ -50,47 +48,68 @@
</div> </div>
<div class="col-5"><q-radio v-model="now_v_h" val="vertical" :label="$t('vertical')" /></div> <div class="col-5"><q-radio v-model="now_v_h" val="vertical" :label="$t('vertical')" /></div>
</div> </div>
<div class="row" v-show="now_v_h == 'vertical'"> <div class="row" v-show="now_v_h == 'vertical'">
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-2"> <q-select class="q-pt-md" :label="$t('vertical')" <div class="col-3 q-px-md"> <q-select class="q-pt-md" :label="$t('vertical point')"
@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')"
@update:model-value="(val) => { chang_point_amount(val, 'v') }" :dense="true" filled @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> 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" <div class="col-3 q-pt-md q-px-md"><q-btn color="white" @click="add_dialog = true" text-color="black"
@click="add_dialog=true" text-color="black"
:label="$t('add control points')" /></div> :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" <div class="col-3 q-pt-md q-px-md"><q-btn color="white" @click="() => { del_dialog = true }"
:label="$t('reduce control points')" /></div> :disable="value_v_point_amount <= 5" text-color="black" :label="$t('reduce control points')" /></div>
</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="row" v-show="now_v_h == 'level'">
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-2"> <q-select class="q-pt-md" :label="$t('level')" <div class="col-3 q-px-md"> <q-select class="q-pt-md" :label="$t('level point')"
@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')"
@update:model-value="(val) => { chang_point_amount(val, 'h') }" :dense="true" filled @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> 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" <div class="col-3 q-pt-md "><q-btn color="white" @click="add_dialog = true" text-color="black"
@click="add_dialog=true" text-color="black"
:label="$t('add control points')" /></div> :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" <div class="col-3 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }"
:label="$t('reduce control points')" /></div> :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>
<div class="q-pt-md"> <q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall')" /></div>
</div> </div>
<div style="position: absolute;bottom: 0;"> <div style="position: absolute;bottom: 0;">
<q-checkbox v-model="auxiliary_line" @update:model-value="(value, evt) => { send_auxiliary_line(value) }" <q-checkbox v-model="auxiliary_line" @update:model-value="(value, evt) => { send_auxiliary_line(value) }"
@ -127,7 +146,6 @@
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>
<style scoped> <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); let serverconfig = JSON.parse($store.state.fusion_configuration);
const selectedprojector = computed(() => { const selectedprojector = computed(() => {
return ( return (
@ -331,8 +350,12 @@ export default defineComponent({
watch(() => now_v_h, (newval, oldval) => { watch(() => now_v_h, (newval, oldval) => {
if (newval.value == 'level') { if (newval.value == 'level') {
set?.SetBlendingOption("blending_grids_select_ui", "hor_density") 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 { } else {
set?.SetBlendingOption("blending_grids_select_ui", "ver_density") 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 }) }, { deep: true })
watch(() => value_v_point_amount, (newval, oldval) => { watch(() => value_v_point_amount, (newval, oldval) => {
@ -391,7 +414,7 @@ export default defineComponent({
save_set_cache() 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) $event = Number($event)
if (type == 'v') { if (type == 'v') {
let tmp = coordinate_transformation_value_to_xy(0, $event) 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 } => { const coordinate_transformation_value_to_xy = (x: number, y: number): { x: number, y: number } => {
x = x / Proportion.value.x x = x / Proportion.value.x
y = (config.height - y) / Proportion.value.y y = (allconfig.projector_height - y) / Proportion.value.y
return { x, y } return { x, y }
} }
@ -499,8 +522,8 @@ export default defineComponent({
} }
start() start()
onMounted(() => { onMounted(() => {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w) Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h) 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_h_point_amount.value = Object.keys(config.multi_hor_density)
options_value_v_point_amount.value = Object.keys(config.multi_ver_density) options_value_v_point_amount.value = Object.keys(config.multi_ver_density)
let tmp = JSON.parse($store.state.fusion_configuration).options; let tmp = JSON.parse($store.state.fusion_configuration).options;
@ -557,16 +580,52 @@ export default defineComponent({
for (let index = 0; index < value_v_point_amount.value; index++) { for (let index = 0; index < value_v_point_amount.value; index++) {
reset(index, false, 'v') reset(index, false, 'v')
} }
send_value(-1, 'v', 0);
break; break;
case 'level': case 'level':
for (let index = 0; index < value_h_point_amount.value; index++) { for (let index = 0; index < value_h_point_amount.value; index++) {
reset(index, false, 'h') reset(index, false, 'h')
} }
send_value(-1, 'h', 0);
break; break;
default: default:
break; 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); 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;
}
} }
const del_dialog = ref(false) const del_dialog = ref(false)
const add_control_points = (amount: number, type: string) => { const add_control_points = (amount: number, type: string) => {
@ -598,8 +657,6 @@ export default defineComponent({
options_value_v_point_amount.value.push(key) options_value_v_point_amount.value.push(key)
} }
// console.log(amount)
// console.log(tmpconfig.multi_ver_density)
value_v_point_amount.value = amount value_v_point_amount.value = amount
$store.commit("setfusion_configuration", res?.config); $store.commit("setfusion_configuration", res?.config);
value_v.value = [] value_v.value = []
@ -673,8 +730,8 @@ export default defineComponent({
*/ */
const recalculate_coordinates = () => { const recalculate_coordinates = () => {
try { try {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w) Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h) Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
max.value.x = div.value.offsetWidth max.value.x = div.value.offsetWidth
max.value.y = div.value.offsetHeight max.value.y = div.value.offsetHeight
for (let index = 0; index < value_v_point_amount.value; index++) { for (let index = 0; index < value_v_point_amount.value; index++) {
@ -872,7 +929,8 @@ export default defineComponent({
del_dialog, del_dialog,
add_dialog, add_dialog,
now_amount, now_amount,
set_cache set_cache,
resetall_all
} }
} }
}) })

View File

@ -88,12 +88,15 @@ export default defineComponent({
let $store = useStore(); let $store = useStore();
let $t = useI18n(); let $t = useI18n();
const ste_status = ref(0); const ste_status = ref(0);
let allconfig = JSON.parse($store.state.fusion_configuration);
let config = JSON.parse($store.state.fusion_configuration).projectors[0]; let config = JSON.parse($store.state.fusion_configuration).projectors[0];
const configselsect = computed(() => { const configselsect = computed(() => {
return $store.state.selected_projector; return $store.state.selected_projector;
}); });
// /**
* 用于计算当前投影仪的索引
*/
let serverconfig = JSON.parse($store.state.fusion_configuration); let serverconfig = JSON.parse($store.state.fusion_configuration);
const selectedprojector = computed(() => { const selectedprojector = computed(() => {
return ( return (
@ -231,10 +234,8 @@ export default defineComponent({
const chang = (index: number, $event: any, type: string) => { const chang = (index: number, $event: any, type: string) => {
index = Number(index) index = Number(index)
let tmp = coordinate_transformation_value_to_xy(value.value[index].x, value.value[index].y) 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].y = Math.round(tmp.y)
value_point.value[index].x = Math.round(tmp.x) 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)) send_value(index, Math.round(value.value[index].x), Math.round(value.value[index].y))
save_set_cache() save_set_cache()
@ -247,7 +248,7 @@ export default defineComponent({
*/ */
const coordinate_transformation_value_to_xy = (x: number, y: number): { x: number, y: number } => { const coordinate_transformation_value_to_xy = (x: number, y: number): { x: number, y: number } => {
x = x / Proportion.value.x x = x / Proportion.value.x
y = (config.height - y) / Proportion.value.y y = (allconfig.projector_height - y) / Proportion.value.y
return { x, y } return { x, y }
} }
@ -293,8 +294,8 @@ export default defineComponent({
} }
start() start()
onMounted(() => { onMounted(() => {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w) Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h) Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
start_point() start_point()
start() start()
use_server_config() use_server_config()
@ -321,8 +322,6 @@ export default defineComponent({
const reset = (index: number, send: boolean, type: string) => { const reset = (index: number, send: boolean, type: string) => {
value.value[index].x = value.value[index].def_x value.value[index].x = value.value[index].def_x
value.value[index].y = value.value[index].def_y 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) chang(index, value.value[index].def_y, type)
save_set_cache() save_set_cache()
} }
@ -333,13 +332,18 @@ export default defineComponent({
} }
const resetall = () => { const resetall = () => {
for (let index = 0; index < value_point.value.length; index++) { 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 = () => { const recalculate_coordinates = () => {
try { try {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w) Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h) Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
max.value.x = div.value.offsetWidth max.value.x = div.value.offsetWidth
max.value.y = div.value.offsetHeight max.value.y = div.value.offsetHeight
for (let index = 0; index < value.value.length; index++) { for (let index = 0; index < value.value.length; index++) {

View File

@ -124,6 +124,7 @@ export default defineComponent({
let $store = useStore(); let $store = useStore();
let $t = useI18n(); let $t = useI18n();
const ste_status = ref(0); const ste_status = ref(0);
let allconfig = JSON.parse($store.state.fusion_configuration);
let config = JSON.parse($store.state.fusion_configuration).projectors[0]; let config = JSON.parse($store.state.fusion_configuration).projectors[0];
const configselsect = computed(() => { const configselsect = computed(() => {
return $store.state.selected_projector; return $store.state.selected_projector;
@ -140,9 +141,7 @@ export default defineComponent({
const value_point_amount = ref(9) const value_point_amount = ref(9)
const del_dialog = ref(false) 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[]>[]) 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 } => { const coordinate_transformation_value_to_xy = (x: number, y: number): { x: number, y: number } => {
x = x / Proportion.value.x x = x / Proportion.value.x
y = (config.height - y) / Proportion.value.y y = (allconfig.projector_height - y) / Proportion.value.y
return { x, y } return { x, y }
} }
@ -342,8 +341,8 @@ export default defineComponent({
} }
start() start()
onMounted(() => { onMounted(() => {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w) Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h) Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
start_point(9) start_point(9)
start() start()
use_server_config() use_server_config()
@ -381,14 +380,18 @@ export default defineComponent({
} }
const resetall = () => { const resetall = () => {
for (let index = 0; index < value_point.value.length; index++) { 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 = () => { const recalculate_coordinates = () => {
try { try {
Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w) Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h) Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
max.value.x = div.value.offsetWidth max.value.x = div.value.offsetWidth
max.value.y = div.value.offsetHeight max.value.y = div.value.offsetHeight
for (let index = 0; index < value.value.length; index++) { 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> @click="currently_selected_projector(index_row + '-' + index_col)"></projector-item>
</div> </div>
<div class="col-12" style="text-align: center"> <div class="col-12" style="text-align: center">
{{ {{
$t("Whether to enable integration") $t("Whether to enable integration")
}}<q-checkbox v-model="EnableBlending" /> }}<q-checkbox v-model="EnableBlending" />
</div> </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>
<div class="col-10"> <div class="col-10">
<div class="q-ta-md"> <div class="q-ta-md">
@ -111,9 +116,6 @@
<q-item-section> <q-item-section>
<q-item-label v-html="opt" /> <q-item-label v-html="opt" />
</q-item-section> </q-item-section>
<q-item-section side>
<q-icon name="clear" @click="del_scenes(opt)"></q-icon>
</q-item-section>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
@ -147,7 +149,7 @@
</q-card-section> </q-card-section>
<q-card-actions align="right" class="bg-white text-teal"> <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('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-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
@ -233,7 +235,27 @@ export default defineComponent({
const send_disable_blending_params = () => { const send_disable_blending_params = () => {
set?.SetBlendingOption(disable_blending_params_id.value, disable_blending_params.value ? "1" : "0"); 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 child :any = ref(null);
/**
* 开启网格时发送全部参数
*
*/
const send_show_blending_grids = () => { const send_show_blending_grids = () => {
let tmp = "" let tmp = ""
switch (optionsstr.value) { switch (optionsstr.value) {
@ -272,11 +294,12 @@ export default defineComponent({
set?.SetBlendingOption("blending_grids_select_point", `9:${child.value!.options_model+1}`) set?.SetBlendingOption("blending_grids_select_point", `9:${child.value!.options_model+1}`)
break; break;
case 'DensityCorrection': case 'DensityCorrection':
console.log(child.value!.now_v_h)
if(child.value!.now_v_h=='vertical'){ if(child.value!.now_v_h=='vertical'){
set?.SetBlendingOption("blending_grids_select_point", `${child.value!.options_model_v+1}`) 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{ }else{
set?.SetBlendingOption("blending_grids_select_point", `${child.value!.options_model_h+1}`) 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; break;
default: default:
@ -284,6 +307,9 @@ export default defineComponent({
} }
}; };
/**
* 重置全部参数
*/
const resetall = () => { const resetall = () => {
set?.ResetBlendingConfig().then((res) => { set?.ResetBlendingConfig().then((res) => {
let tmp = JSON.parse(res ? res.config : ""); let tmp = JSON.parse(res ? res.config : "");
@ -301,6 +327,9 @@ export default defineComponent({
options.value = tmp options.value = tmp
}, 300); }, 300);
} }
/**
* 清除sessionStorage缓存
*/
const clear_sessionStorage = () => { const clear_sessionStorage = () => {
sessionStorage.removeItem("FusionLocale"); sessionStorage.removeItem("FusionLocale");
sessionStorage.removeItem("SurfaceCorrection"); sessionStorage.removeItem("SurfaceCorrection");
@ -327,6 +356,9 @@ export default defineComponent({
optionsstr.value = newValue; optionsstr.value = newValue;
}, },
}); });
/**
* 监听是否开启融合
*/
watch( watch(
() => EnableBlending, () => EnableBlending,
(newVal, oldVal) => { (newVal, oldVal) => {
@ -336,6 +368,32 @@ export default defineComponent({
{ deep: true } { 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, watch(() => optionsstr,
(newVal) => { (newVal) => {
let tmp = "" let tmp = ""
@ -366,6 +424,9 @@ export default defineComponent({
// //
get_scenes() get_scenes()
}; };
/**
* 读取服务器配置
*/
const getconfig = () => { const getconfig = () => {
try { try {
set?.GetBlendingConfig("").then((res) => { set?.GetBlendingConfig("").then((res) => {
@ -387,7 +448,9 @@ export default defineComponent({
options.value = "FusionLocale" options.value = "FusionLocale"
}; };
/**
* 读取服务器场景
*/
const get_scenes = () => { const get_scenes = () => {
set?.EnumBlendingScene().then((res) => { set?.EnumBlendingScene().then((res) => {
if (res == null || res.scenes.length == 0) return if (res == null || res.scenes.length == 0) return
@ -419,7 +482,12 @@ export default defineComponent({
config.value.col = tmp.col; config.value.col = tmp.col;
config.value.row = tmp.row; config.value.row = tmp.row;
$store.commit("setfusion_configuration", res?.config); $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() get_scenes()
set?.SetBlendingOption("blending_grids_select_ui", "blending") set?.SetBlendingOption("blending_grids_select_ui", "blending")
@ -430,6 +498,9 @@ export default defineComponent({
'' ''
] ]
const apply_the_selected_configuration = () => { const apply_the_selected_configuration = () => {
$q.loading.show({
message: 'Loading please wait'
})
set?.ApplyBlendingScene(select_configuration_name.value).then((res) => { set?.ApplyBlendingScene(select_configuration_name.value).then((res) => {
let tmp = JSON.parse(res ? res.config : "{}"); let tmp = JSON.parse(res ? res.config : "{}");
EnableBlending.value = tmp.enable; EnableBlending.value = tmp.enable;
@ -445,6 +516,7 @@ export default defineComponent({
setTimeout(() => { setTimeout(() => {
clear_sessionStorage() clear_sessionStorage()
options.value = tmp options.value = tmp
$q.loading.hide()
}, 800); }, 800);
getconfig() getconfig()
} }
@ -520,7 +592,10 @@ export default defineComponent({
saveconfig, saveconfig,
isdebug, isdebug,
del_dialog, del_dialog,
child child,
options_resolution,
now_resolution,
set_resolution
}; };
}, },
}); });

View File

@ -548,6 +548,12 @@ export namespace Protocol {
public static get kDelBlendingCtrlPoint() { public static get kDelBlendingCtrlPoint() {
return Commands.PROTOCOL_PREFIX + "DelBlendingCtrlPoint"; 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() { public static get kRpcFileManagerGetFileList() {
return Commands.PROTOCOL_PREFIX + "RpcFileManagerGetFileList"; return Commands.PROTOCOL_PREFIX + "RpcFileManagerGetFileList";
} }
@ -701,6 +707,8 @@ export namespace Protocol {
Commands.kDeleteBlendingScene, Commands.kDeleteBlendingScene,
Commands.kAddBlendingCtrlPoint, Commands.kAddBlendingCtrlPoint,
Commands.kDelBlendingCtrlPoint, Commands.kDelBlendingCtrlPoint,
Commands.kSetProjectorResolution,
Commands.kSetProjectorLayout,
Commands.kRpcSetMagicWallGridState, Commands.kRpcSetMagicWallGridState,
Commands.kRpcGetMagicWallGridState, Commands.kRpcGetMagicWallGridState,
Commands.kRpcFileManagerGetFileList, Commands.kRpcFileManagerGetFileList,
@ -3672,6 +3680,45 @@ export namespace Protocol {
column = 0; column = 0;
count = 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 { export class RpcFileManagerGetFileListRequest extends PacketEntity {
dir_path: string = ""; dir_path: string = "";
constructor(dir_path: string, rpc_id = 0) { constructor(dir_path: string, rpc_id = 0) {

View File

@ -170,6 +170,7 @@ export default {
advanced: "Advanced", advanced: "Advanced",
"revert and exit": "Revert And Exit", "revert and exit": "Revert And Exit",
apply: "Apply", apply: "Apply",
load: "Load",
"current real resolution": "Current Real Resolution", "current real resolution": "Current Real Resolution",
"output type": "Output Type", "output type": "Output Type",
"target resolution": "Target Resolution", "target resolution": "Target Resolution",
@ -436,8 +437,8 @@ export default {
"center line color": "center line color", "center line color": "center line color",
"center circle color": "center circle color", "center circle color": "center circle color",
"Whether to operate synchronously": "Whether to operate synchronously", "Whether to operate synchronously": "Whether to operate synchronously",
"Select saved configuration": "Select saved Configuration", "Select saved configuration": "Configuration list",
"read saved configuration": "read saved configuration", "read saved configuration": "Configuration list",
"please choose": "please choose", "please choose": "please choose",
save: "Save", save: "Save",
"Whether to save the configuration": "Whether to save the configuration", "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":
"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", "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", "device verify key": "Device Verify Key",
"use wss": "Use Wss", "use wss": "Use Wss",
"server address": "Server Address", "server address": "Server Address",
@ -488,4 +491,6 @@ export default {
"raster graph": "Raster Graph", "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 '.'", "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: "禁用", disable: "禁用",
enable: "启用", enable: "启用",
apply: "应用", apply: "应用",
load: "加载",
"apply and exit": "应用并退出", "apply and exit": "应用并退出",
revert: "恢复", revert: "恢复",
"revert and exit": "不保存退出", "revert and exit": "不保存退出",
@ -704,8 +705,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": "融合配置列表",
"please choose": "请选择", "please choose": "请选择",
save: "保存", save: "保存",
"Whether to save the configuration": "是否保存配置", "Whether to save the configuration": "是否保存配置",
@ -735,6 +736,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 the current program control point":"重置当前方案控制点",
"device verify key": "设备校验码", "device verify key": "设备校验码",
"use wss": "使用Wss", "use wss": "使用Wss",
"server address": "服务器地址", "server address": "服务器地址",
@ -753,4 +756,6 @@ export default {
"export magic": "导出", "export magic": "导出",
"raster graph": "栅格图", "raster graph": "栅格图",
"the folder name cannot start with a '.'": "文件夹名称不能以“.” 开头", "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