special_video HDMI采集增加右键菜单设置宣传。右键开窗增加旋转弹窗。图片信号源增加旋转参数。

This commit is contained in:
fangxiang 2022-10-19 12:40:04 +08:00
parent a6b1774498
commit c9659e777b
10 changed files with 231 additions and 60 deletions

View File

@ -1115,6 +1115,12 @@ export default class ClientConnection {
);
}
public async setHdmiRotation(rotation: number) {
this.ws?.send(
JSON.stringify(new Protocol.SetHDMIRotationRequestEntity(rotation))
);
}
public async getTimingTasks() {
try {
return await this.doRpc<Protocol.GetTimingTasksResponseEntity>(

View File

@ -137,7 +137,8 @@
<q-item
v-if="
$store.state.isSpecialVideo() &&
item_data.window_type == 'EwindowType::Multimedia'
(item_data.window_type == 'EwindowType::Multimedia' ||
item_data.window_type == 'EwindowType::Image')
"
>
<q-item-section>

View File

@ -77,6 +77,41 @@
<q-icon name="done" />
</q-item-section>
</q-item>
<q-item
clickable
v-ripple
v-if="
$store.state.isSpecialVideo() &&
prop.node.item_data?.window_type == 'EwindowType::HdmiIn'
"
>
<q-item-section>
{{ $t("rotation") }}
</q-item-section>
<q-item-section side>
<q-icon name="keyboard_arrow_right" />
</q-item-section>
<q-menu
@before-show="updateCurrentHdmiRotation"
anchor="top end"
self="top start"
>
<q-list>
<q-item
v-close-popup
v-for="n in [0, 90, 180, 270]"
:key="n"
clickable
@click="setHDMIRotation(n)"
>
<q-item-section>{{ n }}°</q-item-section>
<q-item-section side>
<q-icon v-if="n == current_hdmi_rotation" name="done" />
</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-item>
<q-item
v-if="
@ -206,6 +241,8 @@ export default defineComponent({
const content_height = ref(0);
const current_hdmi_rotation = ref(0);
const refresh_content_height = () => {
content_height.value = window.innerHeight - 135;
};
@ -234,6 +271,8 @@ export default defineComponent({
tree_nodes,
content_height,
lossy_pic,
current_hdmi_rotation,
loga(a: any) {
console.log(a);
},
@ -410,6 +449,28 @@ export default defineComponent({
timeout: 1500,
});
},
updateCurrentHdmiRotation() {
current_hdmi_rotation.value =
GlobalData.getInstance().applicationConfig?.device_hdmi_rotation ?? 0;
},
setHDMIRotation(rotation: number) {
let success = true;
try {
GlobalData.getInstance()
.getCurrentClient()
?.setHdmiRotation(rotation);
} catch {
success = false;
}
$q.notify({
color: success ? "positive" : "negative",
icon: success ? "done" : "warning",
message:
$t.t("set") + (success ? $t.t("success") : $t.t("fail")) + "!",
position: "top",
timeout: 1500,
});
},
};
},
});

View File

@ -63,7 +63,7 @@
method="post"
:headers="generatorFileUploadHeaders"
:label="$t('select software upgrade file') + ':'"
accept=".zip"
accept=".zip,.tar,.tar.gz"
:hide-upload-btn="true"
@uploaded="onUploaded"
@failed="onFailed"

View File

@ -36,4 +36,5 @@ export default class ApplicationConfigEntity {
video_suffix_filter: string | null = "";
image_suffix_filter: string | null = "";
special_video_layout_rotation: string | undefined = "0";
device_hdmi_rotation: number = 0;
}

View File

@ -458,6 +458,9 @@ export namespace Protocol {
public static get kCleanBrowserCache() {
return Commands.PROTOCOL_PREFIX + "CleanBrowserCache";
}
public static get kSetHDMIRotation() {
return Commands.PROTOCOL_PREFIX + "SetHDMIRotation";
}
static _all_commands = new Set([
Commands.kUnKnowCommand,
@ -572,6 +575,7 @@ export namespace Protocol {
Commands.kRpcSetJointActionEquipment,
Commands.kRpcDeleteJointActionEquipment,
Commands.kCleanBrowserCache,
Commands.kSetHDMIRotation,
]);
public static get AllCommands() {
return this._all_commands;
@ -2968,4 +2972,17 @@ export namespace Protocol {
timestamp = Date.now();
}
export class SetHDMIRotationRequestEntity extends PacketEntity {
rotation = 0;
constructor(rotation = 0, rpc_id = 0) {
super();
super.command = Commands.kSetHDMIRotation;
super.flag = PacketEntity.FLAG_REQUEST;
super.rpc_id = rpc_id;
this.rotation = rotation;
}
}
}

View File

@ -375,4 +375,5 @@ export default {
"Clean Browser Cache Command Send Success",
"row multiply column should be less than or equal to ":
"Row Multiply Column Should Be Less Than Or Equal To ",
"please select window rotation": "Please Select Window Rotation",
};

View File

@ -647,4 +647,5 @@ export default {
"clean browser cache command send success": "清除浏览器缓存指令发送成功",
"row multiply column should be less than or equal to ":
"行乘以列的值不能大于",
"please select window rotation": "请选择窗口旋转",
};

View File

@ -1070,33 +1070,74 @@ export default defineComponent({
entity.name = file.name;
entity.local_file_flag = true;
entity.group_uuid = "";
try {
const response = await GlobalData.getInstance()
.getCurrentClient()
?.addSignalSource(entity);
const do_open_local_source = async (
signal_source: SignalSourceEntity
) => {
try {
const response = await GlobalData.getInstance()
.getCurrentClient()
?.addSignalSource(signal_source);
if (response && response.success) {
if (
target_rect &&
!isNaN(target_rect.x) &&
!isNaN(target_rect.y) &&
!isNaN(target_rect.w) &&
!isNaN(target_rect.h)
) {
const open_window_request =
new Protocol.OpenWindowRequestEntity(
response.uuid,
target_rect.x,
target_rect.y,
target_rect.w,
target_rect.h
);
GlobalData.getInstance()
.getCurrentClient()
?.openWindow(open_window_request);
if (response && response.success) {
if (
target_rect &&
!isNaN(target_rect.x) &&
!isNaN(target_rect.y) &&
!isNaN(target_rect.w) &&
!isNaN(target_rect.h)
) {
const open_window_request =
new Protocol.OpenWindowRequestEntity(
response.uuid,
target_rect.x,
target_rect.y,
target_rect.w,
target_rect.h
);
GlobalData.getInstance()
.getCurrentClient()
?.openWindow(open_window_request);
}
}
}
} catch {}
} catch {}
};
if ($store.state.isSpecialVideo()) {
$q.dialog({
title: $t.t("open window"),
message: $t.t("please select window rotation") + ":",
options: {
type: "radio",
model: "0",
items: [
{ label: "0°", value: "0" },
{ label: "90°", value: "90" },
{ label: "180°", value: "180" },
{ label: "270°", value: "270" },
],
},
ok: {
label: $t.t("ok"),
noCaps: true,
flat: true,
},
cancel: {
label: $t.t("cancel"),
noCaps: true,
flat: true,
},
persistent: true,
}).onOk(async (data) => {
let temp_rotation = parseInt(data);
if (isNaN(temp_rotation) || temp_rotation == Infinity) {
temp_rotation = 0;
}
entity.rotation = temp_rotation;
do_open_local_source(entity);
});
} else {
do_open_local_source(entity);
}
}
}
},

View File

@ -1181,44 +1181,86 @@ export default defineComponent({
entity.name = file.name;
entity.local_file_flag = true;
entity.group_uuid = "";
try {
const response = await GlobalData.getInstance()
.getCurrentClient()
?.addSignalSource(entity);
if (response && response.success) {
const cell_width = 1.0 / $store.state.wall_col;
const cell_height = 1.0 / $store.state.wall_row;
const col = Math.floor(
last_context_menu_pos_x.value /
wall.value.offsetWidth /
cell_width
);
const row = Math.floor(
last_context_menu_pos_y.value /
wall.value.offsetHeight /
cell_height
);
const do_open_local_source = async (
signal_source: SignalSourceEntity
) => {
try {
const response = await GlobalData.getInstance()
.getCurrentClient()
?.addSignalSource(signal_source);
if (wall.value && response && response.success) {
const cell_width = 1.0 / $store.state.wall_col;
const cell_height = 1.0 / $store.state.wall_row;
const x = col * cell_width;
const y = row * cell_height;
if (!isNaN(x) && !isNaN(y)) {
const open_window_request =
new Protocol.OpenWindowRequestEntity(
response.uuid,
x,
y,
cell_width,
const col = Math.floor(
last_context_menu_pos_x.value /
wall.value.offsetWidth /
cell_width
);
const row = Math.floor(
last_context_menu_pos_y.value /
wall.value.offsetHeight /
cell_height
);
);
GlobalData.getInstance()
.getCurrentClient()
?.openWindow(open_window_request);
const x = col * cell_width;
const y = row * cell_height;
if (!isNaN(x) && !isNaN(y)) {
const open_window_request =
new Protocol.OpenWindowRequestEntity(
response.uuid,
x,
y,
cell_width,
cell_height
);
GlobalData.getInstance()
.getCurrentClient()
?.openWindow(open_window_request);
}
}
}
} catch {}
} catch {}
};
if ($store.state.isSpecialVideo()) {
$q.dialog({
title: $t.t("open window"),
message: $t.t("please select window rotation") + ":",
options: {
type: "radio",
model: "0",
items: [
{ label: "0°", value: "0" },
{ label: "90°", value: "90" },
{ label: "180°", value: "180" },
{ label: "270°", value: "270" },
],
},
ok: {
label: $t.t("ok"),
noCaps: true,
flat: true,
},
cancel: {
label: $t.t("cancel"),
noCaps: true,
flat: true,
},
persistent: true,
}).onOk(async (data) => {
let temp_rotation = parseInt(data);
if (isNaN(temp_rotation) || temp_rotation == Infinity) {
temp_rotation = 0;
}
entity.rotation = temp_rotation;
do_open_local_source(entity);
});
} else {
do_open_local_source(entity);
}
}
}
},