diff --git a/package.json b/package.json index 64014a3..36e4c5d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "vue": "^3.0.0", "vue-i18n": "^9.1.9", "vue-router": "^4.0.0", - "vuex": "^4.0.1" + "vuex": "^4.0.1", + "zrender": "^5.3.1" }, "devDependencies": { "@quasar/app": "^3.3.3", diff --git a/public/new_icon/about.png b/public/new_icon/about.png new file mode 100644 index 0000000..c90f765 Binary files /dev/null and b/public/new_icon/about.png differ diff --git a/public/new_icon/background_image.png b/public/new_icon/background_image.png new file mode 100644 index 0000000..34c561d Binary files /dev/null and b/public/new_icon/background_image.png differ diff --git a/public/new_icon/clean_windows.png b/public/new_icon/clean_windows.png new file mode 100644 index 0000000..d4091fc Binary files /dev/null and b/public/new_icon/clean_windows.png differ diff --git a/public/new_icon/close_window.png b/public/new_icon/close_window.png new file mode 100644 index 0000000..70e7a68 Binary files /dev/null and b/public/new_icon/close_window.png differ diff --git a/public/new_icon/database_backup.png b/public/new_icon/database_backup.png new file mode 100644 index 0000000..40bc808 Binary files /dev/null and b/public/new_icon/database_backup.png differ diff --git a/public/new_icon/database_recovery.png b/public/new_icon/database_recovery.png new file mode 100644 index 0000000..c670c01 Binary files /dev/null and b/public/new_icon/database_recovery.png differ diff --git a/public/new_icon/device_info.png b/public/new_icon/device_info.png new file mode 100644 index 0000000..ab8b5de Binary files /dev/null and b/public/new_icon/device_info.png differ diff --git a/public/new_icon/fan.png b/public/new_icon/fan.png new file mode 100644 index 0000000..c371396 Binary files /dev/null and b/public/new_icon/fan.png differ diff --git a/public/new_icon/file_manager.png b/public/new_icon/file_manager.png new file mode 100644 index 0000000..14e4511 Binary files /dev/null and b/public/new_icon/file_manager.png differ diff --git a/public/new_icon/graphics_setting.png b/public/new_icon/graphics_setting.png new file mode 100644 index 0000000..03f1a74 Binary files /dev/null and b/public/new_icon/graphics_setting.png differ diff --git a/public/new_icon/grid_setting.png b/public/new_icon/grid_setting.png new file mode 100644 index 0000000..109f2a0 Binary files /dev/null and b/public/new_icon/grid_setting.png differ diff --git a/public/new_icon/lower_window.png b/public/new_icon/lower_window.png new file mode 100644 index 0000000..b870bc8 Binary files /dev/null and b/public/new_icon/lower_window.png differ diff --git a/public/new_icon/network_setting.png b/public/new_icon/network_setting.png new file mode 100644 index 0000000..c8549ff Binary files /dev/null and b/public/new_icon/network_setting.png differ diff --git a/public/new_icon/other_setting.png b/public/new_icon/other_setting.png new file mode 100644 index 0000000..7ab8f24 Binary files /dev/null and b/public/new_icon/other_setting.png differ diff --git a/public/new_icon/subtitle.png b/public/new_icon/subtitle.png new file mode 100644 index 0000000..ef6db5b Binary files /dev/null and b/public/new_icon/subtitle.png differ diff --git a/public/new_icon/system_setting.png b/public/new_icon/system_setting.png new file mode 100644 index 0000000..2b5ca8c Binary files /dev/null and b/public/new_icon/system_setting.png differ diff --git a/public/new_icon/top_window.png b/public/new_icon/top_window.png new file mode 100644 index 0000000..55fca79 Binary files /dev/null and b/public/new_icon/top_window.png differ diff --git a/public/new_icon/upgrade.png b/public/new_icon/upgrade.png new file mode 100644 index 0000000..1d66cd8 Binary files /dev/null and b/public/new_icon/upgrade.png differ diff --git a/public/source_icon/hdmi.png b/public/source_icon/hdmi.png index bf736b8..dfec943 100644 Binary files a/public/source_icon/hdmi.png and b/public/source_icon/hdmi.png differ diff --git a/public/source_icon/media.png b/public/source_icon/media.png index 38dd48b..b6b024e 100644 Binary files a/public/source_icon/media.png and b/public/source_icon/media.png differ diff --git a/public/source_icon/rtsp.png b/public/source_icon/rtsp.png index a9b933f..18938e7 100644 Binary files a/public/source_icon/rtsp.png and b/public/source_icon/rtsp.png differ diff --git a/public/source_icon/web.png b/public/source_icon/web.png index ab518d4..ac5e8ac 100644 Binary files a/public/source_icon/web.png and b/public/source_icon/web.png differ diff --git a/quasar.conf.js b/quasar.conf.js index 1f4db7f..54c6d0a 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -87,7 +87,7 @@ module.exports = configure(function (ctx) { // directives: [], // Quasar plugins - plugins: ["Notify", "Dialog", "Loading", "AppFullscreen"], + plugins: ["Notify", "Dialog", "Loading", "AppFullscreen", "Cookies"], }, // animations: 'all', // --- includes all animations diff --git a/src/boot/i18n.ts b/src/boot/i18n.ts index 3b75d02..c3ead5b 100644 --- a/src/boot/i18n.ts +++ b/src/boot/i18n.ts @@ -1,10 +1,22 @@ -import { boot } from 'quasar/wrappers'; -import { createI18n } from 'vue-i18n'; +import { boot } from "quasar/wrappers"; +import { createI18n } from "vue-i18n"; +import { Cookies } from "quasar"; -import messages from 'src/i18n'; +import messages from "src/i18n"; + +let language = Cookies.get("language"); +if (!language) { + language = "zh-CN"; +} + +if (language != "zh-CN" && language != "en-US") { + language = "zh-CN"; +} + +Cookies.set("language", language); const i18n = createI18n({ - locale: 'zh-CN', + locale: language, messages, }); diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index aae2169..7ab8cd0 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -7,6 +7,7 @@ import { StringKeyValueEntity } from "src/entities/StringKeyValueEntity"; import SubtitleEntity from "src/entities/SubtitleEntity"; import { Protocol } from "src/entities/WSProtocol"; import EventBus, { EventNamesDefine } from "./EventBus"; +import { EdgeBlendingPoint } from "src/entities/EdgeBlendingEntities"; class _RpcInfo { send_timestamp: number; @@ -809,6 +810,7 @@ export default class ClientConnection { new Protocol.GetSystemTimesRequestEntity(0) ); } + public restartDevice(delay_ms?: number) { this.ws?.send( JSON.stringify(new Protocol.RestartDeviceRequestEntity(delay_ms)) @@ -835,6 +837,41 @@ export default class ClientConnection { } } + public async getEdgeBlendingInfo() { + return await this.doRpc( + new Protocol.GetEdgeBlendingInfoRequestEntity(0) + ); + } + + public async setEdgeBlendingInfo( + enable_blending: boolean, + enable_correct: boolean, + width: number, + height: number, + col: number, + row: number, + point_count: number + ) { + return await this.doRpc( + new Protocol.SetEdgeBlendingInfoRequestEntity( + enable_blending, + enable_correct, + width, + height, + col, + row, + point_count, + 0 + ) + ); + } + + public setEdgeBlendingPoint(point: EdgeBlendingPoint) { + this.ws?.send( + JSON.stringify(new Protocol.SetEdgeBlendingPointRequestEntity(point)) + ); + } + public destory() { if (this.ws) { this.ws.onclose = null; diff --git a/src/components/EdgeBlendingControl.vue b/src/components/EdgeBlendingControl.vue new file mode 100644 index 0000000..30fb8ac --- /dev/null +++ b/src/components/EdgeBlendingControl.vue @@ -0,0 +1,234 @@ + + + + + diff --git a/src/components/EdgeBlendingDialog.vue b/src/components/EdgeBlendingDialog.vue new file mode 100644 index 0000000..b8f8b3d --- /dev/null +++ b/src/components/EdgeBlendingDialog.vue @@ -0,0 +1,353 @@ + + + + + diff --git a/src/components/RegisterDialog.vue b/src/components/RegisterDialog.vue index e42d5a7..467e97a 100644 --- a/src/components/RegisterDialog.vue +++ b/src/components/RegisterDialog.vue @@ -219,17 +219,6 @@ export default defineComponent({ } catch {} loading.value = false; }, - toggleFullScreen(e: any) { - console.log(e); - const target = e.target.parentNode.parentNode.parentNode; - console.log(target); - $q.fullscreen - .toggle(target) - .then(() => {}) - .catch((err) => { - console.error(err); - }); - }, }; }, }); diff --git a/src/components/SystemSettingDialog.vue b/src/components/SystemSettingDialog.vue index 355721b..c727ea2 100644 --- a/src/components/SystemSettingDialog.vue +++ b/src/components/SystemSettingDialog.vue @@ -49,13 +49,13 @@ > @@ -308,7 +308,9 @@

{{ - $t("FOCEOUTPUT(CUSTOM): uses the specified timing output") + $t( + "FOCEOUTPUT(CUSTOM): uses the specified timing output" + ) }}

diff --git a/src/entities/EdgeBlendingEntities.ts b/src/entities/EdgeBlendingEntities.ts new file mode 100644 index 0000000..6d1c1b7 --- /dev/null +++ b/src/entities/EdgeBlendingEntities.ts @@ -0,0 +1,17 @@ +export class EdgeBlendingInfo { + enable_blending: boolean = false; + enable_correct: boolean = false; + width: number = 0; + height: number = 0; + col: number = 0; + row: number = 0; + point_count: number = 0; +} + +export class EdgeBlendingPoint { + point_index: number = 0; + row: number = 0; + col: number = 0; + x: number = 0; + y: number = 0; +} diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index 75b86b8..b1bdd5d 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -5,6 +5,7 @@ import { ModeEntity } from "./ModeEntity"; import { PlanEntity } from "./PlanEntity"; import SubtitleEntity from "./SubtitleEntity"; import { PollingEntity, PollingGroupEntity } from "./PollingEntity"; +import { EdgeBlendingPoint } from "./EdgeBlendingEntities"; export namespace Protocol { export class Commands { @@ -337,6 +338,19 @@ export namespace Protocol { return Commands.PROTOCOL_PREFIX + "RpcGetUsbDevices"; } + public static get kRpcGetEdgeBlendingInfo() { + return Commands.PROTOCOL_PREFIX + "RpcGetEdgeBlendingInfo"; + } + public static get kRpcSetEdgeBlendingInfo() { + return Commands.PROTOCOL_PREFIX + "RpcSetEdgeBlendingInfo"; + } + public static get kSetEdgeBlendingPoint() { + return Commands.PROTOCOL_PREFIX + "SetEdgeBlendingPoint"; + } + public static get kRpcSetDevicePowerMode() { + return Commands.PROTOCOL_PREFIX + "RpcSetDevicePowerMode"; + } + static _all_commands = new Set([ Commands.kUnKnowCommand, Commands.kSearchDevice, @@ -419,6 +433,10 @@ export namespace Protocol { Commands.kDesktopDisconnectNotify, Commands.kRpcGetSystemTimes, Commands.kRpcGetUsbDevices, + Commands.kRpcGetEdgeBlendingInfo, + Commands.kRpcSetEdgeBlendingInfo, + Commands.kSetEdgeBlendingPoint, + Commands.kRpcSetDevicePowerMode, ]); public static get AllCommands() { @@ -1998,4 +2016,82 @@ export namespace Protocol { export class PollingGroupEditNotifyEntity extends Protocol.PacketEntity { polling_group: PollingGroupEntity = new PollingGroupEntity(); } + + export class GetEdgeBlendingInfoRequestEntity extends PacketEntity { + timestamp = new Date().getMilliseconds(); + + constructor(rpcid?: number) { + super(); + this.rpc_id = rpcid ?? 0; + this.command = Commands.kRpcGetEdgeBlendingInfo; + } + } + + export class GetEdgeBlendingInfoResponseEntity extends PacketEntity { + enable_blending = false; + enable_correct = false; + width = 0; + height = 0; + col = 0; + row = 0; + point_count = 0; + + points: EdgeBlendingPoint[] = []; + constructor() { + super(); + this.command = Commands.kRpcGetEdgeBlendingInfo; + } + } + + export class SetEdgeBlendingInfoRequestEntity extends PacketEntity { + enable_blending = false; + enable_correct = false; + width = 0; + height = 0; + col = 0; + row = 0; + point_count = 0; + + constructor( + enable_blending: boolean, + enable_correct: boolean, + width: number, + height: number, + col: number, + row: number, + point_count: number, + rpcid?: number + ) { + super(); + this.rpc_id = rpcid ?? 0; + this.command = Commands.kRpcSetEdgeBlendingInfo; + this.enable_blending = enable_blending; + this.enable_correct = enable_correct; + this.width = width; + this.height = height; + this.col = col; + this.row = row; + this.point_count = point_count; + } + } + + export class SetEdgeBlendingInfoResponseEntity extends PacketEntity { + success = false; + + constructor() { + super(); + this.command = Commands.kRpcSetEdgeBlendingInfo; + } + } + + export class SetEdgeBlendingPointRequestEntity extends PacketEntity { + point: EdgeBlendingPoint; + + constructor(point: EdgeBlendingPoint, rpcid?: number) { + super(); + this.rpc_id = rpcid ?? 0; + this.command = Commands.kSetEdgeBlendingPoint; + this.point = point; + } + } } diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index 0d71ede..d0a7149 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -376,4 +376,22 @@ export default { copy: "拷贝", "register dialog": "注册对话框", "active code": "激活码", + "9 point surface correct": "9点曲面矫正", + "4 point plane correct": "4点平面矫正", + "edge blending": "边缘融合", + "blending setting": "融合设置", + "point correct": "点矫正", + "enable blending": "启用融合", + "enable correct": "启用矫正", + row: "行", + col: "列", + "correct type": "矫正类型", + Error: "错误", + "get edge blending data failed": "获取边缘融合数据失败", + "set edge blending data": "设置边缘融合数据", + "signal polling": "信号轮询", + "win top": "置顶", + "win lower": "置底", + "clean screen": "清屏", + "CN/EN switch": "中英文切换", }; diff --git a/src/pages/Index.vue b/src/pages/Index.vue index f02bafd..0346f3c 100644 --- a/src/pages/Index.vue +++ b/src/pages/Index.vue @@ -65,43 +65,46 @@ export default defineComponent({ ); const checkRegistered = () => { - let register: any = - GlobalData.getInstance().applicationConfig?.registered; - try { - register = JSON.parse(register); - } catch { - register = false; - } - if ( - !register && - (!register_dialog.value || !register_dialog.value.isShow()) - ) { - $q.notify({ - color: "negative", - icon: "report_problem", - message: - "" + - $t.t("not registered") + - "!!!" + - "", - position: "center", - actions: [ - { - label: $t.t("register"), - color: "blue", - handler: () => { - if (register_dialog.value) { - register_dialog.value.showDialog(); - } + if (GlobalData.getInstance().getCurrentClient()?.is_connected) { + let register: any = + GlobalData.getInstance().applicationConfig?.registered; + try { + register = JSON.parse(register); + } catch { + register = false; + } + if ( + !register && + (!register_dialog.value || !register_dialog.value.isShow()) + ) { + $q.notify({ + color: "negative", + icon: "report_problem", + message: + "" + + $t.t("not registered") + + "!!!" + + "", + position: "center", + actions: [ + { + label: $t.t("register"), + color: "blue", + handler: () => { + if (register_dialog.value) { + register_dialog.value.showDialog(); + } + }, }, - }, - ], - html: true, - timeout: 2500, - }); + ], + html: true, + timeout: 2500, + }); + } } }; setInterval(checkRegistered, 5000); + checkRegistered(); return { register_dialog, diff --git a/src/pages/LeftToolBar.vue b/src/pages/LeftToolBar.vue index bbe347d..3aabf95 100644 --- a/src/pages/LeftToolBar.vue +++ b/src/pages/LeftToolBar.vue @@ -11,7 +11,7 @@ style="color: red" > - + diff --git a/src/pages/TopToolBar.vue b/src/pages/TopToolBar.vue index 4fa4a68..5df1792 100644 --- a/src/pages/TopToolBar.vue +++ b/src/pages/TopToolBar.vue @@ -50,7 +50,7 @@ stretch flat stack - icon="settings" + :icon="/*settings*/ 'img:new_icon/system_setting.png'" :label="$t('system setting')" class="q-mr-sm" @click="$refs.system_setting_dialog.showDialog()" @@ -60,7 +60,7 @@ stretch flat stack - icon="description" + :icon="/*description*/ 'img:new_icon/file_manager.png'" :label="$t('file manage')" class="q-mr-sm" @click="$refs.file_manage_dialog.showDialog()" @@ -69,7 +69,7 @@ stretch flat stack - icon="grid_on" + :icon="/*grid_on*/ 'img:new_icon/grid_setting.png'" :label="$t('grid setting')" class="q-mr-sm" @click="$refs.grid_setting_dialog.showDialog()" @@ -79,7 +79,7 @@ stretch flat stack - icon="art_track" + :icon="/*art_track*/ 'img:new_icon/subtitle.png'" :label="$t('subtitle')" class="q-mr-sm" @click="$refs.subtitle_dialog.showDialog()" @@ -90,8 +90,8 @@ flat stack :disable="plan_running" - icon="vertical_align_top" - :label="$t('top window')" + :icon="/*vertical_align_top*/ 'img:new_icon/top_window.png'" + :label="$t('win top')" class="q-mr-sm" @click="topWindow" /> @@ -101,8 +101,8 @@ flat stack :disable="plan_running" - icon="vertical_align_bottom" - :label="$t('lower window')" + :icon="/*vertical_align_bottom*/ 'img:new_icon/lower_window.png'" + :label="$t('win lower')" class="q-mr-sm" @click="lowerWindow" /> @@ -112,8 +112,8 @@ flat stack :disable="plan_running" - icon="close" - :label="$t('close this window')" + :icon="/*close*/ 'img:new_icon/close_window.png'" + :label="$t('close')" class="q-mr-sm" @click="closeCurrentWindow" /> @@ -123,12 +123,23 @@ flat stack :disable="plan_running" - icon="clear_all" - :label="$t('close all windwos')" + :icon="/*clear_all*/ 'img:new_icon/clean_windows.png'" + :label="$t('clean screen')" class="q-mr-sm" @click="closeAllWindows" /> + + @@ -155,7 +166,8 @@ @click="$refs.background_image_dialog.showDialog()" > - + + {{ $t("background image") }} @@ -167,7 +179,8 @@ @click="$refs.recovery_database_dialog.showDialog()" > - + + {{ $t("database import") }} @@ -175,7 +188,8 @@ - + + {{ $t("database export") }} @@ -187,7 +201,8 @@ @click="$refs.upgrade_dialog.showDialog()" > - + + {{ $t("upgrade") }} @@ -195,19 +210,31 @@ - + + {{ $t("device info") }} + + + + + + + + {{ $t("CN/EN switch") }} + + - + + {{ $t("about") }} @@ -220,7 +247,8 @@ - + + {{ $store.state.fan_temp.toFixed(1) }} ℃ @@ -236,6 +264,7 @@ +