From 64a86cc23ebd249b66ee6a967269a694da2a69a4 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Mon, 7 Nov 2022 19:35:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E9=9C=B8=E5=AE=9A=E5=88=B6VideoWall?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 13 +- src/common/ClientConnectionCustom.ts | 53 ++ src/common/EventBus.ts | 1 + src/common/Initializer.ts | 3 +- src/components/AdvancedDebugDialog.vue | 59 +- src/components/CenterControlDialog.vue | 1 - .../EditJointActionEquipmentDialog.vue | 1 + .../ListJointActionEquipmentDialog.vue | 1 + src/components/PlanDialog.vue | 1 + src/components/RegisterDialog.vue | 39 +- src/components/SignalSourceDialog.vue | 7 +- src/components/SystemSettingDialog.vue | 83 +- src/components/TimingTaskDialog.vue | 1 + src/components/WindowRectEditDialog.vue | 1 + src/components/custom/ISVVideoWallDialog.vue | 438 ++++++++++ src/entities/EDeviceAttribute.ts | 38 + src/entities/OutputBoardItemConfigEntity.ts | 5 + src/entities/WSProtocol.ts | 39 - src/entities/WSProtocolCustom.ts | 85 ++ src/i18n/en-US/index.ts | 6 + src/i18n/zh-CN/index.ts | 6 + src/layouts/MainLayout.vue | 12 +- src/pad/MainLayout.vue | 10 +- src/pad/TopToolbar.vue | 32 +- src/pad/custom/ISVTopToolbar.vue | 477 +++++++++++ src/pages/TopToolBar.vue | 33 +- src/pages/custom/ISVTopToolBar.vue | 803 ++++++++++++++++++ src/store/index.ts | 28 +- 28 files changed, 2055 insertions(+), 221 deletions(-) create mode 100644 src/common/ClientConnectionCustom.ts create mode 100644 src/components/custom/ISVVideoWallDialog.vue create mode 100644 src/entities/EDeviceAttribute.ts create mode 100644 src/entities/OutputBoardItemConfigEntity.ts create mode 100644 src/entities/WSProtocolCustom.ts create mode 100644 src/pad/custom/ISVTopToolbar.vue create mode 100644 src/pages/custom/ISVTopToolBar.vue diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index fbe62b8..64bd31b 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -13,6 +13,8 @@ import { ExternalControlTableEntity } from "src/entities/ExternalControlTableEnt import { SerialPortConfigEntity } from "src/entities/SerialPortConfigEntity"; import TimingTaskEntity from "src/entities/TimingTaskEntity"; import JointActionEquipmentTableEntity from "src/entities/JointActionEquipmentTableEntity"; +import { CustomProtocol } from "src/entities/WSProtocolCustom"; +import ClientConnectionCustom from "./ClientConnectionCustom"; class _RpcInfo { send_timestamp: number; @@ -50,6 +52,8 @@ export default class ClientConnection { _rpc_id_counter = 0; rpc_map = new Map(); + custom_connection: ClientConnectionCustom = new ClientConnectionCustom(this); + public login_callback: | ((this: ClientConnection, logined: boolean) => void) | null = null; @@ -83,6 +87,10 @@ export default class ClientConnection { return this._is_login; } + get customConnection() { + return this.custom_connection ?? new ClientConnectionCustom(this); + } + checkRpcTimeout() { const current_datetime = new Date().getTime(); this.rpc_map.forEach((v, k, m) => { @@ -142,7 +150,10 @@ export default class ClientConnection { this.rpc_map.get(packet.rpc_id)?.reject(); this.rpc_map.delete(packet.rpc_id); } - if (Protocol.Commands.AllCommands.has(packet.command)) { + if ( + Protocol.Commands.AllCommands.has(packet.command) || + CustomProtocol.Commands.AllCommands.has(packet.command) + ) { if ( packet.flag == Protocol.PacketEntity.FLAG_RESPONSE || packet.flag == Protocol.PacketEntity.FLAG_NOTIFY diff --git a/src/common/ClientConnectionCustom.ts b/src/common/ClientConnectionCustom.ts new file mode 100644 index 0000000..51f8374 --- /dev/null +++ b/src/common/ClientConnectionCustom.ts @@ -0,0 +1,53 @@ +import OutputBoardItemConfigEntity from "src/entities/OutputBoardItemConfigEntity"; +import { CustomProtocol } from "src/entities/WSProtocolCustom"; +import ClientConnection from "./ClientConnection"; + +export default class ClientConnectionCustom { + connection_: ClientConnection | null = null; + + constructor(connection: ClientConnection) { + this.connection_ = connection; + } + + get connection() { + return this.connection_; + } + + public async getVideoWallConfig() { + if (this.connection) { + try { + return await this.connection.doRpc( + new CustomProtocol.ISVGetVideoWallConfigRequestEntity() + ); + } catch (e) { + console.error(e); + return; + } + } + throw "connection is nullptr!"; + } + + public async setVideoWallConfig( + outputs: OutputBoardItemConfigEntity[], + wall_rows: number, + wall_cols: number, + device_rotation: number + ) { + if (this.connection) { + try { + return await this.connection.doRpc( + new CustomProtocol.ISVSetVideoWallConfigRequestEntity( + outputs, + wall_rows, + wall_cols, + device_rotation + ) + ); + } catch (e) { + console.error(e); + return; + } + } + throw "connection is nullptr!"; + } +} diff --git a/src/common/EventBus.ts b/src/common/EventBus.ts index 6231ee3..f2add1e 100644 --- a/src/common/EventBus.ts +++ b/src/common/EventBus.ts @@ -36,5 +36,6 @@ export namespace EventNamesDefine { export const RefreshJointActionEquipmentList = "onRefreshJointActionEquipmentList"; export const CheckDebug = "CheckDebug"; + export const CheckDebug2 = "CheckDebug2"; export const NotifyDownloadAndroid = "NotifyDownloadAndroid"; } diff --git a/src/common/Initializer.ts b/src/common/Initializer.ts index eb3275d..dbfbcd7 100644 --- a/src/common/Initializer.ts +++ b/src/common/Initializer.ts @@ -4,6 +4,7 @@ import { Common } from "./Common"; import EventBus, { EventNamesDefine } from "./EventBus"; import OptionsType from "./OptionsType"; import { Cookies } from "quasar"; +import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; export default class Initializer { private options: OptionsType; @@ -194,7 +195,7 @@ export default class Initializer { .then((response) => { if (response && typeof response.attribute != "undefined") { $store.commit("setDeviceAttribute", response.attribute); - if (response.attribute & Protocol.EDeviceAttribute.CustomISV) { + if (response.attribute & EDeviceAttribute.CustomISV) { let language = Cookies.get("language"); if (!language) { language = "zh-CN"; diff --git a/src/components/AdvancedDebugDialog.vue b/src/components/AdvancedDebugDialog.vue index 0c7cded..0c325cb 100644 --- a/src/components/AdvancedDebugDialog.vue +++ b/src/components/AdvancedDebugDialog.vue @@ -175,6 +175,7 @@ import { useQuasar, date as $date } from "quasar"; import { useI18n } from "vue-i18n"; import GlobalData from "src/common/GlobalData"; import { Protocol } from "src/entities/WSProtocol"; +import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; export default defineComponent({ name: "ComponentAdvancedDebugDialog", @@ -187,10 +188,16 @@ export default defineComponent({ let show_dialog = ref(false); let loading = ref(false); - const function_center_control = ref(false); - const function_output_board = ref(false); - const function_mirroring_output = ref(false); - const function_custom_ISV = ref(false); + const function_custom_ISV = ref($store.state.custom_defines.is_custom_isv); + const function_center_control = ref( + $store.state.custom_defines.function_center_control + ); + const function_output_board = ref( + $store.state.custom_defines.function_output_board + ); + const function_mirroring_output = ref( + $store.state.custom_defines.function_mirroring_output + ); const target_language = ref("zh-CN"); return { @@ -205,33 +212,13 @@ export default defineComponent({ showDialog() { show_dialog.value = true; - setTimeout(async () => { - try { - const response = await GlobalData.getInstance() - .getCurrentClient() - ?.getDeviceAttribute(); - if (response) { - nextTick(() => { - function_center_control.value = - (response.attribute & - Protocol.EDeviceAttribute.CenterControl) != - 0; - function_output_board.value = - (response.attribute & - Protocol.EDeviceAttribute.OutputBoard) != - 0; - function_mirroring_output.value = - ($store.state.device_attribute & - Protocol.EDeviceAttribute.MirroringOutput) != - 0; - - function_custom_ISV.value = - (response.attribute & Protocol.EDeviceAttribute.CustomISV) != - 0; - }); - } - } catch {} - }, 0); + function_custom_ISV.value = $store.state.custom_defines.is_custom_isv; + function_center_control.value = + $store.state.custom_defines.function_center_control; + function_output_board.value = + $store.state.custom_defines.function_output_board; + function_mirroring_output.value = + $store.state.custom_defines.function_mirroring_output; }, resetData() { loading.value = false; @@ -318,19 +305,19 @@ export default defineComponent({ }); }, setDeviceAttribute() { - let attribute = Protocol.EDeviceAttribute.None; + let attribute = EDeviceAttribute.None; if (function_center_control.value) { - attribute |= Protocol.EDeviceAttribute.CenterControl; + attribute |= EDeviceAttribute.CenterControl; } if (function_output_board.value) { - attribute |= Protocol.EDeviceAttribute.OutputBoard; + attribute |= EDeviceAttribute.OutputBoard; } if (function_mirroring_output.value) { - attribute |= Protocol.EDeviceAttribute.MirroringOutput; + attribute |= EDeviceAttribute.MirroringOutput; } if (function_custom_ISV.value) { - attribute |= Protocol.EDeviceAttribute.CustomISV; + attribute |= EDeviceAttribute.CustomISV; } GlobalData.getInstance() diff --git a/src/components/CenterControlDialog.vue b/src/components/CenterControlDialog.vue index 0b9ed23..faaa642 100644 --- a/src/components/CenterControlDialog.vue +++ b/src/components/CenterControlDialog.vue @@ -550,7 +550,6 @@ export default defineComponent({ let success = false; let request_current_type = current_type.value; - console.log(request_current_type); if ( request_current_type != "SERIAL_PORT" && request_current_type != "UDP" && diff --git a/src/components/EditJointActionEquipmentDialog.vue b/src/components/EditJointActionEquipmentDialog.vue index ca325d6..41c5b12 100644 --- a/src/components/EditJointActionEquipmentDialog.vue +++ b/src/components/EditJointActionEquipmentDialog.vue @@ -108,6 +108,7 @@ :loading="loading" flat :label="$t('Close')" + :disable="loading" no-caps color="primary" v-close-popup diff --git a/src/components/ListJointActionEquipmentDialog.vue b/src/components/ListJointActionEquipmentDialog.vue index 5db9b5b..1e1796b 100644 --- a/src/components/ListJointActionEquipmentDialog.vue +++ b/src/components/ListJointActionEquipmentDialog.vue @@ -90,6 +90,7 @@ :loading="loading" flat :label="$t('Close')" + :disable="loading" no-caps color="primary" v-close-popup diff --git a/src/components/PlanDialog.vue b/src/components/PlanDialog.vue index 8f40ce9..9eb06e6 100644 --- a/src/components/PlanDialog.vue +++ b/src/components/PlanDialog.vue @@ -297,6 +297,7 @@ diff --git a/src/components/RegisterDialog.vue b/src/components/RegisterDialog.vue index f10ba6a..13cfbe2 100644 --- a/src/components/RegisterDialog.vue +++ b/src/components/RegisterDialog.vue @@ -388,6 +388,7 @@ import { useI18n } from "vue-i18n"; import GlobalData from "src/common/GlobalData"; import QrcodeVue from "qrcode.vue"; import { Protocol } from "src/entities/WSProtocol"; +import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; export default defineComponent({ name: "ComponentRegisterDialog", @@ -464,22 +465,18 @@ export default defineComponent({ show_dialog.value = false; } - function_center_control.value = - ($store.state.device_attribute & - Protocol.EDeviceAttribute.CenterControl) != - 0; - function_output_board.value = - ($store.state.device_attribute & - Protocol.EDeviceAttribute.OutputBoard) != - 0; - function_mirroring_output.value = - ($store.state.device_attribute & - Protocol.EDeviceAttribute.MirroringOutput) != - 0; - - function_custom_ISV.value = - ($store.state.device_attribute & Protocol.EDeviceAttribute.CustomISV) != - 0; + const function_custom_ISV = ref( + $store.state.custom_defines.is_custom_isv + ); + const function_center_control = ref( + $store.state.custom_defines.function_center_control + ); + const function_output_board = ref( + $store.state.custom_defines.function_output_board + ); + const function_mirroring_output = ref( + $store.state.custom_defines.function_mirroring_output + ); }; return { @@ -615,19 +612,19 @@ export default defineComponent({ } if (success) { - let attribute = Protocol.EDeviceAttribute.None; + let attribute = EDeviceAttribute.None; if (function_center_control.value) { - attribute |= Protocol.EDeviceAttribute.CenterControl; + attribute |= EDeviceAttribute.CenterControl; } if (function_output_board.value) { - attribute |= Protocol.EDeviceAttribute.OutputBoard; + attribute |= EDeviceAttribute.OutputBoard; } if (function_mirroring_output.value) { - attribute |= Protocol.EDeviceAttribute.MirroringOutput; + attribute |= EDeviceAttribute.MirroringOutput; } if (function_custom_ISV.value) { - attribute |= Protocol.EDeviceAttribute.CustomISV; + attribute |= EDeviceAttribute.CustomISV; } GlobalData.getInstance() diff --git a/src/components/SignalSourceDialog.vue b/src/components/SignalSourceDialog.vue index d45b0ba..814f46e 100644 --- a/src/components/SignalSourceDialog.vue +++ b/src/components/SignalSourceDialog.vue @@ -341,6 +341,7 @@ import TimerSignalSourceDialog from "src/components/TimerSignalSourceDialog.vue" import FileEntity from "src/entities/FileEntity"; import FileSuffixHelper from "src/common/FileSuffixHelper"; import { Protocol } from "src/entities/WSProtocol"; +import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; export default defineComponent({ name: "ComponentSignalSourceDialog", @@ -417,11 +418,7 @@ export default defineComponent({ for (const item of build_signal_source_options) { signal_source_options.value.push(item); } - if ( - ($store.state.device_attribute & - Protocol.EDeviceAttribute.CustomISV) == - 0 - ) { + if (($store.state.device_attribute & EDeviceAttribute.CustomISV) == 0) { signal_source_options.value.push({ label: $t.t("weather"), value: "EwindowType::Weather", diff --git a/src/components/SystemSettingDialog.vue b/src/components/SystemSettingDialog.vue index b39e83e..cb282f8 100644 --- a/src/components/SystemSettingDialog.vue +++ b/src/components/SystemSettingDialog.vue @@ -57,12 +57,16 @@ :disable="loading" /> - + {{ $t("mirroring output") }}: @@ -377,7 +387,9 @@ /> - + {{ $t("output type") }}: @@ -421,7 +433,7 @@ @@ -439,7 +451,7 @@ @@ -457,7 +469,7 @@ @@ -791,7 +803,8 @@ name="output_board" class="_panel" v-if=" - function_output_board_attribute || $store.state.advanced_debug + $store.state.custom_defines.function_output_board || + $store.state.advanced_debug " > @@ -809,8 +822,8 @@ :loading="loading" :disable="loading" type="number" - max="11" - min="0" + max="5" + min="1" :rules="[ (val) => (val != null && @@ -818,9 +831,9 @@ val.toString().length > 0) || $t('Please type something'), (val) => - (parseInt(val) >= 0 && parseInt(val) <= 11) || + (parseInt(val) >= 1 && parseInt(val) <= 5) || $t('number must between') + - '0 ~ 11' + + '1 ~ 5' + $t('CN_BERWEEN_SUFFIX'), ]" lazy-rules @@ -836,8 +849,8 @@ v-model="output_board_wall_col" :loading="loading" :disable="loading" - max="11" - min="0" + max="5" + min="1" type="number" :rules="[ (val) => @@ -846,9 +859,9 @@ val.toString().length > 0) || $t('Please type something'), (val) => - (parseInt(val) >= 0 && parseInt(val) <= 11) || + (parseInt(val) >= 1 && parseInt(val) <= 5) || $t('number must between') + - '0 ~ 11' + + '1 ~ 5' + $t('CN_BERWEEN_SUFFIX'), ]" lazy-rules @@ -1114,6 +1127,8 @@ import { EWeekDays } from "src/entities/EWeekDays"; import SystenSettingAdvancedNetworkDialog from "src/components/SystenSettingAdvancedNetworkDialog.vue"; import { AdvancedIpAddressEntity } from "src/entities/AdvancedIpAddressEntity"; +import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; + const _time_zones = [ "UTC-12(Central Pacific)", "UTC-11(Central Pacific)", @@ -1157,12 +1172,6 @@ export default defineComponent({ const timing_task_dialog: Ref = ref(null); const system_setting_advanced_network_dialog: Ref = ref(null); - const function_mirroring_output = ref( - ($store.state.device_attribute & - Protocol.EDeviceAttribute.MirroringOutput) != - 0 - ); - let tab = ref("network"); let auto_ip = ref($t.t("enable")); @@ -1181,30 +1190,6 @@ export default defineComponent({ const mirroring_output = ref(false); - const function_output_board_attribute = ref( - ($store.state.device_attribute & Protocol.EDeviceAttribute.OutputBoard) != - 0 - ); - if ($store.state.isSpecialVideo()) { - function_output_board_attribute.value = false; - } - - watch( - () => $store.state.device_attribute, - (value) => { - if ($store.state.isSpecialVideo()) { - function_output_board_attribute.value = false; - } else { - function_output_board_attribute.value = - (value & Protocol.EDeviceAttribute.OutputBoard) != 0; - } - function_mirroring_output.value = - ($store.state.device_attribute & - Protocol.EDeviceAttribute.MirroringOutput) != - 0; - } - ); - let device_resolution = ref(""); let device_resolution_options: Ref = ref([]); let device_rotate = ref(0); @@ -1486,7 +1471,7 @@ export default defineComponent({ request.target_resolution_timing = device_resolution_timing.value; request.rotate = parseInt(device_rotate.value.toString()); request.hdmi_output_count = mirroring_output.value ? 2 : 1; - if (!function_mirroring_output.value) { + if (!$store.state.custom_defines.function_mirroring_output) { request.hdmi_output_count = 1; } @@ -1731,8 +1716,6 @@ export default defineComponent({ timing_task_dialog, system_setting_advanced_network_dialog, timing_tasks, - function_mirroring_output, - function_output_board_attribute, loading, tab, auto_ip, diff --git a/src/components/TimingTaskDialog.vue b/src/components/TimingTaskDialog.vue index dcf4cfa..8c8f827 100644 --- a/src/components/TimingTaskDialog.vue +++ b/src/components/TimingTaskDialog.vue @@ -108,6 +108,7 @@ diff --git a/src/components/WindowRectEditDialog.vue b/src/components/WindowRectEditDialog.vue index 8b5b02e..3f6bcc9 100644 --- a/src/components/WindowRectEditDialog.vue +++ b/src/components/WindowRectEditDialog.vue @@ -205,6 +205,7 @@ flat :label="$t('Close')" no-caps + :disable="loading" color="primary" v-close-popup /> diff --git a/src/components/custom/ISVVideoWallDialog.vue b/src/components/custom/ISVVideoWallDialog.vue new file mode 100644 index 0000000..0727b6c --- /dev/null +++ b/src/components/custom/ISVVideoWallDialog.vue @@ -0,0 +1,438 @@ + + + + + diff --git a/src/entities/EDeviceAttribute.ts b/src/entities/EDeviceAttribute.ts new file mode 100644 index 0000000..f72de48 --- /dev/null +++ b/src/entities/EDeviceAttribute.ts @@ -0,0 +1,38 @@ +export enum EDeviceAttribute { + None_UnKNow = 0x0000, + + None = 0x00000001, + OutputBoard = 0x00000002, + CenterControl = 0x00000004, + MirroringOutput = 0x00000008, + CustomISV = 0x00000010, + Reserve5 = 0x00000020, + Reserve6 = 0x00000040, + Reserve7 = 0x00000080, + Reserve8 = 0x00000100, + Reserve9 = 0x00000200, + Reserve10 = 0x00000400, + Reserve11 = 0x00000800, + Reserve12 = 0x00001000, + Reserve13 = 0x00002000, + Reserve14 = 0x00004000, + Reserve15 = 0x00008000, + Reserve16 = 0x00010000, + Reserve17 = 0x00020000, + Reserve18 = 0x00040000, + Reserve19 = 0x00080000, + Reserve20 = 0x00100000, + Reserve21 = 0x00200000, + Reserve22 = 0x00400000, + Reserve23 = 0x00800000, + Reserve24 = 0x01000000, + Reserve25 = 0x02000000, + Reserve26 = 0x04000000, + Reserve27 = 0x08000000, + Reserve28 = 0x10000000, + Reserve29 = 0x20000000, + Reserve30 = 0x40000000, + Reserve31 = 0x80000000, + + All = 0xffffffff, +} diff --git a/src/entities/OutputBoardItemConfigEntity.ts b/src/entities/OutputBoardItemConfigEntity.ts new file mode 100644 index 0000000..1108e90 --- /dev/null +++ b/src/entities/OutputBoardItemConfigEntity.ts @@ -0,0 +1,5 @@ +export default class OutputBoardItemConfigEntity { + index = 0; + output_index = 0; + rotation = 0; +} diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index 6295c68..a7e897f 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -2660,45 +2660,6 @@ export namespace Protocol { full_screen: boolean; } - export enum EDeviceAttribute { - None_UnKNow = 0x0000, - - None = 0x00000001, - OutputBoard = 0x00000002, - CenterControl = 0x00000004, - MirroringOutput = 0x00000008, - CustomISV = 0x00000010, - Reserve5 = 0x00000020, - Reserve6 = 0x00000040, - Reserve7 = 0x00000080, - Reserve8 = 0x00000100, - Reserve9 = 0x00000200, - Reserve10 = 0x00000400, - Reserve11 = 0x00000800, - Reserve12 = 0x00001000, - Reserve13 = 0x00002000, - Reserve14 = 0x00004000, - Reserve15 = 0x00008000, - Reserve16 = 0x00010000, - Reserve17 = 0x00020000, - Reserve18 = 0x00040000, - Reserve19 = 0x00080000, - Reserve20 = 0x00100000, - Reserve21 = 0x00200000, - Reserve22 = 0x00400000, - Reserve23 = 0x00800000, - Reserve24 = 0x01000000, - Reserve25 = 0x02000000, - Reserve26 = 0x04000000, - Reserve27 = 0x08000000, - Reserve28 = 0x10000000, - Reserve29 = 0x20000000, - Reserve30 = 0x40000000, - Reserve31 = 0x80000000, - - All = 0xffffffff, - } - export class GetDeviceAttributeRequestEntity extends PacketEntity { constructor(rpc_id = 0) { super(); diff --git a/src/entities/WSProtocolCustom.ts b/src/entities/WSProtocolCustom.ts new file mode 100644 index 0000000..ea25cac --- /dev/null +++ b/src/entities/WSProtocolCustom.ts @@ -0,0 +1,85 @@ +import { Protocol } from "src/entities/WSProtocol"; +import OutputBoardItemConfigEntity from "./OutputBoardItemConfigEntity"; + +export namespace CustomProtocol { + export class Commands { + public static get PROTOCOL_PREFIX() { + return "_"; + } + + public static get kUnKnowCommand() { + return Commands.PROTOCOL_PREFIX + "UnKnowCommand"; + } + + public static get kISVGetVideoWallConfig() { + return Commands.PROTOCOL_PREFIX + "ISVGetVideoWallConfig"; + } + public static get kISVSetVideoWallConfig() { + return Commands.PROTOCOL_PREFIX + "ISVSetVideoWallConfig"; + } + + static _all_commands = new Set([ + Commands.kUnKnowCommand, + Commands.kISVGetVideoWallConfig, + Commands.kISVSetVideoWallConfig, + ]); + + public static get AllCommands() { + return this._all_commands; + } + } + + export class ISVGetVideoWallConfigRequestEntity extends Protocol.PacketEntity { + timestamp = Date.now(); + constructor(rpcid?: number) { + super(); + this.rpc_id = rpcid ?? 0; + this.command = Commands.kISVGetVideoWallConfig; + } + } + + export class ISVGetVideoWallConfigResponseEntity extends Protocol.PacketEntity { + outputs: OutputBoardItemConfigEntity[] = []; + wall_rows = 2; + wall_cols = 2; + device_rotation = 0; + + constructor() { + super(); + super.flag = Protocol.PacketEntity.FLAG_RESPONSE; + this.command = Commands.kISVGetVideoWallConfig; + } + } + + export class ISVSetVideoWallConfigRequestEntity extends Protocol.PacketEntity { + outputs: OutputBoardItemConfigEntity[] = []; + wall_rows = 2; + wall_cols = 2; + device_rotation = 0; + constructor( + outputs: OutputBoardItemConfigEntity[], + wall_rows: number, + wall_cols: number, + device_rotation: number, + rpcid?: number + ) { + super(); + this.rpc_id = rpcid ?? 0; + this.command = Commands.kISVSetVideoWallConfig; + this.outputs = Array.isArray(outputs) ? outputs : []; + this.wall_cols = wall_cols; + this.wall_rows = wall_rows; + this.device_rotation = device_rotation; + } + } + + export class ISVSetVideoWallConfigResponseEntity extends Protocol.PacketEntity { + success = false; + + constructor() { + super(); + super.flag = Protocol.PacketEntity.FLAG_RESPONSE; + this.command = Commands.kISVSetVideoWallConfig; + } + } +} diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index 5d3b970..378b699 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -383,4 +383,10 @@ export default { tcp: "TCP", udp: "UDP", "serial port": "Serial Port", + "screen mode": "Screen Mode", + "splice mode": "Splice Mode", + "landspace mode": "Landspace Mode", + "portrait mode": "Portrait Mode", + "can't be": "Can't Be", + "video wall": "Video Wall", }; diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index 00f8a5f..93ee48d 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -654,4 +654,10 @@ export default { tcp: "TCP", udp: "UDP", "serial port": "串口", + "screen mode": "屏幕方向", + "splice mode": "拼接模式", + "landspace mode": "横屏", + "portrait mode": "竖屏", + "can't be": "不能为", + "video wall": "拼接墙", }; diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index b631c44..08d2ccd 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -7,7 +7,8 @@ class="header text-black" @click="(evt) => evt.stopPropagation()" > - + + @@ -103,6 +104,7 @@ import { defineComponent, ref } from "vue"; import LeftToolBar from "src/pages/LeftToolBar.vue"; import RightToolBar from "src/pages/RightToolBar.vue"; import TopToolBar from "src/pages/TopToolBar.vue"; +import ISVTopToolbar from "src/pages/custom/ISVTopToolBar.vue"; import FooterPortrait from "src/pages/FooterPortrait.vue"; import EventBus, { EventNamesDefine } from "src/common/EventBus"; import { useStore } from "src/store"; @@ -111,7 +113,13 @@ import FileSuffixHelper from "src/common/FileSuffixHelper"; export default defineComponent({ name: "MainLayout", - components: { LeftToolBar, RightToolBar, TopToolBar, FooterPortrait }, + components: { + LeftToolBar, + RightToolBar, + TopToolBar, + ISVTopToolbar, + FooterPortrait, + }, setup() { const $store = useStore(); diff --git a/src/pad/MainLayout.vue b/src/pad/MainLayout.vue index 09fdabe..c5cf3c3 100644 --- a/src/pad/MainLayout.vue +++ b/src/pad/MainLayout.vue @@ -26,7 +26,8 @@ class="header" @touchstart="(evt) => evt.stopPropagation()" > - + + @@ -87,8 +88,9 @@ body { diff --git a/src/pages/TopToolBar.vue b/src/pages/TopToolBar.vue index d5f69d3..5dfca64 100644 --- a/src/pages/TopToolBar.vue +++ b/src/pages/TopToolBar.vue @@ -266,7 +266,7 @@ /> - + @@ -404,7 +399,6 @@ clickable v-close-popup @click="$refs.register_dialog.showDialog()" - v-if="$store.state.factory_mode || !is_custon_isv" > @@ -524,6 +518,7 @@ import { SessionStorage, Cookies, openURL, useQuasar } from "quasar"; import { useI18n } from "vue-i18n"; import { ConnectTableEntity } from "src/entities/ConnectTableEntity"; import ClientConnection from "src/common/ClientConnection"; +import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; export default defineComponent({ name: "PageTopToolBar", @@ -555,16 +550,6 @@ export default defineComponent({ const edge_blending_dialog: Ref = ref(null); const register_dialog: Ref = ref(null); - const function_center_control = ref( - ($store.state.device_attribute & - Protocol.EDeviceAttribute.CenterControl) != - 0 - ); - - const is_custon_isv = ref( - ($store.state.device_attribute & Protocol.EDeviceAttribute.CustomISV) != 0 - ); - const window_rect_edit_dialog: Ref = ref(null); const power_flag = ref(false); @@ -642,16 +627,6 @@ export default defineComponent({ } ); - watch( - () => $store.state.device_attribute, - (value) => { - function_center_control.value = - (value & Protocol.EDeviceAttribute.CenterControl) != 0; - is_custon_isv.value = - (value & Protocol.EDeviceAttribute.CustomISV) != 0; - } - ); - const show_device_list = ref(true); onMounted(() => { show_device_list.value = @@ -663,8 +638,6 @@ export default defineComponent({ plan_running, edge_blending_dialog, register_dialog, - function_center_control, - is_custon_isv, window_rect_edit_dialog, show_device_list, power_flag, diff --git a/src/pages/custom/ISVTopToolBar.vue b/src/pages/custom/ISVTopToolBar.vue new file mode 100644 index 0000000..2cd95fc --- /dev/null +++ b/src/pages/custom/ISVTopToolBar.vue @@ -0,0 +1,803 @@ + + + + + diff --git a/src/store/index.ts b/src/store/index.ts index 098f798..25d591b 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,8 +1,8 @@ -import { ConnectTableEntity } from "./../entities/ConnectTableEntity"; +import { ConnectTableEntity } from "src/entities/ConnectTableEntity"; import { PollingEntity, PollingTreeItemEntity, -} from "./../entities/PollingEntity"; +} from "src/entities/PollingEntity"; import { store } from "quasar/wrappers"; import { ModeEntity, ModeTreeItemEntity } from "src/entities/ModeEntity"; import { WindowOpenNotifyEntity } from "src/entities/MultimediaWindowEntity"; @@ -18,6 +18,8 @@ import { useStore as vuexUseStore, } from "vuex"; +import { EDeviceAttribute } from "src/entities/EDeviceAttribute"; + // import example from './module-example' // import { ExampleStateInterface } from './module-example/state'; @@ -30,6 +32,13 @@ import { * with the Store instance. */ +export class CustomDefines { + is_custom_isv = false; + function_output_board = false; + function_center_control = false; + function_mirroring_output = false; +} + export interface StateInterface { // Define your own store structure, using submodules if needed // example: ExampleStateInterface; @@ -68,6 +77,8 @@ export interface StateInterface { power_state: boolean; product_name: string; + custom_defines: CustomDefines; + isLedPlayer: () => boolean; isSpecialVideo: () => boolean; } @@ -329,6 +340,8 @@ export default store(function (/* { ssrContext } */) { power_state: false, product_name: EProductNames.LED_PLAYER, + custom_defines: new CustomDefines(), + isLedPlayer: () => { return ( Store.state.product_name == EProductNames.LED_PLAYER || @@ -365,6 +378,17 @@ export default store(function (/* { ssrContext } */) { const num = parseInt(playload); if (!isNaN(num) && num >= 0) { state.device_attribute = num; + + // parse custom attributes + + state.custom_defines.is_custom_isv = + (state.device_attribute & EDeviceAttribute.CustomISV) != 0; + state.custom_defines.function_output_board = + (state.device_attribute & EDeviceAttribute.OutputBoard) != 0; + state.custom_defines.function_center_control = + (state.device_attribute & EDeviceAttribute.CenterControl) != 0; + state.custom_defines.function_mirroring_output = + (state.device_attribute & EDeviceAttribute.MirroringOutput) != 0; } }, setAvancedDebug(state: StateInterface, playload?: any) {