public ActionResult GetResults(InitParams init) { //string fileName = System.Web.HttpContext.Current.Server.MapPath(@"..\api\Ken-Tough-Room-Vertical-v2.dxf"); //string fileName = System.Web.HttpContext.Current.Server.MapPath(@"..\api\Ken-Crazy-Colo.dxf"); string fileName = getFileName(init); System.Web.HttpContext.Current.Server.MapPath(string.Format(@"..\api\{0}.dxf", init.FileName)); ProjectClass project = getProject(); createOptimizer(fileName, init, project); //start the operation that raises events which communicate back with the client optimizer.Optimize(); JsonResult js = new JsonResult { JsonRequestBehavior = JsonRequestBehavior.AllowGet, Data = new { universePoints = optimizer.GetUniverse(), floor = project.Floor, obstaclePointArr = optimizer.GetObstaclesPoints(), boxArr = optimizer.Boxes2relo.Select(b => new { points = b.PointsCollection, boxId = b.BoxId, shadowArr = b.ShadowPath.ToArray() }).ToArray() } }; return(js); }
public override void OnMessage(string message) { switch (message) { case "Universe": this.Send(optimizer.GetUniverse()); break; } }
public void BeginOptimization(InitParams init) { startColoOptimizer(init); Clients.Caller.drawUniverse(optimizer.GetUniverse()); Clients.Caller.drawObstacles(optimizer.GetObstaclesPoints()); //start the operation that raises events which communicate back with the client optimizer.Optimize(); }