public void shouldGetFirstChronodexSector() { ChronodexList cl = new ChronodexList(dayData_simple); Assert.AreEqual(expected: "0800", actual: cl.getFirst().StartTime); cl = new ChronodexList(dayData_complex); Assert.AreEqual(expected: "0815", actual: cl.getFirst().StartTime); }
public void shouldCreateChronodexListFromTextTime() { ChronodexList cl = new ChronodexList(dayData_simple); Assert.AreEqual(expected: 4, actual: cl.getSectorsCount()); cl = new ChronodexList(dayData_complex); Assert.AreEqual(expected: 5, actual: cl.getSectorsCount()); }
public void shouldFindLayoutStartSector() { ChronodexList cl = new ChronodexList(dayData_complex); Assert.AreEqual(expected: "1530", actual: cl.findLayoutStartingSector().StartTime); }
static void LayoutChronodex(ChronodexList cl, Graphics go) { // find closest to Zero grad angle var cs = cl.findLayoutStartingSector(); do { if (cl.Descriptions.ContainsKey(cl.getCurrent().Description)) { cl.getCurrent().LabelRectangle = cl.Descriptions[cl.getCurrent().Description].LabelRectangle; cl.getCurrent().CalloutEnd = cl.Descriptions[cl.getCurrent().Description].CalloutEnd; } else { cl.getCurrent().LayoutRespecting(go, cl.getPrevious()); cl.Descriptions.Add(cl.getCurrent().Description, cl.getCurrent()); } cl.moveForward(); } while (cl.getCurrent() != cs); }
public static Image CreateChronodex(ChronodexList cl) { if (cl.getSectorsCount() == 0) {return null;} Assembly myAssembly = Assembly.GetExecutingAssembly(); Stream myStream = myAssembly.GetManifestResourceStream("Chronodex"); Image myImage = Image.FromStream(myStream); myStream.Close(); Graphics go = Graphics.FromImage(myImage); LayoutChronodex(cl, go); // draw sectors ChronodexSector cs; cs = cl.getFirst(); DrawChronodexSector(cs, go); while (cl.getNext() != cs) { cl.moveForward(); DrawChronodexSector(cl.getCurrent(), go); } return myImage; }