├── 3rdparty ├── communication │ ├── bin │ │ └── communication.dll │ ├── include │ │ ├── communicationdef.h │ │ └── communicationglobal.h │ └── lib │ │ └── communication.lib ├── glog │ ├── bin │ │ └── glog.dll │ ├── include │ │ └── glog │ │ │ ├── export.h │ │ │ ├── log_severity.h │ │ │ ├── logging.h │ │ │ ├── platform.h │ │ │ ├── raw_logging.h │ │ │ ├── stl_logging.h │ │ │ └── vlog_is_on.h │ └── lib │ │ └── glog.lib ├── json-develop │ └── include │ │ └── nlohmann │ │ ├── adl_serializer.hpp │ │ ├── byte_container_with_subtype.hpp │ │ ├── detail │ │ ├── abi_macros.hpp │ │ ├── conversions │ │ │ ├── from_json.hpp │ │ │ ├── to_chars.hpp │ │ │ └── to_json.hpp │ │ ├── exceptions.hpp │ │ ├── hash.hpp │ │ ├── input │ │ │ ├── binary_reader.hpp │ │ │ ├── input_adapters.hpp │ │ │ ├── json_sax.hpp │ │ │ ├── lexer.hpp │ │ │ ├── parser.hpp │ │ │ └── position_t.hpp │ │ ├── iterators │ │ │ ├── internal_iterator.hpp │ │ │ ├── iter_impl.hpp │ │ │ ├── iteration_proxy.hpp │ │ │ ├── iterator_traits.hpp │ │ │ ├── json_reverse_iterator.hpp │ │ │ └── primitive_iterator.hpp │ │ ├── json_custom_base_class.hpp │ │ ├── json_pointer.hpp │ │ ├── json_ref.hpp │ │ ├── macro_scope.hpp │ │ ├── macro_unscope.hpp │ │ ├── meta │ │ │ ├── call_std │ │ │ │ ├── begin.hpp │ │ │ │ └── end.hpp │ │ │ ├── cpp_future.hpp │ │ │ ├── detected.hpp │ │ │ ├── identity_tag.hpp │ │ │ ├── is_sax.hpp │ │ │ ├── std_fs.hpp │ │ │ ├── type_traits.hpp │ │ │ └── void_t.hpp │ │ ├── output │ │ │ ├── binary_writer.hpp │ │ │ ├── output_adapters.hpp │ │ │ └── serializer.hpp │ │ ├── string_concat.hpp │ │ ├── string_escape.hpp │ │ └── value_t.hpp │ │ ├── json.hpp │ │ ├── json_fwd.hpp │ │ ├── ordered_map.hpp │ │ └── thirdparty │ │ └── hedley │ │ ├── hedley.hpp │ │ └── hedley_undef.hpp ├── lua │ ├── bin │ │ └── lua.dll │ ├── include │ │ ├── lauxlib.h │ │ ├── lua.h │ │ ├── lua.hpp │ │ ├── luaconf.h │ │ └── lualib.h │ └── lib │ │ └── lua.lib └── qscintilla │ ├── debug │ ├── bin │ │ └── qscintilla2_qt5d.dll │ └── lib │ │ └── qscintilla2_qt5d.lib │ ├── include │ └── Qsci │ │ ├── qsciabstractapis.h │ │ ├── qsciapis.h │ │ ├── qscicommand.h │ │ ├── qscicommandset.h │ │ ├── qscidocument.h │ │ ├── qsciglobal.h │ │ ├── qscilexer.h │ │ ├── qscilexeravs.h │ │ ├── qscilexerbash.h │ │ ├── qscilexerbatch.h │ │ ├── qscilexercmake.h │ │ ├── qscilexercoffeescript.h │ │ ├── qscilexercpp.h │ │ ├── qscilexercsharp.h │ │ ├── qscilexercss.h │ │ ├── qscilexercustom.h │ │ ├── qscilexerd.h │ │ ├── qscilexerdiff.h │ │ ├── qscilexeredifact.h │ │ ├── qscilexerfortran.h │ │ ├── qscilexerfortran77.h │ │ ├── qscilexerhtml.h │ │ ├── qscilexeridl.h │ │ ├── qscilexerjava.h │ │ ├── qscilexerjavascript.h │ │ ├── qscilexerjson.h │ │ ├── qscilexerlua.h │ │ ├── qscilexermakefile.h │ │ ├── qscilexermarkdown.h │ │ ├── qscilexermatlab.h │ │ ├── qscilexeroctave.h │ │ ├── qscilexerpascal.h │ │ ├── qscilexerperl.h │ │ ├── qscilexerpo.h │ │ ├── qscilexerpostscript.h │ │ ├── qscilexerpov.h │ │ ├── qscilexerproperties.h │ │ ├── qscilexerpython.h │ │ ├── qscilexerruby.h │ │ ├── qscilexerspice.h │ │ ├── qscilexersql.h │ │ ├── qscilexertcl.h │ │ ├── qscilexertex.h │ │ ├── qscilexerverilog.h │ │ ├── qscilexervhdl.h │ │ ├── qscilexerxml.h │ │ ├── qscilexeryaml.h │ │ ├── qscimacro.h │ │ ├── qsciprinter.h │ │ ├── qsciscintilla.h │ │ ├── qsciscintillabase.h │ │ ├── qscistyle.h │ │ └── qscistyledtext.h │ └── release │ ├── bin │ └── qscintilla2_qt5.dll │ └── lib │ └── qscintilla2_qt5.lib ├── CommunicationProtocol ├── CommunicationProtocol.pro ├── common │ ├── DataAreaDeal.cpp │ ├── DataAreaDeal.h │ ├── ValueChangeDeal.cpp │ ├── ValueChangeDeal.h │ ├── common.pri │ ├── protocol.h │ ├── protocol_extend.cpp │ ├── protocol_global.h │ ├── protocol_interface.cpp │ ├── protocol_interface.h │ ├── protocol_type.h │ ├── service.cpp │ ├── service.h │ ├── service_def.h │ └── typedefheader.h ├── protocol-cip │ ├── cip.cpp │ ├── cip.h │ ├── protocol-cip.pro │ └── protocol.cpp ├── protocol-meshttp │ ├── meshttp.cpp │ ├── meshttp.h │ ├── protocol-meshttp.pro │ └── protocol.cpp └── protocol-modbusRtu │ ├── modbusRtu.cpp │ ├── modbusRtu.h │ ├── protocol-modbusRtu.pro │ └── protocol.cpp ├── Core ├── App │ ├── App.pro │ ├── IAppRun.cpp │ ├── IAppRun.h │ └── SafeQueue.h ├── Core.pro └── Core │ ├── Core.pro │ ├── FileCommunication │ ├── CommunicationManagement.cpp │ ├── CommunicationManagement.h │ ├── FileCommunication.pri │ ├── ProtocolManager.cpp │ └── ProtocolManager.h │ ├── Interface │ ├── IApp.h │ ├── IFuncModel.h │ ├── IUiSupportModel.h │ ├── IZObject.h │ ├── event_def.h │ ├── extend_func_def.h │ ├── extend_func_head.h │ ├── interface_comm.h │ └── protocol_type.h │ ├── Process │ ├── AppRun.cpp │ ├── AppRun.h │ ├── FuncManager.cpp │ ├── FuncManager.h │ ├── Process.pri │ ├── UISupportManager.cpp │ ├── UISupportManager.h │ └── main.cpp │ ├── image.qrc │ ├── image │ ├── app.ico │ └── logo.ico │ └── logo.rc ├── Example └── test-communication │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── mainwindow.ui │ └── test-communication.pro ├── FuncModel ├── FuncModel.pro ├── FuncModel.pro.user ├── Script │ ├── LuaObject.cpp │ ├── LuaObject.h │ ├── MacroInterface.cpp │ ├── MacroInterface.h │ ├── Script.cpp │ ├── Script.h │ └── Script.pro └── ScriptExtend0 │ ├── ScriptExtend0.pro │ ├── test1.cpp │ └── test1.h ├── ICStudio.pro ├── ICStudioEdit ├── ICStudioEdit.pro └── main.cpp ├── ICStudioRun ├── ICStudioRun.pro └── main.cpp ├── Interface ├── IApp.h ├── IFuncModel.h ├── IUiSupportModel.h ├── IZObject.h ├── event_def.h ├── extend_func_def.h ├── extend_func_head.h ├── interface_comm.h └── protocol_type.h ├── LICENSE ├── Libs ├── Libs.pro ├── Tools │ ├── Tools.pro │ ├── excel.cpp │ ├── excel.h │ ├── tools.cpp │ └── tools.h └── lua │ ├── lua.pro │ ├── lua.pro.user │ └── src │ ├── lapi.c │ ├── lapi.h │ ├── lauxlib.c │ ├── lauxlib.h │ ├── lbaselib.c │ ├── lbitlib.c │ ├── lcode.c │ ├── lcode.h │ ├── lcorolib.c │ ├── lctype.c │ ├── lctype.h │ ├── ldblib.c │ ├── ldebug.c │ ├── ldebug.h │ ├── ldo.c │ ├── ldo.h │ ├── ldump.c │ ├── lfunc.c │ ├── lfunc.h │ ├── lgc.c │ ├── lgc.h │ ├── linit.c │ ├── liolib.c │ ├── llex.c │ ├── llex.h │ ├── llimits.h │ ├── lmathlib.c │ ├── lmem.c │ ├── lmem.h │ ├── loadlib.c │ ├── lobject.c │ ├── lobject.h │ ├── lopcodes.c │ ├── lopcodes.h │ ├── loslib.c │ ├── lparser.c │ ├── lparser.h │ ├── lprefix.h │ ├── lstate.c │ ├── lstate.h │ ├── lstring.c │ ├── lstring.h │ ├── lstrlib.c │ ├── ltable.c │ ├── ltable.h │ ├── ltablib.c │ ├── ltm.c │ ├── ltm.h │ ├── lua.c │ ├── lua.h │ ├── lua.hpp │ ├── luac.c │ ├── luaconf.h │ ├── lualib.h │ ├── lundump.c │ ├── lundump.h │ ├── lutf8lib.c │ ├── lvm.c │ ├── lvm.h │ ├── lzio.c │ └── lzio.h ├── README.md ├── ScriptEdit ├── AddrEditWidget.cpp ├── AddrEditWidget.h ├── FuncManager.cpp ├── FuncManager.h ├── FunctionEditDialog.cpp ├── FunctionEditDialog.h ├── ScriptEdit.pro ├── ScriptEdit.pro.user ├── image.qrc ├── image │ ├── compile.png │ ├── logo.ico │ ├── new.png │ ├── open.png │ ├── save.png │ └── saveall.png ├── logo.rc ├── macroconfig.h ├── macroeditdialog.cpp ├── macroeditdialog.h ├── macroeditdialog.ui ├── main.cpp ├── mainwindow.cpp └── mainwindow.h ├── UiEdit ├── Items │ ├── BackgroundSettingsW.cpp │ ├── BackgroundSettingsW.h │ ├── ItemHelper.cpp │ ├── ItemHelper.h │ ├── ItemProEditDlgBase.cpp │ ├── ItemProEditDlgBase.h │ ├── Items.pro │ ├── LabelBase.cpp │ ├── LabelBase.h │ ├── bitButton │ │ ├── Bit Button.png │ │ ├── BitButtonProDialog.cpp │ │ ├── BitButtonProDialog.h │ │ ├── bitButton.cpp │ │ ├── bitButton.h │ │ ├── bitButton.pro │ │ ├── bitButtonProDlg.cpp │ │ ├── bitButtonProDlg.h │ │ ├── image.qrc │ │ ├── off.png │ │ └── on.png │ ├── combine │ │ ├── combine.cpp │ │ ├── combine.h │ │ └── combine.pro │ ├── interface_item.h │ ├── item_base.h │ ├── protocol_type.h │ ├── sceneButton │ │ ├── Scene Button.png │ │ ├── image.qrc │ │ ├── sceneButton.cpp │ │ ├── sceneButton.h │ │ ├── sceneButton.pro │ │ ├── sceneButtonProDlg.cpp │ │ └── sceneButtonProDlg.h │ └── textEdit │ │ ├── TextEdit.png │ │ ├── image.qrc │ │ ├── textEdit.cpp │ │ ├── textEdit.h │ │ ├── textEdit.pro │ │ ├── textEditProDlg.cpp │ │ └── textEditProDlg.h ├── UiEdit.pro └── UiEdit │ ├── CustomComponentsDlg.cpp │ ├── CustomComponentsDlg.h │ ├── DisplayCustomComponentsDlg.cpp │ ├── DisplayCustomComponentsDlg.h │ ├── Gallery │ ├── Gallery.cpp │ ├── Gallery.h │ ├── GalleryDlg.cpp │ ├── GalleryDlg.h │ └── interface_gallery.h │ ├── Itemsfactory.cpp │ ├── Itemsfactory.h │ ├── MainStatusBar.cpp │ ├── MainStatusBar.h │ ├── MainWindow.cpp │ ├── MainWindow.h │ ├── UIInputPolicy │ ├── IUIInputPolicy.h │ ├── RectCreate_UIInput.cpp │ ├── RectCreate_UIInput.h │ ├── RectEdit_UIInput.cpp │ ├── RectEdit_UIInput.h │ ├── Select_UIInput.cpp │ └── Select_UIInput.h │ ├── UScenePropertyEditDlg.cpp │ ├── UScenePropertyEditDlg.h │ ├── UTabWidget.cpp │ ├── UTabWidget.h │ ├── UToolbar.cpp │ ├── UToolbar.h │ ├── UWidgetScene.cpp │ ├── UWidgetScene.h │ ├── UiEdit.cpp │ ├── UiEdit.h │ ├── UiEdit.pro │ ├── Undo │ ├── UAddUndo.cpp │ ├── UAddUndo.h │ ├── UDelUndo.cpp │ ├── UDelUndo.h │ ├── UMoveUndo.cpp │ ├── UMoveUndo.h │ ├── URectUndo.cpp │ └── URectUndo.h │ ├── VariableTable │ ├── VariableTable.cpp │ ├── VariableTable.h │ ├── VariableTableDlg.cpp │ ├── VariableTableDlg.h │ └── interface_variable_table.h │ ├── image.qrc │ └── image │ ├── Text center.png │ ├── Text down.png │ ├── Text left down.png │ ├── Text left up.png │ ├── Text left.png │ ├── Text right down.png │ ├── Text right up.png │ ├── Text right.png │ ├── Text up.png │ ├── bottom.png │ ├── compile.png │ ├── copy.png │ ├── custom item display.png │ ├── custom item setting.png │ ├── cut.png │ ├── delete screen.png │ ├── delete.png │ ├── duplicate.png │ ├── edit.png │ ├── export.png │ ├── gallery.png │ ├── group.png │ ├── horizontal center.png │ ├── horizontal equidistant.png │ ├── import.png │ ├── item save.png │ ├── left.png │ ├── lock.png │ ├── make same height.png │ ├── make same size.png │ ├── make same width.png │ ├── move down.png │ ├── move left.png │ ├── move right.png │ ├── move to back.png │ ├── move to bottom.png │ ├── move to front.png │ ├── move to top.png │ ├── move up.png │ ├── new screen.png │ ├── new.png │ ├── open.png │ ├── paste.png │ ├── property.png │ ├── redo.png │ ├── reverse select.png │ ├── right.png │ ├── save.png │ ├── saveall.png │ ├── scene.png │ ├── script.png │ ├── search.png │ ├── select all.png │ ├── system setting.png │ ├── system.png │ ├── top.png │ ├── undo.png │ ├── ungroup.png │ ├── unlock.png │ ├── variables.png │ ├── vertical center.png │ ├── vertical equidistant.png │ ├── window.png │ ├── zoom in.png │ └── zoom out.png ├── communication ├── Communication.cpp ├── LogService.cpp ├── LogService.h ├── SafeQueue.h ├── SerialComm.cpp ├── SerialComm.h ├── TcpClient.cpp ├── TcpClient.h ├── TcpServer.cpp ├── TcpServer.h ├── UpdComm.cpp ├── UpdComm.h ├── communication.pro ├── communication.pro.user ├── communicationbase.cpp ├── communicationbase.h ├── communicationdef.h ├── communicationglobal.h ├── serialport │ ├── SerialPort.cpp │ ├── SerialPort.h │ ├── SerialPortBase.cpp │ ├── SerialPortBase.h │ ├── SerialPortInfo.cpp │ ├── SerialPortInfo.h │ ├── SerialPortInfoBase.cpp │ ├── SerialPortInfoBase.h │ ├── SerialPortInfoUnixBase.cpp │ ├── SerialPortInfoUnixBase.h │ ├── SerialPortInfoWinBase.cpp │ ├── SerialPortInfoWinBase.h │ ├── SerialPortUnixBase.cpp │ ├── SerialPortUnixBase.h │ ├── SerialPortWinBase.cpp │ ├── SerialPortWinBase.h │ ├── SerialPort_global.h │ ├── osplatformutil.h │ └── sigslot.h └── socket │ ├── io_config.h │ ├── io_def.h │ ├── io_epoll.cpp │ ├── io_epoll.h │ ├── io_log_service.cpp │ ├── io_log_service.h │ ├── io_select.cpp │ ├── io_select.h │ ├── io_util.cpp │ └── io_util.h └── win32-msvc-mes-bin ├── debug ├── 7z.dll ├── 7z.exe ├── CustomComponents │ └── test0 │ │ ├── item000.item │ │ ├── item000.png │ │ ├── item001.item │ │ ├── item001.png │ │ ├── item002.item │ │ ├── item002.png │ │ ├── item003.item │ │ ├── item003.png │ │ ├── item004.item │ │ └── item004.png ├── Qt5SerialPort.dll ├── ScriptEditor.exe ├── glog.dll ├── image │ └── test11 │ │ ├── off.png │ │ └── on.png ├── lua.dll ├── project │ ├── FuncModel_Errcode.ini │ ├── PlcAddr.ini │ ├── communication.d │ ├── scene │ │ ├── 122.scene │ │ ├── 124.scene │ │ ├── 1254.scene │ │ ├── 157.scene │ │ ├── CurrentSession │ │ ├── dwad.scene │ │ ├── dwd.scene │ │ ├── null.scene │ │ ├── null0.scene │ │ ├── test0.scene │ │ └── test1.scene │ ├── script │ │ ├── 1223.script │ │ ├── CurrentSession │ │ ├── bookmarks │ │ ├── cyc-c1.script │ │ └── test111.script │ ├── system.ini │ ├── uiInfo.ini │ ├── variables │ │ ├── 你.vars │ │ └── 我.vars │ └── version.ini ├── qscintilla2_qt5d.dll └── system │ ├── script_function │ ├── GetValue │ ├── SetValue │ └── SetValue1 │ ├── systemConfig.json │ └── uiProject.json └── release ├── 7z.dll ├── 7z.exe ├── lua.dll ├── lua.exp └── lua.lib /3rdparty/communication/bin/communication.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/communication/bin/communication.dll -------------------------------------------------------------------------------- /3rdparty/communication/lib/communication.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/communication/lib/communication.lib -------------------------------------------------------------------------------- /3rdparty/glog/bin/glog.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/glog/bin/glog.dll -------------------------------------------------------------------------------- /3rdparty/glog/include/glog/export.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef GLOG_EXPORT_H 3 | #define GLOG_EXPORT_H 4 | 5 | #ifdef GLOG_STATIC_DEFINE 6 | # define GLOG_EXPORT 7 | # define GLOG_NO_EXPORT 8 | #else 9 | # ifndef GLOG_EXPORT 10 | # ifdef GOOGLE_GLOG_IS_A_DLL 11 | /* We are building this library */ 12 | # define GLOG_EXPORT __declspec(dllexport) 13 | # else 14 | /* We are using this library */ 15 | # define GLOG_EXPORT __declspec(dllimport) 16 | # endif 17 | # endif 18 | 19 | # ifndef GLOG_NO_EXPORT 20 | # define GLOG_NO_EXPORT 21 | # endif 22 | #endif 23 | 24 | #ifndef GLOG_DEPRECATED 25 | # define GLOG_DEPRECATED __declspec(deprecated) 26 | #endif 27 | 28 | #ifndef GLOG_DEPRECATED_EXPORT 29 | # define GLOG_DEPRECATED_EXPORT GLOG_EXPORT GLOG_DEPRECATED 30 | #endif 31 | 32 | #ifndef GLOG_DEPRECATED_NO_EXPORT 33 | # define GLOG_DEPRECATED_NO_EXPORT GLOG_NO_EXPORT GLOG_DEPRECATED 34 | #endif 35 | 36 | #if 0 /* DEFINE_NO_DEPRECATED */ 37 | # ifndef GLOG_NO_DEPRECATED 38 | # define GLOG_NO_DEPRECATED 39 | # endif 40 | #endif 41 | 42 | #endif /* GLOG_EXPORT_H */ 43 | -------------------------------------------------------------------------------- /3rdparty/glog/lib/glog.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/glog/lib/glog.lib -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/input/position_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // size_t 12 | 13 | #include 14 | 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | 19 | /// struct to capture the start position of the current token 20 | struct position_t 21 | { 22 | /// the total number of characters read 23 | std::size_t chars_read_total = 0; 24 | /// the number of characters read in the current line 25 | std::size_t chars_read_current_line = 0; 26 | /// the number of lines read 27 | std::size_t lines_read = 0; 28 | 29 | /// conversion to size_t to preserve SAX interface 30 | constexpr operator size_t() const 31 | { 32 | return chars_read_total; 33 | } 34 | }; 35 | 36 | } // namespace detail 37 | NLOHMANN_JSON_NAMESPACE_END 38 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/iterators/internal_iterator.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | NLOHMANN_JSON_NAMESPACE_BEGIN 15 | namespace detail 16 | { 17 | 18 | /*! 19 | @brief an iterator value 20 | 21 | @note This structure could easily be a union, but MSVC currently does not allow 22 | unions members with complex constructors, see https://github.com/nlohmann/json/pull/105. 23 | */ 24 | template struct internal_iterator 25 | { 26 | /// iterator for JSON objects 27 | typename BasicJsonType::object_t::iterator object_iterator {}; 28 | /// iterator for JSON arrays 29 | typename BasicJsonType::array_t::iterator array_iterator {}; 30 | /// generic iterator for all other types 31 | primitive_iterator_t primitive_iterator {}; 32 | }; 33 | 34 | } // namespace detail 35 | NLOHMANN_JSON_NAMESPACE_END 36 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/iterators/iterator_traits.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // random_access_iterator_tag 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | namespace detail 19 | { 20 | 21 | template 22 | struct iterator_types {}; 23 | 24 | template 25 | struct iterator_types < 26 | It, 27 | void_t> 29 | { 30 | using difference_type = typename It::difference_type; 31 | using value_type = typename It::value_type; 32 | using pointer = typename It::pointer; 33 | using reference = typename It::reference; 34 | using iterator_category = typename It::iterator_category; 35 | }; 36 | 37 | // This is required as some compilers implement std::iterator_traits in a way that 38 | // doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. 39 | template 40 | struct iterator_traits 41 | { 42 | }; 43 | 44 | template 45 | struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> 46 | : iterator_types 47 | { 48 | }; 49 | 50 | template 51 | struct iterator_traits::value>> 52 | { 53 | using iterator_category = std::random_access_iterator_tag; 54 | using value_type = T; 55 | using difference_type = ptrdiff_t; 56 | using pointer = T*; 57 | using reference = T&; 58 | }; 59 | 60 | } // namespace detail 61 | NLOHMANN_JSON_NAMESPACE_END 62 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/json_custom_base_class.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include // conditional, is_same 4 | 5 | #include 6 | 7 | NLOHMANN_JSON_NAMESPACE_BEGIN 8 | namespace detail 9 | { 10 | 11 | /*! 12 | @brief Default base class of the @ref basic_json class. 13 | 14 | So that the correct implementations of the copy / move ctors / assign operators 15 | of @ref basic_json do not require complex case distinctions 16 | (no base class / custom base class used as customization point), 17 | @ref basic_json always has a base class. 18 | By default, this class is used because it is empty and thus has no effect 19 | on the behavior of @ref basic_json. 20 | */ 21 | struct json_default_base {}; 22 | 23 | template 24 | using json_base_class = typename std::conditional < 25 | std::is_same::value, 26 | json_default_base, 27 | T 28 | >::type; 29 | 30 | } // namespace detail 31 | NLOHMANN_JSON_NAMESPACE_END 32 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/macro_unscope.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | // restore clang diagnostic settings 12 | #if defined(__clang__) 13 | #pragma clang diagnostic pop 14 | #endif 15 | 16 | // clean up 17 | #undef JSON_ASSERT 18 | #undef JSON_INTERNAL_CATCH 19 | #undef JSON_THROW 20 | #undef JSON_PRIVATE_UNLESS_TESTED 21 | #undef NLOHMANN_BASIC_JSON_TPL_DECLARATION 22 | #undef NLOHMANN_BASIC_JSON_TPL 23 | #undef JSON_EXPLICIT 24 | #undef NLOHMANN_CAN_CALL_STD_FUNC_IMPL 25 | #undef JSON_INLINE_VARIABLE 26 | #undef JSON_NO_UNIQUE_ADDRESS 27 | #undef JSON_DISABLE_ENUM_SERIALIZATION 28 | #undef JSON_USE_GLOBAL_UDLS 29 | 30 | #ifndef JSON_TEST_KEEP_MACROS 31 | #undef JSON_CATCH 32 | #undef JSON_TRY 33 | #undef JSON_HAS_CPP_11 34 | #undef JSON_HAS_CPP_14 35 | #undef JSON_HAS_CPP_17 36 | #undef JSON_HAS_CPP_20 37 | #undef JSON_HAS_FILESYSTEM 38 | #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM 39 | #undef JSON_HAS_THREE_WAY_COMPARISON 40 | #undef JSON_HAS_RANGES 41 | #undef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 42 | #endif 43 | 44 | #include 45 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/meta/call_std/begin.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); 16 | 17 | NLOHMANN_JSON_NAMESPACE_END 18 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/meta/call_std/end.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); 16 | 17 | NLOHMANN_JSON_NAMESPACE_END 18 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/meta/identity_tag.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | // dispatching helper struct 18 | template struct identity_tag {}; 19 | 20 | } // namespace detail 21 | NLOHMANN_JSON_NAMESPACE_END 22 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/meta/std_fs.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #if JSON_HAS_EXPERIMENTAL_FILESYSTEM 14 | #include 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | namespace std_fs = std::experimental::filesystem; 19 | } // namespace detail 20 | NLOHMANN_JSON_NAMESPACE_END 21 | #elif JSON_HAS_FILESYSTEM 22 | #include 23 | NLOHMANN_JSON_NAMESPACE_BEGIN 24 | namespace detail 25 | { 26 | namespace std_fs = std::filesystem; 27 | } // namespace detail 28 | NLOHMANN_JSON_NAMESPACE_END 29 | #endif 30 | -------------------------------------------------------------------------------- /3rdparty/json-develop/include/nlohmann/detail/meta/void_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | template struct make_void 18 | { 19 | using type = void; 20 | }; 21 | template using void_t = typename make_void::type; 22 | 23 | } // namespace detail 24 | NLOHMANN_JSON_NAMESPACE_END 25 | -------------------------------------------------------------------------------- /3rdparty/lua/bin/lua.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/lua/bin/lua.dll -------------------------------------------------------------------------------- /3rdparty/lua/include/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lua/include/luaconf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/lua/include/luaconf.h -------------------------------------------------------------------------------- /3rdparty/lua/include/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.45 2017/01/12 17:14:26 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_BITLIBNAME "bit32" 39 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 40 | 41 | #define LUA_MATHLIBNAME "math" 42 | LUAMOD_API int (luaopen_math) (lua_State *L); 43 | 44 | #define LUA_DBLIBNAME "debug" 45 | LUAMOD_API int (luaopen_debug) (lua_State *L); 46 | 47 | #define LUA_LOADLIBNAME "package" 48 | LUAMOD_API int (luaopen_package) (lua_State *L); 49 | 50 | 51 | /* open all previous libraries */ 52 | LUALIB_API void (luaL_openlibs) (lua_State *L); 53 | 54 | 55 | 56 | #if !defined(lua_assert) 57 | #define lua_assert(x) ((void)0) 58 | #endif 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /3rdparty/lua/lib/lua.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/lua/lib/lua.lib -------------------------------------------------------------------------------- /3rdparty/qscintilla/debug/bin/qscintilla2_qt5d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/qscintilla/debug/bin/qscintilla2_qt5d.dll -------------------------------------------------------------------------------- /3rdparty/qscintilla/debug/lib/qscintilla2_qt5d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/qscintilla/debug/lib/qscintilla2_qt5d.lib -------------------------------------------------------------------------------- /3rdparty/qscintilla/include/Qsci/qsciglobal.h: -------------------------------------------------------------------------------- 1 | // This module defines various things common to all of the Scintilla Qt port. 2 | // 3 | // Copyright (c) 2023 Riverbank Computing Limited 4 | // 5 | // This file is part of QScintilla. 6 | // 7 | // This file may be used under the terms of the GNU General Public License 8 | // version 3.0 as published by the Free Software Foundation and appearing in 9 | // the file LICENSE included in the packaging of this file. Please review the 10 | // following information to ensure the GNU General Public License version 3.0 11 | // requirements will be met: http://www.gnu.org/copyleft/gpl.html. 12 | // 13 | // If you do not wish to use this file under the terms of the GPL version 3.0 14 | // then you may purchase a commercial license. For more information contact 15 | // info@riverbankcomputing.com. 16 | // 17 | // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 18 | // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 | 20 | 21 | #ifndef QSCIGLOBAL_H 22 | #define QSCIGLOBAL_H 23 | 24 | #include 25 | 26 | 27 | #define QSCINTILLA_VERSION 0x020d04 28 | #define QSCINTILLA_VERSION_STR "2.13.4" 29 | 30 | 31 | // We only support Qt v5.11 and later. 32 | #if QT_VERSION < 0x050b00 33 | #error "Qt v5.11.0 or later is required" 34 | #endif 35 | 36 | 37 | // Define QSCINTILLA_MAKE_DLL to create a QScintilla shared library, or 38 | // define QSCINTILLA_DLL to link against a QScintilla shared library, or define 39 | // neither to either build or link against a static QScintilla library. 40 | #if defined(QSCINTILLA_DLL) 41 | #define QSCINTILLA_EXPORT Q_DECL_IMPORT 42 | #elif defined(QSCINTILLA_MAKE_DLL) 43 | #define QSCINTILLA_EXPORT Q_DECL_EXPORT 44 | #else 45 | #define QSCINTILLA_EXPORT 46 | #endif 47 | 48 | 49 | #if !defined(QT_BEGIN_NAMESPACE) 50 | #define QT_BEGIN_NAMESPACE 51 | #define QT_END_NAMESPACE 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /3rdparty/qscintilla/include/Qsci/qscilexerjava.h: -------------------------------------------------------------------------------- 1 | // This defines the interface to the QsciLexerJava class. 2 | // 3 | // Copyright (c) 2023 Riverbank Computing Limited 4 | // 5 | // This file is part of QScintilla. 6 | // 7 | // This file may be used under the terms of the GNU General Public License 8 | // version 3.0 as published by the Free Software Foundation and appearing in 9 | // the file LICENSE included in the packaging of this file. Please review the 10 | // following information to ensure the GNU General Public License version 3.0 11 | // requirements will be met: http://www.gnu.org/copyleft/gpl.html. 12 | // 13 | // If you do not wish to use this file under the terms of the GPL version 3.0 14 | // then you may purchase a commercial license. For more information contact 15 | // info@riverbankcomputing.com. 16 | // 17 | // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 18 | // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 | 20 | 21 | #ifndef QSCILEXERJAVA_H 22 | #define QSCILEXERJAVA_H 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | 30 | //! \brief The QsciLexerJava class encapsulates the Scintilla Java lexer. 31 | class QSCINTILLA_EXPORT QsciLexerJava : public QsciLexerCPP 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | //! Construct a QsciLexerJava with parent \a parent. \a parent is 37 | //! typically the QsciScintilla instance. 38 | QsciLexerJava(QObject *parent = 0); 39 | 40 | //! Destroys the QsciLexerJava instance. 41 | virtual ~QsciLexerJava(); 42 | 43 | //! Returns the name of the language. 44 | const char *language() const; 45 | 46 | //! Returns the set of keywords for the keyword set \a set recognised 47 | //! by the lexer as a space separated string. 48 | const char *keywords(int set) const; 49 | 50 | private: 51 | QsciLexerJava(const QsciLexerJava &); 52 | QsciLexerJava &operator=(const QsciLexerJava &); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /3rdparty/qscintilla/release/bin/qscintilla2_qt5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/qscintilla/release/bin/qscintilla2_qt5.dll -------------------------------------------------------------------------------- /3rdparty/qscintilla/release/lib/qscintilla2_qt5.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/3rdparty/qscintilla/release/lib/qscintilla2_qt5.lib -------------------------------------------------------------------------------- /CommunicationProtocol/CommunicationProtocol.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | #SUBDIRS += protocol-cip 3 | #SUBDIRS += protocol-meshttp 4 | SUBDIRS += protocol-modbusRtu 5 | 6 | -------------------------------------------------------------------------------- /CommunicationProtocol/common/DataAreaDeal.h: -------------------------------------------------------------------------------- 1 | #ifndef DATAAREADEAL_H 2 | #define DATAAREADEAL_H 3 | 4 | #include "service_def.h" 5 | #include 6 | #include 7 | #include "ValueChangeDeal.h" 8 | 9 | class DataAreaDeal 10 | { 11 | public: 12 | DataAreaDeal(); 13 | virtual ~DataAreaDeal(); 14 | 15 | //获取地址缓存中的数据. 16 | //len的单位是位 17 | int32_t GetDataFromAddr(const std::string ®, uint64_t index, uint64_t len ,char * data, uint16_t bitOffset = 0); 18 | 19 | //设置地址缓存数据. 20 | //dataLen的单位是位 21 | int32_t SetDataFromAddr(const std::string ®, uint64_t index, uint64_t dataLen ,char * data, uint16_t bitOffset = 0); 22 | 23 | //设置地址变化回调信息. 24 | int32_t SetRegValueChangeCallback(std::vector &addrVec, 25 | Protocol::Add_Type addType); 26 | 27 | //读位,写位 28 | char GetBit(char *byte, uint32_t num) 29 | { 30 | if(((*(byte+(num>>3)))>>(num%8))&0x1) 31 | { 32 | return 1; 33 | } 34 | else { 35 | return 0; 36 | } 37 | } 38 | 39 | bool SetBit(char *byte, uint32_t num, char value) 40 | { 41 | if(value == GetBit(byte,num)) 42 | {//无需设置值 43 | return false; 44 | } 45 | if(!value) 46 | { 47 | *byte = (~(1<<(num%8)))&(*(byte+(num >>3))); 48 | } 49 | else 50 | { 51 | *byte = (1<<(num%8))|(*(byte+(num >>3))); 52 | } 53 | return true; 54 | } 55 | 56 | protected: 57 | std::set::iterator GetDataAreaIterator(const std::string ® , uint64_t index); 58 | 59 | 60 | private: 61 | //地址缓冲区. 62 | std::set m_dataArea; 63 | 64 | std::mutex m_dataAreaLock; 65 | 66 | ValueChangeDeal *m_ValueChangeDeal = nullptr; 67 | }; 68 | 69 | #endif // DATAAREADEAL_H 70 | -------------------------------------------------------------------------------- /CommunicationProtocol/common/ValueChangeDeal.cpp: -------------------------------------------------------------------------------- 1 | #include "ValueChangeDeal.h" 2 | #include "service.h" 3 | #include "typedefheader.h" 4 | #include 5 | 6 | #include "glog/logging.h" 7 | 8 | ValueChangeDeal::ValueChangeDeal(DataAreaDeal *dataAreaDeal):m_DataAreaDeal(dataAreaDeal) 9 | { 10 | } 11 | 12 | void ValueChangeDeal::DealAddrValueChangeCB(const std::string ®, uint64_t index, int32_t ret) 13 | { 14 | m_valueChangeLock.lock(); 15 | //协议标签模式. 16 | //处理值变化回调. 17 | Protocol::AddrInfoForRW ACD("",reg,index); 18 | std::pair::iterator, std::multiset::iterator> it; 19 | it = m_valueChangeAddrInfoSet.equal_range(ACD); 20 | for (std::multiset::iterator findIt = it.first;findIt != it.second;++findIt) 21 | { 22 | if(findIt->callback) 23 | { 24 | findIt->callback(*findIt,ret); 25 | } 26 | } 27 | m_valueChangeLock.unlock(); 28 | } 29 | 30 | int32_t ValueChangeDeal::SetRegValueChangeCallback(std::vector &addrVec, Protocol::Add_Type addType) 31 | { 32 | m_valueChangeLock.lock(); 33 | //协议标签模式 34 | //添加类型判断. 35 | if(Protocol::Cover == addType) 36 | { 37 | m_valueChangeAddrInfoSet.clear(); 38 | } 39 | 40 | for (uint32_t var = 0; var < addrVec.size(); ++var) { 41 | //标签别名转换. 42 | Device::GetInstance().TagDeal(addrVec.at(var)); 43 | //添加. 44 | m_valueChangeAddrInfoSet.emplace(addrVec.at(var)); 45 | } 46 | m_valueChangeLock.unlock(); 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /CommunicationProtocol/common/ValueChangeDeal.h: -------------------------------------------------------------------------------- 1 | #ifndef VALUECHANGEDEAL_H 2 | #define VALUECHANGEDEAL_H 3 | #include "service_def.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class Device; 11 | class DataAreaDeal; 12 | class ValueChangeDeal 13 | { 14 | public: 15 | ValueChangeDeal(DataAreaDeal *dataAreaDeal); 16 | 17 | //处理地址值变化回调. 18 | void DealAddrValueChangeCB(const std::string ®, uint64_t index, int32_t ret); 19 | //设置地址变化回调信息. 20 | int32_t SetRegValueChangeCallback(std::vector &addrVec, 21 | Protocol::Add_Type addType); 22 | 23 | private: 24 | //值变化回调. 25 | std::multiset m_valueChangeAddrInfoSet; 26 | //值变化信息锁. 27 | std::mutex m_valueChangeLock; 28 | 29 | DataAreaDeal * m_DataAreaDeal = nullptr; 30 | }; 31 | 32 | #endif // VALUECHANGEDEAL_H 33 | -------------------------------------------------------------------------------- /CommunicationProtocol/common/common.pri: -------------------------------------------------------------------------------- 1 | 2 | INCLUDEPATH +=$$PWD/ 3 | 4 | HEADERS += \ 5 | $$PWD/DataAreaDeal.h \ 6 | $$PWD/ValueChangeDeal.h \ 7 | $$PWD/protocol.h \ 8 | $$PWD/protocol_global.h \ 9 | $$PWD/protocol_interface.h \ 10 | $$PWD/protocol_type.h \ 11 | $$PWD/service.h \ 12 | $$PWD/service_def.h \ 13 | $$PWD/typedefheader.h 14 | 15 | SOURCES += \ 16 | $$PWD/DataAreaDeal.cpp \ 17 | $$PWD/ValueChangeDeal.cpp \ 18 | $$PWD/protocol_extend.cpp \ 19 | $$PWD/protocol_interface.cpp \ 20 | $$PWD/service.cpp \ 21 | 22 | #GLOG 23 | LIBS += -L$$PWD/../../3rdparty/glog/lib/ -lglog 24 | INCLUDEPATH += $$PWD/../../3rdparty/glog/include 25 | 26 | -------------------------------------------------------------------------------- /CommunicationProtocol/common/protocol_global.h: -------------------------------------------------------------------------------- 1 | #ifndef PROTOCOL_GLOBAL_H 2 | #define PROTOCOL_GLOBAL_H 3 | 4 | #include 5 | 6 | #if defined(PROTOCOL_LIBRARY) 7 | # define PROTOCOLSHARED_EXPORT Q_DECL_EXPORT 8 | #else 9 | # define PROTOCOLSHARED_EXPORT Q_DECL_IMPORT 10 | #endif 11 | 12 | #endif // PROTOCOL_GLOBAL_H 13 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-cip/cip.h: -------------------------------------------------------------------------------- 1 | #ifndef cip_H 2 | #define cip_H 3 | 4 | #include "../common/protocol_interface.h" 5 | #include 6 | 7 | 8 | class cip :public Protocol_Interface 9 | { 10 | public: 11 | cip(); 12 | virtual ~cip(){} 13 | 14 | //协议参数初始化. 15 | virtual void Init(); 16 | 17 | //读. 18 | virtual int32_t ReadFrame(const std::vector &addrInfo); 19 | 20 | //写. 21 | virtual int32_t WriteFrame(const std::vector &addrInfo); 22 | 23 | //校验帧格式. 24 | virtual int32_t CheckFrame(Frame & recvF); 25 | 26 | //版本号. 27 | virtual int32_t GetVersion(std::string &sVersion); 28 | 29 | //注册帧-握手帧. 30 | virtual void GetGlobalFrame(); 31 | 32 | protected: 33 | //组建帧头. 34 | void FormFrameHead(std::vector &send, uint32_t sendLen, char fun); 35 | //根据数据类型计算长度. 36 | uint32_t GetLenFromDataType(unsigned short datatype); 37 | //根据数据类型获取命令码 38 | char GetCommandFromDataType(Protocol::Protocol_DataType dataType); 39 | //单个标签读. 40 | void OneTagReadFrame(const AddrInfo &addrInfo); 41 | //更新字符串标签的长度. 42 | void SetTagOfStringLen(const std::string &name,uint64_t len); 43 | //重新计算帧长部分 44 | void RecalculateFrameLen(Frame &curframe); 45 | 46 | private: 47 | Frame frame; 48 | bool m_bHandshake = false; 49 | //plc会话句柄. 50 | char m_SessionHandle[4] = {0}; 51 | }; 52 | 53 | #endif // cip_H 54 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-cip/protocol-cip.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2022-12-28T14:48:13 4 | # 5 | #------------------------------------------------- 6 | QT -= gui 7 | 8 | TARGET = cip 9 | TEMPLATE = lib 10 | CONFIG += c++17 11 | DEFINES += PROTOCOL_LIBRARY 12 | 13 | #通讯协议格式为标签格式 14 | DEFINES += TAG_MODE 15 | #运行调试日志 16 | #DEFINES += DEBUG_LOG 17 | 18 | # The following define makes your compiler emit warnings if you use 19 | # any feature of Qt which has been marked as deprecated (the exact warnings 20 | # depend on your compiler). Please consult the documentation of the 21 | # deprecated API in order to know how to port your code away from it. 22 | DEFINES += QT_DEPRECATED_WARNINGS 23 | 24 | # You can also make your code fail to compile if you use deprecated APIs. 25 | # In order to do so, uncomment the following line. 26 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 27 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 28 | 29 | 30 | win32-msvc{ 31 | BINDIR = $$PWD/../../win32-msvc-mes-bin 32 | } 33 | CONFIG(debug, debug|release){ 34 | DESTDIR = $$BINDIR/debug/CommunicationProtocol/omron/ 35 | libPath = $$BINDIR/debug 36 | }else{ 37 | DESTDIR = $$BINDIR/release/CommunicationProtocol/omron/ 38 | libPath = $$BINDIR/release 39 | } 40 | LIBS += -L$$libPath -lcommunication 41 | LIBS += -L$$libPath -lApp 42 | 43 | include(../common/common.pri) 44 | 45 | SOURCES += \ 46 | cip.cpp \ 47 | protocol.cpp \ 48 | 49 | HEADERS += \ \ 50 | cip.h 51 | 52 | unix { 53 | target.path = /usr/lib 54 | INSTALLS += target 55 | } 56 | 57 | 58 | #NLOHMANN_JSON 59 | INCLUDEPATH += $$PWD/../../3rdparty/json-develop/include 60 | INCLUDEPATH += $$PWD/../common 61 | 62 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-cip/protocol.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "protocol.h" 3 | #include "service.h" 4 | #include "cip.h" 5 | 6 | #include "../../communication/communicationdef.h" 7 | #include "../../communication/communicationglobal.h" 8 | 9 | /** 10 | * @brief 获取协议需要被外部配置的参数. 11 | * @param[in] config:协议默认参数. 12 | * @return: 13 | * -- 成功,返回 Protocol_Rtn_Success 14 | * -- 失败,返回 Protocol_Rtn_Fail 15 | */ 16 | int32_t GetDeviceConfig(Protocol::Device_Config *config) 17 | { 18 | Device &D = Device::GetInstance(); 19 | D.m_lock.lock(); 20 | 21 | //初始化参数. 22 | if(!D.m_MDevice) 23 | { 24 | D.m_MDevice = std::make_shared(); 25 | D.m_MDevice->Init(); 26 | } 27 | 28 | //参数. 29 | *config = Device::GetInstance().m_deviceConfig; 30 | 31 | D.m_lock.unlock(); 32 | return Protocol_Rtn_Success; 33 | } 34 | 35 | 36 | /** 37 | * @brief 初始化协议,支持动态调整参数. 38 | * @param[in] comm:通讯接口智能指针 config:协议参数. 39 | * @return: 40 | * -- 成功,返回 Protocol_Rtn_Success. 41 | * -- 失败,返回 Protocol_Rtn_Fail. 42 | */ 43 | int32_t InitDevice(std::shared_ptr *comm, const Protocol::Device_Config *config) 44 | { 45 | Device &D = Device::GetInstance(); 46 | 47 | //config 指针为null表示关闭线程. 48 | if(!config) 49 | { 50 | D.StopThread(); 51 | return Protocol_Rtn_Success; 52 | } 53 | 54 | D.m_lock.lock(); 55 | 56 | //初始化参数. 57 | if(!D.m_MDevice) 58 | { 59 | D.m_MDevice = std::make_shared(); 60 | D.m_MDevice->Init(); 61 | } 62 | 63 | //配置更新. 64 | D.m_deviceConfig = *config; 65 | 66 | //初始化. 67 | D.InitDevice(*comm); 68 | 69 | //配置变动处理. 70 | D.UpdateConfig(*config); 71 | 72 | Device::GetInstance().m_lock.unlock(); 73 | 74 | return Protocol_Rtn_Success; 75 | } 76 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-meshttp/meshttp.h: -------------------------------------------------------------------------------- 1 | #ifndef mes_http_H 2 | #define mes_http_H 3 | 4 | #include "protocol_interface.h" 5 | #include 6 | 7 | class mes_http :public Protocol_Interface 8 | { 9 | public: 10 | mes_http(); 11 | virtual ~mes_http(); 12 | 13 | //协议参数初始化. 14 | virtual void Init(); 15 | 16 | //读. 17 | virtual int32_t ReadFrame(const std::vector &addrInfo); 18 | 19 | //写. 20 | virtual int32_t WriteFrame(const std::vector &addrInfo); 21 | 22 | //校验帧格式. 23 | virtual int32_t CheckFrame(Frame & recvF); 24 | 25 | //处理非标准数据解析特殊流程,return -1表示解析完成,上层不需要再次解析. 26 | virtual int32_t DealRecvData(AddrInfo &addrinfo, char * data); 27 | 28 | //每次通讯之前会调用. 29 | virtual void BeforeCommunication(); 30 | 31 | //版本号. 32 | virtual int32_t GetVersion(std::string &sVersion); 33 | 34 | private: 35 | Frame frame; 36 | }; 37 | 38 | #endif // mes_http_H 39 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-meshttp/protocol-meshttp.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2022-12-28T14:48:13 4 | # 5 | #------------------------------------------------- 6 | QT -= gui 7 | 8 | TARGET = meshttp 9 | TEMPLATE = lib 10 | CONFIG += c++17 11 | DEFINES += PROTOCOL_LIBRARY 12 | 13 | # The following define makes your compiler emit warnings if you use 14 | # any feature of Qt which has been marked as deprecated (the exact warnings 15 | # depend on your compiler). Please consult the documentation of the 16 | # deprecated API in order to know how to port your code away from it. 17 | DEFINES += QT_DEPRECATED_WARNINGS 18 | 19 | # You can also make your code fail to compile if you use deprecated APIs. 20 | # In order to do so, uncomment the following line. 21 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 22 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 23 | 24 | 25 | win32-msvc{ 26 | BINDIR = $$PWD/../../win32-msvc-mes-bin 27 | } 28 | CONFIG(debug, debug|release){ 29 | DESTDIR = $$BINDIR/debug/CommunicationProtocol/mes 30 | libPath = $$BINDIR/debug 31 | }else{ 32 | DESTDIR = $$BINDIR/release/CommunicationProtocol/mes 33 | libPath = $$BINDIR/release 34 | } 35 | LIBS += -L$$libPath -lcommunication 36 | LIBS += -L$$libPath -lApp 37 | 38 | include(../common/common.pri) 39 | 40 | SOURCES += \ 41 | meshttp.cpp \ 42 | protocol.cpp \ 43 | 44 | HEADERS += \ 45 | meshttp.h \ 46 | 47 | unix { 48 | target.path = /usr/lib 49 | INSTALLS += target 50 | } 51 | 52 | 53 | #NLOHMANN_JSON 54 | INCLUDEPATH += $$PWD/../../3rdparty/json-develop/include 55 | INCLUDEPATH += $$PWD/../common 56 | 57 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-meshttp/protocol.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "protocol.h" 3 | #include "service.h" 4 | #include "meshttp.h" 5 | 6 | #include "../../communication/communicationdef.h" 7 | #include "../../communication/communicationglobal.h" 8 | 9 | 10 | /** 11 | * @brief 获取协议需要被外部配置的参数. 12 | * @param[in] config:协议默认参数. 13 | * @return: 14 | * -- 成功,返回 Protocol_Rtn_Success. 15 | * -- 失败,返回 Protocol_Rtn_Fail. 16 | */ 17 | int32_t GetDeviceConfig(Protocol::Device_Config *config) 18 | { 19 | Device &D = Device::GetInstance(); 20 | D.m_lock.lock(); 21 | 22 | //初始化参数. 23 | if(!D.m_MDevice) 24 | { 25 | D.m_MDevice = std::make_shared(); 26 | D.m_MDevice->Init(); 27 | } 28 | 29 | //参数. 30 | *config = Device::GetInstance().m_deviceConfig; 31 | 32 | D.m_lock.unlock(); 33 | return Protocol_Rtn_Success; 34 | } 35 | 36 | 37 | /** 38 | * @brief 初始化协议,支持动态调整参数. 39 | * @param[in] comm:通讯接口智能指针 config:协议参数. 40 | * @return: 41 | * -- 成功,返回 Protocol_Rtn_Success. 42 | * -- 失败,返回 Protocol_Rtn_Fail. 43 | */ 44 | int32_t InitDevice(std::shared_ptr *comm,const Protocol::Device_Config *config) 45 | { 46 | Device &D = Device::GetInstance(); 47 | 48 | //config 指针为null表示关闭线程 49 | if(!config) 50 | { 51 | D.StopThread(); 52 | return Protocol_Rtn_Success; 53 | } 54 | 55 | D.m_lock.lock(); 56 | //初始化参数 57 | if(!D.m_MDevice) 58 | { 59 | D.m_MDevice = std::make_shared(); 60 | D.m_MDevice->Init(); 61 | } 62 | 63 | //配置更新. 64 | D.m_deviceConfig = *config; 65 | 66 | //初始化. 67 | D.InitDevice(*comm); 68 | 69 | //配置变动处理. 70 | D.UpdateConfig(*config); 71 | 72 | Device::GetInstance().m_lock.unlock(); 73 | 74 | return Protocol_Rtn_Success; 75 | } 76 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-modbusRtu/modbusRtu.h: -------------------------------------------------------------------------------- 1 | #ifndef modbusRtu_H 2 | #define modbusRtu_H 3 | 4 | #include "../common/protocol_interface.h" 5 | 6 | 7 | class modbusRtu :public Protocol_Interface 8 | { 9 | public: 10 | modbusRtu(); 11 | virtual ~modbusRtu(){} 12 | 13 | //协议参数初始化. 14 | virtual void Init(); 15 | 16 | //读. 17 | virtual int32_t ReadFrame(const std::vector &addrInfo); 18 | 19 | //写. 20 | virtual int32_t WriteFrame(const std::vector &addrInfo); 21 | 22 | //校验帧格式. 23 | virtual int32_t CheckFrame(Frame & recvF); 24 | 25 | //版本号. 26 | virtual int32_t GetVersion(std::string &sVersion); 27 | 28 | 29 | private: 30 | Frame frame; 31 | bool m_bHandshake = false; 32 | //plc会话句柄. 33 | char m_SessionHandle[4] = {0}; 34 | }; 35 | 36 | #endif // modbusRtu_H 37 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-modbusRtu/protocol-modbusRtu.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2022-12-28T14:48:13 4 | # 5 | #------------------------------------------------- 6 | QT -= gui 7 | 8 | TARGET = modbusRtu 9 | TEMPLATE = lib 10 | CONFIG += c++17 11 | DEFINES += PROTOCOL_LIBRARY 12 | 13 | #通讯协议格式为标签格式 14 | #DEFINES += TAG_MODE 15 | #运行调试日志 16 | #DEFINES += DEBUG_LOG 17 | 18 | # The following define makes your compiler emit warnings if you use 19 | # any feature of Qt which has been marked as deprecated (the exact warnings 20 | # depend on your compiler). Please consult the documentation of the 21 | # deprecated API in order to know how to port your code away from it. 22 | DEFINES += QT_DEPRECATED_WARNINGS 23 | 24 | # You can also make your code fail to compile if you use deprecated APIs. 25 | # In order to do so, uncomment the following line. 26 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 27 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 28 | 29 | 30 | win32-msvc{ 31 | BINDIR = $$PWD/../../win32-msvc-mes-bin 32 | } 33 | CONFIG(debug, debug|release){ 34 | DESTDIR = $$BINDIR/debug/CommunicationProtocol/modbus/ 35 | libPath = $$BINDIR/debug 36 | }else{ 37 | DESTDIR = $$BINDIR/release/CommunicationProtocol/modbus/ 38 | libPath = $$BINDIR/release 39 | } 40 | LIBS += -L$$libPath -lcommunication 41 | LIBS += -L$$libPath -lApp 42 | 43 | include(../common/common.pri) 44 | 45 | SOURCES += \ 46 | modbusRtu.cpp \ 47 | protocol.cpp \ 48 | 49 | HEADERS += \ \ 50 | modbusRtu.h 51 | 52 | unix { 53 | target.path = /usr/lib 54 | INSTALLS += target 55 | } 56 | 57 | -------------------------------------------------------------------------------- /CommunicationProtocol/protocol-modbusRtu/protocol.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "protocol.h" 3 | #include "service.h" 4 | #include "modbusRtu.h" 5 | 6 | #include "../../communication/communicationdef.h" 7 | #include "../../communication/communicationglobal.h" 8 | 9 | /** 10 | * @brief 获取协议需要被外部配置的参数. 11 | * @param[in] config:协议默认参数. 12 | * @return: 13 | * -- 成功,返回 Protocol_Rtn_Success 14 | * -- 失败,返回 Protocol_Rtn_Fail 15 | */ 16 | int32_t GetDeviceConfig(Protocol::Device_Config *config) 17 | { 18 | Device &D = Device::GetInstance(); 19 | D.m_lock.lock(); 20 | 21 | //初始化参数. 22 | if(!D.m_MDevice) 23 | { 24 | D.m_MDevice = std::make_shared(); 25 | D.m_MDevice->Init(); 26 | } 27 | 28 | //参数. 29 | *config = Device::GetInstance().m_deviceConfig; 30 | 31 | D.m_lock.unlock(); 32 | return Protocol_Rtn_Success; 33 | } 34 | 35 | 36 | /** 37 | * @brief 初始化协议,支持动态调整参数. 38 | * @param[in] comm:通讯接口智能指针 config:协议参数. 39 | * @return: 40 | * -- 成功,返回 Protocol_Rtn_Success. 41 | * -- 失败,返回 Protocol_Rtn_Fail. 42 | */ 43 | int32_t InitDevice(std::shared_ptr *comm, const Protocol::Device_Config *config) 44 | { 45 | Device &D = Device::GetInstance(); 46 | 47 | //config 指针为null表示关闭线程. 48 | if(!config) 49 | { 50 | D.StopThread(); 51 | return Protocol_Rtn_Success; 52 | } 53 | 54 | D.m_lock.lock(); 55 | 56 | //初始化参数. 57 | if(!D.m_MDevice) 58 | { 59 | D.m_MDevice = std::make_shared(); 60 | D.m_MDevice->Init(); 61 | } 62 | 63 | //配置更新. 64 | D.m_deviceConfig = *config; 65 | 66 | //初始化. 67 | D.InitDevice(*comm); 68 | 69 | //配置变动处理. 70 | D.UpdateConfig(*config); 71 | 72 | Device::GetInstance().m_lock.unlock(); 73 | 74 | return Protocol_Rtn_Success; 75 | } 76 | -------------------------------------------------------------------------------- /Core/App/App.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | TARGET = App 3 | TEMPLATE = lib 4 | CONFIG += c++17 5 | DEFINES += _APP_ 6 | 7 | # The following define makes your compiler emit warnings if you use 8 | # any feature of Qt which has been marked as deprecated (the exact warnings 9 | # depend on your compiler). Please consult the documentation of the 10 | # deprecated API in order to know how to port your code away from it. 11 | DEFINES += QT_DEPRECATED_WARNINGS 12 | 13 | # You can also make your code fail to compile if you use deprecated APIs. 14 | # In order to do so, uncomment the following line. 15 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 16 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 17 | 18 | 19 | win32-msvc{ 20 | BINDIR = $$PWD/../../win32-msvc-mes-bin 21 | } 22 | CONFIG(debug, debug|release){ 23 | DESTDIR = $$BINDIR/debug 24 | }else{ 25 | DESTDIR = $$BINDIR/release 26 | } 27 | 28 | HEADERS += \ 29 | ../MesHost/Interface/IApp.h \ 30 | IAppRun.h 31 | 32 | SOURCES += \ 33 | IAppRun.cpp 34 | 35 | #GLOG 36 | LIBS += -L$$PWD/../../3rdparty/glog/lib/ -lglog 37 | INCLUDEPATH += $$PWD/../../3rdparty/glog/include 38 | 39 | #Tools 40 | LIBS += -L$$DESTDIR -lTools 41 | INCLUDEPATH += $$PWD/../../Libs 42 | 43 | #Interface 44 | INCLUDEPATH += $$PWD/../../Interface 45 | 46 | 47 | -------------------------------------------------------------------------------- /Core/App/SafeQueue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | // Thread safe implementation of a Queue using an std::queue 7 | template 8 | class SafeQueue { 9 | private: 10 | std::queue m_queue; 11 | std::mutex m_mutex; 12 | public: 13 | SafeQueue() { 14 | 15 | } 16 | 17 | SafeQueue(SafeQueue& other) { 18 | //TODO: 19 | } 20 | 21 | ~SafeQueue() { 22 | 23 | } 24 | 25 | 26 | bool empty() { 27 | std::unique_lock lock(m_mutex); 28 | return m_queue.empty(); 29 | } 30 | 31 | int size() { 32 | std::unique_lock lock(m_mutex); 33 | return m_queue.size(); 34 | } 35 | 36 | void enqueue(T& t) { 37 | std::unique_lock lock(m_mutex); 38 | m_queue.push(t); 39 | } 40 | 41 | bool dequeue(T& t) { 42 | std::unique_lock lock(m_mutex); 43 | 44 | if (m_queue.empty()) { 45 | return false; 46 | } 47 | t = std::move(m_queue.front()); 48 | 49 | m_queue.pop(); 50 | return true; 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /Core/Core.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = App Core 3 | MesHost.depends = App 4 | -------------------------------------------------------------------------------- /Core/Core/Core.pro: -------------------------------------------------------------------------------- 1 | QT += core gui network concurrent #xlsx 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets axcontainer 4 | 5 | TARGET = ICStudio 6 | TEMPLATE = app 7 | RC_FILE += logo.rc 8 | 9 | # The following define makes your compiler emit warnings if you use 10 | # any feature of Qt which has been marked as deprecated (the exact warnings 11 | # depend on your compiler). Please consult the documentation of the 12 | # deprecated API in order to know how to port your code away from it. 13 | DEFINES += QT_DEPRECATED_WARNINGS GLOG_NO_ABBREVIATED_SEVERITIES 14 | 15 | # You can also make your code fail to compile if you use deprecated APIs. 16 | # In order to do so, uncomment the following line. 17 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 18 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 19 | 20 | CONFIG += c++17 21 | 22 | # Default rules for deployment. 23 | qnx: target.path = /tmp/$${TARGET}/bin 24 | else: unix:!android: target.path = /opt/$${TARGET}/bin 25 | !isEmpty(target.path): INSTALLS += target 26 | 27 | QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO 28 | QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO 29 | 30 | 31 | win32-msvc{ 32 | BINDIR = $$PWD/../../win32-msvc-mes-bin 33 | } 34 | CONFIG(debug, debug|release){ 35 | DESTDIR = $$BINDIR/debug 36 | }else{ 37 | DESTDIR = $$BINDIR/release 38 | } 39 | 40 | include(FileCommunication/FileCommunication.pri) 41 | include(Process/Process.pri) 42 | 43 | 44 | #NLOHMANN_JSON 45 | INCLUDEPATH += $$PWD/../../3rdparty/json-develop/include 46 | 47 | #MESGLOG 48 | LIBS += -L$$PWD/../../3rdparty/glog/lib/ -lglog 49 | INCLUDEPATH += $$PWD/../../3rdparty/glog/include 50 | 51 | #App 52 | LIBS += -L$$DESTDIR -lApp 53 | 54 | #Tools 55 | LIBS += -L$$DESTDIR -lTools 56 | INCLUDEPATH += $$PWD/../../Libs 57 | 58 | #Communication 59 | LIBS += -L$$DESTDIR -lcommunication 60 | 61 | #Interface 62 | INCLUDEPATH += $$PWD/../../Interface 63 | 64 | RESOURCES += \ 65 | image.qrc 66 | 67 | -------------------------------------------------------------------------------- /Core/Core/FileCommunication/FileCommunication.pri: -------------------------------------------------------------------------------- 1 | 2 | INCLUDEPATH +=$$PWD/ 3 | 4 | HEADERS += \ 5 | $$PWD/CommunicationManagement.h \ 6 | $$PWD/ProtocolManager.h 7 | 8 | SOURCES += \ 9 | $$PWD/CommunicationManagement.cpp \ 10 | $$PWD/ProtocolManager.cpp 11 | -------------------------------------------------------------------------------- /Core/Core/FileCommunication/ProtocolManager.h: -------------------------------------------------------------------------------- 1 | #ifndef PROTOCOLMANAGER_H 2 | #define PROTOCOLMANAGER_H 3 | #include "../../CommunicationProtocol/common/protocol_type.h" 4 | #include "../Interface/interface_comm.h" 5 | #include 6 | #include 7 | 8 | class ProtocolManager 9 | { 10 | public: 11 | ProtocolManager(); 12 | ~ProtocolManager(); 13 | 14 | //初始化link协议库加载. 15 | void Init(const QList &links ); 16 | //通过link名称获取协议接口. 17 | bool GetLinkFuncFromLinkName(const QString &linkName,Protocol::P_Protocol &p); 18 | //获取加载的协议link名称列表. 19 | bool GetLoadProtocolListName(std::vector &linkList); 20 | //关闭协议线程. 21 | void StopAllThread(); 22 | //卸载. 23 | void UnInit(); 24 | 25 | protected: 26 | void LoadProtocolFunc(const QString &pathFileName, const QString &linkName); 27 | 28 | private: 29 | QMap m_linkNameOfLibP;//通讯协议接口和连接名称 30 | QList m_libs;//协议库列表 31 | QMap m_supportLibNameMap;//支持的协议插件列表 32 | }; 33 | 34 | #endif // PROTOCOLMANAGER_H 35 | -------------------------------------------------------------------------------- /Core/Core/Interface/IFuncModel.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCMODEL_H 2 | #define FUNCMODEL_H 3 | #include 4 | #include "IZObject.h" 5 | 6 | class interface_comm; 7 | class FuncModel : public ZObject 8 | { 9 | public: 10 | virtual ~FuncModel(){} 11 | 12 | //模块初始化. 13 | virtual int Init(std::shared_ptr &comm) = 0; 14 | 15 | //属性编辑 16 | virtual int ConfigEditShow(){ 17 | return -1; 18 | } 19 | 20 | //Run循环 21 | //返回值:-1表示退出循环调用 22 | virtual int Run(){ 23 | return -1; 24 | } 25 | 26 | //获取循环Run间隔时间单位ms 27 | //返回值:-1 表示无需循环Run,非-1表示循环调用间隔时间 28 | virtual int GetRunIntervalTime(){ 29 | return -1; 30 | } 31 | }; 32 | 33 | 34 | #if defined(API_FUNC) 35 | #define _API_FUNC extern "C" __declspec(dllexport) 36 | #else 37 | #define _API_FUNC extern "C" __declspec(dllimport) 38 | #endif 39 | 40 | 41 | #endif // FUNCMODEL_H 42 | -------------------------------------------------------------------------------- /Core/Core/Interface/IUiSupportModel.h: -------------------------------------------------------------------------------- 1 | #ifndef IUiModel_H 2 | #define IUiModel_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "IApp.h" 10 | #include "IZObject.h" 11 | 12 | class interface_comm; 13 | class IUiModel : public ZObject 14 | { 15 | public: 16 | //前端数据结构. 17 | using UiVariant = std::variant,std::vector >; 18 | //前端数据回调. 19 | using ValueCB = std::function; 20 | 21 | virtual ~IUiModel(){} 22 | 23 | //模块初始化. 24 | virtual int Init(std::shared_ptr &comm) = 0; 25 | 26 | //设置日志. 27 | virtual int Log(IAPP::Log_Type type,const std::string &sErrCode,const std::string &overview) = 0; 28 | 29 | //前端数据读写. 30 | virtual int SetValue(const std::string &name,const UiVariant &var) = 0; 31 | virtual int GetValue(const std::string &name,UiVariant &var) = 0; 32 | //绑定数据变化回调. 33 | virtual int RegisterValueCB(const std::string &name,ValueCB &CB) = 0; 34 | 35 | }; 36 | 37 | 38 | #if defined(API_UI) 39 | #define _API_UI extern "C" __declspec(dllexport) 40 | #else 41 | #define _API_UI extern "C" __declspec(dllimport) 42 | #endif 43 | 44 | 45 | #endif // FUNCMODEL_H 46 | -------------------------------------------------------------------------------- /Core/Core/Interface/IZObject.h: -------------------------------------------------------------------------------- 1 | #ifndef ZOBJECT_H 2 | #define ZOBJECT_H 3 | #include 4 | #include 5 | 6 | #define PROPERTY_MAX_SIZE 1024 7 | #define Z_TRANSFORM(type,num) (*reinterpret_cast(_a[num])) 8 | #define Z_TRANSFORM_R(type,_r) if (_a[0]) *reinterpret_cast(_a[0]) = std::move(_r) 9 | //脚本接口指针类型 10 | struct lua_State; 11 | typedef int (*ScriptFunc)(lua_State *L); 12 | 13 | class HEvent; 14 | class ZObject 15 | { 16 | public: 17 | virtual ~ZObject(){} 18 | 19 | /* 20 | * 获取版本号 21 | * 参数1-v0-大版本号,参数2-v1-小版本号 22 | */ 23 | virtual void GetVersion(uint32_t &v0,uint32_t &v1){ 24 | //默认版本1.0 25 | v0 = 1; 26 | v1 = 0; 27 | } 28 | 29 | /////事件注册和执行 30 | /* 31 | * 模块注册事件绑定 32 | * 参数1-eventList-绑定的事件列表 33 | * return,执行返回结果 34 | */ 35 | virtual int RegisterEvent(std::vector &eventList){ 36 | return -1; 37 | } 38 | /* 39 | * 事件触发执行接口 40 | * 参数1-event-事件指针(指针不需模块释放) 41 | * return,执行返回结果 42 | */ 43 | virtual int EventCall(HEvent * event){ 44 | return -1; 45 | } 46 | 47 | /////扩展功能注册和执行 48 | /* 49 | * 通过功能id执行模块提供的扩展功能 50 | * 参数1-funid-功能id,参数2-var-入参&出参 51 | * return,执行返回结果 52 | */ 53 | virtual int ExecFuncFromID(int funID , void **_a){ 54 | return -1; 55 | } 56 | /* 57 | * 检查参数 58 | * return,执行返回结果 59 | */ 60 | virtual const char * CheckParms(int funID){ 61 | return nullptr; 62 | } 63 | /* 64 | * 获取模块提供的扩展功能首id 65 | * return,执行返回结果 66 | */ 67 | virtual int GetFuncID(){ 68 | return -1; 69 | } 70 | /* 71 | * 获取模块名称 72 | * return,执行返回结果 73 | */ 74 | virtual std::string GetFuncName(){ 75 | return ""; 76 | } 77 | }; 78 | 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Core/Core/Interface/event_def.h: -------------------------------------------------------------------------------- 1 | #ifndef _EVENT_DEF_H_ 2 | #define _EVENT_DEF_H_ 3 | 4 | #include "IApp.h" 5 | #include 6 | /********************************************************* 7 | * 8 | * 自定义消息,消息号字段统一定义 9 | * 10 | */ 11 | 12 | /***************************事件类型 13 | * 各个模块定义事件类型的地方,全局统一管理 14 | */ 15 | enum Event_Type 16 | { 17 | //工程管理模块(0x0-0xFE) 18 | Event_Project_Load = 0x0,//工程加载 19 | Event_Project_Unload,//工程关闭 20 | Event_Project_Compile,//工程编译 21 | Event_Project_LanguageChange,//多语言切换 22 | }; 23 | 24 | 25 | class ZObject; 26 | class HEvent 27 | { 28 | public: 29 | explicit HEvent(Event_Type type,const QVariant &var, 30 | ZObject * send = nullptr, 31 | Event_Pri_Type pri = Event_Nor, 32 | bool isThread = false) 33 | :_var(var),_pri(pri),_send(send),_type(type),_isThread(isThread){} 34 | 35 | QVariant _var; //事件附带的数据 36 | unsigned char _pri; //事件优先级 37 | ZObject *_send; //事件发送者 38 | Event_Type _type; //事件类型 39 | bool _isThread = false; //事件是否在线程中分发 40 | }; 41 | 42 | #endif // _HMI_EVENT_DEF_H_ 43 | -------------------------------------------------------------------------------- /Core/Core/Interface/extend_func_def.h: -------------------------------------------------------------------------------- 1 | #ifndef EXTENDFUNCHELPER_H 2 | #define EXTENDFUNCHELPER_H 3 | 4 | #define ZMaximumParamCount 7 5 | #define Z_ARG(type, data) ZArgument(#type, data) 6 | #define Z_RETURN_ARG(type, data) ZReturnArgument(#type, data) 7 | 8 | class ZGenericArgument 9 | { 10 | public: 11 | inline ZGenericArgument(const char *aName = nullptr, const void *aData = nullptr) 12 | : _data(aData), _name(aName) {} 13 | inline void *data() const { return const_cast(_data); } 14 | inline const char *name() const { return _name; } 15 | 16 | private: 17 | const void *_data; 18 | const char *_name; 19 | }; 20 | 21 | class ZGenericReturnArgument: public ZGenericArgument 22 | { 23 | public: 24 | inline ZGenericReturnArgument(const char *aName = nullptr, void *aData = nullptr) 25 | : ZGenericArgument(aName, aData) 26 | {} 27 | }; 28 | 29 | template 30 | class ZArgument: public ZGenericArgument 31 | { 32 | public: 33 | inline ZArgument(const char *aName, const T &aData) 34 | : ZGenericArgument(aName, static_cast(&aData)) 35 | {} 36 | }; 37 | template 38 | class ZArgument: public ZGenericArgument 39 | { 40 | public: 41 | inline ZArgument(const char *aName, T &aData) 42 | : ZGenericArgument(aName, static_cast(&aData)) 43 | {} 44 | }; 45 | 46 | 47 | template 48 | class ZReturnArgument: public ZGenericReturnArgument 49 | { 50 | public: 51 | inline ZReturnArgument(const char *aName, T &aData) 52 | : ZGenericReturnArgument(aName, static_cast(&aData)) 53 | {} 54 | }; 55 | 56 | 57 | #endif // EXTENDFUNCHELPER_H 58 | -------------------------------------------------------------------------------- /Core/Core/Interface/extend_func_head.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/Core/Core/Interface/extend_func_head.h -------------------------------------------------------------------------------- /Core/Core/Process/FuncManager.h: -------------------------------------------------------------------------------- 1 | #ifndef FuncManager_H 2 | #define FuncManager_H 3 | #include "../Interface/IFuncModel.h" 4 | #include 5 | #include 6 | 7 | 8 | class FuncManager 9 | { 10 | typedef FuncModel * (*P_CreateFunc)(); 11 | public: 12 | FuncManager(); 13 | ~FuncManager(); 14 | 15 | //初始化库加载 16 | void InitLoad(std::vector > &modelVector); 17 | 18 | protected: 19 | void LoadProtocolFunc(const QString &pathFileName); 20 | 21 | private: 22 | QList m_libs; 23 | QMap m_supportLibNameMap; 24 | P_CreateFunc m_pFunc = nullptr; 25 | }; 26 | 27 | #endif // FuncManager_H 28 | -------------------------------------------------------------------------------- /Core/Core/Process/Process.pri: -------------------------------------------------------------------------------- 1 | HEADERS += \ 2 | $$PWD/AppRun.h \ 3 | $$PWD/FuncManager.h \ 4 | $$PWD/UISupportManager.h 5 | 6 | SOURCES += \ 7 | $$PWD/AppRun.cpp \ 8 | $$PWD/FuncManager.cpp \ 9 | $$PWD/UISupportManager.cpp \ 10 | $$PWD/main.cpp 11 | 12 | INCLUDEPATH +=$$PWD/ 13 | 14 | -------------------------------------------------------------------------------- /Core/Core/Process/UISupportManager.cpp: -------------------------------------------------------------------------------- 1 | #include "UISupportManager.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | UISupportManager::UISupportManager() 9 | { 10 | } 11 | 12 | UISupportManager::~UISupportManager() 13 | { 14 | //foreach (auto lib, m_libs) { 15 | // lib->unload(); 16 | // lib->deleteLater(); 17 | //} 18 | } 19 | 20 | IUiModel *UISupportManager::InitLoad() 21 | { 22 | //读取配置 23 | QSettings sysini("project/system.ini",QSettings::IniFormat); 24 | QString sFuncName = sysini.value("ui").toString(); 25 | if(sFuncName.isNull()) 26 | { 27 | return nullptr; 28 | } 29 | 30 | //读取支持的插件 31 | m_supportLibNameMap.clear(); 32 | QDir dir2("./UiSupport"); 33 | QFileInfoList file_list = dir2.entryInfoList(QDir::Files | QDir::Hidden | QDir::NoSymLinks); 34 | for (int j = 0; j < file_list.size(); ++j) 35 | { 36 | if(file_list.at(j).suffix() == "dll") 37 | { 38 | m_supportLibNameMap.insert(file_list.at(j).fileName().split('.').at(0),file_list.at(j).absoluteFilePath()); 39 | } 40 | } 41 | 42 | //开始加载. 43 | QMap::iterator it = m_supportLibNameMap.find( sFuncName ); 44 | if(it != m_supportLibNameMap.end()) 45 | { 46 | LoadProtocolFunc(it.value()); 47 | } 48 | else 49 | { 50 | LOG(INFO)<<"Front end plug-in not found:"<load()) 63 | { 64 | m_pFunc = reinterpret_cast( pLib->resolve("CreateUiM") ); 65 | } 66 | else 67 | { 68 | LOG(INFO)<errorString().toStdString(); 69 | pLib->deleteLater(); 70 | } 71 | m_libs.append(pLib); 72 | } 73 | -------------------------------------------------------------------------------- /Core/Core/Process/UISupportManager.h: -------------------------------------------------------------------------------- 1 | #ifndef UISupportManager_H 2 | #define UISupportManager_H 3 | #include "../Interface/IUiSupportModel.h" 4 | #include 5 | #include 6 | 7 | 8 | class UISupportManager 9 | { 10 | typedef IUiModel* (*P_CreateUiM)(); 11 | public: 12 | UISupportManager(); 13 | ~UISupportManager(); 14 | 15 | //初始化库加载 16 | IUiModel * InitLoad(); 17 | 18 | protected: 19 | void LoadProtocolFunc(const QString &pathFileName); 20 | 21 | private: 22 | QList m_libs; 23 | QMap m_supportLibNameMap; 24 | P_CreateUiM m_pFunc = nullptr; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Core/Core/image.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/app.ico 4 | image/logo.ico 5 | 6 | 7 | -------------------------------------------------------------------------------- /Core/Core/image/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/Core/Core/image/app.ico -------------------------------------------------------------------------------- /Core/Core/image/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/Core/Core/image/logo.ico -------------------------------------------------------------------------------- /Core/Core/logo.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "image//logo.ico" 2 | -------------------------------------------------------------------------------- /Example/test-communication/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /Example/test-communication/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class MainWindow; 8 | } 9 | 10 | class ICommunication; 11 | class MainWindow : public QMainWindow 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit MainWindow(QWidget *parent = nullptr); 17 | ~MainWindow(); 18 | 19 | //Tcp服务端对应事件的回调函数,分别是断开连接,新连接,有数据 20 | void disconnect(const std::string &ip,int port); 21 | void connect(const std::string &ip,int port); 22 | int readReady(int code, char *buf, uint32_t len, char **sBuf, uint32_t *sLen); 23 | 24 | private slots: 25 | 26 | //tcp服务端初始化 27 | void on_pushButton_clicked(); 28 | //tcp服务端-事件循环接口 29 | void on_pushButton_2_clicked(); 30 | //tcp客户端初始化 31 | void on_pushButton_3_clicked(); 32 | //tcp客户端发送 33 | void on_pushButton_4_clicked(); 34 | //tcp客户端接收 35 | void on_pushButton_5_clicked(); 36 | //tcp客户端-发-收 37 | void on_pushButton_6_clicked(); 38 | 39 | public: 40 | //tcp客户端异步回调 41 | void RWCB(int code, char *buf,int len); 42 | 43 | private: 44 | Ui::MainWindow *ui; 45 | //tcp服务端对象 46 | ICommunication * icomm = nullptr; 47 | //tcp客户端对象 48 | ICommunication * iCommTcpCleint = nullptr; 49 | }; 50 | 51 | #endif // MAINWINDOW_H 52 | -------------------------------------------------------------------------------- /Example/test-communication/test-communication.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2023-02-22T17:15:49 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = test-tcpserver 12 | TEMPLATE = app 13 | 14 | # The following define makes your compiler emit warnings if you use 15 | # any feature of Qt which has been marked as deprecated (the exact warnings 16 | # depend on your compiler). Please consult the documentation of the 17 | # deprecated API in order to know how to port your code away from it. 18 | DEFINES += QT_DEPRECATED_WARNINGS 19 | 20 | # You can also make your code fail to compile if you use deprecated APIs. 21 | # In order to do so, uncomment the following line. 22 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 23 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 24 | 25 | CONFIG += c++11 26 | 27 | SOURCES += \ 28 | main.cpp \ 29 | mainwindow.cpp 30 | 31 | HEADERS += \ 32 | mainwindow.h 33 | 34 | FORMS += \ 35 | mainwindow.ui 36 | 37 | # Default rules for deployment. 38 | qnx: target.path = /tmp/$${TARGET}/bin 39 | else: unix:!android: target.path = /opt/$${TARGET}/bin 40 | !isEmpty(target.path): INSTALLS += target 41 | 42 | 43 | 44 | 45 | win32: LIBS += -L$$PWD/../../win32-msvc-mes-bin/debug/ -lcommunication 46 | -------------------------------------------------------------------------------- /FuncModel/FuncModel.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += ScriptExtend0 4 | SUBDIRS += Script 5 | -------------------------------------------------------------------------------- /FuncModel/Script/LuaObject.h: -------------------------------------------------------------------------------- 1 | #ifndef LUAOBJECT_H 2 | #define LUAOBJECT_H 3 | #include 4 | #include "../../CommunicationProtocol/common/protocol_type.h" 5 | 6 | struct ULua_State; 7 | struct lua_State; 8 | class interface_comm; 9 | class Script; 10 | class LuaObject 11 | { 12 | public: 13 | LuaObject(ULua_State *L,Script *script); 14 | 15 | //通过脚本文件初始化脚本对象 16 | //返回结果:成功or失败 17 | bool InitFromFile(const std::string &file); 18 | 19 | //运行脚本 20 | bool RunScript(); 21 | 22 | //触发脚本回调绑定 23 | bool TriggerCallbackBind(interface_comm * comm); 24 | 25 | //初始化脚本二进制内容 26 | static bool InitLuaText(lua_State *L,const std::string &text, std::vector &buff); 27 | 28 | //触发执行 29 | void TriggerCB(const Protocol::AddrInfoForRW &addr,int32_t code); 30 | 31 | public: 32 | std::string m_name;//脚本名称 33 | std::string m_contend;//脚本内容 34 | std::vector m_runBuff;//脚本二进制执行数据 35 | 36 | int m_luaType;//脚本类型 37 | Protocol::AddrInfoForRW m_triggerVar;//触发地址 38 | int m_cycTime;//循环脚本间隔时间 39 | ULua_State *m_L; 40 | Script * m_ScriptMdeol; 41 | }; 42 | 43 | #endif // LUAOBJECT_H 44 | -------------------------------------------------------------------------------- /FuncModel/Script/MacroInterface.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/FuncModel/Script/MacroInterface.cpp -------------------------------------------------------------------------------- /FuncModel/Script/MacroInterface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/FuncModel/Script/MacroInterface.h -------------------------------------------------------------------------------- /FuncModel/Script/Script.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | TARGET = Script 3 | TEMPLATE = lib 4 | CONFIG += c++17 5 | DEFINES += API_FUNC 6 | 7 | 8 | # The following define makes your compiler emit warnings if you use 9 | # any feature of Qt which has been marked as deprecated (the exact warnings 10 | # depend on your compiler). Please consult the documentation of the 11 | # deprecated API in order to know how to port your code away from it. 12 | DEFINES += QT_DEPRECATED_WARNINGS 13 | 14 | # You can also make your code fail to compile if you use deprecated APIs. 15 | # In order to do so, uncomment the following line. 16 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 17 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 18 | 19 | 20 | win32-msvc{ 21 | BINDIR = $$PWD/../../win32-msvc-mes-bin 22 | } 23 | 24 | CONFIG(debug, debug|release){ 25 | DESTDIR = $$BINDIR/debug/Func/ 26 | libPath = $$BINDIR/debug 27 | }else{ 28 | DESTDIR = $$BINDIR/release/Func/ 29 | libPath = $$BINDIR/release 30 | } 31 | 32 | #GLOG 33 | LIBS += -L$$PWD/../../3rdparty/glog/lib/ -lglog 34 | INCLUDEPATH += $$PWD/../../3rdparty/glog/include 35 | #NLOHMANN_JSON 36 | INCLUDEPATH += $$PWD/../../3rdparty/json-develop/include 37 | #App 38 | LIBS += -L$$libPath -lApp 39 | INCLUDEPATH +=$$PWD/../../MesHost/MesHost/Interface/ 40 | #Tools 41 | LIBS += -L$$libPath -lTools 42 | #Lua 43 | LIBS += -L$$PWD/../../3rdparty/lua/lib/ -llua 44 | INCLUDEPATH += $$PWD/../../3rdparty/lua/include 45 | #Interface 46 | INCLUDEPATH += $$PWD/../../Interface 47 | 48 | HEADERS += \ 49 | LuaObject.h \ 50 | MacroInterface.h \ 51 | Script.h 52 | 53 | SOURCES += \ 54 | LuaObject.cpp \ 55 | MacroInterface.cpp \ 56 | Script.cpp 57 | 58 | 59 | -------------------------------------------------------------------------------- /FuncModel/ScriptExtend0/ScriptExtend0.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | TARGET = test1 3 | TEMPLATE = lib 4 | CONFIG += c++17 5 | DEFINES += API_FUNC 6 | 7 | 8 | # The following define makes your compiler emit warnings if you use 9 | # any feature of Qt which has been marked as deprecated (the exact warnings 10 | # depend on your compiler). Please consult the documentation of the 11 | # deprecated API in order to know how to port your code away from it. 12 | DEFINES += QT_DEPRECATED_WARNINGS 13 | 14 | # You can also make your code fail to compile if you use deprecated APIs. 15 | # In order to do so, uncomment the following line. 16 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 17 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 18 | 19 | 20 | win32-msvc{ 21 | BINDIR = $$PWD/../../win32-msvc-mes-bin 22 | } 23 | 24 | CONFIG(debug, debug|release){ 25 | DESTDIR = $$BINDIR/debug/Func/ 26 | libPath = $$BINDIR/debug 27 | }else{ 28 | DESTDIR = $$BINDIR/release/Func/ 29 | libPath = $$BINDIR/release 30 | } 31 | 32 | 33 | HEADERS += test1.h 34 | 35 | SOURCES += test1.cpp 36 | 37 | #GLOG 38 | LIBS += -L$$PWD/../../3rdparty/glog/lib/ -lglog 39 | INCLUDEPATH += $$PWD/../../3rdparty/glog/include 40 | #App 41 | LIBS += -L$$libPath -lApp 42 | #Interface 43 | INCLUDEPATH += $$PWD/../../Interface 44 | #Lua 45 | LIBS += -L$$PWD/../../3rdparty/lua/lib/ -llua 46 | INCLUDEPATH += $$PWD/../../3rdparty/lua/include 47 | 48 | -------------------------------------------------------------------------------- /FuncModel/ScriptExtend0/test1.cpp: -------------------------------------------------------------------------------- 1 | #include "test1.h" 2 | #include "IApp.h" 3 | #include "extend_func_def.h" 4 | #include "extend_func_head.h" 5 | #include "lua.hpp" 6 | #include "glog/logging.h" 7 | 8 | FuncModel *CreateFunc() 9 | { 10 | return new test1(); 11 | } 12 | 13 | 14 | int test1::Init(std::shared_ptr &comm) 15 | { 16 | Q_UNUSED(comm); 17 | zApp->InvokeMethod(Extend_Script_Register,Z_ARG(ScriptFunc,test1::l_test1),Z_ARG(std::string,"test0425")); 18 | //IAPP::GetIntance()->InvokeMethod(Extend_Script_Register,Z_ARG(ScriptFunc,test1::l_test1)); 19 | //IAPP::GetIntance()->InvokeMethod(Extend_Script_Register,Z_ARG(ScriptFunc,test1::l_test1),Z_ARG(std::string,1)); 20 | return 0; 21 | } 22 | 23 | int test1::ShowConfigEditDlg() 24 | { 25 | LOG(INFO) << "ShowConfigEditDlg"; 26 | return 0; 27 | } 28 | 29 | #include 30 | int test1::l_test1(lua_State *L) 31 | { 32 | int type = lua_type(L,1); 33 | switch (type) { 34 | case LUA_TSTRING:{qDebug()< &comm); 13 | 14 | virtual int ShowConfigEditDlg(); 15 | 16 | virtual std::string GetFuncName(){ 17 | return "test1"; 18 | } 19 | 20 | void test000(int i){} 21 | void test000(int i) const {} 22 | void test000(double d){} 23 | 24 | protected: 25 | static int l_test1(lua_State *L); 26 | }; 27 | 28 | _API_FUNC FuncModel *CreateFunc(); 29 | 30 | #endif // ZDK_AESMES_H 31 | -------------------------------------------------------------------------------- /ICStudio.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | CONFIG += ordered 3 | 4 | SUBDIRS += Libs 5 | SUBDIRS += Core 6 | SUBDIRS += communication 7 | SUBDIRS += CommunicationProtocol 8 | SUBDIRS += FuncModel 9 | SUBDIRS += UiEdit 10 | -------------------------------------------------------------------------------- /ICStudioEdit/ICStudioEdit.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 #console 4 | #CONFIG -= app_bundle 5 | 6 | # The following define makes your compiler emit warnings if you use 7 | # any Qt feature that has been marked deprecated (the exact warnings 8 | # depend on your compiler). Please consult the documentation of the 9 | # deprecated API in order to know how to port your code away from it. 10 | DEFINES += QT_DEPRECATED_WARNINGS 11 | 12 | TARGET = ICStudio_Edit 13 | TEMPLATE = app 14 | 15 | win32-msvc{ 16 | BINDIR = $$PWD/../win32-msvc-mes-bin 17 | } 18 | CONFIG(debug, debug|release){ 19 | DESTDIR = $$BINDIR/debug 20 | }else{ 21 | DESTDIR = $$BINDIR/release 22 | } 23 | 24 | # You can also make your code fail to compile if it uses deprecated APIs. 25 | # In order to do so, uncomment the following line. 26 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 27 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 28 | 29 | SOURCES += \ 30 | main.cpp 31 | 32 | # Default rules for deployment. 33 | qnx: target.path = /tmp/$${TARGET}/bin 34 | else: unix:!android: target.path = /opt/$${TARGET}/bin 35 | !isEmpty(target.path): INSTALLS += target 36 | -------------------------------------------------------------------------------- /ICStudioEdit/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QCoreApplication a(argc, argv); 10 | 11 | //读配置文件获取待加载模块名. 12 | // 打开json文件. 13 | QFile jsonFIle("system/systemConfig.json"); 14 | if( jsonFIle.open(QIODevice::ReadWrite)) 15 | { 16 | QJsonParseError jsonParserError; 17 | QJsonDocument outDoc = QJsonDocument::fromJson(jsonFIle.readAll(),&jsonParserError); 18 | // 文档不空 && jsonParserError解析没有错误,解析成功返回true. 19 | if(!outDoc.isNull() && (jsonParserError.error == QJsonParseError::NoError)) 20 | { 21 | QJsonObject objRoot = outDoc.object(); 22 | QJsonObject objSys = objRoot["systemParams"].toObject(); 23 | objSys["model"] = 1; 24 | objRoot["systemParams"] = objSys; 25 | jsonFIle.close(); 26 | //json转字节 27 | if( jsonFIle.open(QIODevice::WriteOnly)) 28 | { 29 | outDoc.setObject(objRoot); 30 | jsonFIle.write(outDoc.toJson()); 31 | } 32 | } 33 | jsonFIle.close(); 34 | } 35 | 36 | int ret = QProcess::execute("ICStudio.exe"); 37 | 38 | return ret; 39 | } 40 | -------------------------------------------------------------------------------- /ICStudioRun/ICStudioRun.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 #console 4 | #CONFIG -= app_bundle 5 | 6 | # The following define makes your compiler emit warnings if you use 7 | # any Qt feature that has been marked deprecated (the exact warnings 8 | # depend on your compiler). Please consult the documentation of the 9 | # deprecated API in order to know how to port your code away from it. 10 | DEFINES += QT_DEPRECATED_WARNINGS 11 | 12 | TARGET = ICStudio_Run 13 | TEMPLATE = app 14 | 15 | win32-msvc{ 16 | BINDIR = $$PWD/../win32-msvc-mes-bin 17 | } 18 | CONFIG(debug, debug|release){ 19 | DESTDIR = $$BINDIR/debug 20 | }else{ 21 | DESTDIR = $$BINDIR/release 22 | } 23 | 24 | # You can also make your code fail to compile if it uses deprecated APIs. 25 | # In order to do so, uncomment the following line. 26 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 27 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 28 | 29 | SOURCES += \ 30 | main.cpp 31 | 32 | # Default rules for deployment. 33 | qnx: target.path = /tmp/$${TARGET}/bin 34 | else: unix:!android: target.path = /opt/$${TARGET}/bin 35 | !isEmpty(target.path): INSTALLS += target 36 | -------------------------------------------------------------------------------- /ICStudioRun/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QCoreApplication a(argc, argv); 10 | 11 | //读配置文件获取待加载模块名. 12 | // 打开json文件. 13 | QFile jsonFIle("system/systemConfig.json"); 14 | if( jsonFIle.open(QIODevice::ReadWrite)) 15 | { 16 | QJsonParseError jsonParserError; 17 | QJsonDocument outDoc = QJsonDocument::fromJson(jsonFIle.readAll(),&jsonParserError); 18 | // 文档不空 && jsonParserError解析没有错误,解析成功返回true. 19 | if(!outDoc.isNull() && (jsonParserError.error == QJsonParseError::NoError)) 20 | { 21 | QJsonObject objRoot = outDoc.object(); 22 | QJsonObject objSys = objRoot["systemParams"].toObject(); 23 | objSys["model"] = 2; 24 | objRoot["systemParams"] = objSys; 25 | jsonFIle.close(); 26 | //json转字节 27 | if( jsonFIle.open(QIODevice::WriteOnly)) 28 | { 29 | outDoc.setObject(objRoot); 30 | jsonFIle.write(outDoc.toJson()); 31 | } 32 | } 33 | jsonFIle.close(); 34 | } 35 | 36 | int ret = QProcess::execute("ICStudio.exe"); 37 | 38 | return ret; 39 | } 40 | -------------------------------------------------------------------------------- /Interface/IFuncModel.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCMODEL_H 2 | #define FUNCMODEL_H 3 | #include 4 | #include "IZObject.h" 5 | 6 | class interface_comm; 7 | class FuncModel : public ZObject 8 | { 9 | public: 10 | virtual ~FuncModel(){} 11 | 12 | //模块初始化. 13 | virtual int Init(std::shared_ptr &comm) = 0; 14 | 15 | //Run循环 16 | //返回值:-1表示退出循环调用 17 | virtual int Run(){ 18 | return -1; 19 | } 20 | 21 | //编辑显示 22 | virtual int ShowConfigEditDlg() 23 | { 24 | return -1; 25 | } 26 | 27 | //获取循环Run间隔时间单位ms 28 | //返回值:-1 表示无需循环Run,非-1表示循环调用间隔时间 29 | virtual int GetRunIntervalTime(){ 30 | return -1; 31 | } 32 | }; 33 | 34 | 35 | #if defined(API_FUNC) 36 | #define _API_FUNC extern "C" __declspec(dllexport) 37 | #else 38 | #define _API_FUNC extern "C" __declspec(dllimport) 39 | #endif 40 | 41 | 42 | #endif // FUNCMODEL_H 43 | -------------------------------------------------------------------------------- /Interface/IUiSupportModel.h: -------------------------------------------------------------------------------- 1 | #ifndef IUiModel_H 2 | #define IUiModel_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "IApp.h" 10 | #include "IZObject.h" 11 | 12 | class interface_comm; 13 | class IUiModel : public ZObject 14 | { 15 | public: 16 | //前端数据结构. 17 | using UiVariant = std::variant,std::vector >; 18 | //前端数据回调. 19 | using ValueCB = std::function; 20 | 21 | virtual ~IUiModel(){} 22 | 23 | //模块初始化. 24 | virtual int Init(std::shared_ptr &comm) = 0; 25 | 26 | //前端数据读写. 27 | virtual int SetValue(const std::string &name,const UiVariant &var) = 0; 28 | virtual int GetValue(const std::string &name,UiVariant &var) = 0; 29 | //绑定数据变化回调. 30 | virtual int RegisterValueCB(const std::string &name,ValueCB &CB) = 0; 31 | 32 | }; 33 | 34 | 35 | #if defined(API_UI) 36 | #define _API_UI extern "C" __declspec(dllexport) 37 | #else 38 | #define _API_UI extern "C" __declspec(dllimport) 39 | #endif 40 | 41 | 42 | #endif // FUNCMODEL_H 43 | -------------------------------------------------------------------------------- /Interface/IZObject.h: -------------------------------------------------------------------------------- 1 | #ifndef ZOBJECT_H 2 | #define ZOBJECT_H 3 | #include 4 | #include 5 | 6 | #define PROPERTY_MAX_SIZE 1024 7 | #define Z_TRANSFORM(type,num) (*reinterpret_cast(_a[num])) 8 | #define Z_TRANSFORM_R(type,_r) if (_a[0]) *reinterpret_cast(_a[0]) = std::move(_r) 9 | //脚本接口指针类型 10 | struct lua_State; 11 | typedef int (*ScriptFunc)(lua_State *L); 12 | 13 | class HEvent; 14 | class ZObject 15 | { 16 | public: 17 | virtual ~ZObject(){} 18 | 19 | /* 20 | * 获取版本号 21 | * 参数1-v0-大版本号,参数2-v1-小版本号 22 | */ 23 | virtual void GetVersion(uint32_t &v0,uint32_t &v1){ 24 | //默认版本1.0 25 | v0 = 1; 26 | v1 = 0; 27 | } 28 | 29 | /////事件注册和执行 30 | /* 31 | * 模块注册事件绑定 32 | * 参数1-eventList-绑定的事件列表 33 | * return,执行返回结果 34 | */ 35 | virtual int RegisterEvent(std::vector &eventList){ 36 | (void)eventList; 37 | return -1; 38 | } 39 | /* 40 | * 事件触发执行接口 41 | * 参数1-event-事件指针(指针不需模块释放) 42 | * return,执行返回结果 43 | */ 44 | virtual int EventCall(HEvent * event){ 45 | (void)event; 46 | return -1; 47 | } 48 | 49 | /////扩展功能注册和执行 50 | /* 51 | * 通过功能id执行模块提供的扩展功能 52 | * 参数1-funid-功能id,参数2-var-入参&出参 53 | * return,执行返回结果 54 | */ 55 | virtual int ExecFuncFromID(int funID , void **_a){ 56 | (void)funID; 57 | (void)_a; 58 | return -1; 59 | } 60 | /* 61 | * 检查参数 62 | * return,执行返回结果 63 | */ 64 | virtual const char * CheckParms(int funID){ 65 | (void)funID; 66 | return nullptr; 67 | } 68 | /* 69 | * 获取模块提供的扩展功能首id 70 | * return,执行返回结果 71 | */ 72 | virtual int GetFuncID(){ 73 | return -1; 74 | } 75 | /* 76 | * 获取模块名称 77 | * return,执行返回结果 78 | */ 79 | virtual std::string GetFuncName(){ 80 | return ""; 81 | } 82 | }; 83 | 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /Interface/event_def.h: -------------------------------------------------------------------------------- 1 | #ifndef _EVENT_DEF_H_ 2 | #define _EVENT_DEF_H_ 3 | 4 | #include "IApp.h" 5 | #include 6 | /********************************************************* 7 | * 8 | * 自定义消息,消息号字段统一定义 9 | * 10 | */ 11 | 12 | /***************************事件类型 13 | * 各个模块定义事件类型的地方,全局统一管理 14 | */ 15 | enum Event_Type 16 | { 17 | //工程管理模块(0x0-0xFE) 18 | Event_Project_Load = 0x0,//工程加载 19 | Event_Project_Unload,//工程关闭 20 | Event_Project_Compile,//工程编译 21 | Event_Project_LanguageChange,//多语言切换 22 | }; 23 | 24 | 25 | class ZObject; 26 | class HEvent 27 | { 28 | public: 29 | explicit HEvent(Event_Type type,const QVariant &var, 30 | ZObject * send = nullptr, 31 | Event_Pri_Type pri = Event_Nor, 32 | bool isThread = false) 33 | :_var(var),_pri(pri),_send(send),_type(type),_isThread(isThread){} 34 | 35 | QVariant _var; //事件附带的数据 36 | unsigned char _pri; //事件优先级 37 | ZObject *_send; //事件发送者 38 | Event_Type _type; //事件类型 39 | bool _isThread = false; //事件是否在线程中分发 40 | }; 41 | 42 | #endif // _HMI_EVENT_DEF_H_ 43 | -------------------------------------------------------------------------------- /Interface/extend_func_def.h: -------------------------------------------------------------------------------- 1 | #ifndef EXTENDFUNCHELPER_H 2 | #define EXTENDFUNCHELPER_H 3 | 4 | #define ZMaximumParamCount 7 5 | #define Z_ARG(type, data) ZArgument(#type, data) 6 | #define Z_RETURN_ARG(type, data) ZReturnArgument(#type, data) 7 | 8 | class ZGenericArgument 9 | { 10 | public: 11 | inline ZGenericArgument(const char *aName = nullptr, const void *aData = nullptr) 12 | : _data(aData), _name(aName) {} 13 | inline void *data() const { return const_cast(_data); } 14 | inline const char *name() const { return _name; } 15 | 16 | private: 17 | const void *_data; 18 | const char *_name; 19 | }; 20 | 21 | class ZGenericReturnArgument: public ZGenericArgument 22 | { 23 | public: 24 | inline ZGenericReturnArgument(const char *aName = nullptr, void *aData = nullptr) 25 | : ZGenericArgument(aName, aData) 26 | {} 27 | }; 28 | 29 | template 30 | class ZArgument: public ZGenericArgument 31 | { 32 | public: 33 | inline ZArgument(const char *aName, const T &aData) 34 | : ZGenericArgument(aName, static_cast(&aData)) 35 | {} 36 | }; 37 | template 38 | class ZArgument: public ZGenericArgument 39 | { 40 | public: 41 | inline ZArgument(const char *aName, T &aData) 42 | : ZGenericArgument(aName, static_cast(&aData)) 43 | {} 44 | }; 45 | 46 | 47 | template 48 | class ZReturnArgument: public ZGenericReturnArgument 49 | { 50 | public: 51 | inline ZReturnArgument(const char *aName, T &aData) 52 | : ZGenericReturnArgument(aName, static_cast(&aData)) 53 | {} 54 | }; 55 | 56 | 57 | #endif // EXTENDFUNCHELPER_H 58 | -------------------------------------------------------------------------------- /Interface/extend_func_head.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/Interface/extend_func_head.h -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 yanghui-9 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Libs/Libs.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += lua 4 | SUBDIRS += Tools 5 | 6 | -------------------------------------------------------------------------------- /Libs/Tools/Tools.pro: -------------------------------------------------------------------------------- 1 | QT += core gui network sql 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | 4 | TEMPLATE = lib 5 | CONFIG += shared 6 | 7 | DEFINES += TOOLS_LIB 8 | 9 | 10 | win32-msvc{ 11 | BINDIR = $$PWD/../../win32-msvc-mes-bin 12 | } 13 | 14 | CONFIG(debug, debug|release){ 15 | DESTDIR = $$BINDIR/debug 16 | }else{ 17 | DESTDIR = $$BINDIR/release 18 | } 19 | 20 | #CONFIG += PRECOMPILED_HEADER 21 | #Use Precompiled headers (PCH) 22 | #PRECOMPILED_HEADER = cstruct_pch_headers.h 23 | 24 | TARGET = Tools 25 | 26 | HEADERS += \ 27 | excel.h \ 28 | tools.h 29 | 30 | SOURCES += \ 31 | excel.cpp \ 32 | tools.cpp 33 | 34 | #MESGLOG 35 | LIBS += -L$$PWD/../../3rdparty/glog/lib/ -lglog 36 | INCLUDEPATH += $$PWD/../../3rdparty/glog/include 37 | -------------------------------------------------------------------------------- /Libs/Tools/excel.h: -------------------------------------------------------------------------------- 1 | #ifndef EXCEL_H 2 | #define EXCEL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "tools.h" 8 | 9 | class _TOOLS Excel : public QObject 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit Excel(QString fileName , QObject *parent = nullptr); 14 | virtual ~Excel(); 15 | int setHeaderTitle(const QStringList &titleList); 16 | bool CreateExcelFile(); 17 | int insertData(QVector &data); 18 | QString getExcelFileName(){return m_filePathAndName;} 19 | 20 | signals: 21 | void New_day(); 22 | 23 | private: 24 | QString m_BaseDir; 25 | QString m_DirPath; 26 | QString m_filePathAndName; 27 | QString m_CustomFileName; 28 | QFile *m_file = nullptr; 29 | }; 30 | 31 | #endif // EXCEL_H 32 | -------------------------------------------------------------------------------- /Libs/Tools/tools.h: -------------------------------------------------------------------------------- 1 | #ifndef tools_h 2 | #define tools_h 3 | #include 4 | #include 5 | 6 | #if defined(TOOLS_LIB) 7 | # define _TOOLS __declspec(dllexport) 8 | #else 9 | # define _TOOLS __declspec(dllimport) 10 | #endif 11 | 12 | 13 | //导出c函数接口 14 | 15 | //工程配置相关 16 | //导出导入工程文件(带校验) 17 | extern "C" _TOOLS bool Tools_ExportProject(const std::string &sFileName); 18 | extern "C" _TOOLS bool Tools_ImportProject(const std::string &sFileName); 19 | //检查工程文件配置是否损坏 20 | extern "C" _TOOLS bool Tools_CheckProject(); 21 | //文件夹复制 22 | extern "C" _TOOLS bool Tools_CopyDirectory(const std::string &fromDir, const std::string &toDir, bool bCoverIfFileExists); 23 | 24 | //通用工具接口 25 | //汉字编码转换 26 | extern "C" _TOOLS void Tools_GBK2UTF8(std::string *inStr); 27 | //检查目录大小 28 | extern "C" _TOOLS uint64_t Tools_GetDirSize(std::string *sdirPath); 29 | 30 | 31 | 32 | #endif 33 | 34 | 35 | -------------------------------------------------------------------------------- /Libs/lua/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "llimits.h" 12 | #include "lstate.h" 13 | 14 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ 15 | "stack overflow");} 16 | 17 | #define adjustresults(L,nres) \ 18 | { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } 19 | 20 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ 21 | "not enough elements in the stack") 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Libs/lua/src/ldebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $ 3 | ** Auxiliary functions from Debug Interface module 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldebug_h 8 | #define ldebug_h 9 | 10 | 11 | #include "lstate.h" 12 | 13 | 14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) 15 | 16 | #define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1) 17 | 18 | #define resethookcount(L) (L->hookcount = L->basehookcount) 19 | 20 | 21 | LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, 22 | const char *opname); 23 | LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1, 24 | const TValue *p2); 25 | LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1, 26 | const TValue *p2, 27 | const char *msg); 28 | LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1, 29 | const TValue *p2); 30 | LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1, 31 | const TValue *p2); 32 | LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...); 33 | LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg, 34 | TString *src, int line); 35 | LUAI_FUNC l_noret luaG_errormsg (lua_State *L); 36 | LUAI_FUNC void luaG_traceexec (lua_State *L); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Libs/lua/src/lfunc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lfunc.h,v 2.15 2015/01/13 15:49:11 roberto Exp $ 3 | ** Auxiliary functions to manipulate prototypes and closures 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lfunc_h 8 | #define lfunc_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ 15 | cast(int, sizeof(TValue)*((n)-1))) 16 | 17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ 18 | cast(int, sizeof(TValue *)*((n)-1))) 19 | 20 | 21 | /* test whether thread is in 'twups' list */ 22 | #define isintwups(L) (L->twups != L) 23 | 24 | 25 | /* 26 | ** maximum number of upvalues in a closure (both C and Lua). (Value 27 | ** must fit in a VM register.) 28 | */ 29 | #define MAXUPVAL 255 30 | 31 | 32 | /* 33 | ** Upvalues for Lua closures 34 | */ 35 | struct UpVal { 36 | TValue *v; /* points to stack or to its own value */ 37 | lu_mem refcount; /* reference counter */ 38 | union { 39 | struct { /* (when open) */ 40 | UpVal *next; /* linked list */ 41 | int touched; /* mark to avoid cycles with dead threads */ 42 | } open; 43 | TValue value; /* the value (when closed) */ 44 | } u; 45 | }; 46 | 47 | #define upisopen(up) ((up)->v != &(up)->u.value) 48 | 49 | 50 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); 51 | LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems); 52 | LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems); 53 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); 54 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 55 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); 56 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); 57 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, 58 | int pc); 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Libs/lua/src/linit.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: linit.c,v 1.39 2016/12/04 20:17:24 roberto Exp $ 3 | ** Initialization of libraries for lua.c and other clients 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #define linit_c 9 | #define LUA_LIB 10 | 11 | /* 12 | ** If you embed Lua in your program and need to open the standard 13 | ** libraries, call luaL_openlibs in your program. If you need a 14 | ** different set of libraries, copy this file to your project and edit 15 | ** it to suit your needs. 16 | ** 17 | ** You can also *preload* libraries, so that a later 'require' can 18 | ** open the library, which is already linked to the application. 19 | ** For that, do the following code: 20 | ** 21 | ** luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE); 22 | ** lua_pushcfunction(L, luaopen_modname); 23 | ** lua_setfield(L, -2, modname); 24 | ** lua_pop(L, 1); // remove PRELOAD table 25 | */ 26 | 27 | #include "lprefix.h" 28 | 29 | 30 | #include 31 | 32 | #include "lua.h" 33 | 34 | #include "lualib.h" 35 | #include "lauxlib.h" 36 | 37 | 38 | /* 39 | ** these libs are loaded by lua.c and are readily available to any Lua 40 | ** program 41 | */ 42 | static const luaL_Reg loadedlibs[] = { 43 | {"_G", luaopen_base}, 44 | {LUA_LOADLIBNAME, luaopen_package}, 45 | {LUA_COLIBNAME, luaopen_coroutine}, 46 | {LUA_TABLIBNAME, luaopen_table}, 47 | {LUA_IOLIBNAME, luaopen_io}, 48 | {LUA_OSLIBNAME, luaopen_os}, 49 | {LUA_STRLIBNAME, luaopen_string}, 50 | {LUA_MATHLIBNAME, luaopen_math}, 51 | {LUA_UTF8LIBNAME, luaopen_utf8}, 52 | {LUA_DBLIBNAME, luaopen_debug}, 53 | #if defined(LUA_COMPAT_BITLIB) 54 | {LUA_BITLIBNAME, luaopen_bit32}, 55 | #endif 56 | {NULL, NULL} 57 | }; 58 | 59 | 60 | LUALIB_API void luaL_openlibs (lua_State *L) { 61 | const luaL_Reg *lib; 62 | /* "require" functions from 'loadedlibs' and set results to global table */ 63 | for (lib = loadedlibs; lib->func; lib++) { 64 | luaL_requiref(L, lib->name, lib->func, 1); 65 | lua_pop(L, 1); /* remove lib */ 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /Libs/lua/src/lprefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $ 3 | ** Definitions for Lua code that must come before any other header file 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lprefix_h 8 | #define lprefix_h 9 | 10 | 11 | /* 12 | ** Allows POSIX/XSI stuff 13 | */ 14 | #if !defined(LUA_USE_C89) /* { */ 15 | 16 | #if !defined(_XOPEN_SOURCE) 17 | #define _XOPEN_SOURCE 600 18 | #elif _XOPEN_SOURCE == 0 19 | #undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */ 20 | #endif 21 | 22 | /* 23 | ** Allows manipulation of large files in gcc and some other compilers 24 | */ 25 | #if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS) 26 | #define _LARGEFILE_SOURCE 1 27 | #define _FILE_OFFSET_BITS 64 28 | #endif 29 | 30 | #endif /* } */ 31 | 32 | 33 | /* 34 | ** Windows stuff 35 | */ 36 | #if defined(_WIN32) /* { */ 37 | 38 | #if !defined(_CRT_SECURE_NO_WARNINGS) 39 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 40 | #endif 41 | 42 | #endif /* } */ 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /Libs/lua/src/lstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.h,v 1.61 2015/11/03 15:36:01 roberto Exp $ 3 | ** String table (keep all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lstring_h 8 | #define lstring_h 9 | 10 | #include "lgc.h" 11 | #include "lobject.h" 12 | #include "lstate.h" 13 | 14 | 15 | #define sizelstring(l) (sizeof(union UTString) + ((l) + 1) * sizeof(char)) 16 | 17 | #define sizeludata(l) (sizeof(union UUdata) + (l)) 18 | #define sizeudata(u) sizeludata((u)->len) 19 | 20 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 21 | (sizeof(s)/sizeof(char))-1)) 22 | 23 | 24 | /* 25 | ** test whether a string is a reserved word 26 | */ 27 | #define isreserved(s) ((s)->tt == LUA_TSHRSTR && (s)->extra > 0) 28 | 29 | 30 | /* 31 | ** equality for short strings, which are always internalized 32 | */ 33 | #define eqshrstr(a,b) check_exp((a)->tt == LUA_TSHRSTR, (a) == (b)) 34 | 35 | 36 | LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); 37 | LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts); 38 | LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); 39 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 40 | LUAI_FUNC void luaS_clearcache (global_State *g); 41 | LUAI_FUNC void luaS_init (lua_State *L); 42 | LUAI_FUNC void luaS_remove (lua_State *L, TString *ts); 43 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s); 44 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 45 | LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); 46 | LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l); 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Libs/lua/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /Libs/lua/src/luaconf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/Libs/lua/src/luaconf.h -------------------------------------------------------------------------------- /Libs/lua/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.45 2017/01/12 17:14:26 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_BITLIBNAME "bit32" 39 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 40 | 41 | #define LUA_MATHLIBNAME "math" 42 | LUAMOD_API int (luaopen_math) (lua_State *L); 43 | 44 | #define LUA_DBLIBNAME "debug" 45 | LUAMOD_API int (luaopen_debug) (lua_State *L); 46 | 47 | #define LUA_LOADLIBNAME "package" 48 | LUAMOD_API int (luaopen_package) (lua_State *L); 49 | 50 | 51 | /* open all previous libraries */ 52 | LUALIB_API void (luaL_openlibs) (lua_State *L); 53 | 54 | 55 | 56 | #if !defined(lua_assert) 57 | #define lua_assert(x) ((void)0) 58 | #endif 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Libs/lua/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.45 2015/09/08 15:41:05 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "llimits.h" 11 | #include "lobject.h" 12 | #include "lzio.h" 13 | 14 | 15 | /* data to catch conversion errors */ 16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n" 17 | 18 | #define LUAC_INT 0x5678 19 | #define LUAC_NUM cast_num(370.5) 20 | 21 | #define MYINT(s) (s[0]-'0') 22 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) 23 | #define LUAC_FORMAT 0 /* this is the official format */ 24 | 25 | /* load one chunk; from lundump.c */ 26 | LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); 27 | 28 | /* dump one chunk; from ldump.c */ 29 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, 30 | void* data, int strip); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Libs/lua/src/lzio.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.c,v 1.37 2015/09/08 15:41:05 roberto Exp $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #define lzio_c 8 | #define LUA_CORE 9 | 10 | #include "lprefix.h" 11 | 12 | 13 | #include 14 | 15 | #include "lua.h" 16 | 17 | #include "llimits.h" 18 | #include "lmem.h" 19 | #include "lstate.h" 20 | #include "lzio.h" 21 | 22 | 23 | int luaZ_fill (ZIO *z) { 24 | size_t size; 25 | lua_State *L = z->L; 26 | const char *buff; 27 | lua_unlock(L); 28 | buff = z->reader(L, z->data, &size); 29 | lua_lock(L); 30 | if (buff == NULL || size == 0) 31 | return EOZ; 32 | z->n = size - 1; /* discount char being returned */ 33 | z->p = buff; 34 | return cast_uchar(*(z->p++)); 35 | } 36 | 37 | 38 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { 39 | z->L = L; 40 | z->reader = reader; 41 | z->data = data; 42 | z->n = 0; 43 | z->p = NULL; 44 | } 45 | 46 | 47 | /* --------------------------------------------------------------- read --- */ 48 | size_t luaZ_read (ZIO *z, void *b, size_t n) { 49 | while (n) { 50 | size_t m; 51 | if (z->n == 0) { /* no bytes in buffer? */ 52 | if (luaZ_fill(z) == EOZ) /* try to read more */ 53 | return n; /* no more input; return number of missing bytes */ 54 | else { 55 | z->n++; /* luaZ_fill consumed first byte; put it back */ 56 | z->p--; 57 | } 58 | } 59 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ 60 | memcpy(b, z->p, m); 61 | z->n -= m; 62 | z->p += m; 63 | b = (char *)b + m; 64 | n -= m; 65 | } 66 | return 0; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /Libs/lua/src/lzio.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.h,v 1.31 2015/09/08 15:41:05 roberto Exp $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lzio_h 9 | #define lzio_h 10 | 11 | #include "lua.h" 12 | 13 | #include "lmem.h" 14 | 15 | 16 | #define EOZ (-1) /* end of stream */ 17 | 18 | typedef struct Zio ZIO; 19 | 20 | #define zgetc(z) (((z)->n--)>0 ? cast_uchar(*(z)->p++) : luaZ_fill(z)) 21 | 22 | 23 | typedef struct Mbuffer { 24 | char *buffer; 25 | size_t n; 26 | size_t buffsize; 27 | } Mbuffer; 28 | 29 | #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) 30 | 31 | #define luaZ_buffer(buff) ((buff)->buffer) 32 | #define luaZ_sizebuffer(buff) ((buff)->buffsize) 33 | #define luaZ_bufflen(buff) ((buff)->n) 34 | 35 | #define luaZ_buffremove(buff,i) ((buff)->n -= (i)) 36 | #define luaZ_resetbuffer(buff) ((buff)->n = 0) 37 | 38 | 39 | #define luaZ_resizebuffer(L, buff, size) \ 40 | ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \ 41 | (buff)->buffsize, size), \ 42 | (buff)->buffsize = size) 43 | 44 | #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) 45 | 46 | 47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, 48 | void *data); 49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */ 50 | 51 | 52 | 53 | /* --------- Private Part ------------------ */ 54 | 55 | struct Zio { 56 | size_t n; /* bytes still unread */ 57 | const char *p; /* current position in buffer */ 58 | lua_Reader reader; /* reader function */ 59 | void *data; /* additional data */ 60 | lua_State *L; /* Lua state (for reader) */ 61 | }; 62 | 63 | 64 | LUAI_FUNC int luaZ_fill (ZIO *z); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ICStudio 2 | 基于Qt的工控行业组态软件ICStudio
3 | 二次开发平台
4 | 没考虑多语言
5 | 开发环境 Qt5.13 + msvc1027
6 | 7 | 项目后续通过插件进行扩展:数据插件,自定义控件插件,业务插件
8 | 数据插件:默认存在一个本地数据插件,数据插件分为-地址类型和标签类型,地址类型比较常见的有通讯协议比如Modbus等,标签类型的比如CIP协议
9 | 自定义控件插件:UI控件
10 | 业务插件:扩展业务处理,扩展系统功能
11 | 12 | 13 | 1.分为编辑模式和运行模式 14 | 15 | 编辑模式下:
16 | 1.可配置前端UI显示配置绑定数据中心的变量
17 | 2.提供变量绑定UI控件的属性,变量发生变化自动触发到绑定属性的控件
18 | 3.变量可绑定外设的通讯地址也可以绑定本地地址
19 | 外设目前增加到了modbus
20 | 21 | 运行模式下:
22 | 1.无操作的情况下,UI主要通过数据中心驱动,控件刷新&画面切换等等
23 | 24 | 控件:
25 | 1. 可直接按照框架提供的方案直接封装使用qt提供的qwidget通用控件
26 | 2. 可直接自己开发绘制控件,基于qwidget
27 | 3. 控件刷新一键绑定数据中心变量,运行时直接通过数据中心驱动刷新显示
28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ScriptEdit/AddrEditWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef ADDREDITWIDGET_H 2 | #define ADDREDITWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "../CommunicationProtocol/common/protocol_type.h" 9 | 10 | class AddrEditWidget : public QWidget 11 | { 12 | Q_OBJECT 13 | public: 14 | 15 | explicit AddrEditWidget(QWidget *parent = nullptr); 16 | void InitData(const Protocol::AddrInfoForRW &addr,int type = 0); 17 | 18 | 19 | QComboBox * m_typeCombox; 20 | QLineEdit * m_linkenameEdit; 21 | QLineEdit * m_regEdit; 22 | QLineEdit * m_indexEdit; 23 | QComboBox * m_dataTypeCombox; 24 | 25 | signals: 26 | void Changed(const QString &); 27 | }; 28 | 29 | #endif // ADDREDITWIDGET_H 30 | -------------------------------------------------------------------------------- /ScriptEdit/FuncManager.h: -------------------------------------------------------------------------------- 1 | #ifndef FuncManager_H 2 | #define FuncManager_H 3 | #include "IFuncModel.h" 4 | #include 5 | #include 6 | 7 | 8 | class FuncManager 9 | { 10 | typedef FuncModel * (*P_CreateFunc)(); 11 | public: 12 | FuncManager(); 13 | ~FuncManager(); 14 | 15 | //初始化库加载 16 | void InitLoad(std::vector> &modelVector); 17 | 18 | protected: 19 | void LoadProtocolFunc(const QString &pathFileName); 20 | 21 | private: 22 | QList m_libs; 23 | QMap m_supportLibNameMap; 24 | P_CreateFunc m_pFunc = nullptr; 25 | }; 26 | 27 | #endif // FuncManager_H 28 | -------------------------------------------------------------------------------- /ScriptEdit/FunctionEditDialog.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCIONTEDITDIALOG_H 2 | #define FUNCIONTEDITDIALOG_H 3 | 4 | #include 5 | 6 | struct Item_Pakeage 7 | { 8 | QWidget * item = nullptr; 9 | int type = 0; 10 | Item_Pakeage(QWidget *_item,int _type):item(_item),type(_type){} 11 | }; 12 | 13 | class FunciontEditDialog : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit FunciontEditDialog(QWidget *parent, const QString &name, const QString &from); 19 | ~FunciontEditDialog(); 20 | QString GetRusult(); 21 | 22 | public slots: 23 | void okSlot(); 24 | void cancleSlot(); 25 | 26 | private: 27 | QVector m_items; 28 | QString m_name; 29 | }; 30 | 31 | #endif // FUNCIONTEDITDIALOG_H 32 | -------------------------------------------------------------------------------- /ScriptEdit/image.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/compile.png 4 | image/new.png 5 | image/open.png 6 | image/save.png 7 | image/saveAll.png 8 | image/logo.ico 9 | 10 | 11 | -------------------------------------------------------------------------------- /ScriptEdit/image/compile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/ScriptEdit/image/compile.png -------------------------------------------------------------------------------- /ScriptEdit/image/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/ScriptEdit/image/logo.ico -------------------------------------------------------------------------------- /ScriptEdit/image/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/ScriptEdit/image/new.png -------------------------------------------------------------------------------- /ScriptEdit/image/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/ScriptEdit/image/open.png -------------------------------------------------------------------------------- /ScriptEdit/image/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/ScriptEdit/image/save.png -------------------------------------------------------------------------------- /ScriptEdit/image/saveall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/ScriptEdit/image/saveall.png -------------------------------------------------------------------------------- /ScriptEdit/logo.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "image//logo.ico" 2 | -------------------------------------------------------------------------------- /ScriptEdit/macroeditdialog.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/ScriptEdit/macroeditdialog.cpp -------------------------------------------------------------------------------- /ScriptEdit/macroeditdialog.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/ScriptEdit/macroeditdialog.h -------------------------------------------------------------------------------- /UiEdit/Items/BackgroundSettingsW.h: -------------------------------------------------------------------------------- 1 | #ifndef BACKGROUNDSETTINGSW_H 2 | #define BACKGROUNDSETTINGSW_H 3 | 4 | #include 5 | #include 6 | #include 7 | class item_base; 8 | class BackgroundSettingsW : public QGroupBox 9 | { 10 | Q_OBJECT 11 | public: 12 | BackgroundSettingsW(item_base *item, QWidget *parent = nullptr); 13 | 14 | bool IsImg(){ 15 | return picRadio->isChecked(); 16 | } 17 | QColor GetColor(){ 18 | return m_bgColor; 19 | } 20 | QString GetImg(){ 21 | return picBtn->text(); 22 | } 23 | 24 | void IsImgEnable(bool flag){ 25 | colorRadio->setChecked(!flag); 26 | picRadio->setChecked(flag); 27 | 28 | } 29 | void SetColor(QColor color){ 30 | m_bgColor = color; 31 | //按钮设置背景色 32 | colorBtn->setStyleSheet(QString("background-color:#%1%2%3") 33 | .arg(color.red(),2,16,QChar('0')) 34 | .arg(color.green(),2,16,QChar('0')) 35 | .arg(color.blue(),2,16,QChar('0'))); 36 | } 37 | void SetImg(const QString &name){ 38 | picBtn->setText(name); 39 | } 40 | 41 | protected slots: 42 | //颜色选择 43 | void colorSelectSlot(); 44 | //图片选择 45 | void imgSelectSlot(); 46 | //背景类型切换 47 | void bgTypeChangeSlot(); 48 | 49 | private: 50 | QRadioButton * colorRadio; 51 | QPushButton * colorBtn; 52 | QRadioButton * picRadio; 53 | QPushButton * picBtn; 54 | 55 | QColor m_bgColor; 56 | 57 | item_base* m_item; 58 | }; 59 | 60 | #endif // BACKGROUNDSETTINGSW_H 61 | -------------------------------------------------------------------------------- /UiEdit/Items/ItemHelper.cpp: -------------------------------------------------------------------------------- 1 | #include "ItemHelper.h" 2 | 3 | ItemHelper::ItemHelper() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /UiEdit/Items/ItemHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEMHELPER_H 2 | #define ITEMHELPER_H 3 | 4 | 5 | class ItemHelper 6 | { 7 | public: 8 | ItemHelper(); 9 | }; 10 | 11 | #endif // ITEMHELPER_H 12 | -------------------------------------------------------------------------------- /UiEdit/Items/ItemProEditDlgBase.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEMPROEDITDLGBASE_H 2 | #define ITEMPROEDITDLGBASE_H 3 | #include 4 | #include 5 | #include 6 | 7 | #define SPACERITEM 500 8 | 9 | class item_base; 10 | class ItemProEditDlgBase : public QDialog 11 | { 12 | Q_OBJECT 13 | public: 14 | //类型,按钮类-显示类 15 | enum Item_Type 16 | { 17 | ButtonType = 0, 18 | DisplayType 19 | }; 20 | 21 | ItemProEditDlgBase(Item_Type type,item_base *item,QWidget * parent = nullptr); 22 | virtual ~ItemProEditDlgBase(){} 23 | 24 | //初始化UI显示 25 | void InitUI(); 26 | 27 | //刷新数据 28 | void RefreshUI(); 29 | 30 | //保存 31 | void SaveData(); 32 | 33 | protected: 34 | //自定义属性页面 35 | virtual void InitCustomPage() = 0; 36 | virtual void RefreshCustomPage() = 0; 37 | virtual void SaveCustomPage() = 0; 38 | 39 | //动态图像页面 40 | void InitDynaGraph(); 41 | void RefreshDynaGraphPage(); 42 | void SaveDynaGraph(); 43 | 44 | //控制设置页面 45 | void InitCtlSettings(); 46 | void RefreshCtlSettingsPage(); 47 | void SaveCtlSettings(); 48 | 49 | //显示设置页面 50 | void InitPlaySettings(); 51 | void RefreshPlaySettingsPage(); 52 | void SavePlaySettings(); 53 | 54 | //样式表页面 55 | void InitStyleSheet(); 56 | void RefreshStyleSheetPage(); 57 | void SaveStyleSheet(); 58 | 59 | protected slots: 60 | //确认取消 61 | void comfirmSlot(); 62 | void cancleSlot(); 63 | 64 | protected: 65 | QTabWidget * m_tabW = nullptr; 66 | //类型,按钮类-显示类 67 | Item_Type m_type = ButtonType; 68 | 69 | QWidget *m_customPage; 70 | QWidget *m_dynaGraph; 71 | QWidget *m_ctlSettings; 72 | QWidget *m_displaySettings; 73 | QWidget *m_styleSheet; 74 | 75 | QJsonObject m_itemObj; 76 | item_base * m_item; 77 | }; 78 | 79 | #endif // ITEMPROEDITDLGBASE_H 80 | -------------------------------------------------------------------------------- /UiEdit/Items/Items.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += bitButton 4 | SUBDIRS += combine 5 | SUBDIRS += sceneButton 6 | SUBDIRS += textEdit 7 | -------------------------------------------------------------------------------- /UiEdit/Items/LabelBase.cpp: -------------------------------------------------------------------------------- 1 | #include "LabelBase.h" 2 | #include 3 | #include 4 | #include 5 | 6 | LabelBase::LabelBase(QWidget *parent) : QGroupBox (parent) 7 | { 8 | //背景设置 9 | setTitle(QString::fromLocal8Bit("标签设置")); 10 | 11 | QGridLayout * bgLayout = new QGridLayout(); 12 | QLabel * label = new QLabel(QString::fromLocal8Bit("文本:"),this); 13 | textEdit = new QTextEdit(this); 14 | bgLayout->addWidget(label,0,0,1,1); 15 | bgLayout->addWidget(textEdit,0,1,1,1); 16 | 17 | setLayout(bgLayout); 18 | } 19 | -------------------------------------------------------------------------------- /UiEdit/Items/LabelBase.h: -------------------------------------------------------------------------------- 1 | #ifndef LABELBASE_H 2 | #define LABELBASE_H 3 | 4 | #include 5 | 6 | class QTextEdit; 7 | class LabelBase : public QGroupBox 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit LabelBase(QWidget *parent = nullptr); 12 | 13 | QTextEdit * textEdit; 14 | }; 15 | 16 | #endif // LABELBASE_H 17 | -------------------------------------------------------------------------------- /UiEdit/Items/bitButton/Bit Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/Items/bitButton/Bit Button.png -------------------------------------------------------------------------------- /UiEdit/Items/bitButton/bitButton.h: -------------------------------------------------------------------------------- 1 | #ifndef UBitButton_H 2 | #define UBitButton_H 3 | #include 4 | #include "../item_base.h" 5 | 6 | class UBitButton : public item_base 7 | { 8 | Q_OBJECT 9 | public: 10 | UBitButton(QWidget *parent = nullptr); 11 | virtual~UBitButton(){} 12 | void initWidget(); 13 | virtual void itemPaintEvent(QPaintEvent *event); 14 | 15 | //结果调用 16 | virtual bool update_result(int flag = 0, void *reslut = nullptr); 17 | 18 | //地址信息 19 | virtual bool update_addr(QList& addrList); 20 | 21 | //on off 变化值回调 22 | void addrChangeCB(const Protocol::AddrInfoForRW &, int32_t code); 23 | private: 24 | //QImage *m_on = nullptr; 25 | //QImage *m_off = nullptr; 26 | std::shared_ptr m_on; 27 | std::shared_ptr m_off; 28 | bool m_curStatus = false; 29 | }; 30 | 31 | 32 | 33 | 34 | #endif // UBitButton_H 35 | -------------------------------------------------------------------------------- /UiEdit/Items/bitButton/bitButton.pro: -------------------------------------------------------------------------------- 1 | QT+= core gui 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | TEMPLATE = lib 4 | CONFIG += c++17 5 | CONFIG += shared 6 | 7 | DEFINES += _ITEM 8 | #DEFINES += QT_NO_DEBUG_OUTPUT 9 | 10 | 11 | #mingw 12 | win32-g++{ 13 | BINDIR = $$PWD/../../../win32-gcc-mes-bin 14 | } 15 | #msvc 16 | win32-msvc{ 17 | BINDIR = $$PWD/../../../win32-msvc-mes-bin 18 | } 19 | 20 | #arm-linux 21 | linux-arm-g++{ 22 | BINDIR = $$PWD/../../arm-linux-gcc-bin 23 | DEFINES += __NO_PRECOMPILED_HEADER__ 24 | DEFINES += _TTY_POSIX_ 25 | } 26 | 27 | CONFIG(debug, debug|release){ 28 | DESTDIR = $$BINDIR/debug/Items 29 | libPath = $$BINDIR/debug 30 | }else{ 31 | DESTDIR = $$BINDIR/release/Items 32 | libPath = $$BINDIR/release 33 | } 34 | 35 | LIBS += -L$$libPath 36 | 37 | TARGET = bitButton 38 | 39 | HEADERS += \ 40 | ../ItemProEditDlgBase.h \ 41 | ../item_base.h \ 42 | bitButton.h \ 43 | bitButtonProDlg.h 44 | 45 | SOURCES += \ 46 | ../ItemProEditDlgBase.cpp \ 47 | bitButton.cpp \ 48 | bitButtonProDlg.cpp 49 | 50 | 51 | #Interface 52 | INCLUDEPATH += $$PWD/../../../Interface 53 | 54 | DISTFILES += \ 55 | Bit Button.png \ 56 | Bit Button.png 57 | 58 | RESOURCES += \ 59 | image.qrc 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /UiEdit/Items/bitButton/bitButtonProDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef BITBUTTONPRODLG_H 2 | #define BITBUTTONPRODLG_H 3 | #include "../ItemProEditDlgBase.h" 4 | 5 | class item_base; 6 | class bitButtonProDlg : public ItemProEditDlgBase 7 | { 8 | public: 9 | bitButtonProDlg(item_base *item, QWidget * parent = nullptr); 10 | virtual ~bitButtonProDlg(){} 11 | 12 | protected: 13 | //自定义属性页面 14 | virtual void InitCustomPage(); 15 | virtual void RefreshCustomPage(); 16 | virtual void SaveCustomPage(); 17 | 18 | private: 19 | QPushButton * varBtn; 20 | QPushButton * offPicBtn; 21 | QPushButton * onPicBtn; 22 | }; 23 | 24 | #endif // BITBUTTONPRODLG_H 25 | -------------------------------------------------------------------------------- /UiEdit/Items/bitButton/image.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bit Button.png 4 | off.png 5 | on.png 6 | 7 | 8 | -------------------------------------------------------------------------------- /UiEdit/Items/bitButton/off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/Items/bitButton/off.png -------------------------------------------------------------------------------- /UiEdit/Items/bitButton/on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/Items/bitButton/on.png -------------------------------------------------------------------------------- /UiEdit/Items/combine/combine.h: -------------------------------------------------------------------------------- 1 | #ifndef combine_H 2 | #define combine_H 3 | #include 4 | #include "../item_base.h" 5 | 6 | class combine : public item_base 7 | { 8 | Q_OBJECT 9 | public: 10 | combine(QWidget *parent = nullptr); 11 | virtual~combine(){} 12 | void initWidget(); 13 | virtual void itemPaintEvent(QPaintEvent *event); 14 | 15 | //计算控件绘制结果 16 | //flag默认0 flag 17 | //第0位为1表示固定刷新调用,直接切换状态 18 | //第1位为1表示键盘输入调用 19 | //第2位为1表示地址变化调用 20 | //第3位为1表示画面切换,关闭当前画面 21 | //第4位为1表示画面切换,显示当前画面 22 | //第5位为1表示运行编辑模式切换 23 | //第6位为1表示切换为运行模式,1表示编辑模式 24 | virtual bool update_result(int flag = 0, void *reslut = nullptr); 25 | 26 | //地址信息 27 | virtual bool update_addr(QList& addrList); 28 | 29 | //on off 变化值回调 30 | void addrChangeCB(const Protocol::AddrInfoForRW &, int32_t code); 31 | 32 | private: 33 | bool m_curStatus = false; 34 | }; 35 | 36 | 37 | 38 | 39 | #endif // combine_H 40 | -------------------------------------------------------------------------------- /UiEdit/Items/combine/combine.pro: -------------------------------------------------------------------------------- 1 | QT+= core gui 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | TEMPLATE = lib 4 | CONFIG += c++17 5 | CONFIG += shared 6 | 7 | DEFINES += _ITEM 8 | #DEFINES += QT_NO_DEBUG_OUTPUT 9 | 10 | 11 | #mingw 12 | win32-g++{ 13 | BINDIR = $$PWD/../../../win32-gcc-mes-bin 14 | } 15 | #msvc 16 | win32-msvc{ 17 | BINDIR = $$PWD/../../../win32-msvc-mes-bin 18 | } 19 | 20 | #arm-linux 21 | linux-arm-g++{ 22 | BINDIR = $$PWD/../../arm-linux-gcc-bin 23 | DEFINES += __NO_PRECOMPILED_HEADER__ 24 | DEFINES += _TTY_POSIX_ 25 | } 26 | 27 | CONFIG(debug, debug|release){ 28 | DESTDIR = $$BINDIR/debug/Items 29 | libPath = $$BINDIR/debug 30 | }else{ 31 | DESTDIR = $$BINDIR/release/Items 32 | libPath = $$BINDIR/release 33 | } 34 | 35 | #LIBS += -L$$libPath 36 | 37 | #Interface 38 | INCLUDEPATH += $$PWD/../../../Interface 39 | 40 | TARGET = combine 41 | 42 | HEADERS += \ 43 | ../ItemProEditDlgBase.h \ 44 | ../item_base.h \ 45 | combine.h 46 | 47 | SOURCES += \ 48 | ../ItemProEditDlgBase.cpp \ 49 | combine.cpp 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /UiEdit/Items/sceneButton/Scene Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/Items/sceneButton/Scene Button.png -------------------------------------------------------------------------------- /UiEdit/Items/sceneButton/image.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Scene Button.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /UiEdit/Items/sceneButton/sceneButton.h: -------------------------------------------------------------------------------- 1 | #ifndef USceneButton_H 2 | #define USceneButton_H 3 | #include 4 | #include "../item_base.h" 5 | 6 | class USceneButton : public item_base 7 | { 8 | Q_OBJECT 9 | public: 10 | USceneButton(QWidget *parent = nullptr); 11 | virtual~USceneButton(){} 12 | void initWidget(); 13 | virtual void itemPaintEvent(QPaintEvent *event); 14 | 15 | //结果调用 16 | virtual bool update_result(int flag = 0, void *reslut = nullptr); 17 | 18 | //地址信息 19 | virtual bool update_addr(QList& addrList); 20 | 21 | //变化值回调 22 | void addrChangeCB(const Protocol::AddrInfoForRW &, int32_t code); 23 | 24 | protected: 25 | //按下切换 26 | void mousePressEvent(QMouseEvent *event); 27 | 28 | private: 29 | //std::shared_ptr m_on; 30 | //std::shared_ptr m_off; 31 | }; 32 | 33 | 34 | 35 | 36 | #endif // USceneButton_H 37 | -------------------------------------------------------------------------------- /UiEdit/Items/sceneButton/sceneButton.pro: -------------------------------------------------------------------------------- 1 | QT+= core gui 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | TEMPLATE = lib 4 | CONFIG += c++17 5 | CONFIG += shared 6 | 7 | DEFINES += _ITEM 8 | #DEFINES += QT_NO_DEBUG_OUTPUT 9 | 10 | 11 | #mingw 12 | win32-g++{ 13 | BINDIR = $$PWD/../../../win32-gcc-mes-bin 14 | } 15 | #msvc 16 | win32-msvc{ 17 | BINDIR = $$PWD/../../../win32-msvc-mes-bin 18 | } 19 | 20 | #arm-linux 21 | linux-arm-g++{ 22 | BINDIR = $$PWD/../../arm-linux-gcc-bin 23 | DEFINES += __NO_PRECOMPILED_HEADER__ 24 | DEFINES += _TTY_POSIX_ 25 | } 26 | 27 | CONFIG(debug, debug|release){ 28 | DESTDIR = $$BINDIR/debug/Items 29 | libPath = $$BINDIR/debug 30 | }else{ 31 | DESTDIR = $$BINDIR/release/Items 32 | libPath = $$BINDIR/release 33 | } 34 | 35 | LIBS += -L$$libPath 36 | 37 | #App 38 | LIBS += -L$$libPath -lApp 39 | #Interface 40 | INCLUDEPATH += $$PWD/../../../Interface 41 | 42 | TARGET = sceneButton 43 | 44 | HEADERS += \ 45 | ../BackgroundSettingsW.h \ 46 | ../ItemProEditDlgBase.h \ 47 | ../LabelBase.h \ 48 | ../item_base.h \ 49 | sceneButton.h \ 50 | sceneButtonProDlg.h 51 | 52 | SOURCES += \ 53 | ../BackgroundSettingsW.cpp \ 54 | ../ItemProEditDlgBase.cpp \ 55 | ../LabelBase.cpp \ 56 | sceneButton.cpp \ 57 | sceneButtonProDlg.cpp 58 | 59 | INCLUDEPATH += ../../../MesHost/MesHost/Interface 60 | 61 | RESOURCES += \ 62 | image.qrc 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /UiEdit/Items/sceneButton/sceneButtonProDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef SCENEBUTTONPRODLG_H 2 | #define SCENEBUTTONPRODLG_H 3 | #include 4 | #include "../ItemProEditDlgBase.h" 5 | 6 | class item_base; 7 | class BackgroundSettingsW; 8 | class LabelBase; 9 | class sceneButtonProDlg : public ItemProEditDlgBase 10 | { 11 | Q_OBJECT 12 | public: 13 | sceneButtonProDlg(item_base *item, QWidget * parent = nullptr); 14 | virtual ~sceneButtonProDlg(){} 15 | 16 | protected: 17 | //自定义属性页面 18 | virtual void InitCustomPage(); 19 | virtual void RefreshCustomPage(); 20 | virtual void SaveCustomPage(); 21 | 22 | private: 23 | BackgroundSettingsW * m_bgW; 24 | LabelBase * m_label; 25 | QComboBox * m_sceneBox; 26 | QStringList m_sceneList; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /UiEdit/Items/textEdit/TextEdit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/Items/textEdit/TextEdit.png -------------------------------------------------------------------------------- /UiEdit/Items/textEdit/image.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | TextEdit.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /UiEdit/Items/textEdit/textEdit.h: -------------------------------------------------------------------------------- 1 | #ifndef textEdit_H 2 | #define textEdit_H 3 | #include 4 | #include "../item_base.h" 5 | 6 | class textEdit : public item_base 7 | { 8 | Q_OBJECT 9 | public: 10 | textEdit(QWidget *parent = nullptr); 11 | virtual~textEdit(){} 12 | void initWidget(); 13 | 14 | //结果调用 15 | virtual bool update_result(int flag = 0, void *reslut = nullptr); 16 | 17 | //地址信息 18 | virtual bool update_addr(QList& addrList); 19 | 20 | //变化值回调 21 | void addrChangeCB(const Protocol::AddrInfoForRW &, int32_t code); 22 | 23 | //刷新 24 | void itemUpdate(); 25 | 26 | protected: 27 | //按下切换 28 | void mousePressEvent(QMouseEvent *event); 29 | 30 | private: 31 | //std::shared_ptr m_on; 32 | //std::shared_ptr m_off; 33 | QString m_text = "0"; 34 | }; 35 | 36 | 37 | 38 | 39 | #endif // textEdit_H 40 | -------------------------------------------------------------------------------- /UiEdit/Items/textEdit/textEdit.pro: -------------------------------------------------------------------------------- 1 | QT+= core gui 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | TEMPLATE = lib 4 | CONFIG += c++17 5 | CONFIG += shared 6 | 7 | DEFINES += _ITEM 8 | #DEFINES += QT_NO_DEBUG_OUTPUT 9 | 10 | 11 | #mingw 12 | win32-g++{ 13 | BINDIR = $$PWD/../../../win32-gcc-mes-bin 14 | } 15 | #msvc 16 | win32-msvc{ 17 | BINDIR = $$PWD/../../../win32-msvc-mes-bin 18 | } 19 | 20 | #arm-linux 21 | linux-arm-g++{ 22 | BINDIR = $$PWD/../../arm-linux-gcc-bin 23 | DEFINES += __NO_PRECOMPILED_HEADER__ 24 | DEFINES += _TTY_POSIX_ 25 | } 26 | 27 | CONFIG(debug, debug|release){ 28 | DESTDIR = $$BINDIR/debug/Items 29 | libPath = $$BINDIR/debug 30 | }else{ 31 | DESTDIR = $$BINDIR/release/Items 32 | libPath = $$BINDIR/release 33 | } 34 | 35 | LIBS += -L$$libPath 36 | 37 | #App 38 | LIBS += -L$$libPath -lApp 39 | #Interface 40 | INCLUDEPATH += $$PWD/../../../Interface 41 | 42 | TARGET = textEdit 43 | 44 | HEADERS += \ 45 | ../BackgroundSettingsW.h \ 46 | ../ItemHelper.h \ 47 | ../ItemProEditDlgBase.h \ 48 | ../LabelBase.h \ 49 | ../item_base.h \ 50 | textEdit.h \ 51 | textEditProDlg.h 52 | 53 | SOURCES += \ 54 | ../BackgroundSettingsW.cpp \ 55 | ../ItemHelper.cpp \ 56 | ../ItemProEditDlgBase.cpp \ 57 | ../LabelBase.cpp \ 58 | textEdit.cpp \ 59 | textEditProDlg.cpp 60 | 61 | INCLUDEPATH += ../../../MesHost/MesHost/Interface 62 | 63 | RESOURCES += \ 64 | image.qrc 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /UiEdit/Items/textEdit/textEditProDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef textEditProDlg_H 2 | #define textEditProDlg_H 3 | #include 4 | #include "../ItemProEditDlgBase.h" 5 | 6 | class item_base; 7 | class BackgroundSettingsW; 8 | class LabelBase; 9 | class textEditProDlg : public ItemProEditDlgBase 10 | { 11 | Q_OBJECT 12 | public: 13 | textEditProDlg(item_base *item, QWidget * parent = nullptr); 14 | virtual ~textEditProDlg(){} 15 | 16 | protected: 17 | //自定义属性页面 18 | virtual void InitCustomPage(); 19 | virtual void RefreshCustomPage(); 20 | virtual void SaveCustomPage(); 21 | 22 | private: 23 | BackgroundSettingsW * m_bgW; 24 | LabelBase * m_label; 25 | QComboBox * m_sceneBox; 26 | QStringList m_sceneList; 27 | 28 | QPushButton *varBtn; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /UiEdit/UiEdit.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | CONFIG += ordered 3 | 4 | SUBDIRS += Items 5 | SUBDIRS += UiEdit 6 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/CustomComponentsDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef CustomComponentsDlg_H 2 | #define CustomComponentsDlg_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define ICON_WIDTH 50 10 | #define ICON_HEIGHT 50 11 | 12 | class CustomComponentsDlg : public QDialog 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit CustomComponentsDlg(QWidget *parent = nullptr); 17 | 18 | //初始化UI显示 19 | void InitUI(); 20 | 21 | //初始化 22 | void InitPic(); 23 | 24 | //设置选中自定义控件 25 | void SetSelectItems(const QString &sItems); 26 | 27 | //获取选中确认的图片路径 28 | QString GetSelectPic(){ 29 | return m_picPath; 30 | } 31 | 32 | public slots: 33 | //图库类型切换 34 | void typeChangeSlot(int index); 35 | //确认选中 36 | void selectComfirmSlot(); 37 | //取消 38 | void cancleSlot(); 39 | //新增 40 | void addSlot(); 41 | //删除 42 | void delSlot(); 43 | //单元格双击槽 44 | void itemDoubleClicked(QListWidgetItem *item); 45 | 46 | private: 47 | QListWidget * m_imgListWidget = nullptr; 48 | QPushButton * m_confirm = nullptr; 49 | QPushButton * m_cancle = nullptr; 50 | QPushButton * m_new = nullptr; 51 | QPushButton * m_del = nullptr; 52 | QComboBox * m_typeCombox; 53 | QMap> m_picMap; 54 | QMap> m_widgetMap; 55 | QMap m_selectMap; 56 | int m_curIndex = -1; 57 | QString m_picPath; 58 | }; 59 | 60 | #endif // CustomComponentsDlg_H 61 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/DisplayCustomComponentsDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef DisplayCustomComponentsDlg_H 2 | #define DisplayCustomComponentsDlg_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | class MainWindow; 12 | class DisplayCustomComponentsDlg : public QDialog 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit DisplayCustomComponentsDlg(MainWindow *mainW, QWidget *parent = nullptr); 17 | 18 | //初始化UI显示 19 | void InitUI(); 20 | 21 | //显示 22 | void UShow(); 23 | 24 | //加载 25 | void LoadCombineItems(const QString &sList); 26 | 27 | public slots: 28 | //单元格双击槽 29 | void itemClicked(QListWidgetItem *item); 30 | 31 | private: 32 | QListWidget * m_imgListWidget = nullptr; 33 | QMap> m_picMap; 34 | QMap> m_widgetMap; 35 | int m_curIndex = -1; 36 | QString m_sItemList; 37 | MainWindow * m_mainW = nullptr; 38 | }; 39 | 40 | #endif // DisplayCustomComponentsDlg_H 41 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Gallery/Gallery.cpp: -------------------------------------------------------------------------------- 1 | #include "Gallery.h" 2 | #include "GalleryDlg.h" 3 | 4 | Gallery::Gallery() 5 | { 6 | } 7 | 8 | Gallery::~Gallery() 9 | { 10 | //foreach (auto img, m_imgMap) { 11 | // delete img; 12 | //} 13 | m_imgMap.clear(); 14 | } 15 | 16 | std::string Gallery::ShowImgSelectDialog(QWidget * parent) 17 | { 18 | if(!m_dlg) 19 | { 20 | m_dlg = new GalleryDlg(this,parent); 21 | m_dlg->InitUI(); 22 | } 23 | if( QDialog::Accepted == m_dlg->exec()) 24 | { 25 | return m_dlg->GetSelectPic().toStdString(); 26 | } 27 | return ""; 28 | } 29 | 30 | bool Gallery::GetImgFromPath(const std::string &sPath, std::shared_ptr &img) 31 | { 32 | if(!m_dlg) 33 | { 34 | m_dlg = new GalleryDlg(this,nullptr); 35 | m_dlg->InitUI(); 36 | m_dlg->hide(); 37 | } 38 | QMap >::Iterator it = m_imgMap.find(sPath); 39 | if(it != m_imgMap.end()) 40 | { 41 | img = it.value(); 42 | return true; 43 | } 44 | return false; 45 | } 46 | 47 | bool Gallery::UpdateImgFromPath(const std::string &sPath, std::shared_ptr &img) 48 | { 49 | if(!m_dlg) 50 | { 51 | m_dlg = new GalleryDlg(this,nullptr); 52 | m_dlg->InitUI(); 53 | m_dlg->hide(); 54 | } 55 | QMap >::Iterator it = m_imgMap.find(sPath); 56 | if(it != m_imgMap.end()) 57 | { 58 | it.value() = img; 59 | return true; 60 | } 61 | return false; 62 | } 63 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Gallery/Gallery.h: -------------------------------------------------------------------------------- 1 | #ifndef GALLERY_H 2 | #define GALLERY_H 3 | #include "interface_gallery.h" 4 | #include 5 | 6 | class GalleryDlg; 7 | class QImage; 8 | class Gallery : public interface_gallery 9 | { 10 | friend class GalleryDlg; 11 | public: 12 | Gallery(); 13 | virtual ~Gallery(); 14 | 15 | //显示模态显示图片选择对话框,返回选择的图片图库路径 16 | virtual std::string ShowImgSelectDialog(QWidget *parent); 17 | 18 | //通过图片路径获取图片对象指针 19 | virtual bool GetImgFromPath(const std::string &sPath,std::shared_ptr &img); 20 | 21 | //通过图片路径设置图片对象 22 | virtual bool UpdateImgFromPath(const std::string &sPath,std::shared_ptr &img); 23 | 24 | private: 25 | GalleryDlg * m_dlg = nullptr; 26 | QMap > m_imgMap; 27 | }; 28 | 29 | #endif // GALLERY_H 30 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Gallery/GalleryDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef GALLERYDLG_H 2 | #define GALLERYDLG_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define ICON_WIDTH 50 10 | #define ICON_HEIGHT 50 11 | 12 | class QImage; 13 | class Gallery; 14 | class GalleryDlg : public QDialog 15 | { 16 | Q_OBJECT 17 | public: 18 | explicit GalleryDlg(Gallery *gallery,QWidget *parent = nullptr); 19 | 20 | //初始化UI显示 21 | void InitUI(); 22 | 23 | //初始化图库 24 | void InitPic(); 25 | 26 | //获取选中确认的图片路径 27 | QString GetSelectPic(){ 28 | return m_picPath; 29 | } 30 | 31 | public slots: 32 | //图库类型切换 33 | void typeChangeSlot(int index); 34 | //确认选中 35 | void selectComfirmSlot(); 36 | //取消 37 | void cancleSlot(); 38 | //新增 39 | void addSlot(); 40 | //删除 41 | void delSlot(); 42 | //单元格双击槽 43 | void itemDoubleClicked(QListWidgetItem *item); 44 | 45 | private: 46 | QListWidget * m_imgListWidget = nullptr; 47 | QPushButton * m_confirm = nullptr; 48 | QPushButton * m_cancle = nullptr; 49 | QPushButton * m_new = nullptr; 50 | QPushButton * m_del = nullptr; 51 | QComboBox * m_typeCombox; 52 | QMap> m_picMap; 53 | Gallery * m_gallery = nullptr; 54 | QString m_picPath; 55 | }; 56 | 57 | #endif // GALLERYDLG_H 58 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Gallery/interface_gallery.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERFACE_GALLERY_H 2 | #define INTERFACE_GALLERY_H 3 | #include 4 | 5 | class QImage; 6 | class QWidget; 7 | class interface_gallery 8 | { 9 | public: 10 | virtual ~interface_gallery(){} 11 | 12 | //图库接口设计 13 | //显示模态显示图片选择对话框,返回选择的图片图库路径 14 | virtual std::string ShowImgSelectDialog(QWidget *parent) = 0; 15 | 16 | //通过图片路径获取图片对象指针 17 | virtual bool GetImgFromPath(const std::string &sPath,std::shared_ptr &img) = 0; 18 | 19 | //通过图片路径设置图片对象 20 | virtual bool UpdateImgFromPath(const std::string &sPath,std::shared_ptr &img) = 0; 21 | }; 22 | 23 | #endif // INTERFACE_GALLERY_H 24 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/MainStatusBar.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINSTATUSBAR_H 2 | #define MAINSTATUSBAR_H 3 | #include 4 | #include 5 | #include 6 | 7 | class MainStatusBar : public QStatusBar 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit MainStatusBar(QWidget *parent = nullptr); 12 | 13 | public: 14 | void retranslateUI(void); 15 | void refreshUIfromData(); 16 | 17 | public: 18 | QLabel * nameLabel; 19 | QLabel * posStatus; 20 | QLabel * itemLeft; 21 | QLabel * itemTop; 22 | QLabel * itemSize; 23 | QLabel * itemWidth; 24 | QLabel * itemHeight; 25 | QLabel * name; 26 | QLineEdit * leftEdit; 27 | QLineEdit * topEdit; 28 | QLineEdit * widthEdit; 29 | QLineEdit * heightEdit; 30 | }; 31 | 32 | #endif // MAINSTATUSBAR_H 33 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/UIInputPolicy/IUIInputPolicy.h: -------------------------------------------------------------------------------- 1 | #ifndef IUIINPUTPOLICY_H 2 | #define IUIINPUTPOLICY_H 3 | 4 | #include 5 | #include 6 | #include 7 | class UWidgetScene; 8 | class IUIInputPolicy 9 | { 10 | public: 11 | /* in */ 12 | virtual void setScreen(UWidgetScene *) = 0; 13 | 14 | /* ui handler */ 15 | virtual bool mousePress( QMouseEvent * evt ) = 0; 16 | virtual bool mouseMove( QMouseEvent * evt ) = 0; 17 | virtual bool mouseRelease( QMouseEvent* evt ) = 0; 18 | virtual bool keyPressEvent( QKeyEvent * event ) = 0; 19 | }; 20 | 21 | #endif // IUIINPUTPOLICY_H 22 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/UIInputPolicy/RectCreate_UIInput.h: -------------------------------------------------------------------------------- 1 | #ifndef RectCreate_UIInput_H 2 | #define RectCreate_UIInput_H 3 | 4 | #include "../UIInputPolicy/IUIInputPolicy.h" 5 | #include "../UWidgetScene.h" 6 | 7 | class RectCreate_UIInput : public IUIInputPolicy 8 | { 9 | public: 10 | RectCreate_UIInput(); 11 | virtual ~RectCreate_UIInput(){} 12 | 13 | virtual void setScreen(UWidgetScene * scr); 14 | 15 | virtual bool mousePress(QMouseEvent *evt ); 16 | virtual bool mouseMove( QMouseEvent * evt ); 17 | virtual bool mouseRelease( QMouseEvent * evt ); 18 | virtual bool keyPressEvent( QKeyEvent * event ) ; 19 | 20 | public: 21 | UWidgetScene * mScreen = nullptr; 22 | QWidget * item = nullptr; 23 | QMap< QString, int > preNameMap; 24 | }; 25 | 26 | #endif // __RECTANGLE__CREATE__UI__INPUT__H__ 27 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/UIInputPolicy/Select_UIInput.h: -------------------------------------------------------------------------------- 1 | #ifndef Select_UIInput_H 2 | #define Select_UIInput_H 3 | 4 | #include "../UIInputPolicy/IUIInputPolicy.h" 5 | #include "UWidgetScene.h" 6 | 7 | class Select_UIInput : public IUIInputPolicy 8 | { 9 | public: 10 | Select_UIInput(); 11 | virtual ~Select_UIInput(){} 12 | 13 | virtual bool mousePress( QMouseEvent * evt ); 14 | virtual bool mouseMove( QMouseEvent * evt ); 15 | virtual bool mouseRelease( QMouseEvent * evt ); 16 | virtual void setScreen(UWidgetScene * scr); 17 | virtual bool keyPressEvent( QKeyEvent * event ) ; 18 | 19 | protected: 20 | //初始化选择画布 21 | void InitSelectItem(); 22 | 23 | public: 24 | UWidgetScene * mScreen = nullptr; 25 | QPoint m_pressPos; 26 | bool m_pressFlag; 27 | bool m_mulselectFlag; 28 | QRect m_selectRect; 29 | bool m_pflag; 30 | QWidget *m_selectRectItem = nullptr;//选择画布 31 | }; 32 | 33 | #endif // __SELECT__UI__INPUT__H__ 34 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/UScenePropertyEditDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef SCENEPROPERTYEDITDLG_H 2 | #define SCENEPROPERTYEDITDLG_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | class UWidgetScene; 17 | class UScenePropertyEditDlg : public QDialog 18 | { 19 | Q_OBJECT 20 | public: 21 | UScenePropertyEditDlg(UWidgetScene * scene,QWidget *parent = nullptr); 22 | 23 | //初始化UI显示 24 | void InitUI(); 25 | 26 | //刷新数据 27 | void RefreshUI(QJsonObject &sceneObj); 28 | 29 | protected slots: 30 | //脚本勾选处理槽 31 | void scriptCheckboxSlot(int state); 32 | //保存 33 | void saveSlot(); 34 | //颜色选择 35 | void colorSelectSlot(); 36 | //图片选择 37 | void imgSelectSlot(); 38 | //背景类型切换 39 | void bgTypeChangeSlot(); 40 | 41 | private: 42 | QGroupBox * m_scrit; 43 | QCheckBox * pressScript; 44 | QComboBox * pressCombox; 45 | QCheckBox * releaseScript; 46 | QComboBox * releaseCombox; 47 | QCheckBox * cycleScript; 48 | QComboBox * cycleCombox; 49 | QLineEdit * cycTimeEdit; 50 | 51 | QGroupBox * m_window; 52 | QLineEdit * lineX; 53 | QLineEdit * lineY; 54 | QLineEdit * lineW; 55 | QLineEdit * lineH; 56 | 57 | QRadioButton * colorRadio; 58 | QPushButton * colorBtn; 59 | QRadioButton * picRadio; 60 | QPushButton * picBtn; 61 | 62 | QColor m_bgColor; 63 | QStringList m_scriptList; 64 | 65 | UWidgetScene * m_scene = nullptr; 66 | 67 | public: 68 | QJsonObject m_sceneObj; 69 | }; 70 | 71 | #endif // SCENEPROPERTYEDITDLG_H 72 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/UiEdit.cpp: -------------------------------------------------------------------------------- 1 | #include "UiEdit.h" 2 | #include "MainWindow.h" 3 | #include "Itemsfactory.h" 4 | 5 | #include "extend_func_head.h" 6 | 7 | IUiModel *CreateUiM() 8 | { 9 | return new UiEdit(); 10 | } 11 | 12 | UiEdit::UiEdit() 13 | { 14 | } 15 | 16 | UiEdit::~UiEdit() 17 | { 18 | if(m_mainW) 19 | { 20 | delete m_mainW; 21 | } 22 | } 23 | 24 | int UiEdit::Init(std::shared_ptr &comm) 25 | { 26 | m_comm = comm; 27 | m_mainW = new MainWindow(comm); 28 | m_mainW->initUI(); 29 | m_mainW->show(); 30 | 31 | //初始化外调参数 32 | InitParms(); 33 | 34 | return 0; 35 | } 36 | 37 | int UiEdit::ExecFuncFromID(int funID, void **_a) 38 | { 39 | int ret = 0; 40 | switch (funID) 41 | { 42 | case 0: {bool ret = SwitchScene(Z_TRANSFORM(const std::string,1));Z_TRANSFORM_R(bool,ret);} break; 43 | default: ret = -1; 44 | } 45 | return ret; 46 | } 47 | 48 | const char *UiEdit::CheckParms(int funID) 49 | { 50 | if(static_cast( funID ) >= m_parms.size()) 51 | { 52 | return nullptr; 53 | } 54 | return m_parms[static_cast( funID )].data(); 55 | } 56 | 57 | int UiEdit::GetFuncID() 58 | { 59 | return 0 + 0x16FF; 60 | } 61 | 62 | std::string UiEdit::GetFuncName() 63 | { 64 | return "UI"; 65 | } 66 | 67 | bool UiEdit::SwitchScene(const std::string &name) 68 | { 69 | return m_mainW->SwitchScene(name); 70 | } 71 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/UiEdit.h: -------------------------------------------------------------------------------- 1 | #ifndef UIEDIT_H 2 | #define UIEDIT_H 3 | #include "IUiSupportModel.h" 4 | #include "MainStatusBar.h" 5 | 6 | class MainWindow; 7 | class UiEdit :public IUiModel 8 | { 9 | public: 10 | UiEdit(); 11 | virtual ~UiEdit(); 12 | 13 | //模块初始化. 14 | virtual int Init(std::shared_ptr &comm); 15 | 16 | //前端数据读写. 17 | virtual int SetValue(const std::string &name,const UiVariant &var){ 18 | Q_UNUSED(name); 19 | Q_UNUSED(var); 20 | return -1; 21 | } 22 | virtual int GetValue(const std::string &name,UiVariant &var){ 23 | Q_UNUSED(name); 24 | Q_UNUSED(var); 25 | return -1; 26 | } 27 | //绑定数据变化回调. 28 | virtual int RegisterValueCB(const std::string &name,ValueCB &CB){ 29 | Q_UNUSED(name); 30 | Q_UNUSED(CB); 31 | return -1; 32 | } 33 | 34 | 35 | /////扩展功能注册和执行 36 | /* 37 | * 通过功能id执行模块提供的扩展功能 38 | * 参数1-funid-功能id,参数2-var-入参&出参 39 | * return,执行返回结果 40 | */ 41 | virtual int ExecFuncFromID(int funID , void **_a); 42 | virtual const char * CheckParms(int funID); 43 | virtual int GetFuncID(); 44 | virtual std::string GetFuncName(); 45 | 46 | //初始化参数检测 47 | void InitParms(){ 48 | m_parms.push_back("bool(const std::string &)"); 49 | } 50 | 51 | protected: 52 | //对外接口 53 | bool SwitchScene(const std::string &name); 54 | 55 | private: 56 | MainWindow* m_mainW; 57 | std::shared_ptr m_comm; 58 | 59 | //参数检查 60 | std::vector< std::string > m_parms; 61 | }; 62 | 63 | _API_UI IUiModel *CreateUiM(); 64 | 65 | #endif // UIEDIT_H 66 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Undo/UAddUndo.cpp: -------------------------------------------------------------------------------- 1 | #include "UAddUndo.h" 2 | #include "../UWidgetScene.h" 3 | 4 | UAddUndo::UAddUndo(UWidgetScene * scene,QList items):m_scene(scene),m_itemlist(items) 5 | { 6 | } 7 | 8 | UAddUndo::~UAddUndo() 9 | { 10 | if(m_itemlist.size() > 0) 11 | { 12 | foreach (auto item, m_itemlist) { 13 | if(!item->parent()) 14 | {//控件当前不属于任何画面 15 | item->deleteLater(); 16 | } 17 | } 18 | m_itemlist.clear(); 19 | } 20 | } 21 | 22 | void UAddUndo::redo() 23 | { 24 | if(m_isPushRedoCMD) 25 | { 26 | m_isPushRedoCMD = false; 27 | return; 28 | } 29 | if(m_scene) 30 | { 31 | foreach (auto item, m_itemlist) { 32 | item->setParent(m_scene); 33 | item->setVisible(true); 34 | m_scene->addItem(item); 35 | } 36 | } 37 | } 38 | 39 | void UAddUndo::undo() 40 | { 41 | if(m_scene) 42 | { 43 | m_scene->removeItemObject(m_itemlist,true); 44 | } 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Undo/UAddUndo.h: -------------------------------------------------------------------------------- 1 | #ifndef UADDUNDO_H 2 | #define UADDUNDO_H 3 | #include 4 | 5 | class UWidgetScene; 6 | class UAddUndo : public QUndoCommand 7 | { 8 | public: 9 | UAddUndo(UWidgetScene * scene,QList items); 10 | virtual ~UAddUndo(); 11 | 12 | //redo 13 | void redo(); 14 | 15 | //undo 16 | void undo(); 17 | private: 18 | UWidgetScene * m_scene = nullptr; 19 | QList m_itemlist; 20 | bool m_isPushRedoCMD = true; 21 | }; 22 | 23 | #endif // UADDUNDO_H 24 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Undo/UDelUndo.cpp: -------------------------------------------------------------------------------- 1 | #include "UDelUndo.h" 2 | #include "../UWidgetScene.h" 3 | 4 | UDelUndo::UDelUndo(UWidgetScene * scene,QList items):m_scene(scene),m_itemlist(items) 5 | { 6 | } 7 | 8 | UDelUndo::~UDelUndo() 9 | { 10 | if(m_itemlist.size() > 0) 11 | { 12 | foreach (auto item, m_itemlist) { 13 | if(!item->parent()) 14 | {//控件当前不属于任何画面 15 | item->deleteLater(); 16 | } 17 | } 18 | m_itemlist.clear(); 19 | } 20 | } 21 | 22 | void UDelUndo::redo() 23 | { 24 | if(m_isPushRedoCMD) 25 | { 26 | m_isPushRedoCMD = false; 27 | return; 28 | } 29 | if(m_scene) 30 | { 31 | m_scene->removeItemObject(m_itemlist,true); 32 | } 33 | } 34 | 35 | void UDelUndo::undo() 36 | { 37 | if(m_scene) 38 | { 39 | foreach (auto item, m_itemlist) { 40 | item->setParent(m_scene); 41 | item->setVisible(true); 42 | m_scene->addItem(item); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Undo/UDelUndo.h: -------------------------------------------------------------------------------- 1 | #ifndef UDELUNDO_H 2 | #define UDELUNDO_H 3 | #include 4 | 5 | class UWidgetScene; 6 | class UDelUndo : public QUndoCommand 7 | { 8 | public: 9 | UDelUndo(UWidgetScene * scene,QList items); 10 | virtual ~UDelUndo(); 11 | 12 | //redo 13 | void redo(); 14 | 15 | //undo 16 | void undo(); 17 | 18 | private: 19 | UWidgetScene * m_scene = nullptr; 20 | QList m_itemlist; 21 | bool m_isPushRedoCMD = true; 22 | }; 23 | 24 | #endif // UDELUNDO_H 25 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Undo/UMoveUndo.cpp: -------------------------------------------------------------------------------- 1 | #include "UMoveUndo.h" 2 | #include 3 | 4 | UMoveUndo::UMoveUndo(QPoint begin, QPoint end, QList itemlist): 5 | m_begin(begin),m_end(end),m_itemlist(itemlist) 6 | { 7 | } 8 | 9 | UMoveUndo::~UMoveUndo() 10 | { 11 | } 12 | 13 | void UMoveUndo::redo() 14 | { 15 | if(m_isPushRedoCMD) 16 | { 17 | m_isPushRedoCMD = false; 18 | return; 19 | } 20 | int xd = m_begin.x() - m_end.x(); 21 | int yd = m_begin.y() - m_end.y(); 22 | foreach (auto item, m_itemlist) { 23 | item->move(item->pos().x()-xd,item->pos().y()-yd); 24 | } 25 | } 26 | 27 | void UMoveUndo::undo() 28 | { 29 | int xd = m_begin.x() - m_end.x(); 30 | int yd = m_begin.y() - m_end.y(); 31 | foreach (auto item, m_itemlist) { 32 | item->move(item->pos().x()+xd,item->pos().y()+yd); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Undo/UMoveUndo.h: -------------------------------------------------------------------------------- 1 | #ifndef UMOVEUNDO_H 2 | #define UMOVEUNDO_H 3 | #include 4 | #include 5 | 6 | class UMoveUndo: public QUndoCommand 7 | { 8 | public: 9 | UMoveUndo(QPoint begin,QPoint end,QList itemlist); 10 | virtual ~UMoveUndo(); 11 | 12 | //redo 13 | void redo(); 14 | 15 | //undo 16 | void undo(); 17 | 18 | private: 19 | QPoint m_begin; 20 | QPoint m_end; 21 | QList m_itemlist; 22 | bool m_isPushRedoCMD = true; 23 | }; 24 | 25 | #endif // UMOVEUNDO_H 26 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Undo/URectUndo.cpp: -------------------------------------------------------------------------------- 1 | #include "URectUndo.h" 2 | #include "../UIInputPolicy/RectEdit_UIInput.h" 3 | 4 | URectUndo::URectUndo(QRect begin, QRect end, QWidget * item): 5 | m_begin(begin),m_end(end),m_item(item) 6 | { 7 | } 8 | 9 | URectUndo::~URectUndo() 10 | { 11 | } 12 | 13 | void URectUndo::redo() 14 | { 15 | if(m_isPushRedoCMD) 16 | { 17 | m_isPushRedoCMD = false; 18 | return; 19 | } 20 | if(m_item) 21 | { 22 | m_item->setGeometry(m_end.x(), 23 | m_end.y(), 24 | m_end.width(), 25 | m_end.height()); 26 | RectEdit_UIInput::DealCombineItem(m_item); 27 | } 28 | } 29 | 30 | void URectUndo::undo() 31 | { 32 | if(m_item) 33 | { 34 | m_item->setGeometry(m_end.x(), 35 | m_end.y(), 36 | m_begin.width(), 37 | m_begin.height()); 38 | RectEdit_UIInput::DealCombineItem(m_item); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/Undo/URectUndo.h: -------------------------------------------------------------------------------- 1 | #ifndef URectUndo_H 2 | #define URectUndo_H 3 | #include 4 | #include 5 | 6 | class URectUndo: public QUndoCommand 7 | { 8 | public: 9 | URectUndo(QRect begin, QRect end, QWidget* item); 10 | virtual ~URectUndo(); 11 | 12 | //redo 13 | void redo(); 14 | 15 | //undo 16 | void undo(); 17 | private: 18 | QRect m_begin; 19 | QRect m_end; 20 | QWidget* m_item; 21 | bool m_isPushRedoCMD = true; 22 | }; 23 | 24 | #endif // URectUndo_H 25 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/VariableTable/VariableTable.cpp: -------------------------------------------------------------------------------- 1 | #include "VariableTable.h" 2 | #include "VariableTableDlg.h" 3 | 4 | VariableTable::VariableTable() 5 | { 6 | } 7 | 8 | std::string VariableTable::ShowVarSelectDialog(QWidget *parent) 9 | { 10 | if(!m_dlg) 11 | { 12 | m_dlg = new VariableTableDlg(this,parent); 13 | m_dlg->InitUI(); 14 | } 15 | if( QDialog::Accepted == m_dlg->exec()) 16 | { 17 | return m_dlg->GetSelect().toLocal8Bit().data(); 18 | } 19 | return ""; 20 | } 21 | 22 | int VariableTable::GetAddrinfoFromVarName(const std::string &sPath, Protocol::AddrInfoForRW &addr) 23 | { 24 | if(!m_dlg) 25 | { 26 | m_dlg = new VariableTableDlg(this,nullptr); 27 | m_dlg->InitUI(); 28 | m_dlg->hide(); 29 | } 30 | QMap::Iterator it = m_varMap.find(sPath); 31 | if(it != m_varMap.end()) 32 | { 33 | addr = it.value(); 34 | return 0; 35 | } 36 | return -1; 37 | } 38 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/VariableTable/VariableTable.h: -------------------------------------------------------------------------------- 1 | #ifndef VARIABLETABLE_H 2 | #define VARIABLETABLE_H 3 | #include 4 | #include "interface_variable_table.h" 5 | 6 | class VariableTableDlg; 7 | class VariableTable : public interface_variable_table 8 | { 9 | friend class VariableTableDlg; 10 | public: 11 | VariableTable(); 12 | virtual ~VariableTable(){} 13 | 14 | //显示模态显示图片选择对话框,返回选择的变量名称 15 | virtual std::string ShowVarSelectDialog(QWidget *parent); 16 | 17 | //通过变量名称获取地址数据 18 | virtual int GetAddrinfoFromVarName(const std::string &sPath,Protocol::AddrInfoForRW &addr); 19 | 20 | private: 21 | VariableTableDlg * m_dlg = nullptr; 22 | QMap m_varMap; 23 | }; 24 | 25 | #endif // VARIABLETABLE_H 26 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/VariableTable/interface_variable_table.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERFACE_VARIABLE_TABLE_H 2 | #define INTERFACE_VARIABLE_TABLE_H 3 | #include 4 | #include "protocol_type.h" 5 | 6 | class QWidget; 7 | class interface_variable_table 8 | { 9 | public: 10 | virtual ~interface_variable_table(){} 11 | 12 | //变量表接口设计 13 | //显示模态显示图片选择对话框,返回选择的变量名称 14 | virtual std::string ShowVarSelectDialog(QWidget *parent) = 0; 15 | 16 | //通过变量名称获取地址数据 17 | virtual int GetAddrinfoFromVarName(const std::string &sPath,Protocol::AddrInfoForRW &addr) = 0; 18 | 19 | }; 20 | 21 | #endif // INTERFACE_VARIABLE_TABLE_H 22 | -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text center.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text down.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text left down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text left down.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text left up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text left up.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text left.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text right down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text right down.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text right up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text right up.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text right.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/Text up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/Text up.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/bottom.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/compile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/compile.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/copy.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/custom item display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/custom item display.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/custom item setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/custom item setting.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/cut.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/delete screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/delete screen.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/delete.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/duplicate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/duplicate.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/edit.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/export.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/gallery.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/group.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/horizontal center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/horizontal center.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/horizontal equidistant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/horizontal equidistant.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/import.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/item save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/item save.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/left.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/lock.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/make same height.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/make same height.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/make same size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/make same size.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/make same width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/make same width.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/move down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/move down.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/move left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/move left.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/move right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/move right.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/move to back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/move to back.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/move to bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/move to bottom.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/move to front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/move to front.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/move to top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/move to top.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/move up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/move up.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/new screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/new screen.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/new.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/open.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/paste.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/property.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/redo.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/reverse select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/reverse select.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/right.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/save.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/saveall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/saveall.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/scene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/scene.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/script.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/search.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/select all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/select all.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/system setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/system setting.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/system.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/top.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/undo.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/ungroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/ungroup.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/unlock.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/variables.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/vertical center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/vertical center.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/vertical equidistant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/vertical equidistant.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/window.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/zoom in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/zoom in.png -------------------------------------------------------------------------------- /UiEdit/UiEdit/image/zoom out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/UiEdit/UiEdit/image/zoom out.png -------------------------------------------------------------------------------- /communication/Communication.cpp: -------------------------------------------------------------------------------- 1 | #include "communicationdef.h" 2 | #include "SerialComm.h" 3 | #include "TcpClient.h" 4 | #include "TcpServer.h" 5 | 6 | ICommunication * CreateComm(ICommunication::Communication_Type type, const std::string &sPar) 7 | { 8 | ICommunication * icomm = nullptr; 9 | switch (type) { 10 | case ICommunication::tcp_client: 11 | { 12 | icomm = new TcpClient(sPar); 13 | } 14 | break; 15 | case ICommunication::tcp_server: 16 | { 17 | icomm = new TcpServer(sPar); 18 | } 19 | break; 20 | case ICommunication::upd: 21 | { 22 | // 23 | } 24 | break; 25 | case ICommunication::serial: 26 | { 27 | icomm = new SerialComm(sPar); 28 | } 29 | break; 30 | } 31 | return icomm; 32 | } 33 | 34 | int CloseCommunication(ICommunication *pCommunication) 35 | { 36 | if(pCommunication) 37 | { 38 | delete pCommunication; 39 | pCommunication = nullptr; 40 | return 0; 41 | } 42 | else 43 | { 44 | return -1; 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /communication/LogService.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGSERVICE_H 2 | #define LOGSERVICE_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "socket/io_log_service.h" 9 | #include "socket/io_util.h" 10 | 11 | class LogService 12 | { 13 | public: 14 | LogService(); 15 | 16 | int32_t OpenLog(const char * LogName,int AscOrDec =0,int OpenType = 2); 17 | int32_t CloseLog(); 18 | int32_t WriteLog(int q_hour, int q_min, int q_sec, int q_msec, 19 | const char *buf1, int len1, const char *fmt, va_list &ap); 20 | 21 | //工具方法 22 | static void win_unix_sleep(unsigned long sec); 23 | static std::vector StringSplit(const std::string &str,const std::string &pattern); 24 | 25 | 26 | private: 27 | io_log_service_t *m_io_log_service; 28 | int m_logFlag = 0; 29 | }; 30 | 31 | #endif // LOGSERVICE_H 32 | -------------------------------------------------------------------------------- /communication/SafeQueue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | // Thread safe implementation of a Queue using an std::queue 7 | template 8 | class SafeQueue { 9 | private: 10 | std::queue m_queue; 11 | std::mutex m_mutex; 12 | public: 13 | SafeQueue() { 14 | 15 | } 16 | 17 | SafeQueue(SafeQueue& other) { 18 | //TODO: 19 | } 20 | 21 | ~SafeQueue() { 22 | 23 | } 24 | 25 | 26 | bool empty() { 27 | std::unique_lock lock(m_mutex); 28 | return m_queue.empty(); 29 | } 30 | 31 | int size() { 32 | std::unique_lock lock(m_mutex); 33 | return m_queue.size(); 34 | } 35 | 36 | void enqueue(T& t) { 37 | std::unique_lock lock(m_mutex); 38 | m_queue.push(t); 39 | } 40 | 41 | bool dequeue(T& t) { 42 | std::unique_lock lock(m_mutex); 43 | 44 | if (m_queue.empty()) { 45 | return false; 46 | } 47 | t = std::move(m_queue.front()); 48 | 49 | m_queue.pop(); 50 | return true; 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /communication/SerialComm.h: -------------------------------------------------------------------------------- 1 | #ifndef SERIALPORT_H 2 | #define SERIALPORT_H 3 | #include "communicationdef.h" 4 | #include "LogService.h" 5 | #include "serialport/SerialPort.h" 6 | using namespace itas109; 7 | #define CACHE_BUFF_MAX (4096) 8 | 9 | class SerialComm : public ICommunication 10 | { 11 | public: 12 | SerialComm(const std::string &sPar); 13 | virtual ~SerialComm(); 14 | 15 | virtual int32_t SendData(char * pBuffer, uint32_t iLength); 16 | 17 | virtual int32_t RecvData(char * pBuffer, int32_t &iLength, uint32_t uiDelayTime); 18 | 19 | virtual int32_t AsynWR(char *sendBuf,int len,const ResponseCallBack &cb, 20 | int readLenMax,int timeout); 21 | 22 | virtual int32_t Reset(); 23 | 24 | virtual int32_t AsynProcess(int32_t iLock = -1); 25 | 26 | virtual int32_t OpenComm(int setnonblock = 0,int Timo = 500, 27 | const ConnectCB &connectCB = nullptr, 28 | const DisconnectCB &disconnectCB = nullptr, 29 | const ReadReadyCB &ReadReadyCB = nullptr); 30 | 31 | virtual int32_t CloseComm(); 32 | 33 | virtual int32_t SetCommInfo(const std::string &sPar); 34 | 35 | virtual int32_t GetCommInfo(std::string &sPar); 36 | 37 | 38 | //日志 39 | virtual int32_t OpenLog(const char * LogName,int AscOrDec =0,int OpenType = 2); 40 | 41 | virtual int32_t CloseLog(); 42 | 43 | int32_t WriteLog(const char *buf, int len, const char *fmt,...); 44 | 45 | private: 46 | LogService m_log; 47 | bool m_bLogFlag; 48 | itas109::CSerialPort * m_SerialPort; 49 | std::string m_strPort; 50 | int32_t m_serialPollingTime; 51 | BaudRate m_baudRate; 52 | DataBits m_dataBits; 53 | Parity m_parity; 54 | StopBits m_stopBits; 55 | FlowControl m_flowControl; 56 | std::string m_sPar; 57 | 58 | bool m_bReady = false; 59 | 60 | //接收缓存 61 | char m_cacheBuff[CACHE_BUFF_MAX] = {0}; 62 | int32_t m_cacheLen = 0; 63 | }; 64 | 65 | #endif // SERIALPORT_H 66 | -------------------------------------------------------------------------------- /communication/UpdComm.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDCOMM_H 2 | #define UPDCOMM_H 3 | #include "communicationdef.h" 4 | #include "LogService.h" 5 | 6 | class UpdComm : public ICommunication 7 | { 8 | public: 9 | UpdComm(); 10 | virtual ~UpdComm(){} 11 | 12 | 13 | virtual int32_t SendData(char * pBuffer, uint32_t iLength); 14 | 15 | virtual int32_t RecvData(char * pBuffer, int32_t &iLength,uint32_t uiDelayTime); 16 | 17 | virtual int32_t AsynWR(char *sendBuf,int len,const ResponseCallBack &cb, 18 | int readLenMax,int timeout); 19 | 20 | virtual int32_t AsynProcess(int32_t iLock = -1); 21 | 22 | virtual int32_t OpenComm(int setnonblock = 0,int Timo = 500, 23 | const ConnectCB &connectCB = nullptr, 24 | const DisconnectCB &disconnectCB = nullptr, 25 | const ReadReadyCB &ReadReadyCB = nullptr); 26 | 27 | virtual int32_t CloseComm(); 28 | 29 | virtual int32_t SetCommInfo(const std::string &sPar); 30 | 31 | virtual int32_t GetCommInfo(std::string &sPar); 32 | 33 | 34 | //日志 35 | virtual int32_t OpenLog(const char * LogName,int AscOrDec =0,int OpenType = 2); 36 | 37 | virtual int32_t CloseLog(); 38 | 39 | int32_t WriteLog(const char *buf, int len, const char *fmt,...); 40 | 41 | private: 42 | LogService m_log; 43 | }; 44 | 45 | #endif // UPDCOMM_H 46 | -------------------------------------------------------------------------------- /communication/communicationglobal.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMUNICATION_GLOBAL_H 2 | #define COMMUNICATION_GLOBAL_H 3 | #include 4 | 5 | #if defined(WIN32) /* { */ 6 | #if defined(COMMUNICATION_LIBRARY) /* { */ 7 | #define _API_COMM extern "C" __declspec(dllexport) 8 | #else 9 | #define _API_COMM extern "C" __declspec(dllimport) 10 | #endif 11 | #else 12 | #define _API_COMM extern 13 | #endif 14 | 15 | 16 | #endif // COMMUNICATION_GLOBAL_H 17 | -------------------------------------------------------------------------------- /communication/serialport/SerialPortBase.cpp: -------------------------------------------------------------------------------- 1 | #include "SerialPortBase.h" 2 | 3 | CSerialPortBase::CSerialPortBase() 4 | { 5 | lastError = 0; 6 | 7 | m_minByteReadNotify = 1; 8 | 9 | m_operateMode = itas109::AsynchronousOperate; 10 | } 11 | 12 | CSerialPortBase::CSerialPortBase(const std::string &portName) 13 | { 14 | lastError = 0; 15 | 16 | m_minByteReadNotify = 1; 17 | 18 | m_operateMode = itas109::AsynchronousOperate; 19 | } 20 | 21 | CSerialPortBase::~CSerialPortBase() {} 22 | 23 | void CSerialPortBase::setOperateMode(itas109::OperateMode operateMode) 24 | { 25 | m_operateMode = operateMode; 26 | } 27 | 28 | unsigned int CSerialPortBase::getMinByteReadNotify() 29 | { 30 | return m_minByteReadNotify; 31 | } 32 | 33 | int CSerialPortBase::getLastError() const 34 | { 35 | return lastError; 36 | } 37 | 38 | void CSerialPortBase::clearError() {} 39 | -------------------------------------------------------------------------------- /communication/serialport/SerialPortInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "SerialPortInfo.h" 2 | 3 | #ifdef I_OS_WIN 4 | #include "SerialPortInfoWinBase.h" 5 | #define CSERIALPORTINFOBASE CSerialPortInfoWinBase 6 | #elif defined I_OS_UNIX 7 | #include "SerialPortInfoUnixBase.h" 8 | #define CSERIALPORTINFOBASE CSerialPortInfoUnixBase 9 | #else 10 | // Not support 11 | #define CSERIALPORTBASE 12 | #endif // I_OS_WIN 13 | 14 | using namespace itas109; 15 | 16 | CSerialPortInfo::CSerialPortInfo() {} 17 | 18 | CSerialPortInfo::~CSerialPortInfo() {} 19 | 20 | vector CSerialPortInfo::availablePortInfos() 21 | { 22 | return CSERIALPORTINFOBASE::availablePortInfos(); 23 | } 24 | -------------------------------------------------------------------------------- /communication/serialport/SerialPortInfo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SerialPortInfo.h 3 | * @author itas109 (itas109@qq.com) \n\n 4 | * Blog : https://blog.csdn.net/itas109 \n 5 | * Github : https://github.com/itas109 \n 6 | * QQ Group : 12951803 7 | * @brief the CSerialPortInfo class 串口信息辅助类 8 | * @date 2020-04-29 9 | * @copyright The CSerialPort is Copyright (C) 2020 itas109. \n 10 | * Contact: itas109@qq.com \n\n 11 | * You may use, distribute and copy the CSerialPort under the terms of \n 12 | * GNU Lesser General Public License version 3, which is displayed below. 13 | */ 14 | #ifndef __CSERIALPORTINFO_H__ 15 | #define __CSERIALPORTINFO_H__ 16 | 17 | #include "SerialPortInfoBase.h" 18 | #include "SerialPort_global.h" 19 | 20 | #include 21 | #include 22 | 23 | namespace itas109 24 | { 25 | /** 26 | * @brief the CSerialPortInfo class 串口信息辅助类 27 | * 28 | */ 29 | class /*DLL_EXPORT*/ CSerialPortInfo 30 | { 31 | public: 32 | /** 33 | * @brief Construct a new CSerialPortInfo object 构造函数 34 | * 35 | */ 36 | CSerialPortInfo(); 37 | /** 38 | * @brief Destroy the CSerialPortInfo object 析构函数 39 | * 40 | */ 41 | ~CSerialPortInfo(); 42 | 43 | /** 44 | * @brief availablePortInfos 获取串口信息列表 45 | * @return return available port infolist 返回可用串口名称列表 46 | */ 47 | static vector availablePortInfos(); 48 | }; 49 | } // namespace itas109 50 | #endif //__CSERIALPORTINFO_H__ 51 | -------------------------------------------------------------------------------- /communication/serialport/SerialPortInfoBase.cpp: -------------------------------------------------------------------------------- 1 | #include "SerialPortInfoBase.h" 2 | 3 | CSerialPortInfoBase::CSerialPortInfoBase() {} 4 | 5 | CSerialPortInfoBase::~CSerialPortInfoBase() {} 6 | -------------------------------------------------------------------------------- /communication/serialport/SerialPortInfoBase.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SerialPortInfoBase.h 3 | * @author itas109 (itas109@qq.com) \n\n 4 | * Blog : https://blog.csdn.net/itas109 \n 5 | * Github : https://github.com/itas109 \n 6 | * QQ Group : 12951803 7 | * @brief the CSerialPortInfo Base class 串口信息辅助类基类 8 | * @date 2020-04-29 9 | * @copyright The CSerialPort is Copyright (C) 2020 itas109. \n 10 | * Contact: itas109@qq.com \n\n 11 | * You may use, distribute and copy the CSerialPort under the terms of \n 12 | * GNU Lesser General Public License version 3, which is displayed below. 13 | */ 14 | #ifndef __CSERIALPORTINFOBASE_H__ 15 | #define __CSERIALPORTINFOBASE_H__ 16 | 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | using namespace std; 23 | 24 | struct SerialPortInfo 25 | { 26 | std::string portName; 27 | std::string description; 28 | }; 29 | 30 | /** 31 | * @brief the CSerialPortInfo Base class 串口信息辅助类基类 32 | * 33 | */ 34 | class CSerialPortInfoBase 35 | { 36 | public: 37 | /** 38 | * @brief Construct a new CSerialPortInfoBase object 构造函数 39 | * 40 | */ 41 | CSerialPortInfoBase(); 42 | /** 43 | * @brief Destroy the CSerialPortInfoBase object 析构函数 44 | * 45 | */ 46 | ~CSerialPortInfoBase(); 47 | 48 | /** 49 | * @brief availablePortInfos 获取串口信息列表 50 | * @return return available port infolist 返回可用串口名称列表 51 | */ 52 | static std::vector availablePortInfos(void); 53 | }; 54 | #endif //__CSERIALPORTINFOBASE_H__ 55 | -------------------------------------------------------------------------------- /communication/serialport/SerialPortInfoUnixBase.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SerialPortInfoUnixBase.h 3 | * @author itas109 (itas109@qq.com) \n\n 4 | * Blog : https://blog.csdn.net/itas109 \n 5 | * Github : https://github.com/itas109 \n 6 | * QQ Group : 12951803 7 | * @brief the CSerialPortInfo unix class unix串口信息辅助类基类 8 | * @todo Not implemented 未实现 9 | * @date 2020-04-29 10 | * @copyright The CSerialPort is Copyright (C) 2020 itas109. \n 11 | * Contact: itas109@qq.com \n\n 12 | * You may use, distribute and copy the CSerialPort under the terms of \n 13 | * GNU Lesser General Public License version 3, which is displayed below. 14 | */ 15 | #ifndef __CSERIALPORTINFOUNIXBASE_H__ 16 | #define __CSERIALPORTINFOUNIXBASE_H__ 17 | 18 | #include "SerialPortInfoBase.h" 19 | 20 | /** 21 | * @brief the CSerialPortInfo unix class unix串口信息辅助类基类 22 | * 23 | */ 24 | class CSerialPortInfoUnixBase : public CSerialPortInfoBase 25 | { 26 | public: 27 | CSerialPortInfoUnixBase(); 28 | ~CSerialPortInfoUnixBase(); 29 | 30 | /** 31 | * @brief availablePortInfos 获取串口信息列表 32 | * @return return available port infolist 返回可用串口名称列表 33 | */ 34 | static std::vector availablePortInfos(); 35 | }; 36 | #endif //__CSERIALPORTINFOUNIXBASE_H__ 37 | -------------------------------------------------------------------------------- /communication/serialport/SerialPortInfoWinBase.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SerialPortInfoWinBase.h 3 | * @author itas109 (itas109@qq.com) \n\n 4 | * Blog : https://blog.csdn.net/itas109 \n 5 | * Github : https://github.com/itas109 \n 6 | * QQ Group : 12951803 7 | * @brief the CSerialPortInfo windows class windows串口信息辅助类基类 8 | * @date 2020-04-29 9 | * @copyright The CSerialPort is Copyright (C) 2020 itas109. \n 10 | * Contact: itas109@qq.com \n\n 11 | * You may use, distribute and copy the CSerialPort under the terms of \n 12 | * GNU Lesser General Public License version 3, which is displayed below. 13 | */ 14 | #ifndef __CSERIALPORTINFOWINBASE_H__ 15 | #define __CSERIALPORTINFOWINBASE_H__ 16 | 17 | #include "SerialPortInfoBase.h" 18 | 19 | /** 20 | * @brief the CSerialPortInfoBase windows class windows串口信息辅助类基类 21 | * @see inherit 继承 CSerialPortInfoBase 22 | * 23 | */ 24 | class CSerialPortInfoWinBase : public CSerialPortInfoBase 25 | { 26 | public: 27 | /** 28 | * @brief Construct a new CSerialPortInfoWinBase object 构造函数 29 | * 30 | */ 31 | CSerialPortInfoWinBase(); 32 | /** 33 | * @brief Destroy the CSerialPortInfoWinBase object 析构函数 34 | * 35 | */ 36 | ~CSerialPortInfoWinBase(); 37 | 38 | /** 39 | * @brief availablePortInfos 获取串口信息列表 40 | * @return return available port infolist 返回可用串口名称列表 41 | */ 42 | static std::vector availablePortInfos(); 43 | }; 44 | #endif //__CSERIALPORTINFOWINBASE_H__ 45 | -------------------------------------------------------------------------------- /communication/socket/io_def.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/communication/socket/io_def.h -------------------------------------------------------------------------------- /communication/socket/io_epoll.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/communication/socket/io_epoll.h -------------------------------------------------------------------------------- /communication/socket/io_log_service.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/communication/socket/io_log_service.cpp -------------------------------------------------------------------------------- /communication/socket/io_log_service.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/communication/socket/io_log_service.h -------------------------------------------------------------------------------- /communication/socket/io_select.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/communication/socket/io_select.cpp -------------------------------------------------------------------------------- /communication/socket/io_select.h: -------------------------------------------------------------------------------- 1 | #ifndef _IOP_SELECT_H_ 2 | #define _IOP_SELECT_H_ 3 | 4 | 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | int io_init_select(void *io_base, int maxev); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif //__Cplusplus 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /communication/socket/io_util.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/communication/socket/io_util.cpp -------------------------------------------------------------------------------- /communication/socket/io_util.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/communication/socket/io_util.h -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/7z.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/7z.dll -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/7z.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/7z.exe -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item000.item: -------------------------------------------------------------------------------- 1 | { 2 | "z_class_name": "combine", 3 | "z_h": 231, 4 | "z_items": [ 5 | { 6 | "off_img": null, 7 | "on_img": null, 8 | "z_class_name": "Bit Button", 9 | "z_h": 96, 10 | "z_w": 271, 11 | "z_x": 113, 12 | "z_y": 3 13 | }, 14 | { 15 | "off_img": null, 16 | "on_img": null, 17 | "z_class_name": "Bit Button", 18 | "z_h": 91, 19 | "z_w": 226, 20 | "z_x": 5, 21 | "z_y": 136 22 | } 23 | ], 24 | "z_w": 391, 25 | "z_x": 759, 26 | "z_y": 420 27 | } 28 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/CustomComponents/test0/item000.png -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item001.item: -------------------------------------------------------------------------------- 1 | { 2 | "z_class_name": "combine", 3 | "z_h": 205, 4 | "z_items": [ 5 | { 6 | "off_img": null, 7 | "on_img": null, 8 | "z_class_name": "Bit Button", 9 | "z_h": 85, 10 | "z_w": 162, 11 | "z_x": 67, 12 | "z_y": 2 13 | }, 14 | { 15 | "off_img": null, 16 | "on_img": null, 17 | "z_class_name": "Bit Button", 18 | "z_h": 81, 19 | "z_w": 135, 20 | "z_x": 3, 21 | "z_y": 121 22 | } 23 | ], 24 | "z_w": 234, 25 | "z_x": 251, 26 | "z_y": 404 27 | } 28 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/CustomComponents/test0/item001.png -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item002.item: -------------------------------------------------------------------------------- 1 | { 2 | "z_class_name": "combine", 3 | "z_h": 205, 4 | "z_items": [ 5 | { 6 | "off_img": null, 7 | "on_img": null, 8 | "z_class_name": "Bit Button", 9 | "z_h": 85, 10 | "z_w": 162, 11 | "z_x": 67, 12 | "z_y": 2 13 | }, 14 | { 15 | "off_img": null, 16 | "on_img": null, 17 | "z_class_name": "Bit Button", 18 | "z_h": 81, 19 | "z_w": 135, 20 | "z_x": 3, 21 | "z_y": 121 22 | } 23 | ], 24 | "z_w": 234, 25 | "z_x": 251, 26 | "z_y": 404 27 | } 28 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/CustomComponents/test0/item002.png -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item003.item: -------------------------------------------------------------------------------- 1 | { 2 | "z_class_name": "combine", 3 | "z_h": 205, 4 | "z_items": [ 5 | { 6 | "off_img": null, 7 | "on_img": null, 8 | "z_class_name": "Bit Button", 9 | "z_h": 85, 10 | "z_w": 162, 11 | "z_x": 67, 12 | "z_y": 2 13 | }, 14 | { 15 | "off_img": null, 16 | "on_img": null, 17 | "z_class_name": "Bit Button", 18 | "z_h": 81, 19 | "z_w": 135, 20 | "z_x": 3, 21 | "z_y": 121 22 | } 23 | ], 24 | "z_w": 234, 25 | "z_x": 251, 26 | "z_y": 404 27 | } 28 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/CustomComponents/test0/item003.png -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item004.item: -------------------------------------------------------------------------------- 1 | { 2 | "z_class_name": "combine", 3 | "z_h": 205, 4 | "z_items": [ 5 | { 6 | "off_img": null, 7 | "on_img": null, 8 | "z_class_name": "Bit Button", 9 | "z_h": 85, 10 | "z_w": 162, 11 | "z_x": 67, 12 | "z_y": 2 13 | }, 14 | { 15 | "off_img": null, 16 | "on_img": null, 17 | "z_class_name": "Bit Button", 18 | "z_h": 81, 19 | "z_w": 135, 20 | "z_x": 3, 21 | "z_y": 121 22 | } 23 | ], 24 | "z_w": 234, 25 | "z_x": 251, 26 | "z_y": 404 27 | } 28 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/CustomComponents/test0/item004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/CustomComponents/test0/item004.png -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/Qt5SerialPort.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/Qt5SerialPort.dll -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/ScriptEditor.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/ScriptEditor.exe -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/glog.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/glog.dll -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/image/test11/off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/image/test11/off.png -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/image/test11/on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/image/test11/on.png -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/lua.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/lua.dll -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/FuncModel_Errcode.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | Battery_Duplicate_Code = “电芯二维码重码#1、有可能是没开扫码枪(连续多次,提示:检查电芯扫码枪是否开启)2、是正常(对于第一次出现提示)” 3 | MaterialBox_Duplicate_Code = “料盒二维码重码获取冲切没有绑定#1、有可能是没开扫码枪(连续多次,提示:检查料盒扫码枪是否开启)2、是正常(对于第一次出现提示)” 4 | Code_Format_Error = “(MES返回)料盒二维码或者电芯二维码格式错误#扫码枪某次触发失败,人为填入二维码,做显示” 5 | Material_Not_Deducted_Enough = “(MES返回)物料不够扣#操作:摁机台复位摁扭可恢复生产” 6 | Mes_Error_Forcedshutdown = “MES返回错误代码forcedshutdown(暂时在B5有)#操作:手动把物料出站,重进进站(根据提示看是否需要换取新的料盒),数据上传成功后再摁机台复位摁扭可恢复生产” 7 | Frequent_MES_Timeouts = “频繁的MES数据上传超时#操作:需要检查内网是否正常” 8 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/communication.d: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "link4", 4 | "Manufacturer": "modbus", 5 | "Device_Name": "modbusRtu", 6 | "CommInfo": { 7 | "commType": 0, 8 | "sCommPar": "COM7-9600-8-N-1-10-0", 9 | "isThread": true, 10 | "isOnline": true, 11 | "isOpenlog": false 12 | }, 13 | "Device_Config": { 14 | "timeout": 200, 15 | "retryTimes": 3, 16 | "communicationInterval": 100, 17 | "bitPackageInterval": 8, 18 | "wordPackageInterval": 16, 19 | "bitPackageMax": 64, 20 | "wordPackageMax": 64, 21 | "station": 1, 22 | "deviceStation": 2, 23 | "masterOrSlave": 0, 24 | "byteOrder16": 1, 25 | "byteOrder32": 0, 26 | "RWThreshold": 3, 27 | "nonstandardParameters": " " 28 | } 29 | } 30 | ] -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/122.scene: -------------------------------------------------------------------------------- 1 | { 2 | "background_color": 14474460, 3 | "background_type": 0, 4 | "h": 400, 5 | "script": null, 6 | "w": 600, 7 | "window": 1, 8 | "x": 400, 9 | "y": 200, 10 | "z_items": [ 11 | { 12 | "background_color": 14474460, 13 | "background_type": 0, 14 | "scene": "1254", 15 | "text": "切换到首页", 16 | "z_class_name": "Scene Button", 17 | "z_h": 69, 18 | "z_w": 232, 19 | "z_x": 136, 20 | "z_y": 87 21 | }, 22 | { 23 | "off_img": "off1", 24 | "on_img": "on0", 25 | "var": "0x1", 26 | "z_class_name": "Bit Button", 27 | "z_h": 75, 28 | "z_w": 141, 29 | "z_x": 113, 30 | "z_y": 200 31 | }, 32 | { 33 | "off_img": "off1", 34 | "on_img": "on0", 35 | "var": "0x2", 36 | "z_class_name": "Bit Button", 37 | "z_h": 75, 38 | "z_w": 141, 39 | "z_x": 257, 40 | "z_y": 202 41 | } 42 | ], 43 | "z_name": "NEW000", 44 | "z_type": 1 45 | } 46 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/157.scene: -------------------------------------------------------------------------------- 1 | { 2 | "background_color": null, 3 | "background_type": null, 4 | "script": null, 5 | "window": null, 6 | "z_items": [ 7 | { 8 | "off_img": "", 9 | "on_img": "", 10 | "var": "0x1", 11 | "z_class_name": "Bit Button", 12 | "z_h": 89, 13 | "z_w": 157, 14 | "z_x": 190, 15 | "z_y": 122 16 | }, 17 | { 18 | "background_color": 43520, 19 | "background_type": 0, 20 | "scene": "1254", 21 | "text": "切换到首页", 22 | "z_class_name": "Scene Button", 23 | "z_h": 55, 24 | "z_w": 112, 25 | "z_x": 213, 26 | "z_y": 39 27 | }, 28 | { 29 | "off_img": "off1", 30 | "on_img": "on0", 31 | "var": "0x1", 32 | "z_class_name": "Bit Button", 33 | "z_h": 71, 34 | "z_w": 64, 35 | "z_x": 142, 36 | "z_y": 117 37 | } 38 | ], 39 | "z_name": "NEW000", 40 | "z_type": 0 41 | } 42 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/CurrentSession: -------------------------------------------------------------------------------- 1 | 124#157#1254 -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/dwad.scene: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/project/scene/dwad.scene -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/dwd.scene: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/project/scene/dwd.scene -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/null.scene: -------------------------------------------------------------------------------- 1 | { 2 | "background_color": 14474460, 3 | "background_type": 0, 4 | "script": null, 5 | "window": 0, 6 | "z_items": [ 7 | { 8 | "off_img": "off.png", 9 | "on_img": "on.png", 10 | "var": "0x1", 11 | "z_class_name": "Bit Button", 12 | "z_h": 266, 13 | "z_w": 423, 14 | "z_x": 341, 15 | "z_y": 360 16 | }, 17 | { 18 | "off_img": "off.png", 19 | "on_img": "on.png", 20 | "var": "0x2", 21 | "z_class_name": "Bit Button", 22 | "z_h": 148, 23 | "z_w": 203, 24 | "z_x": 280, 25 | "z_y": 97 26 | }, 27 | { 28 | "off_img": null, 29 | "on_img": null, 30 | "z_class_name": "Bit Button", 31 | "z_h": 161, 32 | "z_w": 401, 33 | "z_x": 611, 34 | "z_y": 142 35 | } 36 | ], 37 | "z_name": "null.scene", 38 | "z_type": 0 39 | } 40 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/null0.scene: -------------------------------------------------------------------------------- 1 | { 2 | "background_color": null, 3 | "background_type": null, 4 | "window": null, 5 | "z_items": [ 6 | { 7 | "off_img": null, 8 | "on_img": null, 9 | "z_class_name": "Bit Button", 10 | "z_h": 231, 11 | "z_name": "", 12 | "z_w": 443, 13 | "z_x": 363, 14 | "z_y": 92 15 | }, 16 | { 17 | "off_img": null, 18 | "on_img": null, 19 | "z_class_name": "Bit Button", 20 | "z_h": 153, 21 | "z_w": 200, 22 | "z_x": 69, 23 | "z_y": 122 24 | }, 25 | { 26 | "off_img": null, 27 | "on_img": null, 28 | "z_class_name": "Bit Button", 29 | "z_h": 75, 30 | "z_w": 234, 31 | "z_x": 867, 32 | "z_y": 145 33 | }, 34 | { 35 | "z_class_name": "Scene Button", 36 | "z_h": 82, 37 | "z_w": 151, 38 | "z_x": 248, 39 | "z_y": 365 40 | } 41 | ], 42 | "z_name": "NEW000", 43 | "z_type": 0 44 | } 45 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/test0.scene: -------------------------------------------------------------------------------- 1 | { 2 | "z_items": [ 3 | { 4 | "z_class_name": "Bit Button", 5 | "z_h": 202, 6 | "z_name": "", 7 | "z_w": 291, 8 | "z_x": 230, 9 | "z_y": 116 10 | } 11 | ], 12 | "z_name": "test0.scene", 13 | "z_type": 0 14 | } 15 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/scene/test1.scene: -------------------------------------------------------------------------------- 1 | { 2 | "z_items": [ 3 | { 4 | "z_class_name": "Bit Button", 5 | "z_h": 123, 6 | "z_name": "", 7 | "z_w": 243, 8 | "z_x": 59, 9 | "z_y": 46 10 | } 11 | ], 12 | "z_name": "NEW000", 13 | "z_type": 0 14 | } 15 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/script/1223.script: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/project/script/1223.script -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/script/CurrentSession: -------------------------------------------------------------------------------- 1 | Pcyc-c1.script#test111.script#1223.script -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/script/bookmarks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/project/script/bookmarks -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/script/cyc-c1.script: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/project/script/cyc-c1.script -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/script/test111.script: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/project/script/test111.script -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/system.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | #前端插件配置 3 | ui="UiEdit" 4 | 5 | #后台插件配置 6 | backstage = "Script,test1" 7 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/uiInfo.ini: -------------------------------------------------------------------------------- 1 | [Http_Info] 2 | URI_DeviceState=/mes/thirdParty/thirdPartyAPI!doUploadMachineStatus_Change.action 3 | URI_UserMountGuard=/mes/thirdParty/thirdPartyAPI!validateUser_handleMachine.action 4 | URI_ProductionModelInquiry=/mes/thirdParty/thirdPartyAPI!loadShopOrderList.action 5 | URI_LoadMaterial=/mes/thirdParty/thirdPartyAPI!doLoadMaterial.action 6 | URI_DownMaterial=/mes/thirdParty/thirdPartyAPI!doUnLoadMaterial.action 7 | URI_LoadMaterialInfoInquiry=/mes/thirdParty/thirdPartyAPI!doSearchLoadMaterial.action 8 | URI_MaterialBoxEntrystation=/mes/thirdParty/thirdPartyAPI!sfcValidate_dpPullIn.action 9 | URI_BatteryCellsOutstation=/mes/thirdParty/thirdPartyAPI!doSaveData_dp.action 10 | URI_EmptyMaterialBoxUnpinless=/mes/thirdParty/thirdPartyAPI!doUnBindVehicle_dpAfter.action 11 | 12 | [WorkStationParamSelect] 13 | #工位选择(1为左工位,2为右工位) 14 | WorkStation = 1 15 | 16 | #是否开启当MES后台返回错误信息时中断机台的动作,0:不开启、1:开启 17 | [MesErrorInterrupt] 18 | MesErrorInterruptEquipment = 1 19 | 20 | [EquipmentStatus] 21 | #设备停机 写位 (M 1位) 22 | EquipmentShutDown_Addr_Left = "E5B7A6E69CBAE58FB04D4553-E5819CE69CBAE4BFA1E58FB7 , 1" 23 | EquipmentShutDown_Addr_Right = "E58FB3E69CBAE58FB04D4553-E5819CE69CBAE4BFA1E58FB7 , 1" -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/variables/你.vars: -------------------------------------------------------------------------------- 1 | [ 2 | ] 3 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/variables/我.vars: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "变量名": "0x1", 4 | "寄存器": "0x", 5 | "数据类型": 1, 6 | "索引": 1, 7 | "连接名称": "link4", 8 | "长度": 0 9 | }, 10 | { 11 | "变量名": "0x2", 12 | "寄存器": "0x", 13 | "数据类型": 1, 14 | "索引": 2, 15 | "连接名称": "link4", 16 | "长度": 0 17 | }, 18 | { 19 | "变量名": "4x2", 20 | "寄存器": "4x", 21 | "数据类型": 5, 22 | "索引": 2, 23 | "连接名称": "link4", 24 | "长度": 0 25 | }, 26 | { 27 | "变量名": "status0", 28 | "寄存器": "status", 29 | "数据类型": 5, 30 | "索引": 0, 31 | "连接名称": "link4", 32 | "长度": 0 33 | }, 34 | { 35 | "变量名": "status1", 36 | "寄存器": "status", 37 | "数据类型": 5, 38 | "索引": 1, 39 | "连接名称": "link4", 40 | "长度": 0 41 | }, 42 | { 43 | "变量名": "4x10", 44 | "寄存器": "4x", 45 | "数据类型": 5, 46 | "索引": 10, 47 | "连接名称": "link4", 48 | "长度": 0 49 | }, 50 | { 51 | "变量名": "4x1", 52 | "寄存器": "4x", 53 | "数据类型": 5, 54 | "索引": 1, 55 | "连接名称": "link4", 56 | "长度": 0 57 | } 58 | ] 59 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/project/version.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | versionF=1 3 | versionS=3 4 | MD5=dbc42e303cf1108b1d872d347be504aa 5 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/qscintilla2_qt5d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/debug/qscintilla2_qt5d.dll -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/system/script_function/GetValue: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "note": "GetValue\n读取外设指定连接的数据\n linkname:外设连接\n reg:寄存器名称或者标签名\n index:寄存器索引,标签不需要填写\n datatype:数据类型\n value:读的值" 4 | }, 5 | { 6 | "name": "linkname", 7 | "type": 0, 8 | "args": "test0", 9 | "index": 0 10 | }, 11 | { 12 | "name": "reg", 13 | "type": 0, 14 | "args": "test1", 15 | "index": 0 16 | }, 17 | { 18 | "name": "index", 19 | "type": 0, 20 | "args": "test2", 21 | "index": 0 22 | }, 23 | { 24 | "name": "datatype", 25 | "type": 0, 26 | "args": "test2", 27 | "index": 0 28 | }, 29 | { 30 | "name": "value", 31 | "type": 0, 32 | "args": "test2", 33 | "index": 0 34 | } 35 | ] -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/system/script_function/SetValue: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "note": "SetValue\n设置外设指定连接的数据\n linkname:外设连接\n reg:寄存器名称或者标签名\n index:寄存器索引,标签不需要填写\n datatype:数据类型\n value:写入的值" 4 | }, 5 | { 6 | "name": "linkname", 7 | "type": 0, 8 | "args": "test0", 9 | "index": 0 10 | }, 11 | { 12 | "name": "reg", 13 | "type": 0, 14 | "args": "test1", 15 | "index": 0 16 | }, 17 | { 18 | "name": "index", 19 | "type": 0, 20 | "args": "test2", 21 | "index": 0 22 | }, 23 | { 24 | "name": "datatype", 25 | "type": 0, 26 | "args": "test2", 27 | "index": 0 28 | }, 29 | { 30 | "name": "value", 31 | "type": 0, 32 | "args": "test2", 33 | "index": 0 34 | } 35 | ] -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/system/script_function/SetValue1: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "note": "SetValue\n设置外设指定连接的数据\n linkname:外设连接\n reg:寄存器名称或者标签名\n index:寄存器索引,标签不需要填写\n datatype:数据类型\n value:写入的值" 4 | }, 5 | { 6 | "name": "linkname", 7 | "type": 0, 8 | "args": "test0", 9 | "index": 0 10 | }, 11 | { 12 | "name": "reg", 13 | "type": 0, 14 | "args": "test1", 15 | "index": 0 16 | }, 17 | { 18 | "name": "index", 19 | "type": 0, 20 | "args": "test2", 21 | "index": 0 22 | }, 23 | { 24 | "name": "datatype", 25 | "type": 0, 26 | "args": "test2", 27 | "index": 0 28 | }, 29 | { 30 | "name": "value", 31 | "type": 0, 32 | "args": "test2", 33 | "index": 0 34 | } 35 | ] -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/system/systemConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "systemParams": { 3 | "iLogDirMaxSize": 100, 4 | "model": 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /win32-msvc-mes-bin/debug/system/uiProject.json: -------------------------------------------------------------------------------- 1 | { 2 | "loginParams": { 3 | "UserName": "p99990", 4 | "UserPwd": "123456", 5 | "bPassword": true 6 | }, 7 | "systemParams": { 8 | "systemTrayInfo": { 9 | "bQuit": true 10 | }, 11 | "configInfo": { 12 | "sPassword": "123", 13 | "sExportPath": "D:/360极速浏览器X下载/T1.mesConfig", 14 | "sImportPath": "D:/MES_HOST/win32-msvc-mes-bin/T1.mesConfig", 15 | "iLogDirMaxSize": 10 16 | }, 17 | "logQueryInfo": { 18 | "nPageIndex": 2 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /win32-msvc-mes-bin/release/7z.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/release/7z.dll -------------------------------------------------------------------------------- /win32-msvc-mes-bin/release/7z.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/release/7z.exe -------------------------------------------------------------------------------- /win32-msvc-mes-bin/release/lua.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/release/lua.dll -------------------------------------------------------------------------------- /win32-msvc-mes-bin/release/lua.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/release/lua.exp -------------------------------------------------------------------------------- /win32-msvc-mes-bin/release/lua.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanghui-9/ICStudio/48c6e6f5470a799048c43310091d1f97e04e9b1b/win32-msvc-mes-bin/release/lua.lib --------------------------------------------------------------------------------