简体   繁体   English

流过 SysML 中的接口

[英]Flow through interface in SysML

I was wondering how it would be possible to relate, within a SySML block diagram, the data flowing through two components with the interfaces that they expose.我想知道如何在 SysSML 框图中将流经两个组件的数据与它们公开的接口联系起来。

As an example, assume that you have a supervisor component setting a reference for a lower level controller.例如,假设您有一个主管组件为较低级别的 controller 设置参考。 The controller exposes an interface Operations which features the operation set_reference() and this latter specifies a float parameter reference . controller 公开了一个接口Operations ,该接口具有操作set_reference() ,后者指定了一个浮点参数引用 The supervisor will use the interface to effectively set the reference for the lower level controller.主管将使用该接口有效地为较低级别的 controller 设置参考。 This operation tells that there exists a data flow between the two components (eg each component also has a flow port) and the exchanged data is the reference.该操作告诉两个组件之间存在数据(例如每个组件也有一个流端口),并且交换的数据是参考。 How would you model this scenario in SySML?你会如何 model 这个场景在 SySML 中? Does it exist a way to specify both the interface and the dataflow and say "look, this dataflow is realised through this interface".是否存在一种方法来指定接口和数据流并说“看,这个数据流是通过这个接口实现的”。

Thanks a lot for your help非常感谢你的帮助

A block definition diagram is usually not used to show the flows between components of your system.块定义图通常不用于显示系统组件之间的流程。 Instead you would use an internal block diagram of your system with the two parts s:Supervisor and c:Controller .相反,您将使用系统的内部框图,其中包含两部分s:Supervisorc:Controller

To specify that the controller provides the operation set_reference(r:float) you would use an InterfaceBlock as Type of a port of the controller .要指定 controller 提供操作set_reference(r:float)您可以使用 InterfaceBlock 作为controller的端口类型。 The same InterfaceBlock would be used as Type of a port of the supervisor .相同的 InterfaceBlock 将用作supervisor的端口的类型。 This time, however, conjugated.然而,这一次是共轭的。 That will be shown by prepending a ~ symbol.这将通过添加一个~符号来显示。 Then you need to connect them via their ports.然后你需要通过它们的端口连接它们。 This already suffices to specify that a float value can flow across the connector.这已经足以指定一个浮点值可以流过连接器。 Nothing else is needed.不需要其他任何东西。

However, sometimes you didn't decide yet, how to realize the flow (there is more than one possibility. The set_reference operation, as you have done it, a get_reference operation provided by supervisor or a flow property).但是,有时您还没有决定如何实现流程(有不止一种可能性set_reference操作,正如您所做的那样,由supervisor或流程属性提供的get_reference操作)。 So, you only want to specify the need for some item flowing, but not the mechanism.因此,您只想指定某些项目流动的需要,而不是机制。 In this case you could leave the ports without a type and model an ItemFlow across the connector.在这种情况下,您可以在没有类型的情况下保留端口,并且 model 在连接器上保留 ItemFlow。 It would be shown with a filled triangle placed somewhere near the center of the connector and labeled with the name and type of the flowing item.它将显示一个实心三角形,放置在连接器中心附近的某处,并标有流动项目的名称和类型。 A tool could even support you, by later creating the InterfaceBlocks and operations automatically.通过稍后自动创建接口块和操作,工具甚至可以为您提供支持。

As I said, if you already know, how you are going to realize the flow, modeling the ItemFlow is redundant.正如我所说,如果您已经知道如何实现流程,那么对 ItemFlow 建模是多余的。 Except of course, if you want to limit the possible values in your specific system.当然,如果您想限制特定系统中的可能值。 Lets say, double is a specific float , and in your system only doubles will be used, even though the controller could also handle singles .可以说, double是一个特定的float ,并且在您的系统中只会使用doubles ,即使 controller 也可以处理singles This can be expressed with an ItemFlow of Type double .这可以用double类型的 ItemFlow 来表示。

Some people prefer to only model ItemFlows and leave out the connectors.有些人更喜欢只使用 model ItemFlows 并省略连接器。 ItemFlows alone are shown as dashed arrows with the keyword «flow».单独的 ItemFlows 显示为带有关键字 «flow» 的虚线箭头。 I advise against this, because ItemFlows don't imply that the parts are connected (the flow could be realized by intermediary elements).我建议不要这样做,因为 ItemFlows 并不意味着这些部分是连接的(流程可以通过中间元素来实现)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过接口和项目结构进行依赖注入 - Dependency Injection through Interface and project structure 通过通用接口调用具体的类函数 - Invoke concrete class functions through common interface 通过接口公开单例类的正确方法 - proper way of exposing singleton class through interface 通过其方法的子集实现接口 - Implementing an interface through a subset of its methods 通过接口公开聚合与委托 - Exposing aggregation through the interface vs. delegation 如何通过实现适配器模式来隔离胖接口? - How can I segregate fat interface through implementing adaptern pattern? 通过其实例调用接口或抽象类方法 - Calling Interface or abstract class method through its instance 通过通用接口包装C#类以与多态性一起使用 - Wrapping C# classes to use with polymorphism through a common interface 通过接口检索未知类型数据的类型安全方法 - Typesafe method for retrieving data of unknown type through interface 通过“程序到接口”,如何良好的实践以及POJO中的瞬时对象/休眠对象中的模型如何? - How good practice and how is Transient Objects in POJO / Models in Hibernate Objects through “Program To Interface”?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM