Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is SystemSummaryRow))
            {
                return(Binding.DoNothing);
            }
            SystemSummaryRow row = (SystemSummaryRow)value;

            return($"discovered={row.IsDiscovered}, mapped={row.IsMapped}");
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is SystemSummaryRow))
            {
                return(Binding.DoNothing);
            }
            SystemSummaryRow row = (SystemSummaryRow)value;

            if (row.IsDiscovered && row.IsMapped)
            {
                return('\xf59f');                                  // map-marked
            }
            if (row.IsDiscovered)
            {
                return('\xf606'); // map-marker-check
            }
            return('\xf60b');     // map-marker-question
        }
Exemple #5
0
        private SystemSummaryRow CreateOrGetRow(BodyData bd)
        {
            var match = this.receiver.SystemRows.FirstOrDefault(r => r.BodyId == bd.BodyId);

            if (match == null)
            {
                match             = new SystemSummaryRow();
                match.Order       = 1000 + bd.BodyId;
                match.BodyId      = bd.BodyId;
                match.Description = bd.Name;

                match.DataOrigin    = Core.DataOrigin.Edsm;
                match.IsPlaceholder = true;
                match.IsDiscovered  = !String.IsNullOrWhiteSpace(bd.DiscoveredBy);

                this.receiver.SystemRows.Add(match);
            }

            match.Description = RestyleName(match.Description);

            return(match);
        }