modify matlab

This commit is contained in:
jiegeaiai 2025-01-03 08:24:38 +08:00
parent f71749105e
commit 6af67249a3
25 changed files with 2269 additions and 167 deletions

View File

@ -4,7 +4,7 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -169,6 +169,9 @@ target_link_libraries(
Triton-MT-DLL
libMatlabDataArray
libMatlabEngine
libeng
libmx
libmat
# python39
)

View File

@ -37,11 +37,12 @@ static void LogMessageOutput(QtMsgType type, const QMessageLogContext& context,
SpdLogger::SpdLogger(const std::string& filename, int flush) {
constexpr std::size_t max_size = 1024 * 1024 * 10;
constexpr std::size_t max_files = 5;
//auto tp = std::make_shared<spdlog::details::thread_pool>(1, 1);
//std::shared_ptr<spdlog::logger> logHander = spdlog::rotating_logger_mt<spdlog::async_factory>(LoggerName, filename, max_size, max_files);
auto file_sink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(filename, max_size, max_files);
auto console_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
const char* pFormat = "[%Y-%m-%d %H:%M:%S.%e][%t][%^%l%$][%@]%v";
std::string pFormat("[%Y-%m-%d %H:%M:%S.%e][%t][%^%l%$][%@]%v");
file_sink->set_pattern(pFormat);
console_sink->set_pattern(pFormat);
std::vector<spdlog::sink_ptr> sinks;

View File

@ -1,5 +1,6 @@
#pragma once
#include <map>
#include <osg/Node>
#include <osg/MatrixTransform>
@ -17,6 +18,6 @@ public:
osg::MatrixTransform* ReadNode(const std::string& file);
private:
using NodeMap = std::unordered_map<std::string, osg::ref_ptr<osg::Node>>;
using NodeMap = std::map<std::string, osg::ref_ptr<osg::Node>>;
NodeMap nodes_;
};

View File

@ -4,10 +4,25 @@
<context>
<name>AddParamSetting</name>
<message>
<location filename="../ui/Layout/AddParamSetting.cpp" line="52"/>
<location filename="../ui/Layout/AddParamSetting.cpp" line="64"/>
<source>ParamSetting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/AddParamSetting.cpp" line="104"/>
<source>input param name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/AddParamSetting.cpp" line="111"/>
<source>input param descript</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/AddParamSetting.cpp" line="167"/>
<source>input value</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AddParamSettingClass</name>
@ -52,17 +67,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/AddParamSetting.ui" line="67"/>
<location filename="../ui/Layout/AddParamSetting.ui" line="56"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/AddParamSetting.ui" line="72"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/AddParamSetting.ui" line="80"/>
<location filename="../ui/Layout/AddParamSetting.ui" line="85"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/AddParamSetting.ui" line="93"/>
<location filename="../ui/Layout/AddParamSetting.ui" line="98"/>
<source></source>
<translation type="unfinished"></translation>
</message>
@ -90,6 +110,37 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodeEdtUI</name>
<message>
<location filename="../ui/Layout/CodeEdtUI.cpp" line="34"/>
<source>&amp;file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/CodeEdtUI.cpp" line="35"/>
<source>&amp;Import the template</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/CodeEdtUI.cpp" line="36"/>
<source>&amp;save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/CodeEdtUI.cpp" line="59"/>
<source>matlab editor</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodeEdtUIClass</name>
<message>
<location filename="../ui/Layout/CodeEdtUI.ui" line="16"/>
<source>CodeEdtUI</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DYTChart</name>
<message>
@ -221,6 +272,61 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DockChildList</name>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="381"/>
<source>Added a window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="390"/>
<source>Central area</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="400"/>
<source>Left area</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="410"/>
<source>Upper area</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="420"/>
<source>Right area</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="430"/>
<source>Underneath the area</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="582"/>
<source>delete Window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="598"/>
<location filename="../ui/Layout/DockChildList.cpp" line="611"/>
<source>Move down</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="603"/>
<location filename="../ui/Layout/DockChildList.cpp" line="608"/>
<source>Move up</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/DockChildList.cpp" line="622"/>
<source>add window</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DockTitleBar</name>
<message>
@ -260,29 +366,29 @@
<message>
<location filename="../ui/Menu/FileManagerMenu.ui" line="14"/>
<source>FileManagerMenu</source>
<translation type="unfinished"></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/FileManagerMenu.cpp" line="44"/>
<location filename="../ui/Menu/FileManagerMenu.cpp" line="60"/>
<source>Dyt (*.dyt)</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/FileManagerMenu.cpp" line="47"/>
<source>open dyt file</source>
<translation>dyt文件</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/FileManagerMenu.cpp" line="48"/>
<location filename="../ui/Menu/FileManagerMenu.cpp" line="64"/>
<source>Dyt (*.dyt);;All files (*.*)</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/FileManagerMenu.cpp" line="63"/>
<source>save dyt file</source>
<translation>Dyt文件</translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -290,7 +396,7 @@
<message>
<location filename="../ui/chartPlot/FitCurveChartView.ui" line="16"/>
<source>FitCurveChartView</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -298,17 +404,17 @@
<message>
<location filename="../ui/chartPlot/FitCurveDialog.ui" line="14"/>
<source>FitCurveDialog</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/chartPlot/FitCurveDialog.cpp" line="743"/>
<source>2D Curve</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/chartPlot/FitCurveDialog.cpp" line="747"/>
<source>2D(y(lg)) Curve</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -316,22 +422,22 @@
<message>
<location filename="../ui/FrameTitleBar.ui" line="20"/>
<source>Frame</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/FrameTitleBar.cpp" line="114"/>
<source>default</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/FrameTitleBar.cpp" line="114"/>
<source>silver</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/FrameTitleBar.cpp" line="114"/>
<source>blue</source>
<translation>绿</translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -339,7 +445,7 @@
<message>
<location filename="../ui/Layout/LayoutSettingUI.ui" line="16"/>
<source>LayoutSettingUI</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -347,37 +453,37 @@
<message>
<location filename="../ui/MainFrame.cpp" line="40"/>
<source>Dyt</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainFrame.cpp" line="99"/>
<source>file manager</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainFrame.cpp" line="101"/>
<source>view manager</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainFrame.cpp" line="102"/>
<source>plan manager</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainFrame.cpp" line="103"/>
<source>dynamic display</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainFrame.cpp" line="106"/>
<source>system manager</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainFrame.cpp" line="109"/>
<source>play manager</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -385,60 +491,156 @@
<message>
<location filename="../ui/MainWindow.ui" line="14"/>
<source>MainWindow</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="70"/>
<location filename="../ui/MainWindow.cpp" line="71"/>
<source>model elements</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="76"/>
<location filename="../ui/MainWindow.cpp" line="77"/>
<source>attribte</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="112"/>
<location filename="../ui/MainWindow.cpp" line="113"/>
<source>Wave Curve</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="121"/>
<location filename="../ui/MainWindow.cpp" line="122"/>
<source>Speed Curve</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="131"/>
<location filename="../ui/MainWindow.cpp" line="132"/>
<source>3D Curve</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="157"/>
<location filename="../ui/MainWindow.cpp" line="145"/>
<location filename="../ui/MainWindow.cpp" line="171"/>
<source>Target number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="145"/>
<location filename="../ui/MainWindow.cpp" line="171"/>
<source>Signal-to-noise ratio</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="146"/>
<location filename="../ui/MainWindow.cpp" line="172"/>
<source>Azimuth line of sight</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="146"/>
<location filename="../ui/MainWindow.cpp" line="172"/>
<source>Pitch gaze angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="147"/>
<location filename="../ui/MainWindow.cpp" line="173"/>
<source>azimuth</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="147"/>
<location filename="../ui/MainWindow.cpp" line="173"/>
<source>Pitch angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="148"/>
<location filename="../ui/MainWindow.cpp" line="174"/>
<source>attribute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="148"/>
<location filename="../ui/MainWindow.cpp" line="174"/>
<source>Doppler</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="149"/>
<location filename="../ui/MainWindow.cpp" line="175"/>
<source>course</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="149"/>
<location filename="../ui/MainWindow.cpp" line="175"/>
<source>Speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="150"/>
<location filename="../ui/MainWindow.cpp" line="176"/>
<source>longitude</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="150"/>
<location filename="../ui/MainWindow.cpp" line="176"/>
<source>latitude</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="151"/>
<location filename="../ui/MainWindow.cpp" line="177"/>
<source>distance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="151"/>
<location filename="../ui/MainWindow.cpp" line="177"/>
<source>velocity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="152"/>
<location filename="../ui/MainWindow.cpp" line="178"/>
<source>Radial dimensions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="152"/>
<location filename="../ui/MainWindow.cpp" line="178"/>
<source>Target RCS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="158"/>
<source>Report Table</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="183"/>
<location filename="../ui/MainWindow.cpp" line="184"/>
<source>Report</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="194"/>
<location filename="../ui/MainWindow.cpp" line="195"/>
<source>Signal Indicator Lamp</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="203"/>
<location filename="../ui/MainWindow.cpp" line="204"/>
<source>ParamSetting</source>
<translation></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="208"/>
<source>name: 5year 0412</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="209"/>
<source>name: 5year 0412</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="210"/>
<source>start: no start</source>
<translation type="unfinished"></translation>
</message>
@ -448,7 +650,7 @@
<message>
<location filename="../ui/ModelBrowser.cpp" line="31"/>
<source>model elements</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -456,17 +658,17 @@
<message>
<location filename="../ui/ModelBrowser/ModelBrowserPannal.ui" line="14"/>
<source>ModelBrowserPannal</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelBrowserPannal.ui" line="27"/>
<source></source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelBrowserPannal.ui" line="32"/>
<source></source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -474,57 +676,57 @@
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="96"/>
<source>Release Track</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="113"/>
<source>Add boke Entity</source>
<translation>BOKE实体</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="120"/>
<source>Add lsjhqt Entity</source>
<translation>LSJHQT实体</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="127"/>
<source>Add nimizi Entity</source>
<translation>NIMIZI实体</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="134"/>
<source>Add tkdlj Entity</source>
<translation>TKDLJ实体</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="141"/>
<source>Add jiaofan Entity</source>
<translation>JIAOFAN实体</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="148"/>
<source>Add satellite Entity</source>
<translation>SATELLITE实体</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="250"/>
<source>Track</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="258"/>
<source>Add Mesh Component</source>
<translation>Mesh组件</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="262"/>
<source>Add Path Component</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/ModelBrowser/ModelTreeWidget.cpp" line="269"/>
<source>Delete</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -532,7 +734,7 @@
<message>
<location filename="../ui/Menu/PlanManagerMenu.ui" line="14"/>
<source>PlanManagerMenu</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -540,43 +742,43 @@
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="14"/>
<source>PlayManagerMenu</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="20"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="55"/>
<source>play</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="27"/>
<source>stop</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="55"/>
<source>000.000</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="77"/>
<source>00000</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="95"/>
<source>x1</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="105"/>
<source>up</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.ui" line="112"/>
<source>down</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="34"/>
@ -588,7 +790,7 @@
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="99"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="106"/>
<source>question</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="34"/>
@ -600,13 +802,13 @@
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="99"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="106"/>
<source>has not workspace</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="48"/>
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="52"/>
<source>pause</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -614,29 +816,29 @@
<message>
<location filename="../ui/PropertyBrowser.cpp" line="40"/>
<source>attribute</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser.cpp" line="55"/>
<location filename="../ui/PropertyBrowser.cpp" line="58"/>
<source>WorkSpace</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser.cpp" line="71"/>
<location filename="../ui/PropertyBrowser.cpp" line="74"/>
<source>Entity</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser.cpp" line="203"/>
<source>ModelBase</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser.cpp" line="208"/>
<source>color base</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -644,12 +846,12 @@
<message>
<location filename="../ui/PropertyBrowser/qtpropertybrowserutils.cpp" line="732"/>
<source>Open File</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/PropertyBrowser/qtpropertybrowserutils.cpp" line="732"/>
<source>All Files (*)</source>
<translation></translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -1360,6 +1562,11 @@
<source>Signal Indicator Lamp</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Layout/SignalIndicatorLampUI.cpp" line="186"/>
<source>light</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SurfaceDialog</name>
@ -1425,7 +1632,7 @@
<message>
<location filename="../ui/Menu/SystemManagerMenu.cpp" line="28"/>
<source>question</source>
<translation type="unfinished"></translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Menu/SystemManagerMenu.cpp" line="28"/>

File diff suppressed because it is too large Load Diff

View File

@ -48,10 +48,10 @@ inline void ExtendFrameIntoClientArea(QWindow* window, int left, int top, int ri
#endif
}
inline std::optional<QRect> GetScreenNativeWorkRect(HWND hwnd) {
inline QRect GetScreenNativeWorkRect(HWND hwnd) {
auto monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
if (!monitor)
return std::nullopt;
return QRect();
MONITORINFO info;
::ZeroMemory(&info, sizeof(info));
info.cbSize = sizeof(info);
@ -94,21 +94,23 @@ bool FramelessDelegateWin::nativeEvent(const QByteArray & eventType, void* messa
if (IsZoomed(msg->hwnd)) {
CheckMonitorChanged();
auto rc = workRect_;
if (!rc)
if (!rc.isValid())
return false;
if (auto ret = DefWindowProcW(msg->hwnd, WM_NCCALCSIZE, msg->wParam, msg->lParam); ret) {
auto ret = DefWindowProcW(msg->hwnd, WM_NCCALCSIZE, msg->wParam, msg->lParam);
if ( ret) {
*result = ret;
return true;
}
NCCALCSIZE_PARAMS* ncParam = reinterpret_cast<NCCALCSIZE_PARAMS*>(msg->lParam);
ncParam->rgrc[0].top = rc->top();
ncParam->rgrc[0].bottom = rc->bottom() + 1;
ncParam->rgrc[0].top = rc.top();
ncParam->rgrc[0].bottom = rc.bottom() + 1;
*result = 0;
return true;
} else {
const auto clientRect = reinterpret_cast<LPRECT>(msg->lParam);
const auto before = *clientRect;
if (auto ret = DefWindowProcW(msg->hwnd, WM_NCCALCSIZE, msg->wParam, msg->lParam); ret) {
auto ret = DefWindowProcW(msg->hwnd, WM_NCCALCSIZE, msg->wParam, msg->lParam);
if ( ret) {
*result = ret;
return true;
}
@ -276,7 +278,8 @@ void FramelessDelegateWin::CheckMonitorChanged() {
auto newMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
if (newMonitor != monitor_) {
monitor_ = newMonitor;
if (auto ret = GetScreenNativeWorkRect(hwnd); ret)
auto ret = GetScreenNativeWorkRect(hwnd);
if (!ret.isValid())
workRect_ = ret;
}
}

View File

@ -1,7 +1,6 @@
#pragma once
#include <Windows.h>
#include <optional>
#include "FramelessDelegate.h"
@ -43,7 +42,7 @@ private:
private:
bool firstShow_{ true };
std::optional<QRect> workRect_;
QRect workRect_;
HMONITOR monitor_{ nullptr };
WINDOWPLACEMENT wndPlaceMent_{ 0, 0, 0, {0, 0}, {0, 0}, {0, 0, 0, 0} };
};

View File

@ -12,6 +12,8 @@
#include "python/PythonModule.h"
AddParamSetting::AddParamSetting(const QString& strDir, QWidget* parent)
: QWidget(parent)
{
@ -19,6 +21,16 @@ AddParamSetting::AddParamSetting(const QString& strDir, QWidget* parent)
setWindowFlags(/*Qt::FramelessWindowHint | */Qt::Window);
listType << "String" << "Int" << "Double" << "Int[]" << "Double[]" << "String[]" << "a+bi";
mapDataDes["String"] = "Value";
mapDataDes["Int"] = "1";
mapDataDes["Double"] = "1.0";
mapDataDes["Int[]"] = u8"一维[1,2,3,4,5....]二维[1,2,3,4,5;6,7,8,9,10]";
mapDataDes["Double[]"] = u8"一维[1.0,2.0,3.0,...]二维[1.0,2.0,3.0;6.0,7.0,8.0]";
mapDataDes["String[]"] = u8"一维[s1,s2,s3,s4,s5....]二维[s1,s2,s3,s4,s5;s6,s7,s8,s9,s10]";
mapDataDes["a+bi"] = "1+2(i)";
m_strDir = strDir;
QHeaderView* horizontalHeader = ui.tableWidget->horizontalHeader();
@ -89,14 +101,14 @@ void AddParamSetting::InsertRow()
int iCol = 0;
// 参数名称
{
QString strText = u8"输入参数名称";
QString strText = tr("input param name");
ui.tableWidget->setItem(iRow, iCol, new QTableWidgetItem(strText));
iCol++;
}
// 参数描述
{
QString strText = u8"输入参数描述";
QString strText = tr("input param descript");
ui.tableWidget->setItem(iRow, iCol, new QTableWidgetItem(strText));
iCol++;
}
@ -150,13 +162,20 @@ void AddParamSetting::InsertRow()
iCol++;
}
// 参数描述
//
{
QString strText = u8"输入参数值";
QString strText = tr("input value"); // "输入参数值";
QLineEdit* pValue = new QLineEdit;
pValue->setText(strText);
pValue->setProperty("Row", iRow);
ui.tableWidget->setCellWidget(iRow, iCol, pValue);
iCol++;
}
{
QString strText = mapDataDes["String"];
ui.tableWidget->setItem(iRow, iCol, new QTableWidgetItem(strText));
ui.tableWidget->item(iRow, iCol)->setSelected(false);
}
}
@ -182,9 +201,6 @@ void AddParamSetting::InsertRow(QStringList values)
// 数据类型
{
QStringList listType;
listType << "String" << "Int" << "Float";
QComboBox* pCombox = new QComboBox;
pCombox->addItems(listType);
pCombox->setCurrentText(values[2]);
@ -196,7 +212,7 @@ void AddParamSetting::InsertRow(QStringList values)
iCol++;
}
if (values[2] == "Float")
if (values[2] == "Double")
{
// 最大值
{
@ -350,6 +366,13 @@ void AddParamSetting::InsertRow(QStringList values)
ui.tableWidget->setItem(iRow, iCol, new QTableWidgetItem(strText));
}
}
{
iCol++;
QString strText = mapDataDes[values[2]];
ui.tableWidget->setItem(iRow, iCol, new QTableWidgetItem(strText));
ui.tableWidget->item(iRow, iCol)->setSelected(false);
}
}
void AddParamSetting::RemoveRow()
@ -388,7 +411,7 @@ void AddParamSetting::slotButtonCommit()
sett.clear();
sett.sync();
for (int iRow = 0; iRow < ui.tableWidget->rowCount(); iRow++)
for (int iRow = 0; iRow < ui.tableWidget->rowCount()-1; iRow++)
{
QString strGroup = QString::number(iRow + 1);
QString strName = ui.tableWidget->item(iRow, 0)->text();
@ -415,7 +438,7 @@ void AddParamSetting::slotButtonCommit()
QSpinBox* pCuralue = (QSpinBox*)ui.tableWidget->cellWidget(iRow, 6);
sett.setValue("Value", pCuralue->value());
}
else if (strType == "Float")
else if (strType == "Double")
{
QDoubleSpinBox* pMaxValue = (QDoubleSpinBox*)ui.tableWidget->cellWidget(iRow, 3);
sett.setValue("MaxValue", pMaxValue->value());
@ -655,5 +678,11 @@ void AddParamSetting::slotSelectDataType(const QString& strType)
QWidget* pDecimalValue = ui.tableWidget->cellWidget(iRow, 5);
pDecimalValue->setDisabled(true);
}
{
QString strText = mapDataDes[strType];
ui.tableWidget->setItem(iRow, 7, new QTableWidgetItem(strText));
ui.tableWidget->item(iRow, 7)->setSelected(false);
}
}
}

View File

@ -40,4 +40,7 @@ private:
Ui::AddParamSettingClass ui;
QString m_strDir;
QStringList listType;
QMap<QString, QString> mapDataDes;
};

View File

@ -51,6 +51,11 @@
<string>初始值</string>
</property>
</column>
<column>
<property name="text">
<string>数据输入示例</string>
</property>
</column>
</widget>
</item>
<item>

View File

@ -0,0 +1,86 @@
#include "CodeEdtUI.h"
#include <QPlainTextEdit>
#include <QMenuBar>
#include <QAction>
#include <QStatusBar>
#include <QFileDialog>
#include <QTextStream>
#include <QVBoxLayout>
#include <QFont>
#include <qdebug.h>
#include "SyntaxHighlighter.h"
#include "../DockTitleBar.h"
#include "../DockWidget.h"
CodeEdtUI::CodeEdtUI(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
// 눼쉔덜쯤긍서포
editor = new QPlainTextEdit(this);
QFont serifFont("Times", 20, QFont::Bold);
editor->setFont(serifFont);
syntaxHighlighter = new SyntaxHighlighter(editor->document());
setCentralWidget(editor);
// 눼쉔꽉데
QMenu* fileMenu = menuBar()->addMenu(tr("&file"));
QAction* openAction = new QAction(tr("&Import the template"), this);
QAction* saveAction = new QAction(tr("&save"), this);
fileMenu->addAction(openAction);
fileMenu->addAction(saveAction);
connect(openAction, &QAction::triggered, this, &CodeEdtUI::openFile);
connect(saveAction, &QAction::triggered, this, &CodeEdtUI::saveFile);
// 榴檄으
statusBar();
}
void CodeEdtUI::AttachDock(DockWidget* dockWidget)
{
if (nullptr == dockWidget) {
qDebug() << __FUNCTION__ << "dockwidget is nullptr";
return;
}
dockWidget->SetDockWidgetTitleBar(nullptr);
dockWidget->setWidget(this);
DockTitleBar* dockTitleBar = new DockTitleBar;
dockTitleBar->SetTitle(tr("matlab editor"));
dockWidget->SetDockWidgetTitleBar(dockTitleBar);
}
void CodeEdtUI::openFile() {
QString fileName = QFileDialog::getOpenFileName(this, "Open File", "", "Matlab Files (*.m)");
if (!fileName.isEmpty()) {
QFile file(fileName);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&file);
editor->setPlainText(in.readAll());
file.close();
}
}
}
void CodeEdtUI::saveFile() {
QString fileName = QFileDialog::getSaveFileName(this, "Save File", "", "Matlab Files (*.m)");
if (!fileName.isEmpty()) {
QFile file(fileName);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream out(&file);
out << editor->toPlainText();
file.close();
}
}
}

View File

@ -0,0 +1,24 @@
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_CodeEdtUI.h"
class CodeEdtUI : public QMainWindow
{
Q_OBJECT
public:
CodeEdtUI(QWidget *parent = Q_NULLPTR);
void AttachDock(class DockWidget* dockWidget);
protected slots:
void openFile();
void saveFile();
private:
Ui::CodeEdtUIClass ui;
class QPlainTextEdit* editor;
class SyntaxHighlighter* syntaxHighlighter{ nullptr };
};

View File

@ -0,0 +1,28 @@
<UI version="4.0" >
<class>CodeEdtUIClass</class>
<widget class="QMainWindow" name="CodeEdtUIClass" >
<property name="objectName" >
<string notr="true">CodeEdtUIClass</string>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle" >
<string>CodeEdtUI</string>
</property> <widget class="QMenuBar" name="menuBar" />
<widget class="QToolBar" name="mainToolBar" />
<widget class="QWidget" name="centralWidget" />
<widget class="QStatusBar" name="statusBar" />
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<resources>
<include location="CodeEdtUI.qrc"/>
</resources>
<connections/>
</UI>

View File

@ -378,7 +378,7 @@ void DockChildList::slotAddWindow()
QTreeWidgetItem* pMainWindowItem = new QTreeWidgetItem;
pMainWindowItem->setTextColor(0, Qt::green);
pMainWindowItem->setText(0, QString::fromLocal8Bit("新增窗口"));
pMainWindowItem->setText(0,tr("Added a window"));
pMainWindowItem->setData(0, Qt::UserRole, true); // 是否允许拖拽
pMainWindowItem->setData(0, Qt::UserRole + 1, "MainWindow");
pMainWindowItem->setData(0, Qt::UserRole + 2, "MainWindow");
@ -387,7 +387,7 @@ void DockChildList::slotAddWindow()
{
QTreeWidgetItem* pDocAreaItem = new QTreeWidgetItem;
pDocAreaItem->setTextColor(0, Qt::green);
pDocAreaItem->setText(0, QString::fromLocal8Bit("中心区域"));
pDocAreaItem->setText(0, tr("Central area"));
pDocAreaItem->setData(0, Qt::UserRole, true); // 是否允许拖拽
pDocAreaItem->setData(0, Qt::UserRole + 1, "CentralWidget");
pDocAreaItem->setData(0, Qt::UserRole + 2, "CentralWidget");
@ -397,7 +397,7 @@ void DockChildList::slotAddWindow()
{
QTreeWidgetItem* pDocAreaItem = new QTreeWidgetItem;
pDocAreaItem->setTextColor(0, Qt::green);
pDocAreaItem->setText(0, QString::fromLocal8Bit("左侧区域"));
pDocAreaItem->setText(0, tr("Left area"));
pDocAreaItem->setData(0, Qt::UserRole, true); // 是否允许拖拽
pDocAreaItem->setData(0, Qt::UserRole + 1, "DocArea");
pDocAreaItem->setData(0, Qt::UserRole + 2, "DockLeftArea");
@ -407,7 +407,7 @@ void DockChildList::slotAddWindow()
{
QTreeWidgetItem* pDocAreaItem = new QTreeWidgetItem;
pDocAreaItem->setTextColor(0, Qt::green);
pDocAreaItem->setText(0, QString::fromLocal8Bit("上方区域"));
pDocAreaItem->setText(0, tr("Upper area"));
pDocAreaItem->setData(0, Qt::UserRole, true); // 是否允许拖拽
pDocAreaItem->setData(0, Qt::UserRole + 1, "DocArea");
pDocAreaItem->setData(0, Qt::UserRole + 2, "DockTopArea");
@ -417,7 +417,7 @@ void DockChildList::slotAddWindow()
{
QTreeWidgetItem* pDocAreaItem = new QTreeWidgetItem;
pDocAreaItem->setTextColor(0, Qt::green);
pDocAreaItem->setText(0, QString::fromLocal8Bit("右侧区域"));
pDocAreaItem->setText(0, tr("Right area"));
pDocAreaItem->setData(0, Qt::UserRole, true); // 是否允许拖拽
pDocAreaItem->setData(0, Qt::UserRole + 1, "DocArea");
pDocAreaItem->setData(0, Qt::UserRole + 2, "DockRightArea");
@ -427,7 +427,7 @@ void DockChildList::slotAddWindow()
{
QTreeWidgetItem* pDocAreaItem = new QTreeWidgetItem;
pDocAreaItem->setTextColor(0, Qt::green);
pDocAreaItem->setText(0, QString::fromLocal8Bit("下方区域"));
pDocAreaItem->setText(0, tr("Underneath the area"));
pDocAreaItem->setData(0, Qt::UserRole, true); // 是否允许拖拽
pDocAreaItem->setData(0, Qt::UserRole + 1, "DocArea");
pDocAreaItem->setData(0, Qt::UserRole + 2, "DockBottomArea");
@ -579,7 +579,7 @@ void DockChildList::contextMenuEvent(QContextMenuEvent* event)
}
}
QAction* addMainWindowAction = menu.addAction(QString::fromLocal8Bit("删除窗口"));
QAction* addMainWindowAction = menu.addAction(tr("delete Window"));
connect(addMainWindowAction, &QAction::triggered, this, &DockChildList::slotRemoveWindow);
}
else
@ -595,20 +595,20 @@ void DockChildList::contextMenuEvent(QContextMenuEvent* event)
int iCurIndex = pItem->parent()->indexOfChild(pItem);
if (iCurIndex < 1)
{
QAction* backItemAction = menu.addAction(QString::fromLocal8Bit("下移"));
QAction* backItemAction = menu.addAction(tr("Move down")); // ÏÂÒÆ
connect(backItemAction, &QAction::triggered, this, &DockChildList::slotBack);
}
else if (iCurIndex == pItem->parent()->childCount() - 1)
{
QAction* frontItemAction = menu.addAction(QString::fromLocal8Bit("上移"));
QAction* frontItemAction = menu.addAction(tr("Move up")); // ÉÏÒÆ
connect(frontItemAction, &QAction::triggered, this, &DockChildList::slotFront);
}
else
{
QAction* frontItemAction = menu.addAction(QString::fromLocal8Bit("上移"));
QAction* frontItemAction = menu.addAction(tr("Move up")); // ÉÏÒÆ
connect(frontItemAction, &QAction::triggered, this, &DockChildList::slotFront);
QAction* backItemAction = menu.addAction(QString::fromLocal8Bit("下移"));
QAction* backItemAction = menu.addAction(tr("Move down")); // ÏÂÒÆ
connect(backItemAction, &QAction::triggered, this, &DockChildList::slotBack);
}
}
@ -619,7 +619,7 @@ void DockChildList::contextMenuEvent(QContextMenuEvent* event)
{
QMenu menu(this);
QAction* addMainWindowAction = menu.addAction(QString::fromLocal8Bit("添加窗口"));
QAction* addMainWindowAction = menu.addAction(tr("add window"));
connect(addMainWindowAction, &QAction::triggered, this, &DockChildList::slotAddWindow);
menu.exec(pos);

View File

@ -183,7 +183,7 @@ void SignalIndicatorLampUI::InitLamp(const QString& strFile)
QStringList listLamp;
for (size_t i = 0; i < m_iLampCount; i++)
{
listLamp << QString::fromLocal8Bit("ָʾµÆ") + QString::number(i+1);
listLamp <<tr("light") + QString::number(i+1); // ָʾµÆ
}
InitIndicatorLamp(listLamp, SignalIndicatorLampUI::HLyt, listLamp.size());

View File

@ -0,0 +1,58 @@
#include "SyntaxHighlighter.h"
SyntaxHighlighter::SyntaxHighlighter(QTextDocument* parent)
: QSyntaxHighlighter(parent)
{
HighlightingRule rule;
// 关键字高亮
QStringList keywordPatterns;
keywordPatterns << "\\bif\\b" << "\\belse\\b" << "\\bwhile\\b" << "\\bfor\\b"
<< "\\bclass\\b" << "\\bstruct\\b" << "\\bpublic\\b"
<< "\\bprivate\\b" << "\\bprotected\\b" << "\\bvoid\\b"
<< "\\bint\\b" << "\\bfloat\\b" << "\\bdouble\\b"
<< "\\bfunction\\b" << "\\bconst\\b" << "\\bbool\\b"
<< "\\bforeach\\b" << "\\bfor\\b" << "\\bauto\\b" << "\\bcase\\b"
<< "\\bdefault\\b";
foreach(const QString & pattern, keywordPatterns) {
rule.pattern = QRegularExpression(pattern);
rule.format.setForeground(Qt::blue);
highlightingRules.append(rule);
}
// 类名高亮
rule.pattern = QRegularExpression("\\b[A-Z][a-zA-Z0-9_]*\\b");
rule.format.setForeground(Qt::darkGreen);
highlightingRules.append(rule);
// 字符串高亮
rule.pattern = QRegularExpression("\".*\"");
rule.format.setForeground(Qt::darkMagenta);
highlightingRules.append(rule);
// 单行注释高亮
rule.pattern = QRegularExpression("//[^\n]*");
rule.format.setForeground(Qt::gray);
highlightingRules.append(rule);
// 多行注释高亮
rule.pattern = QRegularExpression("/\\*.*?\\*/", QRegularExpression::DotMatchesEverythingOption);
rule.format.setForeground(Qt::gray);
highlightingRules.append(rule);
}
SyntaxHighlighter::~SyntaxHighlighter()
{
}
void SyntaxHighlighter::highlightBlock(const QString& text)
{
foreach(const HighlightingRule & rule, highlightingRules) {
QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text);
while (matchIterator.hasNext()) {
QRegularExpressionMatch match = matchIterator.next();
setFormat(match.capturedStart(), match.capturedLength(), rule.format);
}
}
}

View File

@ -0,0 +1,24 @@
#pragma once
#include <QSyntaxHighlighter>
#include <QRegularExpression>
class SyntaxHighlighter : public QSyntaxHighlighter
{
Q_OBJECT
public:
SyntaxHighlighter(QTextDocument* parent = nullptr);
~SyntaxHighlighter();
protected:
void highlightBlock(const QString& text) override;
private:
struct HighlightingRule {
QRegularExpression pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;
};

View File

@ -118,6 +118,7 @@ void MainFrame::InitUI() {
QtOsgViewWidget* viewWidget = mainWindow->GetViewWidget();
connect(fileMenu, &FileManagerMenu::LoadDyt, viewWidget, &QtOsgViewWidget::OnLoadDyt);
connect(viewWidget, &QtOsgViewWidget::signalResetWorkSpace, mainWindow, &MainWindow::slotResetWorkSpace);
//connect(chartMenu, &ChartPlotMenu::signalAddCurve, mainWindow->GetFitCurveDlg(), &FitCurveDialog::slotAddSeries);
//connect(chartMenu, &ChartPlotMenu::signalDelCurve, mainWindow->GetFitCurveDlg(), &FitCurveDialog::slotDelCurve);
@ -127,7 +128,7 @@ void MainFrame::InitUI() {
//connect(chartMenu, &ChartPlotMenu::signalAddSurfaceCurve, mainWindow->GetSurfaceDlg(), &SurfaceDialog::slotAddSeries);
//connect(system_, &SystemManagerMenu::signalShowUISetting, mainWindow, &MainWindow::slotShowUISetting);
connect(system_, &SystemManagerMenu::signalShowUISetting, mainWindow, &MainWindow::slotShowUISetting);
if (ui->menuWidget->count() > 0) {
ui->menuWidget->setCurrentIndex(0);

View File

@ -21,6 +21,7 @@
#include "Layout/LayoutSettingUI.h"
#include "Layout/SignalIndicatorLampUI.h"
#include "Layout/AddParamSetting.h"
#include "Layout/CodeEdtUI.h"
#include "Table/targetlistwgt.h"
#include "common/RecourceHelper.h"
@ -141,14 +142,14 @@ void MainWindow::InitUI() {
targetUITable_ = new TargetListWgt;
QStringList headerLabels;
headerLabels << QString::fromLocal8Bit("目标编号") << QString::fromLocal8Bit("信噪比")
<< QString::fromLocal8Bit("方位视线角") << QString::fromLocal8Bit("俯仰视线角")
<< QString::fromLocal8Bit("方位角") << QString::fromLocal8Bit("俯仰角")
<< QString::fromLocal8Bit("属性") << QString::fromLocal8Bit("多普勒")
<< QString::fromLocal8Bit("航向") << QString::fromLocal8Bit("航速")
<< QString::fromLocal8Bit("经度") << QString::fromLocal8Bit("纬度")
<< QString::fromLocal8Bit("距离") << QString::fromLocal8Bit("速度")
<< QString::fromLocal8Bit("径向尺寸") << QString::fromLocal8Bit("目标RCS");
headerLabels << tr("Target number") << tr("Signal-to-noise ratio") //QString::fromLocal8Bit("目标编号") << QString::fromLocal8Bit("信噪比")
<< tr("Azimuth line of sight") << tr("Pitch gaze angle") // QString::fromLocal8Bit("方位视线角") << QString::fromLocal8Bit("俯仰视线角")
<< tr("azimuth") << tr("Pitch angle") // QString::fromLocal8Bit("方位角") << QString::fromLocal8Bit("俯仰角")
<< tr("attribute") << tr("Doppler") // QString::fromLocal8Bit("属性") << QString::fromLocal8Bit("多普勒")
<< tr("course") << tr("Speed") // QString::fromLocal8Bit("航向") << QString::fromLocal8Bit("航速")
<< tr("longitude") << tr("latitude") // QString::fromLocal8Bit("经度") << QString::fromLocal8Bit("纬度")
<< tr("distance") << tr("velocity") // QString::fromLocal8Bit("距离") << QString::fromLocal8Bit("速度")
<< tr("Radial dimensions") << tr("Target RCS"); // QString::fromLocal8Bit("径向尺寸") << QString::fromLocal8Bit("目标RCS");
targetUITable_->SetHeader(headerLabels);
//const QString reportPath = RecourceHelper::Get().GetBasePath() + "/workspace/Report.txt";
@ -167,14 +168,14 @@ void MainWindow::InitUI() {
//WorkSpaceManager::Get().SetTargetListWgt(targetUITable_);
QStringList headerLabels;
headerLabels << QString::fromLocal8Bit("目标编号") << QString::fromLocal8Bit("信噪比")
<< QString::fromLocal8Bit("方位视线角") << QString::fromLocal8Bit("俯仰视线角")
<< QString::fromLocal8Bit("方位角") << QString::fromLocal8Bit("俯仰角")
<< QString::fromLocal8Bit("属性") << QString::fromLocal8Bit("多普勒")
<< QString::fromLocal8Bit("航向") << QString::fromLocal8Bit("航速")
<< QString::fromLocal8Bit("经度") << QString::fromLocal8Bit("纬度")
<< QString::fromLocal8Bit("距离") << QString::fromLocal8Bit("速度")
<< QString::fromLocal8Bit("径向尺寸") << QString::fromLocal8Bit("目标RCS");
headerLabels << tr("Target number") << tr("Signal-to-noise ratio") //QString::fromLocal8Bit("目标编号") << QString::fromLocal8Bit("信噪比")
<< tr("Azimuth line of sight") << tr("Pitch gaze angle") // QString::fromLocal8Bit("方位视线角") << QString::fromLocal8Bit("俯仰视线角")
<< tr("azimuth") << tr("Pitch angle") // QString::fromLocal8Bit("方位角") << QString::fromLocal8Bit("俯仰角")
<< tr("attribute") << tr("Doppler") // QString::fromLocal8Bit("属性") << QString::fromLocal8Bit("多普勒")
<< tr("course") << tr("Speed") // QString::fromLocal8Bit("航向") << QString::fromLocal8Bit("航速")
<< tr("longitude") << tr("latitude") // QString::fromLocal8Bit("经度") << QString::fromLocal8Bit("纬度")
<< tr("distance") << tr("velocity") // QString::fromLocal8Bit("距离") << QString::fromLocal8Bit("速度")
<< tr("Radial dimensions") << tr("Target RCS"); // QString::fromLocal8Bit("径向尺寸") << QString::fromLocal8Bit("目标RCS");
targetUI_->SetHeader(headerLabels);
const QString reportPath = RecourceHelper::Get().GetBasePath() + "/workspace/Report.txt";
@ -201,7 +202,7 @@ void MainWindow::InitUI() {
const QString iniPath = RecourceHelper::Get().GetBasePath() + "/workspace/ParamSetting.ini";
DockWidget* addParamSettingDock = new DockWidget(tr("ParamSetting"), 0);
addParamDlg_ = new AddParamSetting(iniPath);
addParamDlg_ = new CodeEdtUI;
addParamDlg_->AttachDock(addParamSettingDock);
m_mapDockWidget.insert("ParamSetting", addParamSettingDock);
@ -355,3 +356,32 @@ void MainWindow::AddDockArea(const QString& strArea) {
void MainWindow::slotShowUISetting() {
pSettingUI->show();
}
void MainWindow::slotResetWorkSpace()
{
QString wavePath = WorkSpaceManager::Get().GetDYTWaveFile();
if (wavePath.isEmpty())
{
wavePath = RecourceHelper::Get().GetBasePath() + "/workspace/Wave.txt";
WorkSpaceManager::Get().SetDYTWaveFile(wavePath);
}
QString speedPath = WorkSpaceManager::Get().GetDYTReportFile();
if (speedPath.isEmpty())
{
speedPath = RecourceHelper::Get().GetBasePath() + "/workspace/Report.txt";
WorkSpaceManager::Get().SetDYTReportFile(speedPath);
}
QString rdPath = WorkSpaceManager::Get().GetDYTRDFile();
if (rdPath.isEmpty())
{
rdPath = RecourceHelper::Get().GetBasePath() + "/workspace/RD.txt";
WorkSpaceManager::Get().SetDYTRDFile(rdPath);
}
fitCurveDlg_->InitWaveFile(wavePath);
fitYLgCurveDlg_->InitReportFile(speedPath);
surfaceDlg_->InitRD(rdPath);
targetUITable_->InitFile(speedPath, 50);
}

View File

@ -37,6 +37,9 @@ public:
void slotShowUISetting();
public slots:
void slotResetWorkSpace();
private:
void InitUI();
@ -62,7 +65,7 @@ private:
class TargetListWgt* targetUITable_{ nullptr };
class QTabWidget* tabWidget_{ nullptr };
class SignalIndicatorLampUI* signalIndicatorLampUI_{ nullptr };
class AddParamSetting* addParamDlg_{ nullptr };
class CodeEdtUI* addParamDlg_{ nullptr };
QMap<QString, QDockWidget*> m_mapDockWidget;

View File

@ -2,10 +2,7 @@
#include <QTextCodec>
#include <MatlabEngine.hpp>
#include <MatlabDataArray.hpp>
using namespace matlab::engine;
#include "engine.h"
MatlabObject::MatlabObject(QObject *parent)
: QObject(parent)
@ -25,20 +22,12 @@ void MatlabObject::RunMatlabFile(const QString& strFile)
QTextCodec* code = QTextCodec::codecForName("utf-8");
std::string strRun = code->fromUnicode(strMatlabRun.toUtf8().data()).data();
std::u16string utf16_str = string2u16string(strRun);
// Æô¶¯MATLAB Engine
std::unique_ptr<MATLABEngine> matlabPtr = startMATLAB();
if (matlabPtr)
{
// ÔËÐÐMÎļþ
matlabPtr->eval(utf16_str);
}
Engine* ep;
if (!(ep = engOpen("\0"))) {
fprintf(stderr, "\nCan't start MATLAB engine\n");
return; // EXIT_FAILURE;
}
std::u16string MatlabObject::string2u16string(std::string& str)
{
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
std::u16string utf16_str = convert.from_bytes(str);
return utf16_str;
engClose(ep);
}

View File

@ -14,5 +14,5 @@ public:
protected:
std::u16string string2u16string(std::string& str);
//std::u16string string2u16string(std::string& str);
};

View File

@ -151,12 +151,9 @@ void QtOsgViewWidget::OnLoadDyt(const QString& path) {
}
workspace_ = workSpace;
}
//void QtOsgViewWidget::setKeyboardModifiers(QInputEvent* event) {
// dyt_check(nullptr != view_);
// view_->KeyPress(event);
//}
emit signalResetWorkSpace();
}
void QtOsgViewWidget::resizeEvent(QResizeEvent* event) {
if (nullptr == view_) {

View File

@ -27,6 +27,9 @@ public:
void OnLoadDyt(const QString& path);
//void setKeyboardModifiers(QInputEvent* event);
signals:
void signalResetWorkSpace();
protected:
void keyPressEvent(QKeyEvent* event) override;

View File

@ -161,7 +161,7 @@ bool WorkSpaceXMLParse::Load(const QString& dyt) {
tinyxml2::XMLDocument xmlDocument;
tinyxml2::XMLError error = xmlDocument.LoadFile(path.c_str());
if (tinyxml2::XMLError::XML_SUCCESS != error) {
LOG_INFO("load feiled:{}", error);
LOG_INFO("load feiled:{}", static_cast<int>(error));
return false;
}