private iTool IdentifyTool() { iTool toolToExecute = new NOP(); switch (this.operation.ToLower()) { case "export security": toolToExecute = new ExportSecurity(); break; case "export alerts": toolToExecute = new ExportAlerts(); break; case "comparison report": toolToExecute = new ComparisonReport(); break; case "site structure": toolToExecute = new SiteStructure(); break; case "list report": toolToExecute = new ListReport(); break; } return(toolToExecute); }
public static void ChooseBasicComparisons() { // Load same file twice // change the other a little, save it and reload so we get a fresh instance // bypassing some bugs that lead to not everything updating on the fly :( var path = Path.Combine("data", "minimal.xbrl"); var tempPath = Path.GetTempFileName(); var first = Instance.FromFile(path); var second = Instance.FromFile(path); var period = new Period(2050, 12, 31); var entity = new Entity("foo", "bar"); foreach (var context in second.Contexts) { context.Period = period; context.Entity = entity; } second.ToFile(tempPath); second = Instance.FromFile(tempPath); ComparisonReport report = null; string[] expectedMessages = null; BasicComparisons basicSelection; // Full comparison outputs both Entity and Period from basic and detailed comparion report = InstanceComparer.Report(first, second, ComparisonTypes.All); Assert.False(report.Result); expectedMessages = new string[] { "Different Entity", "Different Period", $"(a) {first.Contexts[0].Entity}", $"(b) {second.Contexts[0].Entity}", $"(a) {first.Contexts[0].Period}", $"(b) {second.Contexts[0].Period}" }; Assert.Equal(expectedMessages, report.Messages);//, report.Messages.Join(Environment.NewLine)); // basic comparison with all flags reports Entity and Period basicSelection = BasicComparisons.All; report = InstanceComparer.Report(first, second, ComparisonTypes.Basic); Assert.False(report.Result); expectedMessages = new string[] { "Different Entity", "Different Period", }; Assert.Equal(expectedMessages, report.Messages);//, report.Messages.Join(Environment.NewLine)); // basic comparison without Entity and Period flags does not list any differences basicSelection &= ~BasicComparisons.Entity; basicSelection &= ~BasicComparisons.Period; report = InstanceComparer.Report(first, second, ComparisonTypes.Basic, basicSelection); Assert.True(report.Result); }
public void initialize(ISOMReportFile teamReportFile) { Console.WriteLine(" Building Under Usage..."); if (teamComparisonReport == null) { teamComparisonReport = (ComparisonReport)teamReportFile.FindReport("LEAGUE", "Comparison Report"); teamComparisonReport.processReport(Program.LEAGUES[0].Length); } }
public void testHittersUsage() { Assert.AreEqual(75, ComparisonReport.getPlayerTargetUsage(50)); Assert.AreEqual(178, ComparisonReport.getPlayerTargetUsage(119)); Assert.AreEqual(180, ComparisonReport.getPlayerTargetUsage(120)); Assert.AreEqual(181, ComparisonReport.getPlayerTargetUsage(121)); Assert.AreEqual(659, ComparisonReport.getPlayerTargetUsage(599)); Assert.AreEqual(660, ComparisonReport.getPlayerTargetUsage(600)); Assert.AreEqual(661, ComparisonReport.getPlayerTargetUsage(601)); }
public void testPitchersUsage() { Assert.AreEqual(75, ComparisonReport.getPitcherTargetUsage(50)); Assert.AreEqual(88, ComparisonReport.getPitcherTargetUsage(59)); Assert.AreEqual(90, ComparisonReport.getPitcherTargetUsage(60)); Assert.AreEqual(148, ComparisonReport.getPitcherTargetUsage(118)); Assert.AreEqual(149, ComparisonReport.getPitcherTargetUsage(119)); Assert.AreEqual(150, ComparisonReport.getPitcherTargetUsage(120)); Assert.AreEqual(229, ComparisonReport.getPitcherTargetUsage(199)); Assert.AreEqual(230, ComparisonReport.getPitcherTargetUsage(200)); }
private static TagsCorpus <TNER> GetReport(string etalon, string actual, out ComparisonReport <TNER> report) { var m = Worker.Parser.Parse(etalon); report = Worker.Parser.Parse(actual).Tags .CompareTo( m.Tags, TagsMatchers <TNER> .Lenient, Worker.Values, Worker.Undefined); return(m); }
private Report loadReport(string reportTitle) { if (reportTitle.StartsWith("LEAGUE STANDINGS")) { return(new LeagueStandingsReport(reportTitle, Program.LEAGUES[0].Length > 0)); } if (reportTitle.StartsWith("LEAGUE GRAND TOTALS (primary report) FOR")) { return(new LeagueGrandTotalsReport(reportTitle)); } else if (reportTitle.StartsWith("INJURY/MINOR LEAGUE REPORT FOR")) { return(new LineScoreAndMinorsReport(reportTitle)); } else if (reportTitle.StartsWith("AWARDS VOTING FOR")) { return(new NewspaperStyleReport(reportTitle)); } else if (reportTitle.StartsWith("RECORD BOOK FOR FOR")) { return(new RecordBookReport(reportTitle)); } else if (reportTitle.StartsWith("Comparison Report")) { if (comparisonReport == null) { comparisonReport = new ComparisonReport(reportTitle, Config.config); } return(comparisonReport); } else if (reportTitle.StartsWith("Primary Player Statistics")) { if (primaryStatsReport == null) { primaryStatsReport = new PrimaryStatsReport(reportTitle, Config.config); } return(primaryStatsReport); } else { return(new Report(reportTitle)); } }
public void initialize(ISOMReportFile teamReportFile) { Console.WriteLine(" Building Comparison..."); Console.WriteLine(" Showing Moral=" + Config.SHOW_MORAL + ", Showing Warnings=" + Config.SHOW_WARNING); teamPrimaryStatsReport = (PrimaryStatsReport)teamReportFile.FindReport("LEAGUE", "Primary Player Statistics For"); teamPrimaryStatsReport.processReport(Program.LEAGUES[0].Length); List <Player> replayPlayers = teamPrimaryStatsReport.getPlayers(); teamComparisonReport = (ComparisonReport)teamReportFile.FindReport("LEAGUE", "Comparison Report"); if (teamComparisonReport == null) { System.Console.WriteLine("Are you sure you selected 'ALL REPORTS' for the Team Reports?"); throw new Exception("Unable to find Comparison Report in the Team Report File"); } teamComparisonReport.setPlayerActualData(replayPlayers); teamComparisonReport.processReport(Program.LEAGUES[0].Length); }
private iTool IdentifyTool() { iTool toolToExecute = new NOP(); switch (this.operation.ToLower()) { case "activate features": toolToExecute = new ActivateFeatures(); break; case "enable audit": toolToExecute = new EnableAudit(); break; case "comparison report": toolToExecute = new ComparisonReport(); break; case "import security": toolToExecute = new ImportSecurity(); break; case "import alerts": toolToExecute = new ImportAlerts(); break; case "enable email": toolToExecute = new EnableEmail(); break; case "enable theme": toolToExecute = new EnableTheme(); break; case "delete alerts": toolToExecute = new DeleteAlerts(); break; } return(toolToExecute); }
public void setReportData(ComparisonReport report) { teamComparisonReport = report; }
public ActionResult GenerateComparisonReport(ComparisonReport request) { HostingEnvironment.QueueBackgroundWorkItem(ct => ReportsService.GenerateReport(request)); return(new HttpStatusCodeResult(HttpStatusCode.OK)); }
private static List <Mismatch <TType> > AllErrors <TType>(ComparisonReport <TType> report) { var allErrors = report.Mismatches.SelectMany(p => p.Value).ToList(); return(allErrors); }
static void Main(string[] args) { //CHECK if args is correct if (args.Length < 3) { //Print help PrintHelp(); return; } //CHECK for OPTIONS float tolerance = 0; foreach (var s in args) { if (s.Contains("--tolerance=")) { if (!float.TryParse(s.Substring(12), out tolerance)) { Console.WriteLine("Invalid tolerance value."); return; } } } //CHECK if path is valid string img1path, img2path, outputpath; try { img1path = Path.GetFullPath(args[0]); img2path = Path.GetFullPath(args[1]); outputpath = Path.GetFullPath(args[2]); } catch (Exception e) { Console.WriteLine("Invalid Image Paths provided"); throw; } //CHECK if image is same size Bitmap img1 = new Bitmap(img1path); Bitmap img2 = new Bitmap(img2path); if (img1.Height != img2.Height || img1.Width != img2.Width) { Console.WriteLine("Input images are of different width and height. Unable to compare"); return; } //Execute Comparison ComparisonReport report = CompareImages(img1, img2, tolerance); string html = GenerateHTMLReport(img1path, img2path, outputpath, report); //Dump comparison output report.output.Save(outputpath); File.WriteAllText(outputpath + ".html", html); }
private static string GenerateHTMLReport(string img1path, string img2path, string outputpath, ComparisonReport report) { string html = "<body>"; html += $"<div style='width: 33.33%;display: inline-block;'><img src='{img1path}' style='width: 100%; height: auto'></div>"; html += $"<div style='width: 33.33%;display: inline-block;'><img src='{outputpath}' style='width: 100%; height: auto'></div>"; html += $"<div style='width: 33.33%;display: inline-block;'><img src='{img2path}' style='width: 100%; height: auto'></div>"; html += $"<div>" + $"<p>ΔE is the perceivable difference in color. A ΔE of 0 is mathematically exact. A ΔE of 1.0 to 2.0 is just noticeable.</p>" + $"<table style='width:20em'>" + $"<tr>" + $"<td>Maximum ΔE</td>" + $"<td>{report.maxDeltaE}</td>" + $"</tr>" + $"<tr>" + $"<td>Minimum ΔE</td>" + $"<td>{report.minDeltaE}</td>" + $"</tr>" + $"<tr>" + $"<td>Average ΔE</td>" + $"<td>{report.avgDeltaE}</td>" + $"</tr>" + $"</table></div>"; html += "</body>"; return(html); }