Exemplo n.º 1
0
        /// <summary>
        /// Führt die Goto Aktion
        /// Die Goto Aktion, ist die Aktion bei der man dem Fahstuhl den Befehl geben kann, sich an eine Position zu positionieren
        /// </summary>
        /// <param name="action">Aktion, die auszuführen ist</param>

        public async Task UpdateGoTo(GoToAction action)
        {
            string path     = Url + "/users.php";
            string jsonData = JsonConvert.SerializeObject(action);
            ResponseModel <UserViewModel> result = await RestApiHelper.PostAsync <ResponseModel <UserViewModel> >(path, jsonData);

            if (result != default(ResponseModel <UserViewModel>))
            {
                User = result.Result;
            }
            else
            {
                loggedIn = false;
            }
        }
Exemplo n.º 2
0
        private async void CommandSend_Clicked(object sender, EventArgs e)
        {
            string commandStr = commandEntry.Text;

            NLpProcessing nlp    = new NLpProcessing();
            string        result = await nlp.ProcessWrittenText(commandStr);

            SpeechResponseModel speechResponse = JsonConvert.DeserializeObject <SpeechResponseModel>(result);
            Server server = Server.ServerInstance;

            if (speechResponse.outcome.entities != null && speechResponse.outcome.entities.intent != null)
            {
                if (speechResponse.outcome.entities.intent.value == "command" ||
                    speechResponse.outcome.entities.intent.value == "Command")
                {
                    GoToAction action = new GoToAction()
                    {
                        Goto = speechResponse.outcome.entities.to.value, Username = server.User.Username, Token = server.User.CurrentToken.Value
                    };
                    await server.UpdateGoTo(action);
                }
            }
        }