Compare commits
6 Commits
f65ea8dcd8
...
c840f4ff3f
| Author | SHA1 | Date | |
|---|---|---|---|
| c840f4ff3f | |||
| 4bfd45d287 | |||
| 51a7bbf301 | |||
| 6040a3f698 | |||
| 06a91d4cf1 | |||
| 6617e2f46e |
@ -38,6 +38,7 @@
|
||||
<file>res/models/radar_jamming_station.png</file>
|
||||
<file>res/models/satellite.png</file>
|
||||
<file>res/models/warships.png</file>
|
||||
<file>res/default/menu_image_file.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/qss"/>
|
||||
<qresource prefix="/fonts">
|
||||
|
||||
BIN
src/res/default/menu_image_file.png
Normal file
BIN
src/res/default/menu_image_file.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@ -176,37 +176,37 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="619"/>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="625"/>
|
||||
<source>background-color: rgb(255, 0, 0); border: 1px solid black;</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="650"/>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="656"/>
|
||||
<source>Data Start:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="682"/>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="688"/>
|
||||
<source>Data Stop:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="714"/>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="720"/>
|
||||
<source>X Value:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="746"/>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="752"/>
|
||||
<source>Y Value:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="799"/>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="805"/>
|
||||
<source>Add File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="815"/>
|
||||
<location filename="../ui/WorkSpace/AddCurveFileDlg.ui" line="821"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -393,6 +393,367 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddImageDlg</name>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="14"/>
|
||||
<source>Add Image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="20"/>
|
||||
<source>File Selection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="32"/>
|
||||
<source>File Path:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="48"/>
|
||||
<source>Select curve data file...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="61"/>
|
||||
<source>...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="74"/>
|
||||
<source>File Name:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="87"/>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="113"/>
|
||||
<source>-</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="100"/>
|
||||
<source>File Size:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="123"/>
|
||||
<source>Angular Axis</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="135"/>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="292"/>
|
||||
<source>Title:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="148"/>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="305"/>
|
||||
<source>Enter axis title...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="161"/>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="318"/>
|
||||
<source>Min:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="193"/>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="350"/>
|
||||
<source>Max:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="225"/>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="382"/>
|
||||
<source>Count:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="257"/>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="414"/>
|
||||
<source>Unit:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="270"/>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="427"/>
|
||||
<source>Enter axis Unit...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="280"/>
|
||||
<source>Radial Axis</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="437"/>
|
||||
<source>Curve Management</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="445"/>
|
||||
<source>Curves:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="477"/>
|
||||
<source>Add</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="496"/>
|
||||
<source>Remove</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="521"/>
|
||||
<source>Selected Curve Properties</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="533"/>
|
||||
<source>Name:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="546"/>
|
||||
<source>Enter curve name...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="559"/>
|
||||
<source>Color:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="580"/>
|
||||
<source>Select Color</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="593"/>
|
||||
<source>background-color: rgb(255, 0, 0); border: 1px solid black;</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="624"/>
|
||||
<source>Angular:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="656"/>
|
||||
<source>Radial:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="685"/>
|
||||
<source>X Value:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="711"/>
|
||||
<source>Y Value:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="761"/>
|
||||
<source>Add File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="777"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="786"/>
|
||||
<source>Chart Properties</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="808"/>
|
||||
<source>Time:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="821"/>
|
||||
<source>Chart Name:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="834"/>
|
||||
<source>Chart 1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageDlg.ui" line="837"/>
|
||||
<source>Enter chart name...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddImageFileDlg</name>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="35"/>
|
||||
<source>Data Files (*.txt *.csv *.dat);;All Files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="40"/>
|
||||
<source>Add Image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="49"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="57"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="64"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="71"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="78"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="96"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="103"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="112"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="120"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="127"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="136"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="142"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="154"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="160"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="169"/>
|
||||
<source>Validation Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="49"/>
|
||||
<source>Please select a data file.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="57"/>
|
||||
<source>Selected file does not exist.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="64"/>
|
||||
<source>Selected file is not readable. Please check file permissions.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="71"/>
|
||||
<source>File is too large (over 100MB). Please select a smaller file.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="78"/>
|
||||
<source>At least one curve must be defined.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="97"/>
|
||||
<source>Curve %1 name cannot be empty.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="104"/>
|
||||
<source>Curve name '%1' is duplicated. Please use different names.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="113"/>
|
||||
<source>Curve name '%1' is too long. Please limit to 50 characters.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="121"/>
|
||||
<source>Curve '%1' X value is out of range. Please ensure it is between -1000000 and 1000000.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="128"/>
|
||||
<source>Curve '%1' Y value is out of range. Please ensure it is between -1000000 and 1000000.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="136"/>
|
||||
<source>Chart name cannot be empty.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="142"/>
|
||||
<source>Chart name is too long. Please limit to 100 characters.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="154"/>
|
||||
<source>Angular axis minimum value must be less than maximum value.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="160"/>
|
||||
<source>Radial axis minimum value must be less than maximum value.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="169"/>
|
||||
<source>Time parameter cannot be negative.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="451"/>
|
||||
<source>Curve %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="501"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="533"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="559"/>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="567"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="501"/>
|
||||
<source>Failed to create file entry</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="533"/>
|
||||
<source>Unable to get current workspace</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="544"/>
|
||||
<source>Polar file count has reached the limit (9 files)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="547"/>
|
||||
<source>File already exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="550"/>
|
||||
<source>File copy failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="553"/>
|
||||
<source>Invalid file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="556"/>
|
||||
<source>Failed to add file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddImageFileDlg.cpp" line="567"/>
|
||||
<source>Failed to create Polar file entry.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddLightFileDlg</name>
|
||||
<message>
|
||||
@ -1027,11 +1388,6 @@
|
||||
<source>Polar file count has reached the limit (9 files)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddPolarFileDlg.cpp" line="565"/>
|
||||
<source>Failed to create Polar file entry.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddPolarFileDlg.cpp" line="545"/>
|
||||
<source>File already exists</source>
|
||||
@ -1052,6 +1408,11 @@
|
||||
<source>Failed to add file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/AddPolarFileDlg.cpp" line="565"/>
|
||||
<source>Failed to create Polar file entry.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddSurfaceFileDlg</name>
|
||||
@ -1639,32 +2000,32 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="28"/>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="31"/>
|
||||
<source>Wave文件</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="41"/>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="47"/>
|
||||
<source>Report文件</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="54"/>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="63"/>
|
||||
<source>RD文件</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="67"/>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="79"/>
|
||||
<source>Matlab文件</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="80"/>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="95"/>
|
||||
<source>Lamp文件</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="93"/>
|
||||
<location filename="../ui/Menu/ChartPlotMenu.ui" line="111"/>
|
||||
<source>Run Simu</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2334,6 +2695,7 @@
|
||||
<location filename="../ui/Menu/FileManagerMenu.cpp" line="188"/>
|
||||
<location filename="../ui/Menu/FileManagerMenu.cpp" line="236"/>
|
||||
<location filename="../ui/Menu/FileManagerMenu.cpp" line="285"/>
|
||||
<location filename="../ui/Menu/FileManagerMenu.cpp" line="301"/>
|
||||
<source>prompt</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2344,6 +2706,7 @@
|
||||
<location filename="../ui/Menu/FileManagerMenu.cpp" line="188"/>
|
||||
<location filename="../ui/Menu/FileManagerMenu.cpp" line="236"/>
|
||||
<location filename="../ui/Menu/FileManagerMenu.cpp" line="285"/>
|
||||
<location filename="../ui/Menu/FileManagerMenu.cpp" line="301"/>
|
||||
<source>please create workspace first</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2353,31 +2716,31 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8065"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8261"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8049"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8240"/>
|
||||
<source>Curve[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8066"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8262"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8050"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8241"/>
|
||||
<source>Surface[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8067"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8263"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8051"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8242"/>
|
||||
<source>Table[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8068"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8264"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8052"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8243"/>
|
||||
<source>Light[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8069"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8053"/>
|
||||
<source>Polar[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2453,48 +2816,48 @@
|
||||
<context>
|
||||
<name>QtConeWaveComponentManager</name>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9275"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9284"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9221"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9230"/>
|
||||
<source>ConeWaveComponent</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9372"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9318"/>
|
||||
<source>Height</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9379"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9325"/>
|
||||
<source>Radius</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9386"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9332"/>
|
||||
<source>waveCount</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9396"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9342"/>
|
||||
<source>waveSpeed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9403"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9349"/>
|
||||
<source>baseColor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9410"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9356"/>
|
||||
<source>waveColor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9417"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9363"/>
|
||||
<source>ringBrightAlpha</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9424"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9370"/>
|
||||
<source>ringDarkAlpha</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2600,28 +2963,28 @@
|
||||
<context>
|
||||
<name>QtDashedLineComponentManager</name>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9616"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9625"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9562"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9571"/>
|
||||
<source>DashedLineComponent</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9694"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9640"/>
|
||||
<source>Start</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9701"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9647"/>
|
||||
<source>End</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9708"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9654"/>
|
||||
<source>Radius</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9715"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9661"/>
|
||||
<source>Color</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2637,17 +3000,17 @@
|
||||
<context>
|
||||
<name>QtEntityPropertyManager</name>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8720"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8666"/>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8727"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8673"/>
|
||||
<source>Visible</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8734"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8680"/>
|
||||
<source>Transform</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2729,13 +3092,13 @@
|
||||
<context>
|
||||
<name>QtMeshComponetManager</name>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8851"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8860"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8797"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8806"/>
|
||||
<source>MeshComponent</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8933"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8879"/>
|
||||
<source>Mesh</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2784,13 +3147,13 @@
|
||||
<context>
|
||||
<name>QtPathComponentManager</name>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9010"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9019"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8956"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8965"/>
|
||||
<source>PathComponent</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9092"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="9038"/>
|
||||
<source>Path</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -3040,97 +3403,72 @@
|
||||
<context>
|
||||
<name>QtWorkspacePropertyManager</name>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8306"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8285"/>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8313"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8292"/>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8320"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8299"/>
|
||||
<source>Timestep</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8327"/>
|
||||
<source>SimMatlab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8334"/>
|
||||
<source>MatlabParam</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8341"/>
|
||||
<source>WavePath</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8348"/>
|
||||
<source>ReportPath</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8355"/>
|
||||
<source>RDPath</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8363"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8309"/>
|
||||
<source>CommondPath</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8386"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8332"/>
|
||||
<source>Count</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8402"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8348"/>
|
||||
<source>Curve[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8403"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8349"/>
|
||||
<source>Surface[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8404"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8350"/>
|
||||
<source>Table[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8405"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8351"/>
|
||||
<source>Light[%1]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8416"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8362"/>
|
||||
<source>Curves</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8419"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8365"/>
|
||||
<source>Surfaces</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8422"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8368"/>
|
||||
<source>Tables</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8425"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8371"/>
|
||||
<source>Lights</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8428"/>
|
||||
<location filename="../ui/PropertyBrowser/qtpropertymanager.cpp" line="8374"/>
|
||||
<source>Polars</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
@ -296,5 +296,16 @@ void FileManagerMenu::AddPolarFile()
|
||||
|
||||
void FileManagerMenu::AddImageFile()
|
||||
{
|
||||
|
||||
auto current = WorkSpaceManager::Get().GetCurrent();
|
||||
if (nullptr == current) {
|
||||
QMessageBox::information(&MainFrame::Get(), QObject::tr("prompt"), QObject::tr("please create workspace first"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Show light file addition dialog
|
||||
auto dialog = AddFileDialogFactory::createDialog(FileEntryType::Image, &MainFrame::Get());
|
||||
if (dialog && dialog->exec() == QDialog::Accepted) {
|
||||
|
||||
SaveWorkSpace();
|
||||
}
|
||||
}
|
||||
@ -102,6 +102,7 @@ void ModelTreeWidget::contextMenuEvent(QContextMenuEvent* event) {
|
||||
Entity* entity = value.value<Entity*>();
|
||||
PopupEntityMenu(event, entity);
|
||||
} else {
|
||||
return;
|
||||
QMenu menu(this);
|
||||
|
||||
QAction* addEntiy = new QAction(tr("Add boke Entity"), this);
|
||||
|
||||
75
src/ui/Panel/ImagePanel.cpp
Normal file
75
src/ui/Panel/ImagePanel.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
#include "ui/Panel/ImagePanel.h"
|
||||
#include "ui/DockWidget.h"
|
||||
#include "ui/DockTitleBar.h"
|
||||
#include "common/SpdLogger.h"
|
||||
#include <QHBoxLayout>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
ImagePanel::ImagePanel(int index, const QString& filePath, QWidget* parent)
|
||||
: DataPanel(index, FileEntryType::Table, filePath, parent)
|
||||
{
|
||||
LOG_INFO("Created ImagePanel {} for file: {}", index, filePath.toStdString());
|
||||
}
|
||||
|
||||
ImagePanel::ImagePanel(int index, std::shared_ptr<FileEntryImage> fileEntry, QWidget* parent)
|
||||
: DataPanel(index, fileEntry, parent)
|
||||
{
|
||||
if (fileEntry) {
|
||||
LOG_INFO("Created ImagePanel {} for chart: {}", index, fileEntry->GetName().toStdString());
|
||||
// Override the title with chart name
|
||||
title_ = QString("Image Panel %1 - %2").arg(index).arg(fileEntry->GetName());
|
||||
}
|
||||
else {
|
||||
LOG_WARN("Created ImagePanel {} with null chart data", index);
|
||||
}
|
||||
}
|
||||
|
||||
ImagePanel::~ImagePanel()
|
||||
{
|
||||
LOG_INFO("Destroyed ImagePanel {}", GetIndex());
|
||||
}
|
||||
|
||||
void ImagePanel::RefreshPanel()
|
||||
{
|
||||
// Implement curve-specific refresh logic here
|
||||
DataPanel::RefreshPanel();
|
||||
|
||||
if (auto fileEntry = fileEntry_->AsImage()) {
|
||||
OnDataPanelUpdated(fileEntry);
|
||||
}
|
||||
|
||||
LOG_INFO("Refreshed ImagePanel {}", GetIndex());
|
||||
}
|
||||
|
||||
void ImagePanel::InitUI()
|
||||
{
|
||||
QGridLayout* pMainLyt = new QGridLayout(this);
|
||||
pMainLyt->setContentsMargins(5, 0, 5, 0);
|
||||
setLayout(pMainLyt);
|
||||
}
|
||||
|
||||
QString ImagePanel::GetTypeDisplayName() const
|
||||
{
|
||||
return "Image";
|
||||
}
|
||||
|
||||
void ImagePanel::OnDataPanelUpdated(FileEntryImage* fileEntry)
|
||||
{
|
||||
QString strName = fileEntry->GetName();
|
||||
updateTitle(strName);
|
||||
|
||||
}
|
||||
|
||||
void ImagePanel::OnTimeChanged(double time)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ImagePanel::updateTitle(const QString & title)
|
||||
{
|
||||
if (nullptr != dockWidget_)
|
||||
{
|
||||
dockWidget_->setWindowTitle(title);
|
||||
}
|
||||
}
|
||||
63
src/ui/Panel/ImagePanel.h
Normal file
63
src/ui/Panel/ImagePanel.h
Normal file
@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
|
||||
#include "DataPanel.h"
|
||||
#include "workspace/FileEntry.h"
|
||||
#include <memory>
|
||||
|
||||
class ImagePanel : public DataPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param index Panel index
|
||||
* @param filePath Associated file path
|
||||
* @param parent Parent widget
|
||||
*/
|
||||
explicit ImagePanel(int index, const QString& filePath, QWidget* parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Constructor with chart data
|
||||
* @param index Panel index
|
||||
* @param chartData Chart data containing curve information
|
||||
* @param parent Parent widget
|
||||
*/
|
||||
explicit ImagePanel(int index, std::shared_ptr<FileEntryImage> fileEntry, QWidget* parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
virtual ~ImagePanel();
|
||||
|
||||
/**
|
||||
* @brief Get file type
|
||||
* @return File type (always Curve for this class)
|
||||
*/
|
||||
FileEntryType GetFileType() const override { return FileEntryType::Image; }
|
||||
|
||||
/**
|
||||
* @brief Refresh panel content
|
||||
*/
|
||||
void RefreshPanel() override;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Initialize UI for curve-specific layout
|
||||
*/
|
||||
virtual void InitUI();
|
||||
|
||||
/**
|
||||
* @brief Get type display name
|
||||
* @return Display name for curve type
|
||||
*/
|
||||
QString GetTypeDisplayName() const override;
|
||||
|
||||
void OnDataPanelUpdated(FileEntryImage* fileEntry);
|
||||
|
||||
virtual void OnTimeChanged(double time);
|
||||
|
||||
private:
|
||||
void updateTitle(const QString& title);
|
||||
};
|
||||
|
||||
@ -612,7 +612,13 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#include "AddTableFileDlg.h"
|
||||
#include "AddLightFileDlg.h"
|
||||
#include "AddPolarFileDlg.h"
|
||||
#include "AddImageFileDlg.h"
|
||||
|
||||
BaseAddFileDlg* AddFileDialogFactory::createDialog(FileEntryType type, QWidget* parent) {
|
||||
switch (type) {
|
||||
@ -19,6 +20,8 @@ BaseAddFileDlg* AddFileDialogFactory::createDialog(FileEntryType type, QWidget*
|
||||
return new AddLightFileDlg(parent);
|
||||
case FileEntryType::Polar:
|
||||
return new AddPolarFileDlg(parent);
|
||||
case FileEntryType::Image:
|
||||
return new AddImageFileDlg(parent);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
848
src/ui/WorkSpace/AddImageDlg.ui
Normal file
848
src/ui/WorkSpace/AddImageDlg.ui
Normal file
@ -0,0 +1,848 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AddImageDlg</class>
|
||||
<widget class="QWidget" name="AddImageDlg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>580</width>
|
||||
<height>756</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Add Image</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="fileGroupBox">
|
||||
<property name="title">
|
||||
<string>File Selection</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="fileGridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="filePathLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Path:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="filePathEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Select curve data file...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="selectFileBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="fileNameLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="fileNameValue">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="fileSizeLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLabel" name="fileSizeValue">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="axisRangeGroupBox">
|
||||
<property name="title">
|
||||
<string>Angular Axis</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="xTitleLabel_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Title:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="TitleEdit_Angular">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter axis title...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="xMinLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Min:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="SpinBox_Min_Angular">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="yMinLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Max:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="SpinBox_Max_Angular">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>360.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="xCountLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="SpinBox_Count_Angular">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>13</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="xTitleLabel_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unit:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="TitleEdit_Unit_Angular">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter axis Unit...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QGroupBox" name="axisRangeGroupBox_2">
|
||||
<property name="title">
|
||||
<string>Radial Axis</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="xTitleLabel_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Title:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="TitleEdit_Radial">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter axis title...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="xMinLabel_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Min:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="SpinBox_Min_Radial">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="yMinLabel_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Max:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="SpinBox_Max_Radial">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="xCountLabel_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="SpinBox_Count_Radial">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="xTitleLabel_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unit:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="TitleEdit_Unit_Radial">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter axis Unit...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="curveGroupBox">
|
||||
<property name="title">
|
||||
<string>Curve Management</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="curveVerticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="curveButtonLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="curveListLabel">
|
||||
<property name="text">
|
||||
<string>Curves:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="curveButtonSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addCurveBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="removeCurveBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="curveListWidget">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="curvePropertiesGroupBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Selected Curve Properties</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="curvePropertiesGridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="curveNameLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="curveNameEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter curve name...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="curveColorLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="colorLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="colorButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select Color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="colorPreview">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string>background-color: rgb(255, 0, 0); border: 1px solid black;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="colorSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="dataStartLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Angular:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="SpinBox_Angular">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="dataStopLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Radial:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="SpinBox_Radial">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="xValueLabel">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>X Value:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="xValueSpinBox">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="yValueLabel">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Y Value:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="yValueSpinBox">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="buttonLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add File</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="chartGroupBox">
|
||||
<property name="title">
|
||||
<string>Chart Properties</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="chartGridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="SpinBox_time">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="timeParamLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="chartNameLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Chart Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="chartNameEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Chart 1</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter chart name...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
593
src/ui/WorkSpace/AddImageFileDlg.cpp
Normal file
593
src/ui/WorkSpace/AddImageFileDlg.cpp
Normal file
@ -0,0 +1,593 @@
|
||||
#include "AddImageFileDlg.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
#include <QColorDialog>
|
||||
#include <QListWidget>
|
||||
|
||||
#include "workspace/WorkSpace.h"
|
||||
#include "workspace/WorkSpaceManager.h"
|
||||
|
||||
#include "ui_AddImageDlg.h"
|
||||
|
||||
AddImageFileDlg::AddImageFileDlg(QWidget* parent)
|
||||
: BaseAddFileDlg(FileEntryType::Polar, parent)
|
||||
, ui(new Ui::AddImageDlg)
|
||||
, currentCurveIndex_(-1)
|
||||
, selectedColor_(255, 0, 0)
|
||||
{
|
||||
|
||||
SetupUI(ui);
|
||||
SetTitle(getDialogTitle());
|
||||
|
||||
setupConnections();
|
||||
}
|
||||
|
||||
AddImageFileDlg::~AddImageFileDlg()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
QString AddImageFileDlg::getFileFilter() const
|
||||
{
|
||||
return tr("Data Files (*.txt *.csv *.dat);;All Files (*.*)");
|
||||
}
|
||||
|
||||
QString AddImageFileDlg::getDialogTitle() const
|
||||
{
|
||||
return tr("Add Image");
|
||||
}
|
||||
|
||||
bool AddImageFileDlg::validateSpecificParams()
|
||||
{
|
||||
// File path validation
|
||||
const QString& selectFilePath = getSelectedFilePath();
|
||||
if (selectFilePath.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Validation Error"), tr("Please select a data file."));
|
||||
return false;
|
||||
}
|
||||
|
||||
// File existence validation
|
||||
QFileInfo fileInfo(selectFilePath);
|
||||
if (!fileInfo.exists())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Validation Error"), tr("Selected file does not exist."));
|
||||
return false;
|
||||
}
|
||||
|
||||
// File readability validation
|
||||
if (!fileInfo.isReadable())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Validation Error"), tr("Selected file is not readable. Please check file permissions."));
|
||||
return false;
|
||||
}
|
||||
|
||||
// File size validation (avoid memory issues with large files)
|
||||
if (fileInfo.size() > 100 * 1024 * 1024)
|
||||
{ // 100MB limit
|
||||
QMessageBox::warning(this, tr("Validation Error"), tr("File is too large (over 100MB). Please select a smaller file."));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Curve count validation
|
||||
if (curves_.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Validation Error"), tr("At least one curve must be defined."));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Save current curve properties
|
||||
if (currentCurveIndex_ >= 0)
|
||||
{
|
||||
saveCurveProperties();
|
||||
}
|
||||
|
||||
// Curve name uniqueness validation
|
||||
QStringList curveNames;
|
||||
for (int i = 0; i < curves_.size(); ++i)
|
||||
{
|
||||
const FileEntryPolar::LineProperty& curve = curves_[i];
|
||||
|
||||
if (curve.name.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Validation Error"),
|
||||
tr("Curve %1 name cannot be empty.").arg(i + 1));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (curveNames.contains(curve.name))
|
||||
{
|
||||
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));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Report type validation - ensure x and y values are reasonable
|
||||
if (curve.Angular < -1000000 || curve.Angular > 1000000)
|
||||
{
|
||||
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));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (curve.Radial < -1000000 || curve.Radial > 1000000)
|
||||
{
|
||||
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));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Chart properties validation
|
||||
if (ui->chartNameEdit->text().isEmpty())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Validation Error"), tr("Chart name cannot be empty."));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ui->chartNameEdit->text().length() > 100)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Validation Error"), tr("Chart name is too long. Please limit to 100 characters."));
|
||||
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)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Validation Error"), tr("Time parameter cannot be negative."));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddImageFileDlg::updateFileInfo(const QString& filePath)
|
||||
{
|
||||
QFileInfo fileInfo(filePath);
|
||||
if (fileInfo.exists()) {
|
||||
ui->fileNameValue->setText(fileInfo.fileName());
|
||||
qint64 size = fileInfo.size();
|
||||
QString sizeText;
|
||||
if (size < 1024) {
|
||||
sizeText = QString("%1 B").arg(size);
|
||||
}
|
||||
else if (size < 1024 * 1024) {
|
||||
sizeText = QString("%1 KB").arg(size / 1024.0, 0, 'f', 1);
|
||||
}
|
||||
else {
|
||||
sizeText = QString("%1 MB").arg(size / (1024.0 * 1024.0), 0, 'f', 1);
|
||||
}
|
||||
ui->fileSizeValue->setText(sizeText);
|
||||
}
|
||||
else {
|
||||
ui->fileNameValue->setText("-");
|
||||
ui->fileSizeValue->setText("-");
|
||||
}
|
||||
|
||||
ui->filePathEdit->setText(filePath);
|
||||
}
|
||||
|
||||
void AddImageFileDlg::setupConnections()
|
||||
{
|
||||
// File selection connections
|
||||
connect(ui->selectFileBtn, &QToolButton::clicked, this, &AddImageFileDlg::OnSelectFile);
|
||||
|
||||
// Curve management connections
|
||||
connect(ui->addCurveBtn, &QPushButton::clicked, this, &AddImageFileDlg::onAddCurveClicked);
|
||||
connect(ui->removeCurveBtn, &QPushButton::clicked, this, &AddImageFileDlg::onRemoveCurveClicked);
|
||||
connect(ui->curveListWidget, &QListWidget::currentRowChanged, this, &AddImageFileDlg::onCurveSelectionChanged);
|
||||
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<int>::of(&QSpinBox::valueChanged), this, &AddImageFileDlg::onCurveDataChanged);
|
||||
connect(ui->SpinBox_Radial, QOverload<int>::of(&QSpinBox::valueChanged), this, &AddImageFileDlg::onCurveDataChanged);
|
||||
|
||||
// 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
|
||||
if (currentCurveIndex_ >= 0)
|
||||
{
|
||||
saveCurveProperties();
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
// 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());
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem(displayText);
|
||||
ui->curveListWidget->addItem(item);
|
||||
++currentCurveIndex_;
|
||||
|
||||
ui->curveNameEdit->setText(newCurve.name);
|
||||
|
||||
// Select the new curve
|
||||
ui->curveListWidget->setCurrentRow(curves_.size() - 1);
|
||||
}
|
||||
|
||||
void AddImageFileDlg::onRemoveCurveClicked()
|
||||
{
|
||||
int currentRow = ui->curveListWidget->currentRow();
|
||||
if (currentRow < 0 || currentRow >= curves_.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't allow removing the last curve
|
||||
if (curves_.size() <= 0)
|
||||
{
|
||||
QMessageBox::information(this, "Information", "At least one curve must remain.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove from curves list and UI
|
||||
curves_.removeAt(currentRow);
|
||||
delete ui->curveListWidget->takeItem(currentRow);
|
||||
|
||||
// Update current index
|
||||
if (currentRow >= curves_.size())
|
||||
{
|
||||
currentRow = curves_.size() - 1;
|
||||
}
|
||||
|
||||
if (currentRow >= 0)
|
||||
{
|
||||
ui->curveListWidget->setCurrentRow(currentRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
currentCurveIndex_ = -1;
|
||||
clearCurveProperties();
|
||||
enableCurveProperties(false);
|
||||
}
|
||||
}
|
||||
|
||||
void AddImageFileDlg::onCurveListWidgetItemClicked(QListWidgetItem* item)
|
||||
{
|
||||
if (!item)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
onCurveSelectionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void AddImageFileDlg::onCurveSelectionChanged()
|
||||
{
|
||||
int currentRow = ui->curveListWidget->currentRow();
|
||||
|
||||
// Save previous curve properties
|
||||
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||
{
|
||||
saveCurveProperties();
|
||||
}
|
||||
|
||||
currentCurveIndex_ = currentRow;
|
||||
|
||||
if (currentRow >= 0 && currentRow < curves_.size())
|
||||
{
|
||||
// Load selected curve properties
|
||||
updateCurveProperties();
|
||||
enableCurveProperties(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
clearCurveProperties();
|
||||
enableCurveProperties(false);
|
||||
}
|
||||
}
|
||||
|
||||
void AddImageFileDlg::onCurveNameChanged()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AddImageFileDlg::saveCurveProperties()
|
||||
{
|
||||
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||
{
|
||||
curves_[currentCurveIndex_].name = ui->curveNameEdit->text();
|
||||
|
||||
// Save properties based on chart type
|
||||
curves_[currentCurveIndex_].Angular = ui->SpinBox_Angular->value();
|
||||
curves_[currentCurveIndex_].Radial = ui->SpinBox_Radial->value();
|
||||
|
||||
curves_[currentCurveIndex_].color = selectedColor_;
|
||||
}
|
||||
}
|
||||
|
||||
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_);
|
||||
}
|
||||
|
||||
void AddImageFileDlg::enableCurveProperties(bool enabled)
|
||||
{
|
||||
ui->curvePropertiesGroupBox->setEnabled(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];
|
||||
}
|
||||
|
||||
void AddImageFileDlg::updateCurveProperties()
|
||||
{
|
||||
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||
{
|
||||
const FileEntryPolar::LineProperty& curve = curves_[currentCurveIndex_];
|
||||
|
||||
ui->curveNameEdit->setText(curve.name);
|
||||
|
||||
ui->SpinBox_Angular->blockSignals(true);
|
||||
ui->SpinBox_Angular->setValue(curve.Angular);
|
||||
ui->SpinBox_Angular->blockSignals(false);
|
||||
|
||||
ui->SpinBox_Radial->blockSignals(true);
|
||||
ui->SpinBox_Radial->setValue(curve.Radial);
|
||||
ui->SpinBox_Radial->blockSignals(false);
|
||||
|
||||
selectedColor_ = curve.color;
|
||||
updateColorPreview(curve.color);
|
||||
}
|
||||
}
|
||||
|
||||
void AddImageFileDlg::onSure()
|
||||
{
|
||||
if (validateSpecificParams())
|
||||
{
|
||||
// Create FileEntryCurve object using factory function
|
||||
auto fileEntryPolar = CreateFileEntryPolar(getSelectedFilePath());
|
||||
if (!fileEntryPolar)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Failed to create file entry"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set curve properties
|
||||
fileEntryPolar->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();
|
||||
chartProps.timeParam = ui->SpinBox_time->value();
|
||||
fileEntryPolar->SetChartProperties(chartProps);
|
||||
|
||||
// Add curve properties
|
||||
for (const auto& curve : curves_)
|
||||
{
|
||||
fileEntryPolar->AddLineProperty(curve);
|
||||
}
|
||||
|
||||
// Get current workspace
|
||||
WorkSpace* workspace = WorkSpaceManager::Get().GetCurrent();
|
||||
if (!workspace)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Unable to get current workspace"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Add FileEntryCurve to workspace using new SetFileEntry method
|
||||
auto result = workspace->SetFileEntry(fileEntryPolar);
|
||||
if (result != WorkSpace::FileEntryResult::Ok)
|
||||
{
|
||||
QString errorMsg;
|
||||
switch (result) {
|
||||
case WorkSpace::FileEntryResult::LimitExceeded:
|
||||
errorMsg = tr("Polar file count has reached the limit (9 files)");
|
||||
break;
|
||||
case WorkSpace::FileEntryResult::Duplicate:
|
||||
errorMsg = tr("File already exists");
|
||||
break;
|
||||
case WorkSpace::FileEntryResult::CopyFailed:
|
||||
errorMsg = tr("File copy failed");
|
||||
break;
|
||||
case WorkSpace::FileEntryResult::InvalidFile:
|
||||
errorMsg = tr("Invalid file");
|
||||
break;
|
||||
default:
|
||||
errorMsg = tr("Failed to add file");
|
||||
break;
|
||||
}
|
||||
QMessageBox::warning(this, tr("Error"), errorMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Failed to create Polar file entry."));
|
||||
}
|
||||
}
|
||||
|
||||
void AddImageFileDlg::onCurveDataChanged()
|
||||
{
|
||||
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||
{
|
||||
curves_[currentCurveIndex_].Angular = ui->SpinBox_Angular->value();
|
||||
curves_[currentCurveIndex_].Radial = ui->SpinBox_Radial->value();
|
||||
|
||||
// Update display text in list widget
|
||||
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(curves_[currentCurveIndex_].color.red())
|
||||
.arg(curves_[currentCurveIndex_].color.green())
|
||||
.arg(curves_[currentCurveIndex_].color.blue());
|
||||
|
||||
item->setText(itemText);
|
||||
}
|
||||
}
|
||||
}
|
||||
61
src/ui/WorkSpace/AddImageFileDlg.h
Normal file
61
src/ui/WorkSpace/AddImageFileDlg.h
Normal file
@ -0,0 +1,61 @@
|
||||
#pragma once
|
||||
|
||||
#include "BaseAddFileDlg.h"
|
||||
#include "workspace/FileEntry.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QComboBox;
|
||||
class QLineEdit;
|
||||
class QSpinBox;
|
||||
class QDoubleSpinBox;
|
||||
class QListWidget;
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Ui {
|
||||
class AddImageDlg;
|
||||
}
|
||||
|
||||
class AddImageFileDlg : public BaseAddFileDlg
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AddImageFileDlg(QWidget* parent = nullptr);
|
||||
~AddImageFileDlg() override;
|
||||
|
||||
protected:
|
||||
QString getFileFilter() const override;
|
||||
QString getDialogTitle() const override;
|
||||
bool validateSpecificParams() override;
|
||||
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 onSure();
|
||||
|
||||
private:
|
||||
void setupConnections();
|
||||
void updateColorPreview(const QColor& color);
|
||||
void updateCurveProperties();
|
||||
void saveCurveProperties();
|
||||
void clearCurveProperties();
|
||||
void enableCurveProperties(bool enabled);
|
||||
QString generateCurveName();
|
||||
QColor generateCurveColor() const;
|
||||
|
||||
private:
|
||||
Ui::AddImageDlg* ui;
|
||||
int currentCurveIndex_;
|
||||
QColor selectedColor_;
|
||||
|
||||
FileEntryPolar::ChartProperties chartProperties_;
|
||||
FileEntryPolar::LineProperties curves_;
|
||||
};
|
||||
@ -104,7 +104,7 @@ void DYTChart::InitChartData(QVariant var)
|
||||
InitXTable(strFilePathX);
|
||||
InitYTable(strFilePathY);
|
||||
|
||||
// <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 三维曲线
|
||||
if (m_iCurveType == 3)
|
||||
{
|
||||
QString strFilePathZ = varCurParamMap.value("zFile").toString();
|
||||
@ -130,7 +130,7 @@ void DYTChart::InitChart(int iType)
|
||||
ui.comboBox->hide();
|
||||
|
||||
|
||||
if (1 == iType) // <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (1 == iType) // 二维曲线
|
||||
{
|
||||
/*m_p2DCurve = new FitCurveDialog(1);
|
||||
m_p2DCurve->show();
|
||||
@ -150,7 +150,7 @@ void DYTChart::InitChart(int iType)
|
||||
ui.label_7->hide();
|
||||
ui.toolButton_10->hide();
|
||||
}
|
||||
else if (2 == iType) // <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD>y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
else if (2 == iType) // 二维曲线(y轴对数)
|
||||
{
|
||||
//m_p2DLgCurve = new FitCurveDialog(2);
|
||||
////ui.stackedWidget->insertWidget(0, m_p2DLgCurve);
|
||||
@ -171,7 +171,7 @@ void DYTChart::InitChart(int iType)
|
||||
ui.label_7->hide();
|
||||
ui.toolButton_10->hide();
|
||||
}
|
||||
else // <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
else // 三维曲线
|
||||
{
|
||||
ui.label_13->hide();
|
||||
ui.comboBox_3->hide();
|
||||
@ -267,11 +267,11 @@ void DYTChart::ParseAntennaPatternFile(const QString& strFile, std::vector<std::
|
||||
{
|
||||
if (strFile.isEmpty())
|
||||
{
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("<22><>ʾ"), QString::fromLocal8Bit("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>AntennaPattern<72>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请检查数据AntennaPattern文件路径!"));
|
||||
return;
|
||||
|
||||
}
|
||||
// <EFBFBD><EFBFBD>ȡz<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 读取z轴数据
|
||||
QFile file(strFile);
|
||||
if (file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
@ -296,7 +296,7 @@ void DYTChart::ParseBeamPointFile(const QString& strFile, std::vector<std::vecto
|
||||
{
|
||||
if (strFile.isEmpty())
|
||||
{
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("<22><>ʾ"), QString::fromLocal8Bit("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BeamPoint<6E>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请检查数据BeamPoint文件路径!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -324,7 +324,7 @@ void DYTChart::ParseRD(const QString& strFile, std::vector<std::vector<float>>&
|
||||
{
|
||||
if (strFile.isEmpty())
|
||||
{
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("<22><>ʾ"), QString::fromLocal8Bit("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RD<52>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请检查数据RD文件路径!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ void DYTChart::ParseRD(const QString& strFile, std::vector<std::vector<float>>&
|
||||
if (file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
int iRow = 0;
|
||||
int iStartReadRow = iRowCount * m_iCurTime; // <EFBFBD><EFBFBD>ʼ <20><>
|
||||
int iStartReadRow = iRowCount * m_iCurTime; // 起始 行
|
||||
while (!file.atEnd())
|
||||
{
|
||||
if (iRow >= iStartReadRow && (iRow - iStartReadRow) <= iRowCount)
|
||||
@ -366,7 +366,7 @@ void DYTChart::ParseWave(const QString& strFile, std::vector<std::vector<float>>
|
||||
{
|
||||
if (strFile.isEmpty())
|
||||
{
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("<22><>ʾ"), QString::fromLocal8Bit("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Wave<76>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请检查数据Wave文件路径!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -374,7 +374,7 @@ void DYTChart::ParseWave(const QString& strFile, std::vector<std::vector<float>>
|
||||
if (file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
int iRow = 0;
|
||||
int iStartReadRow = iRowCount * m_iCurTime; // <EFBFBD><EFBFBD>ʼ <20><>
|
||||
int iStartReadRow = iRowCount * m_iCurTime; // 起始 行
|
||||
while (!file.atEnd())
|
||||
{
|
||||
if (iRow >= iStartReadRow && (iRow - iStartReadRow) <= iRowCount)
|
||||
@ -769,33 +769,33 @@ void DYTChart::UpdateRDCurve(int iTime, int iSelRowCount)
|
||||
varCurDataList.push_back(varX);
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
||||
// 曲线颜色
|
||||
QColor curColor;
|
||||
curColor.setNamedColor(ui.label_4->text());
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 曲线名称
|
||||
QString strName = ui.lineEdit_2->text();
|
||||
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0һ<30><D2BB>1<EFBFBD><31><EFBFBD><EFBFBD>
|
||||
// y轴类型 0一般1对数
|
||||
int iYType = 0;
|
||||
if (2 == m_iCurveType)
|
||||
{
|
||||
iYType = 1;
|
||||
}
|
||||
|
||||
// x<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// x轴数据
|
||||
QString strFilePathX = ui.lineEdit->text();
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// y轴数据
|
||||
QString strFilePathY = ui.lineEdit_3->text();
|
||||
// Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Z轴数据
|
||||
QString strFilePathZ = ui.lineEdit_9->text();
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 曲线类型
|
||||
//int iCurveType = ui.comboBox_2->currentIndex();
|
||||
// x<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// x标题
|
||||
QString strXTitle = ui.lineEdit_10->text();
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// y标题
|
||||
QString strYTitle = ui.lineEdit_11->text();
|
||||
// z<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// z标题
|
||||
QString strZTitle = ui.lineEdit_12->text();
|
||||
|
||||
int iXCol = 0, iYCol = 0, iZCol = 0;
|
||||
@ -866,10 +866,10 @@ void DYTChart::Clear()
|
||||
|
||||
void DYTChart::slotSelXFile()
|
||||
{
|
||||
QString strFilePath = QFileDialog::getOpenFileName(nullptr, QString::fromLocal8Bit("ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), "home", "*.txt");
|
||||
QString strFilePath = QFileDialog::getOpenFileName(nullptr, QString::fromLocal8Bit("选择数据文件"), "home", "*.txt");
|
||||
if (strFilePath.isEmpty())
|
||||
{
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请选择有效的文件路径!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -880,10 +880,10 @@ void DYTChart::slotSelXFile()
|
||||
|
||||
void DYTChart::slotSelYFile()
|
||||
{
|
||||
QString strFilePath = QFileDialog::getOpenFileName(nullptr, QString::fromLocal8Bit("ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), "home", "*.txt");
|
||||
QString strFilePath = QFileDialog::getOpenFileName(nullptr, QString::fromLocal8Bit("选择数据文件"), "home", "*.txt");
|
||||
if (strFilePath.isEmpty())
|
||||
{
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请选择有效的文件路径!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -894,10 +894,10 @@ void DYTChart::slotSelYFile()
|
||||
|
||||
void DYTChart::slotSelZFile()
|
||||
{
|
||||
QString strFilePath = QFileDialog::getOpenFileName(nullptr, QString::fromLocal8Bit("ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), "home", "*.txt");
|
||||
QString strFilePath = QFileDialog::getOpenFileName(nullptr, QString::fromLocal8Bit("选择数据文件"), "home", "*.txt");
|
||||
if (strFilePath.isEmpty())
|
||||
{
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("请选择有效的文件路径!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -997,19 +997,19 @@ void DYTChart::slotAdd()
|
||||
}
|
||||
|
||||
|
||||
// x<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// x轴数据
|
||||
QString strFilePathX = ui.lineEdit->text();
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// y轴数据
|
||||
QString strFilePathY = ui.lineEdit_3->text();
|
||||
// Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Z轴数据
|
||||
QString strFilePathZ = ui.lineEdit_9->text();
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 曲线类型
|
||||
//int iCurveType = ui.comboBox_2->currentIndex();
|
||||
// x<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// x标题
|
||||
QString strXTitle = ui.lineEdit_10->text();
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// y标题
|
||||
QString strYTitle = ui.lineEdit_11->text();
|
||||
// z<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// z标题
|
||||
QString strZTitle = ui.lineEdit_12->text();
|
||||
|
||||
std::vector<float> vecX;
|
||||
@ -1017,7 +1017,7 @@ void DYTChart::slotAdd()
|
||||
std::vector<std::vector<float>> vecZ;
|
||||
|
||||
int iXCol = 0, iYCol = 0, iZCol = 0;
|
||||
// <EFBFBD><EFBFBD>ȡx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 读取x轴数据
|
||||
{
|
||||
iXCol = ui.comboBox_2->currentIndex();
|
||||
int iRowCount = ui.tableWidget->rowCount();
|
||||
@ -1037,12 +1037,12 @@ void DYTChart::slotAdd()
|
||||
}
|
||||
else
|
||||
{
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("X<><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("X轴数据文件加载失败,请检测文件是否正常!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD>ȡy<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 读取y轴数据
|
||||
{
|
||||
iYCol = ui.comboBox_4->currentIndex();
|
||||
int iRowCount = ui.tableWidget_2->rowCount();
|
||||
@ -1059,12 +1059,12 @@ void DYTChart::slotAdd()
|
||||
}
|
||||
else
|
||||
{
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("Y<><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("Y轴数据文件加载失败,请检测文件是否正常!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 三维曲线
|
||||
if (m_iCurveType == 3)
|
||||
{
|
||||
//iZCol = ui.comboBox_5->currentIndex();
|
||||
@ -1089,23 +1089,23 @@ void DYTChart::slotAdd()
|
||||
}
|
||||
else
|
||||
{
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("Z<><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("Z轴数据文件加载失败,请检测文件是否正常!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵij<EFBFBD><EFBFBD>ȣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD>ȶ<EFBFBD><EFBFBD><EFBFBD>
|
||||
// 对齐两组数据的长度,按最小长度对齐
|
||||
size_t min_size = std::min({ vecX.size(), vecY.size() });
|
||||
if (vecZ.size() > 0)
|
||||
{
|
||||
min_size = std::min({ min_size, vecZ.size() });
|
||||
}
|
||||
|
||||
// <EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 合并数据
|
||||
QVariantList varCurDataList;
|
||||
for (size_t i = 0; i < min_size; i++)
|
||||
{
|
||||
if (m_iCurveType == 3) // <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (m_iCurveType == 3) // 三维曲线数据
|
||||
{
|
||||
std::vector<float> vecZRow = vecZ[i];
|
||||
|
||||
@ -1128,21 +1128,21 @@ void DYTChart::slotAdd()
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
||||
// 曲线颜色
|
||||
QColor curColor;
|
||||
curColor.setNamedColor(ui.label_4->text());
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 曲线名称
|
||||
QString strName = ui.lineEdit_2->text();
|
||||
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0һ<30><D2BB>1<EFBFBD><31><EFBFBD><EFBFBD>
|
||||
// y轴类型 0一般1对数
|
||||
int iYType = 0;
|
||||
if (2 == m_iCurveType)
|
||||
{
|
||||
iYType = 1;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
||||
// 曲线ID
|
||||
m_iCurveID++;
|
||||
m_iCurSelID = m_iCurveID;
|
||||
|
||||
@ -1200,19 +1200,19 @@ void DYTChart::slotUpdate()
|
||||
return;
|
||||
}
|
||||
|
||||
// x<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// x轴数据
|
||||
QString strFilePathX = ui.lineEdit->text();
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// y轴数据
|
||||
QString strFilePathY = ui.lineEdit_3->text();
|
||||
// Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Z轴数据
|
||||
QString strFilePathZ = ui.lineEdit_9->text();
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 曲线类型
|
||||
//int iCurveType = ui.comboBox_2->currentIndex();
|
||||
// x<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// x标题
|
||||
QString strXTitle = ui.lineEdit_10->text();
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// y标题
|
||||
QString strYTitle = ui.lineEdit_11->text();
|
||||
// z<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// z标题
|
||||
QString strZTitle = ui.lineEdit_12->text();
|
||||
|
||||
std::vector<float> vecX;
|
||||
@ -1220,7 +1220,7 @@ void DYTChart::slotUpdate()
|
||||
std::vector<std::vector<float>> vecZ;
|
||||
|
||||
int iXCol = 0, iYCol = 0, iZCol = 0;
|
||||
// <EFBFBD><EFBFBD>ȡx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 读取x轴数据
|
||||
{
|
||||
iXCol = ui.comboBox_2->currentIndex();
|
||||
int iRowCount = ui.tableWidget->rowCount();
|
||||
@ -1240,12 +1240,12 @@ void DYTChart::slotUpdate()
|
||||
}
|
||||
else
|
||||
{
|
||||
//QMessageBox::information(nullptr, QString::fromLocal8Bit("<22><>ʾ"), QString::fromLocal8Bit("X<><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("X轴数据文件加载失败,请检测文件是否正常!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD>ȡy<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 读取y轴数据
|
||||
{
|
||||
iYCol = ui.comboBox_4->currentIndex();
|
||||
int iRowCount = ui.tableWidget_2->rowCount();
|
||||
@ -1262,12 +1262,12 @@ void DYTChart::slotUpdate()
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("Y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("Y轴数据文件加载失败,请检测文件是否正常!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 三维曲线
|
||||
if (m_iCurveType == 3)
|
||||
{
|
||||
//iZCol = ui.comboBox_5->currentIndex();
|
||||
@ -1292,23 +1292,23 @@ void DYTChart::slotUpdate()
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("<EFBFBD><EFBFBD>ʾ"), QString::fromLocal8Bit("Z<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||
QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("Z轴数据文件加载失败,请检测文件是否正常!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵij<EFBFBD><EFBFBD>ȣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD>ȶ<EFBFBD><EFBFBD><EFBFBD>
|
||||
// 对齐两组数据的长度,按最小长度对齐
|
||||
size_t min_size = std::min({ vecX.size(), vecY.size() });
|
||||
if (vecZ.size() > 0)
|
||||
{
|
||||
min_size = std::min({ min_size, vecZ.size() });
|
||||
}
|
||||
|
||||
// <EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 合并数据
|
||||
QVariantList varCurDataList;
|
||||
for (size_t i = 0; i < min_size; i++)
|
||||
{
|
||||
if (m_iCurveType == 3) // <EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (m_iCurveType == 3) // 三维曲线数据
|
||||
{
|
||||
std::vector<float> vecZRow = vecZ[i];
|
||||
|
||||
@ -1331,14 +1331,14 @@ void DYTChart::slotUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
||||
// 曲线颜色
|
||||
QColor curColor;
|
||||
curColor.setNamedColor(ui.label_4->text());
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 曲线名称
|
||||
QString strName = ui.lineEdit_2->text();
|
||||
|
||||
// y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0һ<30><D2BB>1<EFBFBD><31><EFBFBD><EFBFBD>
|
||||
// y轴类型 0一般1对数
|
||||
int iYType = 0;
|
||||
if (2 == m_iCurveType)
|
||||
{
|
||||
@ -1458,7 +1458,7 @@ void DYTChart::slotUpdateTime(double iTime)
|
||||
std::vector<float> vecY;
|
||||
std::vector<std::vector<float>> vecZ;
|
||||
|
||||
// <EFBFBD><EFBFBD>ȡx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 读取x轴数据
|
||||
{
|
||||
int iRowCount = ui.tableWidget->rowCount();
|
||||
if (iRowCount > 0)
|
||||
@ -1477,7 +1477,7 @@ void DYTChart::slotUpdateTime(double iTime)
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD>ȡy<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 读取y轴数据
|
||||
{
|
||||
int iRowCount = ui.tableWidget_2->rowCount();
|
||||
if (iRowCount > 0)
|
||||
@ -1493,14 +1493,14 @@ void DYTChart::slotUpdateTime(double iTime)
|
||||
}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵij<EFBFBD><EFBFBD>ȣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD>ȶ<EFBFBD><EFBFBD><EFBFBD>
|
||||
// 对齐两组数据的长度,按最小长度对齐
|
||||
size_t min_size = std::min({ vecX.size(), vecY.size() });
|
||||
if (vecZ.size() > 0)
|
||||
{
|
||||
min_size = std::min({ min_size, vecZ.size() });
|
||||
}
|
||||
|
||||
// <EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 合并数据
|
||||
QVariantList varCurDataList;
|
||||
for (size_t i = 0; i < min_size; i++)
|
||||
{
|
||||
|
||||
@ -161,7 +161,7 @@ osgQt::GraphicsWindowQt* OsgWidget::createGraphicsWindow(int x, int y, int w, in
|
||||
traits->alpha = ds->getMinimumNumAlphaBits();
|
||||
traits->stencil = ds->getMinimumNumStencilBits();
|
||||
traits->sampleBuffers = ds->getMultiSamples();
|
||||
traits->samples = ds->getNumMultiSamples();
|
||||
traits->samples = 16/*ds->getNumMultiSamples()*/;
|
||||
|
||||
return new osgQt::GraphicsWindowQt(traits.get());
|
||||
}
|
||||
|
||||
@ -46,6 +46,8 @@ std::shared_ptr<FileEntry> CreateFileEntry(FileEntryType type, const QString& fi
|
||||
return CreateFileEntryLight(filePath);
|
||||
case FileEntryType::Polar:
|
||||
return CreateFileEntryPolar(filePath);
|
||||
case FileEntryType::Image:
|
||||
return CreateFileEntryImage(filePath);
|
||||
default:
|
||||
LOG_ERROR("Unknown FileEntryType: {}", static_cast<int>(type));
|
||||
return nullptr;
|
||||
@ -122,6 +124,20 @@ std::shared_ptr<FileEntryPolar> CreateFileEntryPolar(const QString& filePath) {
|
||||
return fileEntry;
|
||||
}
|
||||
|
||||
std::shared_ptr<FileEntryImage> CreateFileEntryImage(const QString& filePath) {
|
||||
QFileInfo fileInfo(filePath);
|
||||
if (!fileInfo.exists()) {
|
||||
LOG_ERROR("File does not exist: {}", filePath.toUtf8().constData());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto fileEntry = std::make_shared<FileEntryImage>();
|
||||
fileEntry->SetPath(filePath);
|
||||
fileEntry->SetName(fileInfo.baseName()); // Use base name as default display name
|
||||
|
||||
return fileEntry;
|
||||
}
|
||||
|
||||
// Factory functions for creating empty FileEntry objects (for XML parsing)
|
||||
std::shared_ptr<FileEntry> CreateEmptyFileEntry(FileEntryType type) {
|
||||
switch (type) {
|
||||
@ -135,6 +151,8 @@ std::shared_ptr<FileEntry> CreateEmptyFileEntry(FileEntryType type) {
|
||||
return CreateEmptyFileEntryLight();
|
||||
case FileEntryType::Polar:
|
||||
return CreateEmptyFileEntryPolar();
|
||||
case FileEntryType::Image:
|
||||
return CreateEmptyFileEntryImage();
|
||||
default:
|
||||
LOG_ERROR("Unknown FileEntryType: {}", static_cast<int>(type));
|
||||
return nullptr;
|
||||
@ -171,6 +189,12 @@ std::shared_ptr<FileEntryPolar> CreateEmptyFileEntryPolar() {
|
||||
return fileEntry;
|
||||
}
|
||||
|
||||
std::shared_ptr<FileEntryImage> CreateEmptyFileEntryImage() {
|
||||
auto fileEntry = std::make_shared<FileEntryImage>();
|
||||
// Don't set path or name - these will be set during XML parsing
|
||||
return fileEntry;
|
||||
}
|
||||
|
||||
// FileEntrySurface method implementations
|
||||
void FileEntrySurface::SetChartProperties(const ChartProperties& properties) {
|
||||
chartProperties_ = properties;
|
||||
@ -808,3 +832,36 @@ bool FileEntryPolar::ParseFiles(const tinyxml2::XMLElement* chartElement) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void FileEntryImage::SetChartProperties(const ChartProperties& properties) {
|
||||
chartProperties_ = properties;
|
||||
}
|
||||
|
||||
const FileEntryImage::ChartProperties& FileEntryImage::GetChartProperties() const {
|
||||
return chartProperties_;
|
||||
}
|
||||
|
||||
void FileEntryImage::AddImageProperty(const ImageProperty& image) {
|
||||
imageProperties_.append(image);
|
||||
}
|
||||
|
||||
void FileEntryImage::RemoveImageProperty(int index) {
|
||||
if (index >= 0 && index < imageProperties_.size()) {
|
||||
imageProperties_.removeAt(index);
|
||||
}
|
||||
}
|
||||
|
||||
void FileEntryImage::SetImageProperty(int index, const ImageProperty& surface) {
|
||||
if (index >= 0 && index < imageProperties_.size()) {
|
||||
imageProperties_[index] = surface;
|
||||
}
|
||||
}
|
||||
|
||||
const FileEntryImage::ImageProperties& FileEntryImage::GetImageProperties() const {
|
||||
return imageProperties_;
|
||||
}
|
||||
|
||||
FileEntryImage* FileEntryImage::AsImage() {
|
||||
return this;
|
||||
}
|
||||
@ -9,7 +9,8 @@ enum class FileEntryType {
|
||||
Surface,
|
||||
Table,
|
||||
Light,
|
||||
Polar
|
||||
Polar,
|
||||
Image
|
||||
};
|
||||
|
||||
enum class ChartType {
|
||||
@ -39,6 +40,7 @@ inline const char* FileEntryTypeToString(FileEntryType t) {
|
||||
case FileEntryType::Table: return "table";
|
||||
case FileEntryType::Light: return "light";
|
||||
case FileEntryType::Polar: return "polar";
|
||||
case FileEntryType::Image: return "image";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
@ -50,6 +52,7 @@ inline bool FileEntryTypeFromString(const char* s, FileEntryType& out) {
|
||||
if (0 == strcmp(s, "table")) { out = FileEntryType::Table; return true; }
|
||||
if (0 == strcmp(s, "light")) { out = FileEntryType::Light; return true; }
|
||||
if (0 == strcmp(s, "polar")) { out = FileEntryType::Polar; return true; }
|
||||
if (0 == strcmp(s, "image")) { out = FileEntryType::Image; return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -58,6 +61,7 @@ class FileEntryLight;
|
||||
class FileEntrySurface;
|
||||
class FileEntryTable;
|
||||
class FileEntryPolar;
|
||||
class FileEntryImage;
|
||||
|
||||
class FileEntry {
|
||||
public:
|
||||
@ -80,6 +84,7 @@ public:
|
||||
virtual FileEntrySurface* AsSurface() { return nullptr; }
|
||||
virtual FileEntryTable* AsTable() { return nullptr; }
|
||||
virtual FileEntryPolar* AsPolar() { return nullptr; }
|
||||
virtual FileEntryImage* AsImage() { return nullptr; }
|
||||
|
||||
virtual bool ParseFiles(const tinyxml2::XMLElement* element) { return false; }
|
||||
virtual bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) { return false; }
|
||||
@ -101,6 +106,7 @@ std::shared_ptr<FileEntry> CreateFileEntrySurface(const QString& filePath);
|
||||
std::shared_ptr<FileEntryTable> CreateFileEntryTable(const QString& filePath);
|
||||
std::shared_ptr<FileEntryLight> CreateFileEntryLight(const QString& filePath);
|
||||
std::shared_ptr<FileEntryPolar> CreateFileEntryPolar(const QString& filePath);
|
||||
std::shared_ptr<FileEntryImage> CreateFileEntryImage(const QString& filePath);
|
||||
|
||||
// Factory functions for creating empty FileEntry objects (for XML parsing)
|
||||
std::shared_ptr<FileEntry> CreateEmptyFileEntry(FileEntryType type);
|
||||
@ -109,6 +115,7 @@ std::shared_ptr<FileEntry> CreateEmptyFileEntrySurface();
|
||||
std::shared_ptr<FileEntryTable> CreateEmptyFileEntryTable();
|
||||
std::shared_ptr<FileEntryLight> CreateEmptyFileEntryLight();
|
||||
std::shared_ptr<FileEntryPolar> CreateEmptyFileEntryPolar();
|
||||
std::shared_ptr<FileEntryImage> CreateEmptyFileEntryImage();
|
||||
|
||||
|
||||
class FileEntryCurve : public FileEntry {
|
||||
@ -351,3 +358,53 @@ private:
|
||||
ChartProperties chartProperties_;
|
||||
LineProperties lineProperties_;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
using ImageProperties = QList<ImageProperty>;
|
||||
|
||||
public:
|
||||
FileEntryImage() { type_ = FileEntryType::Image; }
|
||||
|
||||
// Chart properties management
|
||||
void SetChartProperties(const ChartProperties& properties);
|
||||
const ChartProperties& GetChartProperties() const;
|
||||
|
||||
// Line properties management
|
||||
void AddImageProperty(const ImageProperty& image);
|
||||
void RemoveImageProperty(int index);
|
||||
void SetImageProperty(int index, const ImageProperty& image);
|
||||
const ImageProperties& GetImageProperties() const;
|
||||
|
||||
// Type conversion
|
||||
FileEntryImage* AsImage() override;
|
||||
|
||||
//// XML处理方法
|
||||
//bool SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) override;
|
||||
//bool ParseFiles(const tinyxml2::XMLElement* element) override;
|
||||
|
||||
private:
|
||||
ChartProperties chartProperties_;
|
||||
ImageProperties imageProperties_;
|
||||
};
|
||||
@ -43,13 +43,13 @@ WorkSpace* WorkSpaceManager::LoadDefaultWorkspace(class OEScene* secen) {
|
||||
|
||||
WorkSpace* workspace = nullptr;
|
||||
|
||||
const QString workspaceDir = Application::GetWorkSpacePath();
|
||||
QFileInfo fileInfo(path);
|
||||
if (fileInfo.exists()) {
|
||||
workspace = LoadDyt(path);
|
||||
} else {
|
||||
const QString workspaceDir = Application::GetWorkSpacePath();
|
||||
QString newPath = QString("%1/%2/%3").arg(workspaceDir).arg(fileInfo.baseName()).arg(fileInfo.fileName());
|
||||
QFileInfo newFileInfo(newPath);
|
||||
if (newFileInfo.exists()) {
|
||||
workspace = LoadDyt(newPath);
|
||||
} else {
|
||||
newPath = QString("%1/%2").arg(workspaceDir).arg(fileInfo.fileName());
|
||||
workspace = LoadDyt(newPath);
|
||||
}
|
||||
@ -82,9 +82,11 @@ void WorkSpaceManager::SaveDefaultWorkspace() {
|
||||
current->Save();
|
||||
QString path = current->GetPath();
|
||||
QFileInfo fileInfo(path);
|
||||
LOG_INFO("save default workspace name:{}", fileInfo.fileName().toLocal8Bit().constData());
|
||||
LOG_INFO("save default workspace name:{}, path:{}",
|
||||
fileInfo.fileName().toLocal8Bit().constData(),
|
||||
path.toLocal8Bit().constData());
|
||||
QSettings settings(iniFile, QSettings::IniFormat);
|
||||
settings.setValue("workspace/name", fileInfo.fileName());
|
||||
settings.setValue("workspace/name", path);
|
||||
}
|
||||
|
||||
bool WorkSpaceManager::Contains(const QString& name) const {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user