Ejemplo n.º 1
0
 public static bool CheckCode(byte[] dataReceived, IAssistant assistant)
 {
     if (dataReceived[5] == 224)
     {
         if (dataReceived[18] != 4)
         {
             assistant.DataToSend = COTPConnectionPacket.ConnectionConfirmLoad(dataReceived).ToArray();
             return(true);
         }
         else
         {
             assistant.DataToSend = new byte[] { 3, 0, 0, 33, 2, 240, 128, 50, 7, 0, 0, 193, 2, 0, 12, 0, 4, 0, 1, 18, 8, 18, 131, 0, 0, 0, 0, 210, 9, 10, 0, 0, 0 };
             return(true);
         }
     }
     else if (dataReceived[5] == 240)
     {
         if (S7PacketGenerator.Check(dataReceived))
         {
             assistant.DataToSend = S7PacketGenerator.GetDataToSend().ToArray();
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
    public void SendIntention(Supervisor.Action intention)
    {
        IAssistant assistant = assistantGameObject.GetComponent <IAssistant>();

        // Check if intention is in current actions
        bool intentionIsValid = true;

        foreach (Supervisor.Action workflowAction in workflow.GetCurrentActions())
        {
            foreach (string workflowInputField in workflowAction.inputFields.Keys)
            {
                Debug.Log(workflowAction.inputFields[workflowInputField].value + intention.inputFields[workflowInputField].value);
                if (workflowAction.inputFields[workflowInputField].value != intention.inputFields[workflowInputField].value)
                {
                    intentionIsValid = false;
                }
            }
        }

        if (intentionIsValid)
        {
            assistant.DoAction(intention);
            workflow.Forward(intention);
        }

        if (workflow.GetCurrentActions()[0].isPassive)
        {
            SendIntention(workflow.GetCurrentActions()[0]);
        }
    }
Ejemplo n.º 3
0
 public ConversationUpdateChannel(IAssistant please)
 {
     _please = please;
 }
Ejemplo n.º 4
0
 public HomeController(IAssistant assistant, IPrivacyDataService privacyDataService)
 {
     _assistant          = assistant ?? throw new ArgumentNullException(nameof(assistant));
     _privacyDataService = privacyDataService ?? throw new ArgumentNullException(nameof(privacyDataService));
 }
Ejemplo n.º 5
0
 public TaskReminder(BotConnector botConnector, IAssistant please)
 {
     _botConnector = botConnector;
     Please        = please;
 }
Ejemplo n.º 6
0
 public SmartSpeakerEndpoints(IAssistant assistant)
 {
     Assistant = assistant;
 }