160308- learning State Pattern Actor

The state machine knowledge

  • State A thing done
  • State B doing things
  • A to B conversion conditions
  • B to A condition conversion
  • End conditions
  • During each switching operation performed by the conversion of

The sample program here

D:\Program Files (x86)\National Instruments\LabVIEW 2014\ProjectTemplates\Source\Actor Framework

Study documents

  • Process State.lvclass inherits from State Actor.lvclass
    • That context the Actor , the operator is the common ancestor of all the states consisting of
    • The state has inherited from the class: Idle.lvclass, Running.lvclass
  • Context actor Features
    • All state share of property
    • Rewriting Substitute Actor.vi , the transition from a state attribute (operator) to another state (the operator)
    • Rewrite Actor Core.vi
    • Changing the state of the process ( Method )
    • The operator can call the parent method, this method can change state (?)
    • Call message class of these methods
  • State.vi Change (a State Actor member)
    • Change state method ( Method, ) calls Change State.vi
  • States.lvlib Process (state class inherits from the context actor i.e. Process State.lvclass )
    • Rewriting Entry.vi and Exit.vi , these two functions can be advanced state
    • With the change of state, some behaviors will change, override these methods
    • New this peculiar state of some of the acts
    • Call these acts message classes
  • Methods apos State Transition the Actor the Context (custom transform operation)
    • Including entry and exit conversion action conversion action
    • Create a method overrides Substitute Actor.vi
    • Creating message classes
  • When the operator in a certain state, the received message data types are unsuitable error
    • This data may be selected automatically discarded, without throwing an exception
    • Change Do.vi Method
  • If you want more complex behavior, the behavior of this function can be placed in the parent class, so different subclasses can rewrite this function
  • working process
  • Starting System: an initial status to Launch Actor.vi
  • System caller ( the Caller ) transmitting a state transition message to a public State , called indirectly the state transition function (method); or a State own direct call transfer function
  • State Pattern UI.lvclass
    • This is a user interface, the operator activates a State Pattern Actor, Process States, as a nested actor

Think

  • What state operator need? State diagram how to paint?
  • Can triggering perform an action in a state (already proven) and cycle to perform an action?
  • How to achieve?

test

  • Of the parent class Go to Idle.vi and subclasses Go to Idle.vi breakpoint test and found no relationship between these two functions, who should perform the execution, depending on message sent to the object in the end who .
    • You will find that the parent and child classes has a corresponding function, but the message class has only one (?)
  • Thread synchronization methods that may be added to the cycle, or the like using the notification in the response function of the control loop
  • Each object has a state machine model of the class can have such a structure, comprising: State the UI class Process parent class, several State class
    • UI -based interface and the core function including
    • Process parent class comprises a core function (this function is not circular core, note that the block diagram), and a state switching function for switching the state of the function
    • State class, including the function and status nearly out of state stay execution of the function (the current project, this function is triggered), this function should be transformed into cycle execution, but the execution cycle function can also be seen as a cycle trigger, that is, on a layer (call) setup period trigger logic function.

Look textbooks

  • In the software design process model, draw the state diagram, we can state model in accordance with the state diagram design that an operator framework.

While designing programming

  • The requirements of the current project, the state shown in FIG, designed according to the state of FIG.

Guess you like

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