Exemple #1
0
        private void extButtonFilter_Click(object sender, EventArgs e)
        {
            ExtendedControls.CheckedIconListBoxFormGroup bodyfilter = new CheckedIconListBoxFormGroup();
            bodyfilter.AddAllNone();
            foreach (var x in Enum.GetNames(typeof(EDPlanet)))
            {
                bodyfilter.AddStandardOption(x.ToString(), x.ToString().Replace("_", " "));
            }
            foreach (var x in Enum.GetNames(typeof(EDStar)))
            {
                bodyfilter.AddStandardOption(x.ToString(), Bodies.StarName(x.ParseEnum <EDStar>()));
            }

            // these are filter types for items which are either do not have scandata or are not stars/bodies.  Only Belts/Barycentre are displayed.. scans of rings/beltculsters are not displayed
            bodyfilter.AddStandardOption("star", "Star");
            bodyfilter.AddStandardOption("body", "Body");
            bodyfilter.AddStandardOption("barycentre", "Barycentre");
            bodyfilter.AddStandardOption("belt", "Belt");

            bodyfilter.SaveSettings = (s, o) =>
            {
                bodyfilters = s.Split(';');
                SQLiteDBClass.PutSettingString(DbSave + "BodyFilters", string.Join(";", bodyfilters));
                DrawSystem();
            };

            bodyfilter.Show(string.Join(";", bodyfilters), extButtonFilter, this.FindForm());
        }
Exemple #2
0
 public JournalStartJump(JObject evt) : base(evt, JournalTypeEnum.StartJump)
 {
     JumpType          = evt["JumpType"].Str();
     StarSystem        = evt["StarSystem"].Str();
     StarClass         = evt["StarClass"].Str();
     FriendlyStarClass = (StarClass.Length > 0) ? Bodies.StarName(Bodies.StarStr2Enum(StarClass)) : "";
 }
 public JournalFSDTarget(JObject evt) : base(evt, JournalTypeEnum.FSDTarget)
 {
     StarSystem            = evt["Name"].Str();
     StarClass             = evt["StarClass"].Str();
     SystemAddress         = evt["SystemAddress"].Long();
     RemainingJumpsInRoute = evt["RemainingJumpsInRoute"].IntNull();
     FriendlyStarClass     = (StarClass.Length > 0) ? Bodies.StarName(Bodies.StarStr2Enum(StarClass)) : "";
 }
 public JournalStartJump(JObject evt) : base(evt, JournalTypeEnum.StartJump)
 {
     JumpType          = evt["JumpType"].Str();
     IsHyperspace      = JumpType.Equals("Hyperspace", System.StringComparison.InvariantCultureIgnoreCase);
     StarSystem        = evt["StarSystem"].Str();
     StarClass         = evt["StarClass"].Str();
     FriendlyStarClass = (StarClass.Length > 0) ? Bodies.StarName(Bodies.StarStr2Enum(StarClass)) : "";
     SystemAddress     = evt["SystemAddress"].LongNull();
 }
 public string GetStarTypeName()           // give description to star class
 {
     return(Bodies.StarName(StarTypeID));
 }
        static private string InfoLine(ISystem sys, StarScan.ScanNode sn, JournalScan js, bool volcanism, bool showvalues, bool shortinfo, bool showGravity)
        {
            var information = new StringBuilder();

            if (js.Mapped)
            {
                information.Append("\u2713"); // let the cmdr see that this body is already mapped - this is a check
            }
            string bodyname = js.BodyDesignationOrName.ReplaceIfStartsWith(sys.Name);

            // Name
            information.Append((bodyname) + @" is a ".T(EDTx.UserControlSurveyor_isa));

            // Additional information
            information.Append((js.IsStar) ? Bodies.StarName(js.StarTypeID) + "." : null);
            information.Append((js.CanBeTerraformable) ? @"terraformable ".T(EDTx.UserControlSurveyor_terraformable) : null);
            information.Append((js.IsPlanet) ? Bodies.PlanetTypeName(js.PlanetTypeID) + "." : null);
            information.Append((js.nRadius < lowRadiusLimit && js.IsPlanet) ? @" Is tiny.".T(EDTx.UserControlSurveyor_LowRadius) : null);
            information.Append((js.nRadius > largeRadiusLimit && js.IsPlanet && js.IsLandable) ? @" Is large.".T(EDTx.UserControlSurveyor_LargeRadius) : null);
            information.Append((js.IsLandable) ? @" Is landable.".T(EDTx.UserControlSurveyor_islandable) : null);
            information.Append((js.IsLandable && showGravity && js.nSurfaceGravityG.HasValue) ? @" (" + Math.Round(js.nSurfaceGravityG.Value, 2, MidpointRounding.AwayFromZero) + "g)" : null);
            information.Append((js.HasAtmosphericComposition && js.IsLandable) ? @" Atmosphere: ".T(EDTx.UserControlSurveyor_Atmosphere) + (js.Atmosphere ?? "unknown atmosphere".T(EDTx.UserControlSurveyor_unknownAtmosphere)) + "." : null);
            information.Append((js.HasMeaningfulVolcanism && js.IsLandable | volcanism) ? @" Has ".T(EDTx.UserControlSurveyor_Has) + js.Volcanism + "." : null);
            information.Append((sn.Signals != null) ? " Has signals.".T(EDTx.UserControlSurveyor_Signals) : null);
            information.Append((js.HasRings) ? @" Is ringed.".T(EDTx.UserControlSurveyor_Hasring) : null);
            information.Append((js.nEccentricity >= eccentricityLimit) ? @" Has an high eccentricity of ".T(EDTx.UserControlSurveyor_eccentricity) + js.nEccentricity + "." : null);

            var ev = js.GetEstimatedValues();

            if (js.WasMapped == true && js.WasDiscovered == true)
            {
                information.Append(" (Mapped & Discovered)".T(EDTx.UserControlSurveyor_MandD));
                if (showvalues)
                {
                    information.Append(' ').Append(ev.EstimatedValueMappedEfficiently.ToString("N0")).Append(" cr");
                }
            }
            else if (js.WasMapped == true && js.WasDiscovered == false)
            {
                information.Append(" (Mapped)".T(EDTx.UserControlSurveyor_MP));
                if (showvalues)
                {
                    information.Append(' ').Append(ev.EstimatedValueFirstMappedEfficiently.ToString("N0")).Append(" cr");
                }
            }
            else if (js.WasDiscovered == true && js.WasMapped == false)
            {
                information.Append(" (Discovered)".T(EDTx.UserControlSurveyor_DIS));
                if (showvalues)
                {
                    information.Append(' ').Append(ev.EstimatedValueFirstMappedEfficiently.ToString("N0")).Append(" cr");
                }
            }
            else
            {
                if (showvalues)
                {
                    information.Append(' ').Append((ev.EstimatedValueFirstDiscoveredFirstMappedEfficiently > 0 ? ev.EstimatedValueFirstDiscoveredFirstMappedEfficiently : ev.EstimatedValueBase).ToString("N0")).Append(" cr");
                }
            }

            if (shortinfo)
            {
                information.Append(' ').Append(js.ShortInformation());
            }
            else
            {
                information.Append(' ').Append(js.DistanceFromArrivalText);
            }

            return(information.ToString());
        }