private string ComposeExtraInfo(SystemSummaryRow row, EntryScanAutoScan sas) { if (row.BodyType == BodyType.Star) { if (sas.StarType == "N") { return("Neutron star"); } return($"Startype: {sas.StarType}"); } EntryScanDetailed sd = sas as EntryScanDetailed; if (sd != null) { if (!String.IsNullOrWhiteSpace(sd.PlanetClass)) { return($"{sd.PlanetClass}"); } } if (row.Description.Contains(BELT_CLUSTER_ID)) { int idx = row.Description.IndexOf(BELT_CLUSTER_ID); return(row.Description.Substring(idx)); } return(row.ExtraInfo); }
private SystemSummaryRow CreateOrGetRow(EntryScanAutoScan scan) { var match = this.receiver.SystemRows.FirstOrDefault(r => r.BodyId == scan.BodyID); if (match == null) { match = new SystemSummaryRow(); match.Order = 1000 + scan.BodyID; match.BodyId = scan.BodyID; match.Description = scan.BodyName; match.ExtraInfo = scan.ScanType.ToString(); match.BodyType = DetectBodyType(scan); match.IsDiscovered = scan.WasDiscovered; match.IsMapped = scan.WasMapped; this.receiver.SystemRows.Add(match); } else if (match.DataOrigin == Core.DataOrigin.Edsm) // was only known from EDSM before... { match.ExtraInfo = scan.ScanType.ToString(); match.BodyType = DetectBodyType(scan); match.IsDiscovered = scan.WasDiscovered; match.IsMapped = scan.WasMapped; } match.Description = RestyleName(match.Description); return(match); }
private void CreateDisplayEventForScanAuto(EntryScanAutoScan @as) { DisplayEvent de = new DisplayEvent() { Text = $"Auto-Scanned {@as.BodyName} {@as.WasDiscovered} {@as.WasMapped}", EventType = DisplayEventType.Scan, }; if (@as.WasDiscovered == false) { de.IsHighlighted = true; de.Symbol2 = '\xf890'; // sparkles de.Symbol2Tooltip = "undiscovered!"; } else { de.IsBoring = true; } this.receiver.Events.Add(de); }
private BodyType DetectBodyType(EntryScanAutoScan scan) { if (!String.IsNullOrWhiteSpace(scan.StarType)) { return(BodyType.Star); } if (scan.BodyName.Contains(BELT_CLUSTER_ID)) { return(BodyType.BeltCluster); } var det = (scan as EntryScanDetailed); if (det != null) { if (!String.IsNullOrWhiteSpace(det.PlanetClass)) { return(BodyType.Planet); } } return(BodyType.Unknown); }