internal static IMAGE_LABEL_INFO LoadLabelEnd(string full_file_name_label) { try { IMAGE_LABEL_INFO ret = new IMAGE_LABEL_INFO { labels = new System.Collections.Generic.List <LABEL>() }; var lines = System.IO.File.ReadAllLines(full_file_name_label); foreach (var line in lines) { var spl = line.Split(" "); Console.WriteLine(line); LABEL lbl = new LABEL { category = spl[0], box2d = new BOX2D() { x1 = double.Parse(spl[1]), y1 = double.Parse(spl[2]), x2 = double.Parse(spl[1]) + double.Parse(spl[3]), y2 = double.Parse(spl[2]) + double.Parse(spl[4]) } }; ret.labels.Add(lbl); } return(ret); } catch (Exception e) { Console.Error.WriteLine(e.Message + e.StackTrace); return(new IMAGE_LABEL_INFO()); } }
public void CreateLabelTruncatesTooLongLabel() { // --- Arrange const string LABEL = "Label012345678901234567890123456789"; var dc = new DisassemblyAnnotation(); // --- Act var result = dc.SetLabel(0x1000, LABEL); // --- Assert result.ShouldBe(true); dc.Labels.Count.ShouldBe(1); dc.Labels[0x1000].ShouldBe(LABEL.Substring(0, DisassemblyAnnotation.MAX_LABEL_LENGTH)); }
private void TranslateStm(LABEL stm) { Label l = new Label(stm.Label); InstrList.Add(l); }
void PrintStm(LABEL s, int d) { Indent(d); Say("LABEL "); Say(s.Label.ToString()); }
void PrintStm(LABEL s, int d) { Indent(d); Say("LABEL "); Say(s.Label.ToString()); }
private void TranslateStm(LABEL stm) { Label l = new Label(stm.Label); InstrList.Add(l); }