コード例 #1
0
        public void GoToVessel()
        {
            if (FlightGlobals.ActiveVessel != vessel)
            {
                var title = "Warning!";
                var msg   = "Do you really want go to ";
                msg += VesselName.ToString() + "?";
                DialogGUIButton[] buttons;

                if (HighLogic.LoadedSceneIsFlight)
                {
                    buttons = new DialogGUIButton[] {
                        new DialogGUIButton("Go", () => { Utils.JumpToVessel(vessel); }),
                        new DialogGUIButton("Target", () => { Utils.SetVesselAsTarget(vessel); }),
                        new DialogGUIButton("Stay", () => { })
                    };
                }
                else
                {
                    buttons = new DialogGUIButton[] {
                        new DialogGUIButton("Go", () => { Utils.JumpToVessel(vessel); }),
                        new DialogGUIButton("Stay", () => { })
                    };
                }

                PopupDialog.SpawnPopupDialog
                (
                    new Vector2(0.5f, 0.5f),
                    new Vector2(0.5f, 0.5f),
                    new MultiOptionDialog(title, msg, title, HighLogic.UISkin, buttons),
                    false,
                    HighLogic.UISkin
                );
            }
        }
コード例 #2
0
 public override string Format()
 {
     return(string.Format("SOF,{0},{1},{2},{3:F6},{4:F6},{5:F1},{6:F1},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19}",
                          SystemID, Time, VesselName.Replace(',', ';'), Lat, Lon, SOG, COG, MMSI,
                          Classification, CallSign.Replace(',', ';'), TrackID, MainRadar, (int)TrackPlatform,
                          QualityFactor, LackOfDetection, PlotCells, (int)TrackLock, TimeStamp, GID, FID));
 }
コード例 #3
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Waypoint?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DateTime?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Location?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (VesselName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ShippingAgent?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DirectConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TranshipmentConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalEquipments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FullEquipments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EmptyEquipments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TEUSEquipments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RiskDetection?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (From?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (To?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalRisks?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ConveyanceID?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ConveyanceRef?.GetHashCode() ?? 0);
            return(hashCode);
        }
コード例 #4
0
        private List <IBasicModule> AddOrbitModules()
        {
            List <IBasicModule> modules = new List <IBasicModule>();

            vesselName = new VesselName("Vessel Name");
            apo        = new Apoapsis("Apoapsis");
            peri       = new Periapsis("Periapsis");
            inc        = new Inclination("Inclination");
            eqNode     = new TimeToEqNode("Equatorial Node");
            ecc        = new Eccentricity("Eccentricity");
            period     = new Period("Period");
            SMA        = new SemiMajorAxis("Semi Major Axis");
            LAN        = new LongAscending("LAN");
            AoPE       = new ArgOfPeriapsis("Arg of Pe");
            altitude   = new OrbitAltitude("Altitude");
            radar      = new RadarAltitude("Radar Altitude");
            terrain    = new TerrainAltitude("Terrain Height");
            velocity   = new Velocity("Velocity");
            location   = new Location("Location");

            vesselName.IsVisible  = BasicSettings.Instance.showVesselName;
            vesselName.AlwaysShow = BasicSettings.Instance.showVesselNameAlways;
            apo.IsVisible         = BasicSettings.Instance.showApoapsis;
            apo.AlwaysShow        = BasicSettings.Instance.showApoapsisAlways;
            peri.IsVisible        = BasicSettings.Instance.showPeriapsis;
            peri.AlwaysShow       = BasicSettings.Instance.showPeriapsisAlways;
            inc.IsVisible         = BasicSettings.Instance.showInclination;
            inc.AlwaysShow        = BasicSettings.Instance.showInclinationAlways;
            eqNode.IsVisible      = BasicSettings.Instance.showTimeToEqNode;
            eqNode.AlwaysShow     = BasicSettings.Instance.showTimeToEqNodeAlways;
            ecc.IsVisible         = BasicSettings.Instance.showEccentricity;
            ecc.AlwaysShow        = BasicSettings.Instance.showEccentricityAlways;
            period.IsVisible      = BasicSettings.Instance.showPeriod;
            period.AlwaysShow     = BasicSettings.Instance.showPeriodAlways;
            SMA.IsVisible         = BasicSettings.Instance.showSMA;
            SMA.AlwaysShow        = BasicSettings.Instance.showSMAAlways;
            LAN.IsVisible         = BasicSettings.Instance.showLAN;
            LAN.AlwaysShow        = BasicSettings.Instance.showLANAlways;
            AoPE.IsVisible        = BasicSettings.Instance.showAoPe;
            AoPE.AlwaysShow       = BasicSettings.Instance.showAoPeAlways;
            altitude.IsVisible    = BasicSettings.Instance.showOrbitAltitude;
            altitude.AlwaysShow   = BasicSettings.Instance.showOrbitAltitudeAlways;
            radar.IsVisible       = BasicSettings.Instance.showRadar;
            radar.AlwaysShow      = BasicSettings.Instance.showRadarAlways;
            terrain.IsVisible     = BasicSettings.Instance.showTerrain;
            terrain.AlwaysShow    = BasicSettings.Instance.showTerrainAlways;
            velocity.IsVisible    = BasicSettings.Instance.showVelocity;
            velocity.AlwaysShow   = BasicSettings.Instance.showVelocityAlways;
            location.IsVisible    = BasicSettings.Instance.showLocation;
            location.AlwaysShow   = BasicSettings.Instance.showLocationAlways;

            modules.Add(AoPE);
            modules.Add(LAN);
            modules.Add(SMA);
            modules.Add(terrain);
            modules.Add(radar);
            modules.Add(altitude);
            modules.Add(velocity);
            modules.Add(location);
            modules.Add(period);
            modules.Add(ecc);
            modules.Add(eqNode);
            modules.Add(inc);
            modules.Add(peri);
            modules.Add(apo);
            modules.Add(vesselName);

            return(modules);
        }
コード例 #5
0
        public override string ToString()
        {
            string result = Date.ToString().Trim() + " " + VesselName.Trim() + " V." + Name.Trim();

            return(result);
        }