From 9b137cc68a1e322943de4cb353566a8af447296e Mon Sep 17 00:00:00 2001 From: fangxiang Date: Fri, 11 Nov 2022 11:35:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnectionCustom.ts | 4 ++-- src/components/custom/ISVVideoWallDialog.vue | 23 +++++--------------- src/entities/WSProtocolCustom.ts | 8 ++++--- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/common/ClientConnectionCustom.ts b/src/common/ClientConnectionCustom.ts index 51f8374..c6114de 100644 --- a/src/common/ClientConnectionCustom.ts +++ b/src/common/ClientConnectionCustom.ts @@ -28,7 +28,7 @@ export default class ClientConnectionCustom { } public async setVideoWallConfig( - outputs: OutputBoardItemConfigEntity[], + rotation_180_outputs: number[], wall_rows: number, wall_cols: number, device_rotation: number @@ -37,7 +37,7 @@ export default class ClientConnectionCustom { try { return await this.connection.doRpc( new CustomProtocol.ISVSetVideoWallConfigRequestEntity( - outputs, + rotation_180_outputs, wall_rows, wall_cols, device_rotation diff --git a/src/components/custom/ISVVideoWallDialog.vue b/src/components/custom/ISVVideoWallDialog.vue index 0eacd3a..94c3f81 100644 --- a/src/components/custom/ISVVideoWallDialog.vue +++ b/src/components/custom/ISVVideoWallDialog.vue @@ -237,8 +237,6 @@ export default defineComponent({ const preview_rotation = ref(0); const previce_grid_height = ref(100); - let cache_outputs: OutputBoardItemConfigEntity[] = []; - class parseSpliceModeResult { rotation = 0; rows = 2; @@ -363,8 +361,6 @@ export default defineComponent({ splice_mode.value += " (180°)"; } // preview_rotation.value = video_wall_config.outputs[pos].rotation; - - cache_outputs = video_wall_config.outputs; } } @@ -387,26 +383,17 @@ export default defineComponent({ try { const result = parseSpliceMode(splice_mode.value); - const output = []; - if (result.rotation != 0) { - for (let i = 0; i < result.cols * result.rows; ++i) { - let item = cache_outputs.find((e) => e && e.index == i); - if (!item) { - item = new OutputBoardItemConfigEntity(); - item.index = i; - item.output_index = i; - item.rotation = 0; - } - item.rotation = result.rotation == 180 ? 1 : 0; - output.push(item); + const rotation_180_outputs = []; + if (result.rotation == 180) { + for (let i = 0; i < result.cols; ++i) { + rotation_180_outputs.push(i); } } - try { const response = await GlobalData.getInstance() .getCurrentClient() ?.customConnection.setVideoWallConfig( - output, + rotation_180_outputs, result.rows, result.cols, screen_mode.value == 0 ? 0 : 90 diff --git a/src/entities/WSProtocolCustom.ts b/src/entities/WSProtocolCustom.ts index ea25cac..9dfd2d2 100644 --- a/src/entities/WSProtocolCustom.ts +++ b/src/entities/WSProtocolCustom.ts @@ -52,12 +52,12 @@ export namespace CustomProtocol { } export class ISVSetVideoWallConfigRequestEntity extends Protocol.PacketEntity { - outputs: OutputBoardItemConfigEntity[] = []; + rotation_180_outputs: number[] = []; wall_rows = 2; wall_cols = 2; device_rotation = 0; constructor( - outputs: OutputBoardItemConfigEntity[], + rotation_180_outputs: number[], wall_rows: number, wall_cols: number, device_rotation: number, @@ -66,7 +66,9 @@ export namespace CustomProtocol { super(); this.rpc_id = rpcid ?? 0; this.command = Commands.kISVSetVideoWallConfig; - this.outputs = Array.isArray(outputs) ? outputs : []; + this.rotation_180_outputs = Array.isArray(rotation_180_outputs) + ? rotation_180_outputs + : []; this.wall_cols = wall_cols; this.wall_rows = wall_rows; this.device_rotation = device_rotation;