Beispiel #1
0
        public void Update()
        {
            if (Lib.IsFlight())
            {
                Drive drive = DB.Vessel(vessel).drive;

                // if no location was ever specified, set it here
                if (drive.location == 0)
                {
                    drive.location = part.flightID;
                }

                // if this is the location the data is stored
                if (drive.location == part.flightID)
                {
                    // get data size
                    double size = drive.size();

                    // show DATA UI button, with size info
                    Events["ToggleUI"].guiName = Lib.StatusToggle("Data", size > double.Epsilon ? Lib.HumanReadableDataSize(size) : "empty");
                    Events["ToggleUI"].active  = true;

                    // show TakeData eva action button, if there is something to take
                    Events["TakeData"].active = size > double.Epsilon;

                    // show StoreData eva action button, if active vessel is an eva kerbal and there is something to store from it
                    Vessel v = FlightGlobals.ActiveVessel;
                    Events["StoreData"].active = v != null && v.isEVA && !EVA.IsDead(v) && DB.Vessel(v).drive.size() > double.Epsilon;

                    // hide TransferLocation button
                    Events["TransferData"].active = false;
                }
                // if this is not the location the data is stored
                else
                {
                    // hide DATA UI button
                    Events["ToggleUI"].active = false;

                    // hide EVA actions
                    Events["TakeData"].active  = false;
                    Events["StoreData"].active = false;

                    // show TransferData button
                    Events["TransferData"].active = true;
                }
            }
        }
Beispiel #2
0
        // transfer data between two vessels
        public static void transfer(Vessel src, Vessel dst)
        {
            // get drives
            Drive a = DB.Vessel(src).drive;
            Drive b = DB.Vessel(dst).drive;

            // get size of data being transfered
            double amount = a.size();

            // if there is data
            if (amount > double.Epsilon)
            {
                // transfer the data
                a.move(b);

                // inform the user
                Message.Post
                (
                    Lib.BuildString(Lib.HumanReadableDataSize(amount), " of data transfered"),
                    Lib.BuildString("from <b>", src.vesselName, "</b> to <b>", dst.vesselName, "</b>")
                );
            }
        }
Beispiel #3
0
        // transfer data between two vessels
        public static void transfer(Vessel src, Vessel dst)
        {
            // get drives
            Drive a = DB.Vessel(src).drive;
            Drive b = DB.Vessel(dst).drive;

            // get size of data being transfered
            double amount = a.size();

            // if there is data
            if (amount > double.Epsilon)
            {
                // transfer the data
                a.move(b);

                // inform the user
                Message.Post
                (
                    Lib.BuildString(Lib.HumanReadableDataSize(amount), " ", Localizer.Format("#KERBALISM_Science_ofdatatransfer")),
                    Lib.BuildString(Localizer.Format("#KERBALISM_Generic_FROM"), " <b>", src.vesselName, "</b> ", Localizer.Format("#KERBALISM_Generic_TO"), " <b>", dst.vesselName, "</b>")
                );
            }
        }