11.25- cooling evaporator research project

Object-Oriented Software Development

  • Make full use of inheritance, enhanced code reuse
  • Using the inheritance mechanism requires a strong ability to abstract thinking

About operator framework

  • Bypassing the task tree
    • This sample project intentionally in a position to interrupt the task tree . "Cooler" and "cooler controller" operator tasks in different branches of the tree, but the present sample project to both the current class queues to be sent to the other party , so that they can communicate with each other directly. The code is contained in "operator core", "air-cooling system application" class method.
    • It communicates directly reason, according to the present exemplary embodiment the design project, and a controller coupled to each other cooler operator height. A cooler and a controller be used in conjunction. You do not have to send messages "Application" operator.
  • Why do not bypass the task tree
    • Task tree destroyed the AF integrity framework
    • In fact, if one of two sub-let the operator is able to communicate directly, the final architecture will be the operator of each child is an independent individual, such architectures and ROS consistent distributed system.
    • But, in fact, we do not need such a framework, we just need an architecture: each sub-operator is controlled, the main operator after the planning decision whether to send a message to the sub-operator, and the operator only child it performs a corresponding action after receiving the message
    • ROS message mechanism is slightly different, all messages are stored in a so-called "Message Manager" node, other nodes can choose to send a message to the node or acquired from the manager node, each node at this time is not controllable, message Manager is not controllable.
  • Ignore the receiver sends a message type
    • Since most are designed for a particular message type operator receives this design typical "execution" of different designs VI, "Execute" type VI first checks whether the correct recipient. The check fails, the "execute" method returns an error from "into a particular class" function, so that the error report to the operator "processing error" method. Most message classes using this design approach, to avoid incorrect command is transmitted to the operator. For example, DAQ command is sent to the operator only understands GPIB commands.
  • The operator design reuse
    • Use "zero coupling mode" message mechanism , when it is desired to send a message to the caller not need to verify the type of caller. This mode uses the so-called "abstract messages" can be achieved. Abstract message is a basic message set include, but the caller where the operation execution command message is not received (i.e., do function). Instead, each type of calling a set of instructions provided by the caller to the operator.
    • The operator will increase design reuse some programming complexity . However, the benefit of this design is that the user can be any type of operator and the caller reused. Since the operator with a callee filled placeholder, the user creates a descendant class abstract class for each message type of the caller. Each type of the caller using caller's message can be appreciated filled symbols occupied.
  • Operators should have a name
    • If there is exactly the same operator, should be named in a cluster data structure.

A deep understanding of the "zero coupling" message mechanism [PDF]

  • Establish virtual message type at the transmitting end
    • name
    • Write Property
    • The establishment of class, into "virtual message classes" folder
  • Subclassing the class of virtual message at the receiving end
    • Select the virtual classes would inherit
    • Establishment message class, into the "Messages" folder
  • note
    • Which the operator has "virtual message class" folder, then the operator is a transmitting side.

Guess you like

Origin www.cnblogs.com/lizhensheng/p/11241973.html