static void Main(string[] args) { int which = 2; if (which == 0) { SettingsFileLoader loado = new SettingsFileLoader(); loado.root = @"C:\Users\Pizzamine98\Desktop\genmandel\"; loado.LoadSettingsFiles(); loado.MakeJsons(); PolyOp opp = new PolyOp(); opp.set = loado.sets[0]; opp.StartUp(); Polynomial deriv = opp.DerivativeC(opp.set.poly); opp.cvalplug = new Complex(); opp.cvalplug.num = new Decimal[2]; opp.cvalplug.num[0] = Decimal.Parse("0.1"); opp.cvalplug.num[1] = Decimal.Parse("0.1"); opp.cvalplug.cpow = 0; opp.debug0 = true; opp.PlugIn(0, opp.set.poly); } else if (which == 1) { SettingsFileLoader loado = new SettingsFileLoader(); loado.root = @"C:\Users\Pizzamine98\Desktop\genmandel\"; loado.LoadSettingsFiles(); loado.MakeJsons(); MPlot poo = new MPlot(); poo.set = loado.sets[0]; PlotExporter export = new PlotExporter(); export.set = loado.sets[0]; export.Setup(poo); } else if (which == 2) { SettingsFileLoader loado = new SettingsFileLoader(); loado.root = @"C:\Users\Pizzamine98\Desktop\genmandel\"; loado.LoadSettingsFiles(); loado.MakeJsons(); SimpleItterator simp = new SimpleItterator(); int whichid = 3; int cores = loado.GetIndexForGivenIndex(whichid); simp.set = loado.sets[cores]; PolyOp opp = new PolyOp(); opp.set = loado.sets[cores]; simp.set.nzoom = 10; opp.StartUp(); simp.opm = opp; simp.zoomnum = 0; simp.h = 1080; simp.w = 1920; while (simp.zoomnum < simp.set.nzoom) { simp.Setup(); simp.zoomnum++; } } }
public void Setup(MPlot plotin) { root = set.root; foldpath = root + "rundata\\info\\"; foldpath2 = root + "rundata\\csv\\"; string[] existing = Directory.GetFiles(foldpath); runid = existing.Length; if (existing.Length == 0) { runsetid = 0; } else { maxrunid = 0; for (int ig = 0; ig < existing.Length; ig++) { things = existing[ig].Split("_"); nthi = things.Length; cpoz = int.Parse(things[nthi - 2]); if (cpoz > maxrunid) { maxrunid = cpoz; } } runsetid = maxrunid + 1; } plotin.zoomnum = 0; while (plotin.zoomnum <= set.nzoom) { Console.WriteLine(); Console.WriteLine("ZOOM NUMBER: " + plotin.zoomnum); Console.WriteLine(); plotin.set = set; plotin.MakePoints(); info = new RunInfo(); info.runid = runid; info.settingid = set.id; info.zoomnum = plotin.zoomnum; info.zoomfactor = plotin.zoomfactor; info.starttime = plotin.starttime; info.runsetid = runsetid; info.endtime = plotin.endtime; info.dt = plotin.dt; info.npoints = plotin.points.Count; info.nsteps = plotin.nsteps; info.polyused = plotin.set.poly; info.center = plotin.lastplug; csvlines = new List <string>(); line = "xval,yval,inset,isboundary,ittbreak,r,g,b"; csvlines.Add(line); foreach (MPoint pill in plotin.points) { line = "" + pill.cval.num[0] + "," + pill.cval.num[1] + "," + pill.inset + "," + pill.isboundary + "," + pill.color.rgb[0] + "," + pill.color.rgb[1] + "," + pill.color.rgb[2]; csvlines.Add(line); } path = foldpath + "runinfo_" + info.runsetid + "_" + info.zoomnum + ".json"; json = JsonConvert.SerializeObject(info); System.IO.File.WriteAllText(path, json); path2 = foldpath2 + "rundata_" + info.runsetid + "_" + info.zoomnum + ".csv"; System.IO.File.WriteAllLines(path2, csvlines.ToArray()); plotin.CycleIt(); } }