void motionModel_exportEach(string path_save, m_Motion motion) { List <m_Motion> motion_list = new List <m_Motion>(); motion_list.Add(motion); TheMapData.saveXML_Motion(path_save, motion_list); }
public void editMotion(m_Motion m_origin) { addNew = false; this.Title = "Edit Motion Group"; butAdd.Content = "Edit"; this.m_origin = m_origin; textBox1.Text = m_origin.name; }
public static void motionModel_add1Posture(m_Motion target, List <m_If> rule) { if (target.inputs.Count > 0) { target.inputs.Add(TheMapData.get_m_If_TimeWithin(1)); //Add Time Within } target.inputs.AddRange(rule); }
void finish() { try { String name = textBox1.Text; if (name != "") { if (addNew) { if (map_type == type_e_event) { m_Event ev = new m_Event(); ev.name = name; form_editor.addEvent(ev, addIndex); } else if (map_type == type_m_motion) { m_Motion m = new m_Motion(); m.name = name; form_editor.addMotion(m, addIndex); } else if (map_type == type_group) { m_Group g = new m_Group(); g.name = name; form_editor.addGroup(g, addIndex); } } else { int[] loc = form_editor.getTVI_Location(self); if (map_type == type_e_event) { ev_origin.name = name; form_editor.reloadTree_event(loc); } else if (map_type == type_m_motion) { m_origin.name = name; form_editor.reloadTree_motion(loc); } else if (map_type == type_group) { g_origin.name = name; form_editor.reloadTree_map_map(loc); } } this.Close(); } } catch { } }
void motionModel_evaluationEach(string header, m_Motion motion) { summary_total.Add(""); List <string> motionFailed = new List <string>(); int detectected_count = 0; int all_inst = container.list_inst.Count(); List <string> all_log = new List <string>(); foreach (Instance inst in container.list_inst) { Boolean detected = TheRuleTester.testDetectMotion(inst.getDataRaw(true), motion.inputs); logDetection log = TheRuleTester.temp_log; string s = ""; if (detected) { s += "[O] "; detectected_count++; } else { s += "[X] "; motionFailed.Add(inst.name + " is unrecognized with " + header); } s += inst.name + " [" + log.info + "]"; all_log.Add(s); } double acc = (double)detectected_count * 100 / all_inst; acc = Math.Round(acc, 2); //--------- summary_total.Add(header += " : " + acc + "% (" + detectected_count + "/" + all_inst + ")"); foreach (string s in all_log) { summary_total.Add(s); } if (acc < 100) { TheTool.exportFile(motionFailed, TheTool.filePath + "all_incomplete_motion.txt", false, true); } }