疏密调节接口

This commit is contained in:
ljqing 2023-01-09 16:51:15 +08:00
parent 584f228c91
commit a6a4a0860d
2 changed files with 89 additions and 1 deletions

View File

@ -1437,6 +1437,38 @@ export default class ClientConnection {
);
}
public async SetBlendingHorDensity(
row: number,
column: number,
control_point: number,
value: number
) {
return await this.doRpc<Protocol.NoneResponse>(
new Protocol.SetBlendingHoDensityRequestEntity(
row,
column,
control_point,
value
)
);
}
public async SetBlendingVerDensity(
row: number,
column: number,
control_point: number,
value: number
) {
return await this.doRpc<Protocol.NoneResponse>(
new Protocol.SetBlendingVerDensityRequestEntity(
row,
column,
control_point,
value
)
);
}
public destory() {
this.ws?.close();
if (this.ws) {

View File

@ -514,6 +514,12 @@ export namespace Protocol {
public static get kSaveBlendingConfig() {
return Commands.PROTOCOL_PREFIX + "SaveBlendingConfig";
}
public static get kSetBlendingHorDensity() {
return Commands.PROTOCOL_PREFIX + "SetBlendingHorDensity";
}
public static get kSetBlendingVerDensity() {
return Commands.PROTOCOL_PREFIX + "SetBlendingVerDensity";
}
static _all_commands = new Set([
Commands.kUnKnowCommand,
@ -642,7 +648,9 @@ export namespace Protocol {
Commands.kEnableBlending,
Commands.kSetBlendingOverlap,
Commands.kGetBlendingConfig,
Commands.kSaveBlendingConfig,
Commands.kSaveBlendingConfig,
Commands.SetBlendingHorDensity,
Commands.SetBlendingVerDensity,
]);
public static get AllCommands() {
return this._all_commands;
@ -3391,4 +3399,52 @@ export namespace Protocol {
}
name = "";
}
export class SetBlendingHorDensityRequestEntity extends PacketEntity {
constructor(
row: number,
column: number,
control_point: number,
value: number,
rpc_id = 0
) {
super();
super.command = Commands.kSetBlendingHorDensity;
super.flag = PacketEntity.FLAG_REQUEST;
super.rpc_id = rpc_id;
this.row = row ?? 0;
this.column = column ?? 0;
this.control_point = control_point ?? 0;
this.value = value ?? 0;
}
row = 0;
column = 0;
control_point = 0; //控制点编号1开始从上到下从左到右
value = 0;
}
export class SetBlendingVerDensityRequestEntity extends PacketEntity {
constructor(
row: number,
column: number,
control_point: number,
value: number,
rpc_id = 0
) {
super();
super.command = Commands.kSetBlendingVerDensity;
super.flag = PacketEntity.FLAG_REQUEST;
super.rpc_id = rpc_id;
this.row = row ?? 0;
this.column = column ?? 0;
this.control_point = control_point ?? 0;
this.value = value ?? 0;
}
row = 0;
column = 0;
control_point = 0; //控制点编号1开始从上到下从左到右
value = 0;
}
}