同步修改协议

This commit is contained in:
fangxiang 2022-11-11 11:35:40 +08:00
parent 6393b8f370
commit 9b137cc68a
3 changed files with 12 additions and 23 deletions

View File

@ -28,7 +28,7 @@ export default class ClientConnectionCustom {
} }
public async setVideoWallConfig( public async setVideoWallConfig(
outputs: OutputBoardItemConfigEntity[], rotation_180_outputs: number[],
wall_rows: number, wall_rows: number,
wall_cols: number, wall_cols: number,
device_rotation: number device_rotation: number
@ -37,7 +37,7 @@ export default class ClientConnectionCustom {
try { try {
return await this.connection.doRpc<CustomProtocol.ISVSetVideoWallConfigResponseEntity>( return await this.connection.doRpc<CustomProtocol.ISVSetVideoWallConfigResponseEntity>(
new CustomProtocol.ISVSetVideoWallConfigRequestEntity( new CustomProtocol.ISVSetVideoWallConfigRequestEntity(
outputs, rotation_180_outputs,
wall_rows, wall_rows,
wall_cols, wall_cols,
device_rotation device_rotation

View File

@ -237,8 +237,6 @@ export default defineComponent({
const preview_rotation = ref(0); const preview_rotation = ref(0);
const previce_grid_height = ref(100); const previce_grid_height = ref(100);
let cache_outputs: OutputBoardItemConfigEntity[] = [];
class parseSpliceModeResult { class parseSpliceModeResult {
rotation = 0; rotation = 0;
rows = 2; rows = 2;
@ -363,8 +361,6 @@ export default defineComponent({
splice_mode.value += " (180°)"; splice_mode.value += " (180°)";
} }
// preview_rotation.value = video_wall_config.outputs[pos].rotation; // preview_rotation.value = video_wall_config.outputs[pos].rotation;
cache_outputs = video_wall_config.outputs;
} }
} }
@ -387,26 +383,17 @@ export default defineComponent({
try { try {
const result = parseSpliceMode(splice_mode.value); const result = parseSpliceMode(splice_mode.value);
const output = <OutputBoardItemConfigEntity[]>[]; const rotation_180_outputs = <number[]>[];
if (result.rotation != 0) { if (result.rotation == 180) {
for (let i = 0; i < result.cols * result.rows; ++i) { for (let i = 0; i < result.cols; ++i) {
let item = cache_outputs.find((e) => e && e.index == i); rotation_180_outputs.push(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);
} }
} }
try { try {
const response = await GlobalData.getInstance() const response = await GlobalData.getInstance()
.getCurrentClient() .getCurrentClient()
?.customConnection.setVideoWallConfig( ?.customConnection.setVideoWallConfig(
output, rotation_180_outputs,
result.rows, result.rows,
result.cols, result.cols,
screen_mode.value == 0 ? 0 : 90 screen_mode.value == 0 ? 0 : 90

View File

@ -52,12 +52,12 @@ export namespace CustomProtocol {
} }
export class ISVSetVideoWallConfigRequestEntity extends Protocol.PacketEntity { export class ISVSetVideoWallConfigRequestEntity extends Protocol.PacketEntity {
outputs: OutputBoardItemConfigEntity[] = []; rotation_180_outputs: number[] = [];
wall_rows = 2; wall_rows = 2;
wall_cols = 2; wall_cols = 2;
device_rotation = 0; device_rotation = 0;
constructor( constructor(
outputs: OutputBoardItemConfigEntity[], rotation_180_outputs: number[],
wall_rows: number, wall_rows: number,
wall_cols: number, wall_cols: number,
device_rotation: number, device_rotation: number,
@ -66,7 +66,9 @@ export namespace CustomProtocol {
super(); super();
this.rpc_id = rpcid ?? 0; this.rpc_id = rpcid ?? 0;
this.command = Commands.kISVSetVideoWallConfig; 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_cols = wall_cols;
this.wall_rows = wall_rows; this.wall_rows = wall_rows;
this.device_rotation = device_rotation; this.device_rotation = device_rotation;