diff --git a/package.json b/package.json index 906c37f..36288f4 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@quasar/cli": "^2.0.0", - "@quasar/extras": "^1.15.10", + "@quasar/extras": "^1.15.11", "@tinymce/tinymce-vue": "4", "@types/element-resize-detector": "^1.1.3", "autoprefixer": "^10.4.2", @@ -19,7 +19,7 @@ "core-js": "^3.21.0", "element-resize-detector": "^1.2.4", "qrcode.vue": "^3.3.3", - "quasar": "^2.11.5", + "quasar": "^2.11.6", "reconnecting-websocket": "^4.4.0", "sortablejs": "^1.15.0", "to": "^0.2.9", @@ -29,6 +29,7 @@ "vue": "^3.0.0", "vue-i18n": "^9.1.9", "vue-router": "^4.0.0", + "vue3-draggable-resizable": "^1.6.5", "vuex": "^4.0.1", "zrender": "^5.3.1" }, diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index b9a3f6a..fd5c8f3 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1261,7 +1261,7 @@ export default class ClientConnection { console.error(e); } } -// + // public async getMagicWallGridState() { try { return await this.doRpc( @@ -1272,7 +1272,7 @@ export default class ClientConnection { } } - public async setMagicWallGridState(show_grid:boolean) { + public async setMagicWallGridState(show_grid: boolean) { try { return await this.doRpc( new Protocol.RpcSetMagicWallGridStateRequestEntity(show_grid) @@ -1361,6 +1361,7 @@ export default class ClientConnection { row: number, column: number, correction_type: number, + control_point_count: number, control_point: number, x: number, y: number @@ -1370,6 +1371,7 @@ export default class ClientConnection { row, column, correction_type, + control_point_count, control_point, x, y @@ -1461,6 +1463,94 @@ export default class ClientConnection { ); } + public async SetBlendingHorDensity( + row: number, + column: number, + control_point_count: number, + control_point: number, + value: number + ) { + return await this.doRpc( + new Protocol.SetBlendingHorDensityRequestEntity( + row, + column, + control_point_count, + control_point, + value + ) + ); + } + + public async SetBlendingVerDensity( + row: number, + column: number, + control_point_count: number, + control_point: number, + value: number + ) { + return await this.doRpc( + new Protocol.SetBlendingVerDensityRequestEntity( + row, + column, + control_point_count, + control_point, + value + ) + ); + } + + public async ResetBlendingConfig() { + return await this.doRpc( + new Protocol.ResetBlendingConfigRequestEntity() + ); + } + + public async SetBlendingOption(id: string, value: string) { + return await this.doRpc( + new Protocol.SetBlendingOptionRequestEntity(id, value) + ); + } + + public async EnumBlendingScene() { + return await this.doRpc( + new Protocol.EnumBlendingSceneRequestEntity() + ); + } + + public async ApplyBlendingScene(name: string) { + return await this.doRpc( + new Protocol.ApplyBlendingSceneRequestEntity(name) + ); + } + + public async DeleteBlendingScene(name: string) { + return await this.doRpc( + new Protocol.DeleteBlendingSceneRequestEntity(name) + ); + } + + public async AddBlendingCtrlPoint( + type: string, + row: number, + column: number, + count: number + ) { + return await this.doRpc( + new Protocol.AddBlendingCtrlPointRequestEntity(type, row, column, count) + ); + } + + public async DelBlendingCtrlPoint( + type: string, + row: number, + column: number, + count: number + ) { + return await this.doRpc( + new Protocol.DelBlendingCtrlPointRequestEntity(type, row, column, count) + ); + } + public async setCloudServerSetting( cloud_server_address: string, cloud_server_verify_key: string, @@ -1483,7 +1573,7 @@ export default class ClientConnection { } this.ws = null; } - public async getFileListFileManager(dir_path:string) { + public async getFileListFileManager(dir_path: string) { try { return await this.doRpc( new Protocol.RpcFileManagerGetFileListRequest(dir_path) @@ -1492,34 +1582,42 @@ export default class ClientConnection { console.error(e); } } - public async RenameFileManager(base_dir:string,file_name:string,new_file_name:string) { + public async RenameFileManager( + base_dir: string, + file_name: string, + new_file_name: string + ) { try { return await this.doRpc( - new Protocol.RpcFileManagerRenameRequest(base_dir,file_name,new_file_name) + new Protocol.RpcFileManagerRenameRequest( + base_dir, + file_name, + new_file_name + ) ); } catch (e) { console.error(e); } } - public async DeleteFileManager(base_dir:string,file_name:string) { + public async DeleteFileManager(base_dir: string, file_name: string) { try { return await this.doRpc( - new Protocol.RpcFileManagerDeleteRequest(base_dir,file_name) + new Protocol.RpcFileManagerDeleteRequest(base_dir, file_name) ); } catch (e) { console.error(e); } } - public async CreateDirectoryFileManager(base_dir:string,dir_name:string) { + public async CreateDirectoryFileManager(base_dir: string, dir_name: string) { try { return await this.doRpc( - new Protocol.RpcFileManagerCreateDirectoryRequest(base_dir,dir_name) + new Protocol.RpcFileManagerCreateDirectoryRequest(base_dir, dir_name) ); } catch (e) { console.error(e); } } - public async CheckModeIndex(mode_index:number) { + public async CheckModeIndex(mode_index: number) { try { return await this.doRpc( new Protocol.RpcCheckModeIndexRequestEntity(mode_index) diff --git a/src/components/FileManageDialog.vue b/src/components/FileManageDialog.vue index 22d4d9e..d907cdb 100644 --- a/src/components/FileManageDialog.vue +++ b/src/components/FileManageDialog.vue @@ -156,7 +156,7 @@ - !!val && val.trim().length > 0&& val.indexOf(".") != 0 , + !!val && val.trim().length > 0 && val.indexOf(".") != 0, type: "text", }, ok: { diff --git a/src/components/FusionSettings/Debugging.vue b/src/components/FusionSettings/Debugging.vue new file mode 100644 index 0000000..b1a0d7f --- /dev/null +++ b/src/components/FusionSettings/Debugging.vue @@ -0,0 +1,92 @@ + + + diff --git a/src/components/FusionSettings/DebuggingItem.vue b/src/components/FusionSettings/DebuggingItem.vue new file mode 100644 index 0000000..1e4bdd1 --- /dev/null +++ b/src/components/FusionSettings/DebuggingItem.vue @@ -0,0 +1,98 @@ + + + + diff --git a/src/components/FusionSettings/DensityCorrection.vue b/src/components/FusionSettings/DensityCorrection.vue index 8651eed..9e61992 100644 --- a/src/components/FusionSettings/DensityCorrection.vue +++ b/src/components/FusionSettings/DensityCorrection.vue @@ -1,97 +1,880 @@ + \ No newline at end of file + name: "ComponentDensityCorrection", + components: { + Vue3DraggableResizable + }, + setup() { + let set = GlobalData.getInstance().getCurrentClient(); + let $store = useStore(); + let $t = useI18n(); + const ste_status = ref(0); + let config = JSON.parse($store.state.fusion_configuration).projectors[0]; + const configselsect = computed(() => { + return $store.state.selected_projector; + }); + + //用于计算当前投影仪的索引 + let serverconfig = JSON.parse($store.state.fusion_configuration); + const selectedprojector = computed(() => { + return ( + $store.getters.GetTheCurrentlySelectedCamera[0] * serverconfig.col + + $store.getters.GetTheCurrentlySelectedCamera[1] + ); + }); + const now_v_h = ref("") + const value_h_point_amount = ref(5) + const value_v_point_amount = ref(5) + const add_dialog=ref(false) + const now_amount=ref(0) + + const options_value_h_point_amount = ref([]) + const options_value_v_point_amount = ref([]) + const deepcopy = (o1: any, o2: any) => { + for (let k in o2) { + if (typeof o2[k] === "object") { + o1[k] = {}; + deepcopy(o1[k], o2[k]); + } else { + o1[k] = o2[k]; + } + } + }; + + const use_server_config = () => { + value_h_point_amount.value = 5 + value_v_point_amount.value = 5 + let a = 5 + value_h.value = [] + value_h_point.value = [] + for (let index = 0; index < config.multi_hor_density[a].length; index++) { + let tmp: DensityCorrectionPoint = config.multi_hor_density[a][index]; + value_h.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + + value_h_point.value.push(tmp_point) + } + + + value_v.value = [] + value_v_point.value = [] + for (let index = 0; index < config.multi_ver_density[a].length; index++) { + let tmp: DensityCorrectionPoint = config.multi_ver_density[a][index]; + value_v.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_v_point.value.push(tmp_point) + } + + } + + const use_set_cache = () => { + if (set_cache.value[selectedprojector.value] != null) { + let tmp = JSON.parse(set_cache.value[selectedprojector.value]); + value_h.value = [] + value_v.value = [] + value_h_point.value = [] + value_v_point.value = [] + deepcopy(value_h.value, tmp.value_h) + deepcopy(value_v.value, tmp.value_v) + value_h_point_amount.value = tmp.value_h_point_amount + value_v_point_amount.value = tmp.value_v_point_amount + deepcopy(value_h_point.value, tmp.value_h_point) + deepcopy(value_v_point.value, tmp.value_v_point) + recalculate_coordinates() + } + } + + + const save_set_cache = () => { + let tmp = { value_h: value_h.value, value_v: value_v.value, value_v_point_amount: value_v_point_amount.value, value_h_point_amount: value_h_point_amount.value, value_v_point: value_v_point.value, value_h_point: value_h_point.value } + set_cache.value[selectedprojector.value] = JSON.stringify(tmp); + } + + + + + const auxiliary_line = ref(false) + + + + + watch( + () => configselsect, + (newVal, oldVal) => { + let tmp = JSON.parse($store.state.fusion_configuration); + let fortmp = null; + let i; + for (i of tmp.projectors) { + if ( + i.col === $store.getters.GetTheCurrentlySelectedCamera[1] && + i.row === $store.getters.GetTheCurrentlySelectedCamera[0] + ) { + fortmp = JSON.parse(JSON.stringify(i)); + } + } + ste_status.value = 1; + config = JSON.parse(JSON.stringify(fortmp)); + use_server_config(); + use_set_cache(); + options_value_h_point_amount.value = Object.keys(config.multi_hor_density) + options_value_v_point_amount.value = Object.keys(config.multi_ver_density) + setTimeout(() => { + ste_status.value = 0; + }, 100); + }, + { deep: true } + ); + + + + const set_cache: any = ref([]); + //值 + let value_h = ref([]); + let value_v = ref([]); + //位置 + let value_h_point = ref([]); + let value_v_point = ref([]); + /** + * 当前选中的点的索引 + */ + const options_model_v = ref(0) + const options_model_h = ref(0) + + const div = ref(); + const max = ref({ x: 0, y: 0 }) + const point = ref({ w: 20, h: 20 }) + + + watch(() => now_v_h, (newval, oldval) => { + if (newval.value == 'level') { + set?.SetBlendingOption("blending_grids_select_ui", "hor_density") + } else { + set?.SetBlendingOption("blending_grids_select_ui", "ver_density") + } + }, { deep: true }) + watch(() => value_v_point_amount, (newval, oldval) => { + set?.SetBlendingOption("blending_grids_control_point_count", `${newval.value}`) + if (now_v_h.value == 'level') { + set?.SetBlendingOption("blending_grids_select_ui", "hor_density") + } else { + set?.SetBlendingOption("blending_grids_select_ui", "ver_density") + } + save_set_cache() + }, { deep: true }) + watch(() => value_h_point_amount, (newval, oldval) => { + set?.SetBlendingOption("blending_grids_control_point_count", `${newval.value}`) + if (now_v_h.value == 'level') { + set?.SetBlendingOption("blending_grids_select_ui", "hor_density") + } else { + set?.SetBlendingOption("blending_grids_select_ui", "ver_density") + } + save_set_cache() + }, { deep: true }) + + watch(() => options_model_h, (newval, oldval) => { + set?.SetBlendingOption("blending_grids_select_point", `${value_h_point.value[newval.value].control_point}`) + }, { deep: true }) + watch(() => options_model_v, (newval, oldval) => { + set?.SetBlendingOption("blending_grids_select_point", `${value_v_point.value[newval.value].control_point}`) + }, { deep: true }) + + /** + * 分辨率和页面的比例 + */ + let Proportion = ref({ x: 100, y: 1000 }); + nextTick(() => { + max.value.x = div.value.offsetWidth + max.value.y = div.value.offsetHeight + }) + + + const chang_point_amount = (val: number, type: string) => { + start_point(val, type) + save_set_cache() + } + + const dragStartHandle = ($event: any, index: number, type: string) => { + let obj_x = $event.x + let obj_y = $event.y + let tmp = coordinate_transformation_xy_to_value(obj_x, obj_y) + if (type == 'v') { + value_v.value[index].y = Math.trunc(tmp.y) + send_value(index, type, Math.trunc(tmp.y)) + } + if (type == 'h') { + value_h.value[index].x = Math.trunc(tmp.x) + send_value(index, type, Math.trunc(tmp.x)) + } + save_set_cache() + } + + const chang = (index: number, $event: any, type: string) => { + $event = Number($event) + if (type == 'v') { + let tmp = coordinate_transformation_value_to_xy(0, $event) + value_v_point.value[index].y = Math.trunc(tmp.y) + send_value(index, type, Math.trunc(value_v.value[index].y)) + } + if (type == 'h') { + let tmp = coordinate_transformation_value_to_xy($event, 0) + value_h_point.value[index].x = Math.trunc(tmp.x) + send_value(index, type, Math.trunc(value_h.value[index].x)) + } + save_set_cache() + } + const options_v = computed(() => { + let tmp = [] + for (let index = 0; index < Number(value_v_point_amount.value); index++) { + tmp.push({ + label: `v${index + 1}`, + value: index, + }) + } + return tmp + }) + const options_h = computed(() => { + let tmp = [] + for (let index = 0; index < Number(value_h_point_amount.value); index++) { + tmp.push({ + label: `h${index + 1}`, + value: index, + }) + } + return tmp + }) + + /** + * 将分辨率的坐标转换为 页面的坐标 + * @param x x坐标 + * @param y y坐标 + */ + const coordinate_transformation_value_to_xy = (x: number, y: number): { x: number, y: number } => { + x = x / Proportion.value.x + y = (config.height - y) / Proportion.value.y + return { x, y } + } + + + /** + * 将页面的坐标转换为 分辨率的坐标 + * @param x x坐标 + * @param y y坐标 + */ + const coordinate_transformation_xy_to_value = (x: number, y: number): { x: number, y: number } => { + x = x * Proportion.value.x + y = (max.value.y - y) * Proportion.value.y + return { x, y } + } + + const start_point = (a: number, type: string) => { + if (type == 'h' || type == 'all') { + value_h.value = [] + value_h_point.value = [] + for (let index = 0; index < config.multi_hor_density[a].length; index++) { + let tmp: DensityCorrectionPoint = config.multi_hor_density[a][index]; + value_h.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_h_point.value.push(tmp_point) + } + } + if (type == 'v' || type == 'all') { + value_v.value = [] + value_v_point.value = [] + for (let index = 0; index < config.multi_ver_density[a].length; index++) { + let tmp: DensityCorrectionPoint = config.multi_ver_density[a][index]; + value_v.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_v_point.value.push(tmp_point) + } + } + + } + + + const start = () => { + let tmp: DensityCorrectionPoint = { control_point: 0, x: 0, y: 0, def_x: 0, def_y: 0 }; + value_v.value.push(tmp) + value_h.value.push(tmp) + value_v_point.value.push(tmp) + value_h_point.value.push(tmp) + } + start() + onMounted(() => { + Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w) + Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h) + options_value_h_point_amount.value = Object.keys(config.multi_hor_density) + options_value_v_point_amount.value = Object.keys(config.multi_ver_density) + let tmp = JSON.parse($store.state.fusion_configuration).options; + auxiliary_line.value = tmp.blending_grids_density_assistant_lines == "1" + now_v_h.value = "level" + start_point(5, 'all') + if ( + sessionStorage.DensityCorrection && + sessionStorage.DensityCorrection.length > 0 + ) { + set_cache.value = JSON.parse(sessionStorage.DensityCorrection); + use_set_cache(); + } + window.onresize = () => { + return (() => { + if (div != null) { + recalculate_coordinates() + } + })(); + }; + }) + + onBeforeUnmount(() => { + sessionStorage.DensityCorrection = JSON.stringify(set_cache.value); + }); + + const reset = (index: number, send: boolean, type: string) => { + if (type == 'v') { + value_v.value[index].x = value_v.value[index].def_x + value_v.value[index].y = value_v.value[index].def_y + chang(index, value_v.value[index].def_y, type) + } + if (type == 'h') { + value_h.value[index].x = value_h.value[index].def_x + value_h.value[index].y = value_h.value[index].def_y + chang(index, value_h.value[index].def_x, type) + } + save_set_cache() + } + const send_value = (index: number, type: string, value: number) => { + let row = $store.getters.GetTheCurrentlySelectedCamera[0] + let col = $store.getters.GetTheCurrentlySelectedCamera[1] + if (type == 'v') { + set?.SetBlendingVerDensity(row, col, Number(value_v_point_amount.value), index + 1, Number(value)); + } + if (type == 'h') { + set?.SetBlendingHorDensity(row, col, Number(value_h_point_amount.value), index + 1, Number(value)); + } + } + const resetall = () => { + switch (now_v_h.value) { + case 'vertical': + for (let index = 0; index < value_v_point_amount.value; index++) { + reset(index, true, 'v') + } + break; + case 'level': + for (let index = 0; index < value_h_point_amount.value; index++) { + reset(index, true, 'h') + } + break; + default: + break; + } + + + } + const del_dialog = ref(false) + const add_control_points = (amount: number, type: string) => { + if (amount < 5) return + let tmpconfig: any = null + let row = $store.getters.GetTheCurrentlySelectedCamera[0] + let col = $store.getters.GetTheCurrentlySelectedCamera[1] + switch (type) { + case 'v': + set?.AddBlendingCtrlPoint('ver_density', row, col, Number(amount)).then((res) => { + if (res == null || typeof (res) == "undefined") return + update(res?.config) + let tmp = JSON.parse(res?.config); + let fortmp = null; + let i; + for (i of tmp.projectors) { + if ( + i.col === $store.getters.GetTheCurrentlySelectedCamera[1] && + i.row === $store.getters.GetTheCurrentlySelectedCamera[0] + ) { + fortmp = JSON.parse(JSON.stringify(i)); + } + } + ste_status.value = 1; + tmpconfig = JSON.parse(JSON.stringify(fortmp)); + config = JSON.parse(JSON.stringify(fortmp)); + options_value_v_point_amount.value = [] + for (let key in tmpconfig.multi_ver_density) { + options_value_v_point_amount.value.push(key) + } + + // console.log(amount) + // console.log(tmpconfig.multi_ver_density) + value_v_point_amount.value = amount + $store.commit("setfusion_configuration", res?.config); + value_v.value = [] + value_v_point.value = [] + for (let index = 0; index < tmpconfig.multi_ver_density[amount].length; index++) { + let tmp: DensityCorrectionPoint = tmpconfig.multi_ver_density[amount][index]; + value_v.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_v_point.value.push(tmp_point) + } + }); + break; + case 'h': + set?.AddBlendingCtrlPoint('hor_density', row, col, Number(amount)).then((res) => { + if (res == null || typeof (res) == "undefined") return + update(res?.config) + let tmp = JSON.parse(res?.config); + let fortmp = null; + let i; + for (i of tmp.projectors) { + if ( + i.col === $store.getters.GetTheCurrentlySelectedCamera[1] && + i.row === $store.getters.GetTheCurrentlySelectedCamera[0] + ) { + fortmp = JSON.parse(JSON.stringify(i)); + } + } + ste_status.value = 1; + tmpconfig = JSON.parse(JSON.stringify(fortmp)); + config = JSON.parse(JSON.stringify(fortmp)); + options_value_h_point_amount.value = [] + for (let key in tmpconfig.multi_hor_density) { + options_value_h_point_amount.value.push(key) + } + value_h_point_amount.value = amount + $store.commit("setfusion_configuration", res?.config); + value_h.value = [] + value_h_point.value = [] + for (let index = 0; index < tmpconfig.multi_hor_density[amount].length; index++) { + let tmp: DensityCorrectionPoint = tmpconfig.multi_hor_density[amount][index]; + value_h.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_h_point.value.push(tmp_point) + } + }); + break; + default: + break; + } + + } + + /** + * 更新比例 更新坐标 + */ + const recalculate_coordinates = () => { + try { + Proportion.value.x = config.width / (div.value.offsetWidth - point.value.w) + Proportion.value.y = config.height / (div.value.offsetHeight - point.value.h) + max.value.x = div.value.offsetWidth + max.value.y = div.value.offsetHeight + for (let index = 0; index < value_v_point_amount.value; index++) { + let x_y = coordinate_transformation_value_to_xy(value_v.value[index].x, value_v.value[index].y) + let def_x_f = coordinate_transformation_value_to_xy(value_v.value[index].def_x, value_v.value[index].def_y) + value_v_point.value[index].x = x_y.x + value_v_point.value[index].y = x_y.y + value_v_point.value[index].def_x = def_x_f.x + value_v_point.value[index].def_y = def_x_f.y + } + for (let index = 0; index < value_h_point_amount.value; index++) { + let x_y = coordinate_transformation_value_to_xy(value_h.value[index].x, value_h.value[index].y) + let def_x_f = coordinate_transformation_value_to_xy(value_h.value[index].def_x, value_h.value[index].def_y) + value_h_point.value[index].x = x_y.x + value_h_point.value[index].y = x_y.y + value_h_point.value[index].def_x = def_x_f.x + value_h_point.value[index].def_x = def_x_f.y + } + } catch (error) { + + } + } + + + const reduce_control_points = (amount: number, type: string) => { + if (amount <= 5) return + let tmpconfig: any = null + let row = $store.getters.GetTheCurrentlySelectedCamera[0] + let col = $store.getters.GetTheCurrentlySelectedCamera[1] + switch (type) { + case 'v': + set?.DelBlendingCtrlPoint('ver_density', row, col, Number(amount)).then((res) => { + if (res == null || typeof (res) == "undefined") return + let tmp = JSON.parse(res?.config); + let fortmp = null; + let i; + for (i of tmp.projectors) { + if ( + i.col === $store.getters.GetTheCurrentlySelectedCamera[1] && + i.row === $store.getters.GetTheCurrentlySelectedCamera[0] + ) { + fortmp = JSON.parse(JSON.stringify(i)); + } + } + ste_status.value = 1; + options_value_v_point_amount.value = [] + tmpconfig = JSON.parse(JSON.stringify(fortmp)); + config = JSON.parse(JSON.stringify(fortmp)); + for (let key in tmpconfig.multi_ver_density) { + options_value_v_point_amount.value.push(key) + } + value_v_point_amount.value = Number(options_value_v_point_amount.value[options_value_v_point_amount.value.length-1]) + amount=Number(options_value_v_point_amount.value[options_value_v_point_amount.value.length-1]) + // console.log(tmpconfig.multi_ver_density) + // console.log(value_v_point_amount.value) + // console.log(amount,'a') + $store.commit("setfusion_configuration", res?.config); + value_v.value = [] + value_v_point.value = [] + + for (let index = 0; index < tmpconfig.multi_ver_density[amount].length; index++) { + let tmp: DensityCorrectionPoint = config.multi_ver_density[amount][index]; + value_v.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_v_point.value.push(tmp_point) + } + options_model_v.value=0 + }); + break; + case 'h': + set?.DelBlendingCtrlPoint('hor_density', row, col, Number(amount)).then((res) => { + if (res == null || typeof (res) == "undefined") return + let tmp = JSON.parse(res?.config); + let fortmp = null; + let i; + for (i of tmp.projectors) { + if ( + i.col === $store.getters.GetTheCurrentlySelectedCamera[1] && + i.row === $store.getters.GetTheCurrentlySelectedCamera[0] + ) { + fortmp = JSON.parse(JSON.stringify(i)); + } + } + ste_status.value = 1; + tmpconfig = JSON.parse(JSON.stringify(fortmp)); + config = JSON.parse(JSON.stringify(fortmp)); + options_value_h_point_amount.value = [] + for (let key in tmpconfig.multi_hor_density) { + options_value_h_point_amount.value.push(key) + } + value_h_point_amount.value = Number(options_value_h_point_amount.value[options_value_h_point_amount.value.length-1]) + amount=Number(options_value_h_point_amount.value[options_value_h_point_amount.value.length-1]) + //value_h_point_amount.value = amount + $store.commit("setfusion_configuration", res?.config); + value_h.value = [] + value_h_point.value = [] + // console.log(tmpconfig.multi_hor_density) + + for (let index = 0; index < tmpconfig.multi_hor_density[amount].length; index++) { + let tmp: DensityCorrectionPoint = tmpconfig.multi_hor_density[amount][index]; + value_h.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_h_point.value.push(tmp_point) + } + options_model_h.value=0 + }); + break; + default: + break; + } + + } + + const update = (config: string) => { + let tmp = JSON.parse($store.state.fusion_configuration); + let fortmp = null; + let i; + for (i of tmp.projectors) { + if ( + i.col === $store.getters.GetTheCurrentlySelectedCamera[1] && + i.row === $store.getters.GetTheCurrentlySelectedCamera[0] + ) { + fortmp = JSON.parse(JSON.stringify(i)); + } + } + ste_status.value = 1; + config = JSON.parse(JSON.stringify(fortmp)); + use_server_config(); + use_set_cache(); + setTimeout(() => { + ste_status.value = 0; + }, 100); + } + const send_auxiliary_line = (val: boolean) => { + set?.SetBlendingOption("blending_grids_density_assistant_lines", val ? "1" : "0"); + } + const del = () => { + let tmp = now_v_h.value == "vertical" ? "v" : "h" + let amount = now_v_h.value == "vertical" ? value_v_point_amount.value : value_h_point_amount.value + reduce_control_points(Number(amount), tmp) + } + const add = () => { + let tmp = now_v_h.value == "vertical" ? "v" : "h" + add_control_points(Number(now_amount.value), tmp); + } + defineExpose({ + now_v_h, + options_model_v, + options_model_h + }); + return { + resetall, + div, + max, + point, + options_model_v, + options_model_h, + value_h, + value_v, + value_h_point, + value_v_point, + dragStartHandle, + chang, + options_v, + options_h, + reset, + options_value_h_point_amount, + options_value_v_point_amount, + value_h_point_amount, + value_v_point_amount, + chang_point_amount, + add_control_points, + now_v_h, + reduce_control_points, + send_auxiliary_line, + auxiliary_line, + del, + add, + del_dialog, + add_dialog, + now_amount, + set_cache + } + } +}) + + diff --git a/src/components/FusionSettings/FourPointCalibration.vue b/src/components/FusionSettings/FourPointCalibration.vue index 80f355e..265b4e2 100644 --- a/src/components/FusionSettings/FourPointCalibration.vue +++ b/src/components/FusionSettings/FourPointCalibration.vue @@ -1,331 +1,378 @@ - \ No newline at end of file + diff --git a/src/components/FusionSettings/FusionLocale.vue b/src/components/FusionSettings/FusionLocale.vue index 3ff5a22..ad31408 100644 --- a/src/components/FusionSettings/FusionLocale.vue +++ b/src/components/FusionSettings/FusionLocale.vue @@ -1,34 +1,25 @@ \ No newline at end of file + diff --git a/src/components/FusionSettings/SurfaceCorrection.vue b/src/components/FusionSettings/SurfaceCorrection.vue index a7b86a1..b044fb4 100644 --- a/src/components/FusionSettings/SurfaceCorrection.vue +++ b/src/components/FusionSettings/SurfaceCorrection.vue @@ -1,487 +1,531 @@ + \ No newline at end of file + }); + } + const del_control_points = (amount: number) => { + let tmp=amount + if (amount <= 9) return + let cardinality = Math.sqrt(amount) + amount = (cardinality + -1) ** 2 + let tmpconfig: any = null + let row = $store.getters.GetTheCurrentlySelectedCamera[0] + let col = $store.getters.GetTheCurrentlySelectedCamera[1] + + set?.DelBlendingCtrlPoint('9', row, col, Number(tmp)).then((res) => { + if (res == null || typeof (res) == "undefined") return + let tmp = JSON.parse(res?.config); + let fortmp = null; + let i; + for (i of tmp.projectors) { + if ( + i.col === $store.getters.GetTheCurrentlySelectedCamera[1] && + i.row === $store.getters.GetTheCurrentlySelectedCamera[0] + ) { + fortmp = JSON.parse(JSON.stringify(i)); + } + } + ste_status.value = 1; + tmpconfig = JSON.parse(JSON.stringify(fortmp)); + config = JSON.parse(JSON.stringify(fortmp)); + options_value_point_amount.value = [] + for (let key in tmpconfig.multi_curved_surface) { + options_value_point_amount.value.push(key) + } + value_point_amount.value = 9 + amount=9 + $store.commit("setfusion_configuration", res?.config); + value.value = [] + value_point.value = [] + for (let index = 0; index < tmpconfig.multi_curved_surface[amount].length; index++) { + let tmp: DensityCorrectionPoint = tmpconfig.multi_curved_surface[amount][index]; + value.value.push(tmp) + let x_y = coordinate_transformation_value_to_xy(tmp.x, tmp.y) + let def_x_f = coordinate_transformation_value_to_xy(tmp.def_x, tmp.def_y) + let tmp_point: DensityCorrectionPoint = { + control_point: tmp.control_point, + x: x_y.x, + y: x_y.y, + def_x: def_x_f.x, + def_y: def_x_f.y + } + value_point.value.push(tmp_point) + } + + }); + } + defineExpose({ + options_model, + }); + return { + resetall, + div, + max, + point, + options_model, + value, + value_point, + dragStartHandle, + chang, + options, + reset, + options_value_point_amount, + value_point_amount, + chang_point_amount, + del_dialog, + add_control_points, + del_control_points + } + } +}) + + diff --git a/src/components/FusionSettingsDialog.vue b/src/components/FusionSettingsDialog.vue index 4d71de5..4f9ea05 100644 --- a/src/components/FusionSettingsDialog.vue +++ b/src/components/FusionSettingsDialog.vue @@ -1,18 +1,16 @@ @@ -115,8 +188,7 @@ import { watch, computed, onMounted, - onBeforeUnmount, - nextTick, + onBeforeMount, } from "vue"; import { useStore } from "src/store"; import { useQuasar, copyToClipboard } from "quasar"; @@ -132,6 +204,7 @@ import FourPointCalibration from "src/components/FusionSettings/FourPointCalibra import GridSettings from "src/components/FusionSettings/GridSettings.vue"; import SurfaceCorrection from "src/components/FusionSettings/SurfaceCorrection.vue"; import DensityCorrection from "src/components/FusionSettings/DensityCorrection.vue"; +import Debugging from "src/components/FusionSettings/Debugging.vue"; export default defineComponent({ name: "ComponentFusionSettingsDialog", @@ -142,6 +215,7 @@ export default defineComponent({ GridSettings, SurfaceCorrection, DensityCorrection, + Debugging }, setup() { let set = GlobalData.getInstance().getCurrentClient(); @@ -149,14 +223,102 @@ export default defineComponent({ let $q = useQuasar(); let $t = useI18n(); let show_dialog = ref(false); - const target_language = ref("zh-CN"); - const text = ref("Projector"); + const save_name = ref("") const showDialog = async () => { show_dialog.value = true; }; + const select_configuration = ref(false) + const del_dialog = ref(false) + const select_configuration_name = ref("") + const send_disable_blending_params = () => { + set?.SetBlendingOption(disable_blending_params_id.value, disable_blending_params.value ? "1" : "0"); + }; + const child :any = ref(null); + const send_show_blending_grids = () => { + let tmp = "" + switch (optionsstr.value) { + case 'FusionLocale': + tmp = '0' + break; + case 'FourPointCalibration': + tmp = '4' + break; + case 'SurfaceCorrection': + tmp = '9' + break; + case 'DensityCorrection': + if(child.value!.now_v_h=='vertical'){ + tmp = 'ver_density' + }else{ + tmp = 'hor_density' + } + + break; + default: + break; + } + set?.SetBlendingOption("blending_grids_select_ui", tmp) + set?.SetBlendingOption('blending_grids_select_projector', now_selsect_projector.value); + set?.SetBlendingOption(show_blending_grids_id.value, show_blending_grids.value ? "1" : "0"); + + switch (optionsstr.value) { + case 'FusionLocale': + + break; + case 'FourPointCalibration': + set?.SetBlendingOption("blending_grids_select_point", `4:${child.value!.options_model+1}`) + break; + case 'SurfaceCorrection': + set?.SetBlendingOption("blending_grids_select_point", `9:${child.value!.options_model+1}`) + break; + case 'DensityCorrection': + console.log(child.value!.now_v_h) + if(child.value!.now_v_h=='vertical'){ + set?.SetBlendingOption("blending_grids_select_point", `${child.value!.options_model_v+1}`) + }else{ + set?.SetBlendingOption("blending_grids_select_point", `${child.value!.options_model_h+1}`) + } + break; + default: + break; + } + + }; + const resetall = () => { + set?.ResetBlendingConfig().then((res) => { + let tmp = JSON.parse(res ? res.config : ""); + EnableBlending.value = tmp.enable; + $store.commit("setEnablefusion", tmp.enable); + config.value.col = tmp.col; + config.value.row = tmp.row; + $store.commit("setfusion_configuration", res?.config); + }); + let tmp = options.value + options.value = "" + $store.commit("setSelectedProjector", "0/0"); + setTimeout(() => { + clear_sessionStorage() + options.value = tmp + }, 300); + } + const clear_sessionStorage = () => { + sessionStorage.removeItem("FusionLocale"); + sessionStorage.removeItem("SurfaceCorrection"); + sessionStorage.removeItem("DensityCorrection"); + sessionStorage.removeItem("FourPointCalibration"); + sessionStorage.removeItem("GridSettings"); + sessionStorage.removeItem("Debugging"); + } + + const config = ref({ col: 0, row: 0 }); const EnableBlending = ref(false); let optionsstr = ref(); optionsstr.value = "FusionLocale"; + const disable_blending_params_id = ref("blending@disable_blending_params"); + const disable_blending_params = ref(false); + const show_blending_grids_id = ref("blending_grids_show"); + const show_blending_grids = ref(false); + const medium = ref(false); const options = computed({ get() { return optionsstr.value; @@ -168,18 +330,197 @@ export default defineComponent({ watch( () => EnableBlending, (newVal, oldVal) => { - $store.commit("setEnableBlending", newVal.value); + $store.commit("setEnablefusion", newVal.value); set?.EnableBlending(newVal.value); }, { deep: true } ); - let data = ref({}); + + watch(() => optionsstr, + (newVal) => { + let tmp = "" + switch (newVal.value) { + case 'FusionLocale': + tmp = "blending" + break; + case 'FourPointCalibration': + tmp = '4' + break; + case 'SurfaceCorrection': + tmp = '9' + break; + case 'DensityCorrection': + tmp = 'hor_density' + break; + default: + break; + } + if (tmp.length) set?.SetBlendingOption("blending_grids_select_ui", tmp) + }, + { deep: true }) + + + + const save = () => { + medium.value = true + //读取场景 + get_scenes() + }; + const getconfig = () => { + try { + set?.GetBlendingConfig("").then((res) => { + let tmp = JSON.parse(res ? res.config : ""); + $store.commit("setEnablefusion", tmp.enable); + $store.commit("setfusion_configuration", res?.config); + }); + } catch (error) { } + }; + const clear = () => { + record_times.value = 0 + show_blending_grids.value = false; + send_show_blending_grids(); + $store.commit("setSelectedProjector", "0/0"); + setTimeout(() => { + clear_sessionStorage() + }, 500); + getconfig() + options.value = "FusionLocale" + }; + + + const get_scenes = () => { + set?.EnumBlendingScene().then((res) => { + if (res == null || res.scenes.length == 0) return + plan_list.splice(0, plan_list.length); + for (let index = 0; index < res.scenes.length; index++) { + plan_list[index] = (res.scenes[index]); + } + }) + } + + onMounted(() => { + setTimeout(() => { + set?.GetBlendingConfig("").then((res) => { + let tmp = JSON.parse(res ? res.config : ""); + let local_options = [ + [disable_blending_params_id, disable_blending_params], + [show_blending_grids_id, show_blending_grids] + ]; + let k: any; + for (k in local_options) { + let local_opt = local_options[k]; + let opt = tmp.options[(local_opt[0].value)]; + if (opt) { + local_opt[1].value = ("0" == opt || "false" == opt.toLowerCase() ? false : true); + } + } + EnableBlending.value = tmp.enable; + $store.commit("setEnablefusion", tmp.enable); + config.value.col = tmp.col; + config.value.row = tmp.row; + $store.commit("setfusion_configuration", res?.config); + + }); + get_scenes() + set?.SetBlendingOption("blending_grids_select_ui", "blending") + }, 1000); + }); + const save_cover_name = ref("") + const plan_list = [ + '' + ] + const apply_the_selected_configuration = () => { + set?.ApplyBlendingScene(select_configuration_name.value).then((res) => { + let tmp = JSON.parse(res ? res.config : "{}"); + EnableBlending.value = tmp.enable; + $store.commit("setEnablefusion", tmp.enable); + config.value.col = tmp.col; + config.value.row = tmp.row; + $store.commit("setfusion_configuration", res?.config); + }); + + let tmp = options.value + options.value = "" + $store.commit("setSelectedProjector", "0/0"); + setTimeout(() => { + clear_sessionStorage() + options.value = tmp + }, 800); + getconfig() + } + const plan_list_op = ref(plan_list) + const filterFn = (val: any, update: any, abort: any) => { + update(() => { + const needle = val.toLocaleLowerCase() + plan_list_op.value = plan_list.filter(v => v.toLocaleLowerCase().indexOf(needle) > -1) + }) + } + const record_times = ref(0) + const setModel = (val: string) => { + save_cover_name.value = val + } + + const saveconfig = () => { + set?.SaveBlendingConfig(save_cover_name.value); + } + + const isdebug = computed(() => { + try { + let tmp = JSON.parse($store.state.fusion_configuration) + return record_times.value > 2 + } catch (error) { + + } + + }) + const name_to_be_deleted = ref(""); + const del_scenes = (name: string) => { + del_dialog.value = true; + name_to_be_deleted.value = name; + } + const dialog_del_scenes = () => { + set?.DeleteBlendingScene(name_to_be_deleted.value); + plan_list.splice(plan_list.findIndex(item => item === name_to_be_deleted.value), 1) + } + const now_selsect_projector=ref("0-0") + const currently_selected_projector = (value: string) => { + set?.SetBlendingOption('blending_grids_select_projector', value); + now_selsect_projector.value=value + } return { + currently_selected_projector, + name_to_be_deleted, + dialog_del_scenes, + get_scenes, + del_scenes, + filterFn, + setModel, + send_disable_blending_params, + disable_blending_params, + send_show_blending_grids, + show_blending_grids, + clear, show_dialog, options, copyToClipboard, showDialog, EnableBlending, + config, + save, + resetall, + medium, + save_name, + save_cover_name, + plan_list, + select_configuration, + select_configuration_name, + apply_the_selected_configuration, + plan_list_op, + record_times, + saveconfig, + isdebug, + del_dialog, + child }; }, }); diff --git a/src/components/SystemSettingDialog.vue b/src/components/SystemSettingDialog.vue index 025bde4..1744ea3 100644 --- a/src/components/SystemSettingDialog.vue +++ b/src/components/SystemSettingDialog.vue @@ -61,10 +61,11 @@ /> - {{ $t("output type") }}: diff --git a/src/entities/DensityCorrection.ts b/src/entities/DensityCorrection.ts new file mode 100644 index 0000000..2b43f5c --- /dev/null +++ b/src/entities/DensityCorrection.ts @@ -0,0 +1,7 @@ +export default class DensityCorrection { + control_point = 0; + x = 0; + y = 0; + def_x = 0; + def_y = 0; +} diff --git a/src/entities/DensityCorrectionPoint.ts b/src/entities/DensityCorrectionPoint.ts new file mode 100644 index 0000000..6c1cf6b --- /dev/null +++ b/src/entities/DensityCorrectionPoint.ts @@ -0,0 +1,7 @@ +export default class DensityCorrectionPoint { + control_point = 0; + x = 0; + y = 0; + def_x = 0; + def_y = 0; +} diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index 54f1711..93a0267 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -521,6 +521,33 @@ 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"; + } + public static get kResetBlending() { + return Commands.PROTOCOL_PREFIX + "ResetBlending"; + } + public static get kSetBlendingOption() { + return Commands.PROTOCOL_PREFIX + "SetBlendingOption"; + } + public static get kEnumBlendingScene() { + return Commands.PROTOCOL_PREFIX + "EnumBlendingScene"; + } + public static get kApplyBlendingScene() { + return Commands.PROTOCOL_PREFIX + "ApplyBlendingScene"; + } + public static get kDeleteBlendingScene() { + return Commands.PROTOCOL_PREFIX + "DeleteBlendingScene"; + } + public static get kAddBlendingCtrlPoint() { + return Commands.PROTOCOL_PREFIX + "AddBlendingCtrlPoint"; + } + public static get kDelBlendingCtrlPoint() { + return Commands.PROTOCOL_PREFIX + "DelBlendingCtrlPoint"; + } public static get kRpcFileManagerGetFileList() { return Commands.PROTOCOL_PREFIX + "RpcFileManagerGetFileList"; } @@ -665,6 +692,15 @@ export namespace Protocol { Commands.kSetBlendingOverlap, Commands.kGetBlendingConfig, Commands.kSaveBlendingConfig, + Commands.kSetBlendingHorDensity, + Commands.kSetBlendingVerDensity, + Commands.kResetBlending, + Commands.kSetBlendingOption, + Commands.kEnumBlendingScene, + Commands.kApplyBlendingScene, + Commands.kDeleteBlendingScene, + Commands.kAddBlendingCtrlPoint, + Commands.kDelBlendingCtrlPoint, Commands.kRpcSetMagicWallGridState, Commands.kRpcGetMagicWallGridState, Commands.kRpcFileManagerGetFileList, @@ -3204,7 +3240,7 @@ export namespace Protocol { } export class RpcGetMagicWallGridStateRequestEntity extends PacketEntity { - constructor( rpc_id = 0) { + constructor(rpc_id = 0) { super(); super.command = Commands.kRpcGetMagicWallGridState; super.flag = PacketEntity.FLAG_REQUEST; @@ -3230,7 +3266,6 @@ export namespace Protocol { } } - export class RpcTestARequestEntity extends PacketEntity { constructor( x: number, @@ -3275,12 +3310,22 @@ export namespace Protocol { lb_l = 0; } + export class RpcBlendingResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + + success = false; + } + /** */ export class SetBlendingCorrectionRequestEntity extends PacketEntity { constructor( row: number, column: number, correction_type: number, + control_point_count: number, control_point: number, x: number, y: number, @@ -3296,11 +3341,13 @@ export namespace Protocol { this.row = row ?? 0; this.column = column ?? 0; this.correction_type = correction_type ?? 0; + this.control_point_count = control_point_count ?? 0; this.control_point = control_point ?? 0; } row = 0; column = 0; correction_type = 0; //4:四点校正,9:曲面校正 + control_point_count = 0; control_point = 0; //控制点编号,1开始,从上到下从左到右 x = 0; y = 0; @@ -3458,108 +3505,279 @@ export namespace Protocol { } name = ""; } - export class RpcFileManagerGetFileListRequest extends PacketEntity{ - dir_path:string="" - constructor(dir_path:string,rpc_id = 0) { + + export class SetBlendingHorDensityRequestEntity extends PacketEntity { + constructor( + row: number, + column: number, + control_point_count: 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_count = control_point_count ?? 0; + this.control_point = control_point ?? 0; + this.value = value ?? 0; + } + row = 0; + column = 0; + control_point_count = 0; + control_point = 0; //控制点编号,1开始,从上到下从左到右 + value = 0; + } + + export class SetBlendingVerDensityRequestEntity extends PacketEntity { + constructor( + row: number, + column: number, + control_point_count: 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_count = control_point_count ?? 0; + this.control_point = control_point ?? 0; + this.value = value ?? 0; + } + row = 0; + column = 0; + control_point_count = 0; + control_point = 0; //控制点编号,1开始,从上到下从左到右 + value = 0; + } + + export class ResetBlendingConfigRequestEntity extends PacketEntity { + constructor(rpc_id = 0) { + super(); + super.command = Commands.kResetBlending; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + } + } + + export class SetBlendingOptionRequestEntity extends PacketEntity { + constructor(id: string, value: string, rpc_id = 0) { + super(); + super.command = Commands.kSetBlendingOption; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.id = id ?? ""; + this.value = value ?? ""; + } + id; + value; + } + + export class EnumBlendingSceneResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + + scenes = []; + } + + export class EnumBlendingSceneRequestEntity extends PacketEntity { + constructor(rpc_id = 0) { + super(); + super.command = Commands.kEnumBlendingScene; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + } + } + + export class ApplyBlendingSceneRequestEntity extends PacketEntity { + constructor(name: string, rpc_id = 0) { + super(); + super.command = Commands.kApplyBlendingScene; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.name = name ?? ""; + } + name; + } + + export class DeleteBlendingSceneRequestEntity extends PacketEntity { + constructor(name: string, rpc_id = 0) { + super(); + super.command = Commands.kDeleteBlendingScene; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.name = name ?? ""; + } + name; + } + + export class AddBlendingCtrlPointRequestEntity extends PacketEntity { + constructor( + type: string, + row: number, + column: number, + count: number, + rpc_id = 0 + ) { + super(); + super.command = Commands.kAddBlendingCtrlPoint; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.type = type ?? ""; + this.row = row ?? 0; + this.column = column ?? 0; + this.count = count ?? 0; + } + type; //ver_density:垂直疏密,hor_density:水平疏密,9:曲面 + row = 0; + column = 0; + count = 0; //控制点数量 + } + + export class DelBlendingCtrlPointRequestEntity extends PacketEntity { + constructor( + type: string, + row: number, + column: number, + count: number, + rpc_id = 0 + ) { + super(); + super.command = Commands.kDelBlendingCtrlPoint; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.type = type ?? ""; + this.row = row ?? 0; + this.column = column ?? 0; + this.count = count ?? 0; + } + type; //ver_density:垂直疏密,hor_density:水平疏密,9:曲面 + row = 0; + column = 0; + count = 0; //控制点数量 + } + export class RpcFileManagerGetFileListRequest extends PacketEntity { + dir_path: string = ""; + constructor(dir_path: string, rpc_id = 0) { super(); super.command = Commands.kRpcFileManagerGetFileList; super.flag = PacketEntity.FLAG_REQUEST; super.rpc_id = rpc_id; - this.dir_path=dir_path + this.dir_path = dir_path; } } - export class RpcFileManagerGetFileListResponse extends PacketEntity{ + export class RpcFileManagerGetFileListResponse extends PacketEntity { constructor() { super(); super.flag = PacketEntity.FLAG_RESPONSE; } - error_code=0; + error_code = 0; success = false; - error_message="" - free=0; - files:FileEntry[]=[] + error_message = ""; + free = 0; + files: FileEntry[] = []; } - export class RpcFileManagerRenameRequest extends PacketEntity{ - constructor(base_dir:string,file_name:string,new_file_name:string,rpc_id = 0) { + export class RpcFileManagerRenameRequest extends PacketEntity { + constructor( + base_dir: string, + file_name: string, + new_file_name: string, + rpc_id = 0 + ) { super(); super.command = Commands.kRpcFileManagerRename; super.flag = PacketEntity.FLAG_REQUEST; super.rpc_id = rpc_id; - this.base_dir=base_dir - this.file_name=file_name - this.new_file_name=new_file_name + this.base_dir = base_dir; + this.file_name = file_name; + this.new_file_name = new_file_name; } - base_dir="" - file_name="" - new_file_name="" + base_dir = ""; + file_name = ""; + new_file_name = ""; } - export class RpcFileManagerRenameResponse extends PacketEntity{ + export class RpcFileManagerRenameResponse extends PacketEntity { constructor() { super(); super.flag = PacketEntity.FLAG_RESPONSE; } success = false; - error_code=0; - error_message="" + error_code = 0; + error_message = ""; } - export class RpcFileManagerDeleteRequest extends PacketEntity{ - constructor(base_dir:string,file_name:string,rpc_id = 0) { + export class RpcFileManagerDeleteRequest extends PacketEntity { + constructor(base_dir: string, file_name: string, rpc_id = 0) { super(); super.command = Commands.kRpcFileManagerDelete; super.flag = PacketEntity.FLAG_REQUEST; super.rpc_id = rpc_id; - this.base_dir=base_dir - this.file_name=file_name + this.base_dir = base_dir; + this.file_name = file_name; } - base_dir="" - file_name="" + base_dir = ""; + file_name = ""; } - export class RpcFileManagerDeleteResponse extends PacketEntity{ + export class RpcFileManagerDeleteResponse extends PacketEntity { constructor() { super(); super.flag = PacketEntity.FLAG_RESPONSE; } success = false; - delete_count="" - error_code=0; - error_message="" + delete_count = ""; + error_code = 0; + error_message = ""; } - export class RpcFileManagerCreateDirectoryRequest extends PacketEntity{ - constructor(base_dir:string,dir_name:string,rpc_id = 0) { + export class RpcFileManagerCreateDirectoryRequest extends PacketEntity { + constructor(base_dir: string, dir_name: string, rpc_id = 0) { super(); super.command = Commands.kRpcFileManagerCreateDirectory; super.flag = PacketEntity.FLAG_REQUEST; super.rpc_id = rpc_id; - this.base_dir=base_dir - this.dir_name=dir_name + this.base_dir = base_dir; + this.dir_name = dir_name; } - base_dir="" - dir_name="" + base_dir = ""; + dir_name = ""; } - export class RpcFileManagerCreateDirectoryResponse extends PacketEntity{ + export class RpcFileManagerCreateDirectoryResponse extends PacketEntity { constructor() { super(); super.flag = PacketEntity.FLAG_RESPONSE; } success = false; - error_message="" - error_code=0; + error_message = ""; + error_code = 0; } - export class RpcCheckModeIndexRequestEntity extends PacketEntity{ - constructor(mode_index:number,rpc_id = 0) { + export class RpcCheckModeIndexRequestEntity extends PacketEntity { + constructor(mode_index: number, rpc_id = 0) { super(); super.command = Commands.kRpcCheckModeIndex; super.flag = PacketEntity.FLAG_REQUEST; - this.mode_index=mode_index + this.mode_index = mode_index; } mode_index = 0; } - export class RpcCheckModeIndexResponseEntity extends PacketEntity{ + export class RpcCheckModeIndexResponseEntity extends PacketEntity { constructor() { super(); super.flag = PacketEntity.FLAG_RESPONSE; } success = false; - } } diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index fcb4bb0..27d0656 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -294,7 +294,7 @@ export default { "open left tool bar": "Open Left Tool Bar", "open right tool bar": "Open Right Tool Bar", fail: " Fail", - finish:"Finish", + finish: "Finish", "edit group": "Edit Group", "open window": "Open Window", "close all windows": "Close All Windows", @@ -407,8 +407,8 @@ export default { "Please input vaild host. example: 192.168.1.1 or 192.168.1.1:8080": "Please Input Vaild Host. Example: 192.168.1.1 or 192.168.1.1:8080", "equipment data": "Equipment Data", - "fusion":"Fusion", - "fusion settings": "fusion settings", + fusion: "Fusion", + "fusion settings": "Fusion Settings", FusionLocale: "Fusion Locale", FourPointCalibration: "Four Pint Calibration", SurfaceCorrection: "Surface Correction", @@ -416,7 +416,7 @@ export default { GridSettings: "Grid Settings", point: "dot", reset: "reset", - "upper fusion zone parameters": "upper fusion zone parameters", + "upper fusion zone parameters": "Upper Fusion Zone Parameters", "Left fusion Band Parameters": "Left Fusion Band Parameters", "Lower fusion Zone Parameters": "Lower Fusion Zone Parameters", "Right fusion Band Parameters": "Right Fusion Band Parameters", @@ -426,8 +426,49 @@ export default { "Set Fusion Band Parameters": "Set Fusion Band Parameters", Projector: "Projector", resetall: "reset all", - "save config": "save config", - "Whether to enable mixing": "Whether to enable mixing", + "save config": "Save Config", + "Whether to enable integration": "Whether to enable integration", + "Whether to hide the desktop": "Whether to hide the desktop", + "resetall config": "resetall config", + "disable blending params": "Dsable blending params", + "show blending grids": "Show Grids", + "line color": "Line Color", + "center line color": "center line color", + "center circle color": "center circle color", + "Whether to operate synchronously": "Whether to operate synchronously", + "Select saved configuration": "Select saved Configuration", + "read saved configuration": "read saved configuration", + "please choose": "please choose", + save: "Save", + "Whether to save the configuration": "Whether to save the configuration", + "New Please enter a name": "New Please enter a name", + "Please select an override": "Please select an override", + "confirm delete": "confirm delete", + "delete or not": "delete or not", + debugging: "Debugging", + disable_blending: "disable blending", + disable_clip: "disable clip", + show_mask: "hide desktop", + save_bmp: "save bmp", + disable_blending_params: "disable blending params", + "Please enter a value within the range": + "Please enter a value within the range", + "vertical correction": "vertical correction", + "horizontal correction": "horizontal correction", + "line width": "line width", + level: "level", + vertical: "vertical", + "auxiliary lines": "auxiliary lines", + "level point": "level point amount", + "vertical point ": "vertical point amount", + "point amount": "point amount", + "add control points": "add control points", + "reduce control points": "delete control points", + "OK to delete you will lose the data you adjusted now": + "OK to delete you will lose the data you adjusted now", + "Please enter the points you need to add": + "Please enter the points you need to add", + "Whether to add control points": "Whether to add control points", "device verify key": "Device Verify Key", "use wss": "Use Wss", "server address": "Server Address", @@ -445,6 +486,6 @@ export default { resize: "Resize", "export magic": "Export", "raster graph": "Raster Graph", - "the folder name cannot start with a '.'":"The Folder Name Cannot Start With a '.'", - + "the folder name cannot start with a '.'": + "The Folder Name Cannot Start With a '.'", }; diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index d39045e..38f419d 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -5,7 +5,7 @@ export default { " ": "", title: "MediaPlayerWebApp", failed: "失败", - finish:"完成", + finish: "完成", fail: "失败", error: "错误", Confirm: "确认", @@ -675,7 +675,7 @@ export default { "Please input vaild host. example: 192.168.1.1 or 192.168.1.1:8080": "请输入合法地址. 例: 192.168.1.1 或 192.168.1.1:8080", "equipment data": "联动设备", - "fusion":"融合", + fusion: "融合", "fusion settings": "融合设置", FusionLocale: "融合区域设置", FourPointCalibration: "四点校正", @@ -695,7 +695,46 @@ export default { Projector: "投影机", resetall: "重置所有", "save config": "保存配置", - "Whether to enable mixing": "是否启用混合", + "Whether to enable integration": "是否启用融合", + "Whether to hide the desktop": "是否隐藏桌面", + "resetall config": "重置所有配置", + "disable blending params": "禁用融合参数", + "show blending grids": "显示网格", + "line color": "线条颜色", + "center line color": "中心线颜色", + "center circle color": "中心圆颜色", + "Whether to operate synchronously": "是否同步操作", + "Select saved configuration": "选择保存的配置", + "read saved configuration": "读取保存的配置", + "please choose": "请选择", + save: "保存", + "Whether to save the configuration": "是否保存配置", + "New Please enter a name": "新建 请输入名称", + "Please select an override": "请选择覆盖", + "confirm delete": "确定删除", + "Whether to delete": "是否删除", + debugging: "调试", + disable_blending: "禁用混合", + disable_clip: "禁用裁剪", + show_mask: "隐藏桌面", + save_bmp: "保存BMP", + disable_blending_params: "禁用融合参数", + "Please enter a value within the range": "请输入范围内的值", + "vertical correction": "垂直校正", + "horizontal correction": "水平校正", + "line width": "线宽", + level: "水平", + vertical: "垂直", + "auxiliary lines": "辅助线", + "level point": "水平点数量", + "vertical point": "垂直点数量", + "point amount": "点数量", + "add control points": "增加", + "reduce control points": "删除", + "OK to delete you will lose the data you adjusted now": + "确定删除你将失去现在调整的数据", + "Please enter the points you need to add": "请输入你所需要添加的点数", + "Whether to add control points": "是否添加控制点", "device verify key": "设备校验码", "use wss": "使用Wss", "server address": "服务器地址", @@ -713,5 +752,5 @@ export default { resize: "缩放", "export magic": "导出", "raster graph": "栅格图", - "the folder name cannot start with a '.'":"文件夹名称不能以“.” 开头", + "the folder name cannot start with a '.'": "文件夹名称不能以“.” 开头", }; diff --git a/src/pages/TopToolBar.vue b/src/pages/TopToolBar.vue index 100000c..8b12819 100644 --- a/src/pages/TopToolBar.vue +++ b/src/pages/TopToolBar.vue @@ -620,6 +620,8 @@ export default defineComponent({ let $q = useQuasar(); let $t = useI18n(); + let set = GlobalData.getInstance().getCurrentClient(); + let show_advanced_menu = ref(true); const edge_blending_dialog: Ref = ref(null); const register_dialog: Ref = ref(null); @@ -646,6 +648,16 @@ export default defineComponent({ let sulv: any = 1 - wendu / 150; return "rotate " + sulv + "s linear infinite"; }); + const getconfig = () => { + try { + set?.GetBlendingConfig("").then((res) => {}); + set?.GetBlendingConfig("").then((res) => { + let tmp = JSON.parse(res ? res.config : ""); + $store.commit("setEnablefusion", tmp.enable); + $store.commit("setfusion_configuration", res?.config); + }); + } catch (error) {} + }; const checkRegistered = () => { if ( GlobalData.getInstance().getCurrentClient()?.is_connected && @@ -715,6 +727,7 @@ export default defineComponent({ isfan.value = false; } return { + getconfig, show_advanced_menu, plan_running, edge_blending_dialog, diff --git a/src/store/index.ts b/src/store/index.ts index ef74c5e..fd7e98c 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -73,7 +73,6 @@ class test_monitor { this.id = id; this.w = w; this.h = h; - } } export interface StateInterface { @@ -115,14 +114,14 @@ export interface StateInterface { product_name: string; show_monitor_list: test_monitor[]; custom_defines: CustomDefines; - fusion_configuration: object; + fusion_configuration: string; isLedPlayer: () => boolean; isSpecialVideo: () => boolean; $wujie: IWuJieInterface | null; // selected_projector: string; - EnableBlending: boolean; + enablefusion: boolean; } // provide typings for `this.$store` @@ -380,12 +379,12 @@ export default store(function (/* { ssrContext } */) { landspace: window.innerWidth > window.innerHeight, device_attribute: 0, power_state: false, - fusion_configuration: {}, + fusion_configuration: "", product_name: EProductNames.LED_PLAYER, show_monitor_list: [], custom_defines: new CustomDefines(), selected_projector: "0/0", - EnableBlending: false, + enablefusion: false, isLedPlayer: () => { return ( Store.state.product_name == EProductNames.LED_PLAYER || @@ -404,7 +403,7 @@ export default store(function (/* { ssrContext } */) { state.initialized = true; }, setShowMonitorList(state: StateInterface, playload?: any) { - state.show_monitor_list = playload + state.show_monitor_list = playload; }, updateLandspace(state: StateInterface, playload?: any) { if (typeof playload == "boolean") { @@ -516,7 +515,7 @@ export default store(function (/* { ssrContext } */) { Math.round(Math.random() * window_color_list.length), 1 )[0]; - } catch { } + } catch {} } } } @@ -537,7 +536,7 @@ export default store(function (/* { ssrContext } */) { Math.round(Math.random() * window_color_list.length - 1), 1 )[0]; - } catch { } + } catch {} state.windows.push(playload); state.windows_sort.push(playload.uuid); } @@ -642,7 +641,7 @@ export default store(function (/* { ssrContext } */) { setDeviceScreenConnectState(state: StateInterface, playload?: any) { try { state.device_screen_connect_state = JSON.parse(playload); - } catch { } + } catch {} }, // signal source setSignalSourceTree( @@ -656,8 +655,8 @@ export default store(function (/* { ssrContext } */) { setSelectedProjector(state: StateInterface, playload?: any) { state.selected_projector = playload; }, - setEnableBlending(state: StateInterface, playload?: any) { - state.EnableBlending = playload; + setEnablefusion(state: StateInterface, playload?: any) { + state.enablefusion = playload; }, clearSignalSourceTree(state: StateInterface, playload?: any) { state.signal_source_tree = []; @@ -1051,6 +1050,9 @@ export default store(function (/* { ssrContext } */) { setWuJie(state: StateInterface, playload?: any) { state.$wujie = playload; }, + setfusion_configuration(state: StateInterface, playload?: any) { + state.fusion_configuration = playload; + }, }, getters: { GetTheCurrentlySelectedCamera(state) { diff --git a/yarn.lock b/yarn.lock index 9bbe78b..3d1f613 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1403,10 +1403,10 @@ selfsigned "^2.0.0" update-notifier "^6.0.2" -"@quasar/extras@^1.15.10": - version "1.15.10" - resolved "https://registry.npmmirror.com/@quasar/extras/-/extras-1.15.10.tgz#515298377249765f9ca0027f6843f6a8e61efcd8" - integrity sha512-6w8e+wPNfcWhzW43tlnJPHOrcNwAgaaNJ3zBz8k+BMqpenA3fHZhFhxCYEVRZVqPFE2IK/8nRiPBp4t9xlW5tA== +"@quasar/extras@^1.15.11": + version "1.15.11" + resolved "https://registry.npmmirror.com/@quasar/extras/-/extras-1.15.11.tgz#a54d60b14446b850a1e5fccab3f381a2e447a73f" + integrity sha512-EEXL10EJQmL9jNs5fp0Kd/nyonG8hTODolj+qpYNPG3qEEoy3txr05Pdmp9qJYaXIzP9rOS9FGhFe9Mnq6MBBg== "@quasar/fastclick@1.1.5": version "1.1.5" @@ -8319,10 +8319,10 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" -quasar@^2.11.5: - version "2.11.5" - resolved "https://registry.npmmirror.com/quasar/-/quasar-2.11.5.tgz#c8a74c8f7bf24b16cdf51f1257df1a38b68fdfb8" - integrity sha512-rX4Rwp9wlCeB9A6RQUxEx/q84LMBVVm6WTECkoq8r/+NBgl9aHVexzZQBnRn2i61D0BJpdX5VcnMxAnJkTx/kA== +quasar@^2.11.6: + version "2.11.6" + resolved "https://registry.npmmirror.com/quasar/-/quasar-2.11.6.tgz#9d200a0de44dc235915fee3ea3ff5673045fdcbc" + integrity sha512-jJniWqTtfLHDuAT1YNx6ZZdZU7nM8vwscyM7IxmijaHq+fDpgjaujDQUlJWgn5ZMkqe3Yvg93MgSxjcL71oJIw== question-cache@^0.4.0: version "0.4.0" @@ -10300,6 +10300,11 @@ vue-style-loader@4.1.3: hash-sum "^1.0.2" loader-utils "^1.0.2" +vue3-draggable-resizable@^1.6.5: + version "1.6.5" + resolved "https://registry.npmmirror.com/vue3-draggable-resizable/-/vue3-draggable-resizable-1.6.5.tgz#021b2c00bff2885ab4fa5981e03bf4f56f12cdac" + integrity sha512-31142E31fGNnq3HKqvmFLSsqIbhck7TyGuQWhUKrDw6DOcGAuRx4ddRjaxvT6fe7dgeKH53qAh+i0ZlWtPLl2g== + vue@^3.0.0: version "3.2.45" resolved "https://registry.npmmirror.com/vue/-/vue-3.2.45.tgz#94a116784447eb7dbd892167784619fef379b3c8"