Merge branch 'magic_wall'

# Conflicts:
#	src/common/ClientConnection.ts
#	src/components/RegisterDialog.vue
#	src/components/SystemSettingDialog.vue
#	src/entities/MagicWallConfig.ts
#	src/entities/RectF.ts
#	src/entities/WSProtocol.ts
#	src/i18n/en-US/index.ts
#	src/i18n/zh-CN/index.ts
#	src/pages/TopToolBar.vue
#	src/store/index.ts
This commit is contained in:
miao 2023-02-01 13:41:33 +08:00
commit e940f24b52
12 changed files with 3740 additions and 1340 deletions

View File

@ -69,15 +69,7 @@
:disable="loading" :disable="loading"
/> />
</q-item-section> </q-item-section>
<q-item-section avatar>
<q-btn
@click="setDeviceAttribute"
:label="$t('commit')"
no-caps
outline
color="primary"
/>
</q-item-section>
</q-item> </q-item>
<q-item> <q-item>
<q-item-section avatar></q-item-section> <q-item-section avatar></q-item-section>
@ -85,12 +77,33 @@
<q-checkbox <q-checkbox
v-model="function_custom_ISV" v-model="function_custom_ISV"
:label="$t('Custom ISV')" :label="$t('Custom ISV')"
class="offset-md-1 col"
color="cyan" color="cyan"
class="col"
:loading="loading" :loading="loading"
:disable="loading" :disable="loading"
/> />
</q-item-section> </q-item-section>
<q-item-section>
<q-checkbox
v-model="function_magic_wall"
:label="$t('magic wall')"
color="cyan"
class="offset-md-1 col"
:loading="loading"
:disable="loading"
/>
</q-item-section>
<q-item-section avatar>
<q-btn
@click="setDeviceAttribute"
:label="$t('commit')"
no-caps
outline
color="primary"
/>
</q-item-section>
</q-item> </q-item>
<q-item> <q-item>
<q-item-section avatar> <q-item-section avatar>
@ -198,6 +211,9 @@ export default defineComponent({
const function_mirroring_output = ref( const function_mirroring_output = ref(
$store.state.custom_defines.function_mirroring_output $store.state.custom_defines.function_mirroring_output
); );
const function_magic_wall = ref(
$store.state.custom_defines.function_magic_wall
);
const target_language = ref("zh-CN"); const target_language = ref("zh-CN");
return { return {
@ -206,6 +222,7 @@ export default defineComponent({
function_center_control, function_center_control,
function_output_board, function_output_board,
function_custom_ISV, function_custom_ISV,
function_magic_wall,
function_mirroring_output, function_mirroring_output,
target_language, target_language,
@ -219,6 +236,8 @@ export default defineComponent({
$store.state.custom_defines.function_output_board; $store.state.custom_defines.function_output_board;
function_mirroring_output.value = function_mirroring_output.value =
$store.state.custom_defines.function_mirroring_output; $store.state.custom_defines.function_mirroring_output;
function_magic_wall.value =
$store.state.custom_defines.function_magic_wall;
}, },
resetData() { resetData() {
loading.value = false; loading.value = false;
@ -227,6 +246,7 @@ export default defineComponent({
function_output_board.value = false; function_output_board.value = false;
function_mirroring_output.value = false; function_mirroring_output.value = false;
function_custom_ISV.value = false; function_custom_ISV.value = false;
function_magic_wall.value=false;
}, },
restartDevice() { restartDevice() {
@ -319,6 +339,9 @@ export default defineComponent({
if (function_custom_ISV.value) { if (function_custom_ISV.value) {
attribute |= EDeviceAttribute.CustomISV; attribute |= EDeviceAttribute.CustomISV;
} }
if (function_magic_wall.value) {
attribute |= EDeviceAttribute.ProductMagicWall;
}
GlobalData.getInstance() GlobalData.getInstance()
.getCurrentClient() .getCurrentClient()

File diff suppressed because it is too large Load Diff

View File

@ -303,6 +303,15 @@
:loading="loading" :loading="loading"
:disable="loading" :disable="loading"
/> />
<q-checkbox
v-model="function_magic_wall"
:label="$t('magic wall')"
color="cyan"
class="offset-md-1 col"
:loading="loading"
:disable="loading"
/>
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
@ -419,6 +428,7 @@ export default defineComponent({
const function_output_board = ref(false); const function_output_board = ref(false);
const function_mirroring_output = ref(false); const function_mirroring_output = ref(false);
const function_custom_ISV = ref(false); const function_custom_ISV = ref(false);
const function_magic_wall = ref(false);
const trial_days = ref(0); const trial_days = ref(0);
const last_days = ref(0); const last_days = ref(0);
@ -441,6 +451,7 @@ export default defineComponent({
function_output_board.value = false; function_output_board.value = false;
function_mirroring_output.value = false; function_mirroring_output.value = false;
function_custom_ISV.value = false; function_custom_ISV.value = false;
function_magic_wall.value=false;
}; };
const showDialog = async () => { const showDialog = async () => {
@ -472,6 +483,9 @@ export default defineComponent({
$store.state.custom_defines.function_output_board; $store.state.custom_defines.function_output_board;
function_mirroring_output.value = function_mirroring_output.value =
$store.state.custom_defines.function_mirroring_output; $store.state.custom_defines.function_mirroring_output;
const function_magic_wall = ref(
$store.state.custom_defines.function_magic_wall
);
}; };
return { return {
@ -493,6 +507,7 @@ export default defineComponent({
server_address, server_address,
function_output_board, function_output_board,
function_custom_ISV, function_custom_ISV,
function_magic_wall,
function_center_control, function_center_control,
function_mirroring_output, function_mirroring_output,
target_language, target_language,
@ -621,6 +636,9 @@ export default defineComponent({
if (function_custom_ISV.value) { if (function_custom_ISV.value) {
attribute |= EDeviceAttribute.CustomISV; attribute |= EDeviceAttribute.CustomISV;
} }
if (function_magic_wall.value) {
attribute |= EDeviceAttribute.ProductMagicWall;
}
GlobalData.getInstance() GlobalData.getInstance()
.getCurrentClient() .getCurrentClient()

View File

@ -1272,6 +1272,7 @@
<div <div
v-if=" v-if="
click_count >= target_click_count ||
click_count >= target_click_count || click_count >= target_click_count ||
$store.state.advanced_debug $store.state.advanced_debug
" "
@ -1721,7 +1722,6 @@ export default defineComponent({
current_time.value = date.formatDate(timeStamp, "HH:mm:ss"); current_time.value = date.formatDate(timeStamp, "HH:mm:ss");
} }
}; };
const refresh_output_board = async () => { const refresh_output_board = async () => {
const settings = await GlobalData.getInstance() const settings = await GlobalData.getInstance()
.getCurrentClient() .getCurrentClient()
@ -1738,6 +1738,7 @@ export default defineComponent({
output_board_volume.value = settings.volume; output_board_volume.value = settings.volume;
output_board_mute.value = settings.mute ? $t.t("on") : $t.t("off"); output_board_mute.value = settings.mute ? $t.t("on") : $t.t("off");
{ {
output_board_resolution_options.value = []; output_board_resolution_options.value = [];
for (const item of Object.keys( for (const item of Object.keys(
@ -2021,6 +2022,9 @@ export default defineComponent({
const applyOutputBoard = async () => { const applyOutputBoard = async () => {
loading.value = true; loading.value = true;
const request = new Protocol.SetOutputBoardSettingRequestEntity(); const request = new Protocol.SetOutputBoardSettingRequestEntity();
const response = await GlobalData.getInstance()
.getCurrentClient()
?.getMagicWallConfig();
request.wall_col = parseInt(output_board_wall_col.value.toString()); request.wall_col = parseInt(output_board_wall_col.value.toString());
request.wall_row = parseInt(output_board_wall_row.value.toString()); request.wall_row = parseInt(output_board_wall_row.value.toString());
request.splicing = output_board_splicing.value == $t.t("on"); request.splicing = output_board_splicing.value == $t.t("on");
@ -2034,13 +2038,20 @@ export default defineComponent({
request.volume = parseInt(output_board_volume.value.toString()); request.volume = parseInt(output_board_volume.value.toString());
request.mute = output_board_mute.value == $t.t("on"); request.mute = output_board_mute.value == $t.t("on");
request.output_board_resolution = output_board_resolution.value; request.output_board_resolution = output_board_resolution.value;
let success = false; let success = false;
try { try {
await GlobalData.getInstance() await GlobalData.getInstance()
.getCurrentClient() .getCurrentClient()
?.setOutputBoardSetting(request); ?.setOutputBoardSetting(request);
success = true; success = true;
if ($store.state.custom_defines.function_magic_wall && response&&success) {
const output_length =
parseInt(output_board_wall_col.value.toString()) *
parseInt(output_board_wall_row.value.toString());
if (output_length != response.config.col * response.config.row) {
$store.commit("setShowMonitorList", []);
}
}
} catch {} } catch {}
$q.notify({ $q.notify({
color: success ? "positive" : "negative", color: success ? "positive" : "negative",
@ -2113,7 +2124,6 @@ export default defineComponent({
const applyUser = async () => { const applyUser = async () => {
loading.value = true; loading.value = true;
console.log("zzz");
const request = new Protocol.SetOutputBoardSettingRequestEntity(); const request = new Protocol.SetOutputBoardSettingRequestEntity();
request.wall_col = parseInt(output_board_wall_col.value.toString()); request.wall_col = parseInt(output_board_wall_col.value.toString());
request.wall_row = parseInt(output_board_wall_row.value.toString()); request.wall_row = parseInt(output_board_wall_row.value.toString());

View File

@ -22,7 +22,7 @@ export enum EDeviceAttribute {
Reserve18 = 0x00040000, Reserve18 = 0x00040000,
Reserve19 = 0x00080000, Reserve19 = 0x00080000,
Reserve20 = 0x00100000, Reserve20 = 0x00100000,
Reserve21 = 0x00200000, ProductMagicWall = 0x00200000,
Reserve22 = 0x00400000, Reserve22 = 0x00400000,
Reserve23 = 0x00800000, Reserve23 = 0x00800000,
Reserve24 = 0x01000000, Reserve24 = 0x01000000,

View File

@ -1,8 +1,8 @@
import RotatedRectF from "./RectF"; import RotatedRectF, { RotatedRectFWithIndex } from "./RectF";
export default class MagicWallConfig { export default class MagicWallConfig {
magic_wall_enable = false; magic_wall_enable = false;
row = 0; row = 0;
col = 0; col = 0;
windows: RotatedRectF[] = []; windows: RotatedRectFWithIndex[] = [];
} }

View File

@ -32,3 +32,11 @@ export class RotatedRectF extends RectF {
this.angle = angle; this.angle = angle;
} }
} }
export class RotatedRectFWithIndex extends RotatedRectF{
index:number=0;
percenter:number=0;
initial_h:number=0;
initial_w:number=0;
background_h:number=0;
background_w:number=0;
}

View File

@ -57,6 +57,7 @@ export default {
Accept: "Accept", Accept: "Accept",
"move speed": "Move Speed", "move speed": "Move Speed",
"y offset": "Y Offset", "y offset": "Y Offset",
"the number must be greater than 0":"the number must be greater than 0",
"pos x": "X Position", "pos x": "X Position",
"pos y": "Y Position", "pos y": "Y Position",
width: "Width", width: "Width",
@ -432,4 +433,14 @@ export default {
"verify key length is 6": "Verify Key Length Is 6", "verify key length is 6": "Verify Key Length Is 6",
server: "Server", server: "Server",
"set cloud server setting": "Set Cloud Server Setting", "set cloud server setting": "Set Cloud Server Setting",
"set magic wall":"Set Magic wall",
"update magic wall":"Update Magic Wall",
"magic wall":"Magic Wall",
"angle":"Angle",
"topology diagram":"Topology Diagram",
"physical central location":"Central Location",
"monitors list":"Monitors List",
"resize":"Resize",
"export magic":"Export"
}; };

View File

@ -499,7 +499,7 @@ export default {
Warning: "警告", Warning: "警告",
function: "功能", function: "功能",
commit: "提交", commit: "提交",
"set device function": "设置设备功能成功", "set device function": "设置设备功能",
operator_play_signal_source: "信号源", operator_play_signal_source: "信号源",
"toolbar edit window rect": "窗口大小", "toolbar edit window rect": "窗口大小",
exit: "退出", exit: "退出",
@ -700,4 +700,13 @@ export default {
"verify key length is 6": "校验码长度必须为6", "verify key length is 6": "校验码长度必须为6",
server: "服务", server: "服务",
"set cloud server setting": "设置云服务器", "set cloud server setting": "设置云服务器",
"set magic wall":"设置魔墙",
"update magic wall":"更新魔墙",
"magic wall":"魔墙",
"angle":"角度",
"topology diagram":"拓扑图",
"physical central location":"物理中心位置",
"monitors list":"显示器",
"resize":"缩放",
"export magic":"导出"
}; };

View File

@ -305,7 +305,7 @@
<q-item <q-item
clickable clickable
:disable="!$store.state.power_state" :disable="!$store.state.power_state"
v-if="$store.state.isLedPlayer()" v-if="$store.state.isLedPlayer()&&!$store.state.custom_defines.function_magic_wall"
v-close-popup v-close-popup
@click=" @click="
($store.state.isSpecialVideo() ($store.state.isSpecialVideo()
@ -322,6 +322,24 @@
{{ $t("grid setting") }} {{ $t("grid setting") }}
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item
clickable
:disable="!$store.state.power_state"
v-close-popup
@click="$refs.control_panel_dialog.showDialog()"
v-if="$store.state.custom_defines.function_magic_wall"
>
<q-item-section avatar>
<!-- <q-icon name="image" /> -->
<q-icon name="img:new_icon/file_manager.png" />
</q-item-section>
<q-item-section>
{{ $t("magic wall") }}
</q-item-section>
</q-item>
<q-item <q-item
clickable clickable
@ -478,6 +496,7 @@
v-if="$store.state.isSpecialVideo()" v-if="$store.state.isSpecialVideo()"
ref="special_video_grid_setting_dialog" ref="special_video_grid_setting_dialog"
/> />
<control-panel-dialog ref="control_panel_dialog" />
<background-image-dialog ref="background_image_dialog" /> <background-image-dialog ref="background_image_dialog" />
<subtitle-dialog ref="subtitle_dialog" /> <subtitle-dialog ref="subtitle_dialog" />
<recovery-database-dialog ref="recovery_database_dialog" /> <recovery-database-dialog ref="recovery_database_dialog" />
@ -519,6 +538,9 @@ import { useStore } from "src/store";
import FusionSettingsDialog from "src/components/FusionSettingsDialog.vue"; import FusionSettingsDialog from "src/components/FusionSettingsDialog.vue";
import GridSettingDialog from "src/components/GridSettingDialog.vue"; import GridSettingDialog from "src/components/GridSettingDialog.vue";
import SpecialVideoGridSettingDialog from "src/components/SpecialVideoGridSettingDialog.vue"; import SpecialVideoGridSettingDialog from "src/components/SpecialVideoGridSettingDialog.vue";
import ControlPanelDialog from "src/components/ControlPanelDialog.vue";
import BackgroundImageDialog from "src/components/BackgroundImageDialog.vue"; import BackgroundImageDialog from "src/components/BackgroundImageDialog.vue";
import RecoveryDatabaseDialog from "src/components/RecoveryDatabaseDialog.vue"; import RecoveryDatabaseDialog from "src/components/RecoveryDatabaseDialog.vue";
import UpgradeDialog from "src/components/UpgradeDialog.vue"; import UpgradeDialog from "src/components/UpgradeDialog.vue";
@ -550,6 +572,9 @@ export default defineComponent({
components: { components: {
GridSettingDialog, GridSettingDialog,
SpecialVideoGridSettingDialog, SpecialVideoGridSettingDialog,
ControlPanelDialog,
BackgroundImageDialog, BackgroundImageDialog,
RecoveryDatabaseDialog, RecoveryDatabaseDialog,
UpgradeDialog, UpgradeDialog,

View File

@ -28,7 +28,9 @@
item.y * ($refs.wall?.offsetHeight ?? 0) item.y * ($refs.wall?.offsetHeight ?? 0)
" "
:zIndex=" :zIndex="
$store.state.windows_sort.findIndex((element) => element == item.uuid) $store.state.windows_sort.findIndex(
(element) => element == item.uuid
) + 1
" "
:isActive="item.uuid == $store.state.selected_window" :isActive="item.uuid == $store.state.selected_window"
:resizeIconSize="14" :resizeIconSize="14"
@ -67,11 +69,76 @@
</window> </window>
</vue3-resize-drag> </vue3-resize-drag>
</div> </div>
<div
id="magic_wall_grids"
ref="magic_wall_grids"
@click="onWallGridsClick"
v-if="
$store.state.power_state &&
$store.state.custom_defines.function_magic_wall
"
>
<div class="row magic_wall_grids" style="height: 31.05vw; width: 55.2vw">
<vue3-resize-drag
v-for="(item, index) of $store.state.show_monitor_list"
:w="item.w * $refs.wall?.clientWidth"
:h="item.h * $refs.wall?.clientHeight"
:x="item.currentx * $refs.wall?.clientWidth"
:y="item.currenty * $refs.wall?.clientHeight"
:rotate="parseInt(item.angle.toString())"
:is-resizable="false"
:isGuide="false"
class="magic_wall"
@dragenter="magic_select(index, item, $event)"
style="text-align: center"
>
{{ item.id + 1 }}
</vue3-resize-drag>
<q-popup-proxy
context-menu
@show="
{
last_context_menu_pos_x = $event.layerX;
last_context_menu_pos_y = $event.layerY;
}
"
>
<q-list>
<q-item
:disable="plan_running || !$store.state.power_state"
clickable
v-close-popup
@click="openWindowByLocalFile($event)"
>
<q-item-section avatar>
<q-icon name="open_in_browser" />
</q-item-section>
<q-item-section> {{ $t("open window") }} </q-item-section>
</q-item>
<q-item
:disable="plan_running || !$store.state.power_state"
clickable
v-close-popup
@click="closeAllWindows"
>
<q-item-section avatar>
<q-icon name="close" color="red" />
</q-item-section>
<q-item-section> {{ $t("close all windows") }} </q-item-section>
</q-item>
</q-list>
</q-popup-proxy>
</div>
</div>
<div <div
id="wall_grids" id="wall_grids"
ref="wall_grids" ref="wall_grids"
@click="onWallGridsClick" @click="onWallGridsClick"
v-if="$store.state.power_state" v-if="
$store.state.power_state &&
!$store.state.custom_defines.function_magic_wall
"
> >
<div <div
v-for="row of wall_rows" v-for="row of wall_rows"
@ -176,6 +243,16 @@
background: #aacceec2; background: #aacceec2;
border: 1px solid #0069bee7; border: 1px solid #0069bee7;
} }
.magic_wall {
border: 1px solid black;
background-color: rgb(173, 228, 251);
position: absolute;
}
.magic_wall_select {
border: 1px dashed black;
}
.magic_wall_grids {
}
</style> </style>
<script lang="ts"> <script lang="ts">
@ -191,7 +268,7 @@ import { NullSignalSource, useStore } from "src/store";
import EventBus, { EventNamesDefine } from "src/common/EventBus"; import EventBus, { EventNamesDefine } from "src/common/EventBus";
import { WindowOpenNotifyEntity } from "src/entities/MultimediaWindowEntity"; import { WindowOpenNotifyEntity } from "src/entities/MultimediaWindowEntity";
import WindowOtherStateChangeNotifyEntity from "src/entities/WindowOtherStateChangeNotifyEntity"; import WindowOtherStateChangeNotifyEntity from "src/entities/WindowOtherStateChangeNotifyEntity";
import { useQuasar } from "quasar"; import { extend, useQuasar } from "quasar";
import { NotifyMessage } from "src/common/ClientConnection"; import { NotifyMessage } from "src/common/ClientConnection";
import EditVolumeDialog from "src/components/EditVolumeDialog.vue"; import EditVolumeDialog from "src/components/EditVolumeDialog.vue";
@ -204,7 +281,6 @@ import FileEntity from "src/entities/FileEntity";
import { SignalSourceEntity } from "src/entities/SignalSourceEntity"; import { SignalSourceEntity } from "src/entities/SignalSourceEntity";
import FileSuffixHelper from "src/common/FileSuffixHelper"; import FileSuffixHelper from "src/common/FileSuffixHelper";
import { SpecialVideoHelper } from "src/common/SpecialVideoHelper"; import { SpecialVideoHelper } from "src/common/SpecialVideoHelper";
class Rect { class Rect {
start_x = 0; start_x = 0;
start_y = 0; start_y = 0;
@ -218,10 +294,29 @@ class Rect {
this.end_y = 0; this.end_y = 0;
} }
} }
class test_monitor {
w = 0.0;
h = 0.0;
currentx = 0.0;
currenty = 0.0;
centerx = 0.0;
centery = 0.0;
angle = 0;
id = 0;
constructor(id: number, w: number, h: number) {
this.currentx = 0.0;
this.currenty = 0.0;
this.angle = 0;
this.centerx = 0;
this.centery = 0;
this.id = id;
this.w = w;
this.h = h;
}
}
export default defineComponent({ export default defineComponent({
name: "PageWall", name: "PageWall",
components: { components: {
vue3ResizeDrag, vue3ResizeDrag,
Window, Window,
@ -241,13 +336,17 @@ export default defineComponent({
const window_rect_edit_dialog: Ref<any> = ref(null); const window_rect_edit_dialog: Ref<any> = ref(null);
const show_windows_flag = ref(true); // window const show_windows_flag = ref(true); // window
const refresh_windows_pos = () => { const refresh_windows_pos = async () => {
// , // ,
show_windows_flag.value = false; show_windows_flag.value = false;
setTimeout(() => { setTimeout(() => {
nextTick(() => { nextTick(() => {
show_windows_flag.value = true; show_windows_flag.value = true;
}); });
if (wall.value) {
let teph = wall.value?.clientHeight / offsetHeight;
let tepw = wall.value?.clientWidth / offsetWidth;
}
}, 100); }, 100);
}; };
@ -258,7 +357,8 @@ export default defineComponent({
const last_context_menu_pos_x = ref(0); const last_context_menu_pos_x = ref(0);
const last_context_menu_pos_y = ref(0); const last_context_menu_pos_y = ref(0);
let offsetHeight = 0;
let offsetWidth = 0;
const plan_running = computed( const plan_running = computed(
() => $store.state.current_running_plan.trim() != "" () => $store.state.current_running_plan.trim() != ""
); );
@ -282,10 +382,174 @@ export default defineComponent({
const area_open_window_flag = ref(false); const area_open_window_flag = ref(false);
const area_open_window_rect = ref(new Rect()); const area_open_window_rect = ref(new Rect());
let item_witdh = ref(0); let item_witdh = ref(0);
const item_height = ref(0); const item_height = ref(0);
const radians = () => {
const test_monitor_list: any = clacMonitor();
if (test_monitor_list) {
const item = test_monitor_list[current_index.value];
return /*a*/ (item.angle * Math.PI) / 180;
}
};
const calculateCoordinates = (
px: number,
py: number,
cx: number,
cy: number
) => {
const x =
cx +
(px - cx) * Math.cos(Number(radians())) -
(py - cy) * Math.sin(Number(radians()));
const y =
cy +
(px - cx) * Math.sin(Number(radians())) +
(py - cy) * Math.cos(Number(radians()));
return { x, y };
};
let current_index = ref(0);
const clacMonitor = () => {
let test_monitor_list: any = [];
$store.state.show_monitor_list.forEach((element) => {
let item: test_monitor = new test_monitor(0, 0, 0);
const wall_dom = wall.value;
if (wall_dom) {
item.h = element.h * wall_dom.clientHeight;
item.w = element.w * wall_dom.clientWidth;
item.currentx = element.currentx * wall_dom.clientWidth;
item.currenty = element.currenty * wall_dom.clientHeight;
item.centerx = item.currentx + item.w * 0.5;
item.centery = item.currenty + item.h * 0.5;
item.angle = element.angle;
item.id = element.id;
test_monitor_list.push(item);
}
});
return test_monitor_list;
};
const four_point = () => {
const test_monitor_list: any = clacMonitor();
if (test_monitor_list) {
const item = test_monitor_list[current_index.value];
item.centerx = parseInt(item.centerx.toString());
item.centery = parseInt(item.centery.toString());
const x2: number = item.currentx + item.w;
const y2: number = item.currenty + item.h;
if (item.angle != 0) {
const point_left_top = calculateCoordinates(
item.currentx,
item.currenty,
item.centerx,
item.centery
);
const point_left_bootom = calculateCoordinates(
item.currentx,
y2,
item.centerx,
item.centery
);
const point_right_top = calculateCoordinates(
x2,
item.currenty,
item.centerx,
item.centery
);
const point_right_bottom = calculateCoordinates(
x2,
y2,
item.centerx,
item.centery
);
const point_list = [
point_left_top,
point_left_bootom,
point_right_top,
point_right_bottom,
];
return point_list;
}
}
};
const select_x = () => {
const point_list = four_point();
const item = $store.state.show_monitor_list[current_index.value];
if (item.angle != 0) {
if (point_list) {
let minx = 100000;
point_list.forEach((element) => {
if (minx > element.x) {
minx = element.x;
}
});
return minx;
}
} else {
if (wall.value) return item.currentx * wall.value?.clientWidth;
}
};
const select_y = () => {
const point_list = four_point();
let miny = 100000;
if (point_list) {
point_list.forEach((element) => {
if (miny > element.y) {
miny = element.y;
}
});
}
const item = $store.state.show_monitor_list[current_index.value];
if (item.angle != 0) {
return miny;
} else {
if (wall.value) return item.currenty * wall.value?.clientHeight;
}
};
const select_height = () => {
const point_list = four_point();
let maxy = 0;
let miny = 100000;
if (point_list) {
point_list.forEach((element) => {
if (miny > element.y) {
miny = element.y;
}
if (maxy < element.y) {
maxy = element.y;
}
});
}
const item = $store.state.show_monitor_list[current_index.value];
if (item.angle != 0) {
return maxy - miny;
} else {
if (wall.value) return item.h * wall.value?.clientHeight;
}
};
const select_width = () => {
const point_list = four_point();
let maxx = 0;
let minx = 100000;
if (point_list) {
point_list.forEach((element) => {
if (minx > element.x) {
minx = element.x;
}
if (maxx < element.x) {
maxx = element.x;
}
});
}
const item = $store.state.show_monitor_list[current_index.value];
if (item.angle != 0) {
return maxx - minx;
} else {
if (wall.value) return item.w * wall.value?.clientWidth;
}
};
const calcWallItemWH = () => { const calcWallItemWH = () => {
item_witdh.value = Math.floor( item_witdh.value = Math.floor(
(wall?.value?.parentElement?.offsetWidth ?? 0) / wall_cols.value (wall?.value?.parentElement?.offsetWidth ?? 0) / wall_cols.value
@ -415,6 +679,7 @@ export default defineComponent({
); );
} }
} }
//
} }
} }
area_open_window_flag.value = false; area_open_window_flag.value = false;
@ -450,6 +715,51 @@ export default defineComponent({
} }
}; };
const show_magic_wall = async () => {
// $store.state.windows_sort.findIndex((element) => element == item.uuid)
let client = GlobalData.getInstance().getCurrentClient();
if (client) {
const response = await client.getMagicWallConfig();
const settings = await GlobalData.getInstance()
.getCurrentClient()
?.getOutputBoardSetting();
if (response&&settings) {
const a = response?.config.windows;
const wall_dom = wall.value;
let monitorList: any = [];
if (a && wall_dom) {
offsetHeight = wall_dom.clientHeight;
offsetWidth = wall_dom.clientHeight;
a.forEach((element) => {
let item: test_monitor = new test_monitor(0, 0, 0);
item.h = element.h;
item.w = element.w;
item.currentx = element.lt.x;
item.currenty = element.lt.y;
item.angle = element.angle;
item.id = element.index;
if ($store.state.show_monitor_list.length == 0) {
monitorList.push(item);
$store.commit("setShowMonitorList", monitorList);
} else {
let flag = false;
$store.state.show_monitor_list.forEach((ele: any) => {
if (element.index == ele.id) {
flag = true;
}
});
if (!flag) {
monitorList.push(item);
$store.commit("setShowMonitorList", monitorList);
}
}
});
}
}
}
};
EventBus.getInstance().on(EventNamesDefine.WindowMouseDown, wallMouseDown); EventBus.getInstance().on(EventNamesDefine.WindowMouseDown, wallMouseDown);
EventBus.getInstance().on(EventNamesDefine.WindowMouseMove, wallMouseMove); EventBus.getInstance().on(EventNamesDefine.WindowMouseMove, wallMouseMove);
EventBus.getInstance().on(EventNamesDefine.WindowMouseUp, wallMouseUp); EventBus.getInstance().on(EventNamesDefine.WindowMouseUp, wallMouseUp);
@ -685,6 +995,9 @@ export default defineComponent({
elementResizeDetectorMaker().listenTo( elementResizeDetectorMaker().listenTo(
wall.value, wall.value,
(element: HTMLElement) => { (element: HTMLElement) => {
if ($store.state.custom_defines.function_magic_wall) {
show_magic_wall();
}
if (element) { if (element) {
calcWallItemWH(); calcWallItemWH();
} }
@ -957,6 +1270,25 @@ export default defineComponent({
.getCurrentClient() .getCurrentClient()
?.replaceWindow2(find_window, uuid); ?.replaceWindow2(find_window, uuid);
} else { } else {
if (
$store.state.custom_defines.function_magic_wall
) {
const item =
$store.state.show_monitor_list[
current_index.value
];
if (wall.value) {
x = Number(select_x()) / wall.value.clientWidth;
y =
Number(select_y()) / wall.value.clientHeight;
width =
Number(select_width()) /
wall.value.clientWidth;
height =
Number(select_height()) /
wall.value.clientHeight;
}
}
const open_window_request = const open_window_request =
new Protocol.OpenWindowRequestEntity( new Protocol.OpenWindowRequestEntity(
uuid, uuid,
@ -999,6 +1331,14 @@ export default defineComponent({
target?.classList.add("drag-enter"); target?.classList.add("drag-enter");
} }
}, },
magic_select(index: number, item: test_monitor, e: DragEvent) {
current_index.value = index;
e.stopPropagation();
let target: HTMLElement | null = e.target as HTMLElement;
if (target) {
target?.classList.add("drag-enter");
}
},
onDragLeave(e: DragEvent) { onDragLeave(e: DragEvent) {
let target: HTMLElement = e.target as HTMLElement; let target: HTMLElement = e.target as HTMLElement;

View File

@ -37,6 +37,7 @@ export class CustomDefines {
function_output_board = false; function_output_board = false;
function_center_control = false; function_center_control = false;
function_mirroring_output = false; function_mirroring_output = false;
function_magic_wall=false;
} }
export interface IWuJieEventBus { export interface IWuJieEventBus {
@ -53,7 +54,27 @@ export interface IWuJieInterface {
props: any; props: any;
bus: IWuJieEventBus; bus: IWuJieEventBus;
} }
class test_monitor {
w = 0.0;
h = 0.0;
currentx = 0.0;
currenty = 0.0;
centerx = 0.0;
centery = 0.0;
angle = 0;
id = 0;
constructor(id: number, w: number, h: number) {
this.currentx = 0.0;
this.currenty = 0.0;
this.angle = 0;
this.centerx = 0;
this.centery = 0;
this.id = id;
this.w = w;
this.h = h;
}
}
export interface StateInterface { export interface StateInterface {
// Define your own store structure, using submodules if needed // Define your own store structure, using submodules if needed
// example: ExampleStateInterface; // example: ExampleStateInterface;
@ -91,6 +112,7 @@ export interface StateInterface {
device_attribute: number; device_attribute: number;
power_state: boolean; power_state: boolean;
product_name: string; product_name: string;
show_monitor_list:test_monitor[];
custom_defines: CustomDefines; custom_defines: CustomDefines;
fusion_configuration: object; fusion_configuration: object;
isLedPlayer: () => boolean; isLedPlayer: () => boolean;
@ -359,7 +381,7 @@ export default store(function (/* { ssrContext } */) {
power_state: false, power_state: false,
fusion_configuration: {}, fusion_configuration: {},
product_name: EProductNames.LED_PLAYER, product_name: EProductNames.LED_PLAYER,
show_monitor_list:[],
custom_defines: new CustomDefines(), custom_defines: new CustomDefines(),
selected_projector: "0/0", selected_projector: "0/0",
EnableBlending: false, EnableBlending: false,
@ -380,6 +402,9 @@ export default store(function (/* { ssrContext } */) {
setInitialized(state: StateInterface, playload?: any) { setInitialized(state: StateInterface, playload?: any) {
state.initialized = true; state.initialized = true;
}, },
setShowMonitorList(state: StateInterface, playload?: any) {
state.show_monitor_list = playload
},
updateLandspace(state: StateInterface, playload?: any) { updateLandspace(state: StateInterface, playload?: any) {
if (typeof playload == "boolean") { if (typeof playload == "boolean") {
state.landspace = playload; state.landspace = playload;
@ -412,6 +437,8 @@ export default store(function (/* { ssrContext } */) {
(state.device_attribute & EDeviceAttribute.CenterControl) != 0; (state.device_attribute & EDeviceAttribute.CenterControl) != 0;
state.custom_defines.function_mirroring_output = state.custom_defines.function_mirroring_output =
(state.device_attribute & EDeviceAttribute.MirroringOutput) != 0; (state.device_attribute & EDeviceAttribute.MirroringOutput) != 0;
state.custom_defines.function_magic_wall =
(state.device_attribute & EDeviceAttribute.ProductMagicWall) != 0;
} }
}, },
setAvancedDebug(state: StateInterface, playload?: any) { setAvancedDebug(state: StateInterface, playload?: any) {