增加MagicWall配置接口
This commit is contained in:
parent
3a44fb1fbf
commit
35c6baba37
|
@ -15,6 +15,7 @@ import TimingTaskEntity from "src/entities/TimingTaskEntity";
|
||||||
import JointActionEquipmentTableEntity from "src/entities/JointActionEquipmentTableEntity";
|
import JointActionEquipmentTableEntity from "src/entities/JointActionEquipmentTableEntity";
|
||||||
import { CustomProtocol } from "src/entities/WSProtocolCustom";
|
import { CustomProtocol } from "src/entities/WSProtocolCustom";
|
||||||
import ClientConnectionCustom from "./ClientConnectionCustom";
|
import ClientConnectionCustom from "./ClientConnectionCustom";
|
||||||
|
import MagicWallConfig from "src/entities/MagicWallConfig";
|
||||||
|
|
||||||
class _RpcInfo {
|
class _RpcInfo {
|
||||||
send_timestamp: number;
|
send_timestamp: number;
|
||||||
|
@ -1232,6 +1233,26 @@ export default class ClientConnection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getMagicWallConfig() {
|
||||||
|
try {
|
||||||
|
return await this.doRpc<Protocol.RpcGetMagicWallConfigResponseEntity>(
|
||||||
|
new Protocol.RpcGetMagicWallConfigRequestEntity()
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async setMagicWallConfig(config: MagicWallConfig) {
|
||||||
|
try {
|
||||||
|
return await this.doRpc<Protocol.RpcSetMagicWallConfigResponseEntity>(
|
||||||
|
new Protocol.RpcSetMagicWallConfigRequestEntity(config)
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async setHdmiInDecodeType(index: number, type: string) {
|
public async setHdmiInDecodeType(index: number, type: string) {
|
||||||
try {
|
try {
|
||||||
return await this.doRpc<Protocol.SetHdmiInDecodeTypeResponseEntity>(
|
return await this.doRpc<Protocol.SetHdmiInDecodeTypeResponseEntity>(
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import RectF from "./RectF";
|
||||||
|
|
||||||
|
export default class MagicWallConfig {
|
||||||
|
magic_wall_enable = false;
|
||||||
|
row = 0;
|
||||||
|
col = 0;
|
||||||
|
windows: RectF[] = [];
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
export default class RectF {
|
||||||
|
lt: PointF = new PointF(0, 0);
|
||||||
|
w: number = 0;
|
||||||
|
h: number = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PointF {
|
||||||
|
constructor(x: number, y: number) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
x: number = 0;
|
||||||
|
y: number = 0;
|
||||||
|
}
|
|
@ -12,6 +12,7 @@ import { SerialPortConfigEntity } from "./SerialPortConfigEntity";
|
||||||
import { ConnectTableEntity } from "./ConnectTableEntity";
|
import { ConnectTableEntity } from "./ConnectTableEntity";
|
||||||
import TimingTaskEntity from "./TimingTaskEntity";
|
import TimingTaskEntity from "./TimingTaskEntity";
|
||||||
import JointActionEquipmentTableEntity from "./JointActionEquipmentTableEntity";
|
import JointActionEquipmentTableEntity from "./JointActionEquipmentTableEntity";
|
||||||
|
import MagicWallConfig from "./MagicWallConfig";
|
||||||
|
|
||||||
export namespace Protocol {
|
export namespace Protocol {
|
||||||
export class Commands {
|
export class Commands {
|
||||||
|
@ -474,6 +475,14 @@ export namespace Protocol {
|
||||||
return Commands.PROTOCOL_PREFIX + "SetHDMIRotation";
|
return Commands.PROTOCOL_PREFIX + "SetHDMIRotation";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static get kRpcSetMagicWallConfig() {
|
||||||
|
return Commands.PROTOCOL_PREFIX + "RpcSetMagicWallConfig";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static get kRpcGetMagicWallConfig() {
|
||||||
|
return Commands.PROTOCOL_PREFIX + "RpcGetMagicWallConfig";
|
||||||
|
}
|
||||||
|
|
||||||
static _all_commands = new Set([
|
static _all_commands = new Set([
|
||||||
Commands.kUnKnowCommand,
|
Commands.kUnKnowCommand,
|
||||||
Commands.kSearchDevice,
|
Commands.kSearchDevice,
|
||||||
|
@ -590,6 +599,8 @@ export namespace Protocol {
|
||||||
Commands.kRpcDeleteJointActionEquipment,
|
Commands.kRpcDeleteJointActionEquipment,
|
||||||
Commands.kCleanBrowserCache,
|
Commands.kCleanBrowserCache,
|
||||||
Commands.kSetHDMIRotation,
|
Commands.kSetHDMIRotation,
|
||||||
|
Commands.kRpcGetMagicWallConfig,
|
||||||
|
Commands.kRpcSetMagicWallConfig,
|
||||||
]);
|
]);
|
||||||
public static get AllCommands() {
|
public static get AllCommands() {
|
||||||
return this._all_commands;
|
return this._all_commands;
|
||||||
|
@ -3036,4 +3047,45 @@ export namespace Protocol {
|
||||||
this.rotation = rotation;
|
this.rotation = rotation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class RpcGetMagicWallConfigRequestEntity extends PacketEntity {
|
||||||
|
constructor(rpc_id = 0) {
|
||||||
|
super();
|
||||||
|
super.command = Commands.kRpcGetMagicWallConfig;
|
||||||
|
super.flag = PacketEntity.FLAG_REQUEST;
|
||||||
|
super.rpc_id = rpc_id;
|
||||||
|
}
|
||||||
|
timestamp = Date.now();
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RpcGetMagicWallConfigResponseEntity extends PacketEntity {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
super.flag = PacketEntity.FLAG_RESPONSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
config: MagicWallConfig = new MagicWallConfig();
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RpcSetMagicWallConfigRequestEntity extends PacketEntity {
|
||||||
|
constructor(config: MagicWallConfig, rpc_id = 0) {
|
||||||
|
super();
|
||||||
|
super.command = Commands.kRpcSetMagicWallConfig;
|
||||||
|
super.flag = PacketEntity.FLAG_REQUEST;
|
||||||
|
super.rpc_id = rpc_id;
|
||||||
|
|
||||||
|
this.config = config ?? new MagicWallConfig();
|
||||||
|
}
|
||||||
|
config: MagicWallConfig = new MagicWallConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RpcSetMagicWallConfigResponseEntity extends PacketEntity {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
super.flag = PacketEntity.FLAG_RESPONSE;
|
||||||
|
}
|
||||||
|
config: MagicWallConfig = new MagicWallConfig();
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue