diff --git a/src/translations/Dyt_zh_CN.qm b/src/translations/Dyt_zh_CN.qm index 04a95a6b..b826ef6d 100644 Binary files a/src/translations/Dyt_zh_CN.qm and b/src/translations/Dyt_zh_CN.qm differ diff --git a/src/translations/Dyt_zh_CN.ts b/src/translations/Dyt_zh_CN.ts index 59f479bf..1ae2d029 100644 --- a/src/translations/Dyt_zh_CN.ts +++ b/src/translations/Dyt_zh_CN.ts @@ -7,213 +7,213 @@ Add Curve Data File - + 新增曲线图表 File Selection - + 文件选择 File Path: - + 文件路径: Select curve data file... - + 选择数据文件... ... - + File Name: - + 文件名称: - - + File Size: - + 文件大小: Chart Properties - + 图表属性 Chart Name: - + 图表名称: Chart 1 - + 图表1 Enter chart name... - + 输入图表名称... Chart Type: - + 图表类型: X Axis Title: - + X轴标题: Enter X axis title... - + 输入X轴标题... Y Axis Title: - + Y轴标题: Enter Y axis title... - + 输入Y轴标题... Time: - + 时间列: Axis Range Settings - + 轴设置 X Tick Count: - + X轴间隔数目: X Min: - + X轴最小值: Y Max: - + Y轴最大值: Y Min: - + Y轴最小值: X Max: - + X轴最大值: Y Tick Count: - + Y轴间隔数目: Curve Management - + 曲线管理 Curves: - + 曲线 Add Curve - + 添加 Remove - + 删除 Selected Curve Properties - + 曲线属性 Curve Name: - + 曲线名称: Enter curve name... - + 输入曲线名称... Curve Color: - + 曲线颜色: Select Color - + 选择颜色 background-color: rgb(255, 0, 0); border: 1px solid black; - + Data Start: - + 数据开始列: Data Stop: - + 数据结束列: X Value: - + X值数据列: Y Value: - + Y值数据列: Add File - + 确定 Cancel - + 取消 Curve %1 - + @@ -238,159 +238,159 @@ Validation Error - + 验证错误 Please select a data file. - + 请选择一个数据文件。 Selected file does not exist. - + 所选文件不存在。 Selected file is not readable. Please check file permissions. - + 所选文件不可读,请检查文件权限。 File is too large (over 100MB). Please select a smaller file. - + 文件太大(超过100MB),请选择一个较小的文件。 At least one curve must be defined. - + 必须至少定义一条曲线。 Curve %1 name cannot be empty. - + 曲线%1名称不能为空。 Curve name '%1' is duplicated. Please use different names. - + 曲线名称“%1”重复,请使用不同的名称。 Curve name '%1' is too long. Please limit to 50 characters. - + 曲线名称“%1”太长,请限制为50个字符。 Curve '%1' start and stop values must be greater than 0. - + 曲线“%1”的开始值和结束值必须大于0。 Curve '%1' start value cannot be greater than stop value. - + 曲线“%1”的起始值不能大于结束值。 Curve '%1' data range is too small. At least 2 data points are required. - + 曲线“%1”的数据范围太小,至少需要2个数据点。 Curve '%1' stop value is too large. Please ensure it does not exceed 1000000. - + 曲线“%1”的结束值太大,请确保它不超过1000000。 Curve '%1' X value is out of range. Please ensure it is between -1000000 and 1000000. - + 曲线“%1”的X列超出范围,请确保它在-1000000到1000000之间。 Curve '%1' Y value is out of range. Please ensure it is between -1000000 and 1000000. - + 曲线“%1”的Y列超出范围,请确保它在-1000000到1000000之间。 Chart name cannot be empty. - + 图表名称不能为空。 Chart name is too long. Please limit to 100 characters. - + 图表名称太长,请限制为100个字符。 X axis title is too long. Please limit to 50 characters. - + X轴标题太长,请限制为50个字符。 Y axis title is too long. Please limit to 50 characters. - + Y轴标题太长,请限制为50个字符。 X axis minimum value must be less than maximum value. - + X轴最小值必须小于最大值。 Y axis minimum value must be less than maximum value. - + Y轴最小值必须小于最大值。 Time parameter cannot be negative. - + 时间参数不能为负。 Data Files (*.txt *.csv *.dat);;All Files (*.*) - + 数据文件(*.txt*.csv*.dat);;所有文件(*.*) Error - + 错误 Failed to create file entry - + 创建文件条目失败。 Unable to get current workspace - + 无法获取当前工作区间。 Curve file count has reached the limit (9 files) - + 曲线文件数已达到限制(9个文件) File already exists - + 文件已存在 File copy failed - + 文件复制失败 Invalid file - + 无效文件 Failed to add file - + 添加文件失败 @@ -398,360 +398,302 @@ Add Image - + 新增图片图表 - File Selection - + Curve Management + 图片管理 - - File Path: - + + Curves: + 图片 - - Select curve data file... - + + Add + 添加 - - ... - + + Remove + 删除 - - File Name: - + + Selected Curve Properties + 图片属性 - - - - - + + Names: + 名称: - - File Size: - + + Enter image names (comma separated)... + 输入图像名称(逗号分隔)... - - Angular Axis - + + Datas: + 数据: - - - Title: - + + Enter data values (comma separated integers)... + 输入数据值(逗号分隔的整数)... - - - Enter axis title... - + + Path: + 路径: - - - Min: - - - - - - Max: - + + Select data path... + 选择数据路径... - - Count: - + + ... + - - - Unit: - + + Suffix: + 后缀: - - - Enter axis Unit... - + + png + - - Radial Axis - + + Enter data suffix... + 输入数据后缀... - - Curve Management - + + Row Index: + 行编号: - - Curves: - + + + + - + - - Add - + + File Selection + 文件选择 - - Remove - + + File Path: + 文件路径: - - Selected Curve Properties - + + Select curve data file... + 选择数据文件... - - Name: - + + File Name: + 文件名称: - - Enter curve name... - + + File Size: + 文件大小: - - Color: - - - - - Select Color - - - - - background-color: rgb(255, 0, 0); border: 1px solid black; - - - - - Angular: - - - - - Radial: - - - - - X Value: - - - - - Y Value: - - - - + Add File - + 确定 - + Cancel - + 取消 - + Chart Properties - + 图表属性 - + Time: - + 时间列: - + Chart Name: - + 图表名称: - + Chart 1 - + 图表1 - + Enter chart name... - + 输入图表名称... AddImageFileDlg - + Data Files (*.txt *.csv *.dat);;All Files (*.*) - + 数据文件(*.txt*.csv*.dat);;所有文件(*.*) - + Add Image - + 新增图片图表 - - - - - - - - - - - - - - - + + + + + + + + + + + + Validation Error - + 验证错误 - + Please select a data file. - + 请选择一个数据文件。 - + Selected file does not exist. - + 所选文件不存在。 - + Selected file is not readable. Please check file permissions. - + 所选文件不可读,请检查文件权限。 - + File is too large (over 100MB). Please select a smaller file. - + 文件太大(超过100MB),请选择一个较小的文件。 - + At least one curve must be defined. - + 必须至少定义一条数据。 - - Curve %1 name cannot be empty. - + + Image %1 name cannot be empty. + 图像%1名称不能为空。 - - Curve name '%1' is duplicated. Please use different names. - + + Image %1 data cannot be empty. + 图像%1数据不能为空。 - - Curve name '%1' is too long. Please limit to 50 characters. - + + Image %1 name does not match data. + 图像%1名称不能匹配数据。 - - Curve '%1' X value is out of range. Please ensure it is between -1000000 and 1000000. - + + Image %1 suffix cannot be empty. + 图像%1后缀不能为空。 - - Curve '%1' Y value is out of range. Please ensure it is between -1000000 and 1000000. - - - - + Chart name cannot be empty. - + 图表名称不能为空。 - + Chart name is too long. Please limit to 100 characters. - + 图表名称太长,请限制为100个字符。 - - Angular axis minimum value must be less than maximum value. - - - - - Radial axis minimum value must be less than maximum value. - - - - + Time parameter cannot be negative. - + 时间参数不能为负。 - - Curve %1 - + + Image %1 + 图像%1 - - - - + + + + Error - + 错误 - + Failed to create file entry - + 创建文件条目失败。 - + Unable to get current workspace - + 无法获取当前工作区间。 - - Polar file count has reached the limit (9 files) - + + Image file count has reached the limit (9 files) + 文件数已达到限制(9个文件) - + File already exists - + 文件已存在 - + File copy failed - + 文件复制失败 - + Invalid file - + 无效文件 - + Failed to add file - + 添加文件失败 - - Failed to create Polar file entry. - + + Failed to create Image file entry. + 创建图像文件失败。 + + + + Select Image directory + 选择图像目录 @@ -760,211 +702,211 @@ Add Light Data File - + 新增信号灯图表 File Selection - + 文件选择 File Path: - + 文件路径: Select light data file... - + 选择数据文件... ... - + File Name: - + 文件名称: - - + File Size: - + 文件大小: Chart Properties - + 图表属性 Chart Name: - + 图表名称: Chart 1 - + 图表1 Time: - + 时间列: Color Properties - + 颜色属性 Open Color: - + 亮灯颜色: Select Color - + 选择颜色 background-color: rgb(0, 255, 0); border: 1px solid black; - + Close Color: - + 灭灯颜色: background-color: rgb(255, 0, 0); border: 1px solid black; - + Light Management - + 信号灯管理 Lights: - + 信号灯 Add Light Row - + 添加 Remove - + 删除 Selected Light Properties - + 信号灯属性 Light Names: - + 名称: Enter light names (comma separated)... - + 输入名称(逗号分隔)... Light Datas: - + 数据值: Enter data values (comma separated integers)... - + 输入数据值(逗号分隔的整数)... Edit Data - + Row Index: - + 行编号: Add File - + 确定 Cancel - + 取消 Light Data Files (*.txt *.csv *.dat);;All Files (*.*) - + 数据文件(*.txt*.csv*.dat);;所有文件(*.*) Warning - + 警告 Please enter a Chart name. - + 输入图表名称。 Error - + 错误 Unable to get current workspace - + 无法获取当前工作区间。 Curve file count has reached the limit (9 files) - + 文件数已达到限制(9个文件) File already exists - + 文件已存在 File copy failed - + 文件复制失败 Invalid file - + 无效文件 Failed to add file - + 添加文件失败 @@ -972,22 +914,22 @@ ParamSetting - + 参数设置 param - + 参数 input param descript - + 输入参数说明 input value - + 输入值 @@ -995,62 +937,62 @@ AddParamSetting - + 参数名称 - + 描述 - + 数据类型 - + 最大值 - + 最小值 - + 小数点有效位 - + 初始值 - + 数据输入示例 - + 添加 - + 删除 - + 应用 - + @@ -1058,200 +1000,190 @@ Add Polar - + 新增极坐标图表 File Selection - + 文件选择 File Path: - + 文件路径: Select curve data file... - + 选择数据文件... ... - + File Name: - + 文件名称: - - + File Size: - + 文件大小: Angular Axis - + 角度轴 Title: - + 标题: Enter axis title... - + 输入轴标题... Min: - + 最小值: Max: - + 最大值: Count: - + 间隔数目: Unit: - + 单位: Enter axis Unit... - + 输入轴单位... Radial Axis - + 径向轴 Curve Management - + 曲线管理 Curves: - + 曲线 Add - + 添加 Remove - + 删除 Selected Curve Properties - + 曲线属性 - - Name: - - - - - Enter curve name... - - - - - Color: - - - - + Select Color - + 选择颜色 - + background-color: rgb(255, 0, 0); border: 1px solid black; - + - + Angular: - + 角度: - + + Color: + 颜色: + + + + Enter curve name... + 输入曲线名称... + + + + Name: + 名称: + + + Radial: - + 径向: - - X Value: - - - - - Y Value: - - - - + Add File - + 确定 - + Cancel - + 取消 - + Chart Properties - + 图表属性 - + Time: - + 时间列: - + Chart Name: - + 图表名称: - + Chart 1 - + 图表1 - + Enter chart name... - + 输入图表名称... @@ -1259,12 +1191,12 @@ Data Files (*.txt *.csv *.dat);;All Files (*.*) - + 数据文件(*.txt*.csv*.dat);;所有文件(*.*) Add Polar - + 新增极坐标图表 @@ -1283,87 +1215,87 @@ Validation Error - + 验证错误 Please select a data file. - + 请选择一个数据文件。 Selected file does not exist. - + 所选文件不存在。 Selected file is not readable. Please check file permissions. - + 所选文件不可读,请检查文件权限。 File is too large (over 100MB). Please select a smaller file. - + 文件太大(超过100MB),请选择一个较小的文件。 At least one curve must be defined. - + 必须至少定义一条数据。 Curve %1 name cannot be empty. - + 曲线%1名称不能为空。 Curve name '%1' is duplicated. Please use different names. - + 曲线名称“%1”重复,请使用不同的名称。 Curve name '%1' is too long. Please limit to 50 characters. - + 曲线名称“%1”太长,请限制为50个字符。 Curve '%1' X value is out of range. Please ensure it is between -1000000 and 1000000. - + 曲线“%1”的X列超出范围,请确保它在-1000000到1000000之间。 Curve '%1' Y value is out of range. Please ensure it is between -1000000 and 1000000. - + 曲线“%1”的Y列超出范围,请确保它在-1000000到1000000之间。 Chart name cannot be empty. - + 图表名称不能为空。 Chart name is too long. Please limit to 100 characters. - + 图表名称太长,请限制为100个字符。 Angular axis minimum value must be less than maximum value. - + 角度轴最小值必须小于最大值。 Radial axis minimum value must be less than maximum value. - + 径向轴最小值必须小于最大值。 Time parameter cannot be negative. - + 时间参数不能为负。 Curve %1 - + 曲线%1 @@ -1371,47 +1303,47 @@ Error - + 错误 Failed to create file entry - + 创建文件条目失败。 Unable to get current workspace - + 无法获取当前工作区间。 Polar file count has reached the limit (9 files) - + 文件数已达到限制(9个文件) File already exists - + 文件已存在 File copy failed - + 文件复制失败 Invalid file - + 无效文件 Failed to add file - + 添加文件失败 Failed to create Polar file entry. - + 创建文件失败。 @@ -1419,290 +1351,290 @@ Add Surface File - + 新增曲面图表 File Selection - + 文件选择 Select surface data file... - + 选择数据文件... Browse... - + 浏览... Chart Properties - + 图表属性 X Axis Title: - + X轴标题: Y Axis Title: - + Y轴标题: Z Axis Title: - + Z轴标题: Time Parameter: - + 时间列: X Range: - + X轴范围: to - + X Count: - + X轴间隔数目: Y Range: - + Y轴范围: Y Count: - + Y轴间隔数目: Z Range: - + Z轴范围: Z Count: - + Z轴间隔数目: Name: - + 名称: Surface Management - + 曲面管理 Add Surface - + 添加 Remove - + 删除 Surface Properties - + 曲面属性 Color: - + 颜色: Select Color - + 选择颜色 Start Point: - + 数据开始列: End Point: - + 数据结束列: X-Map: - + X值映射: x - + y - + z - + Y-Map: - + Y值映射: Z-Map: - + Z值映射: Data Format Parameters - + X Column: - + Y Column: - + Z Column: - + Separator: - + , - + X Grid Size: - + Y Grid Size: - + Has Header Row - + Surface Data Files (*.txt *.dat *.csv);;All Files (*.*) - + 数据文件(*.txt*.csv*.dat);;所有文件(*.*) Add Surface Dialog - + 新增曲面图表 Warning - + 警告 Please add at least one surface. - + 必须至少定义一条数据。 Please fill in all axis titles. - + 请填写所有轴标题。 Select Surface Color - + 选择曲面颜色 Please enter a Surface name. - + 请输入曲面名称。 Error - + 错误 Failed to create surface file entry. - + 创建文件条目失败。 Unable to get current workspace - + 无法获取当前工作区间。 Surface file count has reached the limit (9 files) - + 文件数已达到限制(9个文件) File already exists - + 文件已存在 File copy failed - + 文件复制失败 Invalid file - + 无效文件 Failed to add file - + 添加文件失败 @@ -1711,193 +1643,193 @@ Add Table Data File - + 新增表格图表 File Selection - + 文件选择 File Path: - + 文件路径: Select table data file... - + 选择数据文件... ... - + File Name: - + 文件名称: - - + File Size: - + 文件大小: Basic Information - + 图表属性 Enter table name... - + 输入图表名称... Table Name: - + 图表名称: Time Parameter: - + 时间列: Table Headers Configuration - + 表头设置 File has header row - + Headers (comma-separated): - + 表头(逗号分隔): e.g., Time, Value1, Value2, Value3... - + Tip: Headers will be auto-detected if file has header row - + 提示:如果文件有标题行,将自动检测标题 Parsing Parameters - + Skip Rows: - + Auto-detect parameters - + Encoding: - + UTF-8 - + GBK - + ASCII - + ISO-8859-1 - + Curves Configuration - + Add Curve - + Remove Curve - + Curve Properties - + Name: - + Enter curve name... - + Color: - + Select Color - + Data: - + Enter data values (comma-separated)... - + Data values must match the number of headers - + Add File - + 确定 Cancel - + 取消 @@ -1907,127 +1839,89 @@ Warning - + 警告 Please configure table headers first. - + 请先配置表头。 Select Curve Color - + Please configure table headers. - + 请先配置表头。 Curve %1 name cannot be empty. - + Curve '%1' data cannot be empty. - + Curve '%1' data count (%2) doesn't match headers count (%3). - + Table Files (*.txt *.csv *.tsv *.dat);;All Files (*.*) - + 数据文件(*.txt*.csv*.dat);;所有文件(*.*) Please enter a table name. - + 请输入表格名称。 Error - + 错误 Failed to create table file entry. - + 创建文件条目失败。 Unable to get current workspace - + 无法获取当前工作区间。 Table file count has reached the limit - + 文件数已达到限制 File already exists - + 文件已存在 File copy failed - + 文件复制失败 Invalid file - + 无效文件 Failed to add file - - - - - ChartPlotMenuClass - - - ChartPlotMenu - - - - - Wave文件 - - - - - Report文件 - - - - - RD文件 - - - - - Matlab文件 - - - - - Lamp文件 - - - - - Run Simu - + 添加文件失败 @@ -2035,7 +1929,7 @@ CodeEdtUI - + @@ -2043,17 +1937,17 @@ 2D Curve - + 2D(lg) Curve - + 3D Curve - + @@ -2061,44 +1955,44 @@ Form - + x轴 - + 选择数据列 - + y轴 - + z轴 - + 已添加的曲线 - + 曲线名称 - + 颜色 - + @@ -2106,67 +2000,67 @@ ... - + x轴标题 - + 绑定x轴数据 - + y轴标题 - + 绑定y轴数据 - + z轴标题 - + 绑定z轴数据 - + y轴数据类型 - + 一般 - + 对数 - + 删除 - + 更新 - + 添加 - + @@ -2174,7 +2068,7 @@ Dialog - + @@ -2182,7 +2076,7 @@ DialogTitleBar - + @@ -2190,54 +2084,54 @@ Added a window - + Central area - + Left area - + Upper area - + Right area - + Underneath the area - + delete Window - + Move down - + Move up - + add window - + @@ -2245,7 +2139,7 @@ DockTitleBar - + @@ -2253,7 +2147,7 @@ DynamicDisplayMenu - + @@ -2261,7 +2155,7 @@ ModelBrowserPannal - + @@ -2269,52 +2163,52 @@ FileManagerMenu - + new workspace - + 新建工作区间 open workspace - + 打开工作区间 save workspace - + 保存工作区间 new wave file - + 新建曲线图表 new surface file - + 新建曲面图表 new table file - + 新建表格图表 new light file - + 新建信号灯图表 new polar file - + 新建极坐标图表 new image file - + 新建图像图表 @@ -2322,7 +2216,7 @@ FitCurveChartView - + @@ -2330,7 +2224,7 @@ FitCurveDialog - + @@ -2338,22 +2232,22 @@ Frame - + default - + silver - + blue - + @@ -2361,35 +2255,35 @@ LayoutSettingUI - + MainFrame - + Dyt - + - + file manager - + 文件管理 - + simu manager - + 仿真管理 - + play manager - + 回放管理 - + system manager - + 系统管理 @@ -2397,88 +2291,88 @@ MainWindow - + model elements - + 模型元素 preset models - + 预制模型 attribte - + 属性 - + Main View - + 主视图 ModelTreeWidget - + Add boke Entity - + Add lsjhqt Entity - + Add nimizi Entity - + Add tkdlj Entity - + Add jiaofan Entity - + Add satellite Entity - + Release Track - + Track - + Add Label Component - + Add Mesh Component - + Add Path Component - + Delete @@ -2488,12 +2382,12 @@ warning - + 警告 open dyt file failed - + 打开dyt文件失败。 @@ -2501,7 +2395,7 @@ PlanManagerMenu - + @@ -2509,7 +2403,7 @@ PlayManagerMenu - + @@ -2517,37 +2411,37 @@ play - + 开始 stop - + 停止 000.000 - + 00000 - + x1 - + up - + 加速 down - + 减速 @@ -2559,7 +2453,7 @@ warning - + 警告 @@ -2570,19 +2464,19 @@ has not workspace - + 无法获取当前工作区间。 not timestep - + 没有时戳 pause - + 暂停 @@ -2590,7 +2484,7 @@ Preset Models - + @@ -2598,30 +2492,39 @@ attribute - + 属性 - + WorkSpace - + 工作区间 - - + + + + + + CurveEntry + + + + + Entity - + 实体 - + ModelBase - + 模型 - + color base - + 颜色 @@ -2629,12 +2532,12 @@ Open File - + 打开文件 All Files (*) - + 所有文件(*) @@ -2642,12 +2545,12 @@ Open File - + 打开文件 All Files (*) - + 所有文件(*) @@ -2655,38 +2558,38 @@ error - + 错误 the appliaction is crash - + 应用程序崩溃 longitude: - + 经度: latitude: - + 纬度: altitude: - + 高度: Open Workspace - + 打开工作区间 Dyt Files (*.dyt) - + Dyt文件(*.dyt) @@ -2697,7 +2600,7 @@ prompt - + 提示 @@ -2708,41 +2611,76 @@ please create workspace first - + 请先创建工作区间。 Save Workspace - + 保存工作区间 - - + + Curve[%1] - + - - + + Surface[%1] - + - - + + Table[%1] - + - - + + Light[%1] - + - + Polar[%1] - + + + + + Image[%1] + + + + + Curve[%1] Name + + + + + Curve[%1] Color + + + + + Curve[%1] WaveStart + + + + + Curve[%1] WaveStop + + + + + Curve[%1] ReportX + + + + + Curve[%1] ReportY + @@ -2752,13 +2690,13 @@ True - + False - + @@ -2766,12 +2704,12 @@ True - + False - + @@ -2779,7 +2717,7 @@ Clear Char - + @@ -2787,7 +2725,7 @@ ... - + @@ -2795,71 +2733,71 @@ Red - + Green - + Blue - + Alpha - + QtConeWaveComponentManager - - + + ConeWaveComponent - + - + Height - + - + Radius - + - + waveCount - + - + waveSpeed - + - + baseColor - + - + waveColor - + - + ringBrightAlpha - + - + ringDarkAlpha - + @@ -2867,126 +2805,195 @@ Arrow - + Up Arrow - + Cross - + Wait - + IBeam - + Size Vertical - + Size Horizontal - + Size Backslash - + Size Slash - + Size All - + Blank - + Split Vertical - + Split Horizontal - + Pointing Hand - + Forbidden - + Open Hand - + Closed Hand - + What's This - + Busy + + + + + QtCurveEntryPropertyManager + + + + Curve[%1] Name + + + + + + Curve[%1] Color + + + + + + Curve[%1] WaveStart + + + + + + Curve[%1] WaveStop + + + + + + Curve[%1] ReportX + + + + + + Curve[%1] ReportY + + + + + Name + + + + + ChartType + + + + + Wave + + + + + Report + + + + + Curves + + + + + Count QtDashedLineComponentManager - - + + DashedLineComponent - + - + Start - + - + End - + - + Radius - + - + Color - + @@ -2994,25 +3001,25 @@ ... - + QtEntityPropertyManager - + Name - + 名称 - + Visible - + 显示 - + Transform - + 变换 @@ -3020,12 +3027,12 @@ ... - + Select Font - + 选择字体 @@ -3033,37 +3040,37 @@ Family - + Point Size - + Bold - + Italic - + Underline - + Strikeout - + Kerning - + @@ -3071,36 +3078,36 @@ <Invalid> - + %1, %2 - + Language - + Country - + QtMeshComponetManager - - + + MeshComponent - + 网格体组件 - + Mesh - + 网格体 @@ -3136,26 +3143,26 @@ warning - + 警告 open dyt file failed - + 打开dyt文件失败 QtPathComponentManager - - + + PathComponent - + 路径组件 - + Path - + 路径 @@ -3163,17 +3170,17 @@ (%1, %2) - + X - + Y - + @@ -3181,17 +3188,17 @@ (%1, %2) - + X - + Y - + @@ -3199,22 +3206,22 @@ [%1, %2, %3] (%4) - + [%1, %2] - + [%1, %2, %3] - + [%1, %2, %3] [%4, %5, %6] [%7, %8, %9] - + @@ -3222,27 +3229,27 @@ [(%1, %2), %3 x %4] - + X - + Y - + Width - + Height - + @@ -3250,27 +3257,27 @@ [(%1, %2), %3 x %4] - + X - + Y - + Width - + Height - + @@ -3278,17 +3285,17 @@ %1 x %2 - + Width - + Height - + @@ -3297,32 +3304,32 @@ <Invalid> - + [%1, %2, %3, %4] - + Horizontal Policy - + Vertical Policy - + Horizontal Stretch - + Vertical Stretch - + @@ -3330,17 +3337,17 @@ %1 x %2 - + Width - + Height - + @@ -3348,7 +3355,7 @@ ... - + @@ -3356,17 +3363,17 @@ Location - + 位置 Rotation - + 旋转 Scale - + 缩放 @@ -3374,12 +3381,12 @@ Property - + 属性 Value - + @@ -3387,90 +3394,100 @@ X - + Y - + Z - + QtWorkspacePropertyManager - + Name - - - - - Description - - - - - Timestep - + 名称 + Description + 说明 + + + + Timestep + 时戳 + + + CommondPath - - - - - Count - - - - - Curve[%1] - + 命令路径 - Surface[%1] - - - - - Table[%1] - - - - - Light[%1] - - - - - Curves - + Count + 数目 - Surfaces - + Curve[%1] + + + + + Surface[%1] + + + + + Table[%1] + + Light[%1] + + + + + Image[%1] + + + + + Curves + + + + + Surfaces + + + + Tables - + - + Lights - + - + Polars - + + + + + Images + @@ -3478,7 +3495,7 @@ SignalIndicatorLampUI - + @@ -3486,22 +3503,22 @@ no workspace - + 未打开工作区间 no commands - + 没有命令 Commands - + 命令 unnamed - + 未命名 @@ -3509,7 +3526,7 @@ SimuRunMenu - + @@ -3517,7 +3534,7 @@ DSurfaceDialog - + @@ -3525,32 +3542,32 @@ SystemManagerMenu - + exit - + 退出 windows setting - + 窗口设置 ui setting - + UI设置 question - + 提问 are you sure to exit - + 真的要退出吗? @@ -3558,7 +3575,7 @@ TargetListWgt - + @@ -3566,7 +3583,7 @@ ViewManagerMenu - + @@ -3574,7 +3591,7 @@ WindowManagerMenu - + @@ -3582,63 +3599,63 @@ New WorkSpace - + 新建工作区间 Name - + 名称 input workspace name - + 请输入工作区间 Path - + 路径 select workspace save path - + 选择工作区间保存路径 ... - + commond Path - + 命令路径 select commond file path - + 选择命令文件路径 describe - + 说明 Sure - + 确定 Cancel - + 取消 new workspace - + 新建工作区间 @@ -3648,52 +3665,52 @@ warning - + 警告 name or save path is empty, please check it - + 名称或保存路径为空,请检查! save current workspace? - + 保存当前工作区间? current path is contains current folder, do you want to overwrite it? - + 当前路径包含当前文件夹,是否要覆盖它? removeRecursively failed - + remove递归失败 mkpath failed - + mkpath失败 name is exits - + 名称已存在 save spaceWork directory - + 保存工作区间目录 select command xml file - + 选择命令xml文件 XML files (*.xml);;All files (*.*) - + diff --git a/src/ui/Panel/DataPanel.cpp b/src/ui/Panel/DataPanel.cpp index 74229192..0e176919 100644 --- a/src/ui/Panel/DataPanel.cpp +++ b/src/ui/Panel/DataPanel.cpp @@ -84,6 +84,8 @@ QString DataPanel::GetTypeDisplayName() const return "Light"; case FileEntryType::Polar: return "Polar"; + case FileEntryType::Image: + return "Image"; default: return "Unknown"; } diff --git a/src/ui/Panel/DataPanelFactory.cpp b/src/ui/Panel/DataPanelFactory.cpp index fc937f56..0f5b81d1 100644 --- a/src/ui/Panel/DataPanelFactory.cpp +++ b/src/ui/Panel/DataPanelFactory.cpp @@ -8,6 +8,7 @@ #include "TablePanel.h" #include "LightPanel.h" #include "PolarPanel.h" +#include "ImagePanel.h" DataPanel* DataPanelFactory::CreatePanel(FileEntryType fileType, int index, const QString& filePath, QWidget* parent) { @@ -36,6 +37,11 @@ DataPanel* DataPanelFactory::CreatePanel(FileEntryType fileType, int index, cons // TODO: Implement LightPanel LOG_WARN("PolarPanel not implemented yet, creating base DataPanel"); return new PolarPanel(index, filePath, parent); + + case FileEntryType::Image: + // TODO: Implement LightPanel + LOG_WARN("ImagePanel not implemented yet, creating base DataPanel"); + return new ImagePanel(index, filePath, parent); default: LOG_ERROR("Unsupported file type: {}", static_cast(fileType)); @@ -58,6 +64,7 @@ bool DataPanelFactory::IsTypeSupported(FileEntryType fileType) case FileEntryType::Table: case FileEntryType::Light: case FileEntryType::Polar: + case FileEntryType::Image: return true; default: return false; @@ -77,6 +84,8 @@ QString DataPanelFactory::GetTypeDisplayName(FileEntryType fileType) return "Light"; case FileEntryType::Polar: return "Polar"; + case FileEntryType::Image: + return "Image"; default: return "Unknown"; } diff --git a/src/ui/Panel/DataPanelManager.cpp b/src/ui/Panel/DataPanelManager.cpp index 4b09dc87..683beabf 100644 --- a/src/ui/Panel/DataPanelManager.cpp +++ b/src/ui/Panel/DataPanelManager.cpp @@ -66,6 +66,7 @@ void DataPanelManager::SetWorkspace(WorkSpace* workspace) UpdatePanelsForType(FileEntryType::Table); UpdatePanelsForType(FileEntryType::Light); UpdatePanelsForType(FileEntryType::Polar); + UpdatePanelsForType(FileEntryType::Image); LOG_INFO("DataPanelManager::SetWorkspace - Reapplying UI layout after panels created"); UiLayoutManager::Restore(mainWindow_, 1); } else { diff --git a/src/ui/Panel/ImagePanel.cpp b/src/ui/Panel/ImagePanel.cpp index 38a17688..e9ecc6f2 100644 --- a/src/ui/Panel/ImagePanel.cpp +++ b/src/ui/Panel/ImagePanel.cpp @@ -6,8 +6,11 @@ #include #include +#include "workspace/WorkSpaceManager.h" +#include "workspace/WorkSpace.h" + ImagePanel::ImagePanel(int index, const QString& filePath, QWidget* parent) - : DataPanel(index, FileEntryType::Table, filePath, parent) + : DataPanel(index, FileEntryType::Image, filePath, parent) { LOG_INFO("Created ImagePanel {} for file: {}", index, filePath.toStdString()); } @@ -45,8 +48,10 @@ void ImagePanel::RefreshPanel() void ImagePanel::InitUI() { QGridLayout* pMainLyt = new QGridLayout(this); - pMainLyt->setContentsMargins(5, 0, 5, 0); + pMainLyt->setContentsMargins(0, 0, 0, 0); setLayout(pMainLyt); + + setMinimumHeight(100); } QString ImagePanel::GetTypeDisplayName() const @@ -59,11 +64,39 @@ void ImagePanel::OnDataPanelUpdated(FileEntryImage* fileEntry) QString strName = fileEntry->GetName(); updateTitle(strName); + FileEntryImage::ChartProperties propChart = fileEntry->GetChartProperties(); + + QString strFile = fileEntry->GetPath() + "/" + fileEntry->GetFileName(); + FileEntryImage::ImageProperties listCurve = fileEntry->GetImageProperties(); + updateParseFile(strFile, propChart.timeParam, listCurve); } void ImagePanel::OnTimeChanged(double time) { - + if (m_dataImage.size() > 0) + { + QMap< double, QVariantMap >::const_iterator ite = m_dataImage.lowerBound(time); + if (ite == m_dataImage.end()) + { + ite--; + } + + QVariantMap mapData = ite.value(); + for (QVariantMap::Iterator it = mapData.begin(); it != mapData.end(); it++) + { + QString strKey = it.key(); + QString sData = it.value().toString(); + + QLabel* pImgLabel = m_mapImage.value(strKey); + if (pImgLabel) + { + QImage px; + px.load(sData); + + pImgLabel->setPixmap(QPixmap::fromImage(px)); + } + } + } } void ImagePanel::updateTitle(const QString & title) @@ -72,4 +105,103 @@ void ImagePanel::updateTitle(const QString & title) { dockWidget_->setWindowTitle(title); } +} + +void ImagePanel::updateParseFile(const QString & strFile, int nT, FileEntryImage::ImageProperties listCurve) +{ + if (strFile.isEmpty()) + { + QMessageBox::information(nullptr, QString::fromLocal8Bit("ʾ"), QString::fromLocal8Bit("ļ·")); + return; + } + + m_dataImage.clear(); + + clearImagePanel(); + + QGridLayout* layout = qobject_cast(this->layout()); + if (!layout) + { + return; + } + + QFile file(strFile); + if (file.open(QIODevice::ReadOnly)) + { + for (int nI = 0; nI < listCurve.size(); nI++) + { + FileEntryImage::ImageProperty prop = listCurve.at(nI); + + for (auto i = 0; i < prop.names.size(); ++i) + { + QLabel* pImgLabel = new QLabel; + pImgLabel->setStyleSheet(QString("background-color: rgb(190, 190, 190, 255);")); + pImgLabel->setScaledContents(true); + layout->addWidget(pImgLabel, nI, i); + + QString strKey = QString::number(nI) + "-" + QString::number(i); + m_mapImage.insert(strKey, pImgLabel); + } + } + + QString strDir = WorkSpaceManager::Get().GetCurrent()->GetDir(); + + while (!file.atEnd()) + { + QString strLine = file.readLine().simplified(); + if (!strLine.isEmpty()) + { + QStringList listLine = strLine.split(" "); + double t = listLine.at(nT).toDouble(); + + QVariantMap mapData; + for (int nI = 0; nI < listCurve.size(); nI++) + { + FileEntryImage::ImageProperty prop = listCurve.at(nI); + + for (int nJ = 0; nJ < prop.datas.size(); ++nJ) + { + int nIndex = prop.datas.at(nJ); + QString sImage = listLine.at(nIndex); + + if (prop.path.isEmpty()) + { + sImage = strDir + "/" + prop.names.at(nI) + "/" + sImage + "." + prop.suffix; + } + else + { + sImage = prop.path + "/" + prop.names.at(nI) + "/" + sImage + "." + prop.suffix; + } + + QString strKey = QString::number(nI) + "-" + QString::number(nJ); + mapData.insert(strKey, sImage); + } + } + m_dataImage.insert(t, mapData); + } + } + + file.close(); + } +} + +void ImagePanel::clearImagePanel() +{ + if (auto* layout = qobject_cast(this->layout())) + { + while (layout->count() > 0) + { + QLayoutItem* item = layout->takeAt(0); + if (item) + { + if (auto* w = item->widget()) + { + w->deleteLater(); + } + + delete item; + } + } + } + m_mapImage.clear(); } \ No newline at end of file diff --git a/src/ui/Panel/ImagePanel.h b/src/ui/Panel/ImagePanel.h index bdd862b9..4deec0be 100644 --- a/src/ui/Panel/ImagePanel.h +++ b/src/ui/Panel/ImagePanel.h @@ -4,6 +4,9 @@ #include "workspace/FileEntry.h" #include +#include +#include + class ImagePanel : public DataPanel { Q_OBJECT @@ -59,5 +62,11 @@ protected: private: void updateTitle(const QString& title); + void updateParseFile(const QString& strFile, int nT, FileEntryImage::ImageProperties listCurve); + void clearImagePanel(); + +private: + QMap m_mapImage; + QMap< double, QVariantMap > m_dataImage; }; diff --git a/src/ui/WorkSpace/AddImageDlg.ui b/src/ui/WorkSpace/AddImageDlg.ui index 4a21a0c5..b1b266e3 100644 --- a/src/ui/WorkSpace/AddImageDlg.ui +++ b/src/ui/WorkSpace/AddImageDlg.ui @@ -7,13 +7,302 @@ 0 0 580 - 756 + 601 Add Image + + + + Curve Management + + + + + + + + Curves: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 80 + 16777215 + + + + Add + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + Remove + + + + + + + + + + 16777215 + 120 + + + + false + + + + + + + false + + + Selected Curve Properties + + + + + + + + + 60 + 25 + + + + + 60 + 16777215 + + + + Names: + + + + + + + + 0 + 25 + + + + Enter image names (comma separated)... + + + + + + + + + + + + 60 + 25 + + + + + 60 + 16777215 + + + + Datas: + + + + + + + + 0 + 25 + + + + Enter data values (comma separated integers)... + + + + + + + + + + + + 60 + 25 + + + + + 60 + 16777215 + + + + Path: + + + + + + + + 0 + 25 + + + + true + + + Select data path... + + + + + + + + 0 + 25 + + + + ... + + + + + + + + + + + + 60 + 25 + + + + + 60 + 16777215 + + + + Suffix: + + + + + + + + 0 + 25 + + + + png + + + Enter data suffix... + + + + + + + + + + + + 0 + 25 + + + + + 60 + 16777215 + + + + Row Index: + + + + + + + - + + + + + + + + + + + @@ -117,624 +406,7 @@ - - - - Angular Axis - - - - - - - 0 - 25 - - - - Title: - - - - - - - - 0 - 25 - - - - Enter axis title... - - - - - - - - 0 - 25 - - - - Min: - - - - - - - - 0 - 25 - - - - -999999.000000000000000 - - - 999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 25 - - - - Max: - - - - - - - - 0 - 25 - - - - -999999.000000000000000 - - - 999999.000000000000000 - - - 360.000000000000000 - - - - - - - - 0 - 25 - - - - Count: - - - - - - - - 0 - 25 - - - - 2 - - - 50 - - - 13 - - - - - - - - 0 - 25 - - - - Unit: - - - - - - - - 0 - 25 - - - - Enter axis Unit... - - - - - - - - - - Radial Axis - - - - - - - 0 - 25 - - - - Title: - - - - - - - - 0 - 25 - - - - Enter axis title... - - - - - - - - 0 - 25 - - - - Min: - - - - - - - - 0 - 25 - - - - -999999.000000000000000 - - - 999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 25 - - - - Max: - - - - - - - - 0 - 25 - - - - -999999.000000000000000 - - - 999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 25 - - - - Count: - - - - - - - - 0 - 25 - - - - 2 - - - 50 - - - 6 - - - - - - - - 0 - 25 - - - - Unit: - - - - - - - - 0 - 25 - - - - Enter axis Unit... - - - - - - - - - Curve Management - - - - - - - - Curves: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 80 - 16777215 - - - - Add - - - - - - - - 0 - 0 - - - - - 60 - 16777215 - - - - Remove - - - - - - - - - - 16777215 - 120 - - - - false - - - - - - - false - - - Selected Curve Properties - - - - - - - 0 - 25 - - - - Name: - - - - - - - - 0 - 25 - - - - Enter curve name... - - - - - - - - 0 - 25 - - - - Color: - - - - - - - - - - 0 - 0 - - - - - 100 - 16777215 - - - - Select Color - - - - - - - - 50 - 25 - - - - background-color: rgb(255, 0, 0); border: 1px solid black; - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 25 - - - - Angular: - - - - - - - - 0 - 25 - - - - 0 - - - 999999 - - - 0 - - - - - - - - 0 - 25 - - - - Radial: - - - - - - - - 0 - 25 - - - - 0 - - - 999999 - - - 0 - - - - - - - false - - - X Value: - - - - - - - false - - - -999999.000000000000000 - - - 999999.000000000000000 - - - 0.000000000000000 - - - - - - - false - - - Y Value: - - - - - - - false - - - -999999.000000000000000 - - - 999999.000000000000000 - - - 0.000000000000000 - - - - - - - - - - diff --git a/src/ui/WorkSpace/AddImageFileDlg.cpp b/src/ui/WorkSpace/AddImageFileDlg.cpp index 49fa4914..7734197c 100644 --- a/src/ui/WorkSpace/AddImageFileDlg.cpp +++ b/src/ui/WorkSpace/AddImageFileDlg.cpp @@ -15,9 +15,7 @@ AddImageFileDlg::AddImageFileDlg(QWidget* parent) : BaseAddFileDlg(FileEntryType::Polar, parent) , ui(new Ui::AddImageDlg) , currentCurveIndex_(-1) - , selectedColor_(255, 0, 0) { - SetupUI(ui); SetTitle(getDialogTitle()); @@ -29,7 +27,6 @@ AddImageFileDlg::~AddImageFileDlg() delete ui; } - QString AddImageFileDlg::getFileFilter() const { return tr("Data Files (*.txt *.csv *.dat);;All Files (*.*)"); @@ -86,46 +83,36 @@ bool AddImageFileDlg::validateSpecificParams() } // Curve name uniqueness validation - QStringList curveNames; for (int i = 0; i < curves_.size(); ++i) { - const FileEntryPolar::LineProperty& curve = curves_[i]; - - if (curve.name.isEmpty()) + const FileEntryImage::ImageProperty& curve = curves_[i]; + int nSizeName = curve.names.size(); + if (curve.names.isEmpty()) { QMessageBox::warning(this, tr("Validation Error"), - tr("Curve %1 name cannot be empty.").arg(i + 1)); + tr("Image %1 name cannot be empty.").arg(i + 1)); return false; } - if (curveNames.contains(curve.name)) + int nSizeData = curve.datas.size(); + if (nSizeData == 0) { QMessageBox::warning(this, tr("Validation Error"), - tr("Curve name '%1' is duplicated. Please use different names.").arg(curve.name)); - return false; - } - curveNames.append(curve.name); - - // Curve name length validation - if (curve.name.length() > 50) - { - QMessageBox::warning(this, tr("Validation Error"), - tr("Curve name '%1' is too long. Please limit to 50 characters.").arg(curve.name)); + tr("Image %1 data cannot be empty.").arg(i + 1)); return false; } - // Report type validation - ensure x and y values are reasonable - if (curve.Angular < -1000000 || curve.Angular > 1000000) + if (nSizeName != nSizeData) { QMessageBox::warning(this, tr("Validation Error"), - tr("Curve '%1' X value is out of range. Please ensure it is between -1000000 and 1000000.").arg(curve.name)); + tr("Image %1 name does not match data.").arg(i + 1)); return false; } - if (curve.Radial < -1000000 || curve.Radial > 1000000) + if (curve.suffix.isEmpty()) { QMessageBox::warning(this, tr("Validation Error"), - tr("Curve '%1' Y value is out of range. Please ensure it is between -1000000 and 1000000.").arg(curve.name)); + tr("Image %1 suffix cannot be empty.").arg(i + 1)); return false; } } @@ -143,25 +130,6 @@ bool AddImageFileDlg::validateSpecificParams() return false; } - // Axis range validation - double AngularMin = ui->SpinBox_Min_Angular->value(); - double AngularMax = ui->SpinBox_Max_Angular->value(); - double RadialMin = ui->SpinBox_Min_Radial->value(); - double RadialMax = ui->SpinBox_Max_Radial->value(); - - if (AngularMin > AngularMax) - { - QMessageBox::warning(this, tr("Validation Error"), tr("Angular axis minimum value must be less than maximum value.")); - return false; - } - - if (RadialMin > RadialMax) - { - QMessageBox::warning(this, tr("Validation Error"), tr("Radial axis minimum value must be less than maximum value.")); - return false; - } - - // Time parameter validation double timeParam = ui->SpinBox_time->value(); if (timeParam < 0) @@ -211,54 +179,17 @@ void AddImageFileDlg::setupConnections() connect(ui->curveListWidget, &QListWidget::itemClicked, this, &AddImageFileDlg::onCurveListWidgetItemClicked); // Curve properties connections - connect(ui->colorButton, &QPushButton::clicked, this, &AddImageFileDlg::onColorButtonClicked); - connect(ui->curveNameEdit, &QLineEdit::textChanged, this, &AddImageFileDlg::onCurveNameChanged); - connect(ui->SpinBox_Angular, QOverload::of(&QSpinBox::valueChanged), this, &AddImageFileDlg::onCurveDataChanged); - connect(ui->SpinBox_Radial, QOverload::of(&QSpinBox::valueChanged), this, &AddImageFileDlg::onCurveDataChanged); + connect(ui->image_name, &QLineEdit::textChanged, this, &AddImageFileDlg::onNamesChanged); + connect(ui->image_data, &QLineEdit::textChanged, this, &AddImageFileDlg::onDatasChanged); + connect(ui->image_path, &QLineEdit::textChanged, this, &AddImageFileDlg::onPathChanged); + connect(ui->image_suffix, &QLineEdit::textChanged, this, &AddImageFileDlg::onSuffixChanged); + connect(ui->image_btn, &QToolButton::clicked, this, &AddImageFileDlg::onSelectDir); // Dialog buttons connect(ui->addBtn, &QPushButton::clicked, this, &AddImageFileDlg::onSure); connect(ui->cancelBtn, &QPushButton::clicked, this, &QDialog::reject); } -void AddImageFileDlg::onColorButtonClicked() -{ - if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size()) - { - QColor color = QColorDialog::getColor(curves_[currentCurveIndex_].color, this, "Select Curve Color"); - if (color.isValid()) - { - curves_[currentCurveIndex_].color = color; - selectedColor_ = color; - updateColorPreview(color); - - // Update list item text - QListWidgetItem* item = ui->curveListWidget->item(currentCurveIndex_); - if (item) - { - QString itemText = QString("%1 (%2,%3) (%4,%5,%6)") - .arg(curves_[currentCurveIndex_].name) - .arg(curves_[currentCurveIndex_].Angular) - .arg(curves_[currentCurveIndex_].Radial) - .arg(color.red()) - .arg(color.green()) - .arg(color.blue()); - - item->setText(itemText); - } - } - } -} - -void AddImageFileDlg::updateColorPreview(const QColor& color) -{ - QString styleSheet = QString("background-color: rgb(%1, %2, %3); border: 1px solid black;") - .arg(color.red()) - .arg(color.green()) - .arg(color.blue()); - ui->colorPreview->setStyleSheet(styleSheet); -} - void AddImageFileDlg::onAddCurveClicked() { // Save current curve properties if any curve is selected @@ -268,29 +199,23 @@ void AddImageFileDlg::onAddCurveClicked() } // Create new curve with default properties based on chart type - FileEntryPolar::LineProperty newCurve; - newCurve.name = generateCurveName(); - newCurve.color = generateCurveColor(); - newCurve.Angular = 0.0; - newCurve.Radial = 0.0; - + FileEntryImage::ImageProperty newCurve; + newCurve.names = QStringList() << generateCurveName(); + newCurve.suffix = "png"; // Add to curves list and UI curves_.append(newCurve); // Add to UI list widget with appropriate display format - QString displayText = QString("%1 (%2,%3) (%4,%5,%6)") - .arg(newCurve.name) - .arg(newCurve.Angular) - .arg(newCurve.Radial) - .arg(newCurve.color.red()) - .arg(newCurve.color.green()) - .arg(newCurve.color.blue()); + QString displayText = QString("[%1] [%2] [Row: %3]") + .arg(newCurve.names.join(", ")) + .arg("") + .arg(curves_.size() - 1); QListWidgetItem* item = new QListWidgetItem(displayText); ui->curveListWidget->addItem(item); ++currentCurveIndex_; - ui->curveNameEdit->setText(newCurve.name); + updateCurveProperties(); // Select the new curve ui->curveListWidget->setCurrentRow(curves_.size() - 1); @@ -341,24 +266,8 @@ void AddImageFileDlg::onCurveListWidgetItemClicked(QListWidgetItem* item) } int clickedIndex = ui->curveListWidget->row(item); - if (clickedIndex == currentCurveIndex_) { - ui->curveNameEdit->setText(curves_[currentCurveIndex_].name); - - ui->SpinBox_Angular->blockSignals(true); - ui->SpinBox_Angular->setValue(curves_[currentCurveIndex_].Angular); - ui->SpinBox_Angular->blockSignals(false); - - ui->SpinBox_Radial->blockSignals(true); - ui->SpinBox_Radial->setValue(curves_[currentCurveIndex_].Radial); - ui->SpinBox_Radial->blockSignals(false); - - updateColorPreview(curves_[currentCurveIndex_].color); - enableCurveProperties(true); - - ui->curveNameEdit->setFocus(); - ui->curveNameEdit->selectAll(); } else { @@ -391,27 +300,18 @@ void AddImageFileDlg::onCurveSelectionChanged() } } -void AddImageFileDlg::onCurveNameChanged() +void AddImageFileDlg::onNamesChanged() { if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size()) { - QString newName = ui->curveNameEdit->text(); - curves_[currentCurveIndex_].name = newName; - - // Update list item text with appropriate format - QListWidgetItem* item = ui->curveListWidget->item(currentCurveIndex_); - if (item) - { - QString displayText = QString("%1 (%2,%3) (%4,%5,%6)") - .arg(newName) - .arg(curves_[currentCurveIndex_].Angular) - .arg(curves_[currentCurveIndex_].Radial) - .arg(curves_[currentCurveIndex_].color.red()) - .arg(curves_[currentCurveIndex_].color.green()) - .arg(curves_[currentCurveIndex_].color.blue()); - - item->setText(displayText); + QString namesText = ui->image_name->text(); + QStringList names = namesText.split(",", Qt::SkipEmptyParts); + for (int i = 0; i < names.size(); ++i) { + names[i] = names[i].trimmed(); } + curves_[currentCurveIndex_].names = names; + + updateListDisplay(); } } @@ -419,26 +319,37 @@ void AddImageFileDlg::saveCurveProperties() { if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size()) { - curves_[currentCurveIndex_].name = ui->curveNameEdit->text(); + QString namesText = ui->image_name->text(); + QStringList names = namesText.split(",", Qt::SkipEmptyParts); + for (int i = 0; i < names.size(); ++i) { + names[i] = names[i].trimmed(); + } + curves_[currentCurveIndex_].names = names; - // Save properties based on chart type - curves_[currentCurveIndex_].Angular = ui->SpinBox_Angular->value(); - curves_[currentCurveIndex_].Radial = ui->SpinBox_Radial->value(); + QString dataText = ui->image_data->text(); + QStringList dataStrings = dataText.split(",", Qt::SkipEmptyParts); + QList dataValues; - curves_[currentCurveIndex_].color = selectedColor_; + for (const QString& str : dataStrings) { + bool ok; + int dataValue = str.trimmed().toInt(&ok); + if (ok) { + dataValues.append(dataValue); + } + } + curves_[currentCurveIndex_].datas = dataValues; + + onPathChanged(); + onSuffixChanged(); } } void AddImageFileDlg::clearCurveProperties() { - ui->curveNameEdit->clear(); - - // Clear properties based on chart type - ui->SpinBox_Angular->setValue(0.0); - ui->SpinBox_Radial->setValue(0.0); - - selectedColor_ = QColor(255, 0, 0); - updateColorPreview(selectedColor_); + ui->image_name->clear(); + ui->image_data->clear(); + ui->image_path->clear(); + ui->image_suffix->setText("png"); } void AddImageFileDlg::enableCurveProperties(bool enabled) @@ -448,45 +359,37 @@ void AddImageFileDlg::enableCurveProperties(bool enabled) QString AddImageFileDlg::generateCurveName() { - return tr("Curve %1").arg(curves_.size() + 1); -} - -QColor AddImageFileDlg::generateCurveColor() const -{ - // Generate different colors for each curve - static const QColor colors[] = { - QColor(255, 0, 0), // Red - QColor(0, 255, 0), // Green - QColor(0, 0, 255), // Blue - QColor(255, 255, 0), // Yellow - QColor(255, 0, 255), // Magenta - QColor(0, 255, 255), // Cyan - QColor(255, 128, 0), // Orange - QColor(128, 0, 255), // Purple - }; - - int colorIndex = curves_.size() % (sizeof(colors) / sizeof(colors[0])); - return colors[colorIndex]; + return tr("Image %1").arg(curves_.size() + 1); } void AddImageFileDlg::updateCurveProperties() { if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size()) { - const FileEntryPolar::LineProperty& curve = curves_[currentCurveIndex_]; + const FileEntryImage::ImageProperty& curve = curves_[currentCurveIndex_]; - ui->curveNameEdit->setText(curve.name); + ui->image_name->blockSignals(true); + ui->image_name->setText(curve.names.join(", ")); + ui->image_name->blockSignals(false); - ui->SpinBox_Angular->blockSignals(true); - ui->SpinBox_Angular->setValue(curve.Angular); - ui->SpinBox_Angular->blockSignals(false); + QStringList dataStrings; + for (int dataValue : curve.datas) + { + dataStrings.append(QString::number(dataValue)); + } + ui->image_data->blockSignals(true); + ui->image_data->setText(dataStrings.join(", ")); + ui->image_data->blockSignals(false); - ui->SpinBox_Radial->blockSignals(true); - ui->SpinBox_Radial->setValue(curve.Radial); - ui->SpinBox_Radial->blockSignals(false); + ui->image_path->blockSignals(true); + ui->image_path->setText(curve.path); + ui->image_path->blockSignals(false); - selectedColor_ = curve.color; - updateColorPreview(curve.color); + ui->image_suffix->blockSignals(true); + ui->image_suffix->setText(curve.suffix); + ui->image_suffix->blockSignals(false); + + ui->rowIndexValue->setText(QString::number(currentCurveIndex_)); } } @@ -495,35 +398,25 @@ void AddImageFileDlg::onSure() if (validateSpecificParams()) { // Create FileEntryCurve object using factory function - auto fileEntryPolar = CreateFileEntryPolar(getSelectedFilePath()); - if (!fileEntryPolar) + auto fileEntryImage = CreateFileEntryImage(getSelectedFilePath()); + if (!fileEntryImage) { QMessageBox::warning(this, tr("Error"), tr("Failed to create file entry")); return; } // Set curve properties - fileEntryPolar->SetName(ui->chartNameEdit->text()); + fileEntryImage->SetName(ui->chartNameEdit->text()); // Set chart properties - FileEntryPolar::ChartProperties chartProps; - chartProps.AngularCount = ui->SpinBox_Count_Angular->value(); - chartProps.RadialCount = ui->SpinBox_Count_Radial->value(); - chartProps.AngularTitle = ui->TitleEdit_Angular->text(); - chartProps.RadialTitle = ui->TitleEdit_Radial->text(); - chartProps.AngularUnit = ui->TitleEdit_Unit_Angular->text(); - chartProps.RadialUnit = ui->TitleEdit_Unit_Radial->text(); - chartProps.AngularMin = ui->SpinBox_Min_Angular->value(); - chartProps.AngularMax = ui->SpinBox_Max_Angular->value(); - chartProps.RadialMin = ui->SpinBox_Min_Radial->value(); - chartProps.RadialMax = ui->SpinBox_Max_Radial->value(); + FileEntryImage::ChartProperties chartProps; chartProps.timeParam = ui->SpinBox_time->value(); - fileEntryPolar->SetChartProperties(chartProps); + fileEntryImage->SetChartProperties(chartProps); // Add curve properties for (const auto& curve : curves_) { - fileEntryPolar->AddLineProperty(curve); + fileEntryImage->AddImageProperty(curve); } // Get current workspace @@ -535,13 +428,13 @@ void AddImageFileDlg::onSure() } // Add FileEntryCurve to workspace using new SetFileEntry method - auto result = workspace->SetFileEntry(fileEntryPolar); + auto result = workspace->SetFileEntry(fileEntryImage); if (result != WorkSpace::FileEntryResult::Ok) { QString errorMsg; switch (result) { case WorkSpace::FileEntryResult::LimitExceeded: - errorMsg = tr("Polar file count has reached the limit (9 files)"); + errorMsg = tr("Image file count has reached the limit (9 files)"); break; case WorkSpace::FileEntryResult::Duplicate: errorMsg = tr("File already exists"); @@ -564,30 +457,78 @@ void AddImageFileDlg::onSure() } else { - QMessageBox::critical(this, tr("Error"), tr("Failed to create Polar file entry.")); + QMessageBox::critical(this, tr("Error"), tr("Failed to create Image file entry.")); } } -void AddImageFileDlg::onCurveDataChanged() +void AddImageFileDlg::onDatasChanged() { if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size()) { - curves_[currentCurveIndex_].Angular = ui->SpinBox_Angular->value(); - curves_[currentCurveIndex_].Radial = ui->SpinBox_Radial->value(); + QString dataText = ui->image_data->text(); + QStringList dataStrings = dataText.split(',', Qt::SkipEmptyParts); + + QList dataValues; + for (const QString& str : dataStrings) { + bool ok; + int dataValue = str.trimmed().toInt(&ok); + if (ok) { + dataValues.append(dataValue); + } + } + curves_[currentCurveIndex_].datas = dataValues; + + updateListDisplay(); + } +} + +void AddImageFileDlg::onPathChanged() +{ + if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size()) + { + QString text = ui->image_path->text(); + curves_[currentCurveIndex_].path = text; + } +} + +void AddImageFileDlg::onSuffixChanged() +{ + if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size()) + { + QString text = ui->image_suffix->text(); + curves_[currentCurveIndex_].suffix = text; + } +} + +void AddImageFileDlg::updateListDisplay() +{ + if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size()) + { + QStringList dataStrings; + for (int dataValue : curves_[currentCurveIndex_].datas) { + dataStrings.append(QString::number(dataValue)); + } - // Update display text in list widget QListWidgetItem* item = ui->curveListWidget->item(currentCurveIndex_); - if (item) + if (item) { - QString itemText = QString("%1 (%2,%3) (%4,%5,%6)") - .arg(curves_[currentCurveIndex_].name) - .arg(curves_[currentCurveIndex_].Angular) - .arg(curves_[currentCurveIndex_].Radial) - .arg(curves_[currentCurveIndex_].color.red()) - .arg(curves_[currentCurveIndex_].color.green()) - .arg(curves_[currentCurveIndex_].color.blue()); - - item->setText(itemText); + item->setText(QString("[%1] [%2] [Row: %3]") + .arg(curves_[currentCurveIndex_].names.join(", ")) + .arg(dataStrings.join(", ")) + .arg(currentCurveIndex_)); } } +} + +void AddImageFileDlg::onSelectDir() +{ + QString workspacePath = WorkSpaceManager::Get().GetCurrent()->GetDir(); + const QString imagePath = QFileDialog::getExistingDirectory(this, + tr("Select Image directory"), workspacePath, QFileDialog::DontResolveSymlinks); + if (imagePath.isEmpty()) + { + return; + } + + ui->image_path->setText(imagePath); } \ No newline at end of file diff --git a/src/ui/WorkSpace/AddImageFileDlg.h b/src/ui/WorkSpace/AddImageFileDlg.h index adbb4a96..6b005c48 100644 --- a/src/ui/WorkSpace/AddImageFileDlg.h +++ b/src/ui/WorkSpace/AddImageFileDlg.h @@ -32,30 +32,31 @@ protected: void updateFileInfo(const QString& filePath) override; private slots: - void onColorButtonClicked(); void onAddCurveClicked(); void onRemoveCurveClicked(); void onCurveListWidgetItemClicked(class QListWidgetItem* item); void onCurveSelectionChanged(); - void onCurveNameChanged(); - void onCurveDataChanged(); + void onNamesChanged(); + void onDatasChanged(); + void onPathChanged(); + void onSuffixChanged(); + void onSelectDir(); void onSure(); private: void setupConnections(); - void updateColorPreview(const QColor& color); void updateCurveProperties(); void saveCurveProperties(); void clearCurveProperties(); void enableCurveProperties(bool enabled); QString generateCurveName(); - QColor generateCurveColor() const; + + void updateListDisplay(); private: Ui::AddImageDlg* ui; int currentCurveIndex_; - QColor selectedColor_; - FileEntryPolar::ChartProperties chartProperties_; - FileEntryPolar::LineProperties curves_; + FileEntryImage::ChartProperties chartProperties_; + FileEntryImage::ImageProperties curves_; }; \ No newline at end of file diff --git a/src/ui/WorkSpace/AddPolarDlg.ui b/src/ui/WorkSpace/AddPolarDlg.ui index 6f865f4a..45459416 100644 --- a/src/ui/WorkSpace/AddPolarDlg.ui +++ b/src/ui/WorkSpace/AddPolarDlg.ui @@ -521,42 +521,22 @@ Selected Curve Properties - - + + 0 25 - - Name: + + 0 - - - - - - - 0 - 25 - + + 999999 - - Enter curve name... - - - - - - - - 0 - 25 - - - - Color: + + 0 @@ -625,6 +605,32 @@ + + + + + 0 + 25 + + + + Color: + + + + + + + + 0 + 25 + + + + Enter curve name... + + + @@ -644,6 +650,19 @@ + + + + + 0 + 25 + + + + Name: + + + @@ -657,77 +676,6 @@ - - - - - 0 - 25 - - - - 0 - - - 999999 - - - 0 - - - - - - - false - - - X Value: - - - - - - - false - - - -999999.000000000000000 - - - 999999.000000000000000 - - - 0.000000000000000 - - - - - - - false - - - Y Value: - - - - - - - false - - - -999999.000000000000000 - - - 999999.000000000000000 - - - 0.000000000000000 - - - diff --git a/src/workspace/FileEntry.cpp b/src/workspace/FileEntry.cpp index db727c98..48d8e4c2 100644 --- a/src/workspace/FileEntry.cpp +++ b/src/workspace/FileEntry.cpp @@ -864,4 +864,108 @@ const FileEntryImage::ImageProperties& FileEntryImage::GetImageProperties() cons FileEntryImage* FileEntryImage::AsImage() { return this; +} + +//SaveFiles implementation +bool FileEntryImage::SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) { + if (!scene || !doc) { + LOG_ERROR("Invalid XML parameters"); + return false; + } + + // 创建 元素 + tinyxml2::XMLElement* chartElement = doc->NewElement("chart"); + scene->InsertEndChild(chartElement); + + // 设置chart属性 + chartElement->SetAttribute("name", name_.toUtf8().constData()); + chartElement->SetAttribute("path", fileName_.toUtf8().constData()); + chartElement->SetAttribute("t", chartProperties_.timeParam); + + for (const auto& imageRow : imageProperties_) { + tinyxml2::XMLElement* imageElement = doc->NewElement("curve"); + chartElement->InsertEndChild(imageElement); + + // 保存name列表(以逗号分隔) + QString nameStr = imageRow.names.join(","); + imageElement->SetAttribute("names", nameStr.toUtf8().constData()); + + // 保存data列表(以逗号分隔) + QStringList dataStrList; + for (int value : imageRow.datas) { + dataStrList.append(QString::number(value)); + } + QString dataStr = dataStrList.join(","); + imageElement->SetAttribute("datas", dataStr.toUtf8().constData()); + + imageElement->SetAttribute("path", imageRow.path.toUtf8().constData()); + imageElement->SetAttribute("suffix", imageRow.suffix.toUtf8().constData()); + } + + return true; +} + +//ParseFiles implementation +bool FileEntryImage::ParseFiles(const tinyxml2::XMLElement* chartElement) { + if (!chartElement) { + LOG_ERROR("Invalid XML element"); + return false; + } + + // 解析chart属性 + const char* nameAttr = chartElement->Attribute("name"); + const char* pathAttr = chartElement->Attribute("path"); + if (nameAttr) name_ = QString::fromUtf8(nameAttr); + if (pathAttr) { + QString fullPath = QString::fromUtf8(pathAttr); + QFileInfo fileInfo(fullPath); + fileName_ = fileInfo.fileName(); + path_ = fileInfo.absolutePath(); + } + + chartProperties_.timeParam = chartElement->DoubleAttribute("t", 0.0); + + // 解析所有元素 + imageProperties_.clear(); + for (const tinyxml2::XMLElement* imageElement = chartElement->FirstChildElement("curve"); + imageElement != nullptr; + imageElement = imageElement->NextSiblingElement("curve")) { + + ImageProperty imageRow; + + // 解析name属性(逗号分隔的字符串列表) + const char* nameAttr = imageElement->Attribute("names"); + if (nameAttr) { + QString nameStr = QString::fromUtf8(nameAttr); + imageRow.names = nameStr.split(",", Qt::SkipEmptyParts); + } + + // 解析data属性(逗号分隔的整数列表) + const char* dataAttr = imageElement->Attribute("datas"); + if (dataAttr) { + QString dataStr = QString::fromUtf8(dataAttr); + QStringList dataStrList = dataStr.split(",", Qt::SkipEmptyParts); + for (const QString& str : dataStrList) { + bool ok; + int value = str.trimmed().toInt(&ok); + if (ok) { + imageRow.datas.append(value); + } + } + } + + const char* pathAttr = imageElement->Attribute("path"); + if (pathAttr) { + imageRow.path = QString::fromUtf8(pathAttr); + } + + const char* suffixAttr = imageElement->Attribute("suffix"); + if (suffixAttr) { + imageRow.suffix = QString::fromUtf8(suffixAttr); + } + + imageProperties_.append(imageRow); + } + + return true; } \ No newline at end of file diff --git a/src/workspace/FileEntry.h b/src/workspace/FileEntry.h index e1f36cbd..edfa3345 100644 --- a/src/workspace/FileEntry.h +++ b/src/workspace/FileEntry.h @@ -362,24 +362,14 @@ private: class FileEntryImage : public FileEntry { public: struct ChartProperties { - int AngularCount; - int RadialCount; - QString AngularTitle; - QString RadialTitle; - double AngularMin; - double AngularMax; - double RadialMin; - double RadialMax; - QString AngularUnit; - QString RadialUnit; double timeParam; // 对应XML的t }; struct ImageProperty { - QString name; - QColor color; - int Angular; - int Radial; + QStringList names; + QList datas; + QString path; + QString suffix; }; using ImageProperties = QList; @@ -400,9 +390,9 @@ public: // Type conversion FileEntryImage* AsImage() override; - //// XML处理方法 - //bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override; - //bool ParseFiles(const tinyxml2::XMLElement* element) override; + // XML处理方法 + bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override; + bool ParseFiles(const tinyxml2::XMLElement* element) override; private: ChartProperties chartProperties_; diff --git a/src/workspace/WorkSpace.cpp b/src/workspace/WorkSpace.cpp index aedda10d..fa4e221b 100644 --- a/src/workspace/WorkSpace.cpp +++ b/src/workspace/WorkSpace.cpp @@ -162,6 +162,9 @@ bool WorkSpace::SetFileEntryCount(FileEntryType type, int count) { case FileEntryType::Polar: fileEntry = std::make_shared(); break; + case FileEntryType::Image: + fileEntry = std::make_shared(); + break; default: return false; // Invalid type }