private ActionResult Comm_OnAddMtu(object sender, MTUComm.AddMtuArgs e) { ActionResult result = CreateActionResultUsingInterface(e.MemoryMap, e.MtuType, e.Form); ActionFinishArgs args = new ActionFinishArgs(result); e.AddMtuLog.LogReadMtu(result); // Generate xml log file and save on device e.AddMtuLog.Save(); args.FormLog = e.AddMtuLog; OnFinish(this, args); return(result); }
private async Task Comm_OnAddMtu(object sender, MTUComm.AddMtuArgs args) { try { ActionResult result = await CreateActionResultUsingInterface(args.MemoryMap, args.MtuType, args.Form); ActionFinishArgs finalArgs = new ActionFinishArgs(result); args.AddMtuLog.LogReadMtu(result); this.lastLogCreated = args.AddMtuLog.Save(); this.Finish(finalArgs); } catch (Exception e) { Errors.LogErrorNowAndContinue(new PuckCantCommWithMtuException()); this.OnError(); } }