From af90c9bc0f89c110f3e87c5e583ce2394694c859 Mon Sep 17 00:00:00 2001 From: unknown <john.schihada@hotmail.com> Date: Fri, 29 Nov 2019 01:30:06 +0100 Subject: [PATCH] Started MMTServer in the MMTInterface Component of the MMTManager GameObject. Changes are commented out so far because of absolute path handover to mmt.bat --- Assets/InteractionEngine/MMTInterface.cs | 28 ++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Assets/InteractionEngine/MMTInterface.cs b/Assets/InteractionEngine/MMTInterface.cs index 176b01ce..9d73363b 100644 --- a/Assets/InteractionEngine/MMTInterface.cs +++ b/Assets/InteractionEngine/MMTInterface.cs @@ -1,27 +1,47 @@ -using System.Collections; +using System; +using System.Diagnostics; +using System.ComponentModel; +using System.Collections; using System.Collections.Generic; using UnityEngine; public class MMTInterface : MonoBehaviour { + private Process mmtServerProcess; + private ProcessStartInfo mmtServerProcessInfo; + // Start is called before the first frame update void Start() { + //Start the mmt.bat for carrying out http-Requests + //TODO: Putting the absolute path to mmt.bat here should soon be changed + /*mmtServerProcessInfo = new ProcessStartInfo("cmd.exe", "/c " + "C:\\Users\\John\\Downloads\\Program_Downloads\\For_FAU_PROJECT_MA_MMT\\MMT\\deploy\\mmt.bat"); + //CreateNoWindow = flase -> For now only for testing purposes + mmtServerProcessInfo.CreateNoWindow = false; + mmtServerProcessInfo.UseShellExecute = false; + mmtServerProcessInfo.RedirectStandardError = true; + mmtServerProcessInfo.RedirectStandardOutput = true; + + mmtServerProcess = Process.Start(mmtServerProcessInfo); + */ + CommunicationEvents.AddEvent.AddListener(AddFactToMMT); - CommunicationEvents.RemoveEvent.AddListener(RemoveFactFromMMT); + CommunicationEvents.RemoveEvent.AddListener(RemoveFactFromMMT); + + } void AddFactToMMT(RaycastHit hit, int id ) { //send new fact to MMT - Debug.Log("add fact"+ id); + UnityEngine.Debug.Log("add fact"+ id); } void RemoveFactFromMMT(RaycastHit hit, int id) { - Debug.Log("remove fact"+ id); + UnityEngine.Debug.Log("remove fact"+ id); } -- GitLab