public async Task <Project> Mydelagate() { GDFService _svc = new GDFService(); var ret = await _svc.LoginAsync(Session["user"].ToString(), Session["pass"].ToString()); if (!ret) { return(null); } var proj = await _svc.GetProjectAsync(Convert.ToInt32(Session["id"])); // 2. Execute Simulation var task1 = _svc.ExecRenderingAsync( (s, e) => Console.WriteLine("time={0}, status={1}", e.Time, e.Result.RunningStatus), proj ); RenderingResult rets = await task1; { var result = task1.Result; if (result != null) { List <PartLog> partLogs = new List <PartLog>(result.PartLogs); foreach (var i in partLogs) { var a = i.Parts; var b = i.Time; } List <StatusLog> statusLogs = new List <StatusLog>(result.StatusLogs); foreach (var y in statusLogs) { var c = y.Time; var k = y.OperationRateOfStations; } // rets.FlowLogs = result.FlowLogs; // rets.PartLogs = result.PartLogs; // rets.StatusLogs = result.StatusLogs; // rets.Summary = result.Summary; // rets.RenderingTime = result.RenderingTime; var FlowLogs = result.FlowLogs; var PartLogs = result.PartLogs; var StatusLogs = result.StatusLogs; var Summary = result.Summary; var RenderingTime = result.RenderingTime; partLogs.Add(result.PartLogs); } return(null); } }
public async Task <ActionResult> Tooling() { GDFService _svc = new GDFService(); var ret = await _svc.LoginAsync(Session["user"].ToString(), Session["pass"].ToString()); if (!ret) { return(null); } var proj = await _svc.GetProjectAsync(Convert.ToInt32(Session["id"])); var result = await _svc.ExecRenderingAsync( (s, e) => Console.WriteLine("time={0}, status={1}", e.Time, e.Result.RunningStatus), proj ); RenderingResult rendering = new RenderingResult(); List <ToolingInfo_View> toolingInfo_Views = new List <ToolingInfo_View>(); if (result != null) { rendering.Summary = result.Summary; SummaryResult summary = new SummaryResult(); summary = result.Summary; List <ToolingInfo> toolingInfos = new List <ToolingInfo>(summary.Toolings); //Define object summary_view ToolingInfo_View toolingInfo_View = new ToolingInfo_View(); ToolingInfo toolingInfo = new ToolingInfo(); foreach (var i in toolingInfos) { toolingInfo_View.UnusedCount = i.UnusedCount; toolingInfo_View.UsedCount = i.UsedCount; toolingInfo_View.ZeroLifeCount = i.ZeroLifeCount; toolingInfo_Views.Add(toolingInfo_View); } } return(View(toolingInfo_Views)); }