diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 9f3a373..489627c 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -12,7 +12,8 @@ #include #include #include - +#include +#include PhaseWindow::PhaseWindow(QWidget *parent) : QWidget(parent), ui(new Ui::PhaseWindow) @@ -31,9 +32,11 @@ ui->exitButt->move(screenRect.width() - 80, 10); ui->minButt->move(screenRect.width() - 140, 10); ui->settingButt->move(screenRect.width() - 200, 10); + ui->endButt->move(screenRect.width() - 260, 10); + ui->startButt->move(screenRect.width() - 320, 10); ui->line->setGeometry(0, 89, screenRect.width(), 1); - ui->pointsList->setGeometry(250,30,screenRect.width()-500,40); - ui->labelsList->setGeometry(250,60,screenRect.width()-500,30); + ui->pointsList->setGeometry(200,30,screenRect.width()-600,40); + ui->labelsList->setGeometry(200,60,screenRect.width()-600,30); // 设置主体区域的大小和位置 ui->scrollArea->setGeometry(0, 90, screenRect.width(), screenRect.height() - 90); @@ -76,7 +79,8 @@ { // 获取设备数据 int channelNum = 16; - + //测试通道 + bool arr[16] = {true,false,true,false,true,false,true,false,true,false,true,false,true,false,true,false}; QRect screenRect = QApplication::desktop()->screenGeometry(); ui->scrollContents->setGeometry(0, 90, screenRect.width(), channelNum * 170); @@ -86,6 +90,10 @@ for (int i = 0; i < channelNum; i++) { + QLabel* label = ui->pointsList->findChild(QString("p%1").arg(i+1)); //根据子控件的名称查找子控件 + if(arr[i]) label->setPixmap(QPixmap(":/points/images/green.png")); + else label->setPixmap(QPixmap(":/points/images/white.png")); + if(!arr[i]) continue; QGroupBox * group = new QGroupBox(ui->scrollContents); group->setTitle(QString("通道 - %1").arg(i + 1)); group->setFont(QFont("微软雅黑", 12)); @@ -111,3 +119,20 @@ { QApplication::exit(0); } + +void PhaseWindow::on_startButt_clicked() +{ + //发送开始指令 +} + +void PhaseWindow::on_endButt_clicked() +{ + //发送结束指令 +} + +void PhaseWindow::on_settingButt_clicked() +{ + SetConfig *new_win = new SetConfig(); + new_win->setWindowTitle("配置"); + new_win->show(); +} diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 9f3a373..489627c 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -12,7 +12,8 @@ #include #include #include - +#include +#include PhaseWindow::PhaseWindow(QWidget *parent) : QWidget(parent), ui(new Ui::PhaseWindow) @@ -31,9 +32,11 @@ ui->exitButt->move(screenRect.width() - 80, 10); ui->minButt->move(screenRect.width() - 140, 10); ui->settingButt->move(screenRect.width() - 200, 10); + ui->endButt->move(screenRect.width() - 260, 10); + ui->startButt->move(screenRect.width() - 320, 10); ui->line->setGeometry(0, 89, screenRect.width(), 1); - ui->pointsList->setGeometry(250,30,screenRect.width()-500,40); - ui->labelsList->setGeometry(250,60,screenRect.width()-500,30); + ui->pointsList->setGeometry(200,30,screenRect.width()-600,40); + ui->labelsList->setGeometry(200,60,screenRect.width()-600,30); // 设置主体区域的大小和位置 ui->scrollArea->setGeometry(0, 90, screenRect.width(), screenRect.height() - 90); @@ -76,7 +79,8 @@ { // 获取设备数据 int channelNum = 16; - + //测试通道 + bool arr[16] = {true,false,true,false,true,false,true,false,true,false,true,false,true,false,true,false}; QRect screenRect = QApplication::desktop()->screenGeometry(); ui->scrollContents->setGeometry(0, 90, screenRect.width(), channelNum * 170); @@ -86,6 +90,10 @@ for (int i = 0; i < channelNum; i++) { + QLabel* label = ui->pointsList->findChild(QString("p%1").arg(i+1)); //根据子控件的名称查找子控件 + if(arr[i]) label->setPixmap(QPixmap(":/points/images/green.png")); + else label->setPixmap(QPixmap(":/points/images/white.png")); + if(!arr[i]) continue; QGroupBox * group = new QGroupBox(ui->scrollContents); group->setTitle(QString("通道 - %1").arg(i + 1)); group->setFont(QFont("微软雅黑", 12)); @@ -111,3 +119,20 @@ { QApplication::exit(0); } + +void PhaseWindow::on_startButt_clicked() +{ + //发送开始指令 +} + +void PhaseWindow::on_endButt_clicked() +{ + //发送结束指令 +} + +void PhaseWindow::on_settingButt_clicked() +{ + SetConfig *new_win = new SetConfig(); + new_win->setWindowTitle("配置"); + new_win->show(); +} diff --git a/PhaseWindow.h b/PhaseWindow.h index 8f2314d..1ad6281 100644 --- a/PhaseWindow.h +++ b/PhaseWindow.h @@ -28,6 +28,12 @@ void on_minButt_clicked(); void on_exitButt_clicked(); + void on_startButt_clicked(); + + void on_endButt_clicked(); + + void on_settingButt_clicked(); + private: Ui::PhaseWindow *ui; diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 9f3a373..489627c 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -12,7 +12,8 @@ #include #include #include - +#include +#include PhaseWindow::PhaseWindow(QWidget *parent) : QWidget(parent), ui(new Ui::PhaseWindow) @@ -31,9 +32,11 @@ ui->exitButt->move(screenRect.width() - 80, 10); ui->minButt->move(screenRect.width() - 140, 10); ui->settingButt->move(screenRect.width() - 200, 10); + ui->endButt->move(screenRect.width() - 260, 10); + ui->startButt->move(screenRect.width() - 320, 10); ui->line->setGeometry(0, 89, screenRect.width(), 1); - ui->pointsList->setGeometry(250,30,screenRect.width()-500,40); - ui->labelsList->setGeometry(250,60,screenRect.width()-500,30); + ui->pointsList->setGeometry(200,30,screenRect.width()-600,40); + ui->labelsList->setGeometry(200,60,screenRect.width()-600,30); // 设置主体区域的大小和位置 ui->scrollArea->setGeometry(0, 90, screenRect.width(), screenRect.height() - 90); @@ -76,7 +79,8 @@ { // 获取设备数据 int channelNum = 16; - + //测试通道 + bool arr[16] = {true,false,true,false,true,false,true,false,true,false,true,false,true,false,true,false}; QRect screenRect = QApplication::desktop()->screenGeometry(); ui->scrollContents->setGeometry(0, 90, screenRect.width(), channelNum * 170); @@ -86,6 +90,10 @@ for (int i = 0; i < channelNum; i++) { + QLabel* label = ui->pointsList->findChild(QString("p%1").arg(i+1)); //根据子控件的名称查找子控件 + if(arr[i]) label->setPixmap(QPixmap(":/points/images/green.png")); + else label->setPixmap(QPixmap(":/points/images/white.png")); + if(!arr[i]) continue; QGroupBox * group = new QGroupBox(ui->scrollContents); group->setTitle(QString("通道 - %1").arg(i + 1)); group->setFont(QFont("微软雅黑", 12)); @@ -111,3 +119,20 @@ { QApplication::exit(0); } + +void PhaseWindow::on_startButt_clicked() +{ + //发送开始指令 +} + +void PhaseWindow::on_endButt_clicked() +{ + //发送结束指令 +} + +void PhaseWindow::on_settingButt_clicked() +{ + SetConfig *new_win = new SetConfig(); + new_win->setWindowTitle("配置"); + new_win->show(); +} diff --git a/PhaseWindow.h b/PhaseWindow.h index 8f2314d..1ad6281 100644 --- a/PhaseWindow.h +++ b/PhaseWindow.h @@ -28,6 +28,12 @@ void on_minButt_clicked(); void on_exitButt_clicked(); + void on_startButt_clicked(); + + void on_endButt_clicked(); + + void on_settingButt_clicked(); + private: Ui::PhaseWindow *ui; diff --git a/PhaseWindow.ui b/PhaseWindow.ui index f7742fe..749b3ae 100644 --- a/PhaseWindow.ui +++ b/PhaseWindow.ui @@ -706,6 +706,38 @@ + + + + 1100 + 10 + 40 + 40 + + + + + + + 开始 + + + + + + 1150 + 10 + 40 + 40 + + + + + + + 结束 + + diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 9f3a373..489627c 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -12,7 +12,8 @@ #include #include #include - +#include +#include PhaseWindow::PhaseWindow(QWidget *parent) : QWidget(parent), ui(new Ui::PhaseWindow) @@ -31,9 +32,11 @@ ui->exitButt->move(screenRect.width() - 80, 10); ui->minButt->move(screenRect.width() - 140, 10); ui->settingButt->move(screenRect.width() - 200, 10); + ui->endButt->move(screenRect.width() - 260, 10); + ui->startButt->move(screenRect.width() - 320, 10); ui->line->setGeometry(0, 89, screenRect.width(), 1); - ui->pointsList->setGeometry(250,30,screenRect.width()-500,40); - ui->labelsList->setGeometry(250,60,screenRect.width()-500,30); + ui->pointsList->setGeometry(200,30,screenRect.width()-600,40); + ui->labelsList->setGeometry(200,60,screenRect.width()-600,30); // 设置主体区域的大小和位置 ui->scrollArea->setGeometry(0, 90, screenRect.width(), screenRect.height() - 90); @@ -76,7 +79,8 @@ { // 获取设备数据 int channelNum = 16; - + //测试通道 + bool arr[16] = {true,false,true,false,true,false,true,false,true,false,true,false,true,false,true,false}; QRect screenRect = QApplication::desktop()->screenGeometry(); ui->scrollContents->setGeometry(0, 90, screenRect.width(), channelNum * 170); @@ -86,6 +90,10 @@ for (int i = 0; i < channelNum; i++) { + QLabel* label = ui->pointsList->findChild(QString("p%1").arg(i+1)); //根据子控件的名称查找子控件 + if(arr[i]) label->setPixmap(QPixmap(":/points/images/green.png")); + else label->setPixmap(QPixmap(":/points/images/white.png")); + if(!arr[i]) continue; QGroupBox * group = new QGroupBox(ui->scrollContents); group->setTitle(QString("通道 - %1").arg(i + 1)); group->setFont(QFont("微软雅黑", 12)); @@ -111,3 +119,20 @@ { QApplication::exit(0); } + +void PhaseWindow::on_startButt_clicked() +{ + //发送开始指令 +} + +void PhaseWindow::on_endButt_clicked() +{ + //发送结束指令 +} + +void PhaseWindow::on_settingButt_clicked() +{ + SetConfig *new_win = new SetConfig(); + new_win->setWindowTitle("配置"); + new_win->show(); +} diff --git a/PhaseWindow.h b/PhaseWindow.h index 8f2314d..1ad6281 100644 --- a/PhaseWindow.h +++ b/PhaseWindow.h @@ -28,6 +28,12 @@ void on_minButt_clicked(); void on_exitButt_clicked(); + void on_startButt_clicked(); + + void on_endButt_clicked(); + + void on_settingButt_clicked(); + private: Ui::PhaseWindow *ui; diff --git a/PhaseWindow.ui b/PhaseWindow.ui index f7742fe..749b3ae 100644 --- a/PhaseWindow.ui +++ b/PhaseWindow.ui @@ -706,6 +706,38 @@ + + + + 1100 + 10 + 40 + 40 + + + + + + + 开始 + + + + + + 1150 + 10 + 40 + 40 + + + + + + + 结束 + + diff --git a/SetConfig.cpp b/SetConfig.cpp new file mode 100644 index 0000000..128a3b0 --- /dev/null +++ b/SetConfig.cpp @@ -0,0 +1,31 @@ +#include "SetConfig.h" +#include "ui_SetConfig.h" +#include "QDebug" +SetConfig::SetConfig(QWidget *parent) : + QDialog(parent), + ui(new Ui::SetConfig) +{ + ui->setupUi(this); + init(); +} +void SetConfig::init() +{ + ui->IPInput->setText(SettingConfig::getInstance().DEVICE_HOST); + ui->devInput->setText(QString::number(SettingConfig::getInstance().DEVICE_PORT)); + ui->listenInput->setText(QString::number(SettingConfig::getInstance().LISTEN_PORT)); + ui->logInput->setText(SettingConfig::getInstance().BASE_LOG_PATH); +} +SetConfig::~SetConfig() +{ + delete ui; +} + +void SetConfig::on_buttonBox_accepted() +{ + SettingConfig::getInstance().setConProperty("net", "deviceHost", ui->IPInput->text()); + SettingConfig::getInstance().setConProperty("net", "devicePort", ui->devInput->text()); + SettingConfig::getInstance().setConProperty("net", "listenPort", ui->listenInput->text()); + SettingConfig::getInstance().setConProperty("log", "basePath", ui->logInput->text()); + SettingConfig::getInstance().init(); + qDebug()< - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 9f3a373..489627c 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -12,7 +12,8 @@ #include #include #include - +#include +#include PhaseWindow::PhaseWindow(QWidget *parent) : QWidget(parent), ui(new Ui::PhaseWindow) @@ -31,9 +32,11 @@ ui->exitButt->move(screenRect.width() - 80, 10); ui->minButt->move(screenRect.width() - 140, 10); ui->settingButt->move(screenRect.width() - 200, 10); + ui->endButt->move(screenRect.width() - 260, 10); + ui->startButt->move(screenRect.width() - 320, 10); ui->line->setGeometry(0, 89, screenRect.width(), 1); - ui->pointsList->setGeometry(250,30,screenRect.width()-500,40); - ui->labelsList->setGeometry(250,60,screenRect.width()-500,30); + ui->pointsList->setGeometry(200,30,screenRect.width()-600,40); + ui->labelsList->setGeometry(200,60,screenRect.width()-600,30); // 设置主体区域的大小和位置 ui->scrollArea->setGeometry(0, 90, screenRect.width(), screenRect.height() - 90); @@ -76,7 +79,8 @@ { // 获取设备数据 int channelNum = 16; - + //测试通道 + bool arr[16] = {true,false,true,false,true,false,true,false,true,false,true,false,true,false,true,false}; QRect screenRect = QApplication::desktop()->screenGeometry(); ui->scrollContents->setGeometry(0, 90, screenRect.width(), channelNum * 170); @@ -86,6 +90,10 @@ for (int i = 0; i < channelNum; i++) { + QLabel* label = ui->pointsList->findChild(QString("p%1").arg(i+1)); //根据子控件的名称查找子控件 + if(arr[i]) label->setPixmap(QPixmap(":/points/images/green.png")); + else label->setPixmap(QPixmap(":/points/images/white.png")); + if(!arr[i]) continue; QGroupBox * group = new QGroupBox(ui->scrollContents); group->setTitle(QString("通道 - %1").arg(i + 1)); group->setFont(QFont("微软雅黑", 12)); @@ -111,3 +119,20 @@ { QApplication::exit(0); } + +void PhaseWindow::on_startButt_clicked() +{ + //发送开始指令 +} + +void PhaseWindow::on_endButt_clicked() +{ + //发送结束指令 +} + +void PhaseWindow::on_settingButt_clicked() +{ + SetConfig *new_win = new SetConfig(); + new_win->setWindowTitle("配置"); + new_win->show(); +} diff --git a/PhaseWindow.h b/PhaseWindow.h index 8f2314d..1ad6281 100644 --- a/PhaseWindow.h +++ b/PhaseWindow.h @@ -28,6 +28,12 @@ void on_minButt_clicked(); void on_exitButt_clicked(); + void on_startButt_clicked(); + + void on_endButt_clicked(); + + void on_settingButt_clicked(); + private: Ui::PhaseWindow *ui; diff --git a/PhaseWindow.ui b/PhaseWindow.ui index f7742fe..749b3ae 100644 --- a/PhaseWindow.ui +++ b/PhaseWindow.ui @@ -706,6 +706,38 @@ + + + + 1100 + 10 + 40 + 40 + + + + + + + 开始 + + + + + + 1150 + 10 + 40 + 40 + + + + + + + 结束 + + diff --git a/SetConfig.cpp b/SetConfig.cpp new file mode 100644 index 0000000..128a3b0 --- /dev/null +++ b/SetConfig.cpp @@ -0,0 +1,31 @@ +#include "SetConfig.h" +#include "ui_SetConfig.h" +#include "QDebug" +SetConfig::SetConfig(QWidget *parent) : + QDialog(parent), + ui(new Ui::SetConfig) +{ + ui->setupUi(this); + init(); +} +void SetConfig::init() +{ + ui->IPInput->setText(SettingConfig::getInstance().DEVICE_HOST); + ui->devInput->setText(QString::number(SettingConfig::getInstance().DEVICE_PORT)); + ui->listenInput->setText(QString::number(SettingConfig::getInstance().LISTEN_PORT)); + ui->logInput->setText(SettingConfig::getInstance().BASE_LOG_PATH); +} +SetConfig::~SetConfig() +{ + delete ui; +} + +void SetConfig::on_buttonBox_accepted() +{ + SettingConfig::getInstance().setConProperty("net", "deviceHost", ui->IPInput->text()); + SettingConfig::getInstance().setConProperty("net", "devicePort", ui->devInput->text()); + SettingConfig::getInstance().setConProperty("net", "listenPort", ui->listenInput->text()); + SettingConfig::getInstance().setConProperty("log", "basePath", ui->logInput->text()); + SettingConfig::getInstance().init(); + qDebug()< +#include "common/utils/SettingConfig.h" +namespace Ui { +class SetConfig; +} + +class SetConfig : public QDialog +{ + Q_OBJECT + +public: + explicit SetConfig(QWidget *parent = nullptr); + ~SetConfig(); + void init(); +private slots: + void on_buttonBox_accepted(); + +private: + Ui::SetConfig *ui; +}; + +#endif // SETCONFIG_H diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 9f3a373..489627c 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -12,7 +12,8 @@ #include #include #include - +#include +#include PhaseWindow::PhaseWindow(QWidget *parent) : QWidget(parent), ui(new Ui::PhaseWindow) @@ -31,9 +32,11 @@ ui->exitButt->move(screenRect.width() - 80, 10); ui->minButt->move(screenRect.width() - 140, 10); ui->settingButt->move(screenRect.width() - 200, 10); + ui->endButt->move(screenRect.width() - 260, 10); + ui->startButt->move(screenRect.width() - 320, 10); ui->line->setGeometry(0, 89, screenRect.width(), 1); - ui->pointsList->setGeometry(250,30,screenRect.width()-500,40); - ui->labelsList->setGeometry(250,60,screenRect.width()-500,30); + ui->pointsList->setGeometry(200,30,screenRect.width()-600,40); + ui->labelsList->setGeometry(200,60,screenRect.width()-600,30); // 设置主体区域的大小和位置 ui->scrollArea->setGeometry(0, 90, screenRect.width(), screenRect.height() - 90); @@ -76,7 +79,8 @@ { // 获取设备数据 int channelNum = 16; - + //测试通道 + bool arr[16] = {true,false,true,false,true,false,true,false,true,false,true,false,true,false,true,false}; QRect screenRect = QApplication::desktop()->screenGeometry(); ui->scrollContents->setGeometry(0, 90, screenRect.width(), channelNum * 170); @@ -86,6 +90,10 @@ for (int i = 0; i < channelNum; i++) { + QLabel* label = ui->pointsList->findChild(QString("p%1").arg(i+1)); //根据子控件的名称查找子控件 + if(arr[i]) label->setPixmap(QPixmap(":/points/images/green.png")); + else label->setPixmap(QPixmap(":/points/images/white.png")); + if(!arr[i]) continue; QGroupBox * group = new QGroupBox(ui->scrollContents); group->setTitle(QString("通道 - %1").arg(i + 1)); group->setFont(QFont("微软雅黑", 12)); @@ -111,3 +119,20 @@ { QApplication::exit(0); } + +void PhaseWindow::on_startButt_clicked() +{ + //发送开始指令 +} + +void PhaseWindow::on_endButt_clicked() +{ + //发送结束指令 +} + +void PhaseWindow::on_settingButt_clicked() +{ + SetConfig *new_win = new SetConfig(); + new_win->setWindowTitle("配置"); + new_win->show(); +} diff --git a/PhaseWindow.h b/PhaseWindow.h index 8f2314d..1ad6281 100644 --- a/PhaseWindow.h +++ b/PhaseWindow.h @@ -28,6 +28,12 @@ void on_minButt_clicked(); void on_exitButt_clicked(); + void on_startButt_clicked(); + + void on_endButt_clicked(); + + void on_settingButt_clicked(); + private: Ui::PhaseWindow *ui; diff --git a/PhaseWindow.ui b/PhaseWindow.ui index f7742fe..749b3ae 100644 --- a/PhaseWindow.ui +++ b/PhaseWindow.ui @@ -706,6 +706,38 @@ + + + + 1100 + 10 + 40 + 40 + + + + + + + 开始 + + + + + + 1150 + 10 + 40 + 40 + + + + + + + 结束 + + diff --git a/SetConfig.cpp b/SetConfig.cpp new file mode 100644 index 0000000..128a3b0 --- /dev/null +++ b/SetConfig.cpp @@ -0,0 +1,31 @@ +#include "SetConfig.h" +#include "ui_SetConfig.h" +#include "QDebug" +SetConfig::SetConfig(QWidget *parent) : + QDialog(parent), + ui(new Ui::SetConfig) +{ + ui->setupUi(this); + init(); +} +void SetConfig::init() +{ + ui->IPInput->setText(SettingConfig::getInstance().DEVICE_HOST); + ui->devInput->setText(QString::number(SettingConfig::getInstance().DEVICE_PORT)); + ui->listenInput->setText(QString::number(SettingConfig::getInstance().LISTEN_PORT)); + ui->logInput->setText(SettingConfig::getInstance().BASE_LOG_PATH); +} +SetConfig::~SetConfig() +{ + delete ui; +} + +void SetConfig::on_buttonBox_accepted() +{ + SettingConfig::getInstance().setConProperty("net", "deviceHost", ui->IPInput->text()); + SettingConfig::getInstance().setConProperty("net", "devicePort", ui->devInput->text()); + SettingConfig::getInstance().setConProperty("net", "listenPort", ui->listenInput->text()); + SettingConfig::getInstance().setConProperty("log", "basePath", ui->logInput->text()); + SettingConfig::getInstance().init(); + qDebug()< +#include "common/utils/SettingConfig.h" +namespace Ui { +class SetConfig; +} + +class SetConfig : public QDialog +{ + Q_OBJECT + +public: + explicit SetConfig(QWidget *parent = nullptr); + ~SetConfig(); + void init(); +private slots: + void on_buttonBox_accepted(); + +private: + Ui::SetConfig *ui; +}; + +#endif // SETCONFIG_H diff --git a/SetConfig.ui b/SetConfig.ui new file mode 100644 index 0000000..5697653 --- /dev/null +++ b/SetConfig.ui @@ -0,0 +1,224 @@ + + + SetConfig + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 30 + 241 + 341 + 31 + + + + + 10 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + false + + + + + + 20 + 30 + 101 + 181 + + + + + + + + 微软雅黑 + 12 + + + + IP: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 设备端口: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 监听端口: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 日志地址: + + + Qt::AlignCenter + + + + + + + + + 120 + 30 + 261 + 181 + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + + + buttonBox + accepted() + SetConfig + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + SetConfig + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 9f3a373..489627c 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -12,7 +12,8 @@ #include #include #include - +#include +#include PhaseWindow::PhaseWindow(QWidget *parent) : QWidget(parent), ui(new Ui::PhaseWindow) @@ -31,9 +32,11 @@ ui->exitButt->move(screenRect.width() - 80, 10); ui->minButt->move(screenRect.width() - 140, 10); ui->settingButt->move(screenRect.width() - 200, 10); + ui->endButt->move(screenRect.width() - 260, 10); + ui->startButt->move(screenRect.width() - 320, 10); ui->line->setGeometry(0, 89, screenRect.width(), 1); - ui->pointsList->setGeometry(250,30,screenRect.width()-500,40); - ui->labelsList->setGeometry(250,60,screenRect.width()-500,30); + ui->pointsList->setGeometry(200,30,screenRect.width()-600,40); + ui->labelsList->setGeometry(200,60,screenRect.width()-600,30); // 设置主体区域的大小和位置 ui->scrollArea->setGeometry(0, 90, screenRect.width(), screenRect.height() - 90); @@ -76,7 +79,8 @@ { // 获取设备数据 int channelNum = 16; - + //测试通道 + bool arr[16] = {true,false,true,false,true,false,true,false,true,false,true,false,true,false,true,false}; QRect screenRect = QApplication::desktop()->screenGeometry(); ui->scrollContents->setGeometry(0, 90, screenRect.width(), channelNum * 170); @@ -86,6 +90,10 @@ for (int i = 0; i < channelNum; i++) { + QLabel* label = ui->pointsList->findChild(QString("p%1").arg(i+1)); //根据子控件的名称查找子控件 + if(arr[i]) label->setPixmap(QPixmap(":/points/images/green.png")); + else label->setPixmap(QPixmap(":/points/images/white.png")); + if(!arr[i]) continue; QGroupBox * group = new QGroupBox(ui->scrollContents); group->setTitle(QString("通道 - %1").arg(i + 1)); group->setFont(QFont("微软雅黑", 12)); @@ -111,3 +119,20 @@ { QApplication::exit(0); } + +void PhaseWindow::on_startButt_clicked() +{ + //发送开始指令 +} + +void PhaseWindow::on_endButt_clicked() +{ + //发送结束指令 +} + +void PhaseWindow::on_settingButt_clicked() +{ + SetConfig *new_win = new SetConfig(); + new_win->setWindowTitle("配置"); + new_win->show(); +} diff --git a/PhaseWindow.h b/PhaseWindow.h index 8f2314d..1ad6281 100644 --- a/PhaseWindow.h +++ b/PhaseWindow.h @@ -28,6 +28,12 @@ void on_minButt_clicked(); void on_exitButt_clicked(); + void on_startButt_clicked(); + + void on_endButt_clicked(); + + void on_settingButt_clicked(); + private: Ui::PhaseWindow *ui; diff --git a/PhaseWindow.ui b/PhaseWindow.ui index f7742fe..749b3ae 100644 --- a/PhaseWindow.ui +++ b/PhaseWindow.ui @@ -706,6 +706,38 @@ + + + + 1100 + 10 + 40 + 40 + + + + + + + 开始 + + + + + + 1150 + 10 + 40 + 40 + + + + + + + 结束 + + diff --git a/SetConfig.cpp b/SetConfig.cpp new file mode 100644 index 0000000..128a3b0 --- /dev/null +++ b/SetConfig.cpp @@ -0,0 +1,31 @@ +#include "SetConfig.h" +#include "ui_SetConfig.h" +#include "QDebug" +SetConfig::SetConfig(QWidget *parent) : + QDialog(parent), + ui(new Ui::SetConfig) +{ + ui->setupUi(this); + init(); +} +void SetConfig::init() +{ + ui->IPInput->setText(SettingConfig::getInstance().DEVICE_HOST); + ui->devInput->setText(QString::number(SettingConfig::getInstance().DEVICE_PORT)); + ui->listenInput->setText(QString::number(SettingConfig::getInstance().LISTEN_PORT)); + ui->logInput->setText(SettingConfig::getInstance().BASE_LOG_PATH); +} +SetConfig::~SetConfig() +{ + delete ui; +} + +void SetConfig::on_buttonBox_accepted() +{ + SettingConfig::getInstance().setConProperty("net", "deviceHost", ui->IPInput->text()); + SettingConfig::getInstance().setConProperty("net", "devicePort", ui->devInput->text()); + SettingConfig::getInstance().setConProperty("net", "listenPort", ui->listenInput->text()); + SettingConfig::getInstance().setConProperty("log", "basePath", ui->logInput->text()); + SettingConfig::getInstance().init(); + qDebug()< +#include "common/utils/SettingConfig.h" +namespace Ui { +class SetConfig; +} + +class SetConfig : public QDialog +{ + Q_OBJECT + +public: + explicit SetConfig(QWidget *parent = nullptr); + ~SetConfig(); + void init(); +private slots: + void on_buttonBox_accepted(); + +private: + Ui::SetConfig *ui; +}; + +#endif // SETCONFIG_H diff --git a/SetConfig.ui b/SetConfig.ui new file mode 100644 index 0000000..5697653 --- /dev/null +++ b/SetConfig.ui @@ -0,0 +1,224 @@ + + + SetConfig + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 30 + 241 + 341 + 31 + + + + + 10 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + false + + + + + + 20 + 30 + 101 + 181 + + + + + + + + 微软雅黑 + 12 + + + + IP: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 设备端口: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 监听端口: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 日志地址: + + + Qt::AlignCenter + + + + + + + + + 120 + 30 + 261 + 181 + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + + + buttonBox + accepted() + SetConfig + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + SetConfig + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/common/utils/SettingConfig.cpp b/common/utils/SettingConfig.cpp index a9421d9..1af9d22 100644 --- a/common/utils/SettingConfig.cpp +++ b/common/utils/SettingConfig.cpp @@ -5,12 +5,7 @@ filename = QApplication::applicationDirPath() + "/conf/config.ini"; setting = new QSettings(this->filename, QSettings::IniFormat); - NET_TYPE = getProperty("net", "type").toString(); - DEVICE_HOST = getProperty("net", "deviceHost").toString(); - DEVICE_PORT = getProperty("net", "devicePort").toUInt(); - LISTEN_PORT = getProperty("net", "listenPort").toUInt(); - - BASE_LOG_PATH = getProperty("log", "basePath").toString(); + init(); } @@ -18,3 +13,16 @@ QVariant var = this->setting->value(QString("/%1/%2").arg(nodeName).arg(keyName)); return var; } + +void SettingConfig::setConProperty(QString nodeName, QString keyName, QString value) { + this->setting->setValue(QString("/%1/%2").arg(nodeName).arg(keyName),value); +} +void SettingConfig::init() { + + NET_TYPE = getProperty("net", "type").toString(); + DEVICE_HOST = getProperty("net", "deviceHost").toString(); + DEVICE_PORT = getProperty("net", "devicePort").toUInt(); + LISTEN_PORT = getProperty("net", "listenPort").toUInt(); + + BASE_LOG_PATH = getProperty("log", "basePath").toString(); +} diff --git a/PhaseMeasure.pro b/PhaseMeasure.pro index 424394d..ca48f14 100644 --- a/PhaseMeasure.pro +++ b/PhaseMeasure.pro @@ -4,17 +4,20 @@ CONFIG += c++11 -FORMS += ChannelItem.ui +FORMS += ChannelItem.ui \ + SetConfig.ui FORMS += PhaseWindow.ui include(common/common.pri) include(protocol/protocol.pri) -HEADERS += PhaseDevice.h +HEADERS += PhaseDevice.h \ + SetConfig.h HEADERS += ChannelItem.h HEADERS += PhaseWindow.h -SOURCES += PhaseDevice.cpp +SOURCES += PhaseDevice.cpp \ + SetConfig.cpp SOURCES += ChannelItem.cpp SOURCES += PhaseWindow.cpp SOURCES += main.cpp diff --git a/PhaseMeasure.pro.user b/PhaseMeasure.pro.user index 89c42e4..2e56ba6 100644 --- a/PhaseMeasure.pro.user +++ b/PhaseMeasure.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b3715025-e290-4df4-afaa-42a38b3e40c1} + {58895c32-e1e9-4248-b30e-d2ac0dfba9c9} ProjectExplorer.Project.ActiveTarget @@ -64,14 +64,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.12.8 MinGW 64-bit - Desktop Qt 5.12.8 MinGW 64-bit - qt.qt5.5128.win64_mingw73_kit + Desktop Qt 5.14.2 MinGW 32-bit + Desktop Qt 5.14.2 MinGW 32-bit + qt.qt5.5142.win32_mingw73_kit 0 0 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug true @@ -119,7 +119,7 @@ 2 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -167,7 +167,7 @@ 0 - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -287,8 +287,8 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro - D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro + E:/workspace/ZXSSCJ/PhaseMeasure/PhaseMeasure.pro false @@ -299,14 +299,257 @@ false true - D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + E:/workspace/ZXSSCJ/build-PhaseMeasure_Qt_5_14_2_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + E:/workspace/ZXSSCJ/build-PhaseMeasure-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/PhaseMeasure.pro.user.b371502 b/PhaseMeasure.pro.user.b371502 new file mode 100644 index 0000000..89c42e4 --- /dev/null +++ b/PhaseMeasure.pro.user.b371502 @@ -0,0 +1,319 @@ + + + + + + EnvironmentId + {b3715025-e290-4df4-afaa-42a38b3e40c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 0 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.8 MinGW 64-bit + Desktop Qt 5.12.8 MinGW 64-bit + qt.qt5.5128.win64_mingw73_kit + 0 + 0 + 0 + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + D:/Workspace Qt/PhaseMeasure/PhaseMeasure.pro + + false + + false + true + true + false + false + true + + D:/Workspace Qt/build-PhaseMeasure-Desktop_Qt_5_12_8_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 9f3a373..489627c 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -12,7 +12,8 @@ #include #include #include - +#include +#include PhaseWindow::PhaseWindow(QWidget *parent) : QWidget(parent), ui(new Ui::PhaseWindow) @@ -31,9 +32,11 @@ ui->exitButt->move(screenRect.width() - 80, 10); ui->minButt->move(screenRect.width() - 140, 10); ui->settingButt->move(screenRect.width() - 200, 10); + ui->endButt->move(screenRect.width() - 260, 10); + ui->startButt->move(screenRect.width() - 320, 10); ui->line->setGeometry(0, 89, screenRect.width(), 1); - ui->pointsList->setGeometry(250,30,screenRect.width()-500,40); - ui->labelsList->setGeometry(250,60,screenRect.width()-500,30); + ui->pointsList->setGeometry(200,30,screenRect.width()-600,40); + ui->labelsList->setGeometry(200,60,screenRect.width()-600,30); // 设置主体区域的大小和位置 ui->scrollArea->setGeometry(0, 90, screenRect.width(), screenRect.height() - 90); @@ -76,7 +79,8 @@ { // 获取设备数据 int channelNum = 16; - + //测试通道 + bool arr[16] = {true,false,true,false,true,false,true,false,true,false,true,false,true,false,true,false}; QRect screenRect = QApplication::desktop()->screenGeometry(); ui->scrollContents->setGeometry(0, 90, screenRect.width(), channelNum * 170); @@ -86,6 +90,10 @@ for (int i = 0; i < channelNum; i++) { + QLabel* label = ui->pointsList->findChild(QString("p%1").arg(i+1)); //根据子控件的名称查找子控件 + if(arr[i]) label->setPixmap(QPixmap(":/points/images/green.png")); + else label->setPixmap(QPixmap(":/points/images/white.png")); + if(!arr[i]) continue; QGroupBox * group = new QGroupBox(ui->scrollContents); group->setTitle(QString("通道 - %1").arg(i + 1)); group->setFont(QFont("微软雅黑", 12)); @@ -111,3 +119,20 @@ { QApplication::exit(0); } + +void PhaseWindow::on_startButt_clicked() +{ + //发送开始指令 +} + +void PhaseWindow::on_endButt_clicked() +{ + //发送结束指令 +} + +void PhaseWindow::on_settingButt_clicked() +{ + SetConfig *new_win = new SetConfig(); + new_win->setWindowTitle("配置"); + new_win->show(); +} diff --git a/PhaseWindow.h b/PhaseWindow.h index 8f2314d..1ad6281 100644 --- a/PhaseWindow.h +++ b/PhaseWindow.h @@ -28,6 +28,12 @@ void on_minButt_clicked(); void on_exitButt_clicked(); + void on_startButt_clicked(); + + void on_endButt_clicked(); + + void on_settingButt_clicked(); + private: Ui::PhaseWindow *ui; diff --git a/PhaseWindow.ui b/PhaseWindow.ui index f7742fe..749b3ae 100644 --- a/PhaseWindow.ui +++ b/PhaseWindow.ui @@ -706,6 +706,38 @@ + + + + 1100 + 10 + 40 + 40 + + + + + + + 开始 + + + + + + 1150 + 10 + 40 + 40 + + + + + + + 结束 + + diff --git a/SetConfig.cpp b/SetConfig.cpp new file mode 100644 index 0000000..128a3b0 --- /dev/null +++ b/SetConfig.cpp @@ -0,0 +1,31 @@ +#include "SetConfig.h" +#include "ui_SetConfig.h" +#include "QDebug" +SetConfig::SetConfig(QWidget *parent) : + QDialog(parent), + ui(new Ui::SetConfig) +{ + ui->setupUi(this); + init(); +} +void SetConfig::init() +{ + ui->IPInput->setText(SettingConfig::getInstance().DEVICE_HOST); + ui->devInput->setText(QString::number(SettingConfig::getInstance().DEVICE_PORT)); + ui->listenInput->setText(QString::number(SettingConfig::getInstance().LISTEN_PORT)); + ui->logInput->setText(SettingConfig::getInstance().BASE_LOG_PATH); +} +SetConfig::~SetConfig() +{ + delete ui; +} + +void SetConfig::on_buttonBox_accepted() +{ + SettingConfig::getInstance().setConProperty("net", "deviceHost", ui->IPInput->text()); + SettingConfig::getInstance().setConProperty("net", "devicePort", ui->devInput->text()); + SettingConfig::getInstance().setConProperty("net", "listenPort", ui->listenInput->text()); + SettingConfig::getInstance().setConProperty("log", "basePath", ui->logInput->text()); + SettingConfig::getInstance().init(); + qDebug()< +#include "common/utils/SettingConfig.h" +namespace Ui { +class SetConfig; +} + +class SetConfig : public QDialog +{ + Q_OBJECT + +public: + explicit SetConfig(QWidget *parent = nullptr); + ~SetConfig(); + void init(); +private slots: + void on_buttonBox_accepted(); + +private: + Ui::SetConfig *ui; +}; + +#endif // SETCONFIG_H diff --git a/SetConfig.ui b/SetConfig.ui new file mode 100644 index 0000000..5697653 --- /dev/null +++ b/SetConfig.ui @@ -0,0 +1,224 @@ + + + SetConfig + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 30 + 241 + 341 + 31 + + + + + 10 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + false + + + + + + 20 + 30 + 101 + 181 + + + + + + + + 微软雅黑 + 12 + + + + IP: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 设备端口: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 监听端口: + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 12 + + + + 日志地址: + + + Qt::AlignCenter + + + + + + + + + 120 + 30 + 261 + 181 + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + 0 + 35 + + + + + 11 + + + + + + + + + + + buttonBox + accepted() + SetConfig + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + SetConfig + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/common/utils/SettingConfig.cpp b/common/utils/SettingConfig.cpp index a9421d9..1af9d22 100644 --- a/common/utils/SettingConfig.cpp +++ b/common/utils/SettingConfig.cpp @@ -5,12 +5,7 @@ filename = QApplication::applicationDirPath() + "/conf/config.ini"; setting = new QSettings(this->filename, QSettings::IniFormat); - NET_TYPE = getProperty("net", "type").toString(); - DEVICE_HOST = getProperty("net", "deviceHost").toString(); - DEVICE_PORT = getProperty("net", "devicePort").toUInt(); - LISTEN_PORT = getProperty("net", "listenPort").toUInt(); - - BASE_LOG_PATH = getProperty("log", "basePath").toString(); + init(); } @@ -18,3 +13,16 @@ QVariant var = this->setting->value(QString("/%1/%2").arg(nodeName).arg(keyName)); return var; } + +void SettingConfig::setConProperty(QString nodeName, QString keyName, QString value) { + this->setting->setValue(QString("/%1/%2").arg(nodeName).arg(keyName),value); +} +void SettingConfig::init() { + + NET_TYPE = getProperty("net", "type").toString(); + DEVICE_HOST = getProperty("net", "deviceHost").toString(); + DEVICE_PORT = getProperty("net", "devicePort").toUInt(); + LISTEN_PORT = getProperty("net", "listenPort").toUInt(); + + BASE_LOG_PATH = getProperty("log", "basePath").toString(); +} diff --git a/common/utils/SettingConfig.h b/common/utils/SettingConfig.h index 0674ffd..1e16b63 100644 --- a/common/utils/SettingConfig.h +++ b/common/utils/SettingConfig.h @@ -25,7 +25,8 @@ * @title */ QVariant getProperty(QString nodeName, QString keyName); - + void setConProperty(QString nodeName, QString keyName, QString value); + void init(); /******** 以下为需要的各类参数 ********/ QString NET_TYPE; QString DEVICE_HOST;