Ejemplo n.º 1
0
        /// <summary>
        /// Send an action to a list of ports for this state machine.
        /// </summary>
        /// <param name="actionName">the string for the action, i.e. PortName.ActionName</param>
        /// <param name="data">Generic data </param>
        public void SendPortAction(string sourcePortName, string actionName, object data)
        {
            GQHSMPort destPort = GetPort(sourcePortName);

            if (destPort != null)
            {
                QEvent ev = new QEvent(actionName, data);
                destPort.Port.Receive(destPort.Port, ev);
            }
        }
Ejemplo n.º 2
0
        public void CallPortForward(GQHSMAction action)
        {
            string[] splitS = action.Name.Split(new char[] { '^', '.' }, StringSplitOptions.RemoveEmptyEntries);
            if (splitS.Length <= 1)
            {
                Logger.Error("Need Source port and Action, i.e. ^Sourceport.Action");
                return;
            }

            // use port links to get destination port, if available
            GQHSMPort gp = GetPort(splitS[0]);

            if (gp != null)
            {
                gp.Port.Send(new QEvent(splitS[1], action.Params));
            }
        }
Ejemplo n.º 3
0
 public void RegisterPort(GQHSMPort port)
 {
     if (port.IsMultiPort)
     {
         _nameToMultiPort.Add(port.Name, port);
     }
     else
     {
         if (!_nameToPort.ContainsKey(port.Name))
         {
             _nameToPort.Add(port.Name, port);
         }
         else
         {
             Logger.Error("Duplicate name in single ports {0}\n", port.Name);
         }
     }
 }