Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么获取节点的连接关系 #11

Open
Jun1172 opened this issue Apr 19, 2023 · 2 comments
Open

怎么获取节点的连接关系 #11

Jun1172 opened this issue Apr 19, 2023 · 2 comments

Comments

@Jun1172
Copy link

Jun1172 commented Apr 19, 2023

你好,这个应该就是保存的stn文件的数据结构
我是想用这个描述PLC设备的工作流程,具体设想是这样的
1.编辑一些工作任务的节点,比如电机转动,继电器开关之类的,这个教程已经讲了,目前也知道怎么去编辑自己的节点
2.在edit界面实现任务的流程,就是先干啥后干啥这种,这个也没问题,直接拉线就行
3.把这个流程保存为json文件,需要知道节点前后级连接关系,或者知道stn文件的解析方式也行,这个不知道怎么做
4.把这个文件发给设备端,设备端解析出步骤,执行任务

请问怎么获取节点的前后级连接关系?

@DebugST
Copy link
Owner

DebugST commented Apr 20, 2023

每个节点都有In/OutOptions属性 是一个STNodeOption集合对象 通过调用STNodeOption.GetConnectedOption() 可以获取到已经链接的对象。。。通过遍历的方式可以获得所有连线关系。
如果你想知道文件是怎么解析的 你可以跟踪STNodeEditor.LoadCanvas()之类的函数。不过在现在我已经全部替换成了json文件格式。。不过将会在下一个版本放出。

@Jun1172
Copy link
Author

Jun1172 commented Apr 20, 2023

嗯嗯,谢谢,请问下一版本有计划什么时候上线么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants