public override void OnEntry(trace.Entry e) { var failures = new List<Failure>(); FillFailure(e, failures, et => severities.ContainsKey(eventType.entry) == false || severities[eventType.entry].Contains(et.Severity)); ManagementReport report = BuildReport(e.Parent, failures); Send(report, e.Parent.Properties.ContainsKey(REPORT_ACTIVITY_ID_PROPERTY) ? e.Parent.Properties[REPORT_ACTIVITY_ID_PROPERTY] as String : null, e.Parent.Properties.ContainsKey(REPORT_AGENT_ID_PROPERTY) ? e.Parent.Properties[REPORT_AGENT_ID_PROPERTY] as String : null); }
public async Task <IActionResult> Edit(int id, [Bind("traceId,ClientId,Type,Nom,Surface,prime,UserId,email")] trace trace) { if (id != trace.traceId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(trace); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!traceExists(trace.traceId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ClientId"] = new SelectList(_context.Clients, "ClientId", "email", trace.ClientId); return(View(trace)); }
public override void OnTrace(trace.Trace t) { var failures = new List<Failure>(); foreach (trace.Entry e in t.Entries) FillFailures(e, failures, et => severities.ContainsKey(eventType.trace) == false || severities[eventType.trace].Contains(et.Severity)); ManagementReport report = BuildReport(t, failures.ToArray()); Send(report, t.Properties.ContainsKey(REPORT_ACTIVITY_ID_PROPERTY) ? t.Properties[REPORT_ACTIVITY_ID_PROPERTY] as String : null, t.Properties.ContainsKey(REPORT_AGENT_ID_PROPERTY) ? t.Properties[REPORT_AGENT_ID_PROPERTY] as String : null); }
public async Task <IActionResult> Create([Bind("traceId,ClientId,Type,Nom,Surface,prime,UserId,email")] trace trace) { if (ModelState.IsValid) { _context.Add(trace); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ClientId"] = new SelectList(_context.Clients, "ClientId", "email", trace.ClientId); return(View(trace)); }
private ManagementReport BuildReport(trace.Trace trace, IEnumerable<Failure> failures) { ManagementReport report = new ManagementReport { ID = trace.Id.ToString(), State = new State() { Execution = ExecutionState.Active, Health = HealthState.OperationalWithFailures, Failures = failures.ToArray() }, DateTime = DateTime.UtcNow, SourceID = trace.Properties.ContainsKey(REPORT_SOURCE_ID_PROPERTY) ? trace.Properties[REPORT_SOURCE_ID_PROPERTY] as String : Properties.DefaultSourceId }; return report; }
private void FillFailures(trace.Entry entry, List<Failure> failures, EntryFilterHandler filter) { FillFailure(entry, failures, filter); // fill child entries foreach (trace.Entry innerEntry in entry.Entries) FillFailures(innerEntry, failures, filter); }
private void Form1_Load(object sender, EventArgs e) { //连接数据库 long id, tar_ID; int index; string conStr = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0; Data source=" + Application.StartupPath + "\\database\\whut\\RecognitionAid.mdb"); DataSet ds = dbInterface.query(conStr, "select * from TargetTrailPoints", "目标轨迹"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++)//获取目标个数 { trace s1 = new trace(); s1.tar_ID = Convert.ToInt64(ds.Tables[0].Rows[i]["TGT_ID"]); id = s1.tar_ID; if (!arr_tar.Contains(id)) arr_tar.Add(id); } for (int i = 0; i < arr_tar.Count; i++)//申请list和list_trace空间 { list_trace[i] = new List<Point>(); list_detect_distance[i] = new List<PointD>(); list_detect_distance_final[i] = new List<PointD>(); colour[i] = System.Drawing.Color.FromArgb((220 * i) % 255, (20 * i) % 255, (150 * i) % 255); guassianList[i] = new List<PointD>(); poissonList[i] = new List<PointD>(); uniformList[i] = new List<PointD>(); guassianList_final[i] = new List<PointD>(); poissonList_final[i] = new List<PointD>(); uniformList_final[i] = new List<PointD>(); } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //循环取出ds.table中的值 { //trace s = new trace(); Point p = new Point(); tar_ID = Convert.ToInt64(ds.Tables[0].Rows[i]["TGT_ID"]); //id = s.tar_ID; //s.track_ID = Convert.ToInt64(ds.Tables[0].Rows[i]["TrailID"]); p.X = Convert.ToInt32(ds.Tables[0].Rows[i]["X"]); p.Y = Convert.ToInt32(ds.Tables[0].Rows[i]["Y"]); //s.trail_Point = p; //s.time = Convert.ToInt64(ds.Tables[0].Rows[i]["moveTime"]); index = arr_tar.IndexOf(tar_ID); list_trace[index].Add(p); } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //循环取出ds.table中的值 { PointD p = new PointD(); tar_ID = Convert.ToInt64(ds.Tables[0].Rows[i]["TGT_ID"]); p.X = Convert.ToDouble(ds.Tables[0].Rows[i]["X"]); p.Y = Convert.ToDouble(ds.Tables[0].Rows[i]["Y"]); index = arr_tar.IndexOf(tar_ID); list_detect_distance[index].Add(p); } //for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //循环取出ds.table中的值 //{ // PointD s = new PointD(); // 实例化Point对象 // s.X= Convert.ToDouble(ds.Tables[0].Rows[i]["X"]); // s.Y = Convert.ToDouble(ds.Tables[0].Rows[i]["Y"]); // list.Add(s); // 将取出的对象保存在LIST中 以上是获得值。 //} //for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //循环取出ds.table中的值 //{ // Point s = new Point(); // 实例化Point对象 // s.X = Convert.ToInt32(ds.Tables[0].Rows[i]["X"]); //X,Y看做是经度纬度 // s.Y = Convert.ToInt32(ds.Tables[0].Rows[i]["Y"]); // list_trace.Add(s); // 将取出的对象保存在LIST中 以上是获得值。 //} //foreach (Point p in list_trace) //{ // Console.WriteLine(p.X); // Console.WriteLine(p.Y); //} screenpoint_pic4 =PointToScreen(pictureBox4.Location); Console.WriteLine(screenpoint_pic4.X); Console.WriteLine(screenpoint_pic4.Y); }
/// <summary> /// This is a javascript application. /// </summary> /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param> public Application(IApp page) { // X:\jsc.svn\examples\javascript\async\AsyncWindowUncaughtError\AsyncWindowUncaughtError\ApplicationWebService.cs // intellitrace // a self debugging programe? // can we have buttons for debugging? // https://www.youtube.com/watch?v=4vtKRE9an_I // could we have live patching, remote debugging via udp? var Next = new IHTMLButton { "Next" }.AttachToDocument(); Next.disabled = true; Func <Task> Next_onclick = async delegate { Next.disabled = false; await Next.async.onclick; Next.disabled = true; }; trace trace = async(string filepath, int linenumber, string line) => { // could we go backwards in time too? // like intellitrace? var debugged = new IHTMLPre { }.AttachToDocument(); // should we allow chaning constants? // by patching const load opcodes? var l = new IHTMLSpan { "" + linenumber }.AttachToDocument(); l.title = filepath; l.style.marginRight = "2em"; l.style.color = "darkcyan"; l.AttachTo(debugged); // could we use css to do syntax highlight? var prefixToHide = "await trace();"; // perhaps the next step would be to send us the origina stack usage IL // we see in the jsc reflector? var c = new IHTMLSpan { line.Replace(prefixToHide, "") }; c.style.marginRight = "2em"; //c.style.color = "blue"; c.style.backgroundColor = "yellow"; c.AttachTo(debugged); await Next_onclick(); c.style.backgroundColor = ""; }; interactive <string> __string = async(string data, string filepath, int linenumber, string line) => { var i = new IHTMLInput { value = data }.AttachToDocument(); await Next_onclick(); return(i.value); }; //Func<> Func <string, Task <string> > program = // a simulaton of a program async data => { await trace(); new IHTMLPre { await __string("hello") }.AttachToDocument(); await trace(); new IHTMLPre { await __string("world") }.AttachToDocument(); await trace(); return("done!"); }; new IHTMLButton { "Step Into" }.AttachToDocument().onclick += async e => { new IHTMLHorizontalRule().AttachToDocument(); e.Element.disabled = true; var value = await program("data"); e.Element.disabled = false; new IHTMLPre { new { value } }.AttachToDocument(); }; new IHTMLButton { "Run" }.AttachToDocument().onclick += async e => { // enum to string? new IHTMLHorizontalRule().AttachToDocument(); var x = Next_onclick; // slow down the program Next_onclick = async delegate { await Task.Delay(300); }; e.Element.disabled = true; var value = await program("data"); e.Element.disabled = false; Next_onclick = x; new IHTMLPre { new { value } }.AttachToDocument(); }; }
trace?.Tracer.StartTrace(trace, kind, tags);