├── .gitattributes ├── .gitignore ├── CMakeLists.txt ├── CMakeLists.txt.user ├── CMakePresets.json ├── CMakeUserPresets.json ├── Common └── GraphicsFactory │ ├── GraphicsButtonFactory.cpp │ ├── GraphicsButtonFactory.h │ ├── GraphicsChartFactory.cpp │ ├── GraphicsChartFactory.h │ ├── GraphicsFactory.cpp │ ├── GraphicsFactory.h │ ├── GraphicsLabelFactory.cpp │ ├── GraphicsLabelFactory.h │ ├── GraphicsNodeFactory.cpp │ ├── GraphicsNodeFactory.h │ ├── GraphicsPictureBoxFactory.cpp │ ├── GraphicsPictureBoxFactory.h │ ├── GraphicsPortFactory.cpp │ ├── GraphicsPortFactory.h │ ├── GraphicsSwitchButtonFactory.cpp │ ├── GraphicsSwitchButtonFactory.h │ ├── GraphicsTextFactory.cpp │ └── GraphicsTextFactory.h ├── Entity ├── GraphicsItemInfoConfig.cpp ├── GraphicsItemInfoConfig.h ├── GraphicsNodeConnectionControlBlock.cpp ├── GraphicsNodeConnectionControlBlock.h ├── GraphicsNodeControlBlock.cpp └── GraphicsNodeControlBlock.h ├── Globe ├── AudioPlayer.cpp ├── AudioPlayer.h ├── BuiltRunManager.cpp ├── BuiltRunManager.h ├── DataType.h ├── Enum.h ├── GraphicsItemCreator.cpp ├── GraphicsItemCreator.h ├── GraphicsItemManager.cpp ├── GraphicsItemManager.h ├── GraphicsItemParser.cpp ├── GraphicsItemParser.h ├── Loader.cpp ├── Loader.h ├── Map.h ├── PortAssignor.cpp ├── PortAssignor.h ├── RuningConfig.cpp ├── RuningConfig.h ├── Saver.cpp └── Saver.h ├── Graphics ├── Entity │ ├── RubberEntity.cpp │ └── RubberEntity.h ├── GraphicsItem │ ├── GraphicsButton.cpp │ ├── GraphicsButton.h │ ├── GraphicsChart.cpp │ ├── GraphicsChart.h │ ├── GraphicsGroup.cpp │ ├── GraphicsGroup.h │ ├── GraphicsItem.cpp │ ├── GraphicsItem.h │ ├── GraphicsLable.cpp │ ├── GraphicsLable.h │ ├── GraphicsNode.cpp │ ├── GraphicsNode.h │ ├── GraphicsPictureBox.cpp │ ├── GraphicsPictureBox.h │ ├── GraphicsPort.cpp │ ├── GraphicsPort.h │ ├── GraphicsPreviewItem.cpp │ ├── GraphicsPreviewItem.h │ ├── GraphicsSwitchButton.cpp │ ├── GraphicsSwitchButton.h │ ├── GraphicsText.cpp │ ├── GraphicsText.h │ ├── GraphicsTip.cpp │ └── GraphicsTip.h ├── GraphicsLine │ ├── GraphicsLineItem.cpp │ ├── GraphicsLineItem.h │ ├── GraphicsLineItemBeziercurveitem.cpp │ ├── GraphicsLineItemBeziercurveitem.h │ ├── GraphicsRubberLine.cpp │ └── GraphicsRubberLine.h ├── GraphicsView │ ├── Graphicsview.cpp │ └── Graphicsview.h └── Info │ ├── ButtonInfo.cpp │ ├── ButtonInfo.h │ ├── ChartInfo.cpp │ ├── ChartInfo.h │ ├── GroupInfo.cpp │ ├── GroupInfo.h │ ├── ItemInfo.cpp │ ├── ItemInfo.h │ ├── LineInfo.cpp │ ├── LineInfo.h │ ├── NodeInfo.cpp │ ├── NodeInfo.h │ ├── PictureBoxInfo.cpp │ ├── PictureBoxInfo.h │ ├── PortInfo.cpp │ ├── PortInfo.h │ ├── SwitchButtonInfo.cpp │ ├── SwitchButtonInfo.h │ ├── TextInfo.cpp │ ├── TextInfo.h │ ├── labelInfo.cpp │ └── labelInfo.h ├── LICENSE.txt ├── ProjectTemplate ├── 向量和矩阵 │ ├── .description │ ├── .fcp │ ├── .png │ ├── .tag │ ├── config │ │ └── Them │ │ │ ├── 浅色 │ │ │ ├── GraphicsViewConfig.json │ │ │ └── PortColorConfig.json │ │ │ └── 默认 │ │ │ ├── GraphicsViewConfig.json │ │ │ └── PortColorConfig.json │ ├── nodes │ │ ├── 向量 │ │ │ ├── 三维向量分解 │ │ │ └── 三维向量输入 │ │ ├── 显示 │ │ │ ├── 3×3矩阵显示 │ │ │ ├── 三维向量显示 │ │ │ └── 文本 │ │ ├── 矩阵 │ │ │ ├── 3×3矩阵分解向量 │ │ │ ├── 3×3矩阵输入 │ │ │ ├── 4×4矩阵输入 │ │ │ └── 任意矩阵分解 │ │ ├── 程序 │ │ │ ├── 开始 │ │ │ └── 结束 │ │ └── 运算 │ │ │ ├── 向量 │ │ │ ├── 三维向量减 │ │ │ ├── 三维向量加 │ │ │ ├── 三维向量叉乘 │ │ │ └── 三维向量点乘 │ │ │ └── 矩阵 │ │ │ ├── 矩阵乘 │ │ │ ├── 矩阵减 │ │ │ └── 矩阵加 │ └── script │ │ ├── 向量 │ │ ├── 三维向量分解.xs │ │ ├── 三维向量显示.xs │ │ └── 三维向量输入.xs │ │ ├── 矩阵 │ │ ├── 33矩阵分解向量.xs │ │ ├── 33矩阵显示.xs │ │ ├── 33矩阵输入.xs │ │ ├── 44矩阵输入.xs │ │ └── 任意矩阵分解.xs │ │ └── 运算 │ │ ├── 乘.xs │ │ ├── 减.xs │ │ ├── 加.xs │ │ ├── 叉乘.xs │ │ └── 点乘.xs ├── 数字逻辑 │ ├── .description │ ├── .fcp │ ├── .png │ ├── .tag │ ├── Image │ │ ├── and.png │ │ └── image.png │ ├── config │ │ └── Them │ │ │ ├── 浅色 │ │ │ ├── GraphicsViewConfig.json │ │ │ └── PortColorConfig.json │ │ │ └── 默认 │ │ │ ├── GraphicsViewConfig.json │ │ │ └── PortColorConfig.json │ ├── nodes │ │ ├── 器件 │ │ │ ├── J-K触发器 │ │ │ ├── 二路示波器 │ │ │ ├── 四路示波器 │ │ │ ├── 整数01震荡器 │ │ │ ├── 整数自增器 │ │ │ ├── 示波器 │ │ │ └── 翻转器 │ │ ├── 显示 │ │ │ ├── 无背景文本 │ │ │ ├── 红白文本 │ │ │ └── 黑白文本 │ │ ├── 程序 │ │ │ ├── 开始 │ │ │ └── 结束 │ │ ├── 输入 │ │ │ ├── 开关 │ │ │ ├── 真开关 │ │ │ └── 输入 │ │ └── 运算 │ │ │ ├── 与 │ │ │ ├── 与(图形) │ │ │ ├── 乘 │ │ │ ├── 减 │ │ │ ├── 加 │ │ │ ├── 或 │ │ │ ├── 除 │ │ │ └── 非 │ └── script │ │ ├── testscript.xs │ │ ├── 器件 │ │ ├── JK触发器.xs │ │ ├── 整数01震荡器.xs │ │ ├── 整数自增器.xs │ │ └── 翻转器.xs │ │ ├── 实验 │ │ ├── test.xs │ │ └── 计算器.xs │ │ ├── 显示 │ │ ├── 二路示波器.xs │ │ ├── 四路示波器.xs │ │ ├── 折线图.xs │ │ └── 示波器.xs │ │ ├── 输入 │ │ ├── 01输入.xs │ │ ├── Input_1.xs │ │ ├── StringInput.xs │ │ └── 开关.xs │ │ └── 运算 │ │ ├── Add.xs │ │ ├── And.xs │ │ ├── Div.xs │ │ ├── Mul.xs │ │ ├── Not.xs │ │ ├── Or.xs │ │ └── Sub.xs ├── 空模板 │ ├── .description │ ├── .fcp │ ├── .png │ ├── .tag │ ├── config │ │ └── Them │ │ │ ├── 浅色 │ │ │ ├── GraphicsViewConfig.json │ │ │ └── PortColorConfig.json │ │ │ └── 默认 │ │ │ ├── GraphicsViewConfig.json │ │ │ └── PortColorConfig.json │ └── script │ │ ├── testscript.xs │ │ ├── 器件 │ │ ├── JK触发器.xs │ │ ├── 整数01震荡器.xs │ │ ├── 整数自增器.xs │ │ └── 翻转器.xs │ │ ├── 实验 │ │ ├── test.xs │ │ └── 计算器.xs │ │ ├── 显示 │ │ ├── 二路示波器.xs │ │ ├── 四路示波器.xs │ │ ├── 折线图.xs │ │ └── 示波器.xs │ │ ├── 输入 │ │ ├── 01输入.xs │ │ ├── Input_1.xs │ │ ├── StringInput.xs │ │ └── 开关.xs │ │ └── 运算 │ │ ├── Add.xs │ │ ├── And.xs │ │ ├── Div.xs │ │ ├── Mul.xs │ │ ├── Not.xs │ │ ├── Or.xs │ │ └── Sub.xs └── 通用计算 │ ├── .description │ ├── .fcp │ ├── .png │ ├── .tag │ ├── config │ └── Them │ │ ├── 浅色 │ │ ├── GraphicsViewConfig.json │ │ └── PortColorConfig.json │ │ └── 默认 │ │ ├── GraphicsViewConfig.json │ │ └── PortColorConfig.json │ ├── nodes │ ├── 器件 │ │ ├── 01翻转器 │ │ ├── 整数01震荡器 │ │ └── 整数自增器 │ ├── 实验 │ │ ├── 实验节点 │ │ └── 计算器界面设计 │ ├── 显示 │ │ ├── 图表 │ │ │ └── 坐标点图 │ │ └── 文本 │ │ │ ├── 无背景文本 │ │ │ ├── 红白文本 │ │ │ └── 黑白文本 │ ├── 程序 │ │ ├── 开始 │ │ └── 结束 │ ├── 输入 │ │ ├── 字符串输入 │ │ ├── 小数输入 │ │ ├── 开关 │ │ ├── 整数输入 │ │ ├── 比特输入 │ │ └── 逻辑输入 │ └── 运算 │ │ ├── 小数 │ │ ├── 乘 │ │ ├── 减 │ │ ├── 加 │ │ └── 除 │ │ ├── 整数 │ │ ├── 乘 │ │ ├── 减 │ │ ├── 加 │ │ └── 除 │ │ └── 逻辑 │ │ ├── 与 │ │ ├── 或 │ │ └── 非 │ └── script │ ├── testscript.xs │ ├── 器件 │ ├── JK触发器.xs │ ├── 整数01震荡器.xs │ ├── 整数自增器.xs │ └── 翻转器.xs │ ├── 实验 │ ├── test.xs │ └── 计算器.xs │ ├── 显示 │ ├── 二路示波器.xs │ ├── 四路示波器.xs │ ├── 折线图.xs │ └── 示波器.xs │ ├── 输入 │ ├── 01输入.xs │ ├── Input_1.xs │ ├── StringInput.xs │ └── 开关.xs │ └── 运算 │ ├── Add.xs │ ├── And.xs │ ├── Div.xs │ ├── Mul.xs │ ├── Not.xs │ ├── Or.xs │ └── Sub.xs ├── README.md ├── Resource ├── HelpPage │ ├── Pages │ │ └── Softwareinterface.html │ ├── imgs │ │ ├── de.png │ │ ├── g.png │ │ ├── how.png │ │ ├── label.png │ │ ├── logo.png │ │ └── use.png │ ├── index.html │ └── style.css ├── Resource.qrc ├── Script │ └── Int_Add.x └── icon │ ├── button.png │ ├── chart.png │ ├── check.png │ ├── clock.png │ ├── clsoe.png │ ├── code.png │ ├── copy.png │ ├── delete.png │ ├── deleteLine.png │ ├── deleteLine.psd │ ├── deleteNode.png │ ├── deleteNode.psd │ ├── edit.png │ ├── folder.png │ ├── help.png │ ├── json.png │ ├── label.png │ ├── logo.png │ ├── new.png │ ├── node.png │ ├── nodes.png │ ├── paste.png │ ├── photo.jpg │ ├── picture.png │ ├── picturebox.png │ ├── port.png │ ├── radiobutton_false.png │ ├── radiobutton_true.png │ ├── rename.png │ ├── run.png │ ├── runonce.png │ ├── save.png │ ├── saveAs.png │ ├── select.png │ ├── select.psd │ ├── setting.png │ ├── stop.png │ ├── switch.png │ ├── switch_close.png │ ├── switch_open.png │ ├── 未标题-1.psd │ └── 未标题ss-1.psd ├── Script ├── CodeLine.cpp ├── CodeLine.h ├── Handle │ ├── ExpressionParser.cpp │ ├── ExpressionParser.h │ └── Functions │ │ ├── ChartFunction.h │ │ ├── MathFunction.h │ │ └── NetWorkFunction.h ├── ScriptObject.cpp └── ScriptObject.h ├── UI ├── Editor │ ├── MainWindow.cpp │ ├── MainWindow.h │ └── MainWindow.ui ├── Launcher │ ├── CreatNewProject.cpp │ ├── CreatNewProject.h │ ├── CreatNewProject.ui │ ├── Launcher.cpp │ ├── Launcher.h │ └── Launcher.ui └── Widgets │ ├── CodeEditor │ ├── CodeEditor.cpp │ ├── CodeEditor.h │ ├── Highlighter.cpp │ └── Highlighter.h │ ├── NodeTreeWidget.cpp │ ├── NodeTreeWidget.h │ └── ToolWidget │ ├── ProjectItem.cpp │ ├── ProjectItem.h │ ├── ProjectItem.ui │ ├── SettingWidget.cpp │ ├── SettingWidget.h │ ├── SettingWidget.ui │ ├── TemplateItemWidget.cpp │ ├── TemplateItemWidget.h │ ├── TemplateItemWidget.ui │ ├── nodeeditorwidget.cpp │ ├── nodeeditorwidget.h │ └── nodeeditorwidget.ui ├── Utility ├── InterpreterUtility │ ├── Interpreter.cpp │ └── Interpreter.h └── JsonUtility │ ├── JsonUtility.cpp │ └── JsonUtility.h ├── main.cpp ├── qtpropertybrowser ├── images │ ├── cursor-arrow.png │ ├── cursor-busy.png │ ├── cursor-closedhand.png │ ├── cursor-cross.png │ ├── cursor-forbidden.png │ ├── cursor-hand.png │ ├── cursor-hsplit.png │ ├── cursor-ibeam.png │ ├── cursor-openhand.png │ ├── cursor-sizeall.png │ ├── cursor-sizeb.png │ ├── cursor-sizef.png │ ├── cursor-sizeh.png │ ├── cursor-sizev.png │ ├── cursor-uparrow.png │ ├── cursor-vsplit.png │ ├── cursor-wait.png │ └── cursor-whatsthis.png ├── qtbuttonpropertybrowser.cpp ├── qtbuttonpropertybrowser.h ├── qteditorfactory.cpp ├── qteditorfactory.h ├── qtgroupboxpropertybrowser.cpp ├── qtgroupboxpropertybrowser.h ├── qtpropertybrowser.cpp ├── qtpropertybrowser.h ├── qtpropertybrowserutils.cpp ├── qtpropertybrowserutils_p.h ├── qtpropertymanager.cpp ├── qtpropertymanager.h ├── qttreepropertybrowser.cpp ├── qttreepropertybrowser.h ├── qtvariantproperty.cpp └── qtvariantproperty.h ├── testwidget.cpp └── testwidget.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | /.vs 34 | /.release 35 | /build 36 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "hidden": true, 6 | "name": "Qt", 7 | "cacheVariables": { 8 | "CMAKE_PREFIX_PATH": "$env{QTDIR}" 9 | }, 10 | "vendor": { 11 | "qt-project.org/Qt": { 12 | "checksum": "wVa86FgEkvdCTVp1/nxvrkaemJc=" 13 | } 14 | } 15 | } 16 | ], 17 | "vendor": { 18 | "qt-project.org/Presets": { 19 | "checksum": "67SmY24ZeVbebyKD0fGfIzb/bGI=" 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /CMakeUserPresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "Qt-Debug", 6 | "inherits": "Qt-Default", 7 | "binaryDir": "${sourceDir}/build/Desktop_Qt_6_7_0_MSVC2019_64bit-Debug", 8 | "cacheVariables": { 9 | "CMAKE_BUILD_TYPE": "Debug", 10 | "CMAKE_CXX_FLAGS": "-DQT_QML_DEBUG" 11 | }, 12 | "environment": { 13 | "QML_DEBUG_ARGS": "-qmljsdebugger=file:{71d90414-4b6a-4545-8a18-32cd83c2ad6b},block" 14 | } 15 | }, 16 | { 17 | "name": "Qt-Release", 18 | "inherits": "Qt-Default", 19 | "binaryDir": "${sourceDir}/build/Desktop_Qt_6_7_0_MSVC2019_64bit-Release", 20 | "cacheVariables": { 21 | "CMAKE_BUILD_TYPE": "Release" 22 | } 23 | }, 24 | { 25 | "hidden": true, 26 | "name": "Qt-Default", 27 | "inherits": "6.7.0_msvc2019_64", 28 | "vendor": { 29 | "qt-project.org/Default": { 30 | "checksum": "/LIi1Qk9rOuZl7aAva45VvwngbI=" 31 | } 32 | } 33 | }, 34 | { 35 | "hidden": true, 36 | "name": "6.7.0_msvc2019_64", 37 | "inherits": "Qt", 38 | "environment": { 39 | "QTDIR": "C:/Qt/6.7.0/msvc2019_64" 40 | }, 41 | "architecture": { 42 | "strategy": "external", 43 | "value": "x64" 44 | }, 45 | "generator": "Ninja", 46 | "vendor": { 47 | "qt-project.org/Version": { 48 | "checksum": "H850eNW9oioryPimaUfNGEn6ZfM=" 49 | } 50 | } 51 | } 52 | ], 53 | "vendor": { 54 | "qt-project.org/Presets": { 55 | "checksum": "IZL+30WBOd+5w4ByoueQvf6zWBI=" 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsButtonFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsButtonFactory.h" 2 | 3 | namespace Common { 4 | GraphicsButtonFactory::GraphicsButtonFactory(ButtonInfo info) :info(info) 5 | { 6 | } 7 | GraphicsButtonFactory::~GraphicsButtonFactory() 8 | { 9 | } 10 | QGraphicsItem* GraphicsButtonFactory::CreatSelfGraphicsItem() 11 | { 12 | return new GraphicsButton(info); 13 | } 14 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsButtonFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"GraphicsFactory.h" 3 | #include"../../Graphics/GraphicsItem/GraphicsSwitchButton.h" 4 | #include"../../Graphics/Info/ButtonInfo.h" 5 | 6 | #include"../../Graphics/GraphicsItem/GraphicsButton.h" 7 | namespace Common { 8 | class GraphicsButtonFactory :public GraphicsFactory 9 | { 10 | public: 11 | GraphicsButtonFactory(ButtonInfo info); 12 | ~GraphicsButtonFactory(); 13 | 14 | ButtonInfo info; 15 | 16 | // 通过 GraphicsFactory 继承 17 | QGraphicsItem* CreatSelfGraphicsItem() override; 18 | }; 19 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsChartFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsChartFactory.h" 2 | 3 | namespace Common { 4 | GraphicsChartFactory::GraphicsChartFactory(ChartInfo info) :info(info) 5 | { 6 | 7 | } 8 | GraphicsChartFactory::~GraphicsChartFactory() 9 | { 10 | 11 | } 12 | QGraphicsItem* GraphicsChartFactory::CreatSelfGraphicsItem() 13 | { 14 | return new GraphicsChart(info); 15 | } 16 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsChartFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"../../Graphics/GraphicsItem/GraphicsPort.h" 3 | #include"../../Graphics/Info/PortInfo.h" 4 | #include"../../Graphics/Info/NodeInfo.h" 5 | #include"../../Graphics/Info/TextInfo.h" 6 | #include"../../Graphics/Info/ButtonInfo.h" 7 | #include"../../Graphics/Info/ChartInfo.h" 8 | #include"../../Graphics/GraphicsItem/GraphicsChart.h" 9 | #include"../../Graphics/GraphicsItem/GraphicsSwitchButton.h" 10 | #include"GraphicsFactory.h" 11 | namespace Common { 12 | class GraphicsChartFactory :public GraphicsFactory 13 | { 14 | public: 15 | GraphicsChartFactory(ChartInfo info = {}); 16 | ~GraphicsChartFactory(); 17 | 18 | // 通过 GraphicsFactory 继承 19 | QGraphicsItem* CreatSelfGraphicsItem() override; 20 | ChartInfo info; 21 | }; 22 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsFactory.h" 2 | 3 | namespace Common { 4 | QGraphicsItem* GraphicsFactory::GetGraphicsItem() 5 | { 6 | //主控件 7 | QGraphicsItem* self = CreatSelfGraphicsItem(); 8 | //子控件 9 | for (auto sub : SubFactory) 10 | { 11 | if (sub) 12 | { 13 | QGraphicsItem* subitem = sub->CreatSelfGraphicsItem(); 14 | //设置子控件不可移动 15 | subitem->setFlag(QGraphicsItem::ItemIsMovable, false); 16 | //设置子控件不选中 17 | subitem->setFlag(QGraphicsItem::ItemIsSelectable, false); 18 | subitem->setParentItem(self); 19 | } 20 | } 21 | return self; 22 | } 23 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"../../Graphics/GraphicsItem/GraphicsItem.h" 3 | #include 4 | using namespace::GraphicsModule; 5 | namespace Common { 6 | class GraphicsFactory 7 | { 8 | public: 9 | QGraphicsItem* GetGraphicsItem(); 10 | QListSubFactory;//子工厂 11 | private: 12 | virtual QGraphicsItem* CreatSelfGraphicsItem() = 0; 13 | }; 14 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsLabelFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsLabelFactory.h" 2 | 3 | namespace Common { 4 | GraphicsLabelFactory::GraphicsLabelFactory(LabelInfo info) :Info(info) 5 | { 6 | } 7 | QGraphicsItem* GraphicsLabelFactory::CreatSelfGraphicsItem() 8 | { 9 | return new GraphicsLabel(Info); 10 | } 11 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsLabelFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include"GraphicsFactory.h" 4 | #include"../../Graphics/GraphicsItem/GraphicsLable.h" 5 | #include"../../Graphics/Info/LabelInfo.h" 6 | 7 | namespace Common { 8 | class GraphicsLabelFactory :public GraphicsFactory 9 | { 10 | public: 11 | GraphicsLabelFactory(LabelInfo info); 12 | // 通过 GraphicsFactory 继承 13 | QGraphicsItem* CreatSelfGraphicsItem() override; 14 | LabelInfo Info; 15 | }; 16 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsNodeFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsNodeFactory.h" 2 | 3 | namespace Common { 4 | 5 | 6 | GraphicsNodeFactory::GraphicsNodeFactory(NodeInfo info) 7 | :info(info) 8 | { 9 | 10 | 11 | } 12 | 13 | GraphicsNodeFactory::~GraphicsNodeFactory() 14 | {} 15 | QGraphicsItem* GraphicsNodeFactory::CreatSelfGraphicsItem() 16 | { 17 | return new GraphicsNode(info); 18 | } 19 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsNodeFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include"GraphicsFactory.h" 5 | #include"../../Graphics/GraphicsItem/GraphicsNode.h" 6 | #include"../../Graphics/Info/NodeInfo.h" 7 | namespace Common { 8 | class GraphicsNodeFactory :public GraphicsFactory 9 | { 10 | 11 | public: 12 | GraphicsNodeFactory(NodeInfo info = {}); 13 | ~GraphicsNodeFactory(); 14 | // 通过 GraphicsFactory 继承 15 | QGraphicsItem* CreatSelfGraphicsItem() override; 16 | NodeInfo info; 17 | 18 | }; 19 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsPictureBoxFactory.cpp: -------------------------------------------------------------------------------- 1 | #include"GraphicsPictureBoxFactory.h" 2 | 3 | 4 | namespace Common { 5 | GraphicsPictureBoxFactory::GraphicsPictureBoxFactory(PictureBoxInfo info) :info(info) 6 | { 7 | } 8 | QGraphicsItem* GraphicsPictureBoxFactory::CreatSelfGraphicsItem() 9 | { 10 | return new GraphicsPictureBox(info); 11 | } 12 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsPictureBoxFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"GraphicsFactory.h" 3 | #include"../../Graphics/GraphicsItem/GraphicsPictureBox.h" 4 | #include"../../Graphics/Info/PictureBoxInfo.h" 5 | namespace Common 6 | { 7 | class GraphicsPictureBoxFactory :public GraphicsFactory 8 | { 9 | public: 10 | GraphicsPictureBoxFactory(PictureBoxInfo info = PictureBoxInfo{}); 11 | 12 | // 通过 GraphicsFactory 继承 13 | QGraphicsItem* CreatSelfGraphicsItem() override; 14 | 15 | PictureBoxInfo info; 16 | }; 17 | 18 | 19 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsPortFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsNodeFactory.h" 2 | #include "GraphicsPortFactory.h" 3 | 4 | namespace Common { 5 | 6 | GraphicsPortFactory::GraphicsPortFactory(PortInfo info) :info(info) 7 | { 8 | } 9 | 10 | GraphicsPortFactory::~GraphicsPortFactory() 11 | {} 12 | 13 | QGraphicsItem* GraphicsPortFactory::CreatSelfGraphicsItem() 14 | { 15 | return new GraphicsPort(info); 16 | } 17 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsPortFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"GraphicsFactory.h" 3 | 4 | #include"../../Graphics/GraphicsItem/GraphicsPort.h" 5 | #include"../../Graphics/Info/PortInfo.h" 6 | 7 | namespace Common { 8 | class GraphicsPortFactory :public GraphicsFactory 9 | { 10 | public: 11 | GraphicsPortFactory(PortInfo info = PortInfo{}); 12 | ~GraphicsPortFactory(); 13 | // 通过 GraphicsFactory 继承 14 | QGraphicsItem* CreatSelfGraphicsItem() override; 15 | PortInfo info; 16 | }; 17 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsSwitchButtonFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsSwitchButtonFactory.h" 2 | 3 | namespace Common { 4 | GraphicsSwitchButtonFactory::GraphicsSwitchButtonFactory(SwitchButtonInfo info) :info(info) 5 | {} 6 | 7 | GraphicsSwitchButtonFactory::~GraphicsSwitchButtonFactory() 8 | {} 9 | 10 | QGraphicsItem* GraphicsSwitchButtonFactory::CreatSelfGraphicsItem() 11 | { 12 | return new GraphicsSwitchButton(info); 13 | } 14 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsSwitchButtonFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"GraphicsFactory.h" 3 | #include"../../Graphics/GraphicsItem/GraphicsSwitchButton.h" 4 | #include"../../Graphics/Info/SwitchButtonInfo.h" 5 | 6 | namespace Common { 7 | class GraphicsSwitchButtonFactory :public GraphicsFactory 8 | { 9 | public: 10 | GraphicsSwitchButtonFactory(SwitchButtonInfo info = SwitchButtonInfo{}); 11 | ~GraphicsSwitchButtonFactory(); 12 | 13 | // 通过 GraphicsFactory 继承 14 | QGraphicsItem* CreatSelfGraphicsItem() override; 15 | 16 | SwitchButtonInfo info; 17 | }; 18 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsTextFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsTextFactory.h" 2 | namespace Common { 3 | GraphicsTextFactory::GraphicsTextFactory(TextInfo info) :info(info) 4 | { 5 | 6 | 7 | } 8 | 9 | GraphicsTextFactory::~GraphicsTextFactory() 10 | {} 11 | 12 | QGraphicsItem* GraphicsTextFactory::CreatSelfGraphicsItem() 13 | { 14 | return new GraphicsText(info); 15 | } 16 | } -------------------------------------------------------------------------------- /Common/GraphicsFactory/GraphicsTextFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"GraphicsFactory.h" 3 | 4 | #include"../../Graphics/GraphicsItem/GraphicsText.h" 5 | #include"../../Graphics/Info/TextInfo.h" 6 | namespace Common { 7 | class GraphicsTextFactory :public GraphicsFactory 8 | { 9 | public: 10 | GraphicsTextFactory(TextInfo info = TextInfo{}); 11 | ~GraphicsTextFactory(); 12 | 13 | // 通过 GraphicsFactory 继承 14 | QGraphicsItem* CreatSelfGraphicsItem() override; 15 | TextInfo info; 16 | }; 17 | } -------------------------------------------------------------------------------- /Entity/GraphicsItemInfoConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../Graphics/GraphicsItem/GraphicsItem.h" 4 | #include "../Graphics/Info/ItemInfo.h" 5 | #include "../Graphics/Info/NodeInfo.h" 6 | #include "../Graphics/Info/PortInfo.h" 7 | #include "../Graphics/Info/GroupInfo.h" 8 | #include "../Graphics/Info/GroupInfo.h" 9 | #include "../Graphics/Info/LineInfo.h" 10 | #include "../Graphics/Info/SwitchButtonInfo.h" 11 | #include "../Graphics/Info/PictureBoxInfo.h" 12 | #include "../Graphics/Info/TextInfo.h" 13 | #include "../Graphics/Info/LabelInfo.h" 14 | 15 | #include"../Common/GraphicsFactory/GraphicsPortFactory.h" 16 | #include"../Common/GraphicsFactory/GraphicsNodeFactory.h" 17 | #include"../Common/GraphicsFactory/GraphicsTextFactory.h" 18 | #include"../Common/GraphicsFactory/GraphicsSwitchButtonFactory.h" 19 | #include"../Common/GraphicsFactory/GraphicsFactory.h" 20 | #include"../Common/GraphicsFactory/GraphicsChartFactory.h" 21 | #include"../Common/GraphicsFactory/GraphicsButtonFactory.h" 22 | #include"../Common/GraphicsFactory/GraphicsPictureBoxFactory.h" 23 | #include"../Common/GraphicsFactory/GraphicsLabelFactory.h" 24 | 25 | #include"../Utility/JsonUtility/JsonUtility.h" 26 | #include"../Globe/Enum.h" 27 | #include 28 | 29 | using namespace::Common; 30 | using namespace::Utility; 31 | using namespace::GraphicsModule; 32 | namespace Entity { 33 | class GraphicsItemInfoConfig 34 | { 35 | public: 36 | GraphicsItemInfoConfig(QString fonfigfilepath); 37 | GraphicsItemInfoConfig(QJsonObject jsondoc); 38 | 39 | GraphicsFactory* GetConfigFactory(); 40 | 41 | private: 42 | GraphicsFactory* GenerateControlFactory(QString controlInfoStr); 43 | QString m_itemconfigstr; 44 | GraphicsFactory* factory{ nullptr }; 45 | 46 | }; 47 | } -------------------------------------------------------------------------------- /Entity/GraphicsNodeConnectionControlBlock.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsNodeConnectionControlBlock.h" 2 | namespace Entity { 3 | GraphicsNodeConnectionControlBlock::GraphicsNodeConnectionControlBlock() 4 | { 5 | } 6 | GraphicsNodeConnectionControlBlock::GraphicsNodeConnectionControlBlock 7 | (GraphicsNodeControlBlock Block1, GraphicsNodeControlBlock Block2, 8 | GraphicsPort* port1, GraphicsPort* port2) :Block1(Block1), 9 | Block2(Block2), Block1_Port(port1), Block2_Port(port2) 10 | { 11 | 12 | 13 | } 14 | 15 | bool GraphicsNodeConnectionControlBlock::operator==(GraphicsNodeConnectionControlBlock& GNCCB) 16 | { 17 | if (GNCCB.Block1.GetNode() == Block1.GetNode() && 18 | GNCCB.Block2.GetNode() == Block2.GetNode() && 19 | GNCCB.Block1_Port == Block1_Port && GNCCB.Block2_Port == Block2_Port) 20 | { 21 | return true; 22 | } 23 | 24 | return false; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /Entity/GraphicsNodeConnectionControlBlock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"GraphicsNodeControlBlock.h" 3 | #include"../Graphics/GraphicsItem/GraphicsPort.h" 4 | using namespace GraphicsModule; 5 | namespace Entity { 6 | class GraphicsNodeConnectionControlBlock 7 | { 8 | public: 9 | GraphicsNodeConnectionControlBlock(); 10 | GraphicsNodeConnectionControlBlock(GraphicsNodeControlBlock Block1, 11 | GraphicsNodeControlBlock Block2, GraphicsPort*port1, GraphicsPort*port2); 12 | 13 | 14 | 15 | GraphicsNodeControlBlock Block1{}; 16 | GraphicsNodeControlBlock Block2{}; 17 | 18 | GraphicsPort* Block1_Port{}; 19 | GraphicsPort* Block2_Port{}; 20 | bool operator==(GraphicsNodeConnectionControlBlock& GNCCB); 21 | 22 | 23 | }; 24 | } -------------------------------------------------------------------------------- /Globe/AudioPlayer.cpp: -------------------------------------------------------------------------------- 1 | #include "AudioPlayer.h" 2 | 3 | namespace Globe { 4 | void AudioPlayer::Play(AudioType audio) 5 | { 6 | if (RuningConfig::AudioAllowPlay) 7 | { 8 | AudioPlayerThread* playerThread = new AudioPlayerThread(audio); 9 | playerThread->start(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Globe/AudioPlayer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include"../Globe/Enum.h" 6 | #include"../Globe/Map.h" 7 | namespace Globe { 8 | class AudioPlayer 9 | { 10 | public: 11 | class AudioPlayerThread :public QThread { 12 | public: 13 | AudioPlayerThread(AudioType audio) 14 | { 15 | player->setAudioOutput(audioOutput); 16 | QUrl url(Map::AudioMap[audio]); 17 | player->setSource(url); 18 | }; 19 | void run()override 20 | { 21 | player->play(); 22 | connect(player, &QMediaPlayer::mediaStatusChanged, this, 23 | [this](QMediaPlayer::MediaStatus status) { 24 | if (status == QMediaPlayer::EndOfMedia || status == QMediaPlayer::InvalidMedia) { 25 | delete player; 26 | delete audioOutput; 27 | this->quit(); // 请求线程退出 28 | } 29 | }); 30 | exec(); // 进入事件循环,等待信号和槽的处理 31 | } 32 | private: 33 | QMediaPlayer* player{ new QMediaPlayer{} }; 34 | QAudioOutput* audioOutput{ new QAudioOutput{}}; 35 | }; 36 | 37 | static void Play(AudioType audio); 38 | }; 39 | } -------------------------------------------------------------------------------- /Globe/Enum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace Globe { 3 | 4 | //端口类型 5 | enum PortType 6 | { 7 | DataInput, 8 | DataOutput, 9 | TriggerInput, 10 | TriggerOutput, 11 | ProgramControlInput, 12 | ProgramControlOutput 13 | }; 14 | //图表类型 15 | enum ChartType { 16 | SquareWave,//方波 17 | Straight,//正常直线折现 18 | BesselCurve,//贝塞尔曲线 19 | ColumnChart,//柱形图 20 | PieChart//饼图 21 | }; 22 | 23 | //线类型 24 | enum LineType { 25 | StraightLine,//直线 26 | BezierLine,//贝塞尔 27 | Polyline,//折线 28 | }; 29 | 30 | 31 | //端口数据类型 32 | enum PortDataType 33 | { 34 | Int, 35 | Float, 36 | Bool, 37 | String, 38 | Bit, 39 | Vector, 40 | Matrix 41 | 42 | }; 43 | 44 | //图元类型 45 | enum GraphicsItemType { 46 | Null, 47 | Start, 48 | Node, 49 | Chart, 50 | Button, 51 | SwitchButton, 52 | Text, 53 | Line, 54 | Group, 55 | Port, 56 | PictureBox, 57 | Label, 58 | 59 | }; 60 | 61 | //错误码 62 | enum ErrorCode 63 | { 64 | 65 | 66 | }; 67 | 68 | //工具枚举 69 | enum ToolType 70 | { 71 | Select, 72 | DeleteLine, 73 | DeleteNode 74 | }; 75 | 76 | //音频枚举 77 | enum AudioType 78 | { 79 | Built, 80 | Delete, 81 | Connect, 82 | Run, 83 | }; 84 | } -------------------------------------------------------------------------------- /Globe/GraphicsItemCreator.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsItemCreator.h" 2 | using namespace::Globe; 3 | namespace Globe { 4 | GraphicsItemCreator* GraphicsItemCreator::getInstance() 5 | { 6 | if (!instance) { 7 | instance.reset(new GraphicsItemCreator()); 8 | } 9 | return instance.get(); 10 | } 11 | 12 | QGraphicsItem* GraphicsItemCreator::CreatGraphicsItem(GraphicsItemInfoConfig configInfo) 13 | { 14 | GraphicsFactory* factory = configInfo.GetConfigFactory(); 15 | if (factory) 16 | { 17 | return factory->GetGraphicsItem(); 18 | } 19 | return nullptr; 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /Globe/GraphicsItemCreator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "../Graphics/GraphicsItem/GraphicsItem.h" 5 | #include"../Common/GraphicsFactory/GraphicsFactory.h" 6 | #include"../Entity/GraphicsItemInfoConfig.h" 7 | using namespace::GraphicsModule; 8 | using namespace::Entity; 9 | /// 10 | /// 11 | /// 2024.3.15 By XiaoYongYang 12 | /// 13 | /// GraphicsItemCreator 类是一个用于创建 GraphicsItem 实例的单例类。 14 | /// 它实现了单例模式,确保在整个应用程序中只存在一个 GraphicsItemCreator 实例, 15 | /// 并提供全局访问点 getInstance() 来获取该实例。 16 | /// 17 | 18 | namespace Globe { 19 | class GraphicsItemCreator 20 | { 21 | private: 22 | inline static std::unique_ptr instance{nullptr}; 23 | GraphicsItemCreator() = default; 24 | GraphicsItemCreator(const GraphicsItemCreator&) = delete; 25 | public: 26 | static GraphicsItemCreator* getInstance(); 27 | QGraphicsItem* CreatGraphicsItem(GraphicsItemInfoConfig configInfo); 28 | 29 | }; 30 | } -------------------------------------------------------------------------------- /Globe/GraphicsItemParser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Globe/GraphicsItemParser.cpp -------------------------------------------------------------------------------- /Globe/GraphicsItemParser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../Graphics/GraphicsItem/GraphicsItem.h" 4 | #include"../Common/GraphicsFactory/GraphicsFactory.h" 5 | #include"../Entity/GraphicsItemInfoConfig.h" 6 | using namespace::GraphicsModule; 7 | using namespace::Entity; 8 | namespace Globe { 9 | class GraphicsItemParser 10 | { 11 | public: 12 | static QJsonObject GraphicsItemToJsonObject(GraphicsItem *item); 13 | static QJsonObject GraphicsItemToJsonObject(GraphicsText* text); 14 | }; 15 | } -------------------------------------------------------------------------------- /Globe/Loader.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Globe/Loader.cpp -------------------------------------------------------------------------------- /Globe/Loader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include"../Utility/JsonUtility/JsonUtility.h" 5 | #include"Enum.h" 6 | #include"../Graphics/GraphicsView/Graphicsview.h" 7 | #include"GraphicsItemParser.h" 8 | 9 | using namespace::GraphicsModule; 10 | using namespace::Utility; 11 | namespace Globe { 12 | class Loader 13 | { 14 | public: 15 | static void LoadView(GraphicsView *view); 16 | }; 17 | } -------------------------------------------------------------------------------- /Globe/PortAssignor.cpp: -------------------------------------------------------------------------------- 1 | #include "PortAssignor.h" 2 | 3 | namespace Globe { 4 | QString PortAssignor::PortValueParsing(PortDataType dataType, QVariant var) 5 | { 6 | QString result{ "NULL" }; 7 | switch (dataType) 8 | { 9 | case Globe::Int: 10 | result = QString::number(var.toInt()); 11 | break; 12 | case Globe::Float: 13 | result = QString::number(var.toDouble()); 14 | break; 15 | case Globe::Bool: 16 | result = QString::number(var.toDouble()); 17 | break; 18 | case Globe::String: 19 | result = var.toString(); 20 | break; 21 | case Globe::Vector: 22 | { 23 | QList dat = var.value().data; 24 | result = "Vec" + QString::number(dat.count()); 25 | }break; 26 | case Globe::Matrix: 27 | { 28 | Matrix_Type Matrixdat = var.value(); 29 | if (Matrixdat.data.count() > 0) 30 | { 31 | if (Matrixdat.data[0].data.count() > 0) 32 | { 33 | result = "Mat" + QString::number(Matrixdat.data.count()) 34 | + "*" 35 | + QString::number(Matrixdat.data[0].data.count()); 36 | } 37 | } 38 | 39 | 40 | 41 | } 42 | break; 43 | default: result = var.toString(); 44 | break; 45 | } 46 | 47 | return result; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Globe/PortAssignor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"Enum.h" 3 | #include"DataType.h" 4 | #include 5 | #include 6 | namespace Globe { 7 | class PortAssignor 8 | { 9 | public: 10 | static QString PortValueParsing(PortDataType dataType, QVariant var); 11 | 12 | }; 13 | } -------------------------------------------------------------------------------- /Globe/RuningConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "RuningConfig.h" 2 | namespace Globe { 3 | 4 | } 5 | -------------------------------------------------------------------------------- /Globe/Saver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Globe/Saver.cpp -------------------------------------------------------------------------------- /Globe/Saver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Globe/Saver.h -------------------------------------------------------------------------------- /Graphics/Entity/RubberEntity.cpp: -------------------------------------------------------------------------------- 1 | #include "RubberEntity.h" 2 | 3 | namespace GraphicsModule { 4 | 5 | RubberEntity::RubberEntity(QGraphicsItem* tragetItem) 6 | :TargetItem(tragetItem) { 7 | if (tragetItem != nullptr) 8 | { 9 | //创建预览框 10 | PreViewRect = new GraphicsPreviewItem(); 11 | PreViewRect->Info.backgroundSize = tragetItem->boundingRect(); 12 | PreViewRect->setPos(tragetItem->pos()); 13 | QGraphicsScene* scene = tragetItem->scene(); 14 | scene->addItem(PreViewRect); 15 | } 16 | } 17 | 18 | RubberEntity::~RubberEntity() 19 | { 20 | QGraphicsScene* scene = TargetItem->scene(); 21 | //从场景中删除预览 22 | scene->removeItem(PreViewRect); 23 | //销毁预览框和橡皮筋线 24 | if (PreViewRect != nullptr) 25 | { 26 | delete PreViewRect; 27 | } 28 | PreViewRect = nullptr; 29 | } 30 | 31 | void RubberEntity::Adjust(QPointF offset) 32 | { 33 | if (PreViewRect) 34 | PreViewRect->setPos(PreViewRect->pos() + offset); 35 | } 36 | 37 | void RubberEntity::AdjustTargetPos() 38 | { 39 | if (TargetItem) 40 | TargetItem->setPos(PreViewRect->pos()); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /Graphics/Entity/RubberEntity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"../GraphicsItem/GraphicsPreviewItem.h" 3 | #include"../GraphicsItem/GraphicsItem.h" 4 | #include "../GraphicsLine/GraphicsRubberLine.h" 5 | #include 6 | /// 7 | /// 用于进行拖动图元时预览 8 | /// 9 | 10 | namespace GraphicsModule { 11 | class RubberEntity 12 | { 13 | public: 14 | RubberEntity(QGraphicsItem* tragetItem); 15 | ~RubberEntity(); 16 | //调整预览框和目标位置 17 | void Adjust(QPointF offset); 18 | //调整目标图元位置到预览框 19 | void AdjustTargetPos(); 20 | 21 | //用于建立视图中某个图元和预览框和橡皮筋之间的关系 22 | QGraphicsItem* TargetItem{ nullptr }; 23 | GraphicsPreviewItem* PreViewRect{ nullptr }; 24 | 25 | 26 | }; 27 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsButton.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsButton.h" 2 | 3 | namespace GraphicsModule { 4 | GraphicsButton::GraphicsButton(ButtonInfo info) :Info(info) 5 | { 6 | setAcceptHoverEvents(true); // 开启鼠标悬停事件 7 | 8 | GraphicsItem::Info.GraphicsItemType = Button; 9 | } 10 | QRectF GraphicsButton::boundingRect() const 11 | { 12 | return Info.buttonSize; 13 | } 14 | 15 | 16 | void GraphicsButton::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 17 | { 18 | if (ishover) 19 | { 20 | painter->setBrush(Info.buttonPressColor); 21 | painter->setPen(Info.buttonTextColor); 22 | //画矩形 23 | painter->drawRoundedRect(Info.buttonSize, 5, 5); 24 | //画文字 25 | painter->setPen(Info.buttonTextColor); 26 | painter->drawText(Info.buttonSize, Info.buttonText, { Qt::AlignCenter }); 27 | } 28 | else 29 | { 30 | painter->setPen(Qt::NoPen); 31 | painter->setBrush(Info.buttonColor); 32 | //画矩形 33 | painter->drawRoundedRect(Info.buttonSize, 3, 3); 34 | //画文字 35 | painter->setPen(Info.buttonTextColor); 36 | painter->drawText(Info.buttonSize, Info.buttonText, { Qt::AlignCenter }); 37 | } 38 | 39 | } 40 | void GraphicsButton::mousePressEvent(QGraphicsSceneMouseEvent* event) 41 | { 42 | if (event->button() == Qt::LeftButton) { 43 | //运行中点击才有效 44 | if (RuningConfig::IsRuning) 45 | { 46 | //设置按钮信息已经点击 47 | Info.Clicked = true; 48 | } 49 | } 50 | 51 | } 52 | void GraphicsButton::hoverMoveEvent(QGraphicsSceneHoverEvent* event) 53 | { 54 | ishover = true; 55 | } 56 | void GraphicsButton::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) 57 | { 58 | ishover = false; 59 | } 60 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include"GraphicsItem.h" 6 | #include"../Info/ButtonInfo.h" 7 | #include 8 | #include 9 | #include"../../Globe/RuningConfig.h" 10 | using namespace Globe; 11 | namespace GraphicsModule { 12 | class GraphicsButton : public GraphicsItem 13 | { 14 | public: 15 | GraphicsButton(ButtonInfo info); 16 | QRectF boundingRect() const; 17 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 18 | void mousePressEvent(QGraphicsSceneMouseEvent* event)override; 19 | void hoverMoveEvent(QGraphicsSceneHoverEvent* event)override; 20 | void hoverLeaveEvent(QGraphicsSceneHoverEvent* event)override; 21 | bool ishover{ false }; 22 | ButtonInfo Info; 23 | }; 24 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsChart.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include"GraphicsItem.h" 6 | #include"../Info/ChartInfo.h" 7 | 8 | namespace GraphicsModule { 9 | class GraphicsChart : public GraphicsItem 10 | { 11 | public: 12 | GraphicsChart(ChartInfo info); 13 | QRectF boundingRect() const; 14 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 15 | 16 | ~GraphicsChart(); 17 | ChartInfo Info; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsGroup.cpp: -------------------------------------------------------------------------------- 1 | #include"GraphicsGroup.h" 2 | 3 | namespace GraphicsModule { 4 | GraphicsGroup::GraphicsGroup(GroupInfo info, QGraphicsItem* parent) :QGraphicsItemGroup(parent), 5 | Info(info) 6 | { 7 | setFlag(QGraphicsItem::ItemIsSelectable, true); 8 | 9 | } 10 | 11 | void GraphicsGroup::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 12 | { 13 | Q_UNUSED(widget) 14 | // 选中边框绘制 15 | if (option->state & QStyle::State_Selected) { 16 | painter->setPen(Info.selectBorder); 17 | painter->setBrush(Info.selectBrush); 18 | } 19 | else 20 | { 21 | painter->setPen(Info.normalBorder); 22 | painter->setBrush(Info.normalBrush); 23 | } 24 | 25 | int Radius = Info.radius; 26 | painter->drawRoundedRect(option->rect, Radius, Radius); // 绘制矩形边框 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsGroup.h: -------------------------------------------------------------------------------- 1 | #ifndef QGRAPHICSITEMGROUP_H 2 | #define QGRAPHICSITEMGROUP_H 3 | #include 4 | #include 5 | #include 6 | #include"../Info/GroupInfo.h" 7 | #include"GraphicsItem.h" 8 | namespace GraphicsModule 9 | { 10 | class GraphicsGroup :public QGraphicsItemGroup 11 | { 12 | public: 13 | GraphicsGroup(GroupInfo info=GroupInfo(),QGraphicsItem* parent = nullptr); 14 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; 15 | 16 | GroupInfo Info; 17 | }; 18 | } 19 | 20 | #endif // QGRAPHICSITEMGROUP_H 21 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsItem.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsItem.h" 2 | namespace GraphicsModule { 3 | GraphicsItem::GraphicsItem(ItemInfo info, QGraphicsItem* parent) :Info(info), QGraphicsItem(parent) 4 | { 5 | setFlag(QGraphicsItem::ItemIsSelectable, true); 6 | } 7 | 8 | QRectF GraphicsItem::boundingRect() const 9 | { 10 | return Info.backgroundSize; 11 | } 12 | 13 | GraphicsItem::~GraphicsItem() 14 | { 15 | } 16 | 17 | void GraphicsItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 18 | { 19 | Q_UNUSED(widget) 20 | // 选中边框绘制 21 | if (option->state & QStyle::State_Selected) { 22 | QPen pen = Info.selectBorder; 23 | pen.setWidth(5); 24 | painter->setPen(pen); 25 | painter->setBrush(Qt::NoBrush); 26 | } 27 | else 28 | { 29 | painter->setPen(Qt::NoPen); 30 | painter->setBrush(Qt::NoBrush); 31 | } 32 | //绘制框 33 | QRectF backgroud = boundingRect(); 34 | painter->drawRoundedRect(backgroud, Info.radius, Info.radius); 35 | painter->setPen(Qt::NoPen); 36 | painter->setBrush(Qt::NoBrush); 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include"../Info/ItemInfo.h" 6 | namespace GraphicsModule 7 | { 8 | class GraphicsItem : public QGraphicsItem 9 | { 10 | public: 11 | GraphicsItem(ItemInfo info = ItemInfo(), QGraphicsItem* parent = nullptr); 12 | ~GraphicsItem(); 13 | QRectF boundingRect() const; 14 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override;; 15 | ItemInfo Info; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsLable.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsLable.h" 2 | 3 | namespace GraphicsModule 4 | { 5 | GraphicsLabel::GraphicsLabel(LabelInfo info) :Info(info) 6 | { 7 | info.GraphicsItemType = Label; 8 | 9 | GraphicsItem::Info.GraphicsItemType = Label; 10 | } 11 | QRectF GraphicsLabel::boundingRect() const 12 | { 13 | return Info.backgroundSize; 14 | } 15 | void GraphicsLabel::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 16 | { 17 | painter->setPen(Qt::NoPen); 18 | painter->setBrush(Info.BackgroundColor); 19 | //绘制矩形框 20 | painter->drawRoundedRect(Info.backgroundSize, Info.radius, Info.radius); 21 | 22 | painter->setPen(Info.TextColor); 23 | QFont f; 24 | f.setBold(Info.isbold); 25 | f.setPointSize(Info.textSize); 26 | painter->setFont(f); 27 | //绘制文本 28 | painter->drawText(Info.backgroundSize, Info.Text, { Qt::AlignCenter }); 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsLable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include"../Info/labelInfo.h" 4 | #include "GraphicsItem.h" 5 | namespace GraphicsModule 6 | { 7 | class GraphicsLabel : public GraphicsItem 8 | { 9 | public: 10 | GraphicsLabel(LabelInfo info); 11 | 12 | QRectF boundingRect() const; 13 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 14 | LabelInfo Info; 15 | }; 16 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsNode.cpp: -------------------------------------------------------------------------------- 1 | #include"GraphicsNode.h" 2 | 3 | namespace GraphicsModule { 4 | GraphicsNode::GraphicsNode(NodeInfo nodeInfo) :Info(nodeInfo), GraphicsItem(nodeInfo) 5 | { 6 | GraphicsItem::Info.GraphicsItemType = nodeInfo.GraphicsItemType; 7 | 8 | } 9 | 10 | 11 | 12 | void GraphicsNode::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 13 | { 14 | Q_UNUSED(widget) 15 | GraphicsItem::paint(painter, option, widget); 16 | 17 | int Radius = Info.radius; 18 | QRectF titleback = Info.titleSize; 19 | QRectF backgroud = Info.backgroundSize; 20 | //绘制节点背景 21 | //背景是否以渐变的颜色绘制 22 | if (Info.backgroundColorGradient) 23 | { 24 | QLinearGradient gradient(backgroud.topLeft(), backgroud.bottomLeft()); 25 | gradient.setColorAt(0, Info.backgroundColor1); // 起始颜色 26 | gradient.setColorAt(1, Info.backgroundColor2); // 终止颜色 27 | QBrush titleBarBrush(gradient); 28 | painter->setBrush(titleBarBrush); 29 | } 30 | else 31 | { 32 | painter->setBrush(Info.backgroundColor1); 33 | } 34 | painter->drawRoundedRect(backgroud, Radius, Radius); 35 | 36 | //绘制节点标题栏 37 | //节点标题栏是否渐变 38 | if (Info.titleBackgroundColorGradient) 39 | { 40 | QLinearGradient gradient(titleback.topLeft(), titleback.bottomLeft()); 41 | gradient.setColorAt(0, Info.titleBackgroundColor1); // 起始颜色 42 | gradient.setColorAt(1, Info.titleBackgroundColor2); // 终止颜色 43 | QBrush titleBarBrush(gradient); 44 | painter->setBrush(titleBarBrush); 45 | } 46 | else 47 | { 48 | painter->setBrush(Info.titleBackgroundColor1); 49 | } 50 | //绘制标题 51 | painter->drawRoundedRect(titleback, Radius, Radius); 52 | //绘制标题文字 53 | painter->setPen(Qt::white); 54 | painter->drawText({ 30,0, 55 | Info.titleSize.width() - 60, 56 | Info.titleSize.height() - 10 }, 57 | Info.nodeName, { Qt::AlignCenter }); 58 | } 59 | 60 | 61 | 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include"../Info/NodeInfo.h" 6 | #include "GraphicsItem.h" 7 | 8 | namespace GraphicsModule { 9 | 10 | 11 | class GraphicsNode : public GraphicsItem 12 | { 13 | 14 | public: 15 | GraphicsNode(NodeInfo nodeInfo = NodeInfo()); 16 | 17 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 18 | 19 | 20 | NodeInfo Info; 21 | 22 | 23 | 24 | }; 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsPictureBox.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsPictureBox.h" 2 | 3 | namespace GraphicsModule { 4 | GraphicsPictureBox::GraphicsPictureBox(PictureBoxInfo info) :info(info) 5 | { 6 | info.GraphicsItemType = PictureBox; 7 | image = QPixmap(info.imgPath); 8 | 9 | GraphicsItem::Info.GraphicsItemType = PictureBox; 10 | } 11 | QRectF GraphicsPictureBox::boundingRect() const 12 | { 13 | return info.backgroundSize; 14 | } 15 | void GraphicsPictureBox::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 16 | { 17 | //绘制图片 18 | painter->drawPixmap(info.backgroundSize.x(), info.backgroundSize.y(), image); // 从(0,0)位置开始绘制整个pixmap 19 | } 20 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsPictureBox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include"GraphicsItem.h" 6 | #include"../Info/PictureBoxInfo.h" 7 | #include 8 | #include 9 | #include"../../Globe/RuningConfig.h" 10 | 11 | using namespace Globe; 12 | namespace GraphicsModule { 13 | class GraphicsPictureBox : public GraphicsItem 14 | { 15 | public: 16 | GraphicsPictureBox(PictureBoxInfo info = PictureBoxInfo{}); 17 | QRectF boundingRect() const; 18 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 19 | 20 | PictureBoxInfo info; 21 | QPixmap image; 22 | 23 | }; 24 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsPort.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include"GraphicsItem.h" 7 | #include"../Info/PortInfo.h" 8 | namespace GraphicsModule { 9 | 10 | class GraphicsPort : public GraphicsItem 11 | { 12 | public: 13 | GraphicsPort(PortInfo info); 14 | ~GraphicsPort(); 15 | 16 | QRectF boundingRect() const; 17 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 18 | PortInfo& GetPortInfo(); 19 | void SetPortText(const QString& text); 20 | QString GetPortText() const; 21 | private: 22 | QString PortText{ "" }; 23 | PortInfo m_PortInfo; 24 | // 创建一个互斥锁来保护PortText 25 | mutable QMutex portTextMutex; 26 | }; 27 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsPreviewItem.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsPreviewItem.h" 2 | 3 | 4 | namespace GraphicsModule { 5 | GraphicsPreviewItem::GraphicsPreviewItem(ItemInfo Info):GraphicsItem(Info) 6 | { 7 | this->Info.selectBorder=QPen(Qt::white,3,Qt::DashLine); 8 | 9 | setFlag(QGraphicsItem::ItemIsSelectable, false); 10 | } 11 | 12 | void GraphicsPreviewItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) 13 | { 14 | 15 | Q_UNUSED(widget) 16 | painter->setPen(Info.selectBorder); 17 | painter->setBrush(Info.selectBrush); 18 | //绘制边框 19 | QRectF backgroud = boundingRect(); 20 | painter->drawRoundedRect(backgroud,Info.radius,Info.radius); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsPreviewItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"GraphicsItem.h" 3 | namespace GraphicsModule 4 | { 5 | class GraphicsPreviewItem:public GraphicsItem 6 | { 7 | public: 8 | GraphicsPreviewItem(ItemInfo Info=ItemInfo()); 9 | 10 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 11 | }; 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsSwitchButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include"GraphicsItem.h" 6 | #include"../Info/SwitchButtonInfo.h" 7 | #include 8 | #include 9 | #include"../../Globe/RuningConfig.h" 10 | using namespace Globe; 11 | namespace GraphicsModule { 12 | class GraphicsSwitchButton : public GraphicsItem 13 | { 14 | public: 15 | GraphicsSwitchButton(SwitchButtonInfo Info); 16 | QRectF boundingRect() const; 17 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 18 | void mousePressEvent(QGraphicsSceneMouseEvent* event)override; 19 | 20 | SwitchButtonInfo Info; 21 | }; 22 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsText.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include"../Info/TextInfo.h" 11 | namespace GraphicsModule 12 | { 13 | class GraphicsText :public QGraphicsTextItem 14 | { 15 | public: 16 | GraphicsText(TextInfo info, QGraphicsItem* parent = nullptr); 17 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override; 18 | 19 | void focusOutEvent(QFocusEvent* event); 20 | void mousePressEvent(QGraphicsSceneMouseEvent* event)override; 21 | void keyPressEvent(QKeyEvent* event)override; 22 | QRectF boundingRect() const; 23 | TextInfo* Info{ new TextInfo{} }; 24 | }; 25 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsTip.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsTip.h" 2 | 3 | namespace GraphicsModule 4 | { 5 | void GraphicsTip::showTips(QGraphicsView* view, QString tip) 6 | { 7 | if (!instancePtr) { // 如果单例指针为空,则创建实例 8 | instancePtr = new GraphicsTip(); 9 | view->scene()->addItem(instancePtr); 10 | } 11 | instancePtr->tip = tip; 12 | instancePtr->setZValue(2); 13 | QPointF pos{ view->mapToScene(view->rect().left(),view->rect().height() / 2 - 75) }; 14 | instancePtr->rect = QRectF{ pos.x(),pos.y(),(float)view->width(),150.0f }; 15 | instancePtr->setVisible(true); 16 | 17 | } 18 | QRectF GraphicsTip::boundingRect() const 19 | { 20 | return rect; 21 | } 22 | void GraphicsTip::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 23 | { 24 | QColor backcolor = Qt::black; 25 | backcolor.setAlpha(150); 26 | painter->setBrush(backcolor); 27 | painter->drawRect(rect); 28 | // 设置字体大小和样式 29 | QFont font; 30 | font.setPointSize(25); // 设置字体大小,你可以根据需要调整这个值 31 | font.setBold(true); // 设置为粗体(如果需要) 32 | painter->setFont(font); // 应用字体到painter 33 | // 绘制文本 34 | painter->setPen(Qt::white); 35 | painter->drawText(boundingRect(), Qt::AlignCenter, tip); 36 | } 37 | GraphicsTip::GraphicsTip() 38 | { 39 | this->setVisible(true); 40 | QObject::connect(&timer, &QTimer::timeout, [=]() { 41 | this->setVisible(false); 42 | }); 43 | timer.start(3000); // 设置定时器间隔 44 | } 45 | } -------------------------------------------------------------------------------- /Graphics/GraphicsItem/GraphicsTip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | namespace GraphicsModule 12 | { 13 | class GraphicsTip :public QGraphicsItem 14 | { 15 | public: 16 | static void showTips(QGraphicsView *view,QString tip); // 获取单例实例的静态方法 17 | protected: 18 | // QGraphicsItem的必须重写函数 19 | QRectF boundingRect() const override; 20 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; 21 | 22 | private: 23 | QTimer timer{}; // 定时器 24 | inline static GraphicsTip* instancePtr{nullptr}; // 指向单例实例的指针 25 | QRectF rect; 26 | GraphicsTip(); 27 | QString tip; 28 | }; 29 | } -------------------------------------------------------------------------------- /Graphics/GraphicsLine/GraphicsLineItem.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsLineItem.h" 2 | namespace GraphicsModule 3 | { 4 | GraphicsLineItem::GraphicsLineItem(LineInfo info, QGraphicsItem* parent) : 5 | QGraphicsLineItem(parent), Info(info) 6 | { 7 | } 8 | 9 | GraphicsLineItem::~GraphicsLineItem() 10 | {} 11 | 12 | 13 | void GraphicsLineItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 14 | { 15 | Q_UNUSED(widget) 16 | painter->setPen(Info.LineColorPen); 17 | painter->drawLine(Info.startPos, Info.FinishPos); 18 | } 19 | } -------------------------------------------------------------------------------- /Graphics/GraphicsLine/GraphicsLineItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Info/LineInfo.h" 3 | #include 4 | #include 5 | namespace GraphicsModule 6 | { 7 | class GraphicsLineItem :public QGraphicsLineItem 8 | { 9 | public: 10 | GraphicsLineItem(LineInfo info = LineInfo(), QGraphicsItem* parent = nullptr); 11 | 12 | ~GraphicsLineItem(); 13 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)override;; 14 | LineInfo Info; 15 | }; 16 | } -------------------------------------------------------------------------------- /Graphics/GraphicsLine/GraphicsLineItemBeziercurveitem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "../../Globe/RuningConfig.h" 8 | #include "GraphicsLineItem.h" 9 | using namespace Globe; 10 | namespace GraphicsModule 11 | { 12 | class GraphicsLineItemBeziercurveitem : public GraphicsLineItem 13 | { 14 | public: 15 | GraphicsLineItemBeziercurveitem(); 16 | GraphicsLineItemBeziercurveitem(QPointF startPos, QPointF finishPos); 17 | QRectF boundingRect() const override; 18 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; 19 | void mousePressEvent(QGraphicsSceneMouseEvent* event); 20 | void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); 21 | 22 | void UpdateLine(QPointF startPos, QPointF finishPos); 23 | void SetFinishPos(QPointF finishPos); 24 | void SetStartPos(QPointF startPos); 25 | void SetPen(QPen pen); 26 | private: 27 | //贝塞尔控制点 28 | QPointF control1; 29 | QPointF control2; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /Graphics/GraphicsLine/GraphicsRubberLine.cpp: -------------------------------------------------------------------------------- 1 | #include "GraphicsRubberLine.h" 2 | 3 | namespace GraphicsModule 4 | { 5 | 6 | GraphicsRubberLine::GraphicsRubberLine() 7 | { 8 | 9 | } 10 | GraphicsRubberLine::GraphicsRubberLine(QPointF startPos, QPointF finishPos) 11 | { 12 | UpdateLine(startPos,finishPos); 13 | } 14 | GraphicsRubberLine::~GraphicsRubberLine() 15 | { 16 | 17 | } 18 | void GraphicsRubberLine::UpdateLine(QPointF startPos, QPointF finishPos) 19 | { 20 | 21 | Info.startPos = startPos; 22 | Info.FinishPos = finishPos; 23 | setLine(startPos.x(), startPos.y(), finishPos.x(), finishPos.y()); 24 | 25 | } 26 | void GraphicsRubberLine::SetFinishPos(QPointF finishPos) 27 | { 28 | Info.FinishPos = finishPos; 29 | setLine(Info.startPos.x(), Info.startPos.y(), finishPos.x(), finishPos.y()); 30 | } 31 | 32 | void GraphicsRubberLine::SetStartPos(QPointF startPos) 33 | { 34 | 35 | Info.startPos = startPos; 36 | setLine(startPos.x(), startPos.y(), Info.FinishPos.x(), Info.FinishPos.y()); 37 | } 38 | 39 | 40 | } -------------------------------------------------------------------------------- /Graphics/GraphicsLine/GraphicsRubberLine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include"../Info/LineInfo.h" 4 | #include"../GraphicsLine/GraphicsLineItem.h" 5 | namespace GraphicsModule { 6 | class GraphicsRubberLine :public GraphicsLineItem 7 | { 8 | public: 9 | GraphicsRubberLine(); 10 | GraphicsRubberLine(QPointF startPos, QPointF finishPos); 11 | 12 | ~GraphicsRubberLine(); 13 | void UpdateLine(QPointF startPos,QPointF finishPos); 14 | void SetFinishPos(QPointF finishPos); 15 | void SetStartPos(QPointF startPos); 16 | 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /Graphics/Info/ButtonInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "ButtonInfo.h" 2 | 3 | namespace GraphicsModule 4 | { 5 | ButtonInfo::ButtonInfo() 6 | { 7 | GraphicsItemType = GraphicsItemType::Button; 8 | } 9 | } -------------------------------------------------------------------------------- /Graphics/Info/ButtonInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"ItemInfo.h" 3 | #include 4 | #include 5 | #include 6 | namespace GraphicsModule 7 | { 8 | 9 | class ButtonInfo :ItemInfo 10 | { 11 | public: 12 | ButtonInfo(); 13 | QRectF buttonSize; 14 | QString buttonText{ "button" }; 15 | QColor buttonTextColor{ Qt::white }; 16 | QColor buttonTextPressColor{ Qt::gray }; 17 | QColor buttonColor{ Qt::black }; 18 | QColor buttonPressColor{ Qt::darkGray }; 19 | bool Clicked{ false }; 20 | int buttonIndex{ -1 }; 21 | }; 22 | } -------------------------------------------------------------------------------- /Graphics/Info/ChartInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "ChartInfo.h" 2 | 3 | #pragma once 4 | 5 | namespace GraphicsModule { 6 | ChartInfo::ChartInfo() 7 | { 8 | 9 | GraphicsItemType = GraphicsItemType::Chart; 10 | } 11 | 12 | void ChartInfo::InsertValueList(QList ValueList) 13 | { 14 | //折线图通过X,Y坐标 15 | if (chatyType == Straight && ValueList.count() == 2) 16 | { 17 | QPointF pos{ ValueList[0].toFloat(),ValueList[1].toFloat() }; 18 | DataList.append(pos); 19 | } 20 | else if (chatyType == SquareWave && ValueList.count() == 1) 21 | { 22 | float number = ValueList[0].toFloat(); 23 | if (number != 0) 24 | number = 1; 25 | else 26 | number = 0; 27 | QPointF pos{ 0,number }; 28 | 29 | while (DataList.count() * 20 > RectSize.width()) 30 | DataList.pop_front(); 31 | 32 | DataList.append(pos); 33 | } 34 | } 35 | 36 | }; -------------------------------------------------------------------------------- /Graphics/Info/ChartInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"NodeInfo.h" 3 | #include 4 | namespace GraphicsModule 5 | { 6 | 7 | 8 | 9 | //图表类型 10 | class ChartInfo :ItemInfo 11 | { 12 | public: 13 | ChartInfo(); 14 | //图表类型 15 | ChartType chatyType{ Straight }; 16 | QRectF RectSize; 17 | //图表内数据 18 | QList DataList; 19 | void InsertValueList(QList ValueList); 20 | 21 | float stepDistance{ 2 };//(膨胀系数)单位长度距离,各个图项之间的距离 22 | QColor axisColor{ Qt::green }; 23 | QColor lineColor{ Qt::green }; 24 | bool drawPoint{ true }; 25 | bool drawLine{ true }; 26 | QColor pointColor{ Qt::green }; 27 | int pointSize{ 2 }; 28 | int chartIndex{ -1 }; 29 | 30 | }; 31 | 32 | 33 | } -------------------------------------------------------------------------------- /Graphics/Info/GroupInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "GroupInfo.h" 2 | 3 | namespace GraphicsModule { 4 | 5 | GroupInfo::GroupInfo() 6 | { 7 | GraphicsItemType = GraphicsItemType::Group; 8 | normalBrush=QBrush(QColor(60,100,100,100)); 9 | selectBrush=QBrush(QColor(60,100,100,150)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Graphics/Info/GroupInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include"ItemInfo.h" 4 | namespace GraphicsModule 5 | { 6 | class GroupInfo:public ItemInfo 7 | { 8 | public: 9 | GroupInfo(); 10 | 11 | 12 | 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /Graphics/Info/ItemInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "ItemInfo.h" 2 | 3 | namespace GraphicsModule { 4 | ItemInfo::ItemInfo() 5 | { 6 | 7 | } 8 | ItemInfo::ItemInfo(QRectF rect):backgroundSize(rect) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /Graphics/Info/ItemInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include"../../Globe/Enum.h" 5 | using namespace Globe; 6 | namespace GraphicsModule { 7 | class ItemInfo 8 | { 9 | public: 10 | ItemInfo(); 11 | ItemInfo(QRectF rect); 12 | QRectF backgroundSize{ 0,0,20,20 };//图元大小 13 | QPen normalBorder{ QPen(Qt::NoPen) };//普通边框 14 | QPen selectBorder{ QPen(Qt::white,5,Qt::SolidLine) };//选中时候的边框 15 | QBrush normalBrush{ QBrush(Qt::NoBrush) };//普通填充 16 | QBrush selectBrush{ QBrush(Qt::NoBrush) };//选中时的填充 17 | int radius{ 8 };//圆角 18 | GraphicsItemType GraphicsItemType{ Null };//图元类型 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Graphics/Info/LineInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "LineInfo.h" 2 | 3 | GraphicsModule::LineInfo::LineInfo() 4 | { 5 | GraphicsItemType = GraphicsItemType::Line; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Graphics/Info/LineInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include"ItemInfo.h" 7 | namespace GraphicsModule { 8 | class LineInfo :public ItemInfo 9 | { 10 | public: 11 | LineInfo(); 12 | QPointF startPos; 13 | QPointF FinishPos; 14 | QPen LineColorPen{ QPen(Qt::white,8,Qt::SolidLine) };//线的颜色 15 | 16 | 17 | }; 18 | } -------------------------------------------------------------------------------- /Graphics/Info/NodeInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "NodeInfo.h" 2 | namespace GraphicsModule { 3 | NodeInfo::NodeInfo() 4 | { 5 | GraphicsItemType = GraphicsItemType::Node; 6 | } 7 | } -------------------------------------------------------------------------------- /Graphics/Info/NodeInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEINFO_H 2 | #define NODEINFO_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include"ItemInfo.h" 10 | namespace GraphicsModule 11 | { 12 | 13 | 14 | class NodeInfo :public ItemInfo 15 | { 16 | 17 | public: 18 | NodeInfo(); 19 | 20 | 21 | //背景颜色 22 | QColor backgroundColor1{ QColor(0,0,0,255) }; 23 | QColor backgroundColor2{ QColor(0,0,0,255) }; 24 | //标题栏颜色 25 | QColor titleBackgroundColor1{ QColor(0,0,0,255) }; 26 | QColor titleBackgroundColor2{ QColor(0,0,0,255) }; 27 | 28 | //背景颜色是否渐变 29 | bool backgroundColorGradient = true; 30 | //标题栏颜色是否渐变 31 | bool titleBackgroundColorGradient = true; 32 | 33 | //标题栏大小 34 | QRectF titleSize{ 0,0,backgroundSize.width(),30 }; 35 | 36 | //节点名称 37 | QString nodeName; 38 | 39 | //脚本路径或地址 40 | QString ScriptPath{ "" }; 41 | public: 42 | 43 | 44 | 45 | }; 46 | 47 | 48 | } 49 | #endif // NODEINFO_H 50 | -------------------------------------------------------------------------------- /Graphics/Info/PictureBoxInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pictureboxinfo.h" 2 | 3 | 4 | namespace GraphicsModule { 5 | 6 | PictureBoxInfo::PictureBoxInfo() 7 | { 8 | 9 | GraphicsItemType = GraphicsItemType::PictureBox; 10 | } 11 | 12 | PictureBoxInfo::~PictureBoxInfo() 13 | { 14 | } 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Graphics/Info/PictureBoxInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"ItemInfo.h" 3 | #include"../../Globe/Enum.h" 4 | #include"../../Globe/Map.h" 5 | using namespace Globe; 6 | 7 | namespace GraphicsModule { 8 | 9 | 10 | class PictureBoxInfo :public ItemInfo 11 | { 12 | public: 13 | PictureBoxInfo(); 14 | ~PictureBoxInfo(); 15 | QString imgPath; 16 | QSize imgSize; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /Graphics/Info/PortInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "PortInfo.h" 2 | namespace GraphicsModule { 3 | //端口编号表 4 | 5 | PortInfo::PortInfo(PortType portType, PortDataType portDataType) : 6 | portType(portType), portDataType(portDataType) 7 | { 8 | GraphicsItemType = GraphicsItemType::Port; 9 | static unsigned portnumbercounter = 0; 10 | portNumber = portnumbercounter++; 11 | Update(); 12 | } 13 | 14 | void PortInfo::Update() 15 | { 16 | //如果是数据端口,要设置成对应数据端口的颜色 17 | if (portType == PortType::DataInput || portType == PortType::DataOutput) 18 | { 19 | normalBorder = QPen(Map::PortDataTypeColorMap[portDataType], 3); 20 | } 21 | else 22 | { 23 | //如果是其他端口,要设置成对应端口的颜色 24 | normalBorder = QPen(Map::PortTypeColorMap[portType], 3); 25 | } 26 | 27 | } 28 | 29 | PortInfo::PortInfo() 30 | { 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /Graphics/Info/PortInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include"ItemInfo.h" 4 | #include"../../Globe/Enum.h" 5 | #include"../../Globe/Map.h" 6 | using namespace Globe; 7 | 8 | namespace GraphicsModule { 9 | 10 | 11 | 12 | class PortInfo :public ItemInfo 13 | { 14 | public: 15 | PortInfo(PortType portType, PortDataType portDataType); 16 | 17 | void Update(); 18 | PortInfo(); 19 | PortType portType{ PortType::DataInput }; 20 | PortDataType portDataType{ PortDataType::Int }; 21 | unsigned portIndex{ 0 }; 22 | bool IsConnection{ false }; 23 | bool IsActive{ true }; 24 | unsigned portNumber; 25 | 26 | 27 | }; 28 | } -------------------------------------------------------------------------------- /Graphics/Info/SwitchButtonInfo.cpp: -------------------------------------------------------------------------------- 1 |  2 | #include "SwitchButtonInfo.h" 3 | namespace GraphicsModule 4 | { 5 | 6 | 7 | 8 | SwitchButtonInfo::SwitchButtonInfo() 9 | { 10 | 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /Graphics/Info/SwitchButtonInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"ItemInfo.h" 3 | #include 4 | #include 5 | #include 6 | namespace GraphicsModule 7 | { 8 | class SwitchButtonInfo :ItemInfo 9 | { 10 | public: 11 | SwitchButtonInfo(); 12 | QRectF switchButtonSize; 13 | QColor buttonColor{ Qt::black }; 14 | QColor buttonOpenColor{ Qt::darkGray }; 15 | QColor switchColor{ Qt::white }; 16 | QString text{ "SwitchButton" }; 17 | 18 | bool IsOpen{ false }; 19 | int buttonIndex{ -1 }; 20 | }; 21 | } -------------------------------------------------------------------------------- /Graphics/Info/TextInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "TextInfo.h" 2 | 3 | using namespace Globe; 4 | 5 | namespace GraphicsModule { 6 | TextInfo::TextInfo() 7 | { 8 | GraphicsItemType = GraphicsItemType::Text; 9 | } 10 | } -------------------------------------------------------------------------------- /Graphics/Info/TextInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"ItemInfo.h" 3 | #include"../../Globe/Enum.h" 4 | #include"../../Globe/Map.h" 5 | 6 | #include 7 | using namespace Globe; 8 | namespace GraphicsModule { 9 | class TextInfo :public ItemInfo 10 | { 11 | public: 12 | TextInfo(); 13 | QColor BackgroundColor{ Qt::black }; 14 | QColor TextColor{ Qt::white }; 15 | QString Text{ "text" }; 16 | int index{ -1 }; 17 | int MaxWidth{ 50 }; 18 | }; 19 | } -------------------------------------------------------------------------------- /Graphics/Info/labelInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "labelInfo.h" 2 | 3 | namespace GraphicsModule { 4 | LabelInfo::LabelInfo() 5 | { 6 | GraphicsItemType = GraphicsItemType::Label; 7 | } 8 | 9 | 10 | } -------------------------------------------------------------------------------- /Graphics/Info/labelInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include"ItemInfo.h" 8 | namespace GraphicsModule { 9 | class LabelInfo :public ItemInfo 10 | { 11 | public: 12 | LabelInfo(); 13 | QColor BackgroundColor{ Qt::black }; 14 | QColor TextColor{ Qt::white }; 15 | int index{ -1 }; 16 | QString Text{ "label" }; 17 | bool isbold{ false }; 18 | unsigned textSize{ 12 }; 19 | unsigned radius{ 5 }; 20 | }; 21 | } -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 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 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/.description: -------------------------------------------------------------------------------- 1 | 提供了丰富的矩阵、向量可视化节点 -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/.fcp: -------------------------------------------------------------------------------- 1 | { 2 | "currentRuningPath": "", 3 | "themName":"", 4 | "unitStepDelay":400, 5 | "audioAllowPlay":true 6 | 7 | } -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/ProjectTemplate/向量和矩阵/.png -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/.tag: -------------------------------------------------------------------------------- 1 | 数学计算 2 | 可视化 3 | 矩阵 4 | 向量 -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/config/Them/浅色/GraphicsViewConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "BackgroundConfig": { 4 | "gridEnable":true, 5 | "gridSize": 30, 6 | "gridWidth":1, 7 | "gridColor": "#B6B6B6", 8 | "backColor": "#FDFEFD" 9 | } 10 | } -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/config/Them/浅色/PortColorConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "PortDataTypeColor": { 4 | "Int": "#FF800080", 5 | "Float": "#FF0000CC", 6 | "Bool": "#FF0000", 7 | "String": "#FF00FF00", 8 | "Bit": "#887B68EE", 9 | "Vector": "#FFA500FF", 10 | "Matrix": "#ffd93a" 11 | }, 12 | "PortTypeColor": { 13 | "DataInput": "#000000", 14 | "DataOutput": "#000000", 15 | "TriggerInput": "#88A9A9A9", 16 | "TriggerOutput": "#88A9A9A9", 17 | "ProgramControlInput": "#FFFFFF", 18 | "ProgramControlOutput": "#FFFFFF" 19 | } 20 | } -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/config/Them/默认/GraphicsViewConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "BackgroundConfig": { 4 | "gridEnable":true, 5 | "gridSize": 30, 6 | "gridWidth":1, 7 | "gridColor": "#777777", 8 | "backColor": "#484947" 9 | } 10 | } -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/config/Them/默认/PortColorConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "PortDataTypeColor": { 4 | "Int": "#FF800080", 5 | "Float": "#FF0000CC", 6 | "Bool": "#FF0000", 7 | "String": "#FF00FF00", 8 | "Bit": "#887B68EE", 9 | "Vector": "#FFA500FF", 10 | "Matrix": "#ffd93a" 11 | }, 12 | "PortTypeColor": { 13 | "DataInput": "#000000", 14 | "DataOutput": "#000000", 15 | "TriggerInput": "#88A9A9A9", 16 | "TriggerOutput": "#88A9A9A9", 17 | "ProgramControlInput": "#FFFFFF", 18 | "ProgramControlOutput": "#FFFFFF" 19 | } 20 | } -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/向量/三维向量分解: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/向量/三维向量分解.xs", 7 | "name":"三维向量分解", 8 | "w":150, 9 | "h":140, 10 | "th":50, 11 | "tw":150, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Vector", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, 26 | { 27 | "type": "Port", 28 | "info": { 29 | "size":[125, 45, 20, 20], 30 | "dataType":"Float", 31 | "portType":"DataOutput", 32 | "index":2 33 | 34 | } 35 | },{ 36 | "type": "Port", 37 | "info": { 38 | "size":[125, 75, 20, 20], 39 | "dataType":"Float", 40 | "portType":"DataOutput", 41 | "index":3 42 | } 43 | }, { 44 | "controlType": "Port", 45 | "info": { 46 | "portSize": [125, 105, 20, 20 ], 47 | "portType": "DataOutput", 48 | "portDataType": "Float", 49 | "index":4 50 | } 51 | } 52 | 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/向量/三维向量输入: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/向量/三维向量输入.xs", 7 | "name":"三维向量输入", 8 | "w":150, 9 | "h":140, 10 | "th":50, 11 | "tw":150, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Label", 19 | "info": { 20 | "size":[5,45,20,20], 21 | "text":"X", 22 | "index":1 23 | } 24 | }, { 25 | "type": "Text", 26 | "info": { 27 | "size":[30, 45, 20, 20], 28 | "backColor":"#222222", 29 | "index":1, 30 | "text":"0" 31 | } 32 | }, 33 | { 34 | "type": "Label", 35 | "info": { 36 | "size":[5,75,20,20], 37 | "text":"Y", 38 | "index":2 39 | } 40 | }, { 41 | "type": "Text", 42 | "info": { 43 | "size":[30, 75, 20, 20], 44 | "backColor":"#222222", 45 | "index":2, 46 | "text":"0" 47 | } 48 | }, 49 | { 50 | "type": "Label", 51 | "info": { 52 | "size":[5,105,20,20], 53 | "text":"Z", 54 | "index":3 55 | } 56 | }, { 57 | "type": "Text", 58 | "info": { 59 | "size":[30, 105, 20, 20], 60 | "backColor":"#222222", 61 | "index":3, 62 | "text":"0" 63 | } 64 | }, 65 | { 66 | "type": "Port", 67 | "info": { 68 | "size":[125, 45, 20, 20], 69 | "dataType":"Vector", 70 | "portType":"DataOutput", 71 | "index":1 72 | 73 | } 74 | } 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/显示/三维向量显示: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/向量/三维向量显示.xs", 7 | "name":"三维向量显示", 8 | "w":150, 9 | "h":160, 10 | "th":50, 11 | "tw":150, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Label", 19 | "info": { 20 | "size":[5,75,20,20], 21 | "text":"X" 22 | } 23 | }, { 24 | "type": "Label", 25 | "info": { 26 | "size":[30, 75, 80, 20], 27 | "backColor":"#666666", 28 | "index":1, 29 | "text":"0" 30 | } 31 | }, 32 | { 33 | "type": "Label", 34 | "info": { 35 | "size":[5,105,20,20], 36 | "text":"Y" 37 | } 38 | }, { 39 | "type": "Label", 40 | "info": { 41 | "size":[30, 105, 80, 20], 42 | "backColor":"#666666", 43 | "text":"0", 44 | "index":2 45 | } 46 | }, 47 | { 48 | "type": "Label", 49 | "info": { 50 | "size":[5,135,20,20], 51 | "text":"Z" 52 | } 53 | }, { 54 | "type": "Label", 55 | "info": { 56 | "size":[30, 135, 80, 20], 57 | "backColor":"#666666", 58 | "index":3, 59 | "text":"0" 60 | } 61 | }, 62 | { 63 | "type": "Port", 64 | "info": { 65 | "size":[125, 45, 20, 20], 66 | "dataType":"Vector", 67 | "portType":"DataOutput", 68 | "index":2 69 | 70 | } 71 | }, 72 | { 73 | "type": "Port", 74 | "info": { 75 | "size":[5, 45, 20, 20], 76 | "dataType":"Vector", 77 | "portType":"DataInput", 78 | "index":1 79 | 80 | } 81 | } 82 | ] 83 | } 84 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/显示/文本: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "mainControl": 4 | { 5 | "controlType": "Node", 6 | "info":{ 7 | "nodeName": "", 8 | "scriptPath":"", 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "backgroundColor1": "#99000000", 14 | "backgroundColor2": "#99000000", 15 | "titleBackgroundColor1": "#00000000", 16 | "titleBackgroundColor2": "#00000000", 17 | "backgroundColorGradient": true, 18 | "titleBackgroundColorGradient": true, 19 | "radius": 10, 20 | "titleSize": [ 0, 5, 20, 20 ], 21 | "backgroundSize": [ 0, 0, 20, 20 ] 22 | } 23 | } 24 | , 25 | "controls":[ 26 | { 27 | "controlType": "Text", 28 | "info":{ 29 | "inputSize": [ 3, 25, 50, 20 ], 30 | "backgroundColor":"#000000", 31 | "textColor":"#ffffffff", 32 | "text":"黑白文本", 33 | "inputIndex":1 34 | } 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/矩阵/3×3矩阵分解向量: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/矩阵/33矩阵分解向量.xs", 7 | "name":"3×3矩阵分解", 8 | "w":150, 9 | "h":140, 10 | "th":50, 11 | "tw":150, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Matrix", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, 26 | { 27 | "type": "Port", 28 | "info": { 29 | "size":[125, 45, 20, 20], 30 | "dataType":"Vector", 31 | "portType":"DataOutput", 32 | "index":2 33 | 34 | } 35 | },{ 36 | "type": "Port", 37 | "info": { 38 | "size":[125, 75, 20, 20], 39 | "dataType":"Vector", 40 | "portType":"DataOutput", 41 | "index":3 42 | } 43 | }, { 44 | "controlType": "Port", 45 | "info": { 46 | "portSize": [125, 105, 20, 20 ], 47 | "portType": "DataOutput", 48 | "portDataType": "Vector", 49 | "index":4 50 | } 51 | } 52 | 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/矩阵/任意矩阵分解: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/矩阵/任意矩阵分解.xs", 7 | "name":"任意矩阵分解", 8 | "w":150, 9 | "h":150, 10 | "th":50, 11 | "tw":150, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Matrix", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, 26 | 27 | { 28 | "type": "Port", 29 | "info": { 30 | "size":[125, 45, 20, 20], 31 | "dataType":"Vector", 32 | "portType":"DataOutput", 33 | "index":2 34 | 35 | } 36 | },{ 37 | "type": "Port", 38 | "info": { 39 | "size":[125, 75, 20, 20], 40 | "dataType":"Vector", 41 | "portType":"DataOutput", 42 | "index":3 43 | } 44 | }, { 45 | "controlType": "Port", 46 | "info": { 47 | "portSize": [125, 105, 20, 20 ], 48 | "portType": "DataOutput", 49 | "portDataType": "Vector", 50 | "index":4 51 | } 52 | }, { 53 | "controlType": "Label", 54 | "info": { 55 | "size": [5, 75, 70, 70 ], 56 | "textColor":"#B22222", 57 | "text":"在右侧输入框中输入矩阵的某一行,得到该行的行向量", 58 | "bold":true, 59 | "textSize":8 60 | } 61 | }, { 62 | "type": "Text", 63 | "info": { 64 | "size":[95, 45, 20, 20], 65 | "maxWidth":30, 66 | "backColor":"#222222", 67 | "index":1, 68 | "text":"1" 69 | } 70 | }, { 71 | "type": "Text", 72 | "info": { 73 | "size":[95, 75, 20, 20], 74 | "maxWidth":30, 75 | "backColor":"#222222", 76 | "index":2, 77 | "text":"2" 78 | } 79 | }, { 80 | "type": "Text", 81 | "info": { 82 | "size":[95, 105, 20, 20], 83 | "maxWidth":30, 84 | "backColor":"#222222", 85 | "index":3, 86 | "text":"3" 87 | } 88 | } 89 | 90 | ] 91 | } 92 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/程序/开始: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Start", 5 | "info":{ 6 | "nodeName": "开始", 7 | "scriptPath":"", 8 | "radius": 5, 9 | "titleSize": [ 0, 0, 120, 40 ], 10 | "backgroundSize": [ 0, 0, 120, 100 ] 11 | } 12 | } 13 | , 14 | "controls":[ 15 | { 16 | "controlType": "Port", 17 | "info":{ 18 | "portSize": [ 90, 5, 20, 20 ], 19 | "portIndex": 0, 20 | "portType": "ProgramControlOutput" 21 | } 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/程序/结束: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "结束", 7 | "scriptPath":"", 8 | "radius": 10, 9 | "titleSize": [ 0, 0, 120, 40 ], 10 | "backgroundSize": [ 0, 0, 120, 120 ] 11 | } 12 | } 13 | , 14 | "controls":[ 15 | { 16 | "controlType": "Port", 17 | "info":{ 18 | "portSize": [ 5, 5, 20, 20 ], 19 | "portIndex": 0, 20 | "portType": "ProgramControlInput" 21 | } 22 | }, 23 | { 24 | "controlType": "Port", 25 | "info":{ 26 | "portSize": [ 5, 45, 20, 20 ], 27 | "portIndex": 1, 28 | "portType": "DataInput", 29 | "portDataType": "Vector" 30 | } 31 | }, { 32 | "controlType": "Port", 33 | "info":{ 34 | "portSize": [ 5, 75, 20, 20 ], 35 | "portIndex": 2, 36 | "portType": "DataInput", 37 | "portDataType": "Float" 38 | } 39 | } 40 | 41 | 42 | ] 43 | } -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/运算/向量/三维向量减: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/运算/减.xs", 7 | "name":"三维向量减", 8 | "w":140, 9 | "h":120, 10 | "th":50, 11 | "tw":140, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Vector", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, { 26 | "type": "Port", 27 | "info": { 28 | "size":[5, 75, 20, 20], 29 | "dataType":"Vector", 30 | "portType":"DataInput", 31 | "index":2 32 | } 33 | },{ 34 | "type": "Port", 35 | "info": { 36 | "size":[115, 45, 20, 20], 37 | "dataType":"Vector", 38 | "portType":"DataOutput", 39 | "index":3 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/运算/向量/三维向量加: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/运算/加.xs", 7 | "name":"三维向量加", 8 | "w":140, 9 | "h":120, 10 | "th":50, 11 | "tw":140, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Vector", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, { 26 | "type": "Port", 27 | "info": { 28 | "size":[5, 75, 20, 20], 29 | "dataType":"Vector", 30 | "portType":"DataInput", 31 | "index":2 32 | } 33 | },{ 34 | "type": "Port", 35 | "info": { 36 | "size":[115, 45, 20, 20], 37 | "dataType":"Vector", 38 | "portType":"DataOutput", 39 | "index":3 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/运算/向量/三维向量叉乘: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/运算/叉乘.xs", 7 | "name":"三维向量叉乘", 8 | "w":140, 9 | "h":120, 10 | "th":50, 11 | "tw":140, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Vector", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, { 26 | "type": "Port", 27 | "info": { 28 | "size":[5, 75, 20, 20], 29 | "dataType":"Vector", 30 | "portType":"DataInput", 31 | "index":2 32 | } 33 | },{ 34 | "type": "Port", 35 | "info": { 36 | "size":[115, 45, 20, 20], 37 | "dataType":"Vector", 38 | "portType":"DataOutput", 39 | "index":3 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/运算/向量/三维向量点乘: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/运算/点乘.xs", 7 | "name":"三维向量点乘", 8 | "w":140, 9 | "h":120, 10 | "th":50, 11 | "tw":140, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Vector", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, { 26 | "type": "Port", 27 | "info": { 28 | "size":[5, 75, 20, 20], 29 | "dataType":"Vector", 30 | "portType":"DataInput", 31 | "index":2 32 | } 33 | },{ 34 | "type": "Port", 35 | "info": { 36 | "size":[115, 45, 20, 20], 37 | "dataType":"Float", 38 | "portType":"DataOutput", 39 | "index":3 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/运算/矩阵/矩阵乘: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/运算/乘.xs", 7 | "name":"矩阵乘", 8 | "w":140, 9 | "h":120, 10 | "th":50, 11 | "tw":140, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Matrix", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, { 26 | "type": "Port", 27 | "info": { 28 | "size":[5, 75, 20, 20], 29 | "dataType":"Matrix", 30 | "portType":"DataInput", 31 | "index":2 32 | } 33 | },{ 34 | "type": "Port", 35 | "info": { 36 | "size":[115, 60, 20, 20], 37 | "dataType":"Matrix", 38 | "portType":"DataOutput", 39 | "index":3 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/运算/矩阵/矩阵减: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/运算/减.xs", 7 | "name":"矩阵减", 8 | "w":140, 9 | "h":120, 10 | "th":50, 11 | "tw":140, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Matrix", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, { 26 | "type": "Port", 27 | "info": { 28 | "size":[5, 75, 20, 20], 29 | "dataType":"Matrix", 30 | "portType":"DataInput", 31 | "index":2 32 | } 33 | },{ 34 | "type": "Port", 35 | "info": { 36 | "size":[115, 60, 20, 20], 37 | "dataType":"Matrix", 38 | "portType":"DataOutput", 39 | "index":3 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/nodes/运算/矩阵/矩阵加: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "script":"script/运算/加.xs", 7 | "name":"矩阵加", 8 | "w":140, 9 | "h":120, 10 | "th":50, 11 | "tw":140, 12 | "radius":5 13 | } 14 | } 15 | , 16 | "controls":[ 17 | { 18 | "type": "Port", 19 | "info": { 20 | "size":[5, 45, 20, 20], 21 | "dataType":"Matrix", 22 | "portType":"DataInput", 23 | "index":1 24 | } 25 | }, { 26 | "type": "Port", 27 | "info": { 28 | "size":[5, 75, 20, 20], 29 | "dataType":"Matrix", 30 | "portType":"DataInput", 31 | "index":2 32 | } 33 | },{ 34 | "type": "Port", 35 | "info": { 36 | "size":[115, 60, 20, 20], 37 | "dataType":"Matrix", 38 | "portType":"DataOutput", 39 | "index":3 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/向量/三维向量分解.xs: -------------------------------------------------------------------------------- 1 | a=(port1[0],port1[1],port1[2]) 2 | port1=a 3 | port2=port1[0] 4 | port3=port1[1] 5 | port4=port1[2] -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/向量/三维向量显示.xs: -------------------------------------------------------------------------------- 1 | 2 | port2=port1 3 | label1=port1[0] 4 | label2=port1[1] 5 | label3=port1[2] -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/向量/三维向量输入.xs: -------------------------------------------------------------------------------- 1 | port1=(input1,input2,input3) -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/矩阵/33矩阵分解向量.xs: -------------------------------------------------------------------------------- 1 | port2=port1[0] 2 | port3=port1[1] 3 | port4=port1[2] -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/矩阵/33矩阵显示.xs: -------------------------------------------------------------------------------- 1 | 2 | port2=port1 3 | label1=port1[0][0] 4 | label2=port1[1][0] 5 | label3=port1[2][0] 6 | 7 | label4=port1[0][1] 8 | label5=port1[1][1] 9 | label6=port1[2][1] 10 | 11 | 12 | 13 | label7=port1[0][2] 14 | label8=port1[1][2] 15 | label9=port1[2][2] -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/矩阵/33矩阵输入.xs: -------------------------------------------------------------------------------- 1 | port1={input0,input1,input2;input3,input4,input5;input6,input7,input8} -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/矩阵/44矩阵输入.xs: -------------------------------------------------------------------------------- 1 | bug=input13 2 | 不知道什么原因,第14个矩阵元素似乎不能输入input13 3 | 4 | port1={input0,input1,input2,input3;input4,input5,input6,input7;input8,input9,input10,input11;input12,bug,input14,input15} -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/矩阵/任意矩阵分解.xs: -------------------------------------------------------------------------------- 1 | 2 | r1=input1-1 3 | r2=input2-1 4 | r3=input3-1 5 | port2=port1[r1] 6 | port3=port1[r2] 7 | port4=port1[r3] -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/运算/乘.xs: -------------------------------------------------------------------------------- 1 | port3=port1*port2 -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/运算/减.xs: -------------------------------------------------------------------------------- 1 | port3=port1-port2 -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/运算/加.xs: -------------------------------------------------------------------------------- 1 | port3=port1+port2 -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/运算/叉乘.xs: -------------------------------------------------------------------------------- 1 | port3=port1*port2 -------------------------------------------------------------------------------- /ProjectTemplate/向量和矩阵/script/运算/点乘.xs: -------------------------------------------------------------------------------- 1 | port3=port1.port2 -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/.description: -------------------------------------------------------------------------------- 1 | 利用强大的逻辑节点和可视化显示节点进行数字逻辑仿真 -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/.fcp: -------------------------------------------------------------------------------- 1 | { 2 | "currentRuningPath": "", 3 | "themName":"", 4 | "unitStepDelay":400, 5 | "audioAllowPlay":true 6 | 7 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/ProjectTemplate/数字逻辑/.png -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/.tag: -------------------------------------------------------------------------------- 1 | 数字逻辑 2 | 逻辑运算 3 | 仿真 4 | 模拟 -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/Image/and.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/ProjectTemplate/数字逻辑/Image/and.png -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/Image/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/ProjectTemplate/数字逻辑/Image/image.png -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/config/Them/浅色/GraphicsViewConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "BackgroundConfig": { 4 | "gridEnable":true, 5 | "gridSize": 30, 6 | "gridWidth":1, 7 | "gridColor": "#B6B6B6", 8 | "backColor": "#FDFEFD" 9 | } 10 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/config/Them/浅色/PortColorConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "PortDataTypeColor": { 4 | "Int": "#FF800080", 5 | "Float": "#FF0000CC", 6 | "Bool": "#FF0000", 7 | "String": "#FF00FF00", 8 | "Bit": "#887B68EE", 9 | "Vector": "#FFA500FF", 10 | "Matrix": "#ffd93a" 11 | }, 12 | "PortTypeColor": { 13 | "DataInput": "#000000", 14 | "DataOutput": "#000000", 15 | "TriggerInput": "#88A9A9A9", 16 | "TriggerOutput": "#88A9A9A9", 17 | "ProgramControlInput": "#FFFFFF", 18 | "ProgramControlOutput": "#FFFFFF" 19 | } 20 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/config/Them/默认/GraphicsViewConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "BackgroundConfig": { 4 | "gridEnable":true, 5 | "gridSize": 30, 6 | "gridWidth":1, 7 | "gridColor": "#777777", 8 | "backColor": "#484947" 9 | } 10 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/config/Them/默认/PortColorConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "PortDataTypeColor": { 4 | "Int": "#FF800080", 5 | "Float": "#FF0000CC", 6 | "Bool": "#FF0000", 7 | "String": "#FF00FF00", 8 | "Bit": "#887B68EE", 9 | "Vector": "#FFA500FF", 10 | "Matrix": "#ffd93a" 11 | }, 12 | "PortTypeColor": { 13 | "DataInput": "#000000", 14 | "DataOutput": "#000000", 15 | "TriggerInput": "#88A9A9A9", 16 | "TriggerOutput": "#88A9A9A9", 17 | "ProgramControlInput": "#FFFFFF", 18 | "ProgramControlOutput": "#FFFFFF" 19 | } 20 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/器件/J-K触发器: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "JK触发器", 7 | "scriptPath":"script/器件/JK触发器.xs", 8 | "backgroundSize": [ 0, 0, 135, 130 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 135, 40 ] 21 | } 22 | } 23 | , 24 | "controls":[ 25 | { 26 | "controlType": "Port", 27 | "info": { 28 | "portSize": [ 5, 45, 20, 20 ], 29 | "portIndex": 1, 30 | "portType": "DataInput", 31 | "portDataType": "Int" 32 | } 33 | }, { 34 | "controlType": "Port", 35 | "info": { 36 | "portSize": [ 105, 45, 20, 20 ], 37 | "portIndex": 2, 38 | "portType": "DataOutput", 39 | "portDataType": "Int" 40 | } 41 | }, 42 | { 43 | "controlType": "SwitchButton", 44 | "info": { 45 | "switchButtonSize": [ 5, 75, 40, 20 ], 46 | "buttonColor":"#303030", 47 | "buttonOpenColor":"#4C84E5", 48 | "switchColor":"#E4E2E2", 49 | "buttonIndex":1, 50 | "text":"J" 51 | } 52 | }, 53 | { 54 | "controlType": "SwitchButton", 55 | "info": { 56 | "switchButtonSize": [ 5, 100, 40, 20 ], 57 | "buttonColor":"#303030", 58 | "buttonOpenColor":"#4C84E5", 59 | "switchColor":"#E4E2E2", 60 | "buttonIndex":2, 61 | "text":"K" 62 | } 63 | } 64 | ] 65 | } 66 | -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/器件/整数01震荡器: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "01震荡器", 7 | "scriptPath":"script/器件/整数01震荡器.xs", 8 | "backgroundSize": [ 0, 0, 120, 70 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | } 23 | , 24 | "controls":[ 25 | { 26 | "controlType": "Port", 27 | "info": { 28 | "portSize": [ 95, 45, 20, 20 ], 29 | "portIndex": 1, 30 | "portType": "DataOutput", 31 | "portDataType": "Int" 32 | } 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/器件/整数自增器: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "自增器", 7 | "scriptPath":"script/器件/整数自增器.xs", 8 | "backgroundSize": [ 0, 0, 120, 70 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | } 23 | , 24 | "controls":[ 25 | { 26 | "controlType": "Port", 27 | "info": { 28 | "portSize": [ 90, 45, 20, 20 ], 29 | "portIndex": 1, 30 | "portType": "DataOutput", 31 | "portDataType": "Int" 32 | } 33 | }, { 34 | "controlType": "Text", 35 | "info": { 36 | "inputSize": [ 5, 45, 50, 20 ], 37 | "backgroundColor":"#fffff99", 38 | "textColor":"#ffffffff", 39 | "text":"0", 40 | "inputIndex":1 41 | } 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/器件/翻转器: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "翻转器", 7 | "scriptPath":"script/器件/翻转器.xs", 8 | "backgroundSize": [ 0, 0, 135, 100 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 135, 40 ] 21 | } 22 | } 23 | , 24 | "controls":[ 25 | { 26 | "controlType": "Port", 27 | "info":{ 28 | "portSize": [ 5, 45, 20, 20 ], 29 | "portIndex": 1, 30 | "portType": "DataInput", 31 | "portDataType": "Int" 32 | } 33 | },{ 34 | "controlType": "Port", 35 | "info":{ 36 | "portSize": [ 105, 45, 20, 20 ], 37 | "portIndex": 2, 38 | "portType": "DataOutput", 39 | "portDataType": "Int" 40 | } 41 | },{ 42 | "controlType": "SwitchButton", 43 | "info":{ 44 | "switchButtonSize": [ 5, 75, 40, 20 ], 45 | "buttonColor":"#303030", 46 | "buttonOpenColor":"#4C84E5", 47 | "switchColor":"#E4E2E2", 48 | "buttonIndex":1, 49 | "text":"翻转" 50 | } 51 | } 52 | ] 53 | 54 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/显示/无背景文本: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "mainControl": 4 | { 5 | "controlType": "Node", 6 | "info":{ 7 | "nodeName": "", 8 | "scriptPath":"", 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "backgroundColor1": "#99000000", 14 | "backgroundColor2": "#99000000", 15 | "titleBackgroundColor1": "#00000000", 16 | "titleBackgroundColor2": "#00000000", 17 | "backgroundColorGradient": true, 18 | "titleBackgroundColorGradient": true, 19 | "radius": 10, 20 | "titleSize": [ 0, 5, 20, 20 ], 21 | "backgroundSize": [ 0, 0, 20, 20 ] 22 | } 23 | } 24 | , 25 | "controls":[ 26 | { 27 | "controlType": "Text", 28 | "info":{ 29 | "inputSize": [ 3, 25, 50, 20 ], 30 | "backgroundColor":"#00000000", 31 | "textColor":"#ffffffff", 32 | "text":"无背景文字", 33 | "inputIndex":1 34 | } 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/显示/红白文本: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "mainControl": 4 | { 5 | "controlType": "Node", 6 | "info":{ 7 | "nodeName": "", 8 | "scriptPath":"", 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "backgroundColor1": "#99000000", 14 | "backgroundColor2": "#99000000", 15 | "titleBackgroundColor1": "#00000000", 16 | "titleBackgroundColor2": "#00000000", 17 | "backgroundColorGradient": true, 18 | "titleBackgroundColorGradient": true, 19 | "radius": 10, 20 | "titleSize": [ 0, 5, 20, 20 ], 21 | "backgroundSize": [ 0, 0, 20, 20 ] 22 | } 23 | } 24 | , 25 | "controls":[ 26 | { 27 | "controlType": "Text", 28 | "info":{ 29 | "inputSize": [ 3, 25, 50, 20 ], 30 | "backgroundColor":"#660000", 31 | "textColor":"#ffffffff", 32 | "text":"红白文字", 33 | "inputIndex":1 34 | } 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/显示/黑白文本: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "mainControl": 4 | { 5 | "controlType": "Node", 6 | "info":{ 7 | "nodeName": "", 8 | "scriptPath":"", 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "backgroundColor1": "#99000000", 14 | "backgroundColor2": "#99000000", 15 | "titleBackgroundColor1": "#00000000", 16 | "titleBackgroundColor2": "#00000000", 17 | "backgroundColorGradient": true, 18 | "titleBackgroundColorGradient": true, 19 | "radius": 10, 20 | "titleSize": [ 0, 5, 20, 20 ], 21 | "backgroundSize": [ 0, 0, 20, 20 ] 22 | } 23 | } 24 | , 25 | "controls":[ 26 | { 27 | "controlType": "Text", 28 | "info":{ 29 | "inputSize": [ 3, 25, 50, 20 ], 30 | "backgroundColor":"#000000", 31 | "textColor":"#ffffffff", 32 | "text":"黑白文本", 33 | "inputIndex":1 34 | } 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/程序/开始: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Start", 5 | "info":{ 6 | "nodeName": "开始", 7 | "scriptPath":"", 8 | "normalBorder": "#00000000", 9 | "selectBorder": "#ffffff", 10 | "normalBrush": "#ffffff", 11 | "selectBrush": "#ffffff", 12 | "backgroundColor1": "#FF000000", 13 | "backgroundColor2": "#99000000", 14 | "titleBackgroundColor1": "#AA800000", 15 | "titleBackgroundColor2": "#00000000", 16 | "backgroundColorGradient": true, 17 | "titleBackgroundColorGradient": true, 18 | "radius": 10, 19 | "titleSize": [ 0, 0, 120, 40 ], 20 | "backgroundSize": [ 0, 0, 120, 100 ] 21 | } 22 | } 23 | , 24 | "controls":[ 25 | { 26 | "controlType": "Port", 27 | "info":{ 28 | "portSize": [ 90, 5, 20, 20 ], 29 | "portIndex": 0, 30 | "portType": "ProgramControlOutput" 31 | } 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/程序/结束: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "结束", 7 | "scriptPath":"", 8 | "normalBorder": "#00000000", 9 | "selectBorder": "#ffffff", 10 | "normalBrush": "#ffffff", 11 | "selectBrush": "#ffffff", 12 | "backgroundColor1": "#FF000000", 13 | "backgroundColor2": "#99000000", 14 | "titleBackgroundColor1": "#AA800000", 15 | "titleBackgroundColor2": "#00000000", 16 | "backgroundColorGradient": true, 17 | "titleBackgroundColorGradient": true, 18 | "radius": 10, 19 | "titleSize": [ 0, 0, 120, 40 ], 20 | "backgroundSize": [ 0, 0, 120, 150 ] 21 | } 22 | } 23 | , 24 | "controls":[ 25 | { 26 | "controlType": "Port", 27 | "info":{ 28 | "portSize": [ 5, 5, 20, 20 ], 29 | "portIndex": 0, 30 | "portType": "ProgramControlInput" 31 | } 32 | }, 33 | { 34 | "controlType": "Port", 35 | "info":{ 36 | "portSize": [ 5, 45, 20, 20 ], 37 | "portIndex": 1, 38 | "portType": "DataInput", 39 | "portDataType": "Int" 40 | } 41 | }, { 42 | "controlType": "Port", 43 | "info":{ 44 | "portSize": [ 5, 75, 20, 20 ], 45 | "portIndex": 2, 46 | "portType": "DataInput", 47 | "portDataType": "Int" 48 | } 49 | } 50 | 51 | 52 | ] 53 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/输入/开关: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "开关", 7 | "scriptPath":"script/输入/开关.xs", 8 | "normalBorder": "#00000000", 9 | "selectBorder": "#ffffff", 10 | "normalBrush": "#ffffff", 11 | "selectBrush": "#ffffff", 12 | "backgroundColor1": "#FF000000", 13 | "backgroundColor2": "#99000000", 14 | "titleBackgroundColor1": "#FF800080", 15 | "titleBackgroundColor2": "#00000000", 16 | "backgroundColorGradient": true, 17 | "titleBackgroundColorGradient": true, 18 | "radius": 10, 19 | "titleSize": [ 0, 0, 120, 40 ], 20 | "backgroundSize": [ 0, 0, 120, 70 ] 21 | } 22 | } 23 | , 24 | "controls":[ 25 | { 26 | "controlType": "Port", 27 | "info":{ 28 | "portSize": [ 90, 45, 20, 20 ], 29 | "portIndex": 1, 30 | "portType": "DataOutput", 31 | "portDataType": "Int" 32 | } 33 | }, 34 | { 35 | "controlType": "SwitchButton", 36 | "info":{ 37 | "switchButtonSize": [ 5, 45, 40, 20 ], 38 | "buttonColor":"#303030", 39 | "buttonOpenColor":"#4C84E5", 40 | "switchColor":"#E4E2E2", 41 | "buttonIndex":1, 42 | "text":"" 43 | } 44 | } 45 | ] 46 | 47 | 48 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/输入/真开关: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "开关", 7 | "scriptPath":"script/输入/开关.xs", 8 | "normalBorder": "#00000000", 9 | "selectBorder": "#ffffff", 10 | "normalBrush": "#ffffff", 11 | "selectBrush": "#ffffff", 12 | "backgroundColor1": "#00000000", 13 | "backgroundColor2": "#00000000", 14 | "titleBackgroundColor1": "#00000000", 15 | "titleBackgroundColor2": "#00000000", 16 | "backgroundColorGradient": true, 17 | "titleBackgroundColorGradient": true, 18 | "radius": 10, 19 | "titleSize": [ 0, 0, 100, 40 ], 20 | "backgroundSize": [ 0, 0, 80, 50 ] 21 | } 22 | } 23 | , 24 | "controls":[ 25 | { 26 | "controlType": "Port", 27 | "info":{ 28 | "portSize": [ 50, 30, 20, 20 ], 29 | "portIndex": 1, 30 | "portType": "DataOutput", 31 | "portDataType": "Int" 32 | } 33 | }, 34 | { 35 | "controlType": "SwitchButton", 36 | "info":{ 37 | "switchButtonSize": [ 5, 30, 40, 20 ], 38 | "buttonColor":"#303030", 39 | "buttonOpenColor":"#4C84E5", 40 | "switchColor":"#E4E2E2", 41 | "buttonIndex":1, 42 | "text":"" 43 | } 44 | } 45 | ] 46 | 47 | 48 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/输入/输入: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "输入", 7 | "scriptPath":"script/输入/Input_1.xs", 8 | "backgroundSize": [ 0, 0, 120, 70 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor2": "#99000000", 15 | "titleBackgroundColor1": "#FF800080", 16 | "titleBackgroundColor2": "#00000000", 17 | "backgroundColorGradient": true, 18 | "titleBackgroundColorGradient": true, 19 | "titleSize": [ 0, 0, 120, 40 ] 20 | } 21 | }, 22 | "controls":[ 23 | { 24 | "controlType": "Text", 25 | "info":{ 26 | "inputSize": [ 5, 45, 50, 20 ], 27 | "backgroundColor":"#fffff99", 28 | "textColor":"#ffffffff", 29 | "text":"0", 30 | "inputIndex":1 31 | } 32 | }, 33 | { 34 | "controlType": "Port", 35 | "info":{ 36 | "portSize": [ 90, 45, 20, 20 ], 37 | "portIndex": 1, 38 | "portType": "DataOutput", 39 | "portDataType": "Int" 40 | } 41 | } 42 | ] 43 | 44 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/运算/与: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "与", 7 | "scriptPath":"script/运算/And.xs", 8 | "backgroundSize": [ 0, 0, 120, 100 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | }, 23 | "controls":[ 24 | { 25 | "controlType": "Port", 26 | "info":{ 27 | "portSize": [ 5, 45, 20, 20 ], 28 | "portIndex": 1, 29 | "portType": "DataInput", 30 | "portDataType": "Int" 31 | } 32 | }, { 33 | "controlType": "Port", 34 | "info":{ 35 | "portSize": [ 5, 75, 20, 20 ], 36 | "portIndex": 2, 37 | "portType": "DataInput", 38 | "portDataType": "Int" 39 | } 40 | }, { 41 | "controlType": "Port", 42 | "info":{ 43 | "portSize": [ 90, 65, 20, 20 ], 44 | "portIndex": 3, 45 | "portType": "DataOutput", 46 | "portDataType": "Int" 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/运算/与(图形): -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "", 7 | "scriptPath":"script/运算/And.xs", 8 | "backgroundSize": [ 0, 0, 100, 90 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#00000000", 15 | "backgroundColor2": "#00000000", 16 | "titleBackgroundColor1": "#00000000", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | }, 23 | "controls":[ 24 | { 25 | "controlType": "Port", 26 | "info":{ 27 | "portSize": [ 3, 25, 15, 15 ], 28 | "portIndex": 1, 29 | "portType": "DataInput", 30 | "portDataType": "Int" 31 | } 32 | }, { 33 | "controlType": "PictureBox", 34 | "info":{ 35 | "imageSize": [ 5, 5, 20, 20 ], 36 | "imagePath": "/Image/and.png" 37 | } 38 | }, 39 | { 40 | "controlType": "Port", 41 | "info":{ 42 | "portSize": [ 3, 72, 15, 15 ], 43 | "portIndex": 2, 44 | "portType": "DataInput", 45 | "portDataType": "Int" 46 | } 47 | }, { 48 | "controlType": "Port", 49 | "info":{ 50 | "portSize": [ 96, 45, 15, 15 ], 51 | "portIndex": 3, 52 | "portType": "DataOutput", 53 | "portDataType": "Int" 54 | } 55 | } 56 | ] 57 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/运算/乘: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "乘", 7 | "scriptPath":"script/运算/Mul.xs", 8 | "backgroundSize": [ 0, 0, 120, 100 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | }, 23 | "controls":[ 24 | { 25 | "controlType": "Port", 26 | "info":{ 27 | "portSize": [ 5, 45, 20, 20 ], 28 | "portIndex": 1, 29 | "portType": "DataInput", 30 | "portDataType": "Int" 31 | } 32 | }, { 33 | "controlType": "Port", 34 | "info":{ 35 | "portSize": [ 5, 75, 20, 20 ], 36 | "portIndex": 2, 37 | "portType": "DataInput", 38 | "portDataType": "Int" 39 | } 40 | }, { 41 | "controlType": "Port", 42 | "info":{ 43 | "portSize": [ 90, 65, 20, 20 ], 44 | "portIndex": 3, 45 | "portType": "DataOutput", 46 | "portDataType": "Int" 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/运算/减: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "减", 7 | "scriptPath":"script/运算/Sub.xs", 8 | "backgroundSize": [ 0, 0, 120, 100 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | }, 23 | "controls":[ 24 | { 25 | "controlType": "Port", 26 | "info":{ 27 | "portSize": [ 5, 45, 20, 20 ], 28 | "portIndex": 1, 29 | "portType": "DataInput", 30 | "portDataType": "Int" 31 | } 32 | }, { 33 | "controlType": "Port", 34 | "info":{ 35 | "portSize": [ 5, 75, 20, 20 ], 36 | "portIndex": 2, 37 | "portType": "DataInput", 38 | "portDataType": "Int" 39 | } 40 | }, { 41 | "controlType": "Port", 42 | "info":{ 43 | "portSize": [ 90, 65, 20, 20 ], 44 | "portIndex": 3, 45 | "portType": "DataOutput", 46 | "portDataType": "Int" 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/运算/加: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "加", 7 | "scriptPath":"script/运算/Add.xs", 8 | "backgroundSize": [ 0, 0, 120, 100 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | }, 23 | "controls":[ 24 | { 25 | "controlType": "Port", 26 | "info":{ 27 | "portSize": [ 5, 45, 20, 20 ], 28 | "portIndex": 1, 29 | "portType": "DataInput", 30 | "portDataType": "Int" 31 | } 32 | }, { 33 | "controlType": "Port", 34 | "info":{ 35 | "portSize": [ 5, 75, 20, 20 ], 36 | "portIndex": 2, 37 | "portType": "DataInput", 38 | "portDataType": "Int" 39 | } 40 | }, { 41 | "controlType": "Port", 42 | "info":{ 43 | "portSize": [ 90, 65, 20, 20 ], 44 | "portIndex": 3, 45 | "portType": "DataOutput", 46 | "portDataType": "Int" 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/运算/或: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "或", 7 | "scriptPath":"script/运算/Or.xs", 8 | "backgroundSize": [ 0, 0, 120, 100 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | }, 23 | "controls":[ 24 | { 25 | "controlType": "Port", 26 | "info":{ 27 | "portSize": [ 5, 45, 20, 20 ], 28 | "portIndex": 1, 29 | "portType": "DataInput", 30 | "portDataType": "Int" 31 | } 32 | }, { 33 | "controlType": "Port", 34 | "info":{ 35 | "portSize": [ 5, 75, 20, 20 ], 36 | "portIndex": 2, 37 | "portType": "DataInput", 38 | "portDataType": "Int" 39 | } 40 | }, { 41 | "controlType": "Port", 42 | "info":{ 43 | "portSize": [ 90, 65, 20, 20 ], 44 | "portIndex": 3, 45 | "portType": "DataOutput", 46 | "portDataType": "Int" 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/运算/除: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "除", 7 | "scriptPath":"script/运算/Div.xs", 8 | "backgroundSize": [ 0, 0, 120, 100 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | }, 23 | "controls":[ 24 | { 25 | "controlType": "Port", 26 | "info":{ 27 | "portSize": [ 5, 45, 20, 20 ], 28 | "portIndex": 1, 29 | "portType": "DataInput", 30 | "portDataType": "Int" 31 | } 32 | }, { 33 | "controlType": "Port", 34 | "info":{ 35 | "portSize": [ 5, 75, 20, 20 ], 36 | "portIndex": 2, 37 | "portType": "DataInput", 38 | "portDataType": "Int" 39 | } 40 | }, { 41 | "controlType": "Port", 42 | "info":{ 43 | "portSize": [ 90, 65, 20, 20 ], 44 | "portIndex": 3, 45 | "portType": "DataOutput", 46 | "portDataType": "Int" 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/nodes/运算/非: -------------------------------------------------------------------------------- 1 | { 2 | "mainControl": 3 | { 4 | "controlType": "Node", 5 | "info":{ 6 | "nodeName": "非", 7 | "scriptPath":"script/运算/Not.xs", 8 | "backgroundSize": [ 0, 0, 120, 70 ], 9 | "normalBorder": "#00000000", 10 | "selectBorder": "#ffffff", 11 | "normalBrush": "#ffffff", 12 | "selectBrush": "#ffffff", 13 | "radius": 10, 14 | "backgroundColor1": "#FF000000", 15 | "backgroundColor2": "#99000000", 16 | "titleBackgroundColor1": "#FF800080", 17 | "titleBackgroundColor2": "#00000000", 18 | "backgroundColorGradient": true, 19 | "titleBackgroundColorGradient": true, 20 | "titleSize": [ 0, 0, 120, 40 ] 21 | } 22 | }, 23 | "controls":[ 24 | { 25 | "controlType": "Port", 26 | "info":{ 27 | "portSize": [ 5, 45, 20, 20 ], 28 | "portIndex": 1, 29 | "portType": "DataInput", 30 | "portDataType": "Int" 31 | } 32 | }, 33 | { 34 | "controlType": "Port", 35 | "info":{ 36 | "portSize": [ 90, 45, 20, 20 ], 37 | "portIndex": 2, 38 | "portType": "DataOutput", 39 | "portDataType": "Int" 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/script/testscript.xs: -------------------------------------------------------------------------------- 1 | a=1 2 | b=2 3 | port2=a 4 | port3=b 5 | port1=port2+port3 -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/script/器件/JK触发器.xs: -------------------------------------------------------------------------------- 1 | IF switchbutton1 2 | GOTO:s 3 | GOTO:fd 4 | RETURN 5 | 6 | fd:: 7 | IF switchbutton2 8 | GOTO:s 9 | RETURN 10 | 11 | 12 | s:: 13 | IF switchbutton1&&switchbutton2 14 | GOTO:JK11 15 | IF switchbutton1 16 | GOTO:JK10 17 | IF switchbutton2 18 | GOTO:JK01 19 | RETURN 20 | 21 | 22 | JK11:: 23 | IF port1==1 24 | port2=0 25 | IF port1==0 26 | port2=1 27 | RETURN 28 | 29 | JK10:: 30 | port2=1 31 | RETURN 32 | 33 | JK01:: 34 | port2=0 35 | RETURN 36 | -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/script/器件/整数01震荡器.xs: -------------------------------------------------------------------------------- 1 | IF port1==0 2 | GOTO:flag 3 | port1=0 4 | RETURN 5 | flag:: 6 | port1=1 -------------------------------------------------------------------------------- /ProjectTemplate/数字逻辑/script/器件/整数自增器.xs: -------------------------------------------------------------------------------- 1 | start:: 2 | IF port1 3 | (1) 用户利用内置的蓝图模板低代码业务流程的搭建:系统应提供丰富的内置蓝图模板,涵盖常见的业务流程和功能需求,用户可以通过选择合适的模板来快速构建业务流程,无需从零开始。
4 | (2) 用户自己编辑自己的蓝图节点,进行更加复杂的程序流程的搭建:系统应提供图形化界面,允许用户自定义编辑蓝图节点,包括节点的输入输出、逻辑处理和参数设置等,以满足用户对程序流程的个性化需求。
5 | (3) 用户可以根据自己的多个业务需求,进行多样化的蓝图搭配:系统应具备灵活性和扩展性,允许用户根据不同的业务需求组合和搭配不同的蓝图模板和自定义节点,实现多样化的业务流程。
6 | (4) 用户可以针对单个节点进行单独测试:系统应提供一个单元测试模块,允许用户选择特定的节点并输入测试数据,然后运行节点的脚本代码进行测试。测试结果应该即时反馈给用户,以帮助用户验证节点的功能和逻辑是否正确。
7 | (5) 集成开发环境(IDE):系统提供一个类似于IDE的编辑器界面,用户可以在其中编写脚本和节点代码。该编辑器可以帮助用户编写更加规范和高效的代码。
8 | ![image](https://github.com/CinXiao/FLowCraft/assets/54227677/c0d7b548-6d55-4134-9f0e-04b26596eaf1) 9 | ![image](https://github.com/CinXiao/FLowCraft/assets/54227677/be850f71-7aa9-4502-9f13-042dbbf7e53d) 10 | ![image](https://github.com/CinXiao/FLowCraft/assets/54227677/d662e3bb-6880-49a8-a45b-32d3b84bcf94) 11 | ![image](https://github.com/CinXiao/FLowCraft/assets/54227677/24a03caa-e6ce-4bf2-a116-63665b515a2d) 12 | ![image](https://github.com/CinXiao/FLowCraft/assets/54227677/7d4d6b3f-39bc-432b-91ea-9a8bccfb21a3) 13 | 14 | 15 | -------------------------------------------------------------------------------- /Resource/HelpPage/Pages/Softwareinterface.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |

返回帮助主页

10 |

FlowCraft软件界面介绍

11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Resource/HelpPage/imgs/de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/HelpPage/imgs/de.png -------------------------------------------------------------------------------- /Resource/HelpPage/imgs/g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/HelpPage/imgs/g.png -------------------------------------------------------------------------------- /Resource/HelpPage/imgs/how.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/HelpPage/imgs/how.png -------------------------------------------------------------------------------- /Resource/HelpPage/imgs/label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/HelpPage/imgs/label.png -------------------------------------------------------------------------------- /Resource/HelpPage/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/HelpPage/imgs/logo.png -------------------------------------------------------------------------------- /Resource/HelpPage/imgs/use.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/HelpPage/imgs/use.png -------------------------------------------------------------------------------- /Resource/HelpPage/style.css: -------------------------------------------------------------------------------- 1 |  2 | /* 表格样式 */ 3 | table { 4 | border-collapse: collapse; 5 | width: 100%; 6 | } 7 | 8 | th, td { 9 | border: 1px solid #ddd; 10 | padding: 8px; 11 | text-align: left; 12 | } 13 | 14 | th { 15 | background-color: #f2f2f2; 16 | } 17 | 18 | /* A 标签样式 */ 19 | a { 20 | color: #007bff; 21 | text-decoration: none; 22 | } 23 | 24 | a:hover { 25 | text-decoration: underline; 26 | } 27 | 28 | h1 { 29 | color: #333; 30 | font-size: 28px; 31 | margin-bottom: 20px; 32 | } 33 | 34 | /* H2 标签样式 */ 35 | h2 { 36 | color: #666; 37 | font-size: 24px; 38 | margin-bottom: 16px; 39 | } 40 | 41 | h3 { 42 | color: #666; 43 | font-size: 20px; 44 | } 45 | /* P 标签样式 */ 46 | p { 47 | color: #444; 48 | font-size: 16px; 49 | line-height: 1.5; 50 | margin-bottom: 16px; 51 | } 52 | 53 | 54 | 55 | /* 一级列表项链接样式 */ 56 | ul > li > a { 57 | font-weight: bold; 58 | color: #333; 59 | text-decoration: none; 60 | } 61 | 62 | ul li { 63 | margin-bottom: 10px; /*设置每个列表项之间的垂直间距为5像素 */ 64 | } 65 | /* 二级列表项样式 */ 66 | ul > li > ul { 67 | list-style-type: none; 68 | } 69 | 70 | /* 二级列表项链接样式 */ 71 | ul > li > ul > li > a { 72 | color: #007bff; 73 | text-decoration: none; 74 | } 75 | -------------------------------------------------------------------------------- /Resource/Script/Int_Add.x: -------------------------------------------------------------------------------- 1 | a=Port1; 2 | b=Port2; 3 | c1=a+b; 4 | c2=a-b; 5 | Port3=c1+c2; 6 | -------------------------------------------------------------------------------- /Resource/icon/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/button.png -------------------------------------------------------------------------------- /Resource/icon/chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/chart.png -------------------------------------------------------------------------------- /Resource/icon/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/check.png -------------------------------------------------------------------------------- /Resource/icon/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/clock.png -------------------------------------------------------------------------------- /Resource/icon/clsoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/clsoe.png -------------------------------------------------------------------------------- /Resource/icon/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/code.png -------------------------------------------------------------------------------- /Resource/icon/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/copy.png -------------------------------------------------------------------------------- /Resource/icon/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/delete.png -------------------------------------------------------------------------------- /Resource/icon/deleteLine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/deleteLine.png -------------------------------------------------------------------------------- /Resource/icon/deleteLine.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/deleteLine.psd -------------------------------------------------------------------------------- /Resource/icon/deleteNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/deleteNode.png -------------------------------------------------------------------------------- /Resource/icon/deleteNode.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/deleteNode.psd -------------------------------------------------------------------------------- /Resource/icon/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/edit.png -------------------------------------------------------------------------------- /Resource/icon/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/folder.png -------------------------------------------------------------------------------- /Resource/icon/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/help.png -------------------------------------------------------------------------------- /Resource/icon/json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/json.png -------------------------------------------------------------------------------- /Resource/icon/label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/label.png -------------------------------------------------------------------------------- /Resource/icon/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/logo.png -------------------------------------------------------------------------------- /Resource/icon/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/new.png -------------------------------------------------------------------------------- /Resource/icon/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/node.png -------------------------------------------------------------------------------- /Resource/icon/nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/nodes.png -------------------------------------------------------------------------------- /Resource/icon/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/paste.png -------------------------------------------------------------------------------- /Resource/icon/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/photo.jpg -------------------------------------------------------------------------------- /Resource/icon/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/picture.png -------------------------------------------------------------------------------- /Resource/icon/picturebox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/picturebox.png -------------------------------------------------------------------------------- /Resource/icon/port.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/port.png -------------------------------------------------------------------------------- /Resource/icon/radiobutton_false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/radiobutton_false.png -------------------------------------------------------------------------------- /Resource/icon/radiobutton_true.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/radiobutton_true.png -------------------------------------------------------------------------------- /Resource/icon/rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/rename.png -------------------------------------------------------------------------------- /Resource/icon/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/run.png -------------------------------------------------------------------------------- /Resource/icon/runonce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/runonce.png -------------------------------------------------------------------------------- /Resource/icon/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/save.png -------------------------------------------------------------------------------- /Resource/icon/saveAs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/saveAs.png -------------------------------------------------------------------------------- /Resource/icon/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/select.png -------------------------------------------------------------------------------- /Resource/icon/select.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/select.psd -------------------------------------------------------------------------------- /Resource/icon/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/setting.png -------------------------------------------------------------------------------- /Resource/icon/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/stop.png -------------------------------------------------------------------------------- /Resource/icon/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/switch.png -------------------------------------------------------------------------------- /Resource/icon/switch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/switch_close.png -------------------------------------------------------------------------------- /Resource/icon/switch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/switch_open.png -------------------------------------------------------------------------------- /Resource/icon/未标题-1.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/未标题-1.psd -------------------------------------------------------------------------------- /Resource/icon/未标题ss-1.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Resource/icon/未标题ss-1.psd -------------------------------------------------------------------------------- /Script/CodeLine.cpp: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Script/CodeLine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | namespace ScriptModule 4 | { 5 | 6 | enum ExprssionType { 7 | NONE_Exp,//空语句 8 | Assignment_Exp,//赋值 9 | Jump_Exp,//跳转 10 | Label_Exp,//标号 11 | Finish_Exp,//结束 12 | Judge_Exp,//判断 13 | Handle_Exp,//默认行为 14 | }; 15 | 16 | 17 | class Expression 18 | { 19 | public: 20 | ExprssionType type{ NONE_Exp }; 21 | //根据代码行判断表达式类型 22 | Expression() {}; 23 | Expression(QString codeline) { 24 | code = codeline.replace(" ", ""); 25 | if (codeline.contains("=")&& codeline.count("=")==1) 26 | type = Assignment_Exp; 27 | else if (codeline.contains("IF")) 28 | type = Judge_Exp; 29 | else if (codeline.contains("GOTO:")) 30 | type = Jump_Exp; 31 | else if (codeline.contains("::")) 32 | type = Label_Exp; 33 | else if (codeline.contains("RETURN")) 34 | type = Finish_Exp; 35 | else 36 | type = Handle_Exp; 37 | }; 38 | QString code;//代码 39 | }; 40 | 41 | 42 | } -------------------------------------------------------------------------------- /Script/Handle/ExpressionParser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Script/Handle/ExpressionParser.cpp -------------------------------------------------------------------------------- /Script/Handle/ExpressionParser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Script/Handle/ExpressionParser.h -------------------------------------------------------------------------------- /Script/Handle/Functions/ChartFunction.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Script/Handle/Functions/ChartFunction.h -------------------------------------------------------------------------------- /Script/Handle/Functions/MathFunction.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Script/Handle/Functions/MathFunction.h -------------------------------------------------------------------------------- /Script/Handle/Functions/NetWorkFunction.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/Script/Handle/Functions/NetWorkFunction.h -------------------------------------------------------------------------------- /Script/ScriptObject.cpp: -------------------------------------------------------------------------------- 1 | #include "ScriptObject.h" 2 | namespace ScriptModule { 3 | ScriptObject::ScriptObject(QString Path) :ScriptPath(Path) 4 | { 5 | } 6 | ScriptObject::ScriptObject() 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /Script/ScriptObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ScriptModule 5 | { 6 | class ScriptObject 7 | { 8 | public: 9 | ScriptObject(QString Path); 10 | ScriptObject(); 11 | //脚本路径 12 | QString ScriptPath{}; 13 | //脚本 14 | QString Script; 15 | 16 | }; 17 | } -------------------------------------------------------------------------------- /UI/Launcher/CreatNewProject.h: -------------------------------------------------------------------------------- 1 | #ifndef CREATNEWPROJECT_H 2 | #define CREATNEWPROJECT_H 3 | 4 | #include 5 | #include 6 | #include"../Widgets/ToolWidget/TemplateItemWidget.h" 7 | namespace Ui { 8 | class CreatNewProject; 9 | } 10 | 11 | class CreatNewProject : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit CreatNewProject(QWidget *parent = nullptr); 17 | ~CreatNewProject(); 18 | 19 | 20 | private slots: 21 | void on_selectPath_clicked(); 22 | 23 | void on_pushButton_3_clicked(); 24 | signals: 25 | void stringReturned(const QString &str); 26 | 27 | private: 28 | Ui::CreatNewProject *ui; 29 | QList< TemplateItemWidget *> QListWidgetItemList; 30 | TemplateItemWidget*selectTemplate{nullptr}; 31 | 32 | }; 33 | 34 | #endif // CREATNEWPROJECT_H 35 | -------------------------------------------------------------------------------- /UI/Launcher/Launcher.h: -------------------------------------------------------------------------------- 1 | #ifndef LAUNCHER_H 2 | #define LAUNCHER_H 3 | #include 4 | #include 5 | #include"CreatNewProject.h" 6 | #include"../Editor/MainWindow.h" 7 | #include"../Widgets/ToolWidget/ProjectItem.h" 8 | namespace Ui { 9 | class Launcher; 10 | } 11 | 12 | class Launcher : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | 17 | public: 18 | explicit Launcher(QWidget *parent = nullptr); 19 | ~Launcher(); 20 | 21 | private slots: 22 | void on_commandLinkButton_clicked(); 23 | 24 | void on_CreatProject_clicked(); 25 | 26 | void on_pushButton_clicked(); 27 | 28 | private: 29 | Ui::Launcher *ui; 30 | }; 31 | 32 | #endif // LAUNCHER_H 33 | -------------------------------------------------------------------------------- /UI/Widgets/CodeEditor/CodeEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef CODEEDITOR_H 2 | #define CODEEDITOR_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | typedef enum{ 8 | BROWSE, 9 | EDIT, 10 | }editorMode; 11 | 12 | class CodeEditor : public QPlainTextEdit 13 | { 14 | Q_OBJECT 15 | public: 16 | CodeEditor(QWidget*parent=nullptr); 17 | void setMode(editorMode mode); 18 | void lineNumberAreaPaintEvent(QPaintEvent *event); 19 | int lineNumberAreaWidth(); 20 | protected: 21 | void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; 22 | private slots: 23 | void updateLineNumberAreaWidth(int newBlockCount); 24 | void highlightCurrentLine(); 25 | void updateLineNumberArea(const QRect &, int); 26 | private: 27 | QWidget *lineNumberArea; 28 | }; 29 | class LineNumberArea : public QWidget 30 | { 31 | public: 32 | LineNumberArea(CodeEditor *editor) : QWidget(editor) { 33 | codeEditor = editor; 34 | } 35 | 36 | QSize sizeHint() const Q_DECL_OVERRIDE { 37 | return QSize(codeEditor->lineNumberAreaWidth(), 0); 38 | } 39 | 40 | protected: 41 | void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE { 42 | codeEditor->lineNumberAreaPaintEvent(event); 43 | } 44 | 45 | private: 46 | CodeEditor *codeEditor; 47 | }; 48 | #endif // CODEEDITOR_H 49 | -------------------------------------------------------------------------------- /UI/Widgets/CodeEditor/Highlighter.h: -------------------------------------------------------------------------------- 1 | #ifndef HIGHLIGHTER_H 2 | #define HIGHLIGHTER_H 3 | #include 4 | #include 5 | #include 6 | class XScriptHighlighter : public QSyntaxHighlighter 7 | { 8 | public: 9 | 10 | XScriptHighlighter(QTextDocument *parent = 0); 11 | 12 | protected: 13 | void highlightBlock(const QString &text) Q_DECL_OVERRIDE; 14 | private: 15 | struct HighlightingRule 16 | { 17 | QRegularExpression pattern; 18 | QTextCharFormat format; 19 | }; 20 | QRegularExpression commentStartExpression; 21 | QRegularExpression commentEndExpression; 22 | QVector highlightingRules; 23 | 24 | //关键字 25 | QTextCharFormat keywordFormat; 26 | //控件 27 | QTextCharFormat control_port_Format; 28 | QTextCharFormat control_chart_Format; 29 | QTextCharFormat control_input_Format; 30 | QTextCharFormat control_switchbutton_Format; 31 | QTextCharFormat control_button_Format; 32 | QTextCharFormat control_label_Format; 33 | //操作符 34 | QTextCharFormat operate_Format; 35 | 36 | 37 | QTextCharFormat singleLineKey; 38 | QTextCharFormat singleLineValue; 39 | 40 | QTextCharFormat singleLineCommentFormat; 41 | 42 | QTextCharFormat quotationFormat; 43 | QTextCharFormat functionFormat; 44 | }; 45 | 46 | #endif // HIGHLIGHTER_H 47 | -------------------------------------------------------------------------------- /UI/Widgets/NodeTreeWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include"../../Globe/RuningConfig.h" 15 | using namespace Globe; 16 | class NodeTreeWidget :public QTreeWidget 17 | { 18 | public: 19 | NodeTreeWidget(QWidget* parent = nullptr); 20 | void populateTree(const QDir& dir); 21 | 22 | 23 | 24 | private: 25 | void populateTree(const QDir& dir, QTreeWidgetItem* parentItem); 26 | QIcon folderIcon{ ":/NodeData/icon/folder.png" }; // 文件夹图标 27 | QIcon fileIcon{ ":/NodeData/icon/nodes.png" }; // 文件图标 28 | QIcon scriptIcon{ ":/NodeData/icon/code.png" }; // 脚本图标 29 | QIcon pictureIcon{ ":/NodeData/icon/picture.png" }; // 图片图标 30 | QIcon jsonIcon{ ":/NodeData/icon/json.png" }; // json图标 31 | 32 | QIcon renameIcon{ ":/NodeData/icon/rename.png" }; 33 | QIcon copyIcon{ ":/NodeData/icon/copy.png" }; 34 | QIcon pasteIcon{ ":/NodeData/icon/paste.png" }; 35 | QIcon deleteIcon{ ":/NodeData/icon/delete.png" }; 36 | 37 | void mousePressEvent(QMouseEvent* event); 38 | 39 | 40 | protected: 41 | bool dropMimeData(QTreeWidgetItem* parent, int index, const QMimeData* data, Qt::DropAction action) override; 42 | QMimeData* mimeData(const QList& items) const override; 43 | QDir targetDir{}; 44 | QString clipboard{ "" };//剪贴盘,用于存放复制的文件或者路径 45 | 46 | 47 | 48 | }; 49 | -------------------------------------------------------------------------------- /UI/Widgets/ToolWidget/ProjectItem.cpp: -------------------------------------------------------------------------------- 1 | #include "ProjectItem.h" 2 | #include "ui_ProjectItem.h" 3 | 4 | #include 5 | 6 | ProjectItem::ProjectItem(QString proName,QString path,QWidget *parent) : 7 | QWidget(parent), 8 | ui(new Ui::ProjectItem) 9 | { 10 | ui->setupUi(this); 11 | ProjectPath=path; 12 | ProjectName=proName; 13 | ui->ProjectName->setText(ProjectName); 14 | ui->projectPath->setText(ProjectPath); 15 | } 16 | 17 | ProjectItem::~ProjectItem() 18 | { 19 | delete ui; 20 | } 21 | -------------------------------------------------------------------------------- /UI/Widgets/ToolWidget/ProjectItem.h: -------------------------------------------------------------------------------- 1 | #ifndef PROJECTITEM_H 2 | #define PROJECTITEM_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class ProjectItem; 8 | } 9 | 10 | class ProjectItem : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit ProjectItem(QString proName,QString path,QWidget *parent = nullptr); 16 | ~ProjectItem(); 17 | QString ProjectPath{""}; 18 | QString ProjectName{""}; 19 | private: 20 | Ui::ProjectItem *ui; 21 | 22 | }; 23 | 24 | #endif // PROJECTITEM_H 25 | -------------------------------------------------------------------------------- /UI/Widgets/ToolWidget/SettingWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "SettingWidget.h" 2 | #include 3 | #include 4 | 5 | SettingWidget::SettingWidget(QWidget* parent) 6 | : QDialog(parent) 7 | { 8 | ui.setupUi(this); 9 | 10 | ui.photo->setVisible(false); 11 | 12 | //遍历所有主题文件 13 | QDir dir(RuningConfig::CurrentRuningPath + "/config/Them"); 14 | QStringList filters; 15 | filters << "*"; // 匹配所有文件和文件夹 16 | dir.setNameFilters(filters); 17 | dir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); // 只处理目录,不包括"."和".." 18 | QFileInfoList list = dir.entryInfoList(); 19 | for (const QFileInfo& fileInfo : list) { 20 | if (fileInfo.isDir()) { 21 | ui.them->addItem(fileInfo.fileName()); 22 | } 23 | } 24 | ui.them->setCurrentText(RuningConfig::ThemName); 25 | //改变主题 26 | connect(ui.them, &QComboBox::currentIndexChanged, [=]() 27 | { 28 | RuningConfig::ThemName = ui.them->currentText(); 29 | //刷新配置文件路径 30 | Globe::updateConfigfilePath(); 31 | Globe::initGlobeMap(); 32 | Globe::InitRuningConfig(); 33 | }); 34 | ui.audio->setChecked(RuningConfig::AudioAllowPlay); 35 | 36 | ui.clock->setValue(RuningConfig::UnitStepDelay); 37 | connect(ui.clock, &QSpinBox::valueChanged, [=](int var) { 38 | RuningConfig::UnitStepDelay = var; 39 | }); 40 | 41 | 42 | } 43 | 44 | SettingWidget::~SettingWidget() 45 | {} 46 | 47 | 48 | 49 | 50 | void SettingWidget::on_clock_valueChanged(int arg1) 51 | { 52 | if (arg1 == 1314) 53 | ui.photo->setVisible(true); 54 | else 55 | ui.photo->setVisible(false); 56 | 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /UI/Widgets/ToolWidget/SettingWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "ui_SettingWidget.h" 5 | #include"../../../Globe/RuningConfig.h" 6 | 7 | #include"../../../Globe/Map.h" 8 | using namespace::Globe; 9 | class SettingWidget : public QDialog 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | SettingWidget(QWidget *parent = nullptr); 15 | ~SettingWidget(); 16 | 17 | 18 | private slots: 19 | void on_clock_valueChanged(int arg1); 20 | 21 | private: 22 | Ui::SettingWidgetClass ui; 23 | }; 24 | -------------------------------------------------------------------------------- /UI/Widgets/ToolWidget/TemplateItemWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef TEMPLATEITEMWIDGET_H 2 | #define TEMPLATEITEMWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | namespace Ui { 9 | class TemplateItemWidget; 10 | } 11 | 12 | class TemplateItemWidget : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit TemplateItemWidget(QString tempName,QString Description,QStringList tags,QWidget *parent = nullptr); 18 | ~TemplateItemWidget(); 19 | void Select(); 20 | void DisSelect(); 21 | QString templatePath{""}; 22 | private: 23 | Ui::TemplateItemWidget *ui; 24 | bool isSelect{false}; 25 | 26 | protected: 27 | bool eventFilter(QObject *obj, QEvent *event)override; 28 | bool isMouseOver; // 用于跟踪鼠标是否在窗口上 29 | QColor hoverColor{Qt::gray}; // 鼠标悬停时的背景颜色 30 | QColor normalColor{Qt::white}; // 正常状态的背景颜色 31 | 32 | signals: 33 | void Selected(); 34 | }; 35 | 36 | #endif // TEMPLATEITEMWIDGET_H 37 | -------------------------------------------------------------------------------- /UI/Widgets/ToolWidget/nodeeditorwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEEDITORWIDGET_H 2 | #define NODEEDITORWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include"../NodeTreeWidget.h" 9 | #include 10 | #include 11 | #include"../../../Graphics/GraphicsItem/GraphicsNode.h" 12 | namespace Ui { 13 | class NodeEditorWidget; 14 | } 15 | 16 | class NodeEditorWidget : public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit NodeEditorWidget(QWidget* parent = nullptr); 22 | ~NodeEditorWidget(); 23 | 24 | QGraphicsItem* PreItem{ nullptr }; 25 | QString NodePath{}; 26 | QString ScriptPath{}; 27 | QGraphicsScene* scene{nullptr}; 28 | private slots: 29 | void on_Refresh_clicked(); 30 | 31 | protected: 32 | void keyPressEvent(QKeyEvent *event) override; 33 | 34 | 35 | private: 36 | Ui::NodeEditorWidget* ui; 37 | }; 38 | 39 | #endif // NODEEDITORWIDGET_H 40 | -------------------------------------------------------------------------------- /Utility/InterpreterUtility/Interpreter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | namespace Utility { 6 | 7 | class Interpreter { 8 | public: 9 | //算数表达式类型判断 10 | static bool isArithmeticExpression(const QString& expr); 11 | //逻辑表达式 12 | static bool isLogicalExpression(const QString& expr); 13 | //值类型判断 14 | static bool isInteger(const QString& str); 15 | // 16 | static bool isDecimal(const QString& str); 17 | //函数调用判断 18 | static bool isFunction(const QString& str); 19 | 20 | //向量检测 21 | static bool isVector(const QString& str); 22 | 23 | //矩阵检测 24 | static bool isMatrix(const QString& str); 25 | //下标访问检测 26 | static bool isSubscriptAccess(const QString& str); 27 | 28 | //取出对象和下标 29 | static std::pair> extractObjectNameAndIndices(const QString& input); 30 | 31 | static bool isHexadecimal(const QString& str); 32 | static bool isBool(const QString& str); 33 | static bool isString(const QString& str); 34 | static bool stringToBool(const QString& str); 35 | //拆分逻辑表达式 36 | static QStringList splitLogicalExpression(const QString& expression); 37 | //拆分表达式 38 | static QStringList splitExpression(const QString& expression); 39 | }; 40 | } -------------------------------------------------------------------------------- /Utility/JsonUtility/JsonUtility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | namespace Utility { 12 | class JsonUtility 13 | { 14 | public: 15 | //从文件中获取json字符串 16 | static QString GetJsonStringFromFile(const QString& filePath); 17 | //获取json指定属性的json字符串 18 | static QString GetJsonStringByProperty(const QString& jsonString, const QString& PropertyName); 19 | //获取json指定属性的json数组 20 | static QJsonArray GetArrayByProperty(const QString& jsonString, const QString& PropertyName); 21 | //获取json字符串指定属性的值 22 | static QJsonValue GetJsonValue(const QString& jsonString, const QString& ColorPropertyName); 23 | //通过属性获取QRectF 24 | static QRectF GetRectFromJson(const QString& jsonString, const QString& ColorPropertyName); 25 | 26 | //通过属性名获取颜色 27 | static QColor GetColorFromJson(const QString& jsonString, const QString& PropertyName); 28 | // 判断json字符串存不存在某个属性 29 | static bool JsonStringHasProperty(const QString& jsonString, const QString& propertyName); 30 | 31 | //把json文件保存到指定路径 32 | static void saveToJson(const QJsonDocument& jsonDocument, QString path); 33 | 34 | 35 | }; 36 | } -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include"Graphics/GraphicsView/graphicsview.h" 2 | #include 3 | #include 4 | #include 5 | #include"UI/Launcher/Launcher.h" 6 | #include"Globe/DataType.h" 7 | #include"UI/Widgets/CodeEditor/CodeEditor.h" 8 | #include"UI/Widgets/CodeEditor/Highlighter.h" 9 | #include 10 | #include 11 | #include 12 | using namespace GraphicsModule; 13 | using namespace Utility; 14 | int main(int argc, char* argv[]) 15 | { 16 | QLocale::setDefault(QLocale(QLocale::Chinese, QLocale::China)); 17 | QApplication a(argc, argv); 18 | 19 | 20 | 21 | 22 | 23 | Launcher* launcher = new Launcher(); 24 | launcher->show(); 25 | 26 | 27 | return a.exec(); 28 | } 29 | -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-arrow.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-busy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-busy.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-closedhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-closedhand.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-cross.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-forbidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-forbidden.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-hand.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-hsplit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-hsplit.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-ibeam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-ibeam.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-openhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-openhand.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizeall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-sizeall.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizeb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-sizeb.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizef.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-sizef.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizeh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-sizeh.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-sizev.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-uparrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-uparrow.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-vsplit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-vsplit.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-wait.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-whatsthis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CinXiao/FLowCraft/9a703489b1c6325076a97e8b75006c38f7963618/qtpropertybrowser/images/cursor-whatsthis.png -------------------------------------------------------------------------------- /qtpropertybrowser/qtbuttonpropertybrowser.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QTBUTTONPROPERTYBROWSER_H 5 | #define QTBUTTONPROPERTYBROWSER_H 6 | 7 | #include "qtpropertybrowser.h" 8 | 9 | QT_BEGIN_NAMESPACE 10 | 11 | class QtButtonPropertyBrowserPrivate; 12 | 13 | class QtButtonPropertyBrowser : public QtAbstractPropertyBrowser 14 | { 15 | Q_OBJECT 16 | public: 17 | QtButtonPropertyBrowser(QWidget *parent = 0); 18 | ~QtButtonPropertyBrowser(); 19 | 20 | void setExpanded(QtBrowserItem *item, bool expanded); 21 | bool isExpanded(QtBrowserItem *item) const; 22 | 23 | Q_SIGNALS: 24 | void collapsed(QtBrowserItem *item); 25 | void expanded(QtBrowserItem *item); 26 | 27 | protected: 28 | void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem) override; 29 | void itemRemoved(QtBrowserItem *item) override; 30 | void itemChanged(QtBrowserItem *item) override; 31 | 32 | private: 33 | QScopedPointer d_ptr; 34 | Q_DECLARE_PRIVATE(QtButtonPropertyBrowser) 35 | Q_DISABLE_COPY_MOVE(QtButtonPropertyBrowser) 36 | }; 37 | 38 | QT_END_NAMESPACE 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /qtpropertybrowser/qtgroupboxpropertybrowser.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QTGROUPBOXPROPERTYBROWSER_H 5 | #define QTGROUPBOXPROPERTYBROWSER_H 6 | 7 | #include "qtpropertybrowser.h" 8 | 9 | QT_BEGIN_NAMESPACE 10 | 11 | class QtGroupBoxPropertyBrowserPrivate; 12 | 13 | class QtGroupBoxPropertyBrowser : public QtAbstractPropertyBrowser 14 | { 15 | Q_OBJECT 16 | public: 17 | QtGroupBoxPropertyBrowser(QWidget *parent = 0); 18 | ~QtGroupBoxPropertyBrowser(); 19 | 20 | protected: 21 | void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem) override; 22 | void itemRemoved(QtBrowserItem *item) override; 23 | void itemChanged(QtBrowserItem *item) override; 24 | 25 | private: 26 | QScopedPointer d_ptr; 27 | Q_DECLARE_PRIVATE(QtGroupBoxPropertyBrowser) 28 | Q_DISABLE_COPY_MOVE(QtGroupBoxPropertyBrowser) 29 | }; 30 | 31 | QT_END_NAMESPACE 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /testwidget.cpp: -------------------------------------------------------------------------------- 1 | #include "testwidget.h" 2 | 3 | testwidget::testwidget(QWidget *parent) 4 | : QMainWindow(parent) 5 | {} 6 | 7 | testwidget::~testwidget() {} 8 | -------------------------------------------------------------------------------- /testwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTWIDGET_H 2 | #define TESTWIDGET_H 3 | 4 | #include 5 | 6 | class testwidget : public QMainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | testwidget(QWidget *parent = nullptr); 12 | ~testwidget(); 13 | }; 14 | #endif // TESTWIDGET_H 15 | --------------------------------------------------------------------------------